:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --text: #1f2824;
  --muted: #66706b;
  --line: #dfe4df;
  --accent: #315c4c;
  --accent-soft: #e7f0eb;
  --danger: #a63d40;
  --shadow: 0 14px 36px rgba(33, 53, 44, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

button, input { font: inherit; }
a { color: var(--accent); }

.shell {
  width: min(100% - 32px, 980px);
  margin-inline: auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
}

.local-badge {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 650;
}

main { padding: 42px 0 24px; }

.panel {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow,
.question-kicker,
.progress-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(30px, 5vw, 48px); line-height: 1.18; }
h2 { margin-bottom: 8px; line-height: 1.3; }
.lede { max-width: 720px; color: var(--muted); font-size: 18px; }

.notice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0;
}

.notice-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbf9;
}

.notice-grid h2 { font-size: 16px; }
.notice-grid p { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.start-row, .button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button, .button-link {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

button:focus-visible, .button-link:focus-visible, input:focus-visible + label {
  outline: 3px solid rgba(49, 92, 76, 0.25);
  outline-offset: 2px;
}

.primary-button { color: #fff; background: var(--accent); }
.secondary-button { color: var(--text); border-color: var(--line); background: #fff; }
.danger-button { color: var(--danger); border-color: #edc8c9; background: #fff7f7; }
.text-button { min-height: auto; padding: 6px 0; color: var(--accent); background: transparent; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.source-note { margin-top: 28px; color: var(--muted); font-size: 14px; }
.source-note summary { color: var(--text); cursor: pointer; font-weight: 700; }
.source-note p { margin: 10px 0 0; }

.quiz-toolbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 24px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(33, 53, 44, 0.08);
  backdrop-filter: blur(10px);
}

.quiz-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #dde3de;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.quiz-intro { margin-bottom: 18px; }
.quiz-intro h1 { font-size: clamp(28px, 4vw, 40px); }
.quiz-intro > p:not(.eyebrow) { color: var(--muted); }
.quiz-notice { min-height: 26px; margin: 14px 0 0 !important; color: var(--danger) !important; font-weight: 700; }

.question-list {
  display: grid;
  gap: 14px;
}

.question-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  scroll-margin-top: 105px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.question-card.unanswered {
  border-color: #d07174;
  box-shadow: 0 0 0 3px rgba(166, 61, 64, 0.1);
}

.question-card fieldset { margin: 0; padding: 0; border: 0; }
.question-card legend { width: 100%; margin-bottom: 16px; }
.question-number { display: block; margin-bottom: 5px; color: var(--accent); font-size: 13px; font-weight: 760; }
.question-text { display: block; color: var(--text); font-size: 19px; font-weight: 720; line-height: 1.5; }

.answer-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.answer-options input { position: absolute; opacity: 0; pointer-events: none; }

.answer-options label {
  display: flex;
  min-height: 62px;
  padding: 8px 6px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.answer-options label:hover { border-color: #8fa69b; background: #f7faf8; }
.answer-options input:checked + label { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 760; }
.submit-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
}

.submit-panel h2 { margin-bottom: 4px; }
.submit-panel p { margin: 0; color: var(--muted); }

.result-hero { margin-bottom: 20px; }
.result-hero > p:not(.eyebrow) { color: var(--muted); }
.result-scale-note { margin-top: -8px; font-size: 13px; }
.radar-figure {
  margin: 30px 0 34px;
  padding: 20px 24px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbf9;
}
.radar-figure figcaption { margin-bottom: 4px; font-size: 17px; font-weight: 760; }
.radar-chart svg { display: block; width: min(100%, 560px); height: auto; margin: 0 auto; overflow: visible; }
.radar-grid { fill: none; stroke: #d7ded9; stroke-width: 1; }
.radar-axis { stroke: #d7ded9; stroke-width: 1; }
.radar-shape { fill: rgba(49, 92, 76, 0.22); stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.radar-point { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.radar-label-name { fill: var(--text); font-size: 15px; font-weight: 720; }
.radar-label-score { fill: var(--accent); font-size: 13px; font-weight: 760; }
.domain-results { display: grid; gap: 22px; margin-top: 28px; }

.domain-card { display: grid; grid-template-columns: 170px 1fr 58px; gap: 16px; align-items: center; }
.domain-name strong { display: block; font-size: 18px; }
.domain-name span, .score-note { color: var(--muted); font-size: 13px; }
.score-bar { height: 14px; overflow: hidden; border-radius: 99px; background: #e5e9e6; }
.score-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.score-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 760; }
.domain-summary { grid-column: 2 / -1; margin: -8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.result-sources { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.result-sources summary { color: var(--text); cursor: pointer; font-weight: 720; }
.result-sources p { margin: 10px 0 0; }

.section-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 26px; }
.section-heading > p { max-width: 420px; color: var(--muted); font-size: 14px; }
.facet-groups { display: grid; gap: 20px; }
.facet-group { padding-top: 20px; border-top: 1px solid var(--line); }
.facet-group:first-child { padding-top: 0; border-top: 0; }
.facet-group h3 { margin: 0 0 12px; }
.facet-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.facet-row { display: grid; grid-template-columns: 112px 1fr 42px; gap: 10px; align-items: center; font-size: 14px; }
.facet-row .score-bar { height: 8px; }

.result-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; margin-top: 20px; }
.result-actions p { margin: 0; color: var(--muted); }
.pdf-export-panel {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  padding: 20px;
  border: 1px solid #b9cec5;
  border-radius: 14px;
  background: #f2f7f4;
}
.pdf-export-panel h3 { margin: 2px 0 6px; font-size: 20px; }
.pdf-export-panel .eyebrow { color: var(--accent); }
.pdf-export-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.pdf-export-help { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid #d6e2dc; font-size: 13px; line-height: 1.7; }
.site-footer { padding: 18px 0 36px; color: var(--muted); font-size: 13px; text-align: center; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  main { padding-top: 22px; }
  .notice-grid { grid-template-columns: 1fr; }
  .quiz-toolbar { top: 8px; }
  .quiz-toolbar-actions { gap: 8px; }
  .quiz-intro { padding: 22px 18px; }
  .question-list { gap: 10px; }
  .question-card { padding: 16px 12px; }
  .question-card legend { margin-bottom: 12px; }
  .question-number { margin-bottom: 3px; font-size: 12px; }
  .question-text { font-size: 17px; }
  .answer-options { gap: 4px; }
  .answer-options label {
    min-height: 44px;
    padding: 4px 1px;
    border-radius: 8px;
    font-size: clamp(9px, 2.75vw, 12px);
    line-height: 1;
  }
  .radar-figure { margin: 22px 0 26px; padding: 14px 8px 10px; }
  .radar-label-name { font-size: 13px; }
  .radar-label-score { font-size: 12px; }
  .submit-panel { align-items: stretch; flex-direction: column; }
  .domain-card { grid-template-columns: 1fr 48px; }
  .domain-name { grid-column: 1 / -1; }
  .domain-summary { grid-column: 1 / -1; }
  .section-heading, .result-actions { align-items: stretch; flex-direction: column; }
  .pdf-export-panel { grid-template-columns: 1fr; }
  .pdf-export-buttons { display: grid; grid-template-columns: 1fr; justify-content: stretch; }
  .pdf-export-buttons > * { width: 100%; }
  .pdf-export-help { grid-column: 1; }
  .facet-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 16px, 980px); }
  .quiz-toolbar { padding: 12px; }
  .quiz-toolbar .text-button { font-size: 13px; }
}
