:root {
  --bg: #0d0a16;
  --panel: rgba(25, 18, 40, .8);
  --panel-strong: rgba(32, 23, 51, .96);
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(211, 168, 255, .34);
  --text: #f7f2ff;
  --muted: #b6a9c7;
  --soft: #887899;
  --accent: #d59bff;
  --accent-strong: #a970ff;
  --gold: #f3c982;
  --success: #79d7aa;
  --danger: #ff8d9c;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  --radius: 22px;
  font-family: 'Noto Sans SC', 'Outfit', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.ambient { position: fixed; pointer-events: none; filter: blur(80px); opacity: .35; border-radius: 50%; z-index: -1; }
.ambient-one { width: 480px; height: 480px; background: #643c9b; top: -220px; left: -160px; }
.ambient-two { width: 520px; height: 520px; background: #315b76; right: -240px; bottom: -260px; }
.shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 52px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; background: linear-gradient(145deg, rgba(216, 160, 255, .24), rgba(255,255,255,.04)); box-shadow: 0 10px 34px rgba(130, 72, 189, .28); font-size: 21px; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-copy span { display: block; margin-top: 2px; color: var(--soft); font-size: 12px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: stretch; margin-bottom: 30px; }
.hero-copy, .hero-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(36, 26, 55, .85), rgba(20, 15, 32, .8)); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-copy { padding: clamp(28px, 5vw, 64px); min-height: 390px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.hero-copy::after { content: '猫'; position: absolute; right: 7%; bottom: -20%; font-size: 260px; line-height: 1; color: rgba(213, 155, 255, .06); font-weight: 800; transform: rotate(-12deg); }
.eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
h1 { margin: 16px 0 14px; max-width: 720px; font-size: 56px; line-height: 1.05; letter-spacing: 0; }
h2 { margin: 0; font-size: 26px; letter-spacing: 0; }
h3 { margin: 0; font-size: 17px; }
.hero-copy p { max-width: 590px; color: var(--muted); line-height: 1.8; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; position: relative; z-index: 1; }
.hero-card { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; min-height: 390px; }
.featured-poster { min-height: 250px; }
.hero-card .poster { width: 100%; height: 250px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); opacity: .92; background: #171024; }
.hero-card .poster-placeholder { height: 250px; display: grid; place-items: center; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 25%, rgba(224, 175, 255, .24), transparent 58%), #171024; font-size: 72px; }
.hero-card-footer { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-top: 20px; }
.hero-card-footer span { color: var(--muted); font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 38px 0 16px; }
.section-head p { color: var(--soft); margin: 0; font-size: 13px; }
.search { width: min(330px, 100%); border: 1px solid var(--line); background: rgba(255,255,255,.045); color: var(--text); border-radius: 12px; padding: 11px 14px; outline: none; }
.search:focus, input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(213, 155, 255, .12); }
.script-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.script-card { min-height: 390px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.045); overflow: hidden; display: flex; flex-direction: column; transition: .22s ease; }
.script-card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: rgba(255,255,255,.07); }
.script-card-poster { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #171024; border-bottom: 1px solid var(--line); }
.script-card-body { flex: 1; padding: 18px 20px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.script-card-top { display: flex; justify-content: space-between; gap: 14px; }
.script-card h3 { font-size: 20px; }
.script-card p { color: var(--muted); line-height: 1.7; font-size: 13px; }
.tag { border: 1px solid rgba(243, 201, 130, .28); color: var(--gold); padding: 5px 8px; border-radius: 99px; height: fit-content; white-space: nowrap; font-size: 11px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-footer small { color: var(--soft); }
.card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.button { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.06); border-radius: 11px; padding: 10px 15px; transition: .18s ease; }
.button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.11); transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--accent-strong), #7e5be1); border-color: transparent; color: white; box-shadow: 0 9px 28px rgba(133, 87, 225, .25); }
.button.primary:hover { filter: brightness(1.1); }
.button.ghost { background: transparent; }
.button.danger { color: var(--danger); border-color: rgba(255, 141, 156, .25); }
.button.small { padding: 7px 10px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.form-shell { width: min(620px, 100%); margin: 38px auto 0; padding: 30px; }
.form-shell p { color: var(--muted); line-height: 1.7; }
.form { display: grid; gap: 16px; margin-top: 22px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 13px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.18); color: var(--text); padding: 12px 13px; outline: none; }
textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.hint { color: var(--soft); font-size: 12px; }
.field-error { min-height: 18px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.page-range-form { margin: 0; padding: 24px; }
.room-hero { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(47, 32, 74, .86), rgba(22, 16, 36, .9)); margin-bottom: 18px; }
.room-title { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.room-title h1 { font-size: 42px; margin: 10px 0 0; }
.room-code { text-align: right; }
.room-code small { display: block; color: var(--soft); font-size: 11px; }
.room-code strong { display: block; font: 800 30px Outfit, sans-serif; letter-spacing: .16em; color: var(--gold); margin-top: 3px; }
.room-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.room-status > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); }
.room-status small, .room-status strong { display: block; }
.room-status small { color: var(--soft); font-size: 11px; }
.room-status strong { margin-top: 5px; color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 18px; align-items: start; min-width: 0; }
.room-layout > main, .room-layout > aside { min-width: 0; }
.panel { padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head span { color: var(--soft); font-size: 12px; }
.action-list, .material-list, .answer-list, .people-list { display: grid; gap: 10px; }
.action-row, .material-row, .person-row, .answer-row { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.action-row.released { border-color: rgba(121, 215, 170, .25); background: rgba(121, 215, 170, .06); }
.action-row strong, .material-row strong { display: block; font-size: 14px; }
.action-row small, .material-row small { display: block; color: var(--soft); margin-top: 4px; line-height: 1.5; }
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.host-category-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 4px; scrollbar-width: thin; }
.host-category-tabs .button { flex: 0 0 auto; white-space: nowrap; }
.button.active { border-color: var(--accent); background: rgba(213, 155, 255, .16); color: var(--accent); }
.status { font-size: 11px; color: var(--success); white-space: nowrap; }
.material-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.material-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: rgba(213, 155, 255, .11); color: var(--accent); flex: 0 0 auto; }
.material-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.material-main > div:last-child { min-width: 0; }
.material-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.private-panel textarea { min-height: 150px; resize: vertical; }
.private-actions { justify-content: flex-start; margin-top: 10px; }
.evidence-head { display: flex; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.evidence-list { display: grid; gap: 8px; }
.evidence-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); cursor: pointer; }
.evidence-row input { margin-top: 3px; accent-color: var(--accent); }
.evidence-row strong, .evidence-row small { display: block; }
.evidence-row strong { font-size: 13px; line-height: 1.45; }
.evidence-row small { color: var(--soft); margin-top: 3px; line-height: 1.45; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); padding: 5px 9px; font-size: 11px; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.person-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.person-row .occupied { color: var(--success); font-size: 11px; }
.person-row .open { color: var(--soft); font-size: 11px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.role-choice { text-align: left; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.04); color: var(--text); }
.role-choice:hover { border-color: var(--accent); background: rgba(213,155,255,.09); }
.role-choice[disabled] { opacity: .4; cursor: not-allowed; }
.role-choice small { display: block; color: var(--soft); margin-top: 5px; }
.question-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: rgba(255,255,255,.03); }
.question-card + .question-card { margin-top: 10px; }
.question-card h3 { font-size: 15px; }
.question-card p { margin: 7px 0 12px; color: var(--muted); line-height: 1.6; font-size: 13px; }
.question-card textarea { min-height: 86px; }
.answer-preview { padding: 10px; margin-top: 9px; background: rgba(0,0,0,.16); border-radius: 9px; color: var(--muted); font-size: 12px; white-space: pre-wrap; line-height: 1.6; }
.audio-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-bar select { flex: 1 1 180px; }
.timer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; }
.timer strong { font: 700 24px Outfit, sans-serif; letter-spacing: .08em; }
.empty { border: 1px dashed var(--line); border-radius: 14px; color: var(--soft); padding: 25px; text-align: center; font-size: 13px; }
.footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--soft); font-size: 12px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: #282039; border: 1px solid var(--line-strong); color: var(--text); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); transition: .2s ease; max-width: min(90vw, 520px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.viewer { position: fixed; inset: 0; z-index: 40; background: rgba(4, 3, 8, .86); padding: 22px; display: grid; place-items: center; }
.viewer.hidden { display: none; }
.viewer-box { width: min(1100px, 100%); height: min(90vh, 900px); background: var(--panel-strong); border: 1px solid var(--line-strong); border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; box-shadow: var(--shadow); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.viewer-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { min-height: 0; display: grid; place-items: center; overflow: auto; background: #0b0910; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body audio { width: min(600px, 90%); }

.viewer-box { width: min(1000px, 100%); height: min(94vh, 1100px); display: flex; flex-direction: column; overflow: hidden; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(17, 12, 32, .98); }
.viewer-head > div { min-width: 0; }
.viewer-head strong, .viewer-head small { display: block; }
.viewer-head small { color: var(--muted); margin-top: 4px; }
.book-body { flex: 1; min-height: 0; overflow: auto; background: #171321; padding: 18px; }
.image-book { display: grid; place-items: center; }
.image-book img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.media-book { display: grid; place-items: center; }
.media-book audio, .media-book video { width: min(760px, 100%); max-height: 78vh; }
.html-book { background: #fffdf7; color: #2b2530; line-height: 1.85; font-family: 'Noto Serif SC', 'Songti SC', serif; }
.html-book h1, .html-book h2, .html-book h3 { color: #1d1724; margin: 1.4em 0 .6em; }
.html-book img { max-width: 100%; height: auto; }
.reader-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(25, 19, 40, .98); }
.reader-toolbar span { color: var(--muted); margin-left: auto; font-size: .85rem; }
.reader-mode-tabs { display: flex; gap: 7px; }
.reader-shell { padding: 12px; position: relative; }
.reader-ebook { max-width: 900px; margin: 0 auto; width: 100%; }
.reader-page { margin: 0 auto 20px; padding: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: #fffdf8; color: #29222e; box-shadow: 0 12px 35px rgba(0,0,0,.18); }
.reader-page-number { color: #786e80; font-size: .8rem; margin-bottom: 12px; }
.reader-text { line-height: 1.9; white-space: pre-wrap; font-size: .98rem; }
.reader-page-image { display: block; width: 100%; height: auto; margin-top: 16px; border-top: 1px dashed #d9d2dd; padding-top: 16px; border-radius: 6px; cursor: zoom-in; }
.image-reader { height: 100%; min-height: 0; display: flex; align-items: stretch; justify-content: center; }
.image-stage { width: 100%; height: 100%; min-height: 280px; display: grid; place-items: center; overflow: hidden; position: relative; background: #0b0910; touch-action: none; }
.reader-image { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; }
.reader-empty-page { text-align: center; color: var(--muted); padding: 24px; }
.reader-empty-page p { margin: 8px 0 0; font-size: .85rem; }
.hidden { display: none !important; }
.preview-list { padding: 16px; overflow: auto; }
.preview-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.preview-row strong, .preview-row small { display: block; }
.preview-row small { color: var(--muted); margin-top: 5px; }
.answer-list { margin-top: 12px; display: grid; gap: 8px; }
.question-head { display: flex; justify-content: space-between; gap: 12px; }
.question-card.released { border-color: rgba(121, 215, 170, .36); }
.viewer-empty { display: grid; place-items: center; min-height: 240px; padding: 24px; color: var(--muted); }

@media (max-width: 700px) {
  .viewer { padding: 0; }
  .viewer-box { width: 100%; height: 100dvh; border-radius: 0; }
  .viewer-head { padding: 12px; }
  .book-body { padding: 10px; }
  .reader-page { padding: 11px; margin-bottom: 14px; border-radius: 10px; }
  .reader-text { font-size: .9rem; }
  .reader-toolbar span { width: 100%; margin-left: 0; }
  .preview-row { align-items: flex-start; }
}
.muted { color: var(--muted); }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--text); }
@media (max-width: 850px) {
  .hero, .room-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-card { min-height: 0; }
  .room-title { flex-direction: column; }
  .room-code { text-align: left; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1240px); padding-top: 20px; }
  .topbar { margin-bottom: 30px; }
  .top-actions .button.ghost { display: none; }
  .hero-copy { min-height: 410px; padding: 26px 22px; }
  h1 { font-size: 40px; }
  .hero-actions, .hero-actions .button { width: 100%; }
  .card-footer { align-items: flex-start; flex-direction: column; }
  .card-actions { width: 100%; justify-content: flex-start; }
  .section-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .panel, .form-shell { padding: 17px; }
  .action-row, .material-row { align-items: flex-start; flex-direction: column; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .role-grid, .people-grid { grid-template-columns: 1fr; }
  .room-status { grid-template-columns: 1fr; }
  .viewer { padding: 8px; }
}

/* Reader and stage controls use stable touch targets on small screens. */
.phase-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.phase-index { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(213,155,255,.28); border-radius: 12px; color: var(--accent); font: 700 12px Outfit, sans-serif; }
.phase-copy { min-width: 0; }
.phase-copy strong, .phase-copy small { overflow-wrap: anywhere; }
.clue-input { position: absolute; opacity: 0; pointer-events: none; }
.evidence-row { position: relative; align-items: center; min-height: 58px; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.evidence-row:hover { border-color: rgba(213,155,255,.42); }
.evidence-row.marked { border-color: rgba(121,215,170,.5); background: rgba(121,215,170,.08); }
.clue-check { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid rgba(213,155,255,.5); border-radius: 8px; color: #171321; font-weight: 800; background: transparent; transition: .18s ease; }
.evidence-row.marked .clue-check { border-color: #79d7aa; background: #79d7aa; }
.reader-embedded-image { display: block; width: min(100%, 720px); height: auto; margin: 1.2rem auto; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.2); }
.image-toolbar { display: flex; justify-content: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: rgba(25,19,40,.98); }
.reader-toolbar { min-height: 52px; }
.reader-view-tabs, .reader-themes { display: inline-flex; gap: 5px; align-items: center; }
.reader-search { width: 150px; min-height: 32px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.05); color: var(--text); padding: 6px 9px; }
.reader-toc, .reader-font { width: auto; min-height: 32px; max-width: 130px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.05); color: var(--text); padding: 5px 7px; }
.theme-swatch { width: 23px; height: 23px; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; cursor: pointer; }
.theme-swatch.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-paper { background: #f7f2e8; color: #2d2930; }
.theme-night { background: #181a20; }
.theme-sepia { background: #e9d7b5; }
.theme-green { background: #dce8d1; }
.book-body.reader-shell { padding: 0; background: #111018; }
.reader-shell[data-reader-theme="paper"] { background: #d9d4ca; }
.reader-shell[data-reader-theme="night"] { background: #0d0f14; }
.reader-shell[data-reader-theme="sepia"] { background: #cbb991; }
.reader-shell[data-reader-theme="green"] { background: #b7c9ab; }
.reader-ebook { --reader-font-size: 18px; --reader-line-height: 1.9; --reader-font-family: 'Noto Serif SC', 'Songti SC', serif; padding: 24px 16px 60px; }
.reader-page { border: 0; border-radius: 5px; background: var(--reader-paper, #f7f2e8); color: var(--reader-ink, #2d2930); font-family: var(--reader-font-family); box-shadow: 0 8px 26px rgba(0,0,0,.17); padding: clamp(18px, 4vw, 48px); max-width: 760px; }
.reader-shell[data-reader-theme="night"] .reader-page { --reader-paper: #181a20; --reader-ink: #e4e6ec; }
.reader-shell[data-reader-theme="sepia"] .reader-page { --reader-paper: #f0e1c2; --reader-ink: #433724; }
.reader-shell[data-reader-theme="green"] .reader-page { --reader-paper: #e6efdc; --reader-ink: #263225; }
.reader-text { font-size: var(--reader-font-size); line-height: var(--reader-line-height); letter-spacing: 0; }
.reader-text p { margin: 0 0 1em; white-space: pre-wrap; }
.reader-hit { background: #ffd86b; color: #241a06; border-radius: 3px; padding: 0 .08em; box-shadow: 0 0 0 1px rgba(114,79,0,.18); }
.reader-page-number { color: color-mix(in srgb, var(--reader-ink, #2d2930) 55%, transparent); }
.reader-original { margin-top: 24px; border-top: 1px solid color-mix(in srgb, var(--reader-ink, #2d2930) 15%, transparent); padding-top: 14px; }
.reader-original summary { cursor: pointer; color: color-mix(in srgb, var(--reader-ink, #2d2930) 70%, transparent); font-size: 13px; margin-bottom: 10px; }
.reader-page-image { width: 100%; margin-top: 8px; border: 0; padding: 0; border-radius: 3px; cursor: zoom-in; }
.reader-fallback { padding: 14px; border: 1px dashed color-mix(in srgb, var(--reader-ink, #2d2930) 28%, transparent); border-radius: 10px; color: color-mix(in srgb, var(--reader-ink, #2d2930) 70%, transparent); font-size: 13px; line-height: 1.6; }
.reader-page-mode .reader-page { display: none; min-height: min(72vh, 720px); margin-bottom: 0; }
.reader-page-mode .reader-page.reader-page-active { display: block; }
.image-reader { min-height: 0; height: 100%; }
.image-stage { min-height: 420px; height: 100%; background: #08090d; }
.reader-image { max-width: 100%; max-height: 100%; transform-origin: center center; transition: transform .12s ease-out; will-change: transform; }
.image-stage, .reader-image { touch-action: none; }
.reader-search-count { min-width: 58px; text-align: center; color: var(--text) !important; margin-left: 0 !important; font-variant-numeric: tabular-nums; }
.reader-toolbar .button:disabled { opacity: .38; cursor: not-allowed; }
.viewer-head .row-actions { justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 700px) {
  .phase-row { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
  .phase-row .row-actions { grid-column: 2; justify-content: flex-start; }
  .reader-toolbar { align-content: center; padding: 8px; gap: 6px; }
  .reader-search { width: min(44vw, 150px); }
  .reader-toc { max-width: 82px; }
  .reader-search-count { order: 5; }
  .reader-themes { order: 4; }
  .reader-ebook { padding: 10px 8px 40px; }
  .reader-page { padding: 22px 18px; }
  .image-stage { min-height: 70vh; }
}
