:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65726d;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #ded9cd;
  --teal: #146f68;
  --teal-deep: #0b4d49;
  --teal-pale: #dcece8;
  --amber: #c57a17;
  --amber-pale: #fff0d2;
  --red: #af3d33;
  --red-pale: #fae4df;
  --blue-pale: #e5edf4;
  --shadow: 0 18px 50px rgba(30, 43, 39, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(20, 111, 104, 0.09), transparent 30rem),
    var(--paper);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid rgba(222, 217, 205, 0.8);
  background: rgba(244, 241, 233, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong { display: block; font-size: 18px; letter-spacing: 0.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--teal-deep);
  box-shadow: 0 8px 18px rgba(11, 77, 73, 0.2);
  font-family: serif;
  font-size: 21px;
}

.account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; padding: 7px 10px; color: var(--teal-deep); background: transparent; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

.page-shell { width: min(1460px, calc(100% - 36px)); margin: 0 auto; padding: 48px 0 32px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 16px; font-size: clamp(34px, 5vw, 66px); line-height: 1.06; letter-spacing: -0.045em; }
.hero-copy { max-width: 800px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }

.evidence-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(20, 111, 104, 0.22);
  border-radius: 20px;
  background: var(--teal-pale);
}
.evidence-card strong { display: block; margin-bottom: 6px; }
.evidence-card p { margin: 0; color: #42635d; font-size: 13px; line-height: 1.65; }
.pulse-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 7px rgba(20,111,104,.12); }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.summary-card { min-height: 124px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(30,43,39,.04); }
.summary-card .summary-label { color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin: 8px 0 5px; font-size: 32px; line-height: 1; }
.summary-card small { color: var(--muted); line-height: 1.5; }
.summary-card.alert { border-color: rgba(175,61,51,.2); background: linear-gradient(135deg, var(--surface), var(--red-pale)); }
.summary-card.candidate { border-color: rgba(197,122,23,.2); background: linear-gradient(135deg, var(--surface), var(--amber-pale)); }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.workspace-heading h2 { margin-bottom: 0; font-size: 24px; }
.filter-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #ece8de; }
.filter-tab { border: 0; padding: 9px 13px; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; }
.filter-tab.active { color: var(--teal-deep); background: var(--surface); box-shadow: 0 3px 10px rgba(30,43,39,.08); }

.workspace-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 680px; }
.queue-panel { border-right: 1px solid var(--line); background: #faf8f2; }
.queue { display: flex; max-height: 760px; overflow: auto; flex-direction: column; gap: 10px; padding: 14px; }
.queue-empty { padding: 52px 22px; color: var(--muted); text-align: center; line-height: 1.7; }

.queue-item { width: 100%; border: 1px solid transparent; padding: 14px; border-radius: 15px; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.queue-item:hover { border-color: var(--line); background: var(--surface); }
.queue-item.active { border-color: rgba(20,111,104,.35); background: var(--teal-pale); }
.queue-item-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.queue-item strong { font-size: 14px; }
.queue-item p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.status-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-badge.report_ready { color: #7b211c; background: var(--red-pale); }
.status-badge.awaiting_confirmation { color: #89500c; background: var(--amber-pale); }
.status-badge.processing { color: #315c72; background: var(--blue-pale); }
.status-badge.independent_audit, .status-badge.reviewed_no_report, .status-badge.deferred, .status-badge.no_output { color: #5f6965; background: #ebece8; }

.detail-panel { min-width: 0; padding: clamp(20px, 3vw, 36px); }
.empty-state { display: grid; min-height: 560px; place-content: center; color: var(--muted); text-align: center; }
.empty-state h3 { margin-bottom: 8px; color: var(--ink); }
.empty-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-size: 22px; }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin-bottom: 6px; font-size: 28px; }
.detail-header p { margin: 0; color: var(--muted); font-size: 13px; }
.review-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; color: white; background: var(--teal); text-decoration: none; font-size: 12px; font-weight: 700; }
.review-link:hover { background: var(--teal-deep); }

.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.fact-card { padding: 18px; border-radius: 16px; border: 1px solid var(--line); }
.fact-card h3 { margin-bottom: 5px; font-size: 15px; }
.fact-card > p { margin-bottom: 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.fact-card.machine { border-color: #ead3a8; background: #fffbf2; }
.fact-card.human { border-color: #e9c5bf; background: #fff9f7; }
.anomaly-list { display: flex; flex-direction: column; gap: 9px; }
.anomaly { padding: 12px; border-radius: 11px; background: rgba(255,255,255,.72); }
.anomaly-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.anomaly strong { font-size: 13px; }
.anomaly span { color: var(--muted); font-size: 11px; }
.anomaly p { margin: 0; color: #4f5d58; font-size: 12px; line-height: 1.55; }
.small-empty { padding: 16px 0; color: var(--muted); font-size: 12px; }

.review-editor { margin: 4px 0 22px; padding: 20px; border: 1px solid rgba(20,111,104,.24); border-radius: 17px; background: #f4fbf8; }
.review-editor-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.review-editor-heading h3 { margin: 0; font-size: 18px; }
.review-editor-heading > span { padding: 5px 9px; border-radius: 999px; color: var(--teal-deep); background: var(--teal-pale); font-size: 11px; font-weight: 800; }
.candidate-review { margin-top: 10px; padding: 14px; border: 1px solid #dce8e3; border-radius: 13px; background: rgba(255,255,255,.8); }
.candidate-review > p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.decision-group { display: flex; flex-wrap: wrap; gap: 7px; }
.decision-button { border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; color: var(--muted); background: white; cursor: pointer; font-size: 11px; }
.decision-button:hover { border-color: var(--teal); }
.decision-button.selected { border-color: var(--teal); color: white; background: var(--teal); }
.description-field, .note-field { display: grid; gap: 7px; margin-top: 12px; color: #52605b; font-size: 11px; font-weight: 700; }
.description-field textarea, .note-field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--ink); background: white; font: inherit; font-weight: 400; line-height: 1.55; outline: none; }
.description-field textarea:focus, .note-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,111,104,.1); }
.description-field textarea:disabled { color: #929b97; background: #eeeee9; }
.review-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.secondary-button { min-height: 42px; border: 1px solid var(--teal); border-radius: 9px; padding: 0 14px; color: var(--teal-deep); background: white; cursor: pointer; font-weight: 700; }
.primary-button.compact { min-height: 42px; padding: 0 14px; }
.secondary-button:disabled, .primary-button:disabled { cursor: wait; opacity: .55; }
.review-footnote { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: right; }
.review-readonly { margin: 4px 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #f4f3ee; font-size: 12px; }

.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 0 0 22px; }
.photo { overflow: hidden; aspect-ratio: 4 / 3; border-radius: 12px; background: #e8e5dd; }
.photo img { width: 100%; height: 100%; display: block; object-fit: cover; }

.report-sheet { position: relative; overflow: hidden; padding: clamp(22px, 4vw, 38px); border: 1px solid #d8d2c5; border-radius: 18px; background: #fffefa; box-shadow: inset 0 0 0 7px #f7f3e9; }
.report-watermark { position: absolute; top: 20px; right: -38px; width: 170px; padding: 6px 0; transform: rotate(35deg); color: #7b211c; background: var(--red-pale); font-size: 10px; font-weight: 800; text-align: center; letter-spacing: .08em; }
.report-sheet h3 { margin-bottom: 8px; font-family: Georgia, "Songti SC", serif; font-size: 26px; }
.report-meta { margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.report-notice { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.65; }
.report-blocked { padding: 26px; border: 1px dashed #cfc8bb; border-radius: 16px; background: #faf8f2; }
.report-blocked h3 { margin-bottom: 8px; }
.report-blocked p { margin: 0; color: var(--muted); line-height: 1.65; }

.footer { display: flex; justify-content: space-between; width: min(1460px, calc(100% - 36px)); margin: 0 auto; padding: 0 0 32px; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 360px; padding: 12px 16px; border-radius: 11px; color: white; background: var(--teal-deep); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .2s ease; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateY(0); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-shell { display: grid; width: min(980px, 100%); grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.login-intro { padding: clamp(34px, 6vw, 72px); color: white; background: linear-gradient(145deg, #0a4744, #14786f); }
.login-intro .brand-mark { margin-bottom: 52px; color: var(--teal-deep); background: white; }
.login-intro .eyebrow { color: #a9ddd5; }
.login-intro h1 { font-size: clamp(34px, 5vw, 54px); }
.login-intro > p { color: #d0e8e4; line-height: 1.75; }
.trust-list { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; color: #d0e8e4; font-size: 13px; }
.trust-list li::before { content: "✓"; margin-right: 9px; color: #92d4c9; font-weight: 900; }
.login-card { align-self: center; padding: clamp(30px, 5vw, 54px); }
.login-card h2 { margin-bottom: 8px; font-size: 28px; }
.muted, .privacy-note { color: var(--muted); }
.login-card form { display: grid; gap: 18px; margin-top: 28px; }
.login-card label { display: grid; gap: 8px; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; color: var(--ink); background: white; outline: none; }
.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,111,104,.12); }
.primary-button { min-height: 48px; border: 0; border-radius: 10px; color: white; background: var(--teal); cursor: pointer; font-weight: 750; }
.primary-button:hover { background: var(--teal-deep); }
.privacy-note { margin: 18px 0 0; font-size: 11px; line-height: 1.6; }
.login-error { margin: 18px 0 -8px; padding: 11px 13px; border-radius: 9px; color: #7b211c; background: var(--red-pale); font-size: 12px; }

@media (max-width: 980px) {
  .hero, .login-shell { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 310px minmax(0, 1fr); }
  .fact-grid { grid-template-columns: 1fr; }
  .login-intro { display: none; }
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 22px, 1460px); padding-top: 28px; }
  .hero { gap: 18px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .workspace-heading { align-items: stretch; flex-direction: column; }
  .filter-tabs { overflow-x: auto; }
  .workspace-grid { display: block; }
  .queue-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .queue { max-height: 300px; }
  .detail-panel { min-height: 520px; }
  .detail-header { flex-direction: column; }
  .footer { width: calc(100% - 22px); }
}
