:root {
  --ink: #173630;
  --muted: #667873;
  --cream: #f3efe3;
  --paper: #fffdf8;
  --white: #fff;
  --green: #1f6657;
  --green-dark: #102f2a;
  --mint: #bde8d7;
  --yellow: #f5c94d;
  --orange: #ef7b4a;
  --red: #b54935;
  --line: #dce5df;
  --shadow: 0 24px 70px rgba(25, 58, 50, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(245, 201, 77, .24), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(189, 232, 215, .42), transparent 28rem),
    var(--cream);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px max(24px, calc((100vw - 1380px) / 2));
  color: var(--white);
  background: rgba(16, 47, 42, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--green-dark);
  background: var(--yellow);
  border-radius: 16px 16px 16px 5px;
  font-weight: 900;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: #c7d8d2; font-size: 11px; }

.header-actions { display: flex; gap: 14px; align-items: center; }
.save-status { color: #c7d8d2; font-size: 12px; }

.ghost-button {
  padding: 8px 14px;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
}

main {
  width: min(1380px, calc(100% - 44px));
  margin: 0 auto;
}

.institution-banner {
  margin-top: 22px;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}

.institution-banner.ok {
  color: var(--green-dark);
  background: rgba(189, 232, 215, .72);
  border: 1px solid rgba(31, 102, 87, .18);
}

.institution-banner.warn {
  color: #8b3425;
  background: #f8d8cd;
  border: 1px solid rgba(181, 73, 53, .18);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 54px;
  align-items: end;
  padding: 74px 0 44px;
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.hero h1 {
  max-width: 840px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7vw, 88px);
  line-height: .96;
  letter-spacing: -.055em;
}

.intro {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  color: inherit;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(25, 58, 50, .13);
}

.button:disabled { cursor: not-allowed; opacity: .42; }
.primary { color: var(--white); background: var(--green); }
.secondary { color: var(--ink); background: transparent; border: 1px solid #b9c8c2; }
.submit { min-width: 220px; color: var(--green-dark); background: var(--yellow); }
.danger { color: var(--red); background: #f8d8cd; }

.system-card {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.system-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 28px;
}

.system-card div + div { border-top: 1px solid rgba(255, 255, 255, .12); }
.system-card strong { color: var(--yellow); font-family: Georgia, serif; font-size: 34px; }
.system-card span { color: #d7e4df; font-weight: 700; }

.panel {
  padding: 30px 34px;
  background: var(--paper);
  border: 1px solid rgba(23, 54, 48, .08);
  border-radius: 26px;
  box-shadow: 0 12px 40px rgba(25, 58, 50, .08);
}

.candidate-panel {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 36px;
  align-items: start;
}

h2, h3 { margin: 0; }
.panel-title h2 { font-size: 28px; }
.panel-title p:last-child { color: var(--muted); line-height: 1.7; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  padding: 12px 2px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  outline: 0;
}

input:focus { border-color: var(--green); }

.exam-summary {
  position: sticky;
  z-index: 20;
  top: 74px;
  display: grid;
  grid-template-columns: 150px 1fr 110px;
  gap: 20px;
  align-items: center;
  margin: 28px 0;
  padding: 12px 18px;
  background: rgba(243, 239, 227, .94);
  border: 1px solid rgba(23, 54, 48, .08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.exam-summary div:not(.progress-track) {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.exam-summary strong { color: var(--ink); }
.progress-track { overflow: hidden; height: 10px; background: #d7dfda; border-radius: 999px; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); border-radius: inherit; transition: width .3s ease; }

.exam-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.page-nav, .answer-panel {
  position: sticky;
  top: 150px;
}

.page-nav {
  padding: 24px;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.page-nav .section-kicker { color: var(--mint); }
.page-nav h2 { margin-bottom: 18px; font-size: 20px; }
.page-nav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.page-chip {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: #dbe7e3;
  background: rgba(255,255,255,.08);
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 900;
}

.page-chip:hover { background: rgba(255,255,255,.14); }
.page-chip.active { color: var(--ink); background: var(--yellow); }
.page-chip.done:not(.active) { color: var(--ink); background: var(--mint); }

.legend { display: grid; gap: 8px; margin-top: 22px; color: #c3d3ce; font-size: 11px; }
.legend span { display: flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.current { background: var(--yellow); }
.dot.done { background: var(--mint); }

.paper-stage { min-width: 0; scroll-margin-top: 150px; }
.stage-toolbar { display: flex; align-items: end; justify-content: space-between; margin: 8px 0 18px; }
.stage-toolbar h2 { font-size: 30px; }
.page-counter { color: var(--muted); font-family: Georgia, serif; font-size: 22px; }

.paper-wrap {
  overflow: hidden;
  padding: 18px;
  background: #e5e1d7;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.paper-wrap img { display: block; width: 100%; border-radius: 8px; }

.answer-panel {
  padding: 24px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(25, 58, 50, .08);
}

.answer-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.answer-heading h2 { font-size: 24px; }
.answer-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.answer-rows { display: grid; gap: 12px; margin-top: 18px; }
.answer-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: #f3f5f1;
  border-radius: 14px;
}

.question-number { color: var(--green); font-weight: 900; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice span {
  display: grid;
  width: 100%;
  height: 36px;
  place-items: center;
  margin: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 900;
  text-transform: lowercase;
  transition: .18s ease;
}

.choice span:hover { border-color: var(--green); transform: translateY(-1px); }
.choice input:checked + span { color: var(--white); background: var(--green); border-color: var(--green); box-shadow: 0 5px 12px rgba(31, 102, 87, .22); }
.choice input:focus-visible + span { outline: 3px solid rgba(245, 201, 77, .65); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

.submit-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin: 48px 0;
  padding: 36px 42px;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.submit-panel .section-kicker { color: var(--yellow); }
.submit-panel h2 { font-family: Georgia, serif; font-size: 32px; }
.submit-panel p:last-child { margin: 10px 0 0; color: #c8d9d3; }

.report {
  margin: 48px 0;
  padding: 44px;
  scroll-margin-top: 150px;
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.report-cover {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.report-cover h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
}

.report-cover p:last-child { color: var(--muted); }

.report-level {
  min-width: 260px;
  padding: 20px;
  color: var(--green-dark);
  background: var(--yellow);
  border-radius: 20px;
}

.report-level span, .report-level strong { display: block; }
.report-level span { font-size: 13px; font-weight: 900; opacity: .75; }
.report-level strong { margin-top: 6px; font-size: 30px; }

.report-grid {
  display: grid;
  grid-template-columns: 1.1fr .8fr 1fr 1.2fr;
  gap: 16px;
  margin-top: 24px;
}

.report-card {
  padding: 22px;
  background: #f5f6f1;
  border: 1px solid rgba(23, 54, 48, .08);
  border-radius: 20px;
}

.report-card h3 { margin-bottom: 16px; font-size: 20px; }

dl { display: grid; gap: 12px; margin: 0; }
dl div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
dt { color: var(--muted); font-size: 13px; font-weight: 800; }
dd { margin: 0; font-weight: 900; }

.score-card { text-align: center; }
.score-ring {
  display: grid;
  width: 142px;
  height: 142px;
  place-content: center;
  margin: 4px auto 14px;
  text-align: center;
  background: var(--mint);
  border: 10px solid #e2f2ec;
  border-radius: 50%;
}

.score-ring strong { font-family: Georgia, serif; font-size: 48px; line-height: .9; }
.score-ring span { margin-top: 7px; color: var(--muted); }

.bar-row + .bar-row { margin-top: 18px; }
.bar-row span, .bar-row strong { display: block; }
.bar-row span { color: var(--muted); font-size: 13px; font-weight: 800; }
.bar-row strong { margin: 6px 0 8px; font-size: 22px; }
.bar-row i {
  display: block;
  overflow: hidden;
  height: 10px;
  background: #d9e0db;
  border-radius: 999px;
}
.bar-row b {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  border-radius: inherit;
}

.muted { color: var(--muted); line-height: 1.7; }
.diagnosis-card { margin-top: 16px; }
.wrong-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wrong-group {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.wrong-group strong, .wrong-group span { display: block; }
.wrong-group span { margin-top: 6px; color: var(--green); font-weight: 900; }
.wrong-group p { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }

.report-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.report-disclaimer {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1380px, calc(100% - 44px));
  margin: 0 auto;
  padding: 30px 0 40px;
  color: var(--muted);
  border-top: 1px solid rgba(23, 54, 48, .16);
  font-size: 12px;
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  color: var(--green);
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .system-card { grid-template-columns: repeat(3, 1fr); }
  .system-card div + div { border-top: 0; border-left: 1px solid rgba(255, 255, 255, .12); }
  .candidate-panel { grid-template-columns: 1fr; }
  .exam-layout { grid-template-columns: 170px minmax(0, 1fr); }
  .answer-panel { position: static; grid-column: 2; }
  .report-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  main, footer { width: min(100% - 24px, 1380px); }
  .site-header { padding: 10px 14px; }
  .save-status { display: none; }
  .hero { gap: 28px; padding: 42px 0; }
  .hero h1 { font-size: 44px; }
  .hero-actions, .submit-panel, .report-cover, .report-actions { flex-direction: column; align-items: stretch; }
  .system-card, .form-grid, .exam-summary, .exam-layout, .report-grid, .wrong-groups { grid-template-columns: 1fr; }
  .system-card div + div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .panel { padding: 24px; }
  .exam-summary { top: 66px; gap: 8px; }
  .page-nav, .answer-panel { position: static; }
  .page-nav-grid { grid-template-columns: repeat(5, 1fr); }
  .answer-panel { grid-column: auto; }
  .paper-wrap { padding: 8px; border-radius: 14px; }
  .submit-panel { padding: 28px; }
  .report { padding: 26px 20px; }
  .report-level { min-width: 0; }
  dl div { grid-template-columns: 1fr; gap: 4px; }
  footer { display: grid; gap: 8px; }
}

@media print {
  @page { margin: 12mm; }
  body { background: white; }
  .site-header, .hero, .candidate-panel, .exam-summary, .exam-layout, .submit-panel, footer { display: none !important; }
  main { width: 100%; }
  .report {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .report-actions { display: none; }
  .report-card { break-inside: avoid; }
}
