:root {
  color-scheme: light;
  --ink: #202521;
  --muted: #667068;
  --paper: #f4f1eb;
  --surface: #fffdfa;
  --line: #d9d5cc;
  --green: #176b4d;
  --green-dark: #0e4f38;
  --gold: #bb7a22;
  --danger: #a0352f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 18px; line-height: 1.65; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, input { min-height: 48px; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(187, 122, 34, .45); outline-offset: 2px; }
.hidden { display: none !important; }
.topbar { height: 64px; padding: 0 max(24px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { color: var(--ink); font-weight: 750; text-decoration: none; font-size: 20px; }
.view { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 80px; }
.login-layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 8vw; }
.intro h1, .question-area h1 { max-width: 16ch; font-size: clamp(32px, 4vw, 52px); line-height: 1.22; margin: 8px 0 20px; }
.intro p { max-width: 34rem; color: var(--muted); }
.eyebrow { margin: 0; color: var(--green); font-size: 15px; font-weight: 750; }
.panel { padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px rgba(34, 39, 35, .08); }
.form-stack { display: grid; gap: 12px; }
label, legend { font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #aaa99f; border-radius: 6px; background: #fff; padding: 12px 14px; color: var(--ink); }
textarea { min-height: 116px; resize: vertical; }
fieldset { margin: 4px 0; padding: 0; border: 0; }
.role-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.role-options label { display: flex; min-height: 52px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; font-weight: 600; }
.role-options input { width: 22px; min-height: 22px; accent-color: var(--green); }
.primary, .next { border: 0; border-radius: 6px; padding: 10px 20px; background: var(--green); color: white; font-weight: 750; }
.primary:hover, .next:hover { background: var(--green-dark); }
.secondary { min-height: 48px; border: 1px solid var(--green); border-radius: 6px; padding: 9px 18px; background: transparent; color: var(--green-dark); font-weight: 700; }
.text-button { min-height: 48px; border: 0; background: transparent; color: var(--green-dark); font-weight: 700; padding: 8px 12px; }
.message { min-height: 1.65em; margin: 6px 0; color: var(--muted); }
.error { color: var(--danger); }
.progress-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.progress-row h1, .progress-row h2 { margin: 4px 0 0; line-height: 1.3; }
.count { color: var(--muted); white-space: nowrap; }
.interview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .78fr); gap: 7vw; padding: 56px 0 40px; }
.question-area h1 { margin-top: 0; }
.hint { max-width: 38rem; color: var(--muted); border-left: 4px solid var(--gold); padding-left: 16px; }
.follow-up { margin-top: 36px; padding: 18px 20px; border: 1px solid var(--gold); border-radius: 6px; background: #fff8eb; }
.follow-up span { color: #80510f; font-size: 14px; font-weight: 750; }
.follow-up p { margin: 4px 0 0; font-weight: 700; }
.answer-area { display: grid; align-content: start; gap: 12px; }
.recorder { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 16px; }
.timer { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 750; white-space: nowrap; }
#record-dot { display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 50%; background: #aaa; }
#record-dot.active { background: var(--danger); }
#record-dot.paused { background: #777; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.question-nav { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 24px; }
.next { min-width: 142px; }
.chapter-list { display: grid; gap: 34px; margin-top: 30px; }
.chapter-section h2 { font-size: 24px; margin-bottom: 12px; }
.answer-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 12px; }
.answer-card h3 { margin: 0 0 8px; font-size: 19px; }
.answer-card time { color: var(--muted); font-size: 14px; }
.answer-card audio { display: block; width: min(100%, 440px); margin: 14px 0; }
.follow-up-list { margin: 14px 0 0; padding: 14px 0 0 22px; border-top: 1px solid var(--line); }
.empty { padding: 50px 0; color: var(--muted); text-align: center; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .topbar { height: 58px; padding-left: 16px; padding-right: 16px; }
  .view { width: calc(100% - 32px); padding: 28px 0 max(40px, env(safe-area-inset-bottom)); }
  .login-layout { min-height: auto; grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .intro h1, .question-area h1 { max-width: none; font-size: 32px; }
  .panel { padding: 20px; }
  .role-options { grid-template-columns: 1fr; }
  .progress-row { align-items: center; }
  .interview-grid { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 28px; }
  .recorder { align-items: flex-start; flex-direction: column; }
  .recorder .button-row, .recorder button, #save-button { width: 100%; }
  .question-nav { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: rgba(244, 241, 235, .97); }
  .answer-card { padding: 16px; }
}
