:root {
  --ink: #182037;
  --muted: #687086;
  --paper: #f7f5ef;
  --paper-deep: #efede5;
  --white: #fffefa;
  --line: #dcd9cf;
  --blue: #1d3fd3;
  --blue-dark: #142ba0;
  --blue-soft: #e3e8ff;
  --coral: #ff6b55;
  --coral-soft: #ffe3dc;
  --green: #197c68;
  --green-soft: #dff1e9;
  --yellow: #f1c64d;
  --shadow: 0 24px 70px rgba(30, 36, 60, .11);
  --radius: 24px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --han: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.site-header { width: min(1220px, calc(100% - 48px)); height: 84px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(24,32,55,.12); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--blue); color: white; font-family: var(--han); font-size: 20px; line-height: 1; transform: rotate(-3deg); }
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; margin-right: 8px; }
.brand-mark.large { width: 68px; height: 68px; border-radius: 20px; font-size: 40px; }
.site-nav { display: flex; gap: 30px; align-items: center; }
.site-nav a { position: relative; color: var(--muted); font-size: .88rem; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 2px; background: var(--blue); border-radius: 2px; }
.site-header > .auth-button { justify-self: end; }

.button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 800; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .icon-button:focus-visible, .flashcard:focus-visible, .answer-button:focus-visible { outline: 3px solid rgba(29,63,211,.3); outline-offset: 3px; }
.button-primary { background: var(--blue); color: white; box-shadow: 0 10px 22px rgba(29,63,211,.18); }
.button-primary:hover { background: var(--blue-dark); box-shadow: 0 14px 28px rgba(29,63,211,.25); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.35); }
.button-ghost:hover { border-color: #aaa69b; background: var(--white); }
.button-light { background: white; color: var(--blue); }
.button-text { padding-inline: 5px; color: var(--ink); }
.button-small { min-height: 38px; padding-inline: 15px; border-radius: 10px; font-size: .82rem; }
.button.wide { width: 100%; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; font-size: 1.1rem; }

.eyebrow { margin: 0 0 14px; color: var(--blue); font-size: .7rem; font-weight: 900; letter-spacing: .14em; line-height: 1.2; text-transform: uppercase; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }

.hero { min-height: 690px; width: min(1220px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 1.03fr .97fr; align-items: center; gap: 60px; padding: 66px 0 80px; }
.hero h1 { margin: 0; max-width: 650px; font-family: var(--serif); font-size: clamp(4rem, 7vw, 6.8rem); font-weight: 500; letter-spacing: -.065em; line-height: .87; }
.hero h1 em { color: var(--blue); font-weight: 500; }
.hero-lead { max-width: 580px; margin: 32px 0; color: var(--muted); font-size: 1.1rem; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 24px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 40px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.trust-row span::before { content: "✓"; margin-right: 7px; color: var(--green); }
.hero-visual { position: relative; min-height: 510px; display: grid; place-items: center; isolation: isolate; }
.hero-visual::before { content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%; background: var(--blue-soft); z-index: -3; }
.orbit { position: absolute; width: 510px; height: 320px; border: 1px solid rgba(29,63,211,.25); border-radius: 50%; transform: rotate(25deg); z-index: -2; }
.orbit-two { transform: rotate(-25deg); border-color: rgba(255,107,85,.28); }
.preview-card { width: min(390px, 82%); min-height: 475px; padding: 25px; display: flex; flex-direction: column; background: var(--white); border: 1px solid rgba(24,32,55,.08); border-radius: 28px; box-shadow: var(--shadow); transform: rotate(2.4deg); }
.preview-top { display: flex; justify-content: space-between; align-items: center; }
.level-chip { display: inline-flex; width: fit-content; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.mini-dots { color: var(--muted); letter-spacing: 2px; }
.preview-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.preview-hanzi { font-family: var(--han); font-size: 6rem; font-weight: 600; line-height: 1.15; }
.preview-pinyin { color: var(--coral); font-family: var(--serif); font-size: 1.7rem; font-style: italic; }
.preview-hint { margin-top: 42px; color: #9a9eaa; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.preview-progress { height: 4px; overflow: hidden; background: var(--paper-deep); border-radius: 4px; }
.preview-progress span { display: block; height: 100%; background: var(--blue); }
.floating-note { position: absolute; padding: 12px 16px; border-radius: 12px; box-shadow: 0 13px 30px rgba(24,32,55,.12); font-size: .72rem; font-weight: 800; transform: rotate(-5deg); }
.note-one { top: 75px; right: -8px; background: var(--coral); color: white; }
.note-two { bottom: 42px; left: -2px; background: var(--yellow); color: var(--ink); transform: rotate(4deg); }
.note-two small { font-weight: 600; }

.level-strip { padding: 35px max(24px, calc((100vw - 1220px) / 2)); display: grid; grid-template-columns: 1fr 2fr; align-items: center; gap: 35px; background: var(--ink); color: white; }
.level-strip .eyebrow { color: #aeb9fc; }
.level-strip h2 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.level-pills { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.level-pills a { padding: 9px 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 99px; color: white; font-size: .8rem; font-weight: 800; text-decoration: none; transition: .2s; }
.level-pills a:hover { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }

.feature-section { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 115px 0 130px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 58px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(3rem, 5vw, 5rem); font-weight: 500; letter-spacing: -.05em; line-height: .96; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.feature-grid article { padding: 42px 48px 10px 0; }
.feature-grid article + article { padding-left: 48px; border-left: 1px solid var(--line); }
.feature-grid h3 { margin: 24px 0 10px; font-size: 1.05rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.7; }
.feature-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-weight: 900; }
.feature-icon.coral { background: var(--coral-soft); color: var(--coral); }
.feature-icon.blue { background: var(--blue-soft); color: var(--blue); }
.feature-icon.green { background: var(--green-soft); color: var(--green); font-family: var(--han); }
.final-cta { padding: 70px max(24px, calc((100vw - 1220px) / 2)); display: flex; justify-content: space-between; align-items: center; background: var(--blue); color: white; }
.final-cta .eyebrow { color: #bfc9ff; }
.final-cta h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.7rem, 5vw, 4.4rem); font-weight: 500; letter-spacing: -.04em; }

.site-footer { width: min(1220px, calc(100% - 48px)); min-height: 150px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; color: var(--muted); font-size: .78rem; }
.site-footer > div:first-child { color: var(--ink); }
.site-footer p { text-align: center; }
.footer-links { display: flex; justify-content: flex-end; gap: 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--blue); }

.page-intro { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 90px 0 62px; }
.page-intro.compact { padding-bottom: 40px; }
.page-intro h1 { margin: 0; max-width: 850px; font-family: var(--serif); font-size: clamp(3.7rem, 7vw, 6.4rem); font-weight: 500; letter-spacing: -.06em; line-height: .94; }
.page-intro > p:last-child { max-width: 640px; margin: 24px 0 0; color: var(--muted); font-size: 1.04rem; }
.level-grid { width: min(1220px, calc(100% - 48px)); margin: 0 auto 100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.level-card { padding: 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; transition: .2s; }
.level-card:hover { border-color: var(--blue); box-shadow: 0 12px 30px rgba(30,36,60,.08); transform: translateY(-2px); }
.level-number { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-family: var(--serif); font-size: 1.7rem; }
.level-card strong, .level-card small { display: block; }
.level-card small { margin-top: 3px; color: var(--muted); }
.search-callout { width: min(1220px, calc(100% - 48px)); margin: 0 auto 100px; padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 40px; background: var(--ink); color: white; border-radius: var(--radius); }
.search-callout .eyebrow { color: #aeb9fc; }
.search-callout h2 { margin: 0; font-family: var(--serif); font-size: 2.5rem; font-weight: 500; }
.search-callout p:last-child { color: #b9bdca; }
.word-list { width: min(1220px, calc(100% - 48px)); margin: 0 auto 100px; border-top: 1px solid var(--line); }
.word-list a { min-height: 74px; padding: 12px 10px; display: grid; grid-template-columns: minmax(120px, .7fr) minmax(130px, .8fr) 2fr auto; align-items: center; gap: 25px; border-bottom: 1px solid var(--line); text-decoration: none; transition: .16s; }
.word-list a:hover { padding-inline: 18px; background: var(--white); color: var(--blue); }
.list-hanzi { font-family: var(--han); font-size: 1.55rem; font-weight: 700; color: var(--ink); }
.list-pinyin { color: var(--coral); font-family: var(--serif); font-size: 1.05rem; }
.list-meaning { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.word-detail { width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 75px 0 100px; }
.back-link { display: inline-block; margin-bottom: 38px; text-decoration: none; }
.word-hero { position: relative; padding: 52px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.word-hero .level-chip { position: absolute; top: 22px; left: 22px; }
.word-hero h1 { margin: 10px 0 0; font-family: var(--han); font-size: clamp(5rem, 15vw, 8rem); line-height: 1; }
.word-hero .traditional { margin: 8px 0; color: var(--muted); font-family: var(--han); font-size: 1.4rem; }
.word-pinyin { margin: 12px 0 0; color: var(--coral); font-family: var(--serif); font-size: 1.9rem; font-style: italic; }
.definition-panel { margin: 24px 0; padding: 32px; background: var(--ink); color: white; border-radius: 18px; }
.definition-panel .eyebrow { color: #aeb9fc; }
.definition-panel ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: 40px; }
.definition-panel li { margin-bottom: 8px; break-inside: avoid; }
.word-facts { margin: 0 0 30px; }
.word-facts > div { padding: 16px 4px; display: grid; grid-template-columns: 140px 1fr; border-bottom: 1px solid var(--line); }
.word-facts dt { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.word-facts dd { margin: 0; }

.study-main { width: min(960px, calc(100% - 48px)); min-height: 720px; margin: 0 auto; padding: 54px 0 100px; }
.study-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.study-header h1 { margin: 0; font-family: var(--serif); font-size: 3.5rem; font-weight: 500; letter-spacing: -.05em; }
.setup-panel { padding: 36px 42px 42px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(30,36,60,.07); }
.setup-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.setup-heading h2 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.setup-heading > p { color: var(--muted); font-size: .8rem; }
fieldset { min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
legend, label { font-size: .8rem; font-weight: 800; }
.check-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.check-grid label { cursor: pointer; }
.check-grid input, .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.check-grid span { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-family: var(--serif); font-size: 1.45rem; transition: .15s; }
.check-grid small { color: var(--muted); font-family: var(--sans); font-size: .58rem; font-weight: 600; }
.check-grid input:checked + span { border-color: var(--blue); background: var(--blue); color: white; box-shadow: 0 7px 16px rgba(29,63,211,.18); }
.check-grid input:checked + span small { color: #dce1ff; }
.check-grid input:focus-visible + span, .segmented input:focus-visible + span { outline: 3px solid rgba(29,63,211,.25); outline-offset: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; padding: 4px; background: var(--paper-deep); border-radius: 12px; }
.segmented span { min-height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 3px 10px rgba(30,36,60,.08); }
.toggle-row { min-height: 50px; margin-top: 10px; display: flex; align-items: center; gap: 11px; color: var(--muted); cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border-radius: 99px; background: #c8c8c2; transition: .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: .2s; }
.toggle-row input:checked + .toggle { background: var(--blue); }
.toggle-row input:checked + .toggle::after { transform: translateX(18px); }
select, input[type="search"], textarea { width: 100%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 11px; }
select { height: 50px; margin-top: 10px; padding: 0 14px; }
input[type="search"] { height: 50px; margin-top: 8px; padding: 0 14px; }
textarea { margin-top: 8px; padding: 13px 14px; resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(29,63,211,.15); }
.setup-panel .button.wide { margin-top: 32px; }

.session-status { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin-bottom: 18px; }
.session-status > div:first-child { display: flex; flex-direction: column; }
.session-status strong { font-size: .82rem; }
.session-status span:not(.session-track span) { color: var(--muted); font-size: .68rem; }
.session-track { height: 5px; overflow: hidden; background: var(--paper-deep); border-radius: 5px; }
.session-track span { display: block; height: 100%; background: var(--blue); transition: width .3s; }
.flashcard { position: relative; width: 100%; min-height: 490px; padding: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 28px; background: var(--white); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; }
.flashcard::before { content: ""; position: absolute; width: 340px; height: 340px; top: -230px; right: -170px; border-radius: 50%; border: 50px solid var(--blue-soft); opacity: .55; }
.card-level { position: absolute; left: 24px; top: 24px; }
.card-face-label { position: absolute; top: 28px; right: 28px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card-main { max-width: 100%; font-family: var(--han); font-size: clamp(4rem, 11vw, 7rem); font-weight: 700; line-height: 1.15; text-align: center; }
.flashcard.meaning-front .card-main { max-width: 720px; font-family: var(--serif); font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 500; letter-spacing: -.04em; }
.card-secondary { margin-top: 12px; color: var(--coral); font-family: var(--serif); font-size: 1.5rem; font-style: italic; }
.reveal-prompt { position: absolute; bottom: 27px; color: #999da8; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.answer-content { width: 100%; display: flex; flex-direction: column; align-items: center; }
.answer-rule { width: 70px; height: 1px; margin: 30px 0 23px; background: var(--line); }
.answer-pinyin { color: var(--coral); font-family: var(--serif); font-size: 1.55rem; font-style: italic; }
.answer-characters { margin-top: 10px; font-family: var(--han); font-size: 2.35rem; }
.answer-meaning { max-width: 680px; margin-top: 12px; color: var(--ink); font-family: var(--serif); font-size: 1.4rem; text-align: center; }
.answer-extra { margin-top: 12px; color: var(--muted); font-size: .75rem; text-align: center; }
.flashcard.revealed { min-height: 550px; cursor: default; }
.flashcard.revealed .card-main { font-size: clamp(3rem, 8vw, 5rem); }
.flashcard.revealed.meaning-front .card-main { font-size: clamp(2rem, 4vw, 3rem); }
.answer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.answer-button { min-height: 72px; padding: 10px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left; transition: .18s; }
.answer-button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(30,36,60,.08); }
.answer-button > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 1.1rem; }
.answer-button.again > span:first-child { background: var(--coral-soft); color: var(--coral); }
.answer-button.know > span:first-child { background: var(--green-soft); color: var(--green); }
.answer-button strong, .answer-button small { display: block; }
.answer-button small { color: var(--muted); font-size: .66rem; }
kbd { padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); font-size: .65rem; }
.keyboard-hint { margin-top: 14px; color: var(--muted); font-size: .66rem; text-align: center; }
.ad-container { min-height: 90px; margin-top: 34px; display: grid; place-items: center; border-top: 1px solid var(--line); color: #a4a5a5; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.ad-container:empty, .ad-container.ad-disabled { display: none; }
.empty-state { min-height: 540px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state.standalone { min-height: 100vh; padding: 24px; }
.empty-state > span { color: var(--blue-soft); font-family: var(--han); font-size: 7rem; line-height: 1; }
.empty-state h1, .empty-state h2 { margin: 8px 0; font-family: var(--serif); font-size: 2.6rem; font-weight: 500; }
.empty-state p { margin: 0 0 25px; color: var(--muted); }
.completion-panel { padding: 70px 40px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.completion-mark { width: 100px; height: 100px; margin: 0 auto 30px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-family: var(--han); font-size: 3rem; }
.completion-panel h2 { margin: 0; font-family: var(--serif); font-size: 3rem; font-weight: 500; }
.completion-stats { max-width: 520px; margin: 40px auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.completion-stats > div + div { border-left: 1px solid var(--line); }
.completion-stats strong, .completion-stats span { display: block; }
.completion-stats strong { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; }
.completion-stats span { color: var(--muted); font-size: .7rem; }
.completion-actions { display: flex; justify-content: center; gap: 12px; }

.dashboard-main { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 110px; }
.progress-intro { width: 100%; display: flex; align-items: end; justify-content: space-between; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats-grid article { min-height: 150px; padding: 24px; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.stats-grid span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.stats-grid strong { margin: auto 0 4px; font-family: var(--serif); font-size: 2.8rem; font-weight: 500; }
.stats-grid small { color: #9a9eaa; }
.progress-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 12px; }
.chart-panel, .level-progress-panel { min-height: 380px; padding: 30px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.panel-heading h2 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.bar-chart { height: 235px; margin-top: 35px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; }
.bar-column { height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; }
.bar-column > span { width: min(38px, 65%); min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--blue-soft); transition: height .4s; }
.bar-column.today > span { background: var(--blue); }
.bar-column strong { font-size: .66rem; }
.bar-column small { color: var(--muted); font-size: .6rem; text-transform: uppercase; }
.level-row { margin-top: 20px; }
.level-row > div { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 800; }
.level-row small { color: var(--muted); }
.level-bar { height: 7px; margin-top: 7px; overflow: hidden; background: var(--paper-deep); border-radius: 8px; }
.level-bar span { display: block; height: 100%; background: var(--coral); border-radius: inherit; }
.signin-callout { margin-top: 12px; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--blue-soft); border: 1px solid #ccd4ff; border-radius: 16px; }
.signin-callout > div { display: flex; align-items: center; gap: 18px; }
.signin-callout h2 { margin: 0; font-family: var(--serif); font-size: 1.8rem; font-weight: 500; }
.signin-callout p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }

.suggest-main { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 110px; }
.suggest-main .page-intro { width: 100%; }
.suggest-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; align-items: start; }
.suggest-form { padding: 36px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.suggest-form fieldset { margin-top: 0; }
.suggest-form fieldset > label, .suggest-form fieldset > .search-control { position: relative; display: block; margin-bottom: 24px; }
.search-control > label { display: block; }
.field-hint { float: right; color: var(--muted); font-size: .65rem; font-weight: 500; }
.auth-required { margin-bottom: 26px; padding: 18px; display: flex; align-items: center; gap: 14px; background: var(--blue-soft); border-radius: 12px; }
.auth-required p { flex: 1; margin: 0; }
.auth-required small { color: var(--muted); }
.search-results { position: absolute; z-index: 10; top: 78px; width: 100%; max-height: 260px; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.search-results button { width: 100%; padding: 11px 14px; display: grid; grid-template-columns: 80px 120px 1fr; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.search-results button:hover { background: var(--blue-soft); }
.search-results .result-hanzi { font-family: var(--han); font-size: 1.2rem; }
.search-results .result-pinyin { color: var(--coral); }
.search-results .result-meaning { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.selected-card { margin-top: 8px; padding: 10px 12px; display: block; background: var(--green-soft); color: var(--green); border-radius: 9px; }
.suggest-aside { display: grid; gap: 14px; }
.aside-note, .aside-process { padding: 30px; border-radius: 18px; }
.aside-note { background: var(--ink); color: white; }
.aside-note h2 { margin: 25px 0 8px; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.aside-note p { margin: 0; color: #b9bdca; font-size: .82rem; }
.aside-process { background: var(--paper-deep); }
.aside-process ol { margin: 20px 0 0; padding: 0; list-style: none; }
.aside-process li { padding: 12px 0; display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); font-size: .78rem; }
.aside-process li span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--white); color: var(--blue); font-weight: 800; }

.legal-page { width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 90px 0 110px; }
.legal-page h1 { margin: 0; font-family: var(--serif); font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 500; letter-spacing: -.06em; line-height: .95; }
.legal-updated { margin: 25px 0 60px; padding: 18px; background: var(--coral-soft); border-radius: 12px; color: #743226; font-size: .78rem; }
.legal-page section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal-page h2 { margin: 0 0 9px; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.legal-page section p { margin: 0; color: var(--muted); }
.privacy-control { margin-top: 18px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--paper-deep); border-radius: 12px; }
.privacy-control span { color: var(--muted); font-size: .72rem; }

.auth-callback { min-height: 100vh; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.auth-callback .eyebrow { margin-top: 26px; }
.auth-callback h1 { margin: 0; font-family: var(--serif); font-size: 3rem; font-weight: 500; }
.auth-callback p:not(.eyebrow) { color: var(--muted); }
.loading-dots { display: flex; gap: 6px; margin-top: 18px; }
.loading-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: pulse 1s infinite alternate; }
.loading-dots i:nth-child(2) { animation-delay: .2s; }.loading-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .2; transform: translateY(-4px); } }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; padding: 13px 17px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .78rem; opacity: 0; transform: translateY(20px); pointer-events: none; transition: .25s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; height: auto; min-height: 72px; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; padding: 0 0 14px; justify-content: center; gap: 20px; overflow-x: auto; }
  .site-nav a { font-size: .72rem; }
  .site-nav a.active::after { bottom: -5px; }
  .hero { grid-template-columns: 1fr; padding-top: 70px; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-visual { width: min(580px, 100%); margin: 0 auto; }
  .level-strip { grid-template-columns: 1fr; text-align: center; }
  .level-pills { justify-content: center; }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-layout, .suggest-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header, .hero, .feature-section, .site-footer, .page-intro, .level-grid, .word-list, .search-callout, .study-main, .dashboard-main, .suggest-main, .legal-page { width: min(100% - 28px, 1220px); }
  .brand span:last-child { display: none; }
  .site-nav { justify-content: flex-start; }
  .hero { min-height: auto; gap: 20px; padding: 60px 0 30px; }
  .hero h1 { font-size: clamp(3.5rem, 18vw, 5.2rem); }
  .hero-actions { flex-direction: column; width: 100%; gap: 5px; }
  .hero-actions .button { width: 100%; }
  .trust-row { justify-content: center; gap: 9px 16px; }
  .hero-visual { min-height: 480px; transform: scale(.92); }
  .hero-visual::before { width: 370px; height: 370px; }
  .orbit { width: 410px; }
  .floating-note { display: none; }
  .level-strip { padding-block: 45px; }
  .feature-section { padding: 80px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article, .feature-grid article + article { padding: 30px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .final-cta { padding-block: 55px; flex-direction: column; align-items: flex-start; gap: 28px; }
  .site-footer { padding: 35px 0; grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .site-footer p { margin: 0; }.footer-links { justify-content: center; }
  .page-intro { padding-top: 65px; }.page-intro h1 { font-size: 3.8rem; }
  .level-grid { grid-template-columns: 1fr; }.search-callout { padding: 30px; align-items: flex-start; flex-direction: column; }
  .word-list a { grid-template-columns: 80px 1fr auto; gap: 12px; }.list-meaning { grid-column: 2 / 3; }.list-pinyin { grid-row: 1; grid-column: 2; }
  .definition-panel ol { columns: 1; }
  .study-main { padding-top: 35px; }.study-header h1 { font-size: 2.8rem; }.setup-panel { padding: 28px 18px; }.setup-heading > p { display: none; }
  .check-grid { grid-template-columns: repeat(3, 1fr); }.form-row { grid-template-columns: 1fr; gap: 0; }
  .flashcard { min-height: 470px; padding: 45px 22px; }.session-status { grid-template-columns: 1fr auto; }.session-track { grid-column: 1 / -1; grid-row: 2; }.answer-actions { grid-template-columns: 1fr; }
  .completion-panel { padding: 45px 18px; }.completion-panel h2 { font-size: 2.4rem; }.completion-stats strong { font-size: 1.9rem; }
  .progress-intro { align-items: flex-start; flex-direction: column; gap: 25px; }.stats-grid { grid-template-columns: 1fr 1fr; }.stats-grid article { min-height: 135px; padding: 18px; }.stats-grid strong { font-size: 2.2rem; }
  .chart-panel, .level-progress-panel { padding: 22px 16px; }.signin-callout, .signin-callout > div { align-items: flex-start; flex-direction: column; }
  .suggest-form { padding: 22px 16px; }.auth-required { align-items: flex-start; flex-wrap: wrap; }.search-results button { grid-template-columns: 65px 1fr; }.search-results .result-meaning { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
