:root {
  --ink:#23201c; --muted:#777169; --paper:#fffdf9; --cream:#fff7e9;
  --red:#d84a3a; --red-dark:#a92d25; --line:#eadfce; --green:#3b8169;
  --tone1:#ee0000; --tone2:#00bf1a; --tone3:#1f18ff; --tone4:#a000d8; --tone5:#808080;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:linear-gradient(160deg,#fffaf0 0,#f8f1e6 100%); min-height:100vh; }
button,input { font:inherit; }
button { cursor:pointer; }
.topbar { height:72px; padding:0 max(20px,calc((100vw - 1050px)/2)); display:flex; align-items:center; justify-content:space-between; background:rgba(255,253,249,.9); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; backdrop-filter:blur(10px); }
.brand { display:flex; align-items:center; gap:10px; color:var(--ink); text-decoration:none; font-weight:800; font-size:21px; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; color:white; background:var(--red); font-family:serif; font-size:24px; }
.profile-switch { display:flex; gap:7px; }
.profile { border:1px solid var(--line); background:white; color:var(--muted); width:38px; height:38px; border-radius:50%; font-weight:800; }
.profile.active { color:white; background:var(--ink); border-color:var(--ink); }
main { width:min(calc(100% - 32px),1050px); margin:0 auto; padding:34px 0 110px; overflow:hidden; }
.hero { display:grid; grid-template-columns:1.3fr .7fr; gap:24px; align-items:stretch; }
.hero-copy,.today { background:var(--paper); border:1px solid var(--line); border-radius:26px; padding:30px; box-shadow:0 12px 35px rgba(80,55,28,.06); }
.eyebrow { color:var(--red-dark); text-transform:uppercase; font-size:12px; letter-spacing:.12em; font-weight:800; }
h1 { margin:8px 0 12px; font-family:Georgia,serif; font-size:clamp(34px,5vw,58px); line-height:1.03; }
h2 { margin:0 0 18px; font-size:25px; }
p { color:var(--muted); line-height:1.6; }
.primary,.secondary { border:0; border-radius:14px; padding:13px 18px; font-weight:750; }
.primary { background:var(--red); color:white; box-shadow:0 7px 20px rgba(216,74,58,.23); }
.secondary { background:#f2e9dc; color:var(--ink); }
.hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.hero-actions button:not(.primary) { border:1px solid var(--line); border-radius:14px; padding:13px 18px; background:white; color:var(--ink); font-weight:750; }
.today { background:var(--ink); color:white; }
.today p { color:#cfc8bd; }
.today .primary { width:100%; }
.big-number { font-size:52px; font-family:Georgia,serif; }
.section-title { display:flex; justify-content:space-between; align-items:end; margin:36px 0 14px; }
.section-title h2 { margin:0; }
.section-title button { border:0; background:none; color:var(--red-dark); font-weight:750; }
.module-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.module-card { text-align:left; border:1px solid var(--line); border-radius:22px; padding:22px; background:var(--paper); transition:.18s; }
.module-card:hover { transform:translateY(-2px); box-shadow:0 12px 26px rgba(80,55,28,.09); }
.module-icon { display:grid; place-items:center; width:52px; height:52px; border-radius:17px; background:#f9e2da; color:var(--red-dark); font-family:serif; font-size:30px; }
.module-card:nth-child(2) .module-icon { background:#dfeee8; color:#286651; }
.module-card h3 { margin:16px 0 6px; font-size:20px; }
.module-card p { margin:0 0 16px; }
.progress { height:7px; border-radius:10px; background:#eee4d6; overflow:hidden; }
.progress i { display:block; height:100%; width:var(--progress); background:var(--red); border-radius:inherit; }
.tag { display:inline-block; padding:6px 9px; border-radius:9px; background:#f2e9dc; color:#645c52; font-size:12px; font-weight:700; margin:4px 4px 0 0; }
.back { border:0; background:none; padding:0; color:var(--red-dark); font-weight:750; margin-bottom:20px; }
.lesson-list { display:grid; gap:10px; }
.lesson { display:flex; gap:16px; align-items:center; background:var(--paper); border:1px solid var(--line); border-radius:17px; padding:15px; }
.lesson-num { width:42px; height:42px; flex:0 0 auto; display:grid; place-items:center; border-radius:13px; background:#f7eadb; font-family:Georgia,serif; font-size:20px; }
.lesson strong { display:block; }
.lesson small { color:var(--muted); }
.lesson button { margin-left:auto; border:0; border-radius:12px; background:var(--ink); color:white; padding:9px 12px; }
.practice-shell { max-width:680px; margin:0 auto; }
.lead { margin-top:-4px; }
.activity-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-top:24px; }
.activity-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-height:210px; padding:24px; text-align:left; border:1px solid var(--line); border-radius:24px; background:var(--paper); }
.activity-card:hover { border-color:var(--red); box-shadow:0 12px 30px rgba(80,55,28,.08); }
.activity-card b { display:grid; place-items:center; width:54px; height:54px; border-radius:17px; background:#f9e2da; color:var(--red-dark); font-family:serif; font-size:30px; }
.activity-card strong { margin-top:8px; font-size:20px; }
.activity-card span { color:var(--muted); line-height:1.5; }
.mode-block { margin-top:14px; }
.mode-block>span { display:block; margin-bottom:7px; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.mode-row { display:flex; gap:8px; overflow:auto; padding-bottom:10px; }
.mode { white-space:nowrap; border:1px solid var(--line); border-radius:12px; background:var(--paper); padding:9px 12px; }
.mode.active { border-color:var(--red); color:var(--red-dark); background:#fff0eb; }
.flashcard { min-height:385px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; padding:30px; margin-top:14px; background:var(--paper); border:1px solid var(--line); border-radius:28px; box-shadow:0 15px 40px rgba(80,55,28,.08); }
.prompt-label { color:var(--muted); font-size:13px; text-transform:uppercase; letter-spacing:.1em; }
.hanzi { margin:20px 0 8px; font-size:clamp(42px,9vw,76px); font-family:"Noto Serif SC","Songti SC",serif; }
.translation { font-size:29px; font-weight:700; margin:20px 0; }
.pinyin { font-size:24px; font-weight:700; }
.answer { margin-top:22px; border-top:1px solid var(--line); padding-top:20px; width:100%; }
.answer[hidden] { display:none; }
.example-box { display:grid; gap:5px; margin-top:20px; padding:16px; text-align:left; border-radius:16px; background:var(--cream); }
.example-box span { color:var(--red-dark); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.example-box strong { font-family:"Noto Serif SC","Songti SC",serif; font-size:23px; }
.example-box em { color:var(--muted); font-style:normal; }
.example-box small { color:var(--ink); font-size:14px; }
.rating { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.rating button { border:0; border-radius:13px; padding:13px; font-weight:750; }
.rating button:nth-child(1){background:#f8d8d3}.rating button:nth-child(2){background:#f5e7b8}.rating button:nth-child(3){background:#d7ebdf}
.settings-card { max-width:650px; background:var(--paper); border:1px solid var(--line); border-radius:22px; padding:24px; }
.color-list { display:grid; gap:12px; }
.color-row { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:10px; }
.color-row input { width:50px; height:36px; border:0; padding:0; background:transparent; }
.bottom-nav { position:fixed; z-index:6; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,620px); display:flex; justify-content:space-around; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:rgba(35,32,28,.96); border-radius:22px 22px 0 0; }
.bottom-nav button { border:0; background:none; color:#aaa39a; font-size:22px; min-width:70px; }
.bottom-nav span { display:block; font-size:11px; margin-top:2px; }
.bottom-nav button.active { color:white; }
.tone-1{color:var(--tone1)}.tone-2{color:var(--tone2)}.tone-3{color:var(--tone3)}.tone-4{color:var(--tone4)}.tone-5{color:var(--tone5)}
@media(max-width:700px){.hero,.module-grid,.activity-grid{grid-template-columns:1fr}.hero-copy,.today{padding:23px}.topbar{padding:0 18px}main{padding-top:22px}.lesson{align-items:flex-start}.lesson button{display:none}.activity-card{min-height:0}.flashcard{padding:22px 18px}}
