/* HSK Mastery — landing "try the onboarding" placement demo styles.
   Owned by the try-onboarding feature; loaded by index.php.
   Reuses .wrap / .section-head / .eyebrow / .btn / .door* from styles.css —
   everything below is new surface: the quiz card, choices, result card. */

.tob-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(251,245,230,0.9) inset, 0 22px 50px -28px rgba(31,27,22,0.4);
  padding: 28px;
  max-width: 640px;
}
.tob-fallback { margin: 0; color: var(--ink-faded); font-size: 15px; }

/* Doors reuse .door / .door-zh / .door-body / .door-level / .level-picks /
   .level-pick / .door-note verbatim from styles.css — no overrides needed. */
.tob-card .door:last-of-type { margin-bottom: 12px; }
.tob-card .door-level[hidden] { display: none; }

.tob-eyebrow {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 14px; font-family: var(--serif-body);
}

/* ---------- the first-lesson moment (door 零) ---------- */
.tob-lesson-zh {
  font-family: var(--han); font-size: clamp(30px, 7vw, 44px);
  color: var(--ink); line-height: 1.4; margin: 0 0 10px;
}
.tob-lesson-pinyin {
  font-family: var(--serif-display); font-style: italic;
  font-size: 18px; color: var(--ink-whisper); margin: 0 0 10px;
}
.tob-lesson-en { font-size: 18px; color: var(--ink); margin: 0 0 6px; }
.tob-lesson-note {
  font-size: 14px; color: var(--ink-faded); margin: 0 0 22px;
  padding: 10px 12px; background: var(--paper-sunken); border-radius: 8px;
}
.tob-lesson .btn { margin-top: 4px; }

/* ---------- progress dots ---------- */
.tob-progress { display: flex; gap: 7px; margin: 0 0 20px; flex-wrap: wrap; }
.tob-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper-sunken); border: 1.5px solid var(--hairline);
}
.tob-dot.done { background: var(--accent); border-color: var(--accent); }
.tob-dot.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,50,42,0.15); }

/* ---------- question ---------- */
.tob-q-zh {
  font-family: var(--han); font-size: clamp(24px, 6vw, 32px);
  color: var(--ink); line-height: 1.55; margin: 0 0 8px;
}
.tob-q-pinyin {
  font-family: var(--serif-display); font-style: italic;
  font-size: 15px; color: var(--ink-whisper); margin: 0 0 10px;
}
.tob-q-prompt { font-size: 15.5px; color: var(--ink-faded); margin: 0 0 18px; line-height: 1.5; }

.tob-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 4px; }
@media (max-width: 480px) { .tob-choices { grid-template-columns: 1fr; } }
.tob-choice {
  font: inherit; font-family: var(--han); font-size: 17px;
  padding: 14px 16px; min-height: 52px;
  background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 10px;
  cursor: pointer; color: var(--ink); text-align: left; transition: all .15s;
  line-height: 1.35;
}
.tob-choice:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tob-choice.correct { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.tob-choice.wrong { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }
.tob-choice:disabled { cursor: default; }

.tob-explain {
  display: none; margin-top: 16px; padding: 16px; border-radius: 10px;
  background: var(--paper-sunken); border-left: 3px solid var(--correct);
}
.tob-explain.show { display: block; }
.tob-explain-verdict {
  font-family: var(--serif-body); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; color: var(--correct);
}
.tob-explain-verdict.no { color: var(--wrong); }
.tob-explain.wrong { border-left-color: var(--wrong); }
.tob-explain-body { font-size: 15px; color: var(--ink-faded); line-height: 1.6; margin: 0 0 14px; }
.tob-explain .btn { width: 100%; justify-content: center; }
@media (min-width: 481px) { .tob-explain .btn { width: auto; } }

/* ---------- result card ---------- */
.tob-score {
  font-family: var(--serif-display); font-weight: 600;
  font-size: 56px; line-height: 1; margin: 0 0 14px; color: var(--ink);
}
.tob-score span { font-size: 28px; color: var(--ink-whisper); }
.tob-verdict {
  font-family: var(--serif-display); font-weight: 600;
  font-size: clamp(21px, 4vw, 26px); line-height: 1.3; margin: 0 0 10px; color: var(--ink);
}
.tob-sub { font-size: 16px; color: var(--ink-faded); line-height: 1.55; margin: 0 0 26px; }

.tob-levelbar-wrap { margin: 0 0 22px; }
.tob-levelbar {
  position: relative; display: flex; height: 16px;
  border-radius: 8px; overflow: visible; gap: 2px;
}
.tob-seg { flex: 1; height: 100%; opacity: 0.85; }
.tob-seg:first-child { border-radius: 8px 0 0 8px; }
.tob-seg:last-child { border-radius: 0 8px 8px 0; }
.tob-marker {
  position: absolute; top: -7px; width: 0; height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 10px solid var(--ink);
}
.tob-levelbar-labels {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 11px; color: var(--ink-whisper); font-family: var(--serif-body);
}
.tob-levelbar-labels span { flex: 1; text-align: center; }
.tob-levelbar-labels span.on { color: var(--ink); font-weight: 700; }

.tob-honest {
  font-size: 13.5px; color: var(--ink-whisper); line-height: 1.6;
  margin: 0 0 22px; padding: 12px 14px; background: var(--paper-sunken); border-radius: 8px;
}
.tob-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.tob-cta .btn { flex: 1 1 auto; justify-content: center; }
@media (min-width: 481px) { .tob-cta .btn { flex: 0 0 auto; } }
.tob-quiet { font-size: 13.5px; color: var(--ink-whisper); font-style: italic; margin: 0; }

/* ---------- adaptive placement test (door 测) ---------- */
.plc-of { text-transform: none; letter-spacing: 0; color: var(--ink-whisper); font-weight: 400; margin-left: 6px; }

.plc-ramp-wrap { margin: 0 0 10px; }
.plc-ramp { height: 10px; }
.plc-diff-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 22px; }
.plc-diff-label { font-size: 12px; color: var(--ink-whisper); font-family: var(--serif-body); letter-spacing: 0.04em; }
.plc-diff-dots { display: inline-flex; gap: 5px; }
.plc-diff-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--paper-sunken); border: 1.5px solid var(--hairline); transition: all .15s; }
.plc-diff-dot.on { background: var(--accent); border-color: var(--accent); }

.plc-section-heading {
  font-family: var(--serif-body); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-whisper);
  margin: 22px 0 12px;
}

/* accuracy-by-level bars */
.plc-bars { display: flex; flex-direction: column; gap: 8px; margin: 0 0 4px; }
.plc-bar-row { display: grid; grid-template-columns: 68px 1fr 40px; align-items: center; gap: 10px; }
.plc-bar-label { font-size: 13px; color: var(--ink-faded); font-family: var(--serif-body); }
.plc-bar-track { height: 10px; background: var(--paper-sunken); border-radius: 6px; overflow: hidden; }
.plc-bar-fill { height: 100%; border-radius: 6px; opacity: 0.85; transition: width .3s ease; }
.plc-bar-pct { font-size: 12.5px; color: var(--ink-whisper); text-align: right; font-variant-numeric: tabular-nums; }

/* recommended starting node */
.plc-rec {
  margin: 22px 0 4px; padding: 16px 18px; border-radius: 10px;
  background: var(--paper-sunken); border-left: 3px solid var(--accent);
}
.plc-rec-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 6px;
}
.plc-rec-zh { font-family: var(--han); font-size: 20px; color: var(--ink); margin: 0 0 4px; }
.plc-rec-en { font-size: 14px; color: var(--ink-faded); margin: 0; }

/* topic gap list */
.plc-gap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plc-gap-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 8px; background: var(--paper);
  border: 1px solid var(--hairline); border-left-width: 3px;
}
.plc-gap-solid { border-left-color: var(--correct); }
.plc-gap-shaky { border-left-color: var(--hsk3); }
.plc-gap-missing { border-left-color: var(--wrong); }
.plc-gap-untested { border-left-color: var(--hairline); }
.plc-gap-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.plc-gap-zh { font-family: var(--han); font-size: 16px; color: var(--ink); white-space: nowrap; }
.plc-gap-en { font-size: 12.5px; color: var(--ink-faded); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plc-gap-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.plc-gap-level { font-size: 11px; color: var(--ink-whisper); font-family: var(--serif-body); }
.plc-gap-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; background: var(--paper-sunken); color: var(--ink-faded);
}
.plc-gap-solid .plc-gap-badge { background: var(--correct-bg); color: var(--correct); }
.plc-gap-shaky .plc-gap-badge { background: rgba(138,90,26,0.14); color: var(--hsk3); }
.plc-gap-missing .plc-gap-badge { background: var(--wrong-bg); color: var(--wrong); }

@media (max-width: 480px) {
  .plc-bar-row { grid-template-columns: 56px 1fr 36px; gap: 6px; }
  .plc-gap-row { flex-wrap: wrap; }
  .plc-gap-en { white-space: normal; }
}

/* ---------- limit / error states ---------- */
.tob-limit h3 {
  font-family: var(--serif-display); font-size: 24px; font-weight: 600; margin: 0 0 10px;
}
.tob-limit p { font-size: 15.5px; color: var(--ink-faded); line-height: 1.6; margin: 0 0 20px; }
.tob-error { text-align: center; padding: 12px 0; }
.tob-error p { color: var(--ink-faded); margin: 0 0 14px; }

/* ---------- mobile: keep everything within 375px, no fixed widths ---------- */
@media (max-width: 480px) {
  .tob-card { padding: 20px; border-radius: 12px; }
  .tob-cta { flex-direction: column; align-items: stretch; }
}
