/* 名句摘抄：摘抄本的版面、绘本书架和阅读器。颜色都来自 ui/base.css。 */

/* 顶栏 */
.nb-top { position: sticky; top: 0; z-index: 20; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; background: rgba(251, 246, 234, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nb-top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 1080px; margin: 0 auto; }
.nb-back { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-soft); background: var(--paper-deep); flex: none; }
.nb-back:hover { background: var(--line); }
.nb-heading { flex: 1; min-width: 0; }
.nb-heading h1 { font: 400 26px/1.2 var(--font-kai); white-space: nowrap; }
.nb-heading p { font-size: 13px; line-height: 1.3; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-tabs { flex: none; }
.nb-tabs > a { min-height: 44px; padding: 0 18px; }

.nb-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px var(--gutter) 24px; }
.save-notice { max-width: 1080px; margin: 12px auto 0; padding: 10px 16px; border-radius: var(--r-s); background: var(--sun-tint); color: var(--sun); }
.loading { padding: 32px 0; text-align: center; color: var(--ink-faint); }
.link-btn { color: var(--seal-deep); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.empty-card { display: grid; justify-items: center; gap: 12px; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-m); color: var(--ink-soft); text-align: center; grid-column: 1 / -1; }

/* 本周 */
.week-bar { display: flex; align-items: center; justify-content: center; gap: 12px; }
.week-title { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 2px 34px 2px 12px; border-radius: var(--r-s); cursor: pointer; }
.week-title:hover { background: var(--paper-deep); }
.week-title::after { content: ""; position: absolute; right: 14px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint); transform: rotate(45deg); }
.week-title-text { font-size: clamp(32px, 7vw, 42px); line-height: 1.25; }
.week-title select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.week-caption { margin-top: 2px; text-align: center; color: var(--ink-soft); font-size: 15px; min-height: 28px; }
.type-switch { display: flex; width: fit-content; margin: 12px auto 0; }
.type-switch > a { min-height: 46px; padding: 0 24px; font-size: 18px; }
.stamps { display: flex; justify-content: center; gap: 6px; margin: 14px 0 16px; }
.stamps i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: transparent; }
.stamps i.is-on { background: var(--seal); border-color: var(--seal); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(44%, 158px), 1fr)); gap: 14px; }
@media (min-width: 700px) { .book-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; } }
.book { display: flex; flex-direction: column; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow-1); transition: transform .14s ease, box-shadow .16s ease; }
.book:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.book:active { transform: scale(.98); }
.book-cover { position: relative; display: block; aspect-ratio: 1; background: var(--paper-deep); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover.is-plain { display: grid; place-items: center; background: repeating-linear-gradient(0deg, transparent 0 27px, var(--line) 27px 28px), var(--card); }
.book-plain-char { font-size: 72px; line-height: 1; color: var(--line-strong); }
.book-badges { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 5px; }
.badge { padding: 2px 9px; border-radius: 999px; background: rgba(43, 39, 33, .72); color: #fff; font-size: 13px; line-height: 1.5; font-weight: 600; }
.badge-en { background: var(--sky); }
.book-seal { display: inline-grid; place-items: center; padding: 3px 8px 2px; border: 2.5px solid var(--seal); border-radius: 9px; color: var(--seal); font-size: 19px; line-height: 1.15; letter-spacing: 1px; background: rgba(255, 253, 247, .84); }
.book-cover .book-seal { position: absolute; right: 8px; top: 8px; transform: rotate(-9deg); }
.book[data-copied="true"] .book-cover img { filter: saturate(.72); }
.book-next { position: absolute; left: 8px; top: 8px; padding: 2px 11px; border-radius: 999px; background: var(--seal); color: #fff; font-size: 13px; line-height: 1.6; font-weight: 700; }
.book-text { display: grid; gap: 2px; padding: 10px 12px 12px; min-height: 76px; align-content: start; }
.book-title { font-size: 24px; line-height: 1.25; font-weight: 400; }
.book-title-long { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 19px; line-height: 1.4; }
.book-text small { font-size: 13px; line-height: 1.4; color: var(--ink-faint); }
.week-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* 全部 */
.search-box { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-m); background: #fff; color: var(--ink-faint); }
.search-box:focus-within { border-color: var(--sky); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 17px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; }
.chip { min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--sky-tint); color: var(--sky); box-shadow: inset 0 0 0 1.5px var(--sky); }
.map-note { margin-bottom: 12px; }
.week-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 7px; }
.week-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; color: var(--ink-soft); }
.week-cell i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--seal-tint); }
.week-cell b { position: relative; font-size: 16px; font-weight: 600; }
.week-cell.has-art::after { content: ""; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); }
.week-cell[aria-current="date"] { border: 2px solid var(--seal); color: var(--seal-deep); }
.result-list { display: grid; gap: 8px; margin-top: 10px; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); }
.result-text { display: grid; min-width: 0; }
.result-text b { font-size: 21px; line-height: 1.35; font-weight: 400; }
.result-text small { color: var(--ink-faint); font-size: 14px; }
.result-row .book-seal { flex: none; font-size: 15px; transform: rotate(-7deg); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; color: var(--ink-soft); font-size: 15px; }
.sources { margin-top: 22px; color: var(--ink-faint); font-size: 14px; }
.sources summary { cursor: pointer; min-height: 32px; }
.sources a { text-decoration: underline; text-underline-offset: 2px; }

/* 记录 */
.record-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 460px) { .record-totals { grid-template-columns: repeat(2, 1fr); } }
.record-totals > div { padding: 12px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); }
.record-totals strong { display: block; font: 400 34px/1.2 var(--font-kai); color: var(--seal-deep); }
.record-totals span { color: var(--ink-soft); font-size: 14px; }
.record-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 18px; margin: 14px 2px; }
.record-progress p { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-soft); }
.bar { height: 8px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 0; background: var(--seal); border-radius: 4px; }
.record-month { padding: 16px; margin-bottom: 14px; }
.record-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.record-controls select { min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-s); background: #fff; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 14px; }
.calendar-weekday { text-align: center; color: var(--ink-faint); font-size: 14px; }
.calendar-day { display: grid; place-content: center; justify-items: center; min-height: 52px; border-radius: 12px; background: var(--paper); color: var(--ink-soft); line-height: 1.15; font-size: 16px; }
.calendar-day small { font-size: 12px; min-height: 14px; }
.calendar-day:disabled { opacity: .4; cursor: default; }
.calendar-day.has-records { background: var(--seal-tint); color: var(--seal-deep); font-weight: 600; }
.calendar-day[aria-current="date"] { box-shadow: inset 0 0 0 2px var(--seal); }
.calendar-day[aria-pressed="true"] { background: var(--seal); color: #fff; }
.record-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 8px; }
.record-summary p { flex: 1; min-width: 180px; color: var(--ink-soft); }
.record-day { border-top: 1px solid var(--line); padding: 10px 0; }
.record-day summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.record-day li { display: flex; gap: 10px; padding: 5px 0; align-items: baseline; }
.record-type { flex: none; padding: 0 8px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.record-day li .kai { font-size: 19px; line-height: 1.4; }

/* 阅读器 */
body.reader-open { overflow: hidden; }
.reader { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); overflow: hidden; }
.reader[open] { display: flex; flex-direction: column; }
.reader::backdrop { background: var(--paper); }
.reader-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 6px; }
.reader-top .icon-btn { width: 44px; height: 44px; flex: none; }
.reader-heading { flex: 1; min-width: 0; }
.reader-heading h2 { font-size: 25px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-heading h2.is-long { font-size: 20px; }
.reader-heading p { font-size: 13px; line-height: 1.35; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-lang > button { min-height: 36px; padding: 0 11px; font-size: 15px; }

.reader-steps { display: flex; align-items: center; gap: 5px; padding: 4px 14px 8px; }
.step { position: relative; flex: 1; height: 28px; background: none; }
.step::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--line); }
.step i { position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--seal); transform: scaleX(0); transform-origin: left; }
.step-copy { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-faint); background: var(--paper-deep); }
.step-copy::before { display: none; }
.step-copy .icon { width: 20px; height: 20px; }
.step-copy[aria-current="step"] { background: var(--seal); color: #fff; }

.reader-main { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.reader-story { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 2px 16px 8px; overflow-y: auto; }
.reader-stage { position: relative; flex: none; width: min(100%, 58vh, 620px); aspect-ratio: 1; border-radius: var(--r-l); overflow: hidden; background: var(--paper-deep); box-shadow: var(--shadow-2); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.reader-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .28s ease; }
.reader-stage img.is-in { opacity: 1; }
/* 漫画气泡：给人看的，和画一起出来，没有动画。不接收触摸，滑动翻页照常。 */
.reader-bubbles { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.reader[data-page="intro"] .reader-bubbles { display: none; }
.bubble-outline { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.bubble-fill { fill: var(--card); }
.bubble text { fill: var(--ink); font-family: var(--font-kai); font-weight: 400; text-anchor: middle; }
.bubble text.is-en { font-family: var(--font-ui); font-weight: 500; }
/* 解释页的词句卡和分区 */
.reader[data-page="intro"] .reader-stage { display: flex; width: min(100%, 640px); aspect-ratio: 4 / 3; overflow: visible; }
.reader[data-page="intro"] .reader-stage img { display: none; }
.reader-card { flex: 1; min-width: 0; container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: inherit; background: var(--card); text-align: center; }
.reader-card[hidden] { display: none; }
.card-kind { padding: 0 8px; border: 1.5px solid var(--seal); border-radius: 6px; color: var(--seal); font-size: 13px; font-weight: 700; line-height: 1.5; letter-spacing: 2px; }
.card-phrase { display: grid; justify-items: center; gap: .06em; color: var(--ink); line-height: 1.16; font-size: min(calc(82vw / var(--chars)), 64px); font-size: min(calc(90cqw / var(--chars)), calc(40cqw / var(--rows)), 92px); }
.card-row { display: flex; justify-content: center; }
.card-char { display: grid; justify-items: center; }
.card-char small { font: 500 max(14px, .24em)/1.3 var(--font-ui); color: var(--ink-soft); }
.card-char b { font-weight: 400; }
.card-source { color: var(--ink-soft); font-size: clamp(15px, 5cqw, 21px); line-height: 1.35; }
.card-origin { max-width: 30em; color: var(--ink-soft); font-size: clamp(14px, 4.4cqw, 18px); line-height: 1.45; }
.card-origin span { display: inline-block; }
.card-en { color: var(--ink-soft); font-size: clamp(14px, 4.4cqw, 19px); line-height: 1.35; }
.reader[data-language="zh"] .card-en { display: none; }
.reader-words { width: 100%; max-width: 660px; display: grid; gap: 8px; padding-bottom: 6px; }
.reader-lines { display: contents; }
.reader-intro-label { display: none; }
.reader-line { font-size: clamp(21px, 2.5vh + 8px, 27px); line-height: 1.6; }
.reader-line-en { font-size: clamp(16px, 2vh + 4px, 19px); line-height: 1.5; color: var(--ink-soft); }
.reader[data-language="en"] .reader-line-en { font-size: clamp(19px, 2.4vh + 6px, 24px); color: var(--ink); line-height: 1.55; }
.reader[data-page="intro"] .reader-words { max-width: 640px; min-width: 0; gap: 12px; }
.reader[data-page="intro"] .reader-lesson-section {
  display: block;
  min-width: 0;
  padding: clamp(12px, 2.6vw, 20px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--section-rule);
  border-radius: var(--r-m);
  background: var(--card);
}
.reader-lesson-section h3 {
  margin-bottom: 6px;
  color: var(--section-heading);
  font: 700 clamp(15px, 2vw, 18px)/1.4 var(--font-ui);
}
.reader-lines { --section-rule: var(--seal); --section-heading: var(--seal-deep); }
.reader[data-page="intro"] .reader-intro-label { display: block; }
.reader[data-language="en"] .reader-intro-label-zh,
.reader[data-language="zh"] .reader-intro-label-en { display: none; }
.reader-lesson-section .reader-intro-label-en { color: var(--sky); }
.reader[data-page="intro"][data-language="both"] .reader-intro-label-en {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
}
.reader[data-page="intro"] .reader-line { font-size: clamp(19px, 3vw, 26px); line-height: 1.6; }
.reader[data-page="intro"] .reader-line-en { color: var(--ink); }
.reader-related { --section-rule: var(--sky); --section-heading: var(--sky); }
.reader-related-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}
.reader-related-top h3 { margin-bottom: 0; }
.reader-related-terms, .reader-example, .reader-origin { font-size: clamp(18px, 2.3vw, 23px); line-height: 1.65; line-break: strict; }
.reader-term-group dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 6px 10px; margin: 0; }
.reader-term-group dt { color: var(--ink-soft); font: 700 .88em/1.5 var(--font-ui); }
.reader-term-group dd { margin: 0; }
.reader-term-group h4 { margin: 0 0 6px; font: 700 1em/1.45 var(--font-ui); }
.reader-term-group + .reader-term-group { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.reader-pdf-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.reader-pdf { min-height: 44px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.reader-pdf .icon { width: 19px; height: 19px; }
.reader-pdf-status { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 4px 0; }
.reader-pdf-status:empty { margin: 0; }
.reader-example { --section-rule: var(--leaf); --section-heading: var(--leaf-deep); }
.reader-example strong { color: var(--leaf-deep); font-synthesis: weight; }
.reader-origin { --section-rule: var(--lake); --section-heading: var(--ink); }
.reader-origin p { text-indent: 2em; }
.reader-example p + p, .reader-origin p + p { margin-top: .5em; }
.reader[data-page="intro"] .reader-lang > button { min-width: 44px; min-height: 44px; }
.reader-voice { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 15px; }
.reader-voice .seg > button { min-height: 36px; padding: 0 12px; font-size: 14px; }
.reader-status { color: var(--seal-deep); font-size: 15px; min-height: 1px; }

.reader-controls { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 8vw, 56px); padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.reader-turn { width: 56px; height: 56px; }
.reader-turn svg { width: 28px; height: 28px; }
.reader-play-wrap { display: grid; justify-items: center; gap: 2px; }
.reader-play { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--seal); color: #fff; box-shadow: 0 8px 20px rgba(196, 61, 38, .34); transition: transform .12s ease, background-color .15s ease; }
.reader-play:hover { background: var(--seal-deep); }
.reader-play:active { transform: scale(.94); }
.reader-play:disabled { opacity: .4; box-shadow: none; }
.reader-play svg { width: 36px; height: 36px; }
.reader-play.is-loading { animation: reader-pulse 1s ease-in-out infinite; }
@keyframes reader-pulse { 50% { opacity: .65; } }
.reader-time { color: var(--ink-faint); font-size: 13px; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* 横屏平板和电脑：画在左，字在右 */
@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  .reader-story { flex-direction: row; align-items: center; justify-content: center; gap: clamp(24px, 4vw, 56px); padding: 8px clamp(20px, 4vw, 56px); }
  .reader-stage { width: min(58vw, calc(100vh - 230px), 680px); }
  .reader-words { flex: 1; max-width: 460px; }
  .reader-line { font-size: 28px; }
  .reader-line-en { font-size: 19px; }
}

/* 抄写页 */
.reader-copy { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; text-align: center; }
.copy-kicker { color: var(--ink-soft); font-size: 16px; }
.cells { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.cells.is-idiom { --cell: clamp(66px, 20vw, 108px); gap: 6px; }
.cells.is-quote { --cell: clamp(36px, 10.4vw, 60px); gap: 0; }
.cell { display: grid; justify-items: center; }
.cell-pinyin { font: 500 clamp(13px, 3.4vw, 17px)/1.5 var(--font-ui); color: var(--ink-soft); }
.cell b { display: grid; place-items: center; width: var(--cell); height: var(--cell); font-size: calc(var(--cell) * .74); line-height: 1; font-weight: 400; color: var(--ink); background-color: #fff; border: 1.5px solid var(--grid);
  background-image: linear-gradient(to right, transparent calc(50% - .5px), rgba(143, 185, 150, .6) calc(50% - .5px), rgba(143, 185, 150, .6) calc(50% + .5px), transparent calc(50% + .5px)), linear-gradient(to bottom, transparent calc(50% - .5px), rgba(143, 185, 150, .6) calc(50% - .5px), rgba(143, 185, 150, .6) calc(50% + .5px), transparent calc(50% + .5px)); }
.cells.is-quote .cell { margin: 0 -1px -1px 0; }
.copy-source { color: var(--ink-soft); font: 400 19px/1.4 var(--font-kai); }
.copy-notes { position: relative; display: grid; gap: 8px; width: 100%; max-width: 620px; padding: 14px 16px 32px; border-radius: var(--r-m); background: var(--card); border: 1px solid var(--line); text-align: left; font-size: 17px; line-height: 1.65; }
.copy-notes b { color: var(--leaf-deep); }
#copyPhrase { color: var(--ink-soft); }
.copy-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.copy-hint { min-height: 24px; color: var(--leaf-deep); font-size: 15px; }
.big-seal { position: absolute; right: 10px; bottom: -18px; display: grid; place-items: center; padding: 6px 12px 4px; border: 3.5px solid var(--seal); border-radius: 12px; color: var(--seal); font-size: 26px; line-height: 1.1; letter-spacing: 2px; background: rgba(255, 253, 247, .78); opacity: 0; transform: rotate(-9deg) scale(.86); pointer-events: none; }
.big-seal.is-on { opacity: 1; transform: rotate(-9deg) scale(1); }
.big-seal.is-pressing { animation: seal-press .46s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes seal-press { 0% { opacity: 0; transform: rotate(-9deg) scale(2.1); } 62% { opacity: 1; transform: rotate(-9deg) scale(.94); } 100% { opacity: 1; transform: rotate(-9deg) scale(1); } }

/* 设置与出处 */
.reader-more { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 39, 33, .4); }
.reader-more-card { width: min(100%, 560px); max-height: 82%; overflow-y: auto; display: grid; gap: 12px; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: var(--r-l) var(--r-l) 0 0; background: var(--card); }
.reader-more-card h3 { font-size: 24px; font-weight: 400; }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-weight: 600; }
.more-row input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--seal); }
.more-row .seg > button { min-height: 38px; padding: 0 12px; font-size: 15px; }
.more-story { border-top: 1px solid var(--line); padding-top: 10px; }
.more-story summary { cursor: pointer; font-weight: 600; min-height: 34px; }
.more-story > div { display: grid; gap: 10px; padding-top: 6px; }
.more-kind { color: var(--ink-faint); font-size: 14px; }
.more-paragraph p.kai { font-size: 20px; line-height: 1.6; }
.more-paragraph p[lang="en"] { color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
#moreSource { color: var(--ink-soft); font-size: 15px; }
#moreSource a { display: block; color: var(--sky); text-decoration: underline; text-underline-offset: 2px; min-height: 28px; }

/* 手机横屏：画在左，字和按钮在右，整屏放得下 */
@media (max-height: 520px) and (orientation: landscape) {
  .reader[open] { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .reader-top, .reader-steps { grid-column: 1 / -1; }
  .reader-top { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 0; }
  .reader-steps { padding-top: 0; padding-bottom: 2px; }
  .reader-main, .reader-story { display: contents; }
  .reader-stage { grid-column: 1; grid-row: 3 / 5; width: auto; height: calc(100vh - 100px); height: calc(100dvh - 100px); margin: 0 14px 10px; justify-self: center; align-self: center; }
  .reader[data-page="intro"] .reader-stage { width: auto; }
  .card-kind, .card-en { display: none; }
  .reader-words { grid-column: 2; grid-row: 3; min-height: 0; overflow-y: auto; padding: 0 16px 0 0; align-content: start; }
  .reader-line { font-size: 21px; line-height: 1.5; }
  .reader-line-en { font-size: 15px; }
  .reader-controls { grid-column: 2; grid-row: 4; border-top: 0; background: none; padding: 2px 16px 8px; gap: 20px; }
  .reader-play { width: 54px; height: 54px; }
  .reader-play svg { width: 28px; height: 28px; }
  .reader-turn { width: 46px; height: 46px; }
  .reader-time { display: none; }
  .reader-copy { grid-column: 1 / -1; grid-row: 3 / 5; }
}

/* 打印 */
.print-sheet { display: none; }
@media print {
  body > *:not(.print-sheet) { display: none !important; }
  body { background: #fff; }
  .print-sheet { display: block; color: #000; }
  .print-sheet h1 { font-size: 26px; margin-bottom: 14px; }
  .print-sheet section { break-inside: avoid; padding: 10px 0; border-bottom: 1px solid #bbb; }
  .print-sheet h2 { font-size: 26px; font-weight: 400; margin: 0; }
  .print-sheet p { font-size: 14px; margin: 2px 0 0; }
  .print-meta { color: #444; }
}

@media (max-width: 560px) {
  /* 手机上顶栏不吸顶，把屏幕留给绘本 */
  .nb-top { position: static; padding-bottom: 8px; border-bottom: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nb-tabs { order: 3; width: 100%; display: flex; }
  .nb-tabs > a { flex: 1; }
  .nb-heading h1 { font-size: 24px; }
  .nb-main { padding-top: 6px; }
  .reader-heading h2 { font-size: 22px; }
  .reader-lang > button { min-height: 34px; padding: 0 8px; font-size: 14px; }
  .reader[data-page="intro"] .reader-stage { aspect-ratio: 3 / 2; }
  .reader-play { width: 66px; height: 66px; }
  .week-title-text { font-size: 30px; }
  .week-bar .icon-btn { width: 44px; height: 44px; }
  .type-switch { margin-top: 8px; }
  .stamps { margin: 10px 0 12px; }
}

/* 收紧词句卡，把阅读区域留给正文。 */
@media (min-height: 521px) {
  .reader[data-page="intro"] .reader-stage {
    aspect-ratio: auto;
    min-height: clamp(150px, 24vh, 230px);
  }
  .reader[data-page="intro"] .reader-card { padding: 16px; }
  .reader[data-page="intro"] .step { height: 44px; }
  .reader[data-page="intro"] .step::before,
  .reader[data-page="intro"] .step i { top: calc(50% - 3px); }
  .reader[data-page="intro"] .step-copy { width: 44px; }
}

@media (min-width: 820px) and (min-aspect-ratio: 1/1) and (min-height: 521px) {
  .reader[data-page="intro"] .reader-story { align-items: flex-start; padding-block: 16px; }
  .reader[data-page="intro"] .reader-stage { width: min(39vw, 480px); }
}

/* 最窄的手机：语言切换换到第二行，标题不被挤掉 */
@media (max-width: 350px) {
  .reader-top { flex-wrap: wrap; }
  .reader-heading { flex-basis: 40%; }
  .reader-lang { order: 4; width: 100%; justify-content: center; }
  .reader-lang > button { flex: 1; }
}

/* 很矮的手机：图小一点，让第一段字露出来 */
@media (max-height: 640px) and (orientation: portrait) {
  .reader-stage { width: min(100%, 42vh); }
  .card-kind { display: none; }
  .reader-play { width: 58px; height: 58px; }
  .reader-controls { padding-top: 4px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
