@charset "UTF-8";
:root{--paper:#fff8e8;--ink:#3e493c;--muted:#867f6d;--serif:Georgia,"Noto Serif TC","PMingLiU",serif;font-family:Arial,"Microsoft JhengHei",sans-serif;color:var(--ink);background:#eee7d9;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background-image:radial-gradient(#846b3d0d .7px,transparent .7px);background-size:5px 5px}button,input,select{font:inherit;color:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:0;background:none;min-height:40px}button:disabled{opacity:.25;cursor:default}a{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ad7937;outline-offset:4px}button:hover:not(:disabled){color:#aa672c}h1,h2,h3,p{margin:0}[hidden]{display:none!important}.reader{width:calc(100% - 80px);max-width:1440px;margin:auto}header{height:68px;display:flex;align-items:center;justify-content:space-between;gap:20px;color:#817661;font-size:11px;letter-spacing:.5px}header a{text-decoration:none}header>span{font-family:var(--serif);font-size:15px;letter-spacing:2px}header button{font-size:11px}.book{position:relative;height:calc(100dvh - 157px);min-height:490px;max-height:840px;border-radius:5px 14px 14px 5px;box-shadow:0 2px 0 #cabc9f,0 5px 0 #fbf5e7,0 7px 0 #cabc9f,0 10px 0 #f4eddf,0 25px 40px #57492f26;background:var(--paper);isolation:isolate;overflow:hidden;outline:none}.book:before{content:'';position:absolute;inset:0 auto 0 0;width:14px;background:linear-gradient(90deg,#191f242b,transparent);z-index:5;pointer-events:none}.scene-art{display:block;width:64%;height:100%;object-fit:cover;object-position:center;position:absolute;left:0;top:0;z-index:-1;touch-action:pan-y}.page-content{height:100%;margin-left:64%;position:relative;display:flex;flex-direction:column;padding:35px 30px;background:radial-gradient(#bdb08e15 .7px,transparent .7px),linear-gradient(90deg,#d8c7a332,transparent 25px),var(--paper);background-size:5px 5px,auto,auto}.page-content:before{content:'';position:absolute;left:-28px;top:0;bottom:0;width:29px;background:linear-gradient(90deg,transparent,#fff8e8b3,var(--paper));pointer-events:none}.cover .scene-art,.ending .scene-art{width:100%}.cover .page-content,.ending .page-content{margin-left:0;background:linear-gradient(90deg,#06192a8c,transparent 65%);padding:7% 6%;color:#fff4cf;justify-content:center;align-items:flex-start}.cover .page-content:before,.ending .page-content:before{display:none}.cover-eyebrow{font-family:var(--serif);font-size:15px;letter-spacing:5px;margin-bottom:26px;color:#e9d4a3}.cover h1{font-family:var(--serif);font-weight:400;font-size:clamp(48px,6vw,90px);letter-spacing:-2px;line-height:1.05;text-shadow:0 2px 4px #00152a33}.cover-zh{font-family:var(--serif);font-size:clamp(23px,2.7vw,40px);letter-spacing:9px;margin-top:22px}.cover-copy{font-family:var(--serif);font-size:15px;line-height:1.9;margin-top:30px;color:#eadbb9;max-width:330px}.open-book{font-family:var(--serif);font-size:16px;letter-spacing:2px;border-bottom:1px solid #dec793;padding:12px 3px;margin-top:35px;color:#ffedba}.open-book:hover{color:white!important}.cover-mark{font-size:11px;letter-spacing:1px;position:absolute;bottom:30px;color:#e4d0a4}.chapter-label{font-family:var(--serif);font-size:12px;letter-spacing:1.5px;color:#927e55;line-height:1.5}.page-title{font-family:var(--serif);font-weight:400;font-size:26px;line-height:1.2;margin:12px 0 25px;color:#57674c}.dialogue-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;justify-content:center;gap:30px;flex:1}.dialogue-text{display:block;text-align:left;width:100%;border-radius:6px}.speaker{display:flex;align-items:center;gap:9px;font-size:11px;color:#896d4d;letter-spacing:.3px;margin-bottom:10px}.portrait{font-size:25px;line-height:1;width:31px;display:inline-block;text-align:center}.your-turn{font-size:9px;border-bottom:1px solid #b5813d;color:#986021;margin-left:auto;padding-bottom:2px}.line-en{font-family:var(--serif);font-size:clamp(20px,2vw,30px);line-height:1.42;letter-spacing:-.2px;display:block;color:#3d493a}.line-zh{font-size:13px;line-height:1.85;color:#8a7c63;display:block;margin-top:12px}.line-cue{font-family:var(--serif);font-size:11px;line-height:1.5;color:#a28a5e;margin-top:10px;display:block}.selected-role .dialogue-text{background:#f0e5c78c;box-shadow:0 0 0 10px #f0e5c78c}.page-number{font-family:var(--serif);text-align:center;font-size:12px;letter-spacing:3px;color:#a18d67;margin-top:25px}.page-content.turn-in{animation:turn-in .28s ease-out}@keyframes turn-in{from{opacity:.35;transform:translateX(8px)}to{opacity:1;transform:none}}.cast-intro{font-family:var(--serif);color:#8a7a5e;font-size:14px;line-height:1.9}.cast-list{display:flex;flex-direction:column;gap:10px;margin:20px 0;flex:1;justify-content:center}.cast-role{display:flex;align-items:center;gap:15px;text-align:left;padding:8px;border-bottom:1px dashed #d5c7a6}.cast-role .portrait{font-size:33px;width:40px}.cast-role strong{display:block;font-family:var(--serif);font-size:19px;font-weight:400}.cast-role small{font-size:11px;color:#918269;display:block;margin-top:4px}.cast-role[aria-pressed=true]{background:#eee2c4}.cast-role[aria-pressed=true]:after{content:'✓';margin-left:auto;color:#947440}.cast-page .page-title{font-size:31px}.ending .page-content{background:linear-gradient(90deg,#10282ccc,transparent)}.ending h2{font-family:var(--serif);font-size:clamp(40px,5vw,72px);font-weight:400;line-height:1.1;max-width:450px}.ending p{font-family:var(--serif);line-height:1.9;color:#ecd7ae;margin:25px 0 0;font-size:17px;max-width:330px}.ending-buttons{display:flex;gap:20px;margin-top:30px;flex-wrap:wrap}.ending-buttons button{color:#ffe8b0;font-family:var(--serif);font-size:15px;border-bottom:1px solid #d7bc82;padding:10px 0}.reading-bar{margin-top:21px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:15px;font-size:12px}.reading-options,.page-controls,.extras{display:flex;align-items:center;gap:15px}.reading-options button{font-size:12px;padding:3px 4px;white-space:nowrap}.reading-options button[aria-pressed=true]{color:#a5672a}.page-controls{gap:18px}.page-controls>button:first-child,.page-controls>button:last-child{font-size:24px;width:42px;height:42px;border:1px solid #c9b99a;border-radius:50%;background:#f6efdf}.page-controls #contents-open{font-family:var(--serif);font-size:13px;min-width:115px}.extras{justify-content:flex-end;font-size:11px;gap:20px}.extras button{border-bottom:1px dotted #b6a383;min-height:30px;padding:0 1px}.reading-note{display:flex;justify-content:center;align-items:center;gap:13px;min-height:32px;font-size:10px;color:#9b8a6c;flex-wrap:wrap;padding:4px 0 9px}.reading-note button{min-height:26px;font-size:10px;color:#95602e}#live-status:empty{display:none}.reader:fullscreen{background:#eee7d9;width:100%;max-width:none;padding:0 28px;overflow:auto}.reader:fullscreen header{height:40px}.reader:fullscreen .book{height:calc(100dvh - 134px);max-height:none}dialog{background:var(--paper);border:1px solid #c7b68f;border-radius:7px 15px 15px 7px;padding:38px;max-width:calc(100vw - 28px);width:520px;max-height:calc(100dvh - 40px);color:var(--ink);box-shadow:0 8px 0 #e1d3b9,0 20px 70px #15213166}dialog::backdrop{background:#2333279c;backdrop-filter:blur(5px)}dialog .close{position:absolute;right:12px;top:8px;font-size:26px;width:40px}dialog h2{font-family:var(--serif);font-size:29px;line-height:1.3;font-weight:400;margin:10px 0 20px}dialog h3{font-family:var(--serif);font-size:24px;line-height:1.4;margin:15px 0}dialog p,dialog li{font-size:13px;line-height:1.9;margin:12px 0}dialog a{font-size:12px;line-height:2;color:#92703f}dialog small,dialog .small-note{font-family:var(--serif);font-size:11px;line-height:1.8;color:#8d8066}.wide-dialog{width:660px}.dialog-buttons{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0 8px}.dialog-buttons button{border:1px solid #c7b38b;border-radius:5px;padding:10px 15px;background:#f0e5ca;font-size:12px}.setting{display:flex;justify-content:space-between;gap:15px;align-items:center;font-size:13px;margin:22px 0 12px}.setting select{max-width:65%;padding:9px 8px;border:1px solid #c7b99b;border-radius:4px;background:#fffaf0;font-size:12px}.range-label{display:flex;align-items:center;gap:10px;font-size:12px;margin:20px 0}.range-label input{min-height:30px;min-width:50px;flex:1;accent-color:#9b774a}.contents-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.contents-list button{text-align:left;padding:12px 9px;border-bottom:1px solid #dfd3b9;font-size:12px;line-height:1.5}.contents-list button small{display:block;font-size:10px;color:#938568}.contents-list button[aria-current=true]{background:#ecdfc3}.word-list{display:flex;gap:9px;flex-wrap:wrap}.word-list button{padding:10px 14px;border:1px dashed #c1aa7f;border-radius:50% 46% 44% 50%;font-family:var(--serif);font-size:18px;background:#f4e9cf}.word-list button[aria-pressed=true]{background:#e4d4ad}#word-detail{margin-top:20px;border-top:1px solid #d9c9a8;padding-top:5px}#word-title{font-size:38px}#word-example{font-family:var(--serif);font-size:22px;line-height:1.5}.beats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:25px 0}.beats span{display:flex;align-items:center;flex-direction:column;gap:12px;font-size:12px}.beats b{width:48px;height:48px;border:1px solid #c0ac81;background:#f0e2be;border-radius:50%;display:grid;place-items:center;font-family:var(--serif);font-size:26px;font-weight:400}.beats .active b{background:#6c7c59;color:#fff8df}dialog .chant{font-family:var(--serif);font-size:28px;line-height:1.5;padding:15px 22px;border-left:3px solid #d4b66f}.quiz-options{display:flex;flex-direction:column;gap:8px}.quiz-options button{text-align:left;border-bottom:1px dashed #c6b693;padding:12px;font-family:var(--serif);font-size:20px}.quiz-options button:disabled{opacity:1}.quiz-options .correct{background:#e0e8cd}.quiz-options .incorrect{background:#f1d9c8}.notice{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);max-width:90%;width:max-content;background:#394935;color:#fff8e8;padding:12px 18px;border-radius:5px;font-size:12px;z-index:15}.notice:empty{display:none}.skip{position:fixed;top:-90px;left:20px;z-index:10;padding:14px;background:var(--paper)}.skip:focus{top:10px}#print-area{display:none}
.page-content{overflow-y:auto}.cover .page-content,.ending .page-content{overflow:visible}.cover-copy{margin-top:20px}.open-book{margin-top:20px}.cover-eyebrow{margin-bottom:20px}.cast-page .page-content{padding-top:25px;padding-bottom:25px}.cast-page .page-title{font-size:28px;margin-bottom:18px}.cast-list{gap:5px;margin:12px 0}.cast-page .page-number{display:none}.bilingual.story-page .page-content{padding:24px 28px}.bilingual .page-title{font-size:22px;margin:8px 0 14px}.bilingual .dialogue-list{gap:20px}.bilingual .line-en{font-size:23px;line-height:1.35}.bilingual .line-zh{font-size:12px;line-height:1.65;margin-top:8px}.bilingual .line-cue{font-size:10px;margin-top:6px}.bilingual .speaker{margin-bottom:8px}.bilingual .page-number{margin-top:15px}
@media(min-width:1600px){.page-content{padding:45px}.line-en{font-size:31px}.dialogue-list{gap:40px}}
@media(max-width:1050px){.reader{width:calc(100% - 40px)}.page-content{padding:28px 23px}.scene-art{width:59%}.page-content{margin-left:59%}.page-title{font-size:24px}.line-en{font-size:23px}.dialogue-list{gap:23px}.cover-copy{font-size:13px;max-width:260px}.cover h1{font-size:64px}.reading-bar{gap:6px}.reading-options,.extras{gap:9px}.reading-options button,.extras button{font-size:11px}.page-controls{gap:8px}.page-controls #contents-open{min-width:95px}.page-controls>button:first-child,.page-controls>button:last-child{width:36px;height:36px;font-size:20px}#fullscreen span{display:none}header>span{font-size:12px}.cover .page-content{padding:6%}.line-zh{font-size:12px}}
@media(max-width:900px){.reader{width:calc(100% - 24px)}header{height:54px;font-size:10px;gap:8px}header>span{display:none}header button{font-size:10px}.book{height:auto;min-height:0;max-height:none}.scene-art{position:relative;width:100%;height:auto;aspect-ratio:1.5;object-fit:cover;z-index:0}.page-content{height:auto;margin-left:0;padding:23px 25px;background:var(--paper)}.page-content:before{left:0;right:0;top:-25px;height:26px;width:auto;background:linear-gradient(0deg,var(--paper),transparent)}.cover .scene-art,.ending .scene-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:62% center}.cover,.ending{min-height:590px;height:calc(100dvh - 190px);max-height:850px}.cover .page-content,.ending .page-content{height:100%;padding:34px 27px;background:linear-gradient(180deg,#081f33ad,transparent 66%,#081f3370);justify-content:flex-start}.cover-eyebrow{font-size:11px;letter-spacing:3px;margin-bottom:19px}.cover h1{font-size:55px}.cover-zh{font-size:24px;letter-spacing:6px;margin-top:15px}.cover-copy{font-size:12px;line-height:1.8;margin-top:22px;max-width:230px}.open-book{margin-top:23px;font-size:14px}.cover-mark{font-size:10px;bottom:22px}.page-title{font-size:23px;margin:7px 0 24px}.chapter-label{font-size:11px}.dialogue-list{gap:28px}.line-en{font-size:25px;line-height:1.4}.line-zh{font-size:13px}.speaker{font-size:11px}.page-number{margin-top:24px}.cast-page .scene-art{aspect-ratio:1.9;object-position:center 38%}.cast-list{gap:9px;margin:18px 0}.cast-role{padding:7px}.cast-role strong{font-size:19px}.ending .page-content{justify-content:center;background:linear-gradient(90deg,#10272abf,#10272a1a)}.ending h2{font-size:47px;max-width:300px}.ending p{font-size:15px;max-width:250px}.reading-bar{grid-template-columns:1fr;gap:5px;margin-top:20px}.page-controls{grid-row:1;justify-content:center;gap:30px}.page-controls>button:first-child,.page-controls>button:last-child{width:42px;height:42px}.page-controls #contents-open{font-size:14px;min-width:100px}.reading-options{justify-content:center;gap:18px;margin-top:4px}#fullscreen span{display:inline}.reading-options button{font-size:12px}.extras{justify-content:center;gap:35px}.extras button{font-size:11px}.reading-note{font-size:9px;margin-top:8px;min-height:38px;padding-bottom:12px}.reader:fullscreen{padding:0 12px}.reader:fullscreen .book{height:auto;min-height:0}.reader:fullscreen .cover,.reader:fullscreen .ending{height:calc(100dvh - 220px);min-height:570px}.reader:fullscreen header{height:36px}dialog{padding:32px 23px}.contents-list{gap:5px}.contents-list button{padding:10px 6px;font-size:11px}.setting{align-items:flex-start;flex-direction:column;gap:9px}.setting select{max-width:100%;width:100%}.range-label{font-size:11px}.dialog-buttons button{padding:9px 12px}}
@media(max-height:650px) and (min-width:701px){header{height:44px}.book{height:auto;min-height:480px}.page-content{min-height:480px}.line-en{font-size:22px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Classroom projection: Traditional Chinese stays large and high contrast. */
@media screen {
  :root { --zh-font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif; }
  .reader { max-width: 1800px; }
  .speaker-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
  .speaker-zh { font-family: var(--zh-font); font-weight: 700; color: #334232; }
  .story-page .speaker { font-size: 18px; color: #514734; }
  .bilingual.story-page .page-content { padding: 22px 30px; }
  .bilingual.story-page .chapter-label { font-family: var(--zh-font); font-size: 20px; color: #655334; }
  .bilingual.story-page .page-title { font-size: 26px; margin: 8px 0 18px; }
  .bilingual.story-page .dialogue-list { flex: 1 0 auto; gap: 24px; }
  .bilingual.story-page .speaker { font-size: 24px; line-height: 1.3; margin-bottom: 10px; }
  .bilingual.story-page .portrait { font-size: 30px; width: 36px; flex-shrink: 0; }
  .bilingual.story-page .line-en { font-size: clamp(24px, 2vw, 34px); line-height: 1.35; }
  .bilingual.story-page .line-zh { font-family: var(--zh-font); font-size: clamp(24px, 2.1vw, 32px); font-weight: 600; line-height: 1.5; color: #283a29; margin-top: 12px; }
  .bilingual.story-page .line-cue { font-family: var(--zh-font); font-size: 20px; line-height: 1.45; color: #655334; margin-top: 8px; }
  .story-page .your-turn { font-family: var(--zh-font); font-size: 18px; color: #704510; flex-shrink: 0; }
  .bilingual.story-page .page-number { margin-top: 14px; }
  .cast-role small { font-family: var(--zh-font); font-size: 20px; color: #514734; }
}
@media screen and (min-width: 901px) {
  .bilingual.story-page .scene-art { width: 36%; }
  .bilingual.story-page .page-content { margin-left: 36%; }
}
@media screen and (min-width: 901px) and (max-height: 800px) {
  .bilingual.story-page .page-content { padding: 18px 26px; }
  .bilingual.story-page .page-title { font-size: 24px; margin: 6px 0 12px; }
  .bilingual.story-page .line-en, .bilingual.story-page .line-zh { font-size: 24px; }
  .bilingual.story-page .dialogue-list { gap: 18px; }
  .bilingual.story-page .speaker { font-size: 22px; margin-bottom: 6px; }
  .bilingual.story-page .line-cue { font-size: 18px; margin-top: 6px; }
}
@media screen and (max-width: 900px) {
  .bilingual.story-page .page-content { margin-left: 0; padding: 24px; }
  .bilingual.story-page .line-zh { font-size: 24px; }
  .bilingual.story-page .speaker { font-size: 22px; }
}

@page{size:A4;margin:17mm}@media print{body>*{display:none!important}body>#print-area{display:block!important;background:white;color:#000;font-family:Arial,"Microsoft JhengHei",sans-serif}#print-area h1{font-family:Georgia,serif;font-size:30px;margin-bottom:12px}#print-area h2{font-size:21px;margin:15px 0}#print-area p{font-size:11px;line-height:1.6}#print-area .print-scene{break-before:page}#print-area .print-line{break-inside:avoid;margin:12px 0}#print-area .print-line p:first-child{font-size:13px}#print-area .print-cue{font-size:10px;color:#555}dialog{display:none!important}}
/* Viewport-sized reading keeps large type and flows longer dialogue into columns. */
@media screen {
  .reader, .reader:fullscreen { width:100%; max-width:none; height:100dvh; padding:0 clamp(10px,2vw,36px); display:grid; grid-template-rows:44px minmax(0,1fr) 52px 26px; overflow:hidden; }
  .reader header,.reader:fullscreen header {height:auto;min-width:0}
  header>span{display:flex;align-items:center;gap:12px;min-width:0}
  #script-edition{font:11px Arial,"Microsoft JhengHei",sans-serif;letter-spacing:0;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .reader .book,.reader:fullscreen .book{height:100%;min-height:0;max-height:none}
  .reader .page-content{min-height:0;height:100%;padding:clamp(12px,2vh,28px);overflow:hidden}
  .reader .scene-art{position:absolute;height:100%;width:42%;aspect-ratio:auto;z-index:-1}
  .reader .page-content{margin-left:42%}
  .reader .bilingual .scene-art{width:36%}
  .reader .bilingual .page-content{margin-left:36%}
  .reader .cover .scene-art,.reader .ending .scene-art{width:100%}
  .reader .cover .page-content,.reader .ending .page-content{margin-left:0;padding:5%;justify-content:center}
  .reader .page-title{font-size:clamp(22px,2.2vw,32px);margin:4px 0 12px;flex-shrink:0}
  .reader .chapter-label{font-size:clamp(14px,1.4vw,20px);flex-shrink:0}
  .reader .dialogue-window{flex:1;min-height:0;overflow:hidden}
  .reader .dialogue-list{height:100%;width:100%;display:block;margin:0;padding:0;column-gap:32px;column-fill:auto;column-width:400px;overflow:visible;flex:none}
  .reader .dialogue-line{break-inside:avoid;margin:0 0 22px;padding:4px 6px;overflow-wrap:anywhere}
  .reader .dialogue-line:last-child{margin-bottom:0}
  .reader .line-en{font-size:clamp(24px,2vw,34px);line-height:1.35}
  .reader .line-zh{font-size:clamp(24px,2.1vw,32px);line-height:1.45;margin-top:10px}
  .reader .speaker{font-size:22px;line-height:1.3;margin-bottom:8px;flex-wrap:wrap}
  .reader .line-cue{font-size:18px;line-height:1.4;margin-top:8px}
  .reader .page-number{display:none}
  .reader .reading-bar{margin:8px 0 0;grid-template-columns:1fr auto 1fr;gap:8px}
  .reader .page-controls{grid-row:auto;gap:12px}
  .reader .reading-options{margin:0}
  .reader .reading-note{min-height:0;margin:0;padding:0;font-size:10px}
  .reader .cast-list{min-height:0;gap:0;margin:4px 0}
  .reader .cast-role{padding:5px;min-height:0}
  .reader .cast-role strong{font-size:20px}.reader .cast-role small{font-size:20px;margin-top:0}
  .reader .cast-intro{font-size:14px;line-height:1.5}
  .reader .selected-role .dialogue-text{box-shadow:none}
  .editor-tabs,.editor-pager,.editor-actions{display:flex;align-items:center;gap:8px}
  #editor-dialog{width:1000px;height:94dvh;max-height:94dvh;padding:16px 22px;overflow:hidden}
  #editor-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px}
  #editor-dialog h2{font-size:26px;margin:0 35px 0 0}
  #editor-dialog label{display:flex;flex-direction:column;gap:5px;font-size:14px;min-width:0}
  #editor-dialog input,#editor-dialog select,#editor-dialog textarea{width:100%;min-width:0;border:1px solid #bdac86;border-radius:4px;background:#fffdf6;padding:8px;font:16px Arial,"Microsoft JhengHei",sans-serif;color:#283a29}
  #editor-dialog textarea{resize:none;min-height:0;flex:1;height:100%;line-height:1.4}
  #editor-dialog :focus-visible{outline:3px solid #ad7937;outline-offset:1px}
  .editor-tabs button,.editor-actions button,.editor-confirm button,#edit-save{border:1px solid #b9a479;border-radius:4px;padding:6px 12px;background:#f2e7ce}
  .editor-tabs [aria-pressed=true],#edit-save{background:#465a3e;color:#fff8e8}
  .editor-panel{min-height:0;overflow:auto}
  #editor-lines-panel{display:flex;flex-direction:column;gap:10px;overflow:hidden}
  .editor-pager{justify-content:space-between;flex-shrink:0}
  .editor-pager label{flex-direction:row!important;align-items:center;white-space:nowrap}
  #edit-page{max-width:300px}
  #edit-lines{flex:1;min-height:0}
  #edit-lines fieldset{height:100%;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) minmax(60px,.45fr);gap:10px;margin:0;padding:8px 12px;border:1px solid #c7b68f}
  #edit-lines fieldset>label:first-of-type{grid-column:1/-1;flex-direction:row;align-items:center}
  #edit-lines fieldset>label:last-child{grid-column:1/-1}
  #edit-lines legend,#edit-roles legend{font-size:14px}
  #edit-roles fieldset{border:1px solid #c7b68f;margin-top:20px;display:grid;gap:20px;padding:20px}
  #editor-files-panel p{font-size:15px;line-height:1.6}
  .editor-footer{display:flex;align-items:center;gap:16px;min-height:52px}
  #edit-save{flex-shrink:0}
  #editor-status{font-size:13px;line-height:1.5;margin:0}
  #editor-unsaved{font-size:12px;color:#874b1e}
  .editor-confirm{position:absolute;inset:25% 7% auto;background:#fff8e8;border:2px solid #8d7347;box-shadow:0 0 0 100vmax #18221899;padding:24px;z-index:2}
  .editor-confirm p{font-size:18px}
}
@media screen and (max-width:900px){
  .reader{grid-template-rows:38px minmax(0,1fr) 92px 22px}
  .reader header>span{display:none}
  .reader .reading-bar{grid-template-columns:1fr 1fr;grid-template-rows:44px 36px;gap:0}
  .reader .page-controls{grid-column:1/-1;grid-row:1;gap:24px}
  .reader .reading-options,.reader .extras{justify-content:center;gap:16px}
  .reader .reading-note #page-hint{font-size:9px}
  .reader .scene-art,.reader .bilingual .scene-art{width:100%;height:23%;object-position:center 42%}
  .reader .page-content,.reader .bilingual .page-content{margin-left:0;margin-top:calc((100dvh - 152px)*.23);height:77%;padding:12px 16px}
  .reader .page-content:before{display:none}
  .reader .cover .page-content,.reader .ending .page-content{margin-top:0;height:100%;padding:7%}
  .reader .cover .scene-art,.reader .ending .scene-art{height:100%}
  .reader .cover h1{font-size:clamp(42px,8vw,70px)}
  .reader .cover-copy{margin-top:16px}.reader .cover-zh{margin-top:12px}
  .reader .cast-page .page-content{margin-top:0;height:100%;margin-left:24%;padding:12px}
  .reader .cast-page .scene-art{width:24%;height:100%}
  .reader .cast-page .page-title{font-size:24px}
  .reader .line-en,.reader .line-zh{font-size:24px}
}
@media screen and (max-width:520px){
  #editor-dialog{width:calc(100vw - 12px);max-width:none;height:96dvh;max-height:96dvh;padding:12px}
  #editor-dialog[open]{gap:6px}
  .editor-pager{gap:2px;flex-wrap:wrap}
  .editor-pager label{font-size:12px!important}.editor-pager select{padding:5px!important}
  #edit-page{max-width:155px}
  #edit-lines fieldset{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) minmax(0,1fr) minmax(55px,.5fr);gap:6px;padding:6px}
  .editor-footer{gap:8px}#editor-status{font-size:12px}.editor-actions{flex-wrap:wrap}
}
@media screen and (max-height:550px){
  .reader,.reader:fullscreen{grid-template-rows:32px minmax(0,1fr) 44px 18px}
  .reader .reading-bar{grid-template-columns:1fr auto 1fr;grid-template-rows:1fr;margin-top:4px}
  .reader .page-controls{grid-row:auto;grid-column:auto;gap:6px}
  .reader .scene-art,.reader .bilingual .scene-art{height:100%;width:25%}
  .reader .page-content,.reader .bilingual .page-content{margin-top:0;margin-left:25%;height:100%;padding:8px 14px}
  .reader .cover .page-content,.reader .ending .page-content{margin-left:0;padding:20px 6%}
  .reader .cover .scene-art,.reader .ending .scene-art{width:100%}
  .reader .cover h1{font-size:42px}.reader .cover-eyebrow{font-size:12px;margin-bottom:8px}
  .reader .cover-zh{font-size:24px;margin-top:8px}.reader .cover-copy{display:none}.reader .open-book{margin-top:10px}
  .reader .cover-mark{bottom:12px;right:14px}.reader .page-title{font-size:21px;margin:0 0 4px}
  .reader .chapter-label{font-size:14px}.reader .cast-intro{display:none}
  .reader .cast-role{padding:1px 6px}.reader .cast-role strong,.reader .cast-role small{font-size:16px;display:inline}
  .reader .cast-role .portrait{font-size:22px}.reader .ending h2{font-size:34px}.reader .ending p{margin-top:8px;font-size:14px}
  .reader .ending-buttons{margin-top:8px}
  #editor-dialog{height:98dvh;max-height:98dvh;padding:8px 16px}
  #editor-dialog[open]{gap:4px;grid-template-columns:1fr;grid-template-rows:28px 32px minmax(0,1fr) 44px}
  #editor-dialog h2{font-size:22px}.editor-tabs button{min-height:28px;padding:3px 10px}
  #editor-lines-panel{gap:3px}.editor-pager select{padding:3px!important}.editor-pager button{min-height:28px}
  #edit-lines fieldset{grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto minmax(0,1fr);padding:2px 8px;gap:4px}
  #edit-lines fieldset>label:last-child{grid-column:auto}
  #editor-dialog label{font-size:12px;gap:2px}#editor-dialog textarea{padding:4px;font-size:14px}
  .editor-footer{min-height:0}#editor-status{font-size:12px}.editor-confirm{inset:10% 7% auto;padding:16px}
}
@media screen { .reader .book .dialogue-list { column-gap:32px; } }
@media screen { #edit-lines fieldset>label:first-of-type {white-space:nowrap} #edit-lines fieldset>label:first-of-type select {flex:1;width:0} }
@media screen and (min-width:901px) { .reader .story-page .scene-art {object-position:65% center} }
@media screen and (max-width:520px) {
  .editor-pager{display:grid;grid-template-columns:28px minmax(0,1fr) 84px 28px;gap:3px}
  .editor-pager label{font-size:0!important;gap:0!important}
  .editor-pager select{font-size:14px!important;max-width:100%!important}
}
