:root {
  --ink: #17243a;
  --ink-2: #46546a;
  --paper: #f6f1e8;
  --paper-2: #fffdf8;
  --navy: #16385f;
  --navy-2: #24527f;
  --red: #b94a3d;
  --jade: #3a776c;
  --gold: #caa45d;
  --line: rgba(23, 36, 58, .14);
  --shadow: 0 24px 70px rgba(28, 42, 60, .13);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(202, 164, 93, .16), transparent 27rem),
    radial-gradient(circle at 88% 8%, rgba(58, 119, 108, .11), transparent 25rem),
    var(--paper);
}

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header, .site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header { min-height: 86px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 12px 12px 4px 12px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  box-shadow: 5px 5px 0 rgba(185, 74, 61, .2);
}
.brand b, .brand small { display: block; }
.brand b { font-family: "STKaiti", "KaiTi", serif; font-size: 24px; letter-spacing: .12em; }
.brand small { margin-top: 1px; color: var(--ink-2); font-size: 11px; letter-spacing: .12em; }
.header-note { color: var(--ink-2); font-size: 13px; letter-spacing: .08em; }

#app { width: min(1180px, calc(100% - 40px)); margin: 22px auto 70px; }
.site-footer {
  min-height: 78px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}
.site-footer a { text-underline-offset: 4px; }

.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 42px;
  align-items: center;
  padding: 48px 0;
}
.eyebrow { color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.hero h1 {
  margin: 20px 0 24px;
  max-width: 820px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(52px, 7vw, 96px);
  line-height: .98;
  letter-spacing: -.04em;
  font-weight: 800;
}
.hero h1 em { color: var(--red); font-style: normal; }
.hero-lede { max-width: 720px; font-size: 20px; line-height: 1.85; color: var(--ink-2); }
.hero-actions { display: flex; gap: 14px; align-items: center; margin-top: 34px; flex-wrap: wrap; }
.btn {
  border: 0;
  border-radius: 999px;
  min-height: 50px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: var(--navy); box-shadow: 0 12px 25px rgba(22, 56, 95, .22); }
.btn-primary:hover { background: var(--navy-2); }
.btn-secondary { color: var(--navy); background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.btn-danger { color: #fff; background: var(--red); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.hero-meta { font-size: 13px; color: var(--ink-2); }

.seal-panel { position: relative; aspect-ratio: .82; min-height: 470px; }
.seal-card {
  height: 100%;
  padding: 34px;
  border-radius: 46% 46% 18px 18px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.seal-card::before {
  content: "语";
  position: absolute;
  top: 42px;
  right: 34px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 220px;
  line-height: 1;
  color: rgba(255,255,255,.055);
}
.seal-card .number { color: var(--gold); font-family: Georgia, serif; font-size: 66px; line-height: 1; }
.seal-card h2 { margin: 12px 0; font-family: "STKaiti", "KaiTi", serif; font-size: 34px; }
.seal-card p { margin: 0; color: rgba(255,255,255,.7); line-height: 1.8; }
.section-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; }
.section-mini-grid span { padding: 12px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; font-size: 12px; text-align: center; }

.panel {
  max-width: 900px;
  margin: 34px auto;
  padding: clamp(26px, 5vw, 56px);
  background: rgba(255, 253, 248, .92);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-wide { max-width: 1080px; }
.step-kicker { display: flex; align-items: center; gap: 12px; color: var(--red); font-weight: 800; letter-spacing: .16em; font-size: 12px; }
.step-kicker::before { content: ""; width: 34px; height: 2px; background: var(--red); }
.panel h1, .panel h2 { font-family: "STKaiti", "KaiTi", serif; }
.panel h1 { margin: 12px 0 10px; font-size: clamp(34px, 5vw, 54px); }
.panel h2 { font-size: 28px; }
.panel .lede { color: var(--ink-2); line-height: 1.8; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin: 32px 0; }
.field { display: grid; gap: 9px; }
.field-full { grid-column: 1 / -1; }
.field label, .field legend { font-size: 14px; font-weight: 800; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 4px rgba(36, 82, 127, .1); }
.segmented { display: flex; flex-wrap: wrap; gap: 10px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; min-width: 88px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); text-align: center; background: #fff; }
.segmented input:checked + span { color: #fff; background: var(--navy); border-color: var(--navy); }
.consent { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); }
.form-actions { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.error { min-height: 20px; margin: 10px 0; color: var(--red); font-size: 13px; }

.brief-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 30px 0; }
.brief-card { padding: 18px; min-height: 145px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.brief-card b { display: block; margin-bottom: 9px; font-size: 15px; }
.brief-card span { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.brief-card:nth-child(1) b { color: var(--navy); }
.brief-card:nth-child(2) b { color: var(--red); }
.brief-card:nth-child(3) b { color: var(--jade); }
.brief-card:nth-child(4) b { color: #8d6726; }
.notice { padding: 16px 18px; border-left: 4px solid var(--gold); background: rgba(202, 164, 93, .1); border-radius: 0 12px 12px 0; color: var(--ink-2); line-height: 1.7; font-size: 14px; }

.test-shell { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.test-sidebar, .question-card { background: rgba(255,253,248,.95); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow); }
.test-sidebar { position: sticky; top: 16px; padding: 22px; border-radius: 18px; }
.timer-label { color: var(--ink-2); font-size: 12px; letter-spacing: .12em; }
.timer { margin: 4px 0 20px; font: 700 36px/1 Georgia, serif; color: var(--navy); }
.timer.urgent { color: var(--red); }
.progress-line { height: 7px; background: rgba(22,56,95,.1); border-radius: 99px; overflow: hidden; }
.progress-line span { display: block; height: 100%; background: var(--red); border-radius: inherit; transition: width .25s ease; }
.question-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.q-dot { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-2); }
.q-dot.answered { color: #fff; background: var(--jade); border-color: var(--jade); }
.q-dot.current { outline: 3px solid rgba(185,74,61,.2); border-color: var(--red); }
.sidebar-legend { display: grid; gap: 8px; color: var(--ink-2); font-size: 12px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 3px; background: var(--jade); }

.question-card { min-height: 610px; padding: clamp(24px, 5vw, 52px); border-radius: 22px; }
.question-topline { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); font-size: 13px; }
.section-tag { color: var(--red); font-weight: 800; }
.question-card h1 { margin: 30px 0 26px; font-size: clamp(23px, 3.1vw, 34px); font-family: "STKaiti", "KaiTi", serif; line-height: 1.5; }
.option-list { display: grid; gap: 12px; }
.option { display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: left; line-height: 1.65; color: var(--ink); }
.option:hover { border-color: var(--navy-2); }
.option.selected { color: #fff; background: var(--navy); border-color: var(--navy); }
.option-code { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(22,56,95,.08); font-weight: 800; }
.option.selected .option-code { background: rgba(255,255,255,.16); }
.answer-input { min-height: 58px; font-size: 18px; }
.writing-input { min-height: 220px; resize: vertical; line-height: 1.8; }
.char-count { margin-top: 8px; text-align: right; color: var(--ink-2); font-size: 12px; }
.question-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.question-actions .right { display: flex; gap: 10px; }

.phone-lock { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 24px; color: #fff; background: var(--jade); font-size: 34px; }
.privacy-list { display: grid; gap: 10px; margin: 24px 0; padding: 0; list-style: none; color: var(--ink-2); }
.privacy-list li::before { content: "✓"; margin-right: 10px; color: var(--jade); font-weight: 900; }

.report-head { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.report-title { margin: 7px 0 !important; }
.score-orb { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--navy); box-shadow: inset 0 0 0 10px rgba(255,255,255,.08), 0 14px 35px rgba(22,56,95,.24); }
.score-orb b { font: 700 50px/1 Georgia, serif; }
.score-orb small { display: block; text-align: center; color: rgba(255,255,255,.75); margin-top: 5px; }
.sharp-line { margin: 28px 0; padding: 20px 22px; border-left: 5px solid var(--red); background: rgba(185,74,61,.07); font-size: 18px; font-weight: 700; line-height: 1.8; }
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.score-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.score-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.score-card-head b:last-child { font-family: Georgia, serif; font-size: 22px; }
.bar { height: 8px; margin: 13px 0 10px; border-radius: 99px; background: rgba(22,56,95,.1); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--jade); }
.score-card small { color: var(--ink-2); }
.report-section { margin-top: 34px; }
.report-section h2 { margin-bottom: 14px; }
.report-copy { color: var(--ink-2); font-size: 16px; line-height: 1.9; }
.action-list { display: grid; gap: 12px; padding: 0; list-style: none; counter-reset: action; }
.action-list li { counter-increment: action; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 14px; line-height: 1.7; }
.action-list li::before { content: counter(action); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-weight: 900; }
.report-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.loading { min-height: 440px; display: grid; place-items: center; text-align: center; }
.loading-mark { width: 72px; height: 72px; margin: 0 auto 20px; border: 4px solid rgba(22,56,95,.12); border-top-color: var(--navy); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-body { padding-bottom: 70px; }
.admin-wrap { width: min(1180px, calc(100% - 40px)); margin: 20px auto; }
.admin-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 30px 0; }
.admin-head h1 { margin: 0; font: 800 clamp(38px, 5vw, 64px)/1.05 "STKaiti", "KaiTi", serif; }
.admin-head p { margin: 8px 0 0; color: var(--ink-2); }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.metric { padding: 20px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; }
.metric span { color: var(--ink-2); font-size: 12px; }
.metric b { display: block; margin-top: 12px; font: 700 31px/1 Georgia, serif; }
.admin-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; margin-top: 18px; }
.admin-card { padding: 24px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px; }
.admin-card h2 { margin: 0 0 18px; font: 800 25px/1.2 "STKaiti", "KaiTi", serif; }
.stat-row { display: grid; grid-template-columns: 110px 1fr 52px; gap: 12px; align-items: center; margin: 14px 0; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-2); font-weight: 700; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--jade); background: rgba(58,119,108,.1); font-size: 11px; font-weight: 800; }
.admin-warning { margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; color: #7c5316; background: rgba(202,164,93,.17); font-size: 13px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .seal-panel { aspect-ratio: auto; min-height: 420px; }
  .brief-grid { grid-template-columns: repeat(2, 1fr); }
  .test-shell { grid-template-columns: 1fr; }
  .test-sidebar { position: static; }
  .sidebar-legend { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header, .site-footer, #app, .admin-wrap { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 72px; }
  .header-note { display: none; }
  .hero { min-height: auto; padding-top: 20px; }
  .hero h1 { font-size: 51px; }
  .hero-lede { font-size: 17px; }
  .panel { padding: 24px 18px; }
  .form-grid, .score-grid, .report-head { grid-template-columns: 1fr; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-card { min-height: 0; }
  .score-orb { width: 126px; height: 126px; }
  .question-card { min-height: 0; padding: 24px 18px; }
  .question-topline { flex-direction: column; }
  .question-map { grid-template-columns: repeat(7, 1fr); }
  .q-dot { border-radius: 7px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .admin-head { align-items: start; flex-direction: column; }
}

@media print {
  body { background: #fff; }
  .paper-noise, .site-header, .site-footer, .report-actions { display: none !important; }
  #app { width: 100%; margin: 0; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  .score-card, .action-list li { break-inside: avoid; }
}
