:root {
  --navy: #17324d;
  --blue: #2f75b5;
  --blue-soft: #eaf3fb;
  --gold: #f4b942;
  --gold-soft: #fff5d9;
  --green: #257454;
  --green-soft: #e6f3ec;
  --red: #b94242;
  --red-soft: #fbeaea;
  --ink: #17212b;
  --muted: #667482;
  --line: #d4dce3;
  --surface: #ffffff;
  --background: #f3f6f8;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(47, 117, 181, 0.14), transparent 36rem),
    var(--background);
}

button, select, textarea, input { font: inherit; }
button, select { min-height: 42px; }
button { cursor: pointer; }

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 34px clamp(20px, 5vw, 72px);
  color: white;
  background: linear-gradient(120deg, #122c44, #244f74);
  border-bottom: 5px solid var(--gold);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(244, 185, 66, 0.22), transparent 26rem),
    linear-gradient(135deg, #10283d, #28577d);
}
.auth-screen[hidden] { display: none; }
.auth-card {
  width: min(520px, 100%);
  padding: clamp(26px, 5vw, 44px);
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.auth-card h1 { margin: 6px 0 8px; color: var(--navy); }
.auth-card > p { color: var(--muted); }
.eyebrow.dark { color: var(--blue); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form[hidden] { display: none; }
.setup-notice { padding: 12px 14px; border-radius: 9px; color: #694c09; background: var(--gold-soft); line-height: 1.55; }
.auth-help { margin: 20px 0 0; font-size: 13px; line-height: 1.6; }

.app-header h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 46px); letter-spacing: 0.02em; }
.eyebrow { margin: 0; color: #b9d2e6; font-weight: 700; letter-spacing: 0.08em; }
.subtitle { margin: 0; color: #d8e7f2; }

.deadline-card {
  min-width: 220px;
  padding: 18px 22px;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(7, 24, 39, 0.35);
}
.header-actions { display: grid; gap: 9px; min-width: 245px; }
.user-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(7, 24, 39, 0.35); }
.user-card span { font-size: 13px; color: #d8e7f2; }
.user-card button { min-height: 32px; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.4); border-radius: 7px; color: white; background: transparent; }
.deadline-card span, .deadline-card small { display: block; color: #c9dbe9; }
.deadline-card strong { display: block; margin: 5px 0; font-size: 22px; color: white; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 24px auto 64px; }

.offline-banner, .utility-panel, .import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid #bdd6ea;
  border-radius: 12px;
  background: var(--blue-soft);
}
.offline-banner span { color: #43596b; }

.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.view-tabs.five-tabs { grid-template-columns: repeat(5, 1fr); }
.tab-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #41505e;
  background: #fff;
  font-weight: 700;
}
.tab-button.is-active { border-color: var(--blue); color: white; background: var(--blue); }

.view {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(23, 50, 77, 0.08);
}
.view[hidden] { display: none; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-heading h2 { margin: 2px 0 0; font-size: clamp(22px, 3vw, 30px); color: var(--navy); }
.step-label { margin: 0; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: 0.12em; }
.progress-pill { padding: 9px 14px; border-radius: 999px; background: var(--blue-soft); color: var(--navy); font-weight: 700; white-space: nowrap; }
.progress-pill.is-ready { background: var(--green-soft); color: var(--green); }

.control-grid { display: grid; grid-template-columns: minmax(240px, 0.8fr) 1.2fr; gap: 24px; margin-bottom: 24px; }
.field { display: grid; gap: 8px; }
.field > span { color: #3e4d5b; font-weight: 700; }
select, textarea, input[type="text"], input[type="password"], input[type="search"], input:not([type]) {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #bfcbd5;
  border-radius: 9px;
  color: var(--ink);
  background: white;
}
select:focus, textarea:focus, input:focus-visible, button:focus-visible { outline: 3px solid rgba(47, 117, 181, 0.25); outline-offset: 2px; }

.question-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.question-button { border: 1px solid #b9c8d4; border-radius: 9px; background: white; color: var(--navy); font-weight: 800; }
.question-button.is-active { border-color: var(--navy); color: white; background: var(--navy); }

.score-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.score-panel-header { display: flex; justify-content: space-between; gap: 18px; padding: 20px; color: white; background: var(--navy); }
.score-panel-header h3 { margin: 0 0 4px; font-size: 22px; }
.score-panel-header p { margin: 0; color: #c9dbea; }
.score-output { align-self: center; min-width: 105px; padding: 9px 12px; border-radius: 9px; text-align: center; color: #594109; background: var(--gold-soft); font-weight: 800; }
.score-output.is-complete { color: var(--green); background: var(--green-soft); }

.score-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 18px; align-items: center; margin: 0; padding: 15px 20px; border: 0; border-bottom: 1px solid var(--line); }
.score-row:last-child { border-bottom: 0; }
.score-row legend { display: grid; float: left; width: 100%; padding: 0; }
.score-row legend span { font-weight: 800; color: var(--navy); }
.score-row legend small { margin-top: 3px; color: var(--muted); }
.score-options { display: grid; grid-template-columns: repeat(5, 42px); gap: 7px; }
.score-options input { position: absolute; opacity: 0; pointer-events: none; }
.score-options span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #b9c8d4; border-radius: 8px; background: white; font-weight: 800; }
.score-options input:checked + span { border-color: var(--blue); color: white; background: var(--blue); box-shadow: 0 0 0 3px rgba(47, 117, 181, 0.15); }

.risk-panel { display: grid; gap: 18px; margin-top: 22px; padding: 20px; border: 1px solid #ecd698; border-radius: 12px; background: var(--gold-soft); }
.risk-toggle { display: flex; gap: 13px; align-items: flex-start; }
.risk-toggle input { width: 21px; height: 21px; accent-color: var(--red); }
.risk-toggle span { display: grid; gap: 3px; }
.risk-toggle small { color: #6b5a30; }
.full-width { width: 100%; }

.action-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.primary-button, .secondary-button, .ghost-button, .danger-button, .file-button {
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 800;
}
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.primary-button:disabled { cursor: not-allowed; border-color: #aab5be; background: #aab5be; }
.secondary-button { border: 1px solid var(--navy); color: var(--navy); background: white; }
.ghost-button { border: 1px solid var(--line); color: #435260; background: #f7f9fa; }
.danger-button { border: 1px solid #dfaaaa; color: var(--red); background: white; }

.import-panel { align-items: center; }
.import-panel p, .utility-panel p { margin: 4px 0 0; color: var(--muted); }
.file-button { display: inline-grid; place-items: center; min-height: 42px; border: 1px solid var(--navy); color: var(--navy); background: white; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-summary { margin: 10px 0 22px; color: var(--muted); }
.offline-import { margin: 14px 0 22px; padding: 12px 16px; border: 1px dashed #b8c7d2; border-radius: 10px; color: var(--muted); }
.offline-import summary { cursor: pointer; color: var(--navy); font-weight: 700; }
.offline-import-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 13px; }
.offline-import-row span { font-size: 13px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0; }
.summary-card { padding: 18px; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 12px; background: #fff; }
.summary-card.status-需复议 { border-top-color: var(--red); background: #fffafa; }
.summary-card.status-优先候选 { border-top-color: var(--green); background: #f9fdfa; }
.summary-title { display: flex; align-items: center; justify-content: space-between; }
.summary-title h3 { margin: 0; font-size: 25px; color: var(--navy); }
.summary-title span { padding: 5px 9px; border-radius: 999px; color: var(--navy); background: var(--blue-soft); font-size: 12px; font-weight: 800; }
.summary-card dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0 0; }
.summary-card dl div { padding: 10px; border-radius: 8px; background: #f5f7f9; }
.summary-card dt { color: var(--muted); font-size: 12px; }
.summary-card dd { margin: 3px 0 0; color: var(--navy); font-size: 20px; font-weight: 800; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: white; background: var(--navy); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.risk-cell { color: var(--red); background: var(--red-soft); font-weight: 800; }

.decision-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.decision-form { display: grid; gap: 18px; }
.gate-panel { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.gate-panel h3 { margin: 0 0 14px; color: var(--navy); }
.gate-panel label { display: flex; gap: 10px; margin: 12px 0; line-height: 1.45; }
.gate-panel input { flex: 0 0 auto; width: 19px; height: 19px; accent-color: var(--green); }
.decision-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.decision-checks > div { padding: 11px 13px; border-radius: 8px; font-weight: 700; }
.check-ok { color: var(--green); background: var(--green-soft); }
.check-missing { color: #835f0b; background: var(--gold-soft); }
.check-warning { grid-column: 1 / -1; color: var(--red); background: var(--red-soft); }

.section-description { margin: 8px 0 0; max-width: 760px; color: var(--muted); line-height: 1.65; }
.review-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.review-summary { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 16px 0 22px; }
.review-summary-item { display: grid; gap: 4px; padding: 10px; border-radius: 9px; text-align: center; background: var(--blue-soft); }
.review-summary-item span { color: var(--muted); font-size: 12px; }
.review-summary-item strong { color: var(--navy); font-size: 18px; }
.review-list { display: grid; gap: 16px; }
.review-card { overflow: hidden; border: 1px solid var(--line); border-left: 5px solid #9aabb8; border-radius: 12px; background: white; }
.review-card.review-通过 { border-left-color: var(--green); }
.review-card.review-需修改 { border-left-color: var(--red); }
.review-card.review-不适用 { border-left-color: #7e8992; opacity: 0.85; }
.review-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 20px; background: #f8fafb; }
.review-card-heading h3 { margin: 4px 0 0; color: var(--navy); }
.review-meta { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; }
.review-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.review-badges span { padding: 5px 9px; border-radius: 999px; color: var(--navy); background: var(--blue-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.review-badges .blocking-badge { color: var(--red); background: var(--red-soft); }
.review-card-body { display: grid; gap: 12px; padding: 18px 20px; }
.review-card-body ul { margin: 0; padding-left: 22px; line-height: 1.7; }
.attention-box { padding: 11px 13px; border-radius: 8px; color: #6b520e; background: var(--gold-soft); }
.evidence-hint { color: var(--muted); font-size: 13px; }
.review-edit-grid { display: grid; grid-template-columns: 0.55fr 1.25fr 1.25fr; gap: 14px; padding: 18px 20px; border-top: 1px solid var(--line); background: #fbfcfd; }
.review-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }

.account-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 26px; }
.account-form { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.account-form h3, .account-layout h3 { margin: 0 0 8px; color: var(--navy); }
.user-list { display: grid; gap: 10px; }
.user-list-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.user-list-item > div { display: grid; gap: 3px; }
.user-list-item span { color: var(--muted); font-size: 13px; }
.network-note { margin-top: 24px; padding: 18px 20px; border: 1px solid #bdd6ea; border-radius: 12px; background: var(--blue-soft); }
.network-note p { margin: 5px 0 12px; color: #43596b; }
.network-note code { display: block; min-width: 0; padding: 7px 9px; border-radius: 6px; overflow-wrap: anywhere; color: var(--navy); background: white; }
.network-warning { padding: 10px 12px; border-radius: 8px; color: #75520d !important; background: #fff4d6; }
.server-url-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; }
.server-url-row > span { color: #526779; font-size: 0.88rem; font-weight: 700; }
.muted-text { color: var(--muted); }

.utility-panel { margin-top: 20px; border-color: var(--line); background: white; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(440px, calc(100% - 48px)); padding: 14px 18px; border-radius: 10px; color: white; background: var(--green); box-shadow: 0 12px 36px rgba(0,0,0,0.22); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast[data-type="error"] { background: var(--red); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .app-header, .section-heading, .offline-banner, .import-panel, .utility-panel { align-items: stretch; flex-direction: column; }
  .deadline-card { align-self: stretch; }
  .view-tabs, .view-tabs.five-tabs { grid-template-columns: 1fr; }
  .control-grid, .decision-layout, .summary-grid, .review-filters, .account-layout { grid-template-columns: 1fr; }
  .review-summary { grid-template-columns: repeat(2, 1fr); }
  .review-edit-grid { grid-template-columns: 1fr; }
  .review-card-heading, .review-card-footer { align-items: stretch; flex-direction: column; }
  .score-row { grid-template-columns: 1fr; }
  .score-options { grid-template-columns: repeat(5, minmax(42px, 1fr)); }
  .score-options span { width: 100%; }
  .decision-checks { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .app-header { color: var(--ink); background: white; border-bottom: 2px solid var(--navy); }
  .app-header .eyebrow, .app-header .subtitle, .deadline-card span, .deadline-card small { color: var(--ink); }
  .app-header strong { color: var(--ink); }
  .offline-banner, .view-tabs, #view-score, #view-team, .utility-panel, .action-row { display: none !important; }
  #view-decision { display: block !important; box-shadow: none; border: 0; padding: 0; }
  .page-shell { width: 100%; margin: 16px 0; }
}
