:root {
  --navy: #1f3864;
  --navy-2: #2b4a7d;
  --blue: #338eff;
  --bg: #f5f7fb;
  --line: #e3e8f0;
  --text: #1f2937;
  --muted: #6b7280;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(100deg, var(--navy), var(--navy-2));
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.sub { margin: 3px 0 0; font-size: 12px; opacity: .82; }

.status {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12);
  padding: 7px 13px; border-radius: 20px; font-size: 12.5px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; display: inline-block; }
.status.ok .dot { background: #4ade80; }
.status.err .dot { background: #f87171; }

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1.05fr);
  gap: 18px;
  padding: 18px 24px 40px;
  align-items: start;
}
@media (max-width: 1080px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card h2 {
  font-size: 14px; margin: 4px 0 12px; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.card h2::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--blue);
}
.card > h2:not(:first-child) { margin-top: 22px; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
input[type="date"], input[type="text"] {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 13px; color: var(--text); background: #fff; font-family: inherit;
}
input[type="text"] { width: 92px; }
.tilde { color: var(--muted); }

.hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 10px 0 0; }
.hint code { background: #f1f4f9; padding: 1px 5px; border-radius: 4px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.modes { display: flex; flex-direction: column; gap: 8px; }
.mode {
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 12.5px; color: var(--muted); line-height: 1.65; cursor: pointer;
}
.mode:has(input:checked) { border-color: #b9cdf0; background: #f7faff; color: var(--text); }
.mode input { margin-top: 3px; }
.mode b { color: var(--navy); }
.filter { display: flex; flex-direction: column; gap: 5px; }
.filter span { font-size: 12px; color: var(--muted); }
.filter input { width: 100%; }

.board-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-line a { color: var(--blue); text-decoration: none; font-size: 13px; }
.board-line a:hover { text-decoration: underline; }
.tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 10px;
  background: #eef4ff; color: var(--navy-2); border: 1px solid #dbe7ff;
}

/* 登录状态 / 二维码 */
.login-ok {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 9px; padding: 10px 12px; font-size: 13px;
}
.okdot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; flex: none; }
.qr-wrap {
  display: grid; place-items: center; margin: 10px 0 0;
  padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: #fff;
}
.qr-wrap img { width: 160px; height: 160px; display: block; image-rendering: pixelated; }
.qr-wrap img:not([src]) { visibility: hidden; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

.btn {
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  padding: 9px 16px; font-size: 13.5px; font-family: inherit;
  transition: .15s ease; text-decoration: none; display: inline-block;
}
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(51,142,255,.3); }
.btn.primary:hover { background: #1f7bf0; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn.ghost:hover { border-color: #b9cdf0; background: #f7faff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.actions { margin-top: 18px; }
.actions .btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }

.log {
  background: #0f172a; color: #cbd5e1; border-radius: 10px;
  padding: 12px 14px; font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12.2px; line-height: 1.8; height: 260px; overflow: auto;
}
.log .t { color: #64748b; margin-right: 8px; }
.log .err { color: #fca5a5; }
.log .ok { color: #86efac; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kpi b { display: block; font-size: 20px; color: var(--navy); }
.kpi.wide b { font-size: 13.5px; line-height: 1.5; }
.kpi span { font-size: 12px; color: var(--muted); }

.download-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.file-line { color: var(--muted); font-size: 12px; word-break: break-all; }

details { margin-top: 8px; }
summary { cursor: pointer; color: var(--navy); font-size: 13px; }
.preview-wrap { overflow: auto; max-height: 260px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; }
th { background: #f1f5fb; position: sticky; top: 0; color: var(--navy); font-weight: 600; }

.reports { list-style: none; padding: 0; margin: 4px 0 0; }
.reports li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.reports li:last-child { border-bottom: none; }
.reports a { color: var(--blue); text-decoration: none; }
.reports a:hover { text-decoration: underline; }
.reports .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: grid; place-items: center; z-index: 50;
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: #fff; border-radius: 14px; padding: 26px 34px; text-align: center;
  box-shadow: 0 12px 40px rgba(15,23,42,.25); max-width: 420px;
}
.overlay-card h3 { margin: 14px 0 6px; font-size: 16px; color: var(--navy); }
.overlay-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto; border-radius: 50%;
  border: 3px solid #dbe7ff; border-top-color: var(--blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
