/* TinyMigo日语 — the TinyMigo单词 look (white cards, 小九 pink) grown into a full course app.
   Phone first: one centred column, bottom tabs with 地图 raised in the middle. From 900px the column
   widens and pages that benefit (today, map, scene shelves) go multi-column. */
:root{
 --bg:#f4f4f8;--surface:#fff;--surface-2:#f5f5f9;--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,.24),0 2px 6px rgba(40,48,90,.05);
 --ink:#1d2430;--muted:#626c78;--line:#e7eaf0;--line-2:#d9dee6;
 --brand:#ff9fc1;--brand-dark:#b72f65;--brand-soft:#fff4f8;--brand-light:#ffe2ed;--brand-grad:#ff9fc1;
 --good:#1f8a57;--good-soft:#e6f5ec;--warn:#b26a00;--warn-soft:#fff3dc;--bad:#d2434d;--bad-soft:#fdecee;--sky:#2f8fe0;--sky-soft:#e8f3ff;
 --radius:20px;--col:560px;
 --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:#101318;--surface:#1a2029;--surface-2:#222a35;--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);
  --ink:#edf1f6;--muted:#97a2ae;--line:#28313c;--line-2:#323d49;
  --brand:#ff8fb5;--brand-dark:#ff9cc0;--brand-soft:#33202a;--brand-light:#5b3446;--brand-grad:#f2739f;
  --good:#6fd39f;--good-soft:#173326;--warn:#f2c35a;--warn-soft:#352b14;--bad:#ff7d85;--bad-soft:#3a1f22;--sky:#62b4ff;--sky-soft:#152b40;
  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.6 var(--font);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
a{color:inherit;text-decoration:none}
button,input,select,textarea{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,h3,p{margin:0}
h1{font-size:26px;line-height:1.3;font-weight:800;text-wrap:balance}
h2{font-size:19px;line-height:1.4;font-weight:800;text-wrap:balance}
h3{font-size:16px;font-weight:800}
ol,ul{margin:0;padding:0;list-style:none}
ruby rt{font-size:.5em;font-weight:500;color:var(--muted);letter-spacing: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}
.pad{padding:12px 4px}
.zh{display:block;color:var(--muted);font-size:14px;line-height:1.5}
body.no-zh .zh{display:none}
.eyebrow{font-size:12.5px;font-weight:700;color:var(--muted);letter-spacing:.04em}
.section-label{font-size:13px;font-weight:800;color:var(--muted);margin:26px 4px 10px;letter-spacing:.06em}
.tag{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;background:var(--brand-light);color:var(--brand-dark);white-space:nowrap}
.note{font-size:13.5px;color:var(--warn);background:var(--warn-soft);border-radius:14px;padding:10px 14px;margin:10px 0;font-weight:600}
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.row.center{justify-content:center;margin:18px 0}
.big{font:900 30px/1 var(--round);color:var(--brand-dark)}
.empty-state{text-align:center;padding:60px 16px;display:grid;gap:16px;justify-items:center}
.boot{padding:40vh 0;text-align:center;color:var(--muted)}
.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:10px 20px;border-radius:999px;font-weight:800;font-size:15px;background:var(--surface);box-shadow:var(--shadow);transition:transform .12s}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--brand-grad);color:#fff;box-shadow:0 10px 22px -10px rgba(255,120,170,.75)}
.btn.ghost{background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--line-2)}
.btn.danger{background:var(--bad);color:#fff}
.btn.sm{min-height:36px;padding:6px 14px;font-size:13.5px}
.btn.wide{display:flex;width:100%;margin-top:10px}
.danger-text{color:var(--bad)!important}
.icon-btn{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--surface);box-shadow:var(--shadow);flex:none}
.icon-btn.big{width:64px;height:64px;background:var(--brand-grad);color:#fff}
.icon-btn.corner{position:absolute;right:16px;top:16px}
.play{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--brand-soft);color:var(--brand-dark);flex:none}
.link{display:inline-flex;align-items:center;gap:4px;color:var(--brand-dark);font-weight:700}

/* Shell */
.view{max-width:var(--col);margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom));animation:view-in .25s ease-out}
@keyframes view-in{from{opacity:0;transform:translateY(6px)}}
.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:11.5px;font-weight:700;color:var(--muted);border-radius:14px}
.tabs a .icon{width:25px;height:25px;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-map .icon{width:46px;height:46px;padding:10px;margin-top:-22px;border-radius:50%;background:var(--brand-grad);color:#fff;box-shadow:0 10px 20px -8px rgba(255,120,170,.8)}
.tabs a.tab-map.active .icon{transform:translateY(-3px) scale(1.06)}
body.immersive .tabs{display:none}
body.immersive .view{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
.toast{position:fixed;left:50%;bottom:calc(96px + 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:80;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}
.fx-canvas{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:90}

/* Segmented control */
.seg{display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--seg);margin:14px 0}
.seg button{flex:1;min-height:38px;border-radius:999px;font-weight:800;font-size:14px;color:var(--muted)}
.seg button[aria-selected=true]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}

/* Q版小九: same sprite sheet and motion as TinyMigo单词 (site-apps/ja-words). */
.mascot{position:relative;display:inline-block;--xj:118px}
.mascot.lg{--xj:150px}.mascot.home{--xj:122px}.mascot.sm{--xj:84px}.mascot.xs{--xj:58px}
.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%/60% 60% 40% 40%;background:#9fd8ff}
.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}
.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-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{animation:pop .4s cubic-bezier(.3,1.7,.5,1)}
@keyframes pop{0%{transform:scale(.6);opacity:0}100%{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* 今天 */
.emoji{font-size:1.15em}
.today-top{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin:10px 2px 18px}
.today-date{font-size:13px;color:var(--muted);font-weight:600}
.today-top h1{font-size:30px;letter-spacing:-.01em}
.streak-chip{display:inline-flex;align-items:center;gap:3px;padding:6px 12px;border-radius:999px;background:var(--warn-soft);color:var(--warn);font-size:13px;font-weight:700;flex:none}
.streak-chip b{font:900 17px var(--round)}
.hero-lesson{position:relative;display:grid;gap:12px;justify-items:start;min-height:220px;padding:22px 112px 22px 22px;border-radius:28px;background:#ff9cc0;color:#fff;box-shadow:0 18px 36px -18px rgba(240,90,150,.65);overflow:hidden;isolation:isolate}
.hero-lesson::before{content:"";position:absolute;z-index:-1;right:-70px;top:-70px;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.2)}
.hero-tag{font-size:12.5px;font-weight:800;padding:4px 11px;border-radius:999px;background:rgba(255,255,255,.3)}
.hero-lesson h2{font-size:26px;line-height:1.35;font-weight:800;text-shadow:0 1px 3px rgba(170,40,90,.3)}
.hero-steps{display:flex;gap:4px;flex-wrap:wrap}
.hero-steps li{display:inline-flex;align-items:center;gap:1px;padding:3px 9px;border-radius:999px;background:rgba(255,255,255,.24);font-size:12px;font-weight:700}
.hero-steps li.done{background:#fff;color:#c94c80}
.hero-steps li.next{box-shadow:inset 0 0 0 1.5px #fff}
.hero-btn{display:inline-flex;align-items:center;gap:2px;margin-top:2px;padding:10px 18px;border-radius:999px;background:#fff;color:#c94c80;font-weight:800;font-size:15px;box-shadow:0 8px 18px -10px rgba(150,30,80,.6)}
.hero-lesson .mascot{position:absolute;right:-8px;bottom:-8px;--xj:140px}
.hero-lesson>*:not(.mascot){position:relative;z-index:1}
/* Place pictures (scene-art.js): illustrated banner, scene picture, or a street-sign plate with 小九. */
.scene-banner{position:relative;display:block;border-radius:24px;overflow:hidden;background:var(--surface);box-shadow:var(--shadow)}
.art-banner{position:relative;display:block}
.art-banner img{display:block;width:100%;height:auto}
.banner-box{position:absolute;display:grid;place-content:center;justify-items:center;text-align:center;line-height:1.2;color:#3b2a33}
.banner-box b{font-size:clamp(20px,6vw,34px);font-weight:800;letter-spacing:.02em}
.banner-box small{font-size:clamp(11px,3vw,15px);font-weight:700;color:#c25a88}
.art-photo{position:relative;display:block;height:150px}
.art-photo img{width:100%;height:100%;object-fit:cover}
.art-photo::after{content:none}
.scene-banner .banner-text{position:absolute;left:12px;bottom:12px;z-index:1;display:grid;padding:8px 14px;border-radius:14px;background:rgba(43,34,48,.72);color:#fff;line-height:1.25}
.banner-text b{font-size:23px;font-weight:800}
.banner-text small{font-size:13px;opacity:.92}
.art-sign{display:flex;align-items:flex-end;gap:4px;height:150px;padding:0 14px 0 2px;background:color-mix(in srgb,var(--sign) 12%,#fff)}
.mascot.sign{--xj:120px;flex:none;margin-bottom:-6px}
.sign-plate{align-self:center;margin-top:-18px;display:flex;align-items:center;gap:10px;padding:10px 16px 10px 10px;white-space:nowrap;border-radius:18px;background:#fff;box-shadow:0 10px 24px -14px rgba(40,48,90,.45),inset 0 0 0 2.5px var(--sign);color:#1d2430}
.sign-plate i{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;background:var(--sign);color:#fff;font:800 28px/1 var(--jp);font-style:normal}
.sign-plate>span{display:grid;line-height:1.25}
.sign-plate b{font-size:21px;font-weight:800}
.sign-plate small{font-size:12.5px;font-weight:700;color:var(--sign)}
.sign-plate.big{padding:14px 24px 14px 14px;gap:16px}
.sign-plate.big i{width:72px;height:72px;font-size:42px;border-radius:16px}
.sign-plate.big b{font-size:26px}
.banner-go{position:absolute;right:12px;bottom:12px;z-index:2;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.95);color:#1d2430;box-shadow:0 4px 12px -4px rgba(0,0,0,.3)}
.thumb{display:block;width:100%;height:100%;overflow:hidden;border-radius:inherit}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb-sign{display:grid;place-items:center;background:var(--sign)}
.thumb-sign i{font:800 34px/1 var(--jp);font-style:normal;color:#fff}
.hero-sign{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--sign) 12%,#fff)}
.quick-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}
.quick{display:grid;justify-items:center;gap:2px;padding:14px 6px 12px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}
.quick-ic{display:grid;place-items:center;width:40px;height:40px;border-radius:14px;background:var(--brand-soft);color:var(--brand-dark);margin-bottom:4px}
.quick b{font:900 22px/1.1 var(--round);font-variant-numeric:tabular-nums}
.quick b i{font-style:normal;font-size:13px;color:var(--muted);font-weight:700}
.quick small{font-size:12px;color:var(--muted);font-weight:700}
.quick.hot{box-shadow:inset 0 0 0 2px var(--brand),var(--shadow)}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:10px;margin-top:16px}
.stats>*{display:grid;gap:2px;justify-items:center;padding:14px 6px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.stats b{font:900 22px/1.1 var(--round);font-variant-numeric:tabular-nums}
.stats span{font-size:12.5px;color:var(--muted);font-weight:700}

/* 教材 */
.page-head{display:grid;gap:4px;margin:10px 2px 4px}
.page-head h1{font-size:30px}
.book-name{font-size:13px;font-weight:700;color:var(--muted);margin:0 4px 10px}
.lesson-list{display:grid;gap:10px}
.lesson-row{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}
.lesson-row.current{box-shadow:inset 0 0 0 2px var(--brand),var(--shadow)}
.lesson-no{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--brand-soft);color:var(--brand-dark);font:900 18px var(--round);flex:none}
.lesson-row.current .lesson-no{background:var(--brand-grad);color:#fff}
.lesson-main{flex:1;display:grid;gap:8px;min-width:0}
.lesson-main b{font-size:17px;font-weight:700;line-height:1.35}
.dots4{display:flex;gap:5px;align-items:center}
.dots4 i{width:22px;height:5px;border-radius:9px;background:var(--line-2)}
.dots4 i.on{background:var(--good)}
.dots4 small{margin-left:6px;font-size:12px;color:var(--brand-dark);font-weight:700}
.lesson-scene{display:block;width:40px;height:40px;border-radius:12px;overflow:hidden;flex:none}
.lesson-scene .thumb-sign i,.stop-thumb .thumb-sign i,.next-thumb .thumb-sign i,.use-thumb .thumb-sign i{font-size:20px}
.upcoming{display:grid;gap:8px}
.upcoming li{display:grid;grid-template-columns:1fr auto;gap:2px 8px;padding:14px 16px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.upcoming small{grid-column:1/-1}

/* 一课 */
.lesson-head{display:flex;align-items:center;gap:12px;margin:8px 0 14px}
.lesson-head h1{font-size:24px}
.part-tabs{position:sticky;top:8px;z-index:5;display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow-lg)}
.part-tabs a{flex:1;display:flex;align-items:center;justify-content:center;gap:2px;min-height:40px;border-radius:999px;font-weight:700;font-size:14.5px;color:var(--muted)}
.part-tabs a .icon{color:var(--good)}
.part-tabs a.active{background:var(--brand-grad);color:#fff}
.part-tabs a.active .icon{color:#fff}
.part-intro{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:20px 4px 14px;color:var(--muted);font-size:14px}
.word-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.word-card{position:relative;width:100%;height:100%;display:grid;align-content:start;gap:6px;padding:16px 14px 14px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow);text-align:left;transition:transform .12s,box-shadow .2s}
.word-card:active{transform:scale(.98)}
.word-card.playing{box-shadow:inset 0 0 0 2px var(--brand),var(--shadow)}
.wc-word{font-size:22px;line-height:1.95;font-weight:600;word-break:break-word;padding-right:18px}
.word-card.long .wc-word{font-size:18px}
.word-card.longer .wc-word{font-size:15.5px}
.wc-mean{font-size:14px;line-height:1.5}
.wc-pos{justify-self:start;font-size:11.5px;color:var(--muted);background:var(--surface-2);padding:1px 8px;border-radius:999px}
.wc-play{position:absolute;right:12px;top:14px;color:var(--brand)}
.read-sec{margin-bottom:16px;border-radius:22px;background:var(--surface);box-shadow:var(--shadow);overflow:hidden}
.read-sec h3{padding:14px 18px 4px;font-size:13px;font-weight:800;color:var(--brand-dark);letter-spacing:.06em}
.para{display:grid;grid-template-columns:1fr auto;gap:2px 12px;align-items:start;padding:12px 18px 16px;border-top:1px solid var(--line);cursor:pointer;transition:background .2s}
.read-sec h3+.para{border-top:0}
.para.playing{background:var(--brand-soft)}
.para .play{width:34px;height:34px;margin-top:8px}
.para>div{min-width:0}
.speaker{display:inline-block;font-size:12px;font-weight:800;color:var(--sky);margin-top:6px}
.jp-line{font-size:19px;line-height:2.15}
.grammar-card{display:grid;gap:10px;padding:20px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);margin-bottom:12px;scroll-margin-top:70px}
.grammar-card.flash{animation:flash 1.6s ease}
@keyframes flash{0%,40%{box-shadow:inset 0 0 0 3px var(--brand),var(--shadow)}}
.grammar-card h3{justify-self:start;font-size:20px;padding:4px 12px;border-radius:12px;background:var(--brand-soft);color:var(--ink)}
.explain{font-size:15px;line-height:1.75;color:var(--ink)}
.example{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:10px 12px;border-radius:14px;background:var(--brand-soft)}
.example .jp-line{font-size:18px}
.part-end{display:grid;gap:8px;margin:20px 0}
.ok-line{display:flex;align-items:center;gap:4px;justify-content:center;color:var(--good);font-weight:800}
.quiz{display:grid;gap:12px;margin-top:10px}
.quiz-top{display:flex;justify-content:space-between;align-items:center}
.bar{height:6px;border-radius:9px;background:var(--seg);overflow:hidden}
.bar span{display:block;height:100%;background:var(--brand-grad);transition:width .3s}
.quiz-q{font-size:18px;line-height:1.6}
.zh-big{font-size:20px;color:var(--brand-dark)}
.options{display:grid;gap:8px}
.option{text-align:left;padding:14px 16px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);font-size:15px;line-height:1.6}
.option.right{background:var(--good-soft);box-shadow:inset 0 0 0 2px var(--good)}
.option.wrong{background:var(--bad-soft);box-shadow:inset 0 0 0 2px var(--bad)}
.built{min-height:60px;display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:10px;border-radius:16px;background:var(--surface);box-shadow:inset 0 0 0 1.5px var(--line-2)}
.bank{display:flex;flex-wrap:wrap;gap:8px}
.token{padding:9px 14px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow);font-size:18px}
.token.placed{background:var(--brand-soft);box-shadow:none}
.fb{display:grid;gap:6px;padding:14px;border-radius:16px;font-size:14.5px}
.fb.ok{background:var(--good-soft)}.fb.ok b{color:var(--good)}
.fb.no{background:var(--warn-soft)}.fb.no b{color:var(--warn)}
.summary{position:relative;display:grid;gap:14px;justify-items:center;text-align:center;padding:30px 4px}
.summary .bubble{position:relative;display:block;margin:0 auto 8px}
.use-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:14px 16px;border-radius:var(--radius);background:var(--surface);box-shadow:inset 4px 0 0 var(--accent),var(--shadow)}
.use-thumb{display:block;width:52px;height:52px;border-radius:14px;overflow:hidden;flex:none}
.use-card>span:nth-child(2){flex:1;display:grid}
.use-card small{color:var(--muted)}

/* 地图 */
.map-layout{display:grid;gap:16px}
/* The whole map is shown; pins are percentages of the full picture, so they stay on their buildings. */
.island{margin:0;border-radius:24px;overflow:hidden;box-shadow:var(--shadow-lg);background:#bfe3f6}
.island-canvas{position:relative}
.island img{display:block;width:100%;height:auto}
.pin{position:absolute;transform:translate(-50%,-50%);display:inline-flex;align-items:center;gap:3px;padding:5px 10px 5px 7px;border-radius:999px;background:rgba(255,255,255,.96);box-shadow:0 6px 16px -6px rgba(30,40,80,.5);font-weight:800;font-size:12.5px;color:#1d2430;white-space:nowrap;transition:transform .15s}
.pin:active{transform:translate(-50%,-50%) scale(.95)}
.pin span{font-size:15px}
.pin.locked{background:rgba(255,255,255,.75);color:#68717d}
.pin.on-route{box-shadow:0 0 0 3px var(--brand),0 6px 16px -6px rgba(30,40,80,.45)}
.pin i{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--brand-dark);color:#fff;font:800 11px var(--round);font-style:normal}
.route-stops{display:grid;gap:8px;margin-top:8px}
.route-stops a{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.route-stops a>span:nth-child(3){flex:1;display:grid}
.route-stops small{color:var(--muted);font-size:12.5px}
.stop-no{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--brand-soft);color:var(--brand-dark);font:800 13px var(--round)}
.route-stops a.done .stop-no{background:var(--good-soft);color:var(--good)}
.stop-thumb,.next-thumb{display:block;width:44px;height:44px;border-radius:12px;overflow:hidden;flex:none}
.district-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.district-list button{width:100%;display:grid;grid-template-columns:auto 1fr;gap:0 8px;text-align:left;padding:10px 12px;border-radius:14px;background:var(--surface);box-shadow:var(--shadow)}
.district-list .emoji{grid-row:span 2;font-size:24px;align-self:center}
.district-list button.locked{opacity:.7}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips li{display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border-radius:999px;background:var(--surface);box-shadow:inset 0 0 0 1.5px var(--line-2);font-size:14px;color:var(--muted)}

/* 街区 */
.place-list{display:grid;gap:12px}
.place-card{display:flex;align-items:center;gap:14px;padding:12px;border-radius:var(--radius);background:var(--surface);box-shadow:inset 4px 0 0 var(--accent),var(--shadow)}
.place-art{position:relative;display:block;width:84px;height:84px;border-radius:16px;overflow:hidden;flex:none;background:var(--surface-2)}
.place-main{flex:1;display:grid;gap:2px;min-width:0}
.place-main b{font-size:18px}
.place-main small{color:var(--muted);font-size:13.5px}
.place-meta{font-size:12.5px;color:var(--accent);font-weight:700}
.place-meta em{font-style:normal;color:var(--warn)}

/* 场景 */
.scene-bar{position:sticky;top:0;z-index:6;display:flex;align-items:center;gap:10px;padding:8px 0;background:var(--bg)}
.scene-title{flex:1;display:grid;text-align:center;line-height:1.3}
.scene-title b{font-size:17px}
.scene-title small{color:var(--muted);font-size:12.5px}
.goal{display:flex;gap:8px;align-items:flex-start;font-size:14.5px;font-weight:700;margin:4px 2px}
.goal .tag{background:color-mix(in srgb,var(--accent,#ff9fc1) 20%,var(--surface));color:var(--ink)}
.scene-note{font-size:12.5px;color:var(--muted);margin:4px 2px 0}
.scene-body{margin-top:12px}
.stage-hero{position:relative;height:clamp(170px,32vh,300px);border-radius:var(--radius);overflow:hidden;background:color-mix(in srgb,var(--accent) 22%,#fff);box-shadow:var(--shadow)}
.stage-hero img{width:100%;height:100%;object-fit:cover;object-position:50% 30%}
.hero-xj{position:absolute;left:8px;bottom:0}
.talk{display:grid;gap:10px;margin-top:-26px;position:relative;padding:0 6px}
.talk-progress{justify-self:center;font-size:12.5px;font-weight:800;padding:4px 12px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow)}
.staff-line{position:relative;display:grid;gap:4px;padding:16px 56px 16px 16px;border-radius:20px 20px 20px 6px;background:var(--surface);box-shadow:var(--shadow-lg)}
.staff-line .play{position:absolute;right:12px;top:12px}
.role{display:inline-block;flex:none;white-space:nowrap;width:max-content;font-size:11.5px;font-weight:800;padding:1px 8px;border-radius:999px;background:var(--sky-soft);color:var(--sky)}
.role.me{background:var(--brand-light);color:var(--brand-dark)}
.jp-big{font-size:22px;line-height:2;font-weight:600}
.jp-mid{font-size:18px;line-height:1.9}
.hint-line{font-size:13.5px;color:var(--warn);background:var(--warn-soft);border-radius:12px;padding:6px 12px}
.answers{display:grid;gap:8px}
.answer{text-align:left;padding:12px 16px;border-radius:18px 18px 6px 18px;background:var(--brand-soft);box-shadow:inset 0 0 0 1.5px var(--brand-light);transition:transform .12s}
.answer:active{transform:scale(.98)}
.talk-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;margin-top:4px}
.mic{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:8px 18px;border-radius:999px;background:var(--brand-grad);color:#fff;font-weight:800;touch-action:none}
.mic.on{background:var(--bad);animation:pulse-ring 1s ease-in-out infinite}
@keyframes pulse-ring{50%{box-shadow:0 0 0 8px rgba(210,67,77,.2)}}
.heard{font-size:13.5px;color:var(--muted);text-align:center}
.coach{display:flex;gap:10px;align-items:flex-end;padding:12px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.coach>div:last-child{display:grid;gap:4px}
.browse-hero{height:120px;border-radius:var(--radius);overflow:hidden;margin-bottom:10px}
.browse-hero img{width:100%;height:100%;object-fit:cover;object-position:50% 45%}
.section-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 8px;scrollbar-width:none}
.section-tabs::-webkit-scrollbar{display:none}
.section-tabs button{flex:none;display:grid;grid-template-columns:auto auto;gap:0 6px;align-items:center;padding:8px 14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);text-align:left}
.section-tabs button>span:first-child{grid-row:span 2;font-size:20px}
.section-tabs button span[lang]{font-weight:700;font-size:14px}
.section-tabs button small{font-size:11.5px;color:var(--muted)}
.section-tabs button[aria-selected=true]{background:var(--ink);color:var(--bg)}
.section-tabs button[aria-selected=true] small{color:inherit;opacity:.75}
.browse-hint{margin:2px 4px 8px}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.tiles.board,.tiles.window{grid-template-columns:repeat(2,1fr)}
.tile{position:relative;display:grid;gap:2px;justify-items:center;align-content:start;text-align:center;padding:10px 6px 10px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);min-height:132px}
.tile:active{transform:scale(.97)}
.tile-name{font-size:14px;line-height:1.7;font-weight:600}
.tile .zh{font-size:12px}
.tile-price{font:800 13px var(--round);color:var(--brand-dark)}
.tile-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;font-size:30px;background:var(--surface-2)}
.tile-icon.big{width:96px;height:96px;font-size:56px;border-radius:24px;margin:0 auto}
.sprite{display:block;width:64px;height:64px;background-repeat:no-repeat}
.sprite.big{width:132px;height:132px;margin:0 auto}
.qty-badge{position:absolute;right:6px;top:6px;display:grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--brand-dark);color:#fff;font:800 12px var(--round)}
.browse-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:16px 0 90px}
.basket-bar{position:fixed;z-index:15;left:50%;bottom:calc(12px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(var(--col),calc(100% - 24px));display:flex;gap:10px;align-items:center;padding:8px 8px 8px 12px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow-lg)}
.basket-btn{flex:1;display:flex;align-items:center;gap:8px;text-align:left}
.basket-btn span{display:grid;line-height:1.3}
.basket-btn small{color:var(--muted);font-size:12.5px;font-variant-numeric:tabular-nums}
.receipt-card{display:grid;gap:10px;padding:20px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-lg);border-top:6px solid var(--accent)}
.receipt-card h2 small{font-size:14px;color:var(--muted);font-weight:600}
.receipt-rows{display:grid;gap:6px;border-top:1.5px dashed var(--line-2);padding-top:10px}
.receipt-rows li{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.receipt-rows li>span{display:grid}
.receipt-rows b{font-variant-numeric:tabular-nums}
.receipt-total{display:flex;justify-content:space-between;border-top:1.5px dashed var(--line-2);padding-top:8px;font-weight:800}
.receipt-total b{font:900 22px var(--round);color:var(--brand-dark)}
.talk-log{display:grid;gap:10px}
.talk-log li{display:grid;gap:4px}
.talk-log p{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;font-size:15.5px;line-height:1.9}
.talk-log .a{padding-left:16px}
.talk-log .play{width:30px;height:30px}
.thanks{padding:10px 12px;border-radius:14px;background:var(--surface-2);font-size:16px}
.next-list{display:grid;gap:8px}
.next-card{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--surface);box-shadow:inset 4px 0 0 var(--accent),var(--shadow)}
.next-card>span:nth-child(2){flex:1;display:grid}
.next-card small{color:var(--muted);font-size:13px}

.next-card.soon{opacity:.7;box-shadow:inset 0 0 0 1.5px var(--line-2)}

/* Sheets */
.sheet-backdrop{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center;background:rgba(20,24,32,.42);animation:fade .2s}
@keyframes fade{from{opacity:0}}
.sheet{position:relative;width:min(560px,100%);max-height:88dvh;overflow-y:auto;padding:22px 18px calc(22px + env(safe-area-inset-bottom));border-radius:26px 26px 0 0;background:var(--surface);display:grid;gap:10px;animation:rise .28s cubic-bezier(.2,.9,.3,1)}
@keyframes rise{from{transform:translateY(40px);opacity:.4}}
.sheet-x{position:absolute;right:12px;top:12px;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--surface-2);z-index:1}
.item-sheet{display:grid;gap:10px;text-align:center}
.item-sheet .price{font:900 22px var(--round);color:var(--brand-dark)}
.item-sheet .note{text-align:left}
.opt-group{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap}
.opt-group>span{font-size:13px;font-weight:800;color:var(--muted);margin-right:4px}
.opt{display:grid;padding:6px 14px;border-radius:14px;background:var(--surface-2);min-width:64px}
.opt small{font-size:11.5px;color:var(--muted)}
.opt[aria-pressed=true]{background:var(--ink);color:var(--bg)}
.opt[aria-pressed=true] small{color:inherit;opacity:.8}
.ask-lines{display:grid;gap:6px;text-align:left}
.ask-lines li{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:10px 12px;border-radius:14px;background:var(--brand-soft)}
.qty{display:flex;align-items:center;justify-content:center;gap:10px}
.qty>span{font-size:13px;font-weight:800;color:var(--muted)}
.qty output{min-width:30px;font:800 18px var(--round);text-align:center}
.step{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--surface-2)}
.basket-rows{display:grid;gap:8px}
.basket-rows li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}
.basket-rows li>span:first-child{display:grid}
.basket-rows .qty{gap:6px}

/* 短片 */
.film{display:grid;gap:14px;max-width:520px;margin:0 auto}
.film-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.film-cover{display:grid;gap:12px;padding:20px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow-lg)}
.film-script{display:grid;gap:6px;max-height:46vh;overflow-y:auto;padding:4px}
.film-script li{display:flex;gap:8px;align-items:baseline;font-size:15px;line-height:1.9}
.film-script li.me{padding-left:18px}
.film-frame{display:grid;gap:10px;padding:16px;border-radius:26px;background:var(--surface);box-shadow:var(--shadow-lg)}
.film-media{position:relative;aspect-ratio:4/3;border-radius:18px;overflow:hidden;background:color-mix(in srgb,var(--accent) 22%,#fff)}
.film-media img,.film-media video{width:100%;height:100%;object-fit:cover}
.film-xj{position:absolute;right:10px;bottom:-4px}
.film-xj.me{right:auto;left:10px}
.film-role{position:absolute;left:12px;top:12px;font-size:12px;font-weight:800;padding:2px 10px;border-radius:999px;background:rgba(255,255,255,.92);color:#1d2430}
.film-frame.me .film-role{left:auto;right:12px;background:var(--brand-dark);color:#fff}
.film-meta{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.film-jp{font-size:clamp(22px,6vw,30px);line-height:2;text-align:center;font-weight:600;min-height:2.2em}
.film-zh{text-align:center;color:var(--muted);font-size:16px}
.dots{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--line-2)}
.dots i.on{background:var(--brand-dark)}
.film-controls{display:flex;justify-content:center;align-items:center;gap:22px}

/* 练习 */
.tools{display:grid;gap:10px}
.tool-card{display:flex;align-items:center;gap:14px;padding:16px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.tool-card>span:nth-child(2){flex:1;display:grid}
.tool-card small{font-size:13px}
.tool-card em{font-style:normal;font-weight:800;font-size:13px;color:var(--brand-dark);background:var(--brand-soft);padding:3px 10px;border-radius:999px}
.tool-card.hot{box-shadow:inset 0 0 0 2px var(--brand),var(--shadow)}
.tool-ic{display:grid;place-items:center;width:48px;height:48px;border-radius:16px;background:var(--brand-soft);color:var(--brand-dark)}
.review{display:grid;gap:12px}
.flash-card{display:grid;gap:8px;justify-items:center;align-content:center;min-height:300px;padding:24px;border-radius:26px;background:var(--surface);box-shadow:var(--shadow-lg);text-align:center}
.fc-word{font-size:44px;line-height:1.9;font-weight:600}
.fc-reading{font-size:20px;color:var(--brand-dark)}
.fc-mean{font-size:20px;font-weight:700}
.center-btn{justify-self:center}
.grades{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.grade{display:grid;gap:2px;padding:14px 6px;border-radius:18px;font-weight:800;background:var(--surface);box-shadow:var(--shadow)}
.grade small{font-size:11.5px;font-weight:600;color:var(--muted)}
.grade.g0{color:var(--bad)}.grade.g1{color:var(--warn)}.grade.g2{color:var(--good)}
.compare-list{display:grid;gap:10px}
.compare{display:grid;gap:8px;padding:16px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.compare ul{display:grid;gap:4px}
.compare a{display:flex;justify-content:space-between;gap:8px;padding:8px 10px;border-radius:12px;background:var(--brand-soft)}
.compare .explain{font-size:14px;color:var(--ink);background:var(--good-soft);padding:8px 12px;border-radius:12px}
.filter-row{display:grid;gap:8px}
.search{width:100%;min-height:44px;padding:8px 16px;border-radius:999px;border:1.5px solid var(--line-2);background:var(--surface)}
.gram-list{display:grid;gap:6px;margin-top:10px}
.gram-row{display:flex;align-items:center;gap:8px;padding:12px 14px;border-radius:14px;background:var(--surface)}
.gram-row b{flex:1;font-weight:600}
.mistakes{display:grid;gap:8px}
.mistakes li{display:grid;gap:6px;padding:14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.select-row{display:flex;align-items:center;gap:10px;margin:6px 2px}
.select-row select{flex:1;min-height:42px;padding:6px 12px;border-radius:12px;border:1.5px solid var(--line-2);background:var(--surface)}
.shadow-list{display:grid;gap:8px}
.shadow-list li{display:grid;gap:6px;padding:14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.shadow-list li.recording{box-shadow:inset 0 0 0 2px var(--bad)}

/* 我的 / 厨房 */
.me-head{display:flex;align-items:center;gap:12px;margin:6px 0 12px}
.receipt-list,.saved-words{display:grid;gap:8px}
.receipt-list button{width:100%;display:flex;align-items:center;gap:10px;text-align:left;padding:12px 14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.receipt-list button>span:nth-child(2){flex:1;display:grid}
.receipt-list em{font-style:normal;font-weight:800;font-variant-numeric:tabular-nums}
.receipt-list .emoji{font-size:24px}
.saved-words li{display:flex;justify-content:space-between;align-items:center;padding:8px 8px 8px 14px;border-radius:14px;background:var(--surface)}
.saved-words li>span{display:grid;font-size:18px}
.saved-words small{font-size:12.5px}
.settings{display:grid;gap:2px;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.setting{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;background:var(--surface)}
.setting>span{display:grid}
.setting small{font-size:12.5px}
.setting input[type=checkbox]{width:24px;height:24px;accent-color:var(--brand-dark)}
.setting input[type=range]{accent-color:var(--brand-dark);width:140px}
.backup{width:100%;min-height:160px;padding:12px;border-radius:14px;border:1.5px solid var(--line-2);background:var(--surface-2);font-size:12px}
.card{display:grid;gap:10px;padding:16px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);margin-top:12px}
.recipe-pick{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.recipe-pick button{display:grid;padding:12px 8px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);text-align:center}
.recipe-pick button small{font-size:12px;color:var(--muted)}
.recipe-pick button[aria-pressed=true]{background:var(--ink);color:var(--bg)}
.recipe-pick button[aria-pressed=true] small{color:inherit;opacity:.8}
.ingredients{display:grid;gap:6px}
.ingredients li{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:14px;background:var(--surface-2)}
.ingredients li>span{flex:1;display:grid}
.ingredients small{color:var(--muted);font-size:12.5px}
.ingredients em{font-style:normal;font-size:12.5px;font-weight:800;color:var(--warn)}
.ingredients li.ok em{color:var(--good)}
.cook-steps{display:grid;gap:10px}
.cook-steps li{display:grid;grid-template-columns:auto 1fr;gap:10px;padding:12px;border-radius:16px;background:var(--surface-2)}
.cook-steps li.done{background:var(--good-soft)}
.step-no{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--surface);font:800 13px var(--round)}

/* iPad and desktop: wider column, side-by-side where it helps. */
@media (min-width:900px){
 :root{--col:1080px}
 .view{padding-left:28px;padding-right:28px}
 body[data-page=today] .view{max-width:760px}
 .lesson-list{grid-template-columns:repeat(2,1fr)}
 .map-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
 .pin{font-size:14px;padding:6px 12px 6px 8px}
 .place-list{grid-template-columns:repeat(2,1fr)}
 .tiles{grid-template-columns:repeat(5,1fr)}
 .tiles.board,.tiles.window{grid-template-columns:repeat(4,1fr)}
 .scene-body.stage-entry,.scene-body.stage-counter{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:20px;align-items:start}
 .scene-body.stage-entry .stage-hero,.scene-body.stage-counter .stage-hero{height:min(62vh,520px);position:sticky;top:70px}
 .scene-body.stage-entry .talk,.scene-body.stage-counter .talk{margin-top:0}
 .scene-body.stage-done{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:20px;align-items:start}
 .scene-body.stage-done>.row{grid-column:1/-1}
 .browse-hero{height:160px}
 .tools,.compare-list{grid-template-columns:repeat(2,1fr)}
 .word-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .lesson-body .quiz,.lesson-body .summary{max-width:680px;margin-left:auto;margin-right:auto}
 .sheet{border-radius:26px;margin-bottom:5vh}
 .sheet-backdrop{align-items:center}
 .review,.film{max-width:620px;margin:0 auto}
}
.scene-banner.kind-banner .banner-go{display:none}
.tile.text-only{min-height:104px;align-content:center;padding:14px 8px;gap:4px}
.tile.text-only .tile-name{font-size:15px}
.item-sheet>h2:first-child{margin-top:18px}
.tiles.text{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:900px){.tiles.text{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* 自己的家: the room picture with its objects outlined and labelled in Japanese (scene.js roomView). */
.room-wrap{margin-bottom:12px}
.room-view{position:relative;height:clamp(300px,52vh,460px);overflow-y:auto;border-radius:var(--radius);box-shadow:var(--shadow);background:var(--surface-2);overscroll-behavior:contain;scrollbar-width:none}
.room-view::-webkit-scrollbar{display:none}
.room-canvas{position:relative;width:100%}
.room-canvas img{position:absolute;inset:0;width:100%;height:100%;display:block}
.room-canvas svg{position:absolute;inset:0;width:100%;height:100%}
.room-canvas path{fill:transparent;stroke:transparent;stroke-width:2;vector-effect:non-scaling-stroke;cursor:pointer;transition:fill .15s,stroke .15s}
.room-canvas path:hover{fill:rgba(255,255,255,.18);stroke:#fff}
.room-canvas path.on{fill:color-mix(in srgb,var(--accent) 26%,transparent);stroke:var(--accent);stroke-width:2.5}
.spot-chip{position:absolute;transform:translate(-50%,-50%);z-index:1;padding:3px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#2b2230;font:700 12.5px/1.4 var(--jp);white-space:nowrap;box-shadow:0 3px 10px -4px rgba(60,30,50,.45)}
.spot-chip.on{background:var(--accent);color:#fff}
.spot-chip:active{transform:translate(-50%,-50%) scale(.95)}
.spot-chip.from-left,.spot-chip.from-right{transform:translateY(-50%)}
.room-tip{margin:8px 4px 0;font-size:12.5px;color:var(--muted);text-align:center}
.spot-crop{display:block;width:132px;height:132px;margin:0 auto;border-radius:22px;background-repeat:no-repeat;box-shadow:var(--shadow)}
@media (min-width:900px){
 .browse.has-room{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:20px;align-items:start}
 .browse.has-room .room-wrap{position:sticky;top:70px;margin:0}
 .browse.has-room .room-view{height:calc(100vh - 200px)}
 .browse.has-room .tiles.text{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* 场景 feed (views/feed.js): one scene per screen, picture on the top quarter, chat bubbles below,
   swipe up for the next — the layout of the 小红书 scene videos. Bubbles: the other speaker light
   yellow on the left, 小九 light pink on the right; text colours are fixed so dark mode stays readable. */
:root{--tabs-h:66px;--bar-h:84px;--bubble-staff:#fff3c4;--bubble-xj:#ffe1ec;--bubble-ink:#2b2230;--bubble-muted:#68535f}
body[data-page=feed] .view{max-width:none;padding:0;animation:none}
.feed{position:fixed;left:0;right:0;top:0;bottom:calc(var(--bar-h) + env(safe-area-inset-bottom));overflow-y:scroll;overscroll-behavior:contain;scrollbar-width:none;background:var(--bg)}
.feed::-webkit-scrollbar{display:none}
/* One scene after another in a single continuous scroll: the scene's title and picture stick to the
   top while its bubbles scroll under them, and the next scene's top pushes them away. No snapping,
   so a line being read is never yanked off screen. */
.short{min-height:100%;max-width:var(--col);margin:0 auto;padding:0 14px}
.short+.short{border-top:6px solid var(--line)}
.short-top{position:sticky;top:0;z-index:3;padding:max(10px,env(safe-area-inset-top)) 0 10px;background:var(--bg)}
.short-head{display:flex;align-items:center;gap:8px;padding:2px 2px 8px}
.short-no{font:800 13px var(--round);color:var(--brand-dark)}
.short-head h2{flex:1;font-size:17px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.short-head h2 b{color:var(--brand-dark)}
.short-count{font:700 12.5px var(--round);color:var(--muted)}
.short-body{display:block}
.short-media{margin:0;height:min(18vh,150px);min-height:120px;border-radius:18px;overflow:hidden;background:#ffe1ec}
.short-media img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 45%}
.short-plain{display:flex;align-items:flex-end;justify-content:center;gap:4px;height:100%;padding-top:10px;color:#a3406b}
.short-plain b{align-self:center;font-size:22px;font-weight:800}
.short-talk{padding:2px 2px 18px}
.short-goal{font-size:13px;color:var(--muted);margin:0 4px 10px}
.bubbles{display:grid;gap:10px}
.bubble-row{display:flex;gap:8px;align-items:flex-start;transition:opacity .25s}
.bubble-row.by-xj{flex-direction:row-reverse}
.av{width:38px;height:38px;flex:none;border-radius:50%;object-fit:cover;background:#fff;box-shadow:0 0 0 2px #fff}
.av-text{display:grid;place-items:center;background:#ffd23f;color:#5a3d00;font-size:15px;font-weight:800}
.tb{max-width:82%;padding:7px 13px 9px;border-radius:6px 18px 18px 18px;background:var(--bubble-staff);color:var(--bubble-ink);cursor:pointer}
.by-xj .tb{background:var(--bubble-xj);border-radius:18px 6px 18px 18px}
.tb .who{font-size:11px;font-weight:800;color:var(--bubble-muted)}
.b-jp{font-size:17.5px;line-height:1.85;font-weight:600}
.tb ruby rt{color:var(--bubble-muted)}
.tb .zh{display:block;font-size:12.5px;color:var(--bubble-muted)}
.short[data-mode=watch] .bubble-row.later,.short[data-mode=role] .bubble-row.later:not(.by-xj){opacity:.3}
.bubble-row.now .tb{box-shadow:inset 0 0 0 2.5px #f5b800}
.bubble-row.by-xj.now .tb{box-shadow:inset 0 0 0 2.5px var(--brand)}
.bubble-row.hide .b-jp{color:transparent;background:#f6c9da;border-radius:8px}
.bubble-row.hide .b-jp ruby rt{color:transparent}
.b-tools:empty{display:none}
.b-tools{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.your-turn{flex-basis:100%;font-size:13px;font-weight:700;color:#a3406b}
.chip{display:inline-flex;align-items:center;gap:4px;min-height:34px;padding:4px 12px;border-radius:999px;background:#fff;color:var(--bubble-ink);font-size:13px;font-weight:700;box-shadow:0 1px 3px rgba(60,30,50,.15)}
.chip.go{background:#ff8fb8;color:#fff}
.chip.rec,.chip.mic.on{background:#d2434d;color:#fff}
.chip.mic{touch-action:none}
.core{margin-top:18px;padding:14px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.core h3{font-size:15px}
.core-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}
.core-word{display:grid;gap:2px;padding:9px 12px;border-radius:14px;background:var(--brand-soft);text-align:left}
.cw-jp{font-size:17px;font-weight:700;line-height:1.7}
.core-word small{font-size:12px;color:var(--muted)}
.short-next{margin:14px 0 6px;text-align:center;font-size:12.5px;color:var(--muted)}
.short-tools{position:sticky;bottom:0;z-index:3;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:8px 0 6px;background:var(--bg)}
.short-tools button{display:flex;flex-direction:column;align-items:center;gap:1px;padding:6px 0;border-radius:14px;font-size:12px;font-weight:700;color:var(--muted)}
.short-tools button[aria-pressed=true]{background:var(--brand-light);color:var(--brand-dark)}
@media (min-width:900px){
 .short{max-width:1100px;padding:0 28px;display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);column-gap:24px;align-items:start}
 .short-top{display:contents}
 .short-head{grid-column:1/-1;position:sticky;top:0;z-index:3;padding:16px 0 10px;background:var(--bg)}
 .short-media{grid-column:1;grid-row:2/span 2;position:sticky;top:64px;height:auto;aspect-ratio:3/2;min-height:0}
 .short-body{grid-column:2;grid-row:2}
 .short-tools{grid-column:2;grid-row:3}
 .short-head h2{font-size:20px}
}

/* 今天 (views/today.js): the scene card, the lesson and review pair, the next-scenes strip. */
body[data-page=today] .today-top{align-items:center;margin:6px 2px 12px}
.today-scene{display:block;border-radius:26px;overflow:hidden;background:var(--surface);box-shadow:var(--shadow-lg)}
.ts-pic{display:block;aspect-ratio:3/2;background:#ffe1ec}
.ts-pic img,.ts-pic video{display:block;width:100%;height:100%;object-fit:cover}
.pic-plain{display:flex;align-items:flex-end;justify-content:center;width:100%;height:100%;background:#ffe1ec}
.ts-body{display:grid;gap:6px;justify-items:start;padding:14px 18px 18px}
.ts-title{font-size:21px;line-height:1.35;font-weight:800}
.ts-line{font-size:17px;line-height:1.9;color:var(--muted)}
.ts-btn{display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:10px 20px;border-radius:999px;background:#ff8fb8;color:#fff;font-weight:800}
.today-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.mini-card{display:grid;gap:2px;padding:0 0 12px;border-radius:20px;overflow:hidden;background:var(--surface);box-shadow:var(--shadow)}
.mini-card.hot{box-shadow:inset 0 0 0 2.5px #ffc83d,var(--shadow)}
.mc-pic{display:block;aspect-ratio:3/2;background:#fff3c4;margin-bottom:6px}
.mc-pic img{display:block;width:100%;height:100%;object-fit:cover}
.mc-pic .pic-plain{background:#fff3c4}
.mini-card b{padding:0 12px;font-size:16px}
.mini-card small{padding:0 12px;font-size:12.5px;color:var(--muted)}
.next-strip{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 8px;scrollbar-width:none}
.next-strip::-webkit-scrollbar{display:none}
.next-strip li{flex:0 0 132px}
.next-strip a{display:grid;gap:1px}
.ns-pic{display:block;aspect-ratio:1;border-radius:18px;overflow:hidden;background:#ffe1ec;margin-bottom:4px}
.ns-pic img{display:block;width:100%;height:100%;object-fit:cover}
.next-strip b{font-size:14px}
.next-strip small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 地图 · one area (views/district.js): its places, each with its scenes and, for shops, the way in. */
.area-cover{aspect-ratio:3/2;border-radius:var(--radius);overflow:hidden;margin-bottom:14px;background:#ffe1ec}
.area-cover img{display:block;width:100%;height:100%;object-fit:cover}
.area-places{display:grid;gap:12px}
.area-place{display:grid;gap:10px;padding:12px;border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.ap-main{display:flex;align-items:center;gap:12px}
.ap-pic{display:flex;align-items:flex-end;justify-content:center;width:76px;height:76px;flex:none;border-radius:16px;overflow:hidden;background:#ffe1ec}
.ap-pic img{width:100%;height:100%;object-fit:cover}
.ap-text{flex:1;display:grid;min-width:0}
.ap-text b{font-size:18px}
.ap-text small{font-size:12.5px;color:var(--muted)}
.ap-meta{font-size:12.5px;font-weight:700;color:var(--brand-dark)}
.ap-tasks{display:flex;flex-wrap:wrap;gap:6px}
.ap-tasks a{display:inline-flex;align-items:center;gap:4px;padding:5px 11px;border-radius:999px;background:#fff3c4;color:#5a3d00;font-size:13px;font-weight:700}
.ap-tasks a.seen{background:var(--brand-light);color:var(--brand-dark)}
/* 进店（实景练习：超市挑货结账、点单、办事……）放在店名下面，用实心大按钮，一眼能看到（用户 2026-11-20） */
.ap-enter{justify-self:stretch;display:flex;align-items:center;justify-content:center;gap:6px;min-height:46px;font-size:15px}
.ap-enter small{font-size:12px;font-weight:700;opacity:.85;padding:2px 8px;border-radius:999px;background:rgba(255,255,255,.22)}
.ap-sub{font-size:12.5px;font-weight:800;color:var(--muted);margin-top:2px}
.ap-rooms{display:flex;flex-wrap:wrap;gap:6px}
.ap-rooms a{display:inline-block;padding:5px 12px;border-radius:999px;box-shadow:inset 0 0 0 1.5px var(--line-2);font-size:13px;font-weight:700}
.chips li small{margin-left:4px;font-size:11.5px;color:var(--muted)}
@media (min-width:900px){.area-places{grid-template-columns:repeat(2,1fr);align-items:start}}
.book-tools{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 14px}
.book-tools a{display:flex;align-items:center;gap:8px;padding:10px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow);color:var(--brand-dark)}
.book-tools span{display:grid;line-height:1.3;color:var(--ink)}
.book-tools b{font-size:14px}
.book-tools small{font-size:11.5px;color:var(--muted)}
.fav-shorts{display:grid;gap:8px}
.fav-shorts a{display:flex;align-items:center;gap:6px;padding:12px 14px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.fav-shorts a .icon:first-child{color:#f5b800}
.fav-shorts a .icon:last-child{margin-left:auto;color:var(--muted)}
.short-note{font-size:12px;color:var(--warn);background:var(--warn-soft);border-radius:10px;padding:5px 10px;margin:0 2px 10px}

/* 场景 feed chrome: a back button in every scene's title row, and one bottom bar for the page. */
.short-back{display:grid;place-items:center;width:36px;height:36px;margin-left:-6px;border-radius:50%;color:var(--ink);flex:none}
.short-back:active{background:var(--seg)}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.short-end{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:16px 0 8px}


/* 场景 page: the star in each scene's title row, the end-of-scene checklist and the bottom bar
   (跟读 · a raised play button · 扮演). */
.short-fav{display:grid;place-items:center;width:36px;height:36px;margin-right:-6px;border-radius:50%;color:var(--muted);flex:none}
.short-fav .fi{width:22px;height:22px}
.short-fav[aria-pressed=true]{color:#f5b800}
.short-wrap{margin:22px 0 10px;padding:16px;border-radius:22px;background:var(--surface);box-shadow:var(--shadow)}
.sw-title{font-size:15px;font-weight:800;margin:0 2px 10px}
.short-steps{display:grid;gap:8px}
.short-steps button,.short-steps a{width:100%;display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:16px;background:var(--surface-2);text-align:left;color:var(--ink)}
.short-steps .st-no{display:grid;place-items:center;width:28px;height:28px;flex:none;border-radius:50%;background:var(--surface);font:800 13px var(--round);color:var(--muted);box-shadow:inset 0 0 0 1.5px var(--line-2)}
.short-steps .st-text{flex:1;display:grid;line-height:1.35}
.short-steps .st-text b{font-size:15px}
.short-steps .st-text small{font-size:12.5px;color:var(--muted)}
.short-steps .icon{color:var(--muted)}
.short-steps li.ok button,.short-steps li.ok a{background:#fff6d6}
.short-steps li.ok .st-no{background:#ffc83d;color:#fff;box-shadow:none}
.short-steps li.ok .st-no .icon{width:15px;height:15px;color:#fff}
.sw-next{width:100%;display:flex;align-items:center;gap:8px;margin-top:12px;padding:12px 14px;border-radius:16px;background:#ffe1ec;color:#a3406b;text-align:left}
.sw-next span{font-size:12.5px;font-weight:700;flex:none}
.sw-next b{flex:1;min-width:0;font-size:14px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feed-bar{position:fixed;z-index:20;left:0;right:0;bottom:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;padding:6px max(28px,calc((100% - 520px)/2)) calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-radius:24px 24px 0 0;box-shadow:0 -10px 28px -18px rgba(60,30,50,.4)}
.feed-bar button{display:flex;flex-direction:column;align-items:center;gap:3px;justify-self:center;min-width:76px;padding:4px 10px 0;color:var(--muted)}
.feed-bar .fb-ic{display:grid;place-items:center;width:52px;height:36px;border-radius:999px;transition:background .15s,color .15s,transform .15s}
.feed-bar .fi{width:26px;height:26px}
.feed-bar .fb-label{font-size:12px;font-weight:800;line-height:1.2;letter-spacing:.04em}
.feed-bar button[aria-pressed=true]{color:var(--brand-dark)}
.feed-bar button[aria-pressed=true] .fb-ic{background:var(--brand-light)}
.feed-bar button:active .fb-ic{transform:scale(.94)}
.feed-bar .fb-main .fb-ic{width:64px;height:64px;margin-top:-30px;border-radius:50%;background:#ff8fb8;color:#fff;box-shadow:0 10px 22px -8px rgba(240,100,150,.7),0 0 0 6px var(--surface)}
.feed-bar .fb-main .fi{width:30px;height:30px}
.feed-bar .fb-main[aria-pressed=true] .fb-ic{background:#f2739f}
.feed-bar .fb-main .fb-label{color:var(--ink)}
.short-media video{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 45%;background:#ffe1ec}

/* 课文：彩色词块 — the user's iPad textbook design and its colours: a line under every word (blue for
   words, purple for particles, yellow for verbs and endings, pink for negatives and replies), furigana
   above. 逐句跟读 scrolls through all sentences like the scene feed, the controls fixed at the bottom. */
.stripes{line-height:1.6}
.stripe{position:relative;display:inline-block;vertical-align:bottom;margin:0 4px 8px 0;padding:.75em 0 7px;line-height:1.55}
.stripe::after{content:"";position:absolute;left:1px;right:1px;bottom:0;height:3px;border-radius:999px;background:var(--line-c)}
.stripe-unit{display:inline-block;white-space:nowrap}
.stripe-unit .stripe{margin-right:1px}
.stripe-unit .stripe:last-child{margin-right:4px}
.stripe ruby{ruby-position:over;ruby-align:center}
.stripe rt{font-size:.55em;font-weight:400}
.s-w{--line-c:#91c5f2}
.s-p{--line-c:#bca0eb}
.s-e{--line-c:#e9cf79}
.s-n,.s-r{--line-c:#f2b3d2}
.s-q{--line-c:#e3dfe8}
.stripe-legend{display:flex;flex-wrap:wrap;gap:6px 12px;margin:4px 4px 12px;font-size:12px;color:var(--muted)}
.stripe-legend .lg{display:inline-flex;align-items:center;gap:5px}
.stripe-legend .lg i{display:inline-block;width:18px;height:4px;border-radius:99px;background:var(--line-c)}
.para.striped .jp-line{margin:2px 0 4px}
.follow-start{display:flex;width:100%;justify-content:center;gap:8px;margin:2px 0 12px}
.fl-list{padding-bottom:150px}
.fl-list .read-sec{padding:0 16px 6px}
.fl-unit{margin:4px -10px;padding:4px 10px 6px;border-radius:16px;border:2px solid transparent;cursor:pointer;transition:background .2s,border-color .2s}
.fl-unit.current{border-color:#e9cf79;background:var(--surface-2)}
.fl-unit.current.recording{border-color:var(--brand)}
.fl-unit .jp-line{margin:2px 0}
.fl-zh{margin:4px 0 2px;color:var(--muted);font-size:14px}
.follow-dock{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + env(safe-area-inset-bottom));z-index:30;width:min(var(--col),calc(100% - 20px));padding:6px 8px 8px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow-lg)}
.fd-top{display:flex;justify-content:space-between;align-items:center;padding:0 8px 4px;font-size:12px;color:var(--muted)}
.fd-top button{font-size:12px;font-weight:700;color:var(--brand-dark);padding:2px 0}
.fd-row{display:flex;align-items:center;gap:8px}
.fd-btn{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 4px;border-radius:16px;font-size:12px;font-weight:700;color:var(--ink);background:var(--surface-2)}
.fd-btn svg{width:24px;height:24px}
.fd-btn.demo svg{color:#d9a400}
.fd-btn.mine svg{color:#8e6ad6}
.fd-btn.rec{background:var(--brand);color:#fff}
.fd-btn.rec.on{background:var(--brand-dark)}
.fd-btn:disabled{opacity:.45}
.fd-nav{flex:none;display:grid;place-items:center;width:36px;height:52px;border-radius:14px;color:var(--muted)}
.fd-nav:disabled{opacity:.3}
/* 地图: the way into the swipe-up scene feed (it no longer has a tab of its own) */
.feed-entry{display:flex;align-items:center;gap:12px;padding:10px 14px 10px 10px;margin:0 0 14px;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow)}
.fe-pic{flex:none;width:84px;height:56px;border-radius:12px;overflow:hidden;background:var(--brand-light)}
.fe-pic img{width:100%;height:100%;object-fit:cover}
.fe-text{flex:1;min-width:0}
.fe-text b{display:block;font-size:17px}
.fe-text small{display:block;color:var(--muted);font-size:12px;line-height:1.45}
.fe-go{flex:none;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--brand);color:#fff}
/* 课文: a one-line lesson title, nothing between the part tabs and the text, the controls at the bottom */
.lesson-head.compact{gap:10px;margin:6px 0 10px}
.lesson-head.compact .icon-btn{width:38px;height:38px}
.lesson-head.compact h1{display:flex;align-items:baseline;gap:8px;min-width:0;font-size:17px;line-height:1.3}
.lesson-head.compact h1 small{flex:none;font-size:13px;font-weight:700;color:var(--muted)}
.lesson-head.compact h1 span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.text-top-gap{height:12px}
.dock-space{height:90px}
.lesson-dock{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + env(safe-area-inset-bottom));z-index:30;width:min(var(--col),calc(100% - 20px));display:flex;gap:6px;padding:6px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow-lg)}
.ld-btn{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 2px;border-radius:18px;font-size:12px;font-weight:700;color:var(--muted)}
.ld-btn svg{width:22px;height:22px}
.ld-btn.main{flex:1.3;background:var(--brand);color:#fff}
.ld-btn.on{color:var(--ink)}
.ld-btn.on svg{color:#8e6ad6}
/* 我的: a row per kind of saved thing (only when there is one), a quiet line for backup */
.me-rows{list-style:none;margin:14px 0 6px;padding:0;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.me-rows li+li{border-top:1px solid var(--line)}
.me-rows button,.me-rows a{display:flex;align-items:center;gap:10px;width:100%;padding:14px 16px;text-align:left}
.me-rows button b,.me-rows a b{flex:1;font-size:15px}
.me-rows button em,.me-rows a em{font-style:normal;font-weight:800;color:var(--muted)}
.me-rows .icon:first-child{color:var(--brand-dark)}
.me-foot{display:flex;justify-content:center;gap:8px;margin:22px 0 8px;font-size:13px;color:var(--muted)}
.me-foot button{color:var(--muted)}
.me-foot button[data-act="reset"]{color:var(--bad)}
.me-head~.stats{grid-template-columns:repeat(4,1fr);gap:8px}
.me-head~.stats>div{padding:12px 4px}
.me-head~.stats b{font-size:20px}
.me-head~.stats span{font-size:11px}
/* 我的: account card and the login sheet */
.account-card{display:flex;align-items:center;gap:12px;margin:14px 0 4px;padding:12px 14px;background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow)}
.ac-ic{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--brand-soft);color:var(--brand-dark)}
.ac-text{flex:1;min-width:0}
.ac-text b{display:block;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ac-text small{display:block;font-size:12px;color:var(--muted)}
.field{display:block;margin:12px 0}
.field>span{display:block;font-size:13px;font-weight:700;margin-bottom:6px}
.field input{width:100%;padding:12px 14px;border-radius:14px;border:1.5px solid var(--line-2);background:var(--surface-2);font-size:16px}
.field input:focus{outline:none;border-color:var(--brand)}
.form-err{min-height:1.4em;margin:4px 2px 10px;font-size:13px;color:var(--bad)}
.login-box .btn.wide+.btn.wide{margin-top:8px}
.fresh-codes{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:10px 0}
.fresh-codes code,.invite-list code{font:700 16px/1.4 ui-monospace,Menlo,monospace;letter-spacing:.08em}
.fresh-codes code{padding:10px;border-radius:12px;background:var(--brand-soft);text-align:center}
.invite-list{list-style:none;margin:12px 0 0;padding:0;max-height:40vh;overflow:auto}
.invite-list li{display:flex;justify-content:space-between;align-items:center;padding:8px 2px;border-top:1px solid var(--line)}
/* 地图: every islet is a tap target for its area (the label pin sits above it) */
.islet{position:absolute;transform:translate(-50%,-50%);width:46%;height:16%;border-radius:40%;-webkit-tap-highlight-color:transparent}
.islet:active{background:rgba(255,255,255,.22)}
.island.solo{max-width:var(--col);margin:0 auto 8px}
.island.solo{margin-top:6px}
/* 地图: nothing but the island, full width, centred, the rest of the screen the same sea */
body[data-page="map"]{background:#86d8fd}
body[data-page="map"] .view{max-width:none;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;padding:env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom))}
body[data-page="map"] .island.solo{width:min(100%,640px);margin:0 auto;border-radius:0;box-shadow:none;background:none}

/* 排行榜和学习群（views/ranks.js, views/group.js） */
.icon.xs{width:13px;height:13px;vertical-align:-2px}
.streak-chip .chip-sep{display:inline-block;width:1px;height:14px;background:currentColor;opacity:.25;margin:0 6px}
.study-seg a{flex:1;display:flex;align-items:center;justify-content:center;min-height:38px;border-radius:999px;font-weight:800;font-size:14px;color:var(--muted)}
.study-seg a.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.av{display:inline-grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;color:#fff;font-weight:800;font-size:15px}
.av.lg{width:52px;height:52px;font-size:21px}
.my-rank{display:flex;align-items:center;gap:12px;padding:14px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}
.my-rank>div{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.my-rank b{font-size:17px}
.week-note{margin:12px 4px 6px}
.rank-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
.rank-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.rank-row.me{outline:2px solid #f35fa6}
.rank-no{width:26px;text-align:center;font-weight:900;font-size:16px;color:var(--muted)}
.rank-no.r1{color:#e6a800}.rank-no.r2{color:#9a9aa8}.rank-no.r3{color:#d9822b}
.rank-name{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.rank-name b{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-name b small{font-size:11px;font-weight:700;color:#f35fa6;margin-left:2px}
.rank-name small.muted{font-size:12px}
.done-today{color:#e0457f;font-weight:700}
.rank-min{display:flex;flex-direction:column;align-items:flex-end;line-height:1.1}
.rank-min b{font-size:18px}.rank-min small{font-size:11px;color:var(--muted)}
.group-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
.group-list a{display:flex;align-items:center;gap:12px;padding:14px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.group-list a>span{flex:1;display:flex;flex-direction:column;gap:2px}
.group-actions{gap:10px;margin-top:16px}.group-actions .btn{flex:1}
.invite-card{display:flex;align-items:center;gap:12px;padding:14px;border-radius:18px;background:var(--warn-soft);margin-bottom:12px}
.invite-card>div{flex:1;display:flex;flex-direction:column;gap:4px}
.invite-card code{font-size:26px;font-weight:900;letter-spacing:4px;color:var(--warn)}
.today-count{display:flex;align-items:center;gap:6px;margin:4px 4px 10px;font-weight:700}
.today-count b{color:#e0457f;font-size:18px}
.av-pick{display:flex;gap:10px;margin:6px 0 14px}
.av-pick button{width:36px;height:36px;border-radius:50%;border:3px solid transparent}
.av-pick button[aria-checked=true]{border-color:var(--ink)}
.study-gate{padding:28px 12px}.study-gate .icon{width:40px;height:40px;color:#f35fa6}
.empty-note,.loading-note{margin:18px 6px}
.center{text-align:center}

/* 学习群标签页（views/groups.js） */
.board-card{display:flex;align-items:center;gap:10px;padding:14px;border-radius:20px;background:var(--warn-soft);color:var(--ink);box-shadow:var(--shadow);margin-bottom:6px}
.board-card>.icon:first-child{color:var(--warn);width:26px;height:26px}
.board-card>span:not(.av){flex:1;display:flex;flex-direction:column;gap:2px}
.board-card b{font-size:16px}
.group-cards{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.group-card{display:flex;align-items:center;gap:12px;padding:16px 14px;border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}
.gc-ic{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:#f35fa6;color:#fff;flex:none}
.gc-main{flex:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.gc-main b{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gc-today,.gc-rank{display:flex;flex-direction:column;align-items:center;line-height:1.15;min-width:48px}
.gc-today b{font-size:17px;color:#e0457f}.gc-rank b{font-size:15px}
.gc-today small,.gc-rank small{font-size:11px;color:var(--muted)}

/* Learning polish: keep the pink world while making its actions legible. */
:root{--on-pink:#402333}
.btn.primary,.icon-btn.big,.tabs a.tab-map .icon,.lesson-row.current .lesson-no,.part-tabs a.active,.part-tabs a.active .icon,.mic,.chip.go,.ts-btn,.feed-bar .fb-main .fb-ic,.fd-btn.rec,.fe-go,.ld-btn.main,.hero-lesson{color:var(--on-pink)}
.btn.danger{background:#b72b3a;color:white}
.pin i,.qty-badge,.film-frame.me .film-role{background:#b72f65;color:white}
.spot-chip.on{background:#ffe2ed;color:#402333}
.short-steps li.ok .st-no,.short-steps li.ok .st-no .icon{color:#513800}
.short-back,.short-fav{min-width:44px;min-height:44px}
.tb{cursor:default}
.bubble-play{display:block;text-align:left;width:100%;color:inherit;border-radius:8px;min-height:44px}
.bubble-play:focus-visible{outline-color:#6b405c;outline-offset:5px}
.core h3{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.core h3 small{color:var(--muted);font-size:12px;font-weight:400}
.core-word{min-height:72px}
.short-media{position:relative}
@media(min-width:900px){.short-media{position:sticky}}
.media-retry{position:absolute;bottom:8px;left:8px;right:8px;min-height:44px;border-radius:10px;background:var(--surface);color:var(--ink);font-size:12px;padding:6px}
[hidden]{display:none!important}
.group-translation{margin-top:10px;border-top:1px solid var(--line);padding-top:8px;color:var(--muted);font-size:13px}
.group-translation small{font-weight:700}
.today-heading{font-size:26px;margin:12px 0 5px}
.today-sub{color:var(--muted);font-size:14px;margin-bottom:18px}
.today-scene{border-radius:20px;box-shadow:var(--shadow)}
.ts-pic{height:150px;aspect-ratio:auto}
.ts-body{gap:8px;padding:16px}
.ts-kicker{font-size:12px;color:var(--brand-dark);font-weight:700}
.ts-title{font-size:20px}
.ts-line{font-size:15px;color:var(--ink);line-height:1.7}
.ts-btn{min-height:44px;margin-top:4px;padding:9px 18px}
.today-pair{grid-template-columns:1fr;gap:8px;margin-top:14px}
.mini-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:16px;box-shadow:none}
.mini-card>span:nth-child(2){flex:1;display:grid;gap:2px;min-width:0}
.mini-card b,.mini-card small{padding:0}
.mini-card b{font-size:15px}
.mini-card small{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mc-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--brand-soft);color:var(--brand-dark)}
.today-places{margin-top:24px}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.section-heading h2{font-size:17px}
.section-heading a{display:flex;align-items:center;font-size:12px;color:var(--muted)}
.quick-places{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.quick-places a{position:relative;display:block;overflow:hidden;border-radius:14px;aspect-ratio:1.4}
.quick-places img{width:100%;height:100%;object-fit:cover}
.quick-places b{position:absolute;left:0;right:0;bottom:0;padding:18px 8px 6px;background:rgba(30,20,30,.82);color:white;font-size:13px}
.product-art{display:block;width:100%;aspect-ratio:1;background-repeat:no-repeat;background-color:#fffaf1;border-radius:12px}
.product-art.big{width:200px;max-width:100%;margin:0 auto 12px}
@media(min-width:700px){
 body[data-page=today] .view{max-width:920px}
 .today-scene{display:grid;grid-template-columns:42% minmax(0,1fr)}
 .ts-pic{height:100%;min-height:220px}
 .ts-body{padding:24px}
 .today-pair{grid-template-columns:1fr 1fr}
 .quick-places a{aspect-ratio:2.7}
}
@media(prefers-reduced-motion:reduce){.feed{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
