:root {
  --ink: #14201f;
  --muted: #60706e;
  --paper: #fbfaf6;
  --canvas: #f3efe5;
  --line: #d8d3c7;
  --green: #21675f;
  --green-dark: #174d47;
  --mint: #e2efeb;
  --danger: #b5483d;
  --danger-bg: #fff4f1;
  --shadow: 0 16px 40px rgba(38, 49, 47, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
.ambient { position: fixed; border-radius: 50%; filter: blur(60px); pointer-events: none; opacity: .42; }
.ambient-a { width: 340px; height: 340px; left: -130px; top: -120px; background: #d4e4dc; }
.ambient-b { width: 280px; height: 280px; right: -130px; bottom: 5%; background: #eadfca; }
.site-header, .app-shell, .progress-shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; position: relative; }
.site-header { padding: 36px 0 24px; display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.eyebrow { margin: 0; color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: .15em; }
.institution { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.wave-mark { color: var(--green); font-size: 42px; line-height: 1; transform: rotate(90deg); opacity: .72; }
.progress-shell { height: 10px; overflow: hidden; border-radius: 999px; background: #cbd4d0; }
#progressBar { width: 2%; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease; }
.app-shell { padding: 30px 0 18px; }
.card { background: rgba(251, 250, 246, .96); border: 1px solid #33413f; border-radius: 22px; box-shadow: var(--shadow); padding: 30px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.icon-badge { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 25px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 5vw, 44px); line-height: 1.16; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: clamp(23px, 4vw, 32px); line-height: 1.25; }
h3 { margin-bottom: 4px; font-size: 18px; }
.lead { max-width: 760px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.meta-item { padding: 15px; border-radius: 14px; background: #f1efe8; }
.meta-item b { display: block; color: var(--green); font-size: 17px; }
.meta-item span { color: var(--muted); font-size: 12px; }
.notice { padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: white; font-size: 14px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 8px; color: var(--muted); }
.checks { display: grid; gap: 10px; margin: 18px 0; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; background: white; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; font-size: 14px; }
.check-row input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn { min-height: 46px; border: 1px solid var(--green); border-radius: 13px; padding: 0 22px; cursor: pointer; font-weight: 750; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { color: var(--ink); background: #faf8f1; border-color: #35413f; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
select, textarea, .password-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; padding: 11px 12px; outline: none; }
select:focus, textarea:focus, .password-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33, 103, 95, .12); }
.fatigue-scale, .score-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.score-option input { position: absolute; opacity: 0; pointer-events: none; }
.score-option label { height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); cursor: pointer; font-weight: 800; transition: .15s ease; }
.score-option input:checked + label { color: white; border-color: var(--green); background: var(--green); }
.score-option input:focus-visible + label { outline: 3px solid rgba(33, 103, 95, .25); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; }
.audio-card { position: sticky; top: 10px; z-index: 5; padding: 20px 24px; background: rgba(251, 250, 246, .96); backdrop-filter: blur(12px); }
.audio-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.audio-head p { margin: 0; }
.stage-label { color: var(--green); font-size: 12px; font-weight: 850; letter-spacing: .15em; }
.stage-note { margin-top: 4px !important; color: var(--muted); font-size: 13px; }
.status-pill { white-space: nowrap; border-radius: 999px; padding: 7px 11px; background: #ecece6; color: var(--muted); font-size: 12px; font-weight: 750; }
.status-pill.done { background: var(--mint); color: var(--green); }
audio { width: 100%; margin-top: 15px; }
.question-card { border-color: var(--line); box-shadow: none; padding: 22px; }
.question-caption { margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.question { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.72); }
.question + .question { margin-top: 10px; }
.question.error { border-color: #df928a; background: var(--danger-bg); }
.question-text { margin-bottom: 13px; font-size: 14px; }
.error-box { margin-top: 15px; padding: 13px 15px; border: 1px solid #e7a59e; border-radius: 13px; color: var(--danger); background: var(--danger-bg); font-size: 14px; }
.stage-complete { padding: 20px; border-radius: 18px; background: var(--green); color: white; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.stage-complete p { margin: 0; }
.stage-complete small { color: rgba(255,255,255,.72); }
.stage-complete .btn { background: #f5f1e7; color: var(--ink); border-color: transparent; }
.counter { color: var(--muted); text-align: right; font-size: 12px; }
.success { text-align: center; padding-block: 48px; }
.success .icon-badge { margin: 0 auto; color: white; background: var(--green); }
.completion-id { display: inline-block; margin-top: 18px; padding: 9px 15px; border-radius: 10px; color: var(--green); background: var(--mint); font-family: Consolas, monospace; font-weight: 800; }
.admin-shell { max-width: 980px; margin: 0 auto; }
.admin-login { max-width: 580px; margin: 0 auto; }
.admin-toolbar { display: flex; gap: 12px; align-items: end; }
.admin-toolbar .field { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stat { padding: 16px; border-radius: 14px; background: #f1efe8; }
.stat b { display: block; font-size: 25px; color: var(--green); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 13px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #eeece4; color: var(--muted); font-size: 11px; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.bar { width: 120px; height: 7px; border-radius: 99px; background: #d7d8d1; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); }
footer { position: relative; padding: 22px 16px 36px; text-align: center; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }

@media (max-width: 700px) {
  .site-header, .app-shell, .progress-shell { width: min(100% - 20px, 1120px); }
  .site-header { padding-top: 22px; }
  .wave-mark { display: none; }
  .card { padding: 21px 16px; border-radius: 18px; }
  .meta-grid, .form-grid, .stats { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .audio-card { top: 5px; padding: 16px; }
  .audio-head { display: block; }
  .status-pill { display: inline-block; margin-top: 10px; }
  .question-card { padding: 16px 12px; }
  .question { padding: 13px 10px; }
  .score-scale, .fatigue-scale { gap: 4px; }
  .score-option label { height: 39px; border-radius: 8px; }
  .scale-labels { font-size: 10px; }
  .stage-complete { display: block; }
  .stage-complete .btn { width: 100%; margin-top: 14px; }
  .admin-toolbar { display: grid; }
}
