* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #1f2328;
  --muted: #6b7280;
  --primary: #1e4a76;
  --primary-2: #3a72b0;
  --accent: var(--primary);
  --accent-dark: color-mix(in srgb, var(--primary) 80%, #000);
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; }
.brand-title { font-size: 16px; font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--muted); }

.org-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.org-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.org-tab:hover { border-color: var(--accent); }
.org-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.org-tab .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; background: #9ca3af;
}
.org-tab .dot.on { background: #34d399; }
.org-tab .dot.off { background: #fbbf24; }

.layout {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-actions { display: flex; gap: 8px; }

.org-status { font-size: 12px; color: var(--muted); }
.org-banner {
  display: none;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.org-banner.show { display: block; }

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.form-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 12px;
}

.drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .15s;
  background: #fafbfc;
}
.drop:hover, .drop.dragover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 28px; color: var(--accent); }
.drop-text { font-weight: 500; margin-top: 6px; }
.drop-hint { font-size: 12px; color: var(--muted); }
.drop-files { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.file-chip {
  background: #eef2ff; color: #3730a3;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
}

.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

.conclusion {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 15px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.conclusion.pass { background: #f0fdf4; border-color: #86efac; color: var(--green); }
.conclusion.cond { background: #fffbeb; border-color: #fcd34d; color: var(--amber); }
.conclusion.fail { background: #fef2f2; border-color: #fca5a5; color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  background: #f3f4f6; border-radius: 999px; padding: 4px 12px; font-size: 12px; color: #374151;
}
.chip strong { color: var(--text); }

.sub-title { font-size: 14px; margin: 20px 0 10px; color: var(--text); }

.materials { display: flex; flex-direction: column; gap: 8px; }
.material-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.material-group .name { font-weight: 500; }
.material-group .files { font-size: 12px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.table th { background: #f9fafb; font-weight: 500; }
.table td.status-pass { color: var(--green); }
.table td.status-fail { color: var(--red); }
.table td.status-warn { color: var(--amber); }

.issues { display: flex; flex-direction: column; gap: 8px; }
.issue {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.issue.critical { border-color: #fca5a5; background: #fef2f2; }
.issue.major { border-color: #fcd34d; background: #fffbeb; }
.issue .title { font-weight: 500; }
.issue .detail { font-size: 13px; color: var(--muted); }

.report-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  max-height: 480px;
  overflow: auto;
  background: #fff;
  font-family: "Songti SC", "STSong", "FangSong", serif;
  line-height: 1.8;
  font-size: 14px;
}
.report-preview h1 { font-size: 20px; text-align: center; }
.report-preview h2 { font-size: 16px; border-bottom: 1px solid #eee; padding-bottom: 4px; margin-top: 20px; }
.report-preview table { border-collapse: collapse; width: 100%; font-size: 13px; }
.report-preview th, .report-preview td { border: 1px solid #ddd; padding: 5px 8px; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px;
}

.footer .beian {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
}
.footer .beian a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 8px;
}
.footer .beian a:hover {
  color: var(--primary);
}

.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.auth-view {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 48px 20px;
}

.auth-shell {
  width: 880px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.auth-brand {
  background: #16324f;
  color: #eaf1f8;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
}
.auth-logo { width: 60px; height: 60px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 30px; margin: 0; font-weight: 600; letter-spacing: 6px; }
.auth-rule {
  width: 56px; height: 3px;
  background: #c9a063;
  margin: 10px 0 14px;
  border-radius: 2px;
}
.auth-slogan { margin: 0 0 30px; color: #9fb6cf; font-size: 13px; letter-spacing: .5px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.auth-points li { display: flex; gap: 12px; font-size: 13px; color: #c9d8e6; line-height: 1.6; }
.auth-points strong { color: #fff; font-weight: 500; font-size: 14px; }
.pt-icon {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.auth-foot { margin-top: 28px; font-size: 12px; color: #7d99b5; }

.auth-panel { padding: 44px 40px; display: flex; align-items: center; }
.auth-card { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.auth-title { margin: 0; font-size: 22px; font-weight: 600; }
.auth-sub { margin: -6px 0 8px; font-size: 13px; color: var(--muted); }
.btn.full { width: 100%; padding: 12px 0; font-size: 15px; letter-spacing: 4px; }
.auth-msg { font-size: 13px; color: var(--red); min-height: 18px; }
.auth-msg.ok { color: var(--green); }
.auth-switch { font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 28px; }
  .auth-brand h1 { font-size: 22px; }
  .auth-points { display: none; }
  .auth-foot { display: none; }
  .auth-panel { padding: 28px 24px; }
}

.ledger-row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 12px; }

.dates-input { display: flex; gap: 8px; }
.dates-input input { flex: 1; }
.date-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2ff; color: #3730a3;
  padding: 3px 6px 3px 12px; border-radius: 999px; font-size: 12px;
}
.date-chip button {
  border: none; background: transparent; color: #6366f1;
  cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1;
}
.ledger-field { flex: 1; }
.ledger-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); padding-bottom: 10px; }

.ledger-card {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 16px;
  font-size: 13px;
}
.ledger-card .item { display: flex; flex-direction: column; }
.ledger-card .k { font-size: 11px; color: #3b5b8a; }
.ledger-card .v { font-weight: 600; color: #1e3a5f; }
.ledger-card .v.neg { color: var(--red); }
.ledger-card .head {
  grid-column: 1 / -1;
  font-weight: 600;
  color: #1e3a5f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ledger-card .head .fresh { font-size: 11px; font-weight: 400; color: #3b5b8a; }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
}

/* 数据看板 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f7f9fc;
}
.stat-value { font-size: 22px; font-weight: 700; color: #1e3a5f; }
.stat-unit { font-size: 12px; font-weight: 400; color: #3b5b8a; margin-left: 4px; }
.stat-label { font-size: 12px; color: #3b5b8a; margin-top: 4px; }
.stat-issues { border-top: 1px dashed #dbe4f0; padding-top: 10px; }
.stat-issues-title { font-size: 13px; font-weight: 600; color: #1e3a5f; margin-bottom: 6px; }
.stat-issue-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed #eef2f7;
}
.stat-issue-name { color: #333; }
.stat-issue-count { color: #b91c1c; font-weight: 600; }

/* 验证码输入行 */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }
.code-row .btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 审核进度条 */
.progress-track {
  margin-top: 8px;
  height: 8px;
  background: #e5ebf3;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 4px;
  transition: width 0.35s ease;
}

/* 补正复审对照 */
.resolution { margin: 14px 0 4px; border: 1px solid #d8e2ee; border-radius: 10px; padding: 12px 16px; background: #f7fafd; }
.resolution .rz-head { font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.resolution .rz-note { font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.resolution .rz-group { margin-bottom: 8px; }
.resolution .rz-label { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.resolution .rz-label.ok { color: #15803d; }
.resolution .rz-label.warn { color: #a15c00; }
.resolution .rz-label.bad { color: #b91c1c; }
.resolution .rz-item { font-size: 13px; padding-left: 18px; line-height: 1.7; }
.resolution .rz-item.ok { color: #15803d; }
.resolution .rz-item.warn { color: #a15c00; }
.resolution .rz-item.bad { color: #b91c1c; }
.resolution .rz-item.none { color: #9ca3af; }
.btn.ghost { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn.ghost:hover { background: #eef4fa; }

/* 台账带出的只读字段 */
input[readonly] { background: #f3f6fa; color: #4b5563; border-style: dashed; cursor: not-allowed; }

/* 站点设置（管理后台） */
.sitecfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 6px; }
.sitecfg-grid .field span { font-size: 12px; }
.sitecfg-color { display: flex; align-items: center; gap: 10px; }
.sitecfg-color input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.sitecfg h3.sub-title { margin: 18px 0 8px; }
.matedit-table input { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.matedit-table .mkey { color: var(--muted); font-size: 12px; white-space: nowrap; }
.matedit-table .mscope { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sitecfg-msg { min-height: 20px; font-size: 13px; margin-top: 8px; }
.sitecfg-msg.ok { color: var(--green); }
.sitecfg-msg.err { color: var(--red); }
@media (max-width: 720px) { .sitecfg-grid { grid-template-columns: 1fr; } }

/* 取消审核按钮（审核进行中显示） */
.btn.danger { color: #c0392b; border-color: #e5b4ae; }
.btn.danger:hover { border-color: #c0392b; background: #fdf3f2; }

/* 历史记录全量弹窗（童老师 2026-11-28：主界面只留 5 条 + 更多按钮） */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17, 24, 39, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--bg, #fff); width: 100%; max-width: 1100px; max-height: 88vh;
  border-radius: 12px; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e7eb);
  gap: 12px; flex-wrap: wrap;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head > div { display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 12px 20px 20px; overflow-y: auto; }
.modal-body .table { min-width: 900px; }
