:root{
  --bg:#f5f3ee; --card:#fffdf9; --ink:#1d2a27; --muted:#6b7672; --line:#e4e0d6;
  --accent:#1f6f5c; --accent-2:#e8f2ee; --warn:#b7791f; --bad:#c0392b; --good:#1f8a5c;
  --radius:12px; --shadow:0 1px 2px rgba(30,40,35,.06),0 4px 14px rgba(30,40,35,.05);
}
@media (prefers-color-scheme:dark){
  :root{--bg:#121816;--card:#1a2220;--ink:#e6ece9;--muted:#93a29c;--line:#2a3532;--accent:#5cc2a2;--accent-2:#1f2f2a;--shadow:none}
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
a{color:var(--accent)}
.wrap{max-width:860px;margin:0 auto;padding:0 18px 80px}
header.top{display:flex;align-items:center;gap:14px;padding:16px 0;flex-wrap:wrap}
.brand{font-weight:800;font-size:20px;letter-spacing:-.3px;color:var(--accent);text-decoration:none}
.brand small{font-weight:500;color:var(--muted);font-size:13px;margin-left:6px}
nav.tabs{display:flex;gap:4px;margin-left:auto;flex-wrap:wrap}
nav.tabs button{background:none;border:0;padding:8px 12px;border-radius:8px;color:var(--muted);font:inherit;cursor:pointer}
nav.tabs button.on{background:var(--accent-2);color:var(--accent);font-weight:600}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;margin:14px 0;box-shadow:var(--shadow)}
h1{font-size:26px;margin:8px 0}
h2{font-size:19px;margin:0 0 10px}
h3{font-size:16px;margin:0 0 6px}
.muted{color:var(--muted)}
.small{font-size:13px}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.grow{flex:1}
label{display:block;font-size:14px;color:var(--muted);margin:10px 0 4px}
input[type=text],input[type=email],input[type=password],input[type=number],textarea,select{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}
textarea{min-height:110px;resize:vertical}
input:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:-1px}
.btn{display:inline-flex;align-items:center;gap:6px;background:var(--accent);color:#fff;border:0;border-radius:8px;padding:10px 18px;font:inherit;font-weight:600;cursor:pointer}
.btn.ghost{background:transparent;color:var(--accent);border:1px solid var(--accent)}
.btn.small{padding:6px 12px;font-size:14px}
.btn:disabled{opacity:.55;cursor:wait}
.btn.big{padding:14px 26px;font-size:17px}
.pill{display:inline-block;padding:2px 10px;border-radius:99px;font-size:13px;background:var(--accent-2);color:var(--accent)}
.pill.warn{background:#fbf1de;color:var(--warn)}
.pill.bad{background:#fbe5e2;color:var(--bad)}
.banner{background:#fbf1de;color:#7a5414;border-radius:10px;padding:10px 14px;margin:12px 0;font-size:14px}
@media (prefers-color-scheme:dark){.banner{background:#3a2f1a;color:#f0d9a8}.pill.warn{background:#3a2f1a}.pill.bad{background:#3a1f1c}}
.err{color:var(--bad);font-size:14px;min-height:20px;margin-top:8px}
.progress{height:10px;background:var(--line);border-radius:99px;overflow:hidden}
.progress>div{height:100%;background:var(--accent);transition:width .4s}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}
.stat{background:var(--accent-2);border-radius:10px;padding:12px}
.stat b{display:block;font-size:24px;color:var(--accent)}

/* word cards */
.words{display:grid;gap:10px}
.word{border:1px solid var(--line);border-radius:10px;padding:12px 14px;background:var(--bg)}
.word .head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.word .w{font-size:21px;font-weight:700}
.word .ph{color:var(--muted);font-size:14px}
.word .tr{font-weight:600;color:var(--accent)}
.hidetr .word .tr,.hidetr .word .extr{filter:blur(6px);cursor:pointer}
.word .def{margin:4px 0}
.word ul{margin:6px 0;padding-left:18px}
.word .more{font-size:14px}
.word details summary{cursor:pointer;color:var(--accent);font-size:14px;margin-top:4px}
.icon{background:none;border:0;cursor:pointer;font-size:17px;padding:2px 4px;color:var(--muted)}
.x{margin-left:auto}

/* quiz */
.qsec{margin:22px 0 8px;font-weight:700;color:var(--accent);border-bottom:1px solid var(--line);padding-bottom:4px}
.q{padding:12px 0;border-bottom:1px dashed var(--line)}
.q .p{font-size:18px;margin-bottom:6px}
.q .p.big{font-size:22px;font-weight:700}
.opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
.opt{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:8px;padding:10px;text-align:left;font:inherit;cursor:pointer}
.opt.sel{border-color:var(--accent);background:var(--accent-2);font-weight:600}
.res .q.ok{border-left:4px solid var(--good);padding-left:10px}
.res .q.no{border-left:4px solid var(--bad);padding-left:10px}
.ans{font-size:14px;margin-top:4px}
.score{font-size:42px;font-weight:800}
.eval{background:var(--accent-2);border-radius:10px;padding:12px 14px;margin:10px 0}
.sticky{position:sticky;bottom:12px;display:flex;justify-content:flex-end;margin-top:16px}
.sticky .btn{box-shadow:0 6px 18px rgba(0,0,0,.18)}

/* history */
.bars{display:flex;align-items:flex-end;gap:3px;height:90px;margin:10px 0}
.bars div{flex:1;background:var(--accent);border-radius:3px 3px 0 0;min-height:2px;opacity:.85}
table{width:100%;border-collapse:collapse;font-size:15px}
td,th{padding:7px 6px;border-bottom:1px solid var(--line);text-align:left}
th{color:var(--muted);font-weight:500;font-size:13px}

/* landing */
.hero{padding:30px 0 10px}
.hero h1{font-size:34px;line-height:1.2;letter-spacing:-.5px}
.feature{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.auth{max-width:420px}
.switch{display:flex;gap:4px;margin-bottom:6px}
.switch button{flex:1;background:var(--bg);border:1px solid var(--line);padding:9px;border-radius:8px;font:inherit;cursor:pointer;color:var(--muted)}
.switch button.on{background:var(--accent-2);color:var(--accent);border-color:var(--accent);font-weight:600}
.check{display:flex;gap:8px;align-items:flex-start;font-size:14px;color:var(--muted);margin-top:12px}
.check input{margin-top:4px}
.hidden{display:none!important}
.spin{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:s .8s linear infinite}
@keyframes s{to{transform:rotate(360deg)}}

/* v2: four skills, speech, calendar, insights */
.soundtip{color:#7a5414;margin:2px 0}
@media (prefers-color-scheme:dark){.soundtip{color:#f0d9a8}}
.icon.playing,.btn.playing{color:var(--accent);transform:scale(1.15)}
.listen{display:flex;align-items:center;gap:6px;margin:4px 0 8px}
.listen .icon{font-size:26px}
.skillnav{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 0}
.skillnav a{text-decoration:none}
.skillsec{margin:28px 0 4px;font-size:20px;font-weight:800;color:var(--ink);padding:8px 12px;background:var(--accent-2);border-radius:8px}
.passage{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:12px 16px;margin:8px 0;line-height:1.75;font-size:17px}
.speak{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.btn.rec{background:#c0392b}
.btn.rec.on{animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.6}}
.speakres{flex-basis:100%;margin-top:6px}
.speakscore b{font-size:26px}
.good{color:var(--good)} .mid{color:var(--warn)} .low{color:var(--bad)}
.sw{display:inline-block;padding:1px 5px;border-radius:5px;margin:2px 0;font-weight:600}
.sw.good{background:#e3f4ea}.sw.mid{background:#fbf1de}.sw.low{background:#fbe5e2}
@media (prefers-color-scheme:dark){.sw.good{background:#1d3328}.sw.mid{background:#3a2f1a}.sw.low{background:#3a1f1c}}
.sw sub{font-weight:400;font-size:11px;margin-left:2px}
.sbar{display:grid;grid-template-columns:120px 1fr 90px;gap:10px;align-items:center;margin:6px 0;font-size:14px}
.sbar b{text-align:right}
.progress .d90{background:#1f8a5c}.progress .d75{background:#6aae7c}.progress .d60{background:#d6a440}.progress .d0{background:#c0392b}.progress .dnone{background:transparent}
.progress.two{position:relative;height:14px}
.progress.two>div{position:absolute;left:0;top:0;height:7px}
.progress.two>div.prev{top:7px;background:var(--muted);opacity:.35}
.up{color:var(--good);font-size:12px}.down{color:var(--bad);font-size:12px}
.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;margin-top:12px}
.cal-h{text-align:center;font-size:12px;color:var(--muted)}
.cal-d{aspect-ratio:1/0.82;border:0;border-radius:8px;font:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;cursor:pointer;padding:0}
.cal-d span{font-weight:700}.cal-d small{font-size:11px;opacity:.9}
.cal-d.d90{background:#1f8a5c}.cal-d.d75{background:#6aae7c}.cal-d.d60{background:#d6a440}.cal-d.d0{background:#c0392b}
.cal-d.dnone{background:var(--line);color:var(--muted);cursor:default}
.cal-d.future{background:transparent;color:var(--muted);border:1px dashed var(--line);cursor:default}
.cal-d.today{outline:2px solid var(--ink);outline-offset:1px}
.dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:4px;vertical-align:-1px}
.dot.d90{background:#1f8a5c}.dot.d75{background:#6aae7c}.dot.d60{background:#d6a440}.dot.d0{background:#c0392b}.dot.dnone{background:var(--line)}
.daybox{border:1px solid var(--line);border-radius:10px;padding:12px;margin-top:12px}
.stat span{display:block}
.chart{width:100%;height:auto}
.chart .grid{stroke:var(--line)}.chart text{font-size:10px;fill:var(--muted)}
.chart polyline{fill:none;stroke-width:1.5;opacity:.55}
.chart polyline.total{stroke:var(--ink);stroke-width:2.5;opacity:1}
.chart .dotc{fill:var(--ink)}
.sk-L{stroke:#3b7dd8;color:#3b7dd8}.sk-S{stroke:#c0392b;color:#c0392b}.sk-R{stroke:#1f8a5c;color:#1f8a5c}.sk-W{stroke:#b7791f;color:#b7791f}
.legend{display:flex;gap:12px}.lg::before{content:"";display:inline-block;width:14px;height:3px;background:currentColor;margin-right:4px;vertical-align:middle}
.lg.total{color:var(--ink)}
.methods li{margin:6px 0}
.wc{text-align:right}
