/* ADHDXLab — one stylesheet, system fonts, no third-party assets. */

:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #5b6672;
  --line: #e3dfd3;
  --brand: #1f6f64;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ee;
  --accent: #f2b134;
  --warn-soft: #fff4e0;
  --danger: #a43b2f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 41, 51, 0.06), 0 6px 20px rgba(31, 41, 51, 0.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 20px 48px; }
a { color: var(--brand); }
img, svg { max-width: 100%; }

/* Language: both are in the markup, the selected one is shown. */
html[data-lang="en"] .zh,
html[data-lang="zh"] .en { display: none; }

.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;
}

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .inner {
  max-width: 980px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 16px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--brand); }
.lang-toggle {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer;
}

.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.site-footer .inner { max-width: 980px; margin: 0 auto; padding: 20px; }
.site-footer .legal { margin: 12px 0 0; }

/* Disclaimer blocks always show both languages. */
.disclaimer {
  background: var(--warn-soft); border: 1px solid #f0d9a8; border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.92rem; color: #4a3b1c;
}
.disclaimer p { margin: 4px 0; }
.site-footer .disclaimer { background: transparent; border: 0; padding: 0; color: var(--muted); }

/* Landing */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin: 0 0 12px; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.hero .cta { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 16px 0 0; }
.pill-list li { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }

.section { margin: 36px 0; }
.section h2 { font-size: 1.4rem; margin: 0 0 12px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tile h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tile p { margin: 0; color: var(--muted); }
.tile .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 8px; }
.two-col { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.check-list { margin: 0; padding-left: 1.2em; }
.check-list li { margin: 4px 0; }
.edu-box { background: var(--surface); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--brand); }
.btn:focus-visible, .lang-toggle:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn.danger { color: var(--danger); border-color: #e6c3be; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Practice */
.practice-top { display: grid; gap: 12px; margin-bottom: 16px; }
.safety-strip { margin: 0; text-align: right; }
.safety-strip .btn { color: var(--danger); border-color: #e6c3be; }
.practice-bar {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow);
}
.practice-bar .spacer { flex: 1; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 4vw, 32px); box-shadow: var(--shadow);
}
.panel h1 { margin-top: 0; font-size: 1.6rem; }
.panel h2 { font-size: 1.25rem; }
.lead { font-size: 1.1rem; }
.muted { color: var(--muted); font-size: 0.95rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--muted); margin: 0; }
.skill { color: var(--brand); font-weight: 600; margin-top: -6px; }
.note { background: var(--brand-soft); border-radius: 10px; padding: 8px 12px; }

.choices { border: 0; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.choices legend { font-weight: 700; margin-bottom: 8px; }
.choice { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
.check input { margin-top: 6px; width: 18px; height: 18px; }

.game { text-align: center; }
.stimulus { font-size: clamp(5rem, 22vw, 9rem); height: 1.3em; line-height: 1.3em; user-select: none; }
.btn.tap { min-width: 220px; min-height: 72px; font-size: 1.5rem; }
.feedback { min-height: 1.8em; font-size: 1.15rem; font-weight: 600; color: var(--brand); }

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.choice-btn { flex-direction: column; min-height: 72px; }
.choice-btn .emoji { font-size: 1.6rem; }
.other-word { margin-top: 18px; }
.other-word .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.text { flex: 1; min-width: 180px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font: inherit; }
.scale { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); }
.scale-btn { flex-direction: column; min-height: 80px; }
.scale-btn strong { font-size: 1.5rem; }
.guide { text-align: center; margin: 12px 0 20px; }
.guide-step { font-size: 1.5rem; font-weight: 700; min-height: 2.4em; }
.guide-count { font-size: 2.6rem; color: var(--brand); margin: 0; min-height: 1.3em; }

.seq-display { font-size: clamp(4.5rem, 18vw, 7rem); height: 1.3em; line-height: 1.3em; user-select: none; }
.seq-trail { min-height: 2.2em; font-size: 1.6rem; letter-spacing: 0.2em; }
.seq-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(80px, 120px)); justify-content: center; margin: 8px auto 4px; }
.seq-item { font-size: 2.2rem; min-height: 80px; }

.card h2 { font-size: 1.05rem; color: var(--muted); margin-bottom: 4px; }
.card section { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.done-list { margin: 0; padding-left: 1.2em; }
.tonight p { font-size: 1.1rem; font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.safety { border-color: #e6c3be; }
.safety-block { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.safety-block p { margin: 6px 0; font-size: 1.05rem; }

@media (max-width: 560px) {
  .scale { grid-template-columns: repeat(3, 1fr); }
  .site-nav { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer .legal, .practice-top, .no-print, .disclaimer.top { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #999; }
}
