:root{--muted:#586570;--success:#24764b;--danger:#b63a32}html,body{background:#f3e9df;user-select:auto;font-size:16px;line-height:1.6}body{margin:0}#app.v3-app{max-width:1120px;min-height:100dvh;box-shadow:0 4px 40px #6b514515;overflow:visible;padding-bottom:100px}.v3-header{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10;background:#fff6eef5;backdrop-filter:blur(12px)}.brand{display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none;font-weight:800}.brand-mark{font-size:1.05rem}.content{padding:24px;flex:1}h1{font-size:1.6rem;line-height:1.35;margin:0 0 8px}h2{font-size:1.2rem;margin:0 0 12px}h3{font-size:1rem}p{margin:0 0 12px}a{color:#7047b8}.muted{color:var(--muted)}.kicker{color:#a74619;font-size:.8rem;letter-spacing:.08em;font-weight:800}.pill{border:1px solid #dfd1c4;background:white;border-radius:30px;padding:9px 16px;color:var(--text);font-weight:700;min-height:44px}.pill.active{background:var(--primary-soft);border-color:var(--primary)}button,input,select,textarea{font:inherit}button,a,input,select,textarea{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #6647c9;outline-offset:3px}button{min-height:44px}.btn{min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}.btn-primary{color:#fff;background:#b94b1d}.btn-ghost{background:#fff;color:var(--text);border:1px solid #dfd1c4}.row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.between{justify-content:space-between}.section{margin-top:28px}.panel{background:#fff;border:1px solid var(--border);border-radius:22px;padding:24px;box-shadow:var(--shadow)}.summary-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:20px}.book-card{margin:0;padding:26px;background:linear-gradient(125deg,#ffe0c9,#ffefd9);color:var(--text)}.book-card h1{font-size:1.7rem}.book-card p{color:#6f594b}.metric{font-size:2rem;font-weight:800;line-height:1.2}.metric small{font-size:1rem;font-weight:500}.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px}.topic{display:flex;align-items:center;gap:14px;padding:20px;border:1px solid var(--border);border-radius:20px;background:#fff;text-align:left;text-decoration:none;color:var(--text);transition:transform .15s,box-shadow .15s}.topic:hover{box-shadow:var(--shadow);transform:translateY(-2px)}.topic-ico{background:var(--primary-soft);border-radius:16px;padding:12px;font-size:1.6rem;line-height:1}.topic strong{display:block}.topic small{color:var(--muted)}.word-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:16px}.word-tile{border:1px solid var(--border);padding:14px;border-radius:20px;background:white;text-align:left;color:var(--text)}.word-tile img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:16px}.word-tile strong{display:block;font-size:1.15rem;margin-top:8px}.word-tile span{color:var(--muted)}.item-layout{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start}.item-picture{width:100%;max-width:420px;aspect-ratio:1;object-fit:contain;border-radius:28px;background:#fff4e7;justify-self:center}.item-copy{padding:20px 0}.english{font-size:2.3rem;font-weight:850;line-height:1.25;margin:16px 0 8px;overflow-wrap:anywhere}.chinese{color:var(--muted);font-size:1.2rem}.example{padding:16px 0;border-bottom:1px solid var(--border)}.example:last-child{border:0}.sentence-button{text-align:left;border:0;background:none;color:var(--text);padding:12px;width:100%;border-radius:10px}.sentence-button:hover{background:var(--bg-soft)}.audio-status{margin-top:10px;font-size:.88rem;color:var(--muted);min-height:24px}.audio-fallback{font-size:.9rem;border:1px solid #c9bdad;background:#fff;border-radius:10px;padding:8px 12px}.notice{margin:12px 24px 0;padding:12px 16px;border-radius:12px;background:#fff0ce;color:#6b4b0b}.error{color:#a22a25;padding:10px 0;white-space:pre-line}.success{color:#24633f}.empty{padding:35px 20px;text-align:center;color:var(--muted);border:1px dashed #cfbda9;border-radius:20px;background:#ffffff80}.list-stack{display:grid;gap:12px}.list-entry{padding:20px;background:#fff;border:1px solid var(--border);border-radius:18px;display:block;color:var(--text);text-decoration:none;text-align:left}.list-entry strong{display:block}.tag{border-radius:8px;background:#f0e9fa;color:#61449a;font-size:.8rem;padding:3px 8px}.tab-bar{max-width:1120px;margin:auto;left:0;right:0;width:100%;position:fixed;border-top:1px solid var(--border);box-shadow:0 -4px 20px #664f3e08}.tab-bar a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:#586570;font-weight:700;min-height:54px;border-radius:12px;flex:1}.tab-bar a.active{background:var(--primary-soft);color:#9e3e15}.site-footer{padding:18px 24px;display:flex;justify-content:space-between;gap:12px;font-size:.8rem;color:var(--muted)}.hidden{display:none!important}.form-grid{display:grid;gap:14px}label{display:block;font-weight:700}input,select,textarea{width:100%;padding:12px;border:1px solid #c9bdad;border-radius:12px;background:#fff;min-width:0}label small{display:block;font-weight:400;color:var(--muted);margin-top:5px}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.dialog-head h2{margin:0}.dialog-head button{border:0;background:#f3eee9;border-radius:50%;width:44px;font-size:1.5rem}dialog{border:1px solid var(--border);border-radius:24px;padding:24px;width:min(92vw,520px);max-height:88dvh;overflow:auto;margin:auto;color:var(--text);background:var(--bg)}dialog::backdrop{background:#32291f88;backdrop-filter:blur(3px)}.v3-toast{position:fixed;left:50%;bottom:92px;transform:translateX(-50%);padding:12px 20px;border-radius:14px;background:#2d3839;color:white;z-index:100;max-width:90vw;pointer-events:none}.v3-toast:empty{display:none}.skip-link{position:fixed;left:10px;top:-80px;z-index:200;background:white;padding:12px}.skip-link:focus{top:10px}.story-text{max-width:740px;margin:20px auto;font-size:1.12rem;line-height:1.9}.quiz{background:#f5f0fb;padding:16px;border-radius:16px;margin-top:16px}.quiz .row{margin-top:10px}.quiz button{border:1px solid #cfc1e3;background:white;border-radius:10px;padding:8px 15px}.quiz button.correct{background:#d7f1df;border-color:#3d8957}.quiz button.wrong{background:#fbe2db;border-color:#ae5b44}.progress-track{height:8px;background:#f2e0ce;border-radius:10px;overflow:hidden;margin:14px 0}.progress-track i{display:block;background:var(--primary);height:100%}.management{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px}.management .panel{min-width:0}.binding{padding:14px 0;border-bottom:1px solid var(--border)}.admin-layout{max-width:1200px;margin:auto;padding:30px 24px}.table-wrap{overflow:auto;background:#fff;border-radius:14px}table{width:100%;border-collapse:collapse;font-size:.9rem}th,td{text-align:left;white-space:nowrap;padding:12px;border-bottom:1px solid var(--border)}th{background:#f5f0e9}.small{font-size:.85rem}.code-output{white-space:pre-wrap;overflow-wrap:anywhere;background:#293338;color:white;padding:16px;border-radius:12px;font-family:monospace;user-select:text}.danger{background:#fff1ec;border:1px solid #e0aaa0;color:#9a3426}.game-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}.game-options button{padding:18px;background:white;border:2px solid var(--border);border-radius:16px}.game-options img{width:100%;max-height:160px;object-fit:contain}.match-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.match-grid button{padding:15px;border:2px solid var(--border);background:white;border-radius:12px}.match-grid img{max-width:100%;height:90px}.match-grid button.selected{border-color:var(--primary)}.match-grid button.matched{opacity:.45;border-color:#33865a}.cache-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}@media(max-width:680px){.content{padding:18px}.v3-header{padding:14px 18px}.summary-grid,.item-layout{grid-template-columns:1fr}.tiles{grid-template-columns:1fr 1fr;gap:12px}.topic{padding:15px;gap:10px}.topic-ico{font-size:1.3rem;padding:9px}.item-picture{max-width:300px}.item-copy{padding:0}.english{font-size:2rem}.panel{padding:20px}.site-footer{flex-direction:column}.management{grid-template-columns:1fr}.match-grid{grid-template-columns:repeat(2,1fr)}.word-grid{grid-template-columns:1fr 1fr;gap:12px}.tab-bar a{font-size:.9rem}.book-card h1{font-size:1.45rem}.notice{margin-left:18px;margin-right:18px}.admin-layout{padding:20px 14px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.v3-header .brand-mark{width:48px;min-width:48px;height:36px;white-space:nowrap;font-size:16px;border-radius:12px}.row>.btn{width:auto;flex:1;min-width:140px}.tab-bar .tab{font-size:14px}.content:focus:not(:focus-visible){outline:none}

/* The route target receives focus for screen readers; interactive controls retain visible focus rings. */
main#view:focus{outline:none}
.sentence-fallback{margin:4px 0 12px;font-size:13px}

.scene-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.scene-grid .list-entry{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:10px;min-height:180px}.scene-symbol{font-size:30px;line-height:1.2}.scene-intro{display:flex;gap:20px;align-items:center;justify-content:space-between}.scene-intro .btn{width:auto;white-space:nowrap}.scene-picture{display:block;width:100%;max-width:760px;height:auto;aspect-ratio:8/5;object-fit:contain;margin:18px auto;border-radius:22px;background:#f5eadb}.conversation-layout{grid-template-columns:1fr}.conversation-layout .item-copy{max-width:800px;width:100%;margin:auto}.dialogue{display:grid;gap:16px}.dialogue-turn{border:1px solid #e3ddd1;border-radius:18px;background:#fffaf1;padding:18px}.child-turn{margin-left:40px;background:#edf4f0}.role-label{font-size:13px;font-weight:700;color:#785139;display:block;margin-bottom:10px}.dialogue-turn .sentence-button{font-size:19px;text-align:left;line-height:1.6;padding:4px 0}.dialogue-turn p{margin:6px 0}.parent-tip{border-left:4px solid #80a18b;background:#f0f4ee;padding:18px;border-radius:10px}.parent-tip p{margin:8px 0 0;line-height:1.7}
@media(max-width:900px){.scene-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:680px){.scene-intro{align-items:stretch;flex-direction:column}.scene-grid{gap:12px}.scene-grid .list-entry{padding:16px;min-height:180px}.child-turn{margin-left:18px}.dialogue-turn{padding:15px}.dialogue-turn .sentence-button{font-size:18px}.scene-picture{border-radius:16px}.scene-intro .btn{white-space:normal}}
.row.between>.btn{flex:0 0 auto;min-width:0;width:auto}

/* Keep the bilingual pair together at every viewport size. */
.bilingual-pair{min-width:0}.bilingual-pair .sentence-button{font-size:18px;line-height:1.65;padding:8px 0}.bilingual-pair .translation{color:#4c5c57;font-size:16px;line-height:1.8;margin:2px 0 10px;overflow-wrap:anywhere}.bilingual-note{color:#526653;background:#eff5ed;border-radius:12px;padding:12px 16px;margin-top:20px}.bilingual-choice{display:flex;flex-direction:column;align-items:flex-start;min-width:100px;text-align:left}.choice-translation{display:block;font-size:14px;color:#53635a;margin-top:3px}.story-line{padding:14px 0;border-bottom:1px solid #eee5da}.story-line:last-child{border:0}.scene-group h2{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 12px}.scene-group h2 small{font-size:14px;font-weight:500;color:var(--muted)}.scene-count{font-size:14px;color:#5d625b}.scene-grid .scene-card{padding:16px;overflow:hidden;gap:8px}.scene-thumbnail{display:block;align-self:stretch;aspect-ratio:3/2;background:#f0eae0;border-radius:12px;overflow:hidden;margin-bottom:4px}.scene-thumbnail img{display:block;width:100%;height:100%;object-fit:cover}.scene-grid .list-entry strong{font-size:17px}.scene-grid .list-entry>span[lang=en]{font-size:15px}.scene-picture{aspect-ratio:3/2;background:#f2eee7;object-fit:contain}.image-disclosure{font-size:12px;line-height:1.7;color:#68625a;margin:0 auto;max-width:760px}.item-layout:has(>.image-disclosure){grid-template-columns:1fr;gap:10px}.dialogue-turn .translation{font-size:16px}.dialogue-turn .sentence-fallback{margin-bottom:0}.dialogue-turn .bilingual-pair .sentence-button{font-size:19px}.english{overflow-wrap:normal;word-break:normal}.scene-card .tag{align-self:flex-start}
@media(max-width:680px){.scene-grid{grid-template-columns:1fr}.scene-grid .scene-card{min-height:0;display:grid;grid-template-columns:120px minmax(0,1fr);gap:5px 14px}.scene-thumbnail{grid-row:1/5;grid-column:1;aspect-ratio:1;height:120px;width:120px;margin:0}.scene-card>.tag,.scene-card>strong,.scene-card>span[lang=en],.scene-card>.small{grid-column:2}.scene-card .tag{justify-self:start}.scene-grid .list-entry>span[lang=en]{font-size:14px;line-height:1.5}.scene-card>.small{font-size:12px}.bilingual-pair .sentence-button{font-size:18px}.dialogue-turn .translation{font-size:16px}.image-disclosure{text-align:left}.conversation-layout .item-copy{padding-top:8px}}
@media(max-width:360px){.scene-grid .scene-card{grid-template-columns:96px minmax(0,1fr);gap:6px 10px}.scene-thumbnail{height:96px;width:96px}.scene-grid .list-entry strong{font-size:16px}}

@media(max-width:680px){.scene-card:not(:has(.scene-thumbnail)){display:flex;min-height:0}}

.scene-figure{margin:0;min-width:0}.scene-figure .scene-picture{margin:0 0 10px}.conversation-layout{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:28px}.conversation-layout>.scene-figure{position:sticky;top:108px}.conversation-layout .item-copy{padding-top:0}.conversation-layout .english{font-size:2rem;margin-top:8px}.conversation-layout .bilingual-note{font-size:14px}.conversation-layout .dialogue{margin-top:16px}@media(max-width:900px){.conversation-layout{grid-template-columns:1fr}.conversation-layout>.scene-figure{position:static}.conversation-layout .english{font-size:1.9rem}}

.word-figure{margin:0;min-width:0;width:100%;max-width:420px;justify-self:center}.word-figure .item-picture{display:block}.word-figure .image-disclosure{margin-top:10px}

.word-figure:has(.image-disclosure) .item-picture{aspect-ratio:3/2;height:auto;background:#f5efe8}

.browse-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}.browse-toolbar label{display:flex;flex-direction:column;gap:6px;font-weight:700}.browse-search{flex:1 1 260px;min-width:0}.browse-filter{flex:0 1 200px}.browse-toolbar input,.browse-toolbar select{min-height:48px;width:100%;box-sizing:border-box;border:1px solid #cdbdab;border-radius:12px;background:#fff;padding:10px 12px;color:#332f2a}.browse-photo{display:block;width:100%;height:170px;object-fit:contain;background:#fff8ef;border-radius:14px}.study-actions{display:flex;flex-direction:column;align-items:stretch;gap:12px;max-width:460px;margin-inline:auto}.study-actions small{text-align:center}.word-tile strong,.list-entry strong{overflow-wrap:anywhere}.word-tile img{display:block;height:auto;aspect-ratio:1;object-fit:contain;background:#fff8ef}.word-tile span{display:block;line-height:1.5}.word-tile .small{font-size:.8rem;margin-top:5px}.word-figure .item-picture{object-fit:contain}.word-figure{min-width:0}@media(max-width:600px){.browse-toolbar{align-items:stretch}.browse-filter{flex:1 1 150px}.browse-photo{height:145px}.study-actions{max-width:none}.browse-toolbar button{align-self:flex-end}.browse-toolbar input{font-size:16px}}

/* v3.5: readable bilingual rows, compact study controls, no forced clipping. */
.home-overview h1{font-size:1.45rem;margin:0}.home-stats{display:flex;flex-wrap:wrap;gap:8px 22px;margin:10px 0;color:var(--muted);font-size:15px}.home-stats strong{color:var(--text)}.home-overview>p{margin:8px 0 0}.home-play .topic{padding:12px 16px;min-height:48px}.home-play h2{margin:0}
.study-extras>summary::after{content:'展开';margin-left:auto;padding-left:12px;color:#715e51;font-size:14px;font-weight:400}.study-extras[open]>summary::after{content:'收起'}
.bilingual-pair{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px;padding-block:7px}
.bilingual-pair .sentence-button{width:auto;max-width:100%;min-width:0;flex:0 1 auto;line-height:1.45;padding:7px 0;overflow-wrap:anywhere}
.bilingual-pair .translation{flex:0 1 auto;min-width:0;max-width:100%;margin:0;line-height:1.5;font-size:16px}
.headword{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;margin:8px 0 12px}
.headword .english,.headword .chinese{margin:0;max-width:100%}
.study-extras{margin-top:8px;border-top:1px solid var(--border)}
.study-extras>summary{display:flex;align-items:center;min-height:44px;font-weight:700;color:#684c3c;cursor:pointer;list-style:revert}
.study-extras[open]>summary{margin-bottom:8px}
.prefetch-setting{display:flex;align-items:center;gap:10px;min-height:44px;margin:8px 0}
.prefetch-setting input{width:22px;height:22px;padding:0;flex:none}
.dialogue{gap:9px}.dialogue-turn{padding:10px 14px}.role-label{margin-bottom:2px}.dialogue-turn .bilingual-pair{padding:0}.dialogue-turn .bilingual-pair .sentence-button{font-size:18px;line-height:1.4}
.bilingual-note{padding:8px 12px;margin-top:12px}.story-line{padding:9px 0}.story-text{margin:12px auto}
@media(max-width:680px){
 .content[data-study]{padding:10px 12px}.content[data-study]>.section{margin-top:10px}
 .content[data-study]>.panel{padding:12px;border-radius:18px}.content[data-study] .item-layout{gap:8px}
 .content[data-study] .headword{margin:2px 0 8px;gap:3px 12px}.content[data-study] .headword .english{font-size:clamp(30px,8.2vw,40px);line-height:1.15}
 .content[data-study] .headword .chinese{font-size:18px}.content[data-study] .item-copy>.kicker{margin-bottom:4px}
 .content[data-study] .item-copy>.row.section{margin-top:8px;gap:7px}.content[data-study] .item-copy>.row.section>.btn{min-width:110px;min-height:44px}
 .content[data-study] .audio-status{margin:5px 0;min-height:20px;font-size:13px;line-height:1.45}
 .content[data-study] .word-figure{max-width:320px}.content[data-study] .word-figure .item-picture{height:200px;width:100%;max-width:none;aspect-ratio:auto;border-radius:16px;object-fit:contain}
 .content[data-study] .scene-figure .scene-picture{height:170px;aspect-ratio:auto;margin-bottom:4px}
 .content[data-study] .image-disclosure{font-size:12px;line-height:1.4;margin:4px 0}
 .content[data-study=word]>.study-actions,.content[data-study=phrase]>.study-actions{position:sticky;bottom:calc(66px + env(safe-area-inset-bottom));z-index:6;gap:6px;margin-top:8px;padding:6px;background:#fff6eef5;border-radius:14px;box-shadow:0 -3px 14px #624c3010}
 .content[data-study] .study-actions>.btn{min-height:44px;padding-block:8px}.content[data-study] .study-actions small{font-size:12px;line-height:1.35}
 .content[data-study] .dialogue{gap:7px}.content[data-study] .dialogue-turn{padding:8px 10px;border-radius:12px}.content[data-study] .child-turn{margin-left:12px}
 .content[data-study] .parent-tip{padding:10px 12px}.content[data-study] .bilingual-pair .sentence-button{font-size:18px}
 .content[data-study] .bilingual-pair .translation{font-size:16px}.content[data-study] .story-text{font-size:18px;line-height:1.5}
}
@media(max-width:680px) and (max-height:700px){.content[data-study] .word-figure .item-picture{height:155px}.content[data-study] .scene-figure .scene-picture{height:140px}}
.content[data-study] .item-copy>.study-actions{position:static;margin:8px 0;padding:0;box-shadow:none;background:none;gap:6px;max-width:none}
.content[data-study] .item-copy>.study-actions .btn{min-height:44px;padding-block:8px}
.bilingual-choice{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:4px 8px}.choice-translation{display:inline;margin:0;font-size:16px}
@media(max-width:680px){.content[data-study] .item-copy>.row.section>.btn{min-width:96px}.content[data-study] .audio-fallback{font-size:14px;padding:8px;min-height:44px}.content[data-study] .item-copy>.row .pill{padding-inline:10px}}
@media(max-width:680px) and (max-height:700px){.v3-header{padding:8px 12px}.content[data-study] .item-copy>.kicker{display:none}.content[data-study] .item-copy>.study-actions{margin-top:4px}.content[data-study] .headword{margin-block:0 6px}}
.tiles.theme-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}.topic.theme-card{flex-direction:row;justify-content:flex-start;align-items:center;padding:12px;gap:14px;min-height:104px}.theme-card .theme-cover{display:block;width:80px;height:80px;min-width:80px;object-fit:contain;background:#fff8f0;border-radius:14px}.theme-card>div{min-width:0}.theme-card strong{font-size:1.1rem;line-height:1.45}.theme-card small{display:block;margin-top:5px}.entry-number{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:30px;padding:0 7px;border-radius:9px;background:#f0e9fa;color:#61449a;font-size:.9rem;font-weight:800;margin-bottom:8px}@media(max-width:480px){.tiles.theme-grid{grid-template-columns:1fr}.topic.theme-card{padding:12px;gap:16px}}
