:root {
  --ink: #22302b;
  --ink-soft: #46544e;
  --muted: #748079;
  --paper: #f8f4ec;
  --card: #fffdf8;
  --line: #e5ddcf;
  --line-strong: #d3c8b6;
  --accent: #2f6153;
  --accent-dark: #234b40;
  --accent-soft: #e8f0eb;
  --warm: #b88a5a;
  --warm-soft: #f6ebdd;
  --danger: #a94438;
  --danger-soft: #f9e9e5;
  --warn: #8a6421;
  --warn-soft: #f7efdc;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(34, 48, 43, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.35; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }

.container { width: min(100% - 32px, 760px); margin: 0 auto; }
.container.narrow { width: min(100% - 32px, 620px); }
.center-page { padding: 8vh 0 48px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.92em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 20px 56px;
  background:
    radial-gradient(circle at 82% 12%, rgba(184, 138, 90, 0.18), transparent 44%),
    radial-gradient(circle at 12% 88%, rgba(47, 97, 83, 0.16), transparent 46%),
    linear-gradient(160deg, #fdfbf5 0%, #f2ede2 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner { width: min(100%, 760px); margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.brand-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand-logo {
  width: 54px;
  height: auto;
  flex: none;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(34, 48, 43, 0.16);
}
.brand-lockup-text { flex: 1; min-width: 0; }
.brand-avatar { display: block; width: 46px; height: auto; flex: none; border-radius: 10px; box-shadow: 0 8px 18px rgba(34, 48, 43, 0.14); }
.brand-lockup .eyebrow { margin-bottom: 2px; }
.brand-sub { color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em; }
.hero-portrait { display: none; margin: 0; }
.hero-portrait img {
  display: block;
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(34, 48, 43, 0.18);
}
.hero-portrait figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: right; }
.hero h1 {
  font-size: clamp(30px, 7.4vw, 48px);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.hero-copy { color: var(--ink-soft); max-width: 540px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-meta span {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.6);
}

.progress-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 22px;
  padding: 12px 16px 10px;
  background: rgba(248, 244, 236, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(34, 48, 43, 0.06);
}
.progress-track { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #6e9b86);
  transition: width 0.35s ease;
}
.progress-text { margin-top: 7px; font-size: 12px; color: var(--muted); }

.form-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px 12px;
  margin-bottom: 22px;
  box-shadow: 0 3px 16px rgba(34, 48, 43, 0.03);
}
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.section-letter {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
}
.section-heading h2 { font-size: 20px; font-weight: 600; }
.section-heading p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.question-group { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 6px; }
.question-group h3 { font-size: 15px; color: var(--accent-dark); margin: 12px 0 0; }

.field { padding: 18px 0; border-bottom: 1px solid #efe9de; }
.field:last-child { border-bottom: 0; }
.field.dependent { display: none; }
.field.dependent.is-visible { display: block; }
.field-label { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.required { color: var(--warm); margin-left: 3px; }
.field-help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field-help a { text-decoration: underline; text-underline-offset: 3px; }
.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  background: var(--danger-soft);
  border-radius: 8px;
  padding: 6px 10px;
}

.options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.options-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover { border-color: var(--line-strong); }
.option input { margin-top: 5px; accent-color: var(--accent); flex: none; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.school-item.is-na-locked { opacity: 0.55; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"], textarea, select {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 97, 83, 0.12);
}
textarea { resize: vertical; min-height: 88px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.submit-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 8px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.submit-panel p { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14px;
}
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #edcfc8; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #ead9b4; }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #cfe0d6; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 28px;
  box-shadow: var(--shadow);
}
.result-card h1 { font-size: clamp(26px, 6vw, 36px); margin-bottom: 16px; }
.link-box {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fbf8f1;
  overflow-wrap: anywhere;
}
.link-box span { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; color: var(--ink-soft); }
.result-card .btn { margin-top: 6px; }

.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.login-form .btn { margin-top: 6px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.site-footer p + p { margin-top: 6px; }

.prose-page { padding: 56px 0; }
.prose-page h1 { font-size: 32px; margin-bottom: 18px; }
.prose-page h2 { font-size: 19px; margin: 28px 0 8px; }
.prose-page p { color: var(--ink-soft); margin-bottom: 12px; }
.prose-page .btn { margin-top: 20px; }

/* Report */
.report-shell { width: min(100% - 32px, 780px); margin: 0 auto; padding: 40px 0 64px; }
.report-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.report-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}
.report-logo { width: 44px; height: auto; flex: none; border-radius: 10px; box-shadow: 0 8px 18px rgba(34, 48, 43, 0.12); }
.report-brand-text { flex: 1; min-width: 0; }
.report-brand-text .eyebrow { margin-bottom: 2px; }
.report-teacher-figure { margin: 0; flex: none; text-align: center; }
.report-teacher { display: block; width: 52px; height: auto; border-radius: 10px; }
.report-teacher-figure figcaption { margin-top: 4px; font-size: 11px; color: var(--muted); }
.report-hero h1 { font-size: clamp(26px, 6vw, 38px); margin-bottom: 14px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.report-intro { color: var(--ink-soft); font-size: 15px; padding-top: 16px; border-top: 1px dashed var(--line); }
.print-button { margin-top: 20px; padding: 9px 16px; font-size: 13px; }

.report-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 26px;
  margin-bottom: 18px;
}
.report-section h2 { font-size: 21px; font-weight: 600; margin-bottom: 14px; color: var(--accent-dark); }
.report-content { color: var(--ink-soft); font-size: 15.5px; white-space: pre-wrap; }
.report-section-warm { border-color: #e8d7bd; background: #fffbf3; }

.score-panel {
  margin: 4px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf7ee;
}
.score-panel-head h3 { font-size: 15px; color: var(--accent-dark); }
.score-panel-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.score-grid { display: grid; grid-template-columns: 1fr; gap: 1px; margin-top: 14px; background: var(--line); border-radius: 10px; overflow: hidden; }
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 14px;
  padding: 10px 12px;
  background: #fffdf8;
}
.score-label { font-size: 14px; }
.score-value { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; color: var(--accent-dark); }
.score-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

.cta-block {
  background: linear-gradient(150deg, #f1e6d4, #fbf6ec);
  border: 1px solid #e3d3b9;
  border-radius: 20px;
  padding: 28px 26px;
  margin: 22px 0;
  text-align: center;
}
.cta-block p { color: var(--ink-soft); }
.cta-block .btn { margin-top: 14px; }
.cta-qr { display: block; width: 168px; max-width: 70%; margin: 18px auto 0; border-radius: 12px; }
.cta-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 168px;
  max-width: 70%;
  aspect-ratio: 1;
  margin: 18px auto 0;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--muted);
  font-size: 13px;
}
.cta-qr-placeholder small { font-size: 11px; letter-spacing: 0.14em; color: var(--warm); text-transform: uppercase; }
.cta-wechat { margin-top: 12px; font-size: 13px; color: var(--muted); }

.compliance-block {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-top: 26px;
  background: #f6f1e7;
}
.compliance-block h2 { font-size: 16px; color: var(--ink-soft); margin-bottom: 10px; }
.compliance-block p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

@media (max-width: 639px) {
  .report-brand-text .brand-sub { display: none; }
  .report-brand { gap: 10px; }
}

@media (min-width: 640px) {
  .container { width: min(100% - 48px, 760px); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 200px; gap: 32px; }
  .hero-portrait { display: block; }
  .brand-avatar { display: none; }
  .form-section { padding: 32px 30px 16px; }
  .field { padding: 22px 0; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .submit-panel { flex-direction: row; align-items: center; justify-content: space-between; }
  .submit-panel .btn { flex: none; }
  .options-wrap { grid-template-columns: 1fr 1fr 1fr; }
}

@media print {
  body { background: #fff; }
  .report-hero, .report-section, .cta-block, .compliance-block {
    box-shadow: none;
    break-inside: avoid;
  }
  .print-button, .site-footer a { display: none; }
  .report-shell { width: 100%; padding: 0; }
}
