/* TinyMigo单词 — clean and light, phone-first: one centred column, bottom tab bar.
   Mint is the action colour, sky blue the secondary; cards are white with a soft "pressable" edge. */
/* The hidden attribute always wins over a class that sets display (the 语法解析 panel is display:flex). */
[hidden]{display:none!important}
:root{
 --bg:#f3f4f8;--surface:#fff;--surface-2:#f4f5f9;--seg:rgba(40,48,80,.06);--shadow:0 6px 20px -10px rgba(40,48,90,.16),0 1px 3px rgba(40,48,90,.04);--shadow-lg:0 16px 34px -16px rgba(40,48,90,.22),0 2px 6px rgba(40,48,90,.04);--shadow-press:0 2px 6px -2px rgba(40,48,90,.14);--glow:0 10px 22px -10px rgba(255,120,170,.75);--ink:#1b2631;--muted:#7d8995;--line:#e6ebf0;--line-2:#d9e1e8;
 --brand:#ffa3c4;--brand-dark:#ec74a4;--brand-soft:#fff5f9;--brand-light:#ffe2ed;--brand-grad:linear-gradient(180deg,#ffbcd4 0%,#ff9fc1 100%);--brand-edge:#f585b0;
 --sky:#2fa3ff;--sky-dark:#1786e0;--sky-soft:#e7f3ff;
 --amber:#ffae1f;--amber-dark:#e29300;--amber-soft:#fff4dc;
 --coral:#7a879b;--coral-dark:#5f6b7e;--coral-soft:#eef1f5;--danger:#f0454f;--danger-dark:#cf2f39;
 --violet:#8a6cff;--violet-soft:#f0ecff;
 --pink:#ff9fc1;--pink-soft:#fff4f8;
 --st-new:#e6ebf0;--st-learning:var(--amber);--st-review:var(--sky);--st-mastered:var(--brand);
 --lv-n5:#ff9fc1;--lv-n4:var(--sky);--lv-n3:var(--violet);--lv-n2:var(--amber);--lv-n1:#ec74a4;
 --pad-bg:#fff;--pad-grid:#dfe6ec;--pad-guide:rgba(27,38,49,.1);--pad-ink:#1b2631;--pad-answer:#ff9fc1;
 --radius:20px;--col:520px;
 --font:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Noto Sans SC","Microsoft YaHei",sans-serif;
 --round:ui-rounded,"SF Pro Rounded",-apple-system,"PingFang SC",sans-serif;
 --jp:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",Meiryo,sans-serif;
 color-scheme:light;
}
@media (prefers-color-scheme:dark){
 :root{
  --bg:#0f1419;--surface:#1a222b;--surface-2:#222c36;--seg:rgba(255,255,255,.07);--shadow:0 8px 22px -12px rgba(0,0,0,.6);--shadow-lg:0 16px 34px -16px rgba(0,0,0,.7);--shadow-press:0 2px 6px rgba(0,0,0,.5);--glow:0 10px 22px -12px rgba(255,140,185,.5);--ink:#eef3f7;--muted:#8f9ba7;--line:#26313c;--line-2:#303d49;
  --brand:#ff8fb5;--brand-dark:#ff9cc0;--brand-soft:#3a1f2c;--brand-light:#6b3a50;--brand-grad:linear-gradient(180deg,#ff9cc0 0%,#f2739f 100%);--brand-edge:#c4527d;--sky:#55b4ff;--sky-dark:#2a8ad6;--sky-soft:#152b40;
  --amber:#ffbe45;--amber-dark:#d49317;--amber-soft:#3a2d12;--coral:#97a3b6;--coral-dark:#6f7b8d;--coral-soft:#232c37;--danger:#ff6168;--danger-dark:#c93c44;
  --violet:#a38bff;--violet-soft:#26204a;--pink:#ff8db3;--pink-soft:#3a1d28;
  --st-new:#2a3541;--pad-bg:#182028;--pad-grid:#33414e;--pad-guide:rgba(238,243,247,.13);--pad-ink:#eef3f7;--pad-answer:#ff8fb5;
  color-scheme:dark;
 }
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;min-height:100dvh;background:var(--bg);color:var(--ink);font:16px/1.55 var(--font);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
a{color:inherit;text-decoration:none}
button,input{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0;-webkit-user-select:none;user-select:none}
button:disabled{cursor:default;opacity:.4}
:focus-visible{outline:2.5px solid var(--sky);outline-offset:2px;border-radius:12px}
[lang=ja],.jp{font-family:var(--jp)}
h1,h2,p{margin:0}
.icon{width:24px;height:24px;flex:none}
.icon.sm{width:18px;height:18px}
.muted{color:var(--muted)}
.small{font-size:13px}
.center{text-align:center}
.romaji{font-family:var(--round);color:var(--muted);letter-spacing:.02em}
.romaji.big{font-size:20px;color:var(--ink);font-weight:700}
.romaji.huge{font-size:48px;line-height:1.05;color:var(--ink);font-weight:800}
.section-label{font-size:13px;font-weight:800;color:var(--muted);margin:24px 4px 10px;letter-spacing:.06em}
.note{font-size:13px;color:var(--amber-dark);background:var(--amber-soft);border-radius:14px;padding:10px 14px;margin:10px 0;font-weight:600}
.boot{padding:40vh 0;text-align:center;color:var(--muted)}

/* Shell */
.view{max-width:var(--col);margin:0 auto;padding:max(12px,env(safe-area-inset-top)) 16px calc(90px + env(safe-area-inset-bottom));animation:view-in .28s ease-out}
@keyframes view-in{from{opacity:0;transform:translateY(8px)}}
.tabs{position:fixed;z-index:20;left:0;right:0;bottom:0;display:flex;justify-content:center;background:var(--surface);box-shadow:0 -8px 24px -14px rgba(40,48,90,.22);padding:6px max(8px,calc((100% - var(--col))/2)) calc(6px + env(safe-area-inset-bottom))}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;padding:6px 0 4px;font-size:11px;font-weight:700;color:var(--muted);border-radius:14px}
.tabs a .icon{width:26px;height:26px;transition:transform .3s cubic-bezier(.3,1.7,.5,1)}
.tabs a.active{color:var(--brand-dark)}
.tabs a.active .icon{transform:translateY(-2px) scale(1.1)}
.tabs a.tab-fab{color:var(--brand-dark);justify-content:flex-end}
.fab{display:grid;place-items:center;width:58px;height:58px;margin-top:-30px;margin-bottom:2px;border-radius:50%;background:var(--brand-grad);color:#fff;box-shadow:0 0 0 5px var(--surface),var(--glow);transition:transform .2s cubic-bezier(.3,1.6,.5,1)}
.fab .icon{width:28px;height:28px;stroke-width:2}
.tabs a.tab-fab:active .fab{transform:scale(.9)}
.tabs a.tab-fab .icon{transform:none}
.tabs a:active .icon{transform:scale(.85)}
body.immersive .tabs{display:none}
body.immersive .view{padding-bottom:max(16px,env(safe-area-inset-bottom))}

/* Pressable surfaces: a 2px border and a solid bottom edge that collapses on press. */
.card,.list,.quick-item,.mode-card,.tool-card,.shortcut,.book-pill,.book-item,.summary-stats div,.stat-tiles div,.settings,.loop-options,.link-list{background:var(--surface);box-shadow:var(--shadow)}
.topbar{display:flex;align-items:center;gap:8px;min-height:52px;margin:4px 0 10px}
.topbar h1{flex:1;font:800 28px/1.2 var(--round)}
.topbar-gap{width:4px}
.icon-btn{display:inline-grid;place-items:center;width:42px;height:42px;border-radius:50%;color:var(--muted);flex:none;transition:transform .15s,background .15s}
.icon-btn:active{transform:scale(.9);background:var(--surface-2)}
.icon-btn.lg{width:58px;height:58px;color:var(--ink);box-shadow:var(--shadow)}
.card{border-radius:var(--radius);padding:18px;margin-bottom:14px}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:20px 4px 10px}
.card .card-head{margin:0 0 14px}
.card-head h2{font:800 17px/1.3 var(--round)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:50px;padding:0 20px;border-radius:16px;font:800 15px var(--round);letter-spacing:.02em;background:var(--surface);color:var(--ink);box-shadow:var(--shadow);white-space:nowrap;transition:transform .08s,box-shadow .08s}
.btn:active{transform:scale(.97);box-shadow:var(--shadow-press)}
.btn .icon{width:18px;height:18px}
.btn.primary{background:var(--brand-grad);border-color:transparent;color:#fff;text-shadow:0 1px 2px rgba(222,86,140,.5);box-shadow:var(--glow)}
.btn.primary:active{box-shadow:var(--shadow-press)}
.btn.ghost{color:var(--sky-dark)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff;box-shadow:0 10px 20px -10px rgba(240,69,79,.6)}
.btn.block{display:flex;width:100%}
.btn.big{min-height:58px;font-size:17px;border-radius:18px;align-items:center;margin-top:0}
.btn.small{min-height:38px;padding:0 14px;font-size:14px;border-radius:12px;box-shadow:var(--shadow)}
.btn.small.primary{box-shadow:var(--glow)}
.btn.grow{flex:1}
.btn-sub{font-weight:700;opacity:.85;margin-left:6px;font-size:14px}
.link{color:var(--sky-dark);font-size:14px;font-weight:700;padding:6px 4px}
kbd{display:none;font:11px ui-monospace,monospace;opacity:.55;border:1px solid currentColor;border-radius:4px;padding:0 4px;margin-left:6px}
@media (hover:hover) and (pointer:fine){kbd{display:inline-block}}
.badge{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:8px;font:800 12px/1 var(--round);color:#fff;letter-spacing:.03em}
.lv-n5{background:var(--lv-n5)}.lv-n4{background:var(--lv-n4)}.lv-n3{background:var(--lv-n3)}.lv-n2{background:var(--lv-n2)}.lv-n1{background:var(--lv-n1)}
@media (prefers-color-scheme:dark){.badge{color:#0f1419}}
.tag{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:8px;font-size:12px;font-weight:700;background:var(--surface-2);color:var(--muted)}
.tag.new{background:var(--sky-soft);color:var(--sky-dark)}
.tag.again{background:var(--amber-soft);color:var(--amber-dark)}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none;background:var(--st-new)}
.st-learning{background:var(--st-learning)}.st-review{background:var(--st-review)}.st-mastered{background:var(--st-mastered)}.st-new{background:var(--st-new)}
.seg{display:flex;background:var(--seg);border-radius:14px;padding:4px;gap:2px;margin:8px 0}
.seg button{flex:1;min-height:38px;border-radius:10px;font-size:14px;font-weight:700;color:var(--muted);white-space:nowrap;transition:background .2s,color .2s}
.seg button[aria-selected=true],.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-press)}
.seg.small button{min-height:32px;font-size:13px}
.seg.inline{display:inline-flex;margin:0}
.seg.inline button{padding:0 12px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:0 14px;border-radius:999px;background:var(--surface);font-size:14px;font-weight:700;transition:transform .1s}
.chip:active{transform:scale(.95)}
.chip span{color:var(--muted);font-size:12px}
.chip.active{background:var(--brand-soft);color:var(--brand-dark);box-shadow:inset 0 0 0 1.5px var(--brand)}
.chip.active span{color:inherit}
.empty-state{text-align:center;padding:36px 16px;display:flex;flex-direction:column;align-items:center;gap:12px}
.empty-state p:first-child{font-size:17px;font-weight:800}
.switch{appearance:none;-webkit-appearance:none;width:51px;height:31px;border-radius:999px;background:var(--line-2);position:relative;flex:none;cursor:pointer;transition:background .25s;margin:0}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.18);transition:transform .25s cubic-bezier(.3,1.4,.5,1)}
.switch:checked{background:var(--brand)}
.switch:checked::after{transform:translateX(20px)}

/* Word lists */
.list{border-radius:var(--radius);overflow:hidden}
.word-row{display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr) auto;align-items:center;gap:12px;padding:13px 16px;min-height:58px;position:relative}
.word-row::before{content:"";position:absolute;left:16px;right:16px;top:0;height:1px;background:var(--line)}
.list>.word-row:first-child::before,.list>.list-item:first-child .word-row::before{display:none}
.word-row:active{background:var(--surface-2)}
.word-row-main{display:flex;flex-direction:column;min-width:0;max-width:46vw}
.word-row-main .jp{font-size:18px;font-weight:700;line-height:1.3}
.word-row-main .reading{font-size:12.5px;color:var(--muted);font-family:var(--jp)}
.word-row-meaning{font-size:14px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.word-row-meta{display:flex;align-items:center;gap:8px}
.list-item{display:flex;align-items:center}
.list-item .word-row{flex:1;min-width:0}
.list-item .icon-btn{margin-right:4px}
.list-head{display:flex;align-items:center;justify-content:space-between;margin:4px 4px 12px}

/* Today */
.hero-card{position:relative;overflow:hidden;border-radius:26px;padding:18px;background:linear-gradient(165deg,#fff8fb 0%,#ffeaf2 100%);margin:6px 0 14px;animation:rise-in .45s ease-out both}
.hero-top{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:flex-start;gap:8px;min-height:146px}
.hero-text{position:relative;z-index:2;max-width:calc(100% - 132px)}
.hero-text .eyebrow{font-size:13px;color:var(--muted);font-weight:700}
.hero-text h1{font:800 30px/1.15 var(--round);margin-top:2px}
.hero-bubble{position:relative;display:block;margin-top:10px;border-radius:16px 16px 4px 16px;width:max-content;max-width:100%}
.hero-bubble::after{content:"";position:absolute;right:-8px;bottom:7px;border:7px solid transparent;border-left-color:var(--surface);border-right:0}
.hero-card .mascot{position:absolute;right:-4px;top:-6px;z-index:1}
.hero-card .mascot{--xj:138px}
.hero-progress{position:relative;z-index:1;display:flex;align-items:center;gap:12px;margin:4px 0 16px}
.hero-ring{position:relative;width:84px;height:84px;flex:none;border-radius:50%;background:var(--surface)}
.hero-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.hero-ring circle{fill:none;stroke-width:9;stroke-linecap:round}
.hero-ring .ring-bg{stroke:var(--line)}
.hero-ring .ring-fg{stroke:url(#ring-today);transition:stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1)}
.hero-ring .ring-label{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.hero-ring .ring-label b{font:800 21px var(--round)}
.hero-ring .ring-label small{font-size:10.5px;color:var(--muted);font-weight:700}
.hero-stats{flex:1;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.hero-stats div{padding:9px 8px;border-radius:16px;background:var(--surface);display:flex;flex-direction:column;align-items:center}
.hero-stats b{font:800 21px/1.15 var(--round)}
.hero-stats span{font-size:11.5px;color:var(--muted);font-weight:700}
.hero-streak b{color:var(--amber-dark)}
.hero-streak span{display:flex;align-items:center;gap:2px}
.hero-streak .icon{width:13px;height:13px;color:var(--amber);animation:flicker 1.6s ease-in-out infinite;transform-origin:50% 90%}
@keyframes flicker{0%,100%{transform:scale(1) rotate(-3deg)}50%{transform:scale(1.15) rotate(3deg)}}
.hero-cta{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:58px;border-radius:18px;background:var(--brand-grad);color:#fff;font:800 18px var(--round);letter-spacing:.03em;text-shadow:0 1px 2px rgba(222,86,140,.5);box-shadow:var(--glow);transition:transform .08s,box-shadow .08s}
.hero-cta:active{transform:scale(.98);box-shadow:var(--shadow-press)}
.hero-cta small{font:700 14px var(--font);opacity:.9}
.hero-done{position:relative;z-index:1;text-align:center;font-weight:800;color:var(--brand-dark);padding:2px 0}
.hero-done .hero-cta{margin-top:10px}
.book-pill{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:18px;margin-bottom:14px;font-size:14px;animation:rise-in .45s .05s ease-out both}
.book-pill b{font-weight:800}
.book-pill .bar{flex:1;height:8px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.book-pill .bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ffc6dc 0%,#ff93bb 100%)}
.book-pill .muted{font:700 12.5px var(--round)}
.quick{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:0 0 14px}
.quick-item,.mode-card,.tool-card{position:relative;display:flex;flex-direction:column;gap:2px;padding:16px;border-radius:20px;transition:transform .08s,box-shadow .08s;animation:rise-in .45s ease-out both;animation-delay:calc(var(--i,0)*40ms + 80ms)}
.quick-item:active,.mode-card:active,.tool-card:active{transform:scale(.97);box-shadow:var(--shadow-press)}
.quick-item b,.mode-card b,.tool-card b{font:800 16px/1.3 var(--round);margin-top:10px}
.quick-item>span:last-child,.mode-card>span:last-child,.tool-card>span:last-child{font-size:12.5px;color:var(--muted);line-height:1.4}
.ico{display:grid;place-items:center;width:46px;height:46px;border-radius:14px}
.ico .icon{width:25px;height:25px;stroke-width:2.2}
.ico.c1{background:var(--brand-soft);color:var(--brand-dark)}
.ico.c2{background:var(--sky-soft);color:var(--sky-dark)}
.ico.c3{background:var(--amber-soft);color:var(--amber-dark)}
.ico.c4{background:var(--violet-soft);color:var(--violet)}
.ico.c5{background:var(--coral-soft);color:var(--coral)}
.ico.c6{background:var(--pink-soft);color:var(--pink)}
@keyframes rise-in{from{opacity:0;transform:translateY(12px)}}
.stack-bar{display:flex;height:14px;border-radius:999px;background:var(--st-new);overflow:hidden;gap:2px}
.stack-bar i{display:block;height:100%;transform-origin:left;animation:grow-x .9s .2s cubic-bezier(.2,.8,.2,1) both}
@keyframes grow-x{from{transform:scaleX(0)}}
.legend{display:flex;flex-wrap:wrap;gap:8px 16px;list-style:none;margin:14px 0 0;padding:0;font-size:13px;color:var(--muted);font-weight:600}
.legend li{display:flex;align-items:center;gap:6px}
.legend b{color:var(--ink);font-family:var(--round)}
.week{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;align-items:end}
.week-col{display:flex;flex-direction:column;align-items:center;gap:4px}
.week-track{height:100px;width:100%;max-width:26px;display:flex;align-items:flex-end;border-radius:8px;background:var(--surface-2)}
.week-bar{width:100%;border-radius:8px;background:linear-gradient(180deg,#d4c8ff,#a594ff);transform-origin:bottom;animation:grow-y .8s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i)*60ms + 200ms)}
.week-col.today .week-bar{background:linear-gradient(180deg,#ffc6dc,#ff8fb8)}
@keyframes grow-y{from{transform:scaleY(0)}}
.week-col b{font:800 12px var(--round);height:16px}
.week-col small{font-size:12px;color:var(--muted);font-weight:600}
.week-col.today small{color:var(--brand-dark);font-weight:800}

/* Home: a pink block that runs to the top edge, with the progress card overlapping its lower edge. */
.home-head{position:relative;margin:calc(-1*max(12px,env(safe-area-inset-top))) -16px 0;padding:calc(max(12px,env(safe-area-inset-top)) + 8px) 20px 86px;background:linear-gradient(165deg,#ffeaf2 0%,#ffd4e3 60%,#ffc3d8 100%);border-radius:0 0 34px 34px;overflow:hidden;animation:rise-in .45s ease-out both}
.home-head::before{content:"";position:absolute;right:-70px;top:-70px;width:230px;height:230px;border-radius:50%;background:rgba(255,255,255,.38)}
.home-head::after{content:"";position:absolute;left:-70px;bottom:-100px;width:210px;height:210px;border-radius:50%;background:rgba(255,255,255,.24)}
.home-row{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;min-height:34px}
.home-row .eyebrow{font:700 13px var(--round);color:#c9628f}
.book-chip{display:inline-flex;align-items:center;gap:2px;padding:6px 8px 6px 12px;border-radius:999px;background:rgba(255,255,255,.75);font:800 13px var(--round);color:var(--brand-dark);box-shadow:0 4px 12px -6px rgba(220,90,140,.45)}
.book-chip .icon{width:15px;height:15px}
.home-hello{position:relative;z-index:2;max-width:calc(100% - 150px);margin-top:8px}
.home-hello h1{font:800 30px/1.15 var(--round)}
.home-hello .bubble{position:relative;display:block;margin-top:8px}
.home-big{position:relative;z-index:2;margin-top:14px}
.label{font:800 11px var(--round);letter-spacing:.12em;color:#c9628f}
.big{display:flex;align-items:baseline;gap:6px;margin-top:2px}
.big b{font:800 52px/1 var(--round);letter-spacing:-.02em}
.big small{font:700 15px var(--round);color:var(--muted)}
.home-head .mascot{position:absolute;right:2px;bottom:60px;z-index:1;--xj:158px}
.float-card{position:relative;z-index:3;margin:-62px 2px 16px;padding:16px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow-lg);animation:rise-in .45s .06s ease-out both}
.float-row{display:grid;grid-template-columns:auto 1fr 1fr 1fr;align-items:center;gap:4px;margin-bottom:14px}
.float-card .hero-ring{width:72px;height:72px;background:none}
.float-card .hero-ring .ring-label b{font-size:18px}
.stat{display:flex;flex-direction:column;align-items:center;gap:1px}
.stat .emo{font-size:17px;line-height:1.25}
.stat b{font:800 22px/1.1 var(--round)}
.stat small{font-size:11.5px;color:var(--muted);font-weight:700}
.prow{display:grid;grid-template-columns:78px 1fr 56px;align-items:center;gap:10px;min-height:42px}
.prow-label{display:flex;gap:6px;font-size:14px;font-weight:700}
.prow-bar{height:12px;border-radius:999px;background:var(--seg);overflow:hidden}
.prow-bar i{display:block;height:100%;border-radius:inherit;transform-origin:left;animation:grow-x .9s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i)*90ms + 150ms)}
.p-mastered{background:linear-gradient(90deg,#ffc6dc,#ff8fb8)}
.p-review{background:linear-gradient(90deg,#bfe3ff,#5fb4ff)}
.p-learning{background:linear-gradient(90deg,#ffe3ad,#ffb23f)}
.prow b{text-align:right;font:800 17px var(--round)}
.prow b small{font-size:11px;color:var(--muted);margin-left:1px}
.prow-foot{font-size:12px;color:var(--muted);margin-top:8px}
.chart-head{display:flex;justify-content:space-between;align-items:flex-start}
.chart .big b{font-size:34px}
.chart-delta{font-size:12.5px;font-weight:700;color:var(--muted);margin:2px 0 8px}
.chart-delta.up{color:var(--brand-dark)}
.chart-delta.down{color:var(--coral)}
.curve-wrap{position:relative}
.curve{display:block;width:100%;height:128px;overflow:visible}
.curve-line{stroke-dasharray:1400;stroke-dashoffset:1400;animation:draw 1.3s .2s cubic-bezier(.4,0,.2,1) forwards}
@keyframes draw{to{stroke-dashoffset:0}}
.curve-area{animation:fade .8s .7s both}
.curve-dot{position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px #ff8fb8,0 4px 12px rgba(255,120,170,.6);animation:pop .4s 1.3s both}
.curve-dot em{position:absolute;bottom:20px;right:-8px;padding:3px 9px;border-radius:999px;background:var(--ink);color:var(--surface);font:800 12px var(--round);font-style:normal;white-space:nowrap}
.curve-labels{display:grid;margin-top:8px;font-size:11.5px;color:var(--muted);font-weight:700;text-align:center;white-space:nowrap}
.curve-labels .today{color:var(--brand-dark);font-weight:800}
@media (prefers-color-scheme:dark){.home-head{background:linear-gradient(165deg,#2c1d25 0%,#3b2030 100%)}.home-row .eyebrow,.label{color:#ff9cc0}.book-chip{background:rgba(255,255,255,.1)}}

/* Welcome */
.welcome{gap:8px}
.step-dots{display:flex;justify-content:center;gap:6px;padding:10px 0 4px}
.step-dots i{width:7px;height:7px;border-radius:999px;background:var(--line-2);transition:width .3s,background .3s}
.step-dots i.on{width:22px;background:var(--brand-grad)}
.welcome-hero{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px;animation:rise-in .45s ease-out both}
.welcome-hero .mascot{--xj:190px}
.welcome-hero h1{font:800 30px/1.3 var(--round)}
.welcome-hero p{color:var(--muted);font-weight:600;line-height:1.7}
.welcome-head{padding:22px 4px 6px;animation:rise-in .4s ease-out both}
.welcome-head h1{font:800 30px/1.25 var(--round);margin:6px 0}
.welcome-head p{color:var(--muted);font-weight:600}
.welcome-actions{display:flex;flex-direction:column;align-items:center;gap:6px;padding-bottom:8px;margin-top:auto}
.level-wheel{display:flex;gap:6px;overflow-x:auto;scroll-snap-type:x mandatory;padding:40px calc(50% - 70px);margin:10px -16px 0;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.level-wheel::-webkit-scrollbar{display:none}
.level{flex:none;width:140px;height:140px;border-radius:50%;scroll-snap-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--surface);box-shadow:var(--shadow-lg);transition:transform .08s linear,opacity .08s linear;will-change:transform}
.level b{font:800 44px/1 var(--round)}
.level small{font:700 13px var(--round);color:var(--muted);margin-top:4px}
.level[aria-pressed=true]{background:var(--brand-grad);color:#fff;box-shadow:var(--glow),0 0 0 8px var(--brand-soft)}
.level[aria-pressed=true] small{color:rgba(255,255,255,.9)}
.level-info{text-align:center;min-height:64px}
.level-info b{font:800 19px var(--round)}
.level-info p{color:var(--muted);font-weight:600;margin-top:4px}
.goal{text-align:center;margin-top:26px}
.goal .big{justify-content:center}
.goal .big b{font-size:68px;color:var(--brand-dark)}
.goal-hint{color:var(--muted);font-weight:700;margin-top:6px;min-height:22px}
.ruler-wrap{position:relative;margin:26px -16px 12px}
.ruler{display:flex;align-items:flex-end;height:74px;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 calc(50% - 7px);scrollbar-width:none;-webkit-overflow-scrolling:touch;-webkit-mask-image:linear-gradient(90deg,transparent,#000 22%,#000 78%,transparent);mask-image:linear-gradient(90deg,transparent,#000 22%,#000 78%,transparent)}
.ruler::-webkit-scrollbar{display:none}
.ruler i{position:relative;flex:none;width:14px;height:22px;scroll-snap-align:center;display:flex;justify-content:center}
.ruler i::before{content:"";width:2px;height:100%;border-radius:2px;background:var(--line-2)}
.ruler i.major{height:36px}
.ruler i.major::before{background:#c7cfd9}
.ruler i em{position:absolute;bottom:calc(100% + 6px);font:800 12px var(--round);font-style:normal;color:var(--muted)}
.ruler-needle{position:absolute;left:50%;bottom:-6px;width:4px;height:58px;margin-left:-2px;border-radius:4px;background:var(--brand-grad);box-shadow:var(--glow)}
.ruler-needle::after{content:"";position:absolute;left:50%;bottom:-8px;width:14px;height:14px;margin-left:-7px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px #ff9fc1}
.center-chips{justify-content:center;margin-top:12px}

/* Me: swipeable word-book cards and a stepper for the daily goal */
.book-rail{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 16px 14px;margin:0 -16px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.book-rail::-webkit-scrollbar{display:none}
.book-card{flex:none;width:76%;scroll-snap-align:center;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:18px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow);text-align:left;transition:transform .15s}
.book-card:active{transform:scale(.98)}
.book-card-top{display:flex;align-items:center;justify-content:space-between;width:100%}
.book-card-top b{font:800 34px/1 var(--round)}
.book-card-top em{font:800 12px var(--round);font-style:normal;padding:4px 10px;border-radius:999px;background:rgba(255,255,255,.3)}
.book-card-name{font:800 17px var(--round);margin-top:8px}
.book-card small{color:var(--muted);font-size:12.5px;font-weight:600}
.book-card-bar{width:100%;height:8px;border-radius:999px;background:var(--seg);overflow:hidden;margin-top:14px}
.book-card-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ffc6dc,#ff8fb8)}
.book-card-foot{font:700 12.5px var(--round);color:var(--muted)}
.book-card.active{background:linear-gradient(150deg,#ffc0d6 0%,#ff98bd 100%);color:#fff;box-shadow:var(--glow)}
.book-card.active small,.book-card.active .book-card-foot{color:rgba(255,255,255,.92)}
.book-card.active .book-card-bar{background:rgba(255,255,255,.35)}
.book-card.active .book-card-bar i{background:#fff}
.rail-dots{display:flex;justify-content:center;gap:5px;margin-bottom:6px}
.rail-dots i{width:6px;height:6px;border-radius:999px;background:var(--line-2);transition:width .3s,background .3s}
.rail-dots i.on{width:18px;background:var(--brand)}
.section-label .muted{font-weight:600;letter-spacing:0;margin-left:6px}
.stepper{display:flex;align-items:center;gap:4px;background:var(--seg);border-radius:14px;padding:3px}
.stepper button{width:36px;height:34px;border-radius:11px;font:800 20px var(--round);color:var(--brand-dark)}
.stepper button:active{background:var(--surface)}
.stepper b{min-width:34px;text-align:center;font:800 17px var(--round)}

/* Q版小九: the approved sprite sheet, light positional motion and small overlays per mood. */
.mascot{position:relative;display:inline-block;--xj:118px}
.mascot.lg{--xj:150px}
.mascot.xs{--xj:60px}
.mascot-body{position:relative;display:block;touch-action:manipulation}
.xj{display:block;width:var(--xj);aspect-ratio:1;overflow:hidden;transform-origin:50% 96%;animation:xj-breathe 3s ease-in-out infinite}
.xj-frame{display:block;width:100%;height:100%;background:url('assets/xiaojiu-sprite.webp') 0 0/400% 200% no-repeat;filter:drop-shadow(0 6px 8px rgba(214,96,112,.22))}
@keyframes xj-breathe{50%{transform:translateY(-2px) scale(1.015,.985)}}
.mascot.hop .xj,.mascot[data-mood=happy] .xj{animation:xj-hop .55s cubic-bezier(.3,1.6,.5,1)}
.mascot[data-mood=cheer] .xj{animation:xj-jump .6s ease-in-out 4}
.mascot[data-mood=sad] .xj{animation:none;transform:translateY(4px) scale(.97,1.02)}
.mascot[data-mood=think] .xj{animation:none;transform:rotate(-6deg)}
@keyframes xj-hop{0%{transform:scale(1)}25%{transform:scale(1.08,.9)}55%{transform:translateY(-20%) scale(.95,1.06)}80%{transform:scale(1.05,.94)}100%{transform:none}}
@keyframes xj-jump{0%,100%{transform:none}15%{transform:scale(1.06,.92)}50%{transform:translateY(-22%) scale(.96,1.05)}}
.xj-fx{position:absolute;display:none;pointer-events:none}
.xj-fx.sweat{right:14%;top:16%;width:12%;aspect-ratio:3/4;border-radius:50% 50% 50% 50%/60% 60% 40% 40%;background:#9fd8ff;box-shadow:inset -2px -2px 0 #6cbcf0}
.xj-fx.ask{right:2%;top:2%;font:900 calc(var(--xj)*.24)/1 var(--round);color:var(--sky)}
.xj-fx.spark{inset:0;background:radial-gradient(circle at 12% 30%,#ffd166 0 3%,transparent 3.5%),radial-gradient(circle at 90% 26%,#ffd166 0 2.5%,transparent 3%),radial-gradient(circle at 16% 70%,#ffd166 0 2%,transparent 2.5%)}
.mascot[data-mood=sad] .xj-fx.sweat{display:block;animation:xj-drip 1.2s ease-in infinite}
.mascot[data-mood=think] .xj-fx.ask{display:block;animation:xj-bob 1s ease-in-out infinite}
.mascot[data-mood=happy] .xj-fx.spark,.mascot[data-mood=cheer] .xj-fx.spark{display:block;animation:xj-twinkle .5s ease-in-out infinite alternate}
@keyframes xj-twinkle{from{opacity:.3}to{opacity:1}}
@keyframes xj-drip{0%{transform:translateY(-4px);opacity:0}30%{opacity:1}100%{transform:translateY(10px);opacity:0}}
@keyframes xj-bob{50%{transform:translateY(-5px)}}
.bubble{position:absolute;z-index:2;padding:8px 12px;border-radius:16px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:700;line-height:1.45;box-shadow:var(--shadow)}
.bubble:empty{display:none}
.bubble.pop,.combo.pop{animation:pop .4s cubic-bezier(.3,1.7,.5,1)}
@keyframes pop{0%{transform:scale(.6);opacity:0}100%{transform:scale(1);opacity:1}}
.summary .mascot,.empty-state .mascot{align-self:center;margin-top:12px}
.summary .bubble,.empty-state .bubble{position:relative;display:block;margin:0 auto 8px;max-width:270px;text-align:center}
.fx-canvas{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:90}

/* Learning session */
.session{display:flex;flex-direction:column;min-height:calc(100dvh - max(28px,env(safe-area-inset-top) + env(safe-area-inset-bottom) + 16px))}
.session-top{display:flex;align-items:center;gap:12px;min-height:48px;margin-bottom:4px}
.session-title{flex:1;font:800 19px var(--round)}
.progress{flex:1;height:14px;border-radius:999px;background:var(--seg);overflow:hidden}
.progress i{display:block;height:100%;background:linear-gradient(90deg,#ffc6dc 0%,#ff93bb 100%);border-radius:inherit;transition:width .45s cubic-bezier(.2,.8,.2,1);box-shadow:inset 0 -4px 0 rgba(0,0,0,.08)}
.count{font:800 14px var(--round);color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.coach{display:flex;align-items:center;gap:8px;min-height:62px;margin:2px 0 4px}
.coach .bubble{position:relative;border-radius:16px 16px 16px 4px;font-size:13px}
.coach .bubble::before{content:"";position:absolute;left:-8px;bottom:8px;border:7px solid transparent;border-right-color:var(--surface);border-left:0}
.coach .combo{margin-left:auto}
.combo-slot{height:30px;display:flex;justify-content:center;align-items:center}
.combo{display:inline-flex;align-items:center;gap:4px;padding:5px 12px;border-radius:999px;background:var(--amber);color:#fff;font:800 13px var(--round);box-shadow:0 6px 14px -6px rgba(226,147,0,.6)}
.combo .icon{width:15px;height:15px}
.deck{position:relative;flex:1;display:flex;margin:2px 0 28px;min-height:360px}
.deck-ghost{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:28px;background:var(--surface);box-shadow:var(--shadow);transform-origin:50% 100%}
.deck-ghost.g1{transform:translateY(10px) scale(.94)}
.deck-ghost.g2{transform:translateY(20px) scale(.88);opacity:.6}
.flash{position:relative;z-index:1;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:26px 18px;background:var(--surface);border-radius:28px;box-shadow:var(--shadow-lg);touch-action:none;cursor:grab;will-change:transform;overflow:hidden}
.flash.dragging{cursor:grabbing}
.flash.tone-known{box-shadow:inset 0 0 0 2.5px var(--brand),var(--shadow-lg)}
.flash.tone-fuzzy{box-shadow:inset 0 0 0 2.5px var(--amber),var(--shadow-lg)}
.flash.tone-forgot{box-shadow:inset 0 0 0 2.5px var(--coral),var(--shadow-lg)}
.stamp{position:absolute;top:24px;padding:6px 14px;border-radius:12px;border:3px solid currentColor;font:900 22px var(--round);letter-spacing:.04em;pointer-events:none;opacity:0;background:var(--surface)}
.stamp.known{left:20px;color:var(--brand);transform:rotate(-12deg);opacity:var(--known,0)}
.stamp.forgot{right:20px;color:var(--coral);transform:rotate(12deg);opacity:var(--forgot,0)}
.stamp.fuzzy{left:50%;top:auto;bottom:24px;color:var(--amber);transform:translateX(-50%);opacity:var(--fuzzy,0)}
.flash.reveal .stamp{display:none}
/* The answer side grows with its content (meaning, example, 语法解析) and lets a finger scroll the page;
   only the question side keeps every touch for swiping. Horizontal swipes still go to the next word. */
.flash.reveal{overflow:visible;touch-action:pan-y}
.flash-tags{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.flash-word{font-family:var(--jp);font-size:clamp(44px,13.5vw,68px);line-height:1.15;font-weight:700;padding:4px 12px;word-break:keep-all;overflow-wrap:anywhere}
.flash.reveal .flash-word{font-size:clamp(36px,10.5vw,52px)}
.flash-reading{font-size:20px;min-height:30px;font-family:var(--jp);color:var(--muted);font-weight:600}
.flash-reading .romaji{font-size:15px;margin-left:4px}
.sound-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 15px;border-radius:999px;background:var(--sky-soft);color:var(--sky-dark);font-size:13px;font-weight:800;transition:transform .12s}
.sound-btn:active{transform:scale(.93)}
.sound-btn .icon{width:20px;height:20px}
.flash-ask{color:var(--muted);margin-top:14px;font-weight:700}
.flash-meaning{margin-top:8px;padding-top:14px;border-top:2px dashed var(--line);width:min(100%,460px);display:flex;flex-direction:column;gap:12px}
.flash-meaning>p{font:800 23px/1.4 var(--font)}
.flash-meaning small{color:var(--muted);font-weight:700}
.swipe-tip{text-align:center;font-size:12.5px;color:var(--muted);margin-top:12px;font-weight:600}
.swipe-tip .link{margin-left:8px;font-size:12.5px}
/* The finger dot that pulls the card in the first-time swipe demo. */
.swipe-finger{position:absolute;left:50%;top:58%;width:48px;height:48px;margin:-24px 0 0 -24px;border-radius:50%;background:rgba(255,255,255,.6);border:3px solid var(--brand);box-shadow:0 0 0 8px rgba(247,127,176,.18),0 8px 18px -8px rgba(222,86,140,.7);opacity:0;pointer-events:none;z-index:3}
.session-actions{display:flex;gap:10px}
.grade{flex:1;min-height:62px;border-radius:18px;font:800 17px var(--round);display:flex;align-items:center;justify-content:center;gap:3px;background:var(--surface);box-shadow:var(--shadow);transition:transform .08s,box-shadow .08s}
.grade:active{transform:translateY(3px);box-shadow:var(--shadow-press)}
.grade.forgot{color:var(--coral)}
.grade.fuzzy{color:var(--amber-dark)}
.grade.known{background:var(--brand-grad);border-color:transparent;color:#fff;text-shadow:0 1px 2px rgba(222,86,140,.5);box-shadow:var(--glow)}
.grade.known:active{box-shadow:var(--shadow-press)}
.grade .icon{stroke-width:2.4}
.session-actions .btn{min-height:60px;font-size:17px;border-radius:18px}
.session-extra{display:flex;justify-content:center;gap:18px;margin-top:10px}

/* Example sentence */
.example{display:flex;align-items:flex-start;gap:10px;text-align:left;padding:12px 14px;border-radius:16px;background:var(--surface-2)}
.example-play{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:50%;background:var(--surface);color:var(--sky-dark);box-shadow:var(--shadow-press);transition:transform .12s}
.example-play:active{transform:scale(.9)}
.example-ja{font-size:17px;line-height:2.05}
.example-ja ruby rt{font-size:10px;color:var(--muted);letter-spacing:0}
.example-ja mark{background:linear-gradient(transparent 60%,color-mix(in srgb,var(--brand) 38%,transparent) 60%);color:inherit;font-weight:800;border-radius:2px}
.example-zh{font-size:13.5px;color:var(--muted);line-height:1.5}
.example-body{flex:1;min-width:0}
.grammar-toggle{margin-top:8px;padding:5px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand-dark);font:700 12.5px/1.2 var(--font);box-shadow:inset 0 0 0 1px var(--brand-light)}
.grammar-toggle[aria-expanded="true"]{background:var(--surface);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line)}
.grammar-panel{margin-top:10px;margin-left:-44px;padding-top:10px;border-top:1px dashed var(--line-2);display:flex;flex-direction:column;gap:8px}
.grammar-h{font:800 12.5px/1.2 var(--font);color:var(--muted);letter-spacing:.04em}
.grammar-note{font-size:13px;color:var(--muted);list-style:none}
.toks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px;list-style:none;padding:0;margin:0}
.tok{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;padding:11px 12px;border:1px solid var(--line-2);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-press);color:var(--ink);text-align:left;overflow-wrap:anywhere}
.tok-gloss{font:500 13px/1.5 var(--font)}
.tok-jp{font:700 16px/1.25 var(--jp)}
.tok-kana{font-size:10.5px;color:var(--muted);line-height:1.2}
.tok-pos{font:700 11px/1.3 var(--font);color:var(--sky-dark)}
.tok-form{font-size:10.5px;color:var(--muted);line-height:1.3}
.gps{display:flex;flex-direction:column;gap:6px;list-style:none;padding:0;margin:0}
.gp{padding:9px 11px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow-press);display:flex;flex-direction:column;gap:3px}
.gp-head{display:flex;align-items:center;gap:7px}
.gp-lv{font:800 10.5px/1 var(--font);padding:3px 6px;border-radius:6px;background:var(--brand-light);color:var(--brand-dark)}
.gp-pattern{font:800 15px/1.3 var(--jp)}
.gp p{font-size:13px;line-height:1.5;color:var(--ink)}
.gp .gp-in{font-size:12px;color:var(--muted)}

/* Summary */
.summary{display:flex;flex-direction:column;gap:16px;padding:6px 0 24px}
.summary h1{font:800 27px var(--round);text-align:center}
.summary h2{font:800 16px var(--round);margin-top:8px}
.summary.inline{padding-top:18px}
.summary-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:10px}
.summary-stats div{display:flex;flex-direction:column;align-items:center;padding:14px 8px;border-radius:18px}
.summary-stats b{font:800 28px/1.1 var(--round)}
.summary-stats span{color:var(--muted);font-size:13px;font-weight:700}
.summary-actions{display:flex;flex-direction:column;gap:12px;margin-top:8px}
.ring-wrap{position:relative;width:146px;height:146px;align-self:center}
.ring{width:100%;height:100%;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:12;stroke-linecap:round}
.ring-bg{stroke:var(--surface-2)}
.ring .ring-fg{stroke:url(#ring-summary);transition:stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1)}
.ring-label{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ring-label b{font:800 34px/1 var(--round)}
.ring-label small{color:var(--muted);font-size:12.5px;margin-top:4px;font-weight:700}

/* Dictionary and word page */
.search-box{position:sticky;top:max(10px,env(safe-area-inset-top));z-index:5;display:flex;align-items:center;gap:10px;padding:0 16px;height:54px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);border:2px solid var(--surface-2);transition:border-color .2s,background .2s}
.search-box:focus-within{box-shadow:var(--shadow),0 0 0 2px var(--brand-light)}
.search-box .icon{color:var(--muted)}
.search-box input{flex:1;min-width:0;border:0;outline:0;background:none;font-size:17px;height:100%}
.search-hint{font-size:13px;color:var(--muted);min-height:20px;margin:8px 4px;font-weight:600}
.shortcut-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 0}
.shortcut{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:18px;font-weight:800}
.shortcut .ico{width:36px;height:36px;border-radius:12px}
.shortcut .ico .icon{width:19px;height:19px}
.shortcut>span:last-child{margin-left:auto;color:var(--muted);font:800 15px var(--round)}
.word-hero{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:26px 18px}
.word-big{font-family:var(--jp);font-size:clamp(40px,12.5vw,60px);line-height:1.2;font-weight:700}
.word-reading{font-size:19px;color:var(--muted);font-weight:600}
.word-meaning{font-size:20px;font-weight:800;margin-top:4px}
.status-line{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.status-line .muted{font-size:14px}
.row-actions{display:flex;flex-wrap:wrap;gap:8px}

/* Kana */
.kgrid{display:grid;gap:8px;margin:14px 0}
.kgrid.cols-5{grid-template-columns:repeat(5,1fr)}
.kgrid.cols-3{grid-template-columns:repeat(3,1fr)}
.kcell{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;aspect-ratio:1/1.08;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);line-height:1.1;transition:transform .08s,box-shadow .08s;animation:rise-in .35s ease-out both;animation-delay:calc(var(--i,0)*10ms)}
.kcell:active{transform:scale(.93);box-shadow:var(--shadow-press)}
.cols-3 .kcell{aspect-ratio:1.6/1}
.kcell b{font:700 clamp(22px,6.6vw,30px)/1.1 var(--jp)}
.kcell-sub{font:clamp(12px,3.4vw,15px)/1.2 var(--jp);color:var(--muted)}
.kcell small{font:800 10.5px var(--round);color:var(--muted);margin-top:2px}
.kcell .dot{position:absolute;top:6px;right:6px;width:7px;height:7px}
.kcell.blank{background:transparent;border-color:transparent;box-shadow:none}
.kana-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}
.kana-actions .tool-card{padding:14px 12px}
.kana-actions .tool-card b{font-size:14.5px}

/* Sheets */
.sheet-backdrop{position:fixed;inset:0;z-index:50;background:rgba(15,25,35,.38);display:flex;align-items:flex-end;justify-content:center;animation:fade .18s}
.sheet{width:100%;max-width:var(--col);max-height:94dvh;overflow:auto;background:var(--surface);border-radius:26px 26px 0 0;padding:22px 18px calc(18px + env(safe-area-inset-bottom));animation:slide-up .28s cubic-bezier(.2,.8,.2,1)}
.sheet h2{font:800 20px var(--round);margin-bottom:8px}
.sheet p{color:var(--muted)}
.sheet-actions{display:flex;gap:10px;margin-top:20px}
.sheet-actions .btn{flex:1}
@keyframes fade{from{opacity:0}}
@keyframes slide-up{from{transform:translateY(60px);opacity:.5}}
.sheet-head{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:6px}
.sheet-close{position:absolute;right:12px}
.kana-sheet{position:relative;display:flex;flex-direction:column;gap:12px}
.kana-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.kana-pair button{display:flex;flex-direction:column;align-items:center;padding:10px;border-radius:20px;background:var(--surface-2);font:600 64px/1.15 var(--jp);transition:transform .1s}
.kana-pair button:active{transform:scale(.95)}
.kana-pair small{font:700 12px var(--font);color:var(--muted)}
.kana-example{display:flex;align-items:center;gap:10px;justify-content:center;padding:12px;border-radius:16px;background:var(--surface-2);font-size:15px}
.kana-example span:first-child{font-size:18px;font-weight:800}
.kana-example .icon{color:var(--sky)}
.pad-head{display:flex;align-items:center;justify-content:space-between;font-weight:800;font-size:14px}
.pad{display:block;width:min(100%,320px);aspect-ratio:1;margin:0 auto;border-radius:22px;background:var(--pad-bg);box-shadow:inset 0 0 0 2px var(--pad-grid);touch-action:none;cursor:crosshair;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:contain}
.pad-tools{display:flex;gap:8px;justify-content:center}
.pad-tools .btn{min-height:44px;padding:0 14px}
.pad-result{min-height:22px;text-align:center;font-size:14px;color:var(--muted);font-weight:700}
.pad-result.good{color:var(--brand-dark)}.pad-result.ok{color:var(--amber-dark)}.pad-result.bad{color:var(--coral)}
.pad-result .jp{font-size:20px;color:var(--ink)}

/* Practice */
.mode-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:18px}
.match-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:6px 0 14px;perspective:900px}
.tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:92px;padding:10px 6px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow);text-align:center;font-size:15px;font-weight:700;line-height:1.3;transition:transform .1s,box-shadow .1s,border-color .15s,background .15s;animation:deal .42s cubic-bezier(.2,.9,.3,1.2) both;animation-delay:calc(var(--i,0)*35ms)}
@keyframes deal{from{opacity:0;transform:rotateY(90deg) scale(.8)}}
.tile:active{transform:translateY(3px);box-shadow:var(--shadow-press)}
.tile.jp .jp{font-size:20px;font-weight:800;word-break:keep-all}
.tile.jp.long .jp{font-size:16px}
.tile small{font-size:11.5px;color:var(--muted);font-weight:600}
.tile.picked{background:var(--sky-soft);box-shadow:inset 0 0 0 2px var(--sky),var(--shadow)}
.tile.shake{animation:shake .36s;background:var(--coral-soft);box-shadow:inset 0 0 0 2px var(--coral)}
@keyframes shake{25%{transform:translateX(-6px)}50%{transform:translateX(6px)}75%{transform:translateX(-3px)}}
/* After .shake so a matched tile always vanishes, even straight after a miss. */
.tile.done{pointer-events:none;background:var(--brand-soft);box-shadow:inset 0 0 0 2px var(--brand);animation:vanish .55s cubic-bezier(.4,0,.2,1) forwards}
@keyframes vanish{40%{transform:scale(1.08);opacity:1}100%{transform:scale(.3);opacity:0}}
.dictation,.quiz,.write{flex:1;display:flex;flex-direction:column;align-items:center;gap:12px;padding:12px 0 18px}
.big-sound{position:relative;display:grid;place-items:center;width:116px;height:116px;border-radius:50%;background:var(--sky);color:#fff;margin-top:16px;box-shadow:0 14px 26px -12px rgba(47,163,255,.75);transition:transform .08s,box-shadow .08s}
.big-sound::after{content:"";position:absolute;inset:-10px;border-radius:50%;border:3px solid var(--sky-soft);animation:ripple 2.2s ease-out infinite}
@keyframes ripple{from{transform:scale(.9);opacity:1}to{transform:scale(1.25);opacity:0}}
.big-sound:active{transform:scale(.94);box-shadow:var(--shadow-press)}
.big-sound .icon{width:50px;height:50px;stroke-width:2.2}
.big-sound.small{width:70px;height:70px;margin:0}
.big-sound.small::after{display:none}
.big-sound.small .icon{width:32px;height:32px}
.hint-toggle{padding:9px 16px;border-radius:14px;background:var(--surface-2);color:var(--muted);font-size:15px;font-weight:700;max-width:100%}
.answer-form{width:min(100%,440px);display:flex;flex-direction:column;gap:6px;margin-top:8px}
.answer-form input{height:60px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);padding:0 16px;font-size:22px;font-weight:700;text-align:center;outline:0;transition:border-color .2s,background .2s}
.answer-form input:focus{box-shadow:var(--shadow),0 0 0 2px var(--sky)}
.answer-form input.shake{animation:shake .36s;box-shadow:0 0 0 2px var(--coral)}
.preview{min-height:26px;text-align:center;font-size:18px;color:var(--sky-dark);font-weight:700}
.practice-title{font:800 20px/1.4 var(--round);text-align:center}
.dictation .answer-form{margin-top:0}
.dictation .preview:empty{display:none}
.dictation-input-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted)}
.dictation-input-tools .btn{min-height:44px;font-size:12px;padding:8px 10px}
.dictation-keyboard{padding:10px;border-radius:20px;background:var(--surface-2);user-select:none;-webkit-user-select:none;touch-action:manipulation}
.dictation-keyboard .ime-grid{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:none;grid-auto-flow:row;gap:6px;max-height:244px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.dictation-keyboard .ime-fn{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:10px}
.dictation-keyboard .ime-key{min-height:44px;border:0;border-radius:10px;background:var(--surface);color:var(--ink);font:600 19px var(--jp);box-shadow:var(--shadow-press)}
.dictation-keyboard .ime-key.fn{background:var(--sky-soft);color:var(--ink);font-size:16px}
.dictation-keyboard .ime-key:active{background:var(--brand-soft)}
.dictation-keyboard-help{text-align:center;font-size:11px}
.verdict{display:flex;gap:12px;align-items:flex-start;width:min(100%,440px);padding:14px 16px;border-radius:18px;animation:pop .32s cubic-bezier(.3,1.6,.5,1)}
.verdict.good{background:var(--brand-soft);color:var(--brand-dark)}
.verdict.bad{background:var(--coral-soft);color:var(--coral)}
.verdict p{color:var(--ink);font-size:15px}
.verdict .muted{color:var(--muted);font-size:14px}
.quiz-prompt{display:flex;flex-direction:column;align-items:center;gap:4px;padding:22px 16px;min-height:150px;justify-content:center;text-align:center;font-size:20px;font-weight:800;line-height:1.4;width:100%;border-radius:24px;background:var(--surface);box-shadow:var(--shadow);animation:rise-in .3s ease-out}
.quiz-prompt .jp{font-size:clamp(38px,11vw,56px)}
.quiz-prompt .jp.huge{font-size:96px}
.quiz-prompt small{font-size:17px;color:var(--muted);font-weight:500}
.quiz>.big-sound{margin:18px 0 10px}
.options{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%}
.option{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:78px;padding:10px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow);font-size:16px;font-weight:700;line-height:1.35;text-align:center;transition:transform .08s,box-shadow .08s;animation:rise-in .3s ease-out both;animation-delay:calc(var(--i,0)*45ms + 60ms)}
.option:active{transform:translateY(3px);box-shadow:var(--shadow-press)}
.option .jp{font-size:21px;font-weight:800}
.option small{font-size:12px;color:var(--muted)}
.option.correct{background:var(--brand-soft);box-shadow:inset 0 0 0 2px var(--brand);opacity:1;animation:pop .32s cubic-bezier(.3,1.6,.5,1)}
.option.wrong{background:var(--coral-soft);box-shadow:inset 0 0 0 2px var(--coral);opacity:1;animation:shake .36s}
.write-prompt{display:flex;align-items:center;gap:16px}
/* 单词默写: one small box per character above the big pad; after 检查 each box shows the ink,
   the printed character and the similarity. */
.ww-prompt{display:flex;align-items:center;gap:16px;width:min(100%,440px)}
.ww-meaning{font:800 21px/1.35 var(--round);margin-bottom:6px;overflow-wrap:anywhere}
.ww-reading{font:700 26px/1.3 var(--jp);margin-bottom:2px}
.ww-hint{display:block;font-size:13px;font-weight:700;color:var(--sky-dark);padding:2px 0 6px;text-align:left}
.ww-slots{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%}
.ww-slot{position:relative;display:grid;place-items:center;width:52px;height:52px;padding:0;border-radius:14px;background:var(--pad-bg);box-shadow:inset 0 0 0 2px var(--pad-grid)}
.ww-slot.current{box-shadow:inset 0 0 0 3px var(--brand)}
.ww-ink{width:100%;height:100%;pointer-events:none}
.ww-slot.checked{width:68px;height:auto;padding:6px 4px 5px;gap:3px}
.ww-slot.checked .ww-ink{width:52px;height:52px}
.ww-answer{font:600 22px/1.1 var(--jp);color:var(--ink)}
.ww-slot small{font:800 12px var(--round);color:var(--coral)}
.ww-slot.good small{color:var(--brand-dark)}.ww-slot.ok small{color:var(--amber-dark)}
.ww-slot.good{box-shadow:inset 0 0 0 2px var(--brand-light)}.ww-slot.bad{box-shadow:inset 0 0 0 2px var(--coral-soft)}
.word-write .pad{width:min(100%,300px)}
.write-prompt .seg{margin-top:6px}
.loop-stage{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:26px 12px;min-height:300px;background:var(--surface);box-shadow:var(--shadow);border-radius:28px;margin:8px 0 18px}
.loop-word{font-family:var(--jp);font-size:clamp(46px,14vw,78px);line-height:1.15;font-weight:700;animation:rise-in .3s ease-out}
.loop-meaning{font-size:22px;font-weight:800;transition:opacity .4s,filter .4s}
.loop-meaning.veiled{opacity:.2;filter:blur(7px)}
.eq{display:flex;align-items:flex-end;gap:4px;height:22px;margin-top:6px}
.eq i{width:5px;height:6px;border-radius:3px;background:var(--brand);opacity:.35}
.eq.on i{opacity:1;animation:eq .8s ease-in-out infinite}
.eq.on i:nth-child(2){animation-delay:.15s}.eq.on i:nth-child(3){animation-delay:.3s}.eq.on i:nth-child(4){animation-delay:.45s}.eq.on i:nth-child(5){animation-delay:.6s}
@keyframes eq{50%{height:22px}}
.loop-controls{display:flex;align-items:center;justify-content:center;gap:24px;margin-bottom:18px}
.play-btn{display:grid;place-items:center;width:80px;height:80px;border-radius:50%;background:var(--brand-grad);color:#fff;box-shadow:var(--glow);transition:transform .08s,box-shadow .08s}
.play-btn:active{transform:scale(.93);box-shadow:var(--shadow-press)}
.play-btn .icon{width:34px;height:34px;fill:currentColor}
.loop-options,.settings{display:flex;flex-direction:column;border-radius:var(--radius);padding:2px 18px}
.option-row,.setting{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;border-top:1px solid var(--line);font-weight:700}
.option-row:first-child,.setting:first-child{border-top:0}
.setting small{display:block;font-size:12px;color:var(--muted);font-weight:500}

/* Me */
.stat-tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.stat-tiles div{display:flex;flex-direction:column;padding:14px 16px;border-radius:20px}
.stat-tiles b{font:800 28px/1.15 var(--round)}
.stat-tiles div:nth-child(1) b{color:var(--brand-dark)}
.stat-tiles div:nth-child(2) b{color:var(--sky-dark)}
.stat-tiles div:nth-child(3) b{color:var(--amber-dark)}
.stat-tiles div:nth-child(4) b{color:var(--violet)}
.stat-tiles span{font-size:12.5px;color:var(--muted);font-weight:700}
.book-list{display:flex;flex-direction:column;gap:10px}
.book-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:4px 12px;padding:14px 16px;border-radius:18px;text-align:left;transition:transform .08s}
.book-item:active{transform:translateY(2px)}
.book-item.active{box-shadow:inset 0 0 0 2px var(--brand),var(--shadow);background:var(--brand-soft)}
.book-text{display:flex;flex-direction:column}
.book-text b{font:800 16px var(--round)}
.book-text small{color:var(--muted);font-size:12.5px;font-weight:600}
.book-count{font:700 13px var(--round);color:var(--muted)}
.book-count b{color:var(--ink);font-size:15px}
.book-bar{grid-column:1/-1;height:8px;border-radius:999px;background:var(--surface-2);overflow:hidden;margin-top:8px}
.book-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ffc6dc 0%,#ff93bb 100%)}
.link-list{border-radius:var(--radius);padding:2px 0}
.link-list a,.link-list button,.link-list label{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:0 18px;border-top:1px solid var(--line);font-size:15px;font-weight:700;cursor:pointer;text-align:left}
.link-list>:first-child{border-top:0}
.link-list .icon{width:20px;height:20px;color:var(--muted)}
.link-list span{flex:1}
.link-list b{color:var(--muted);font:800 15px var(--round)}
.danger-text{color:var(--danger)}
.danger-text .icon{color:var(--danger)!important}
.about{font-size:12.5px;line-height:1.75;color:var(--muted);margin:22px 4px 8px}
.about a{color:var(--sky-dark)}

/* Sign-in gate (the app is sold): 小九 on top, one short form, links underneath. */
.gate{gap:6px;padding-bottom:8px}
.gate-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:18px 4px 8px;animation:rise-in .4s ease-out both}
.gate-hero .mascot{--xj:120px}
.gate-hero h1{font:800 26px/1.3 var(--round)}
.gate-hero p{color:var(--muted);font-weight:600;line-height:1.7;max-width:340px}
.gate-form{display:flex;flex-direction:column;gap:14px;background:var(--surface);box-shadow:var(--shadow);border-radius:var(--radius);padding:20px 18px;margin-top:6px}
.gate-links{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;margin-top:6px}
.gate-who{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--muted);font-weight:600;margin-top:4px}
.gate-foot{margin-top:auto;padding-top:20px;text-align:center;font-size:12px;color:var(--muted)}
.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:800;color:var(--muted)}
.field span small{font-weight:600;margin-left:6px}
.field>small{font-weight:600}
.field input{height:52px;border-radius:14px;border:2px solid var(--surface-2);background:var(--surface-2);padding:0 14px;font-size:17px;font-weight:600;color:var(--ink);outline:0;min-width:0;transition:border-color .15s,background .15s}
.field input:focus{border-color:var(--brand-light);background:var(--surface)}
.field.compact input{height:46px;font-size:16px}
.field.grow{flex:1}
.code-input{font:700 20px/1 ui-monospace,"SF Mono",Menlo,monospace!important;letter-spacing:.12em;text-transform:uppercase;text-align:center}
.form-error{color:var(--danger);background:color-mix(in srgb,var(--danger) 10%,transparent);border-radius:12px;padding:10px 12px;font-size:14px;font-weight:700}
.form-note{color:var(--sky-dark);background:var(--sky-soft);border-radius:12px;padding:10px 12px;font-size:14px;font-weight:700}
.account-row{display:flex;align-items:center;gap:12px;min-height:64px;padding:10px 18px}
.account-row span{display:flex;flex-direction:column;min-width:0}
.account-row b{color:var(--ink)!important;font:700 15px var(--font)!important;overflow:hidden;text-overflow:ellipsis}
.account-row small{font-size:12.5px;color:var(--muted);font-weight:600}

/* 兑换码管理 */
.card-title{font:800 17px var(--round);margin-bottom:12px}
.code-make{display:flex;flex-direction:column;gap:12px}
.code-make .card-title{margin:0}
.code-make-row{display:flex;gap:10px}
.code-make-row .field:first-child{width:86px;flex:none}
.code-fresh{border:2px dashed var(--brand-light)}
.code-fresh-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.code-fresh-head .card-title{margin:0}
.code-fresh-list{list-style:none;margin:8px 0 0;padding:0}
.code-fresh-list li{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-top:1px solid var(--line)}
.code-fresh-list li:first-child{border-top:0}
.code-fresh-list code,.code-row code{font:700 16px ui-monospace,"SF Mono",Menlo,monospace;letter-spacing:.06em}
.stat-tiles.three{grid-template-columns:repeat(3,1fr);margin-top:6px}
.stat-tiles.three b{font-size:24px}
.search-box.small{position:static;height:46px;margin:6px 0 12px}
.search-box.small input{font-size:15px}
.code-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.code-row{background:var(--surface);box-shadow:var(--shadow);border-radius:18px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}
.code-row-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.code-status{font-size:12px;font-weight:800;border-radius:8px;padding:3px 8px;background:var(--surface-2);color:var(--muted)}
.st-unused .code-status{background:var(--brand-soft);color:var(--brand-dark)}
.st-used .code-status{background:var(--sky-soft);color:var(--sky-dark)}
.st-revoked .code-status{background:var(--amber-soft);color:var(--amber-dark)}
.st-void code,.st-revoked code{color:var(--muted);text-decoration:line-through}
.code-note{font-size:14px;font-weight:700}
.code-meta{font-size:12.5px;color:var(--muted);font-weight:600;overflow-wrap:anywhere}
.code-actions{display:flex;gap:8px;margin-top:6px}
.code-actions:empty{display:none}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;margin:16px 0;font-size:13px;color:var(--muted);font-weight:700}

.toast{position:fixed;left:50%;bottom:calc(92px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:11px 20px;border-radius:999px;font-size:14px;font-weight:700;opacity:0;pointer-events:none;transition:.25s;z-index:60}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media (prefers-color-scheme:dark){.hero-card{background:linear-gradient(165deg,#2a1b23 0%,#3a1f2c 100%)}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
