* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f1f5f9; color: #1e293b; line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* 顶部导航 */
.nav {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.nav .brand { font-weight: 700; font-size: 16px; color: #1e293b; }
.nav .user-area { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.nav .user-area .quota { color: #64748b; }
.btn {
  padding: 8px 16px; border-radius: 6px; border: 1px solid #cbd5e1;
  background: #fff; color: #1e293b; font-size: 14px; transition: all .15s;
}
.btn:hover { background: #f8fafc; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #fff; border-color: #fecaca; color: #dc2626; }
.btn-danger:hover { background: #fef2f2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 登录页 */
.login-wrap {
  max-width: 400px; margin: 80px auto; background: #fff;
  padding: 32px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.login-wrap h1 { font-size: 20px; margin-bottom: 4px; }
.login-wrap .sub { color: #64748b; font-size: 13px; margin-bottom: 24px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs button {
  flex: 1; padding: 8px; background: #f1f5f9; border: none; border-radius: 6px;
  font-size: 14px; color: #64748b;
}
.tabs button.active { background: #2563eb; color: #fff; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.field textarea { resize: vertical; min-height: 170px; height: 170px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #2563eb;
}

/* 主布局 */
.container { max-width: 1200px; margin: 24px auto; padding: 0 24px; }
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; }
.card {
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { font-size: 16px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }

/* 分辨率选择 */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 8px; border: 1px solid #cbd5e1; background: #fff;
  border-radius: 6px; font-size: 13px; color: #475569;
}
.seg button.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 上传 */
.drop {
  border: 2px dashed #cbd5e1; border-radius: 8px; padding: 20px;
  text-align: center; color: #64748b; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.drop:hover { border-color: #2563eb; color: #2563eb; }
.drop img { max-width: 100%; max-height: 160px; margin-top: 8px; border-radius: 4px; }

/* 结果区 */
.result-empty {
  border: 2px dashed #e2e8f0; border-radius: 10px; min-height: 720px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 14px;
}
.result-img {
  border: 2px dashed #e2e8f0; border-radius: 10px; min-height: 720px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; background: #fafbfc;
}
.result-img img {
  max-width: 100%;
  max-height: 680px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.result-meta { margin-top: 12px; font-size: 13px; color: #64748b; display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f8fafc; color: #475569; font-weight: 600; }
tr:hover td { background: #f8fafc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-ok { background: #dcfce7; color: #166534; }
.tag-fail { background: #fee2e2; color: #991b1b; }
.tag-admin { background: #fef3c7; color: #92400e; }
.tag-user { background: #e0e7ff; color: #3730a3; }

/* toast */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 6px; color: #fff; font-size: 14px;
  z-index: 100; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.err { background: #dc2626; }
.toast.ok { background: #16a34a; }

/* loading */
.loading { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff;
  border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* admin tabs */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; }
.admin-tabs button {
  padding: 10px 20px; background: none; border: none; font-size: 14px;
  color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.admin-tabs button.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mono { font-family: Consolas, monospace; font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

/* 审批状态标签与按钮 */
.tag-warn { background:#fef3c7; color:#b45309; padding:2px 8px; border-radius:10px; font-size:12px; }
.btn-warn { background:#f59e0b; color:#fff; border:1px solid #f59e0b; }
.btn-warn:hover { background:#d97706; }
