/* ══════════════════════════════════════════════════════════════
   請看下回（to-be-continued）— 作者工作室的樣式（畫面在 studio/app.js）
   接在 reader.css 後面：色彩、字、間距、按鈕（tbc-btn）、標籤（tbc-tag）、內文（tbc-prose）、上下回卡都用請看下回的代號，
   淺色、夜間、護眼兩色跟著讀者選的底色一起換。作者工作室自己的 class 一律 sto- 開頭。
   只多一組「要注意」的顏色（自查沒過、有還沒存的修改）：金色只給旁白（設計說明「主要設計決定」第 4 點），朱紅是下一步。
   不經建置：不用 inset、:has()、color-mix() 這類 Chrome 74、Safari 12 不認得的寫法。
   ══════════════════════════════════════════════════════════════ */

:root {
  --sto-warn: #9a4600;
  --sto-warn-bg: #fdf0e3;
  --sto-warn-line: #eab489;
  --sto-radius: 14px;
  --sto-scrim: rgba(18, 19, 22, .46);
}
:root[data-theme="dark"] { --sto-warn: #ffb27a; --sto-warn-bg: #2b1e13; --sto-warn-line: #7a4b27; --sto-scrim: rgba(0, 0, 0, .62); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --sto-warn: #ffb27a; --sto-warn-bg: #2b1e13; --sto-warn-line: #7a4b27; --sto-scrim: rgba(0, 0, 0, .62); }
}
:root[data-theme="sepia"] { --sto-warn: #8f3f00; --sto-warn-bg: #f6e1c8; --sto-warn-line: #d9a576; }
:root[data-theme="green"] { --sto-warn: #883a00; --sto-warn-bg: #ead9c0; --sto-warn-line: #c99a6a; }

/* ── 頁首：站名後面接頁名；站名不折行，窄到放不下時頁名截成… ── */
.tbc-page--studio .tbc-brand { flex: none; white-space: nowrap; }
.tbc-appbar__page { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 44px; margin-left: var(--tbc-s2); padding-left: var(--tbc-s3); border-left: 1px solid var(--tbc-line); color: var(--tbc-ink-2); font-size: var(--tbc-fs-ui); font-weight: 500; white-space: nowrap; }
/* 英文的站名長：手機上字小一點、字距收一點，跟頁名放得進一行 */
@media (max-width: 420px) {
  html[lang="en"] .tbc-page--studio .tbc-brand { font-size: 15px; letter-spacing: .02em; }
  html[lang="en"] .tbc-appbar__page { margin-left: var(--tbc-s1); padding-left: var(--tbc-s2); }
}

/* ── 版面 ── */
.tbc-studio { padding-bottom: var(--tbc-s7); }
/* MarkuUI 的額度元件（用到八成與用完的提醒、要不要用積木盒、額度條）：長相只經 --marku-* 變數套請看下回的顏色、字級與鈕的圓角，
   淺色、夜間、護眼跟著換；不夠的提示是「要注意」的那一組顏色，額度條的底照分隔線（.sto-quota） */
.tbc-studio {
  --marku-color-primary: var(--tbc-accent);
  --marku-color-font-primary: var(--tbc-accent-ink);
  --marku-color-default: var(--tbc-ink-2);
  --marku-color-info: var(--tbc-ink-3);
  --marku-color-warning: var(--sto-warn);
  --marku-color-danger: var(--tbc-accent);
  --marku-color-default-surface: var(--sto-warn-bg);
  --marku-color-default-border: var(--sto-warn-line);
  --marku-color-font-default-title: var(--tbc-ink);
  --marku-color-font-default-main: var(--tbc-ink);
  --marku-color-font-default-support: var(--tbc-ink-2);
  --marku-border-radius-default: 999px;
  --marku-border-radius-card: 12px;
  --marku-font-size-medium: var(--tbc-fs-ui);
  --marku-font-size-small: var(--tbc-fs-small);
}
.tbc-studio textarea, .tbc-studio select { font: inherit; color: inherit; }
.tbc-studio :focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: 2px; border-radius: 6px; }
.sto-page { max-width: 880px; } /* 靠左、跟頁首的站名對齊；看稿的頁另外置中成內文欄 */
.sto-page--narrow { max-width: 640px; }
.sto-stack > * + * { margin-top: var(--tbc-s4); }
.sto-center { text-align: center; }
.sto-crumbs { margin-bottom: var(--tbc-s2); }
.sto-crumbs a { color: var(--tbc-ink-2); }
/* 返回：左箭頭跟字的第一行垂直置中（書名長到換行時跟著第一行）；箭頭的線在圖示框裡離左邊 6px，往左拉回來，看得到的箭頭跟下面標題的左緣對齊 */
.sto-back { display: inline-flex; align-items: flex-start; gap: 2px; margin-left: -6px; font-weight: 600; line-height: 20px; }
.sto-back .tbc-icon { width: 18px; height: 18px; margin-top: 1px; }

.sto-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--tbc-s4); margin: var(--tbc-s2) 0 var(--tbc-s5); }
.sto-head__text { flex: 1 1 320px; min-width: 0; }
.sto-title { margin: 0; font-size: 26px; line-height: 1.3; letter-spacing: .04em; font-weight: 700; }
.sto-title--book { font-family: var(--tbc-font-serif); letter-spacing: .06em; }
.sto-lead { margin: var(--tbc-s2) 0 0; max-width: 34em; color: var(--tbc-ink-2); line-height: 1.75; }
.sto-h2 { margin: 0; font-size: 18px; line-height: 1.4; letter-spacing: .02em; }
.sto-h2 > .tbc-icon { width: 20px; height: 20px; margin-right: var(--tbc-s2); vertical-align: -3px; color: var(--tbc-ink-2); }
.sto-h3 { margin: 0; font-size: 15px; line-height: 1.5; }
.sto-sub { margin: var(--tbc-s1) 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); line-height: 1.6; }
.sto-sub--lead { display: flex; align-items: center; gap: var(--tbc-s2); margin: var(--tbc-s2) 0 0; padding: 0 var(--tbc-s1); }
.sto-sub--lead .tbc-icon { width: 16px; height: 16px; }
@media (min-width: 1024px) { .sto-title { font-size: 32px; } }

.sto-card { padding: var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: var(--sto-radius); background: var(--tbc-raised); }
.sto-card > .sto-h2 + * { margin-top: var(--tbc-s3); }
@media (min-width: 720px) { .sto-card { padding: var(--tbc-s5); } }
.sto-grid2, .sto-grid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--tbc-s4); }
@media (min-width: 600px) {
  .sto-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sto-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── 按鈕（tbc-btn 之外的幾種）── */
.tbc-studio .tbc-btn { font-size: var(--tbc-fs-ui); padding: 0 var(--tbc-s4); color: var(--tbc-ink); }
.tbc-studio .tbc-btn .tbc-icon { width: 18px; height: 18px; }
.tbc-studio .tbc-btn--primary { color: var(--tbc-accent-ink) !important; }
.tbc-studio .tbc-btn[disabled] { opacity: .45; cursor: not-allowed; }
.tbc-studio .tbc-btn[disabled]:hover { border-color: var(--tbc-line); }
.tbc-studio .tbc-btn--primary[disabled]:hover { border-color: var(--tbc-accent); filter: none; }
.tbc-studio .tbc-btn.is-busy { opacity: .8; cursor: progress; }
.sto-btn--quiet { border-color: transparent !important; background: none !important; color: var(--tbc-ink-2) !important; }
.sto-btn--quiet:hover { background: var(--tbc-surface) !important; color: var(--tbc-ink) !important; }
/* 警示（刪掉、停下、下架）：MarkuUI 的警示色（.tbc-studio 設成請看下回的朱紅） */
.sto-btn--danger { color: var(--marku-color-danger) !important; border-color: var(--tbc-line); background: none; }
.sto-btn--danger:hover { border-color: var(--marku-color-danger) !important; background: var(--tbc-accent-soft); }
.tbc-studio .sto-btn--s { padding: 0 var(--tbc-s3); font-size: 14px; }
.tbc-studio .sto-link { min-height: 44px; margin: -12px 0; padding: 0 var(--tbc-s1); border: 0; background: none; color: var(--tbc-accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sto-spin { animation: sto-spin .9s linear infinite; }
@keyframes sto-spin { to { transform: rotate(360deg); } }

.sto-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); margin-top: var(--tbc-s4); }
.sto-actions .sto-help { margin: 0; flex: 1 1 220px; }
.sto-actions__gap { flex: 1; }
.sto-actions--center { justify-content: center; }
.sto-actions--end { justify-content: flex-end; }
.sto-actions--sticky {
  position: -webkit-sticky; position: sticky; bottom: 0; z-index: 5; margin: var(--tbc-s4) calc(-1 * var(--tbc-s4)) 0; padding: var(--tbc-s3) var(--tbc-s4) calc(var(--tbc-s3) + env(safe-area-inset-bottom, 0px));
  background: var(--tbc-paper); border-top: 1px solid var(--tbc-line);
}
.sto-card .sto-actions--sticky, .sto-unit .sto-actions--sticky { background: var(--tbc-raised); }
.sto-actions--sticky .sto-help { flex: 0 1 auto; }
.sto-actions--page { margin-left: calc(-1 * var(--tbc-s4)); margin-right: calc(-1 * var(--tbc-s4)); }
@media (min-width: 720px) { .sto-actions--page { margin-left: 0; margin-right: 0; padding-left: 0; } }
.sto-unit .sto-actions--sticky { margin-left: calc(-1 * var(--tbc-s4)); margin-right: calc(-1 * var(--tbc-s4)); }
@media (min-width: 720px) { .sto-unit .sto-actions--sticky { margin-left: calc(-1 * var(--tbc-s5)); margin-right: calc(-1 * var(--tbc-s5)); padding-left: var(--tbc-s5); } }
@media (min-width: 720px) { .sto-card .sto-actions--sticky { margin-left: calc(-1 * var(--tbc-s5)); margin-right: calc(-1 * var(--tbc-s5)); padding-left: var(--tbc-s5); } }

/* ── 欄位 ── */
.sto-field { margin-top: var(--tbc-s3); min-width: 0; }
.sto-field:first-child { margin-top: 0; }
.sto-label { display: block; margin-bottom: 6px; font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .04em; color: var(--tbc-ink-2); }
.sto-input, .sto-textarea {
  display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--tbc-line); border-radius: 10px;
  background: var(--tbc-paper); color: var(--tbc-ink); font: 400 15px/1.6 var(--tbc-font-ui);
  transition: border-color .15s, box-shadow .15s;
}
.sto-input { min-height: 44px; }
.sto-select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--tbc-ink-2) 50%), linear-gradient(135deg, var(--tbc-ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.sto-textarea { resize: vertical; min-height: 88px; }
.sto-textarea--doc { min-height: 260px; font-size: 15px; line-height: 1.8; }
.sto-textarea--read { min-height: 60vh; padding: var(--tbc-s4); font-family: var(--tbc-font-read); font-size: var(--tbc-fs-body); line-height: var(--tbc-lh-body); letter-spacing: .02em; }
.sto-input::placeholder, .sto-textarea::placeholder { color: var(--tbc-ink-3); opacity: 1; }
.sto-input:hover, .sto-textarea:hover { border-color: var(--tbc-ink-3); }
.tbc-studio .sto-input:focus, .tbc-studio .sto-textarea:focus { outline: none; border-color: var(--tbc-accent); box-shadow: 0 0 0 3px var(--tbc-accent-soft); }
.sto-field.is-error .sto-input, .sto-field.is-error .sto-textarea { border-color: var(--tbc-accent); }
.sto-help { margin: 6px 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); line-height: 1.6; }
.sto-error { margin: 6px 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-accent); font-weight: 600; }

/* ── 提醒、標籤、量條 ── */
.sto-notice { display: flex; gap: var(--tbc-s3); padding: var(--tbc-s3) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: 12px; background: var(--tbc-surface); }
.sto-notice > .tbc-icon { margin-top: 2px; color: var(--tbc-ink-2); }
.sto-notice--warn { background: var(--sto-warn-bg); border-color: var(--sto-warn-line); }
.sto-notice--warn > .tbc-icon { color: var(--sto-warn); }
.sto-notice--error { background: var(--tbc-accent-soft); border-color: var(--tbc-accent); }
.sto-notice--error > .tbc-icon { color: var(--tbc-accent); }
.sto-notice__body { flex: 1; min-width: 0; }
.sto-notice__title { margin: 0; font-weight: 700; line-height: 1.6; }
.sto-notice__text { margin-top: 2px; color: var(--tbc-ink-2); font-size: 14px; line-height: 1.6; }
.sto-notice__actions { display: flex; flex-wrap: wrap; gap: var(--tbc-s2); margin-top: var(--tbc-s3); }
.sto-card .sto-notice, .sto-card > .sto-notice { margin-top: var(--tbc-s3); }

.sto-tag--final { color: var(--tbc-paper); background: var(--tbc-ink); }
.sto-tag--draft { color: var(--tbc-ink-2); background: var(--tbc-surface); }
.sto-tag--done { color: var(--tbc-ink-2); background: var(--tbc-surface); }
.sto-tag--issue { color: var(--sto-warn); background: var(--sto-warn-bg); }
.sto-tag--live { color: var(--tbc-accent); background: var(--tbc-accent-soft); }
.sto-tag--muted { color: var(--tbc-ink-3); background: none; box-shadow: inset 0 0 0 1px var(--tbc-line); }
.sto-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tbc-accent); box-shadow: 0 0 0 3px var(--tbc-accent-soft); animation: sto-pulse 1.6s ease-in-out infinite; }
@keyframes sto-pulse { 50% { opacity: .35; } }

.sto-meter { position: relative; height: 8px; border-radius: 999px; background: var(--tbc-surface); overflow: hidden; }
.sto-meter > span { position: absolute; left: 0; top: 0; bottom: 0; min-width: 8px; border-radius: 999px; background: var(--tbc-accent); transition: width .3s ease; }
.sto-meter > span[style*="width: 0%"] { min-width: 0; }
.sto-meter.is-full > span { background: var(--sto-warn); }

.sto-loading { display: flex; align-items: center; justify-content: center; gap: var(--tbc-s2); padding: var(--tbc-s7) 0; color: var(--tbc-ink-2); margin: 0; }
.sto-empty { padding: var(--tbc-s6) var(--tbc-s4); border: 1px dashed var(--tbc-line); border-radius: var(--sto-radius); text-align: center; color: var(--tbc-ink-2); }
.sto-empty p { margin: 0 0 var(--tbc-s4); line-height: 1.7; }

/* ── 還沒開放 ── */
.sto-closed { max-width: 30em; margin: var(--tbc-s7) auto; text-align: center; }
.sto-closed__mark { width: 28px; height: 28px; padding: 14px; box-sizing: content-box; border-radius: 50%; color: var(--tbc-accent); background: var(--tbc-accent-soft); }
.sto-closed__title { margin: var(--tbc-s4) 0 var(--tbc-s2); font-size: 22px; }
.sto-closed__text { margin: 0 0 var(--tbc-s2); color: var(--tbc-ink-2); line-height: 1.75; }
.sto-closed .tbc-btn { margin-top: var(--tbc-s4); }
.sto-closed__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--tbc-s2) var(--tbc-s3); }

/* ── 我的書：這週寫小說的額度（用掉幾 %、什麼時候補滿；不寫金額與點數）── */
.sto-quota { margin-bottom: var(--tbc-s5); padding: var(--tbc-s3) var(--tbc-s4) var(--tbc-s3); border-radius: 12px; background: var(--tbc-surface); --marku-color-default-border: var(--tbc-ink-3); }

/* ── 作品空間（MarkuUI 的 MarkuFileSpace：我的書在額度下面、我的檔）：底照額度那一塊，用量條的底照分隔線 ── */
.sto-space { margin: calc(-1 * var(--tbc-s3)) 0 var(--tbc-s5); padding: var(--tbc-s3) var(--tbc-s4); border-radius: 12px; background: var(--tbc-surface); --marku-color-default-border: var(--tbc-ink-3); }
.sto-files { max-width: 760px; --marku-color-default-border: var(--tbc-line); }
.sto-books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s3); }
@media (min-width: 720px) { .sto-books { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sto-book { display: flex; align-items: stretch; gap: var(--tbc-s4); height: 100%; padding: var(--tbc-s4) var(--tbc-s3) var(--tbc-s4) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: var(--sto-radius); background: var(--tbc-raised); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.sto-book:hover { border-color: var(--tbc-ink-3); box-shadow: var(--tbc-shadow); }
/* 小書封：照請看下回的文字版封面（墨黑底、直排書名、朱紅印章），不用圖 */
.sto-book__cover { position: relative; flex: none; align-self: flex-start; display: grid; place-items: center; width: 52px; height: 72px; border-radius: 4px; background: var(--tbc-cover-bg); color: var(--tbc-cover-ink); box-shadow: inset 0 0 0 3px var(--tbc-cover-bg), inset 0 0 0 4px rgba(244, 241, 234, .22); }
.sto-book__cover-cols { display: flex; flex-direction: row-reverse; gap: 3px; }
.sto-book__cover-t { writing-mode: vertical-rl; font-family: var(--tbc-font-serif); font-size: 13px; font-weight: 700; letter-spacing: .06em; line-height: 1.05; }
.sto-book__cover.is-two .sto-book__cover-t { font-size: 12px; }
.sto-book__cover.is-three .sto-book__cover-t { font-size: 10px; }
.sto-book__cover.is-four .sto-book__cover-t { font-size: 8.5px; }
.sto-book__seal { position: absolute; left: 7px; bottom: 7px; width: 8px; height: 8px; border-radius: 1px; background: #b3261e; }
.sto-book__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sto-book__title { font-family: var(--tbc-font-serif); font-size: 20px; font-weight: 700; letter-spacing: .04em; line-height: 1.35; }
.sto-book__idea { color: var(--tbc-ink-2); font-size: 14px; line-height: 1.65; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sto-book__meta { display: flex; flex-wrap: wrap; gap: 0 var(--tbc-s3); font-size: var(--tbc-fs-small); color: var(--tbc-ink-3); }
.sto-book__live { display: inline-flex; align-items: center; gap: var(--tbc-s2); font-size: var(--tbc-fs-small); font-weight: 700; color: var(--tbc-accent); }
.sto-book__go { align-self: center; color: var(--tbc-ink-3); }

/* ── 開一本書 ── */
.sto-form { margin-top: var(--tbc-s4); }
/* 表單的間距節奏（開一本書與「基本設定」的卡用同一套 .sto-fields）：名稱到輸入 8px、輸入到說明 6px（.sto-help）、
   欄與欄 24px、卡的標題到第一欄 16px；篇幅結構的四格放在同一個框裡 */
.sto-fields > .sto-field, .sto-fields > .sto-check-field { margin-top: var(--tbc-s5); }
.sto-fields > .sto-field:first-child { margin-top: 0; }
.sto-fields > .sto-h2 + .sto-field { margin-top: var(--tbc-s4); }
.sto-fields .sto-label { margin-bottom: var(--tbc-s2); }
.sto-group { margin-left: 0; margin-right: 0; border: 0; padding: 0; min-width: 0; }
.sto-grid4.sto-group__panel { margin-top: var(--tbc-s3); padding: 0 var(--tbc-s4) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: 12px; }

/* 欄位名稱那一列（開一本書與基本設定）：名稱在左，「讓 AI 決定」在右，字比名稱小、不粗，看得出是這一欄的選項；
   點得到的範圍上下各多 12px（觸控至少 44px），不撐高這一列 */
.sto-labelrow { display: flex; align-items: center; justify-content: space-between; gap: var(--tbc-s3); width: 100%; margin: 0 0 var(--tbc-s2); padding: 0; }
.sto-labelrow > .sto-label, .sto-fields .sto-labelrow > .sto-label, .sto-labelrow > .sto-h2 { margin: 0; }
.sto-labelrow + .sto-help { margin-top: 0; }
.sto-aichoice { flex: none; display: inline-flex; align-items: center; gap: 6px; margin: -12px 0; padding: 12px 0 12px var(--tbc-s2); cursor: pointer;
  font-size: var(--tbc-fs-small); font-weight: 400; letter-spacing: 0; color: var(--tbc-ink-2); white-space: nowrap; }
.sto-aichoice input { width: 16px; height: 16px; margin: 0; accent-color: var(--tbc-accent); }
.sto-aichoice:hover { color: var(--tbc-ink); }
.sto-form > .Marku-AiRun { margin-top: var(--tbc-s5); padding-top: var(--tbc-s4); border-top: 1px solid var(--tbc-line); }
.sto-pending { display: flex; align-items: flex-start; gap: var(--tbc-s1); color: var(--tbc-ink-2); }
.sto-pending .tbc-icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--tbc-accent); }
.sto-title.is-pending, .sto-book__title.is-pending { color: var(--tbc-ink-3); }

/* ── 一本書：頁頭、正在做的工作、分頁 ── */
.sto-bookhead { margin: var(--tbc-s1) 0 var(--tbc-s4); }
.sto-bookhead > * + * { margin-top: var(--tbc-s4); }
.sto-bookhead__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--tbc-s1) var(--tbc-s3); }
.sto-bookhead__genre { font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.sto-tabs { position: -webkit-sticky; position: sticky; top: 56px; z-index: 10; margin: 0 calc(-1 * var(--tbc-s4)) var(--tbc-s5); padding: 0 var(--tbc-s4); background: var(--tbc-paper); border-bottom: 1px solid var(--tbc-line); }
@media (min-width: 720px) { .sto-tabs { margin-left: 0; margin-right: 0; padding: 0; } }
.sto-tabs__row { display: flex; gap: var(--tbc-s1); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sto-tabs__row::-webkit-scrollbar { display: none; }
/* 放不下時還沒看到的那一邊淡出，看得出可以滑（TabRow 照捲到哪寫 data-more） */
.sto-tabs__row[data-more="right"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.sto-tabs__row[data-more="left"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
.sto-tabs__row[data-more="both"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.sto-tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 var(--tbc-s3); color: var(--tbc-ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sto-tab:hover { color: var(--tbc-ink); }
.sto-tab .tbc-icon { width: 16px; height: 16px; }
.sto-tab[aria-current="page"] { color: var(--tbc-ink); }
.sto-tab[aria-current="page"]::after { content: ""; position: absolute; left: var(--tbc-s3); right: var(--tbc-s3); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--tbc-accent); }
/* 手機：中文的七個分頁一行放得下（每個至少 44px 寬）；英文的照樣左右滑 */
@media (max-width: 420px) {
  .sto-tabs__row { gap: 0; }
  .sto-tab { padding: 0 var(--tbc-s2); }
  .sto-tab[aria-current="page"]::after { left: var(--tbc-s2); right: var(--tbc-s2); }
}
.tbc-studio .sto-tab:focus-visible { outline-offset: -2px; }

/* ── 設定 ── */
.sto-doc__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--tbc-s2) var(--tbc-s4); }
.sto-doc__head > div:first-child { flex: 1 1 260px; min-width: 0; }
.sto-doc__status { flex: none; padding-top: 2px; }
.sto-docmeta { font-size: var(--tbc-fs-small); color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; }
.sto-doc .sto-field { margin-top: var(--tbc-s3); }
.sto-doc .sto-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* 標題就是這一份的名字，標籤只給讀屏 */
.sto-livebox { max-height: 340px; overflow: auto; margin-top: var(--tbc-s3); padding: var(--tbc-s3) var(--tbc-s4); border-radius: 10px; background: var(--tbc-surface); }
.sto-livebox__text { margin: 0; white-space: pre-wrap; word-break: break-word; font: 400 14px/1.75 var(--tbc-font-ui); color: var(--tbc-ink-2); }
.sto-danger { padding-top: var(--tbc-s3); border-top: 1px solid var(--tbc-line); }

/* ── 細綱 ── */
.sto-unit { border: 1px solid var(--tbc-line); border-radius: var(--sto-radius); background: var(--tbc-raised); }
.sto-unit[open] { border-color: var(--tbc-ink-3); }
.sto-unit__sum { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "k t tag" "m m m"; align-items: center; gap: 2px var(--tbc-s3); min-height: 56px; padding: var(--tbc-s3) var(--tbc-s4); cursor: pointer; list-style: none; }
.sto-unit__sum::-webkit-details-marker { display: none; }
.sto-unit__k { grid-area: k; font-size: var(--tbc-fs-small); font-weight: 700; color: var(--tbc-accent); letter-spacing: .06em; }
.sto-unit__t { grid-area: t; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sto-unit__meta { grid-area: m; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.sto-unit__sum > .tbc-tag { grid-area: tag; }
.sto-unit__body { padding: 0 var(--tbc-s4) var(--tbc-s4); border-top: 1px solid var(--tbc-line); }
.sto-unit__body > .sto-sub:first-child { margin: var(--tbc-s3) 0; }
@media (min-width: 720px) { .sto-unit__sum, .sto-unit__body { padding-left: var(--tbc-s5); padding-right: var(--tbc-s5); } }
/* 按停時寫到的字：跟單元卡同一個外框，一行標題，展開看字與複製 */
.sto-partial { margin-top: var(--tbc-s3); }
.sto-partial__sum { padding: var(--tbc-s3) var(--tbc-s4); cursor: pointer; font: 500 14px/1.6 var(--tbc-font-ui); color: var(--tbc-ink-2); }
.sto-partial__body { padding: 0 var(--tbc-s4) var(--tbc-s4); border-top: 1px solid var(--tbc-line); }
@media (min-width: 720px) { .sto-partial__sum, .sto-partial__body { padding-left: var(--tbc-s5); padding-right: var(--tbc-s5); } }
.sto-unitfields { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: var(--tbc-s3); margin-top: var(--tbc-s4); }
.sto-unitfields .sto-field { margin-top: 0; }
.sto-unitfields .sto-field:nth-child(3) { grid-column: 1 / -1; }
@media (min-width: 720px) { .sto-unitfields { grid-template-columns: 5.5em minmax(0, 1.4fr) minmax(0, 1fr); } .sto-unitfields .sto-field:nth-child(3) { grid-column: auto; } }
.sto-plans__count { margin-left: var(--tbc-s2); font-size: var(--tbc-fs-small); font-weight: 400; color: var(--tbc-ink-2); }
.sto-plans__empty { margin-top: var(--tbc-s3); padding: var(--tbc-s5) var(--tbc-s4); border: 1px dashed var(--tbc-line); border-radius: 12px; text-align: center; }
.sto-plans__empty p { margin: 0; color: var(--tbc-ink-2); line-height: 1.7; }
.sto-plans__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--tbc-s2); margin-top: var(--tbc-s6); padding-top: var(--tbc-s4); border-top: 1px dashed var(--tbc-line); }
.sto-plans { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-plan { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s2); padding: var(--tbc-s4) 0; border-bottom: 1px solid var(--tbc-line); }
.sto-plan:last-child { border-bottom: 0; }
.sto-plan__n { font-size: var(--tbc-fs-small); font-weight: 700; color: var(--tbc-accent); letter-spacing: .08em; }
.sto-plan__fields .sto-field + .sto-field { margin-top: var(--tbc-s2); }
@media (min-width: 720px) { .sto-plan { grid-template-columns: 76px minmax(0, 1fr); gap: var(--tbc-s4); } .sto-plan__n { padding-top: 30px; } }
.sto-unit__foot { margin-top: var(--tbc-s5); padding-top: var(--tbc-s4); border-top: 1px solid var(--tbc-line); }

/* ── 寫稿 ── */
.sto-range { display: flex; align-items: flex-end; gap: var(--tbc-s3); margin-top: var(--tbc-s3); }
.sto-range .sto-field { flex: 0 1 160px; margin-top: 0; }
.sto-range__dash { padding-bottom: 10px; color: var(--tbc-ink-3); }
.sto-run { border-color: var(--tbc-accent); }
.sto-run__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--tbc-s3); }
.sto-run__k { margin: 0 0 2px; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.sto-run__t { display: flex; align-items: center; gap: var(--tbc-s2); margin: 0; font-size: 20px; line-height: 1.4; }
.sto-run__bar { display: flex; align-items: center; gap: var(--tbc-s3); margin-top: var(--tbc-s4); font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; }
.sto-run__bar .sto-meter { flex: 1; }
.sto-live { position: relative; max-height: 320px; overflow: auto; margin-top: var(--tbc-s3); padding: 0 var(--tbc-s4); border-radius: 10px; background: var(--tbc-surface); font-size: 16px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px); mask-image: linear-gradient(to bottom, transparent 0, #000 40px); }
.tbc-prose.sto-live__prose { padding: var(--tbc-s6) 0 var(--tbc-s3); font-size: 16px; }
.sto-runlist { list-style: none; margin: var(--tbc-s4) 0 0; padding: 0; border-top: 1px solid var(--tbc-line); }
.sto-runlist__i { display: flex; align-items: center; gap: var(--tbc-s3); min-height: 44px; border-bottom: 1px solid var(--tbc-line); color: var(--tbc-ink-3); font-size: 14px; }
.sto-runlist__mark { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--tbc-line); }
.sto-runlist__mark .tbc-icon { width: 14px; height: 14px; stroke-width: 2.5; }
.sto-runlist__n { font-weight: 600; min-width: 5.5em; }
.sto-runlist__s { flex: 1; }
.sto-runlist__go { color: var(--tbc-accent); font-weight: 600; text-decoration: none; }
.sto-runlist__i.is-done { color: var(--tbc-ink); }
.sto-runlist__i.is-done .sto-runlist__mark { background: var(--tbc-ink); color: var(--tbc-paper); box-shadow: none; }
.sto-runlist__i.is-now { color: var(--tbc-accent); }
.sto-runlist__i.is-now .sto-runlist__mark { box-shadow: inset 0 0 0 1.5px var(--tbc-accent); }

.sto-rows { list-style: none; margin: var(--tbc-s2) 0 0; padding: 0; }
.sto-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); }
.sto-row:last-child { border-bottom: 0; }
.sto-row__main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sto-row__t { font-weight: 600; }
.sto-row__m { font-size: var(--tbc-fs-small); color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; }
.sto-row__q { font-size: 14px; color: var(--tbc-ink-2); line-height: 1.6; }
.sto-row__acts { display: flex; gap: var(--tbc-s2); }
.sto-row.is-current .sto-row__t { color: var(--tbc-ink); }

/* ── 稿件 ── */
.sto-export > .sto-notice { margin-top: var(--tbc-s3); }
.sto-chunit + .sto-chunit { margin-top: var(--tbc-s6); }
.sto-chunit__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--tbc-s3); margin: 0 0 var(--tbc-s2); font-size: 17px; }
.sto-chunit__k { font-size: var(--tbc-fs-small); font-weight: 700; color: var(--tbc-accent); letter-spacing: .06em; }
.sto-chunit__r { font-size: var(--tbc-fs-small); font-weight: 400; color: var(--tbc-ink-3); }
.sto-chlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tbc-line); }
.sto-chlist__row { display: grid; grid-template-columns: 5em minmax(0, 1fr) auto; grid-template-areas: "n t go" "n tags go"; align-items: center; gap: 2px var(--tbc-s3); min-height: 56px; padding: var(--tbc-s2) var(--tbc-s1); border-bottom: 1px solid var(--tbc-line); text-decoration: none; }
a.sto-chlist__row:hover { background: var(--tbc-surface); }
.sto-chlist__n { grid-area: n; font-size: 14px; color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; }
.sto-chlist__t { grid-area: t; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sto-chlist__tags { grid-area: tags; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--tbc-s2); }
.sto-chlist__c { font-size: 12px; color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; }
.sto-chlist__go { grid-area: go; color: var(--tbc-ink-3); }
.sto-chlist__row.is-planned .sto-chlist__t { color: var(--tbc-ink-3); font-weight: 400; }
@media (min-width: 720px) {
  .sto-chlist__row { grid-template-columns: 5.5em minmax(0, 1fr) auto auto; grid-template-areas: "n t tags go"; }
  .sto-chlist__tags { justify-content: flex-end; }
}

/* ── 一回：看稿與改 ── */
/* 整頁是置中的一欄：返回列、寫的期間的進度、寫好之後的那一條與稿，左右緣都跟單元與回的標題對齊。欄寬照內文的字級算（--tbc-measure 是 em），
   所以整頁用內文的字級，稿以外的回到介面的字級、返回的字照原本的小字 */
.sto-page.sto-chapter { max-width: calc(var(--tbc-measure) + 2px); margin-left: auto; margin-right: auto; font-size: var(--tbc-fs-body); }
.sto-chapter > :not(.sto-read) { font-size: var(--tbc-fs-ui); }
.sto-chapter > .sto-crumbs > .sto-back { font-size: var(--tbc-fs-small); }
.sto-read > * + * { margin-top: var(--tbc-s4); }
.sto-read > .tbc-prose, .sto-read > .sto-proseblock, .sto-read > .tbc-ch-end { margin-top: 0; }
.sto-read .sto-card, .sto-read .sto-notice, .sto-read .sto-toolbar, .sto-read .sto-check, .sto-read .sto-editor { font-size: var(--tbc-fs-ui); }
.sto-ch-head { padding-top: var(--tbc-s3); }
.sto-ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); margin: var(--tbc-s3) 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; }
.sto-ch-note { display: flex; gap: var(--tbc-s2); margin: var(--tbc-s3) 0 0; font-size: 14px; color: var(--tbc-ink-2); line-height: 1.6; }
.sto-ch-note .tbc-icon { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.sto-ch-note__q { display: block; margin-top: 2px; color: var(--tbc-ink); }
.sto-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tbc-s2); padding: var(--tbc-s3) 0; border-top: 1px solid var(--tbc-line); border-bottom: 1px solid var(--tbc-line); }
.sto-toolbar .tbc-btn { width: 100%; }
@media (min-width: 600px) { .sto-toolbar { display: flex; flex-wrap: wrap; } .sto-toolbar .tbc-btn { width: auto; } .sto-toolbar > :last-child { margin-left: auto; } }
.sto-check { margin: 0; }
.sto-read > .sto-check--ok { margin-top: var(--tbc-s3); }
.sto-check--ok { display: flex; align-items: center; gap: var(--tbc-s2); color: var(--tbc-ink-2); font-size: 14px; }
.sto-check--ok .tbc-icon { color: var(--tbc-ink-2); }
.sto-check--bad { padding: var(--tbc-s3) var(--tbc-s4); border: 1px solid var(--sto-warn-line); border-radius: 12px; background: var(--sto-warn-bg); }
.sto-check__t { display: flex; align-items: center; gap: var(--tbc-s2); margin: 0; font-weight: 700; color: var(--sto-warn); }
.sto-check__list { list-style: none; margin: var(--tbc-s2) 0 0; padding: 0; }
.sto-check__list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--tbc-s1) var(--tbc-s3); padding: var(--tbc-s2) 0; border-top: 1px solid var(--sto-warn-line); }
.sto-check__n { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--sto-warn); color: var(--tbc-paper); font-size: 12px; font-weight: 700; }
.sto-check__body { flex: 1 1 240px; min-width: 0; line-height: 1.65; }
.sto-check__type { margin-right: var(--tbc-s2); font-weight: 700; }
.sto-check__d { color: var(--tbc-ink); }
.tbc-prose.sto-prose { padding-top: var(--tbc-s2); }
.sto-prose .sto-flag { position: relative; background: var(--sto-warn-bg); box-shadow: 0 0 0 .4em var(--sto-warn-bg), -.4em 0 0 .4em var(--sto-warn-line); }
.sto-prose .sto-flag::after {
  content: attr(data-flag); position: absolute; top: -.85em; right: -.4em; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--sto-warn); color: var(--tbc-paper); font: 700 12px/20px var(--tbc-font-ui); letter-spacing: 0; text-align: center;
}
.sto-editor .sto-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 圈起來改：圈好的地方標在稿上（最後一段帶編號）、上面的清單與意見、畫面下緣的「圈起來」 ── */
.sto-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.is-marking .sto-prose { cursor: text; -webkit-user-select: text; user-select: text; }
.sto-prose mark.sto-mark { color: inherit; background: var(--tbc-accent-soft); border-radius: 3px; padding: .08em 0; }
.sto-prose mark.sto-mark--pending { box-shadow: inset 0 -2px 0 var(--tbc-accent); }
.sto-prose mark.sto-mark--changed { box-shadow: inset 0 -1px 0 var(--tbc-accent); }
.sto-prose mark.sto-mark[data-n]::after {
  content: attr(data-n); display: inline-block; vertical-align: super; min-width: 16px; height: 16px; margin-left: 2px; padding: 0 4px; border-radius: 8px;
  background: var(--tbc-accent); color: var(--tbc-accent-ink); font: 700 11px/16px var(--tbc-font-ui); letter-spacing: 0; text-align: center; text-indent: 0;
}
.sto-prose mark.sto-mark--changed[data-n]::after { background: transparent; color: var(--tbc-accent); box-shadow: inset 0 0 0 1px var(--tbc-accent); }
.sto-markno { flex: none; display: inline-block; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--tbc-accent); color: var(--tbc-accent-ink); font: 700 12px/22px var(--tbc-font-ui); text-align: center; }
.sto-markno--done { background: transparent; color: var(--tbc-accent); box-shadow: inset 0 0 0 1px var(--tbc-accent); }
.sto-marks .sto-h3 + .sto-help { margin-top: var(--tbc-s2); }
.sto-marklist { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-markitem { padding: var(--tbc-s3) 0; border-top: 1px solid var(--tbc-line); }
.sto-markitem__head { display: flex; align-items: flex-start; gap: var(--tbc-s2); }
.sto-markitem__head .sto-markno { margin-top: 3px; }
.sto-markitem__q { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0 0 0 var(--tbc-s2); border-left: 2px solid var(--tbc-accent); color: var(--tbc-ink); font-family: var(--tbc-font-read); line-height: 1.7; overflow-wrap: anywhere; quotes: none; }
.sto-markitem__q::before, .sto-markitem__q::after, .sto-markbar__q::before, .sto-markbar__q::after { content: none; }
.sto-markitem__head .tbc-btn { flex: none; margin: -6px 0; }
.sto-markitem .sto-field { margin-top: var(--tbc-s2); }
.sto-marks__empty { margin: var(--tbc-s3) 0 0; padding: var(--tbc-s3); border: 1px dashed var(--tbc-line); border-radius: 10px; color: var(--tbc-ink-2); font-size: 14px; text-align: center; }
.sto-charge { display: flex; align-items: flex-start; gap: var(--tbc-s2); }
.sto-charge .tbc-icon { flex: none; width: 15px; height: 15px; margin-top: 4px; }
.sto-stack > .sto-charge { margin-top: var(--tbc-s2); padding: 0 var(--tbc-s1); }
.sto-markbar {
  position: -webkit-sticky; position: sticky; bottom: 0; z-index: 6; margin: var(--tbc-s4) calc(-1 * var(--tbc-s4)) 0;
  padding: var(--tbc-s3) var(--tbc-s4) calc(var(--tbc-s3) + env(safe-area-inset-bottom, 0px));
  background: var(--tbc-raised); border-top: 1px solid var(--tbc-line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); font-size: var(--tbc-fs-ui);
}
.sto-markbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); }
.sto-markbar__q { flex: 1 1 160px; min-width: 0; margin: 0; padding-left: var(--tbc-s2); border-left: 2px solid var(--tbc-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--tbc-font-read); quotes: none; }
.sto-markbar__hint { flex: 1 1 160px; min-width: 0; margin: 0; color: var(--tbc-ink-2); font-size: 14px; line-height: 1.6; }
.sto-markbar__hint.is-warn { color: var(--sto-warn); font-weight: 600; }
.sto-markbar__edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--tbc-s2) var(--tbc-s3); }
.sto-markbar__n { flex: 1 1 100%; display: flex; align-items: center; gap: var(--tbc-s2); font-size: var(--tbc-fs-small); font-weight: 700; color: var(--tbc-ink-2); }
.sto-markbar__note { flex: 1 1 200px; min-width: 0; width: auto; min-height: 60px; }
@media (min-width: 720px) { .sto-markbar { margin-left: 0; margin-right: 0; padding-left: var(--tbc-s4); border: 1px solid var(--tbc-line); border-bottom: 0; border-radius: var(--sto-radius) var(--sto-radius) 0 0; } }
.sto-changelist { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-change { display: flex; gap: var(--tbc-s3); padding: var(--tbc-s3) 0; border-top: 1px solid var(--tbc-line); }
.sto-change__body { flex: 1 1 auto; min-width: 0; }
.sto-change__note { margin: 0; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.sto-change__row { display: flex; gap: var(--tbc-s2); margin: var(--tbc-s1) 0 0; font-size: 14px; line-height: 1.7; }
.sto-change__k { flex: none; color: var(--tbc-ink-3); font-size: var(--tbc-fs-small); line-height: 1.9; }
.sto-change__was { color: var(--tbc-ink-2); text-decoration-color: var(--tbc-ink-3); font-family: var(--tbc-font-read); overflow-wrap: anywhere; }
.sto-change__now { padding: 0 2px; background: var(--tbc-accent-soft); color: var(--tbc-ink); text-decoration: none; border-radius: 3px; font-family: var(--tbc-font-read); overflow-wrap: anywhere; }
.sto-change__kept { color: var(--tbc-ink-3); }
.sto-aside { margin-top: var(--tbc-s6) !important; }
.sto-aside__head { display: flex; align-items: center; justify-content: space-between; gap: var(--tbc-s2); }
.sto-aside .sto-h3 + .sto-aside__text, .sto-aside__head + .sto-aside__text { margin-top: var(--tbc-s2); }
.sto-aside__text { margin: 0; color: var(--tbc-ink-2); font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.sto-aside .sto-aside__text + .sto-h3 { margin-top: var(--tbc-s4); }
.sto-pager { margin-top: var(--tbc-s5) !important; }

/* ── 撰寫筆記 ── */
.sto-statehead { padding: 0 var(--tbc-s1); }
/* 標題與「改筆記」同一列：手機寬度鈕換到下一行、靠左 */
.sto-notes__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--tbc-s3); }
.sto-notes__head > div { flex: 1 1 260px; min-width: 0; }
.sto-summaries .sto-field { margin-top: var(--tbc-s2); }
.sto-notes__before { display: block; overflow-wrap: anywhere; }
.sto-notes__before > span { margin-right: var(--tbc-s2); color: var(--tbc-ink-3); }
.sto-items { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-item { display: flex; align-items: flex-start; gap: var(--tbc-s2); padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); }
.sto-item:first-child { padding-top: 0; }
.sto-item__fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s2) var(--tbc-s3); }
.sto-item__fields .sto-field { margin-top: 0; }
.sto-item > .tbc-btn { margin-top: 26px; }
@media (min-width: 720px) {
  .sto-item__fields--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .sto-item__fields--3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.sto-summaries { margin: var(--tbc-s3) 0 0; padding: 0; list-style: none; }
.sto-summaries li { padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); }
.sto-summaries li:last-child { border-bottom: 0; }
.sto-summaries__n { font-weight: 700; color: var(--tbc-ink); text-decoration: none; }
.sto-summaries__n:hover { text-decoration: underline; }
.sto-summaries p { margin: var(--tbc-s1) 0 0; color: var(--tbc-ink-2); font-size: 14px; line-height: 1.75; }

/* ── 用量 ── */
.sto-usage-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s4); }
@media (min-width: 720px) { .sto-usage-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sto-stat__k { margin: 0; font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .06em; color: var(--tbc-ink-2); }
.sto-stat__v { margin: var(--tbc-s1) 0 var(--tbc-s3); font-size: 30px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.sto-stat__warn { margin: var(--tbc-s2) 0 0; color: var(--sto-warn); font-weight: 600; font-size: 14px; }
.sto-tokens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tbc-s2) var(--tbc-s4); margin: var(--tbc-s4) 0 0; }
.sto-tokens dt { font-size: 12px; color: var(--tbc-ink-3); }
.sto-tokens dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.sto-table-wrap { margin-top: var(--tbc-s3); overflow-x: auto; }
.sto-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sto-table th, .sto-table td { padding: var(--tbc-s2) var(--tbc-s2); border-bottom: 1px solid var(--tbc-line); text-align: right; white-space: nowrap; }
.sto-table th:first-child { text-align: left; }
.sto-table thead th { font-size: 12px; font-weight: 700; color: var(--tbc-ink-2); }
.sto-table tbody th { font-weight: 600; }
.sto-table tbody th a { color: var(--tbc-ink); text-decoration: none; }
.sto-table tbody th a:hover { text-decoration: underline; }
.sto-table__sub { display: block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 400; color: var(--tbc-ink-3); }
.sto-table tfoot th, .sto-table tfoot td { font-weight: 700; border-bottom: 0; }
.sto-table__usd { color: var(--tbc-ink); font-weight: 600; }
@media (max-width: 599px) {
  /* 手機：一回一張，欄名寫在數字前面 */
  .sto-table thead { display: none; }
  .sto-table, .sto-table tbody, .sto-table tfoot, .sto-table tr, .sto-table th, .sto-table td { display: block; width: auto; }
  .sto-table tr { padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--tbc-s3); }
  .sto-table th { grid-column: 1 / -1; padding: 0 0 var(--tbc-s1); border: 0; }
  .sto-table td { display: flex; justify-content: space-between; gap: var(--tbc-s2); padding: 0; border: 0; text-align: right; }
  .sto-table td::before { content: attr(data-k); color: var(--tbc-ink-3); font-size: 12px; text-align: left; }
  .sto-table tfoot tr { border-bottom: 0; }
}

/* ── 對話框、提示 ── */
/* ── 上架到請看下回 ── */
.sto-card--need { border-color: var(--tbc-accent); box-shadow: 0 0 0 3px var(--tbc-accent-soft); }
.sto-rules { padding-top: var(--tbc-s3); padding-bottom: var(--tbc-s3); }
.sto-rules__h { display: flex; align-items: center; gap: var(--tbc-s2); font-size: 16px; }
.sto-rules__h .tbc-icon { flex: none; width: 18px; height: 18px; color: var(--tbc-ink-2); }
.sto-card > .sto-rules__h + .sto-rules__list { margin-top: var(--tbc-s2); }
.sto-rules__list { margin: 0; padding-left: 1.2em; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); line-height: 1.7; }
.sto-rules__list li + li { margin-top: 4px; }
.sto-rules__link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: var(--tbc-s1); color: var(--tbc-accent); font-size: var(--tbc-fs-small); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sto-rules__link .tbc-icon { flex: none; width: 14px; height: 14px; }
.sto-pen__review { flex: 1 0 100%; min-width: 0; }
.sto-pen__cool, .sto-pen__other { flex: 1 0 100%; min-width: 0; margin: 0; }
.sto-pen__review .sto-notice, .sto-card .sto-pen__review .sto-notice { margin-top: 0; }
.sto-pen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); padding-top: var(--tbc-s3); padding-bottom: var(--tbc-s3); }
.sto-pen__k { font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .04em; color: var(--tbc-ink-2); }
.sto-pen__v { flex: 1 1 auto; min-width: 0; font-family: var(--tbc-font-serif); font-size: 18px; letter-spacing: .04em; overflow-wrap: anywhere; }
/* 這本書的語言的筆名還沒設、在用另一個語言的：照樣寫在筆名的位置但淡一點，下一行寫明（.sto-pen__other） */
.sto-pen__v.is-other { color: var(--tbc-ink-2); }
.sto-pen__form { max-width: 420px; margin-top: var(--tbc-s3); }
.sto-listing .sto-field { margin-top: var(--tbc-s4); }
.sto-blurb__meta { display: flex; align-items: center; gap: var(--tbc-s2); margin-top: 6px; min-height: 22px; }
.sto-blurb__meta .tbc-tag { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 標籤不折行：窄到放不下才截成… */
.sto-blurb__meta .tbc-icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.sto-blurb__count { flex: none; white-space: nowrap; font-size: 12px; color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; }
.sto-blurb__ask { margin-top: var(--tbc-s2); }
.sto-help--warn { color: var(--sto-warn); font-weight: 600; }
.sto-blurb__other { margin-top: var(--tbc-s3); padding: var(--tbc-s3) var(--tbc-s4); border-radius: 12px; background: var(--tbc-surface); }
.sto-blurb__k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--tbc-ink-2); }
.sto-blurb__t { margin: 4px 0 var(--tbc-s3); line-height: 1.7; }
.tbc-studio .sto-select--s { padding-top: 6px; padding-bottom: 6px; font-size: 14px; }

.sto-releases__tools { display: flex; flex-wrap: wrap; gap: var(--tbc-s2); }
.sto-releases > .sto-notice { margin-top: var(--tbc-s3); }
.sto-blockers { margin: var(--tbc-s1) 0 0; padding-left: 1.2em; }
.sto-blockers li + li { margin-top: 4px; }

.sto-rel { list-style: none; margin: var(--tbc-s4) 0 0; padding: 0; border-top: 1px solid var(--tbc-line); }
.sto-rel__row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "pick main" ". side";
  align-items: start; gap: var(--tbc-s2) var(--tbc-s2); padding: var(--tbc-s3) var(--tbc-s1); border-bottom: 1px solid var(--tbc-line);
}
.sto-rel__row.is-on { background: var(--tbc-accent-soft); }
.sto-rel__pick { grid-area: pick; display: grid; place-items: center; width: 32px; min-height: 28px; }
.sto-rel__pick input { width: 20px; height: 20px; margin: 0; accent-color: var(--tbc-accent); cursor: pointer; }
.sto-rel__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tbc-line); }
.sto-rel__main { grid-area: main; min-width: 0; }
.sto-rel__title { display: flex; align-items: baseline; gap: var(--tbc-s2); min-height: 28px; cursor: default; }
label.sto-rel__title { cursor: pointer; }
.sto-rel__n { flex: none; font-size: 14px; color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; }
.sto-rel__t { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.sto-rel__row.is-off .sto-rel__t { color: var(--tbc-ink-2); font-weight: 500; }
.sto-rel__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--tbc-s2); margin-top: 4px; }
.sto-rel__tags .tbc-tag .tbc-icon { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.sto-rel__date { font-size: 12px; color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; }
.sto-rel__hint { margin: 6px 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); line-height: 1.6; }
.sto-rel__hint--bad { color: var(--tbc-accent); font-weight: 600; overflow-wrap: anywhere; }
.sto-rel__side { grid-area: side; display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); }
.sto-rel__side .sto-select { width: auto; min-width: 9.5em; }
.tbc-studio .sto-rel__icon { width: 44px; padding: 0; }
@media (min-width: 720px) {
  .sto-rel__row { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "pick main side"; align-items: center; padding-left: var(--tbc-s2); padding-right: var(--tbc-s2); }
  .sto-rel__side { justify-content: flex-end; }
}
.sto-confirm-list { margin: 0; padding-left: 1.2em; }
.sto-confirm-list li + li { margin-top: var(--tbc-s2); }

.sto-scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; place-items: center; padding: var(--tbc-s4); background: var(--sto-scrim); }
.sto-dialog { width: 100%; max-width: 420px; padding: var(--tbc-s5); border-radius: 16px; background: var(--tbc-raised); color: var(--tbc-ink); box-shadow: var(--tbc-float-shadow); }
.sto-dialog__title { margin: 0; font-size: 18px; }
.sto-dialog__body { margin-top: var(--tbc-s2); color: var(--tbc-ink-2); line-height: 1.75; }
.sto-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--tbc-s2); margin-top: var(--tbc-s5); }
.sto-toast {
  position: fixed; left: 50%; top: 68px; z-index: 70; display: flex; align-items: center; gap: var(--tbc-s2); max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 999px; background: var(--tbc-ink); color: var(--tbc-paper); font-size: 14px; font-weight: 600; box-shadow: var(--tbc-float-shadow);
  opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.sto-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.sto-toast .tbc-icon { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .sto-spin, .sto-dot { animation: none; }
  .sto-toast, .sto-meter > span { transition: none; }
}

/* ══ 第二版 ══════════════════════════════════════════════════════ */

/* ── 開一本書：篇幅結構、勾選 ── */
.sto-fieldset { margin: var(--tbc-s4) 0 0; padding: var(--tbc-s3) var(--tbc-s4) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: 12px; min-width: 0; }
.sto-fieldset > legend { padding: 0 var(--tbc-s1); margin-bottom: 0; }
.sto-fieldset > .sto-help:first-of-type { margin-top: 0; }
.sto-grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--tbc-s3); margin-top: var(--tbc-s2); }
.sto-grid4 .sto-field { margin-top: var(--tbc-s3); }
@media (min-width: 720px) { .sto-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 類型：清單裡的每一種一個切換鈕（樣子跟書架的類型篩選一樣，reader.css 的 tbc-langs__opt），最多選三個 */
.sto-genres { border: 0; padding: 0; margin: var(--tbc-s3) 0 0; min-width: 0; }
.sto-genres > legend { padding: 0; }
.sto-genres__opts { display: flex; flex-wrap: wrap; gap: var(--tbc-s2); }
.sto-genres__opt { min-height: 44px; } /* 觸控目標至少 44px（書架的篩選鈕是 36px） */
.sto-genres__opt:disabled { opacity: .45; cursor: not-allowed; }
.sto-genres__opt:disabled:hover { border-color: var(--tbc-line); }
.sto-genres.is-error .sto-genres__opt[aria-pressed="false"] { border-color: var(--tbc-accent); }
.sto-check-field { margin-top: var(--tbc-s3); }
.sto-checkline { display: flex; align-items: center; gap: var(--tbc-s2); min-height: 44px; cursor: pointer; font-weight: 600; line-height: 1.5; }
.sto-checkline input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--tbc-accent); }
.sto-check-field .sto-help { margin-top: 0; padding-left: 28px; }

/* ── 書的卡片：英文書名橫排的小書封、上一次停在哪 ── */
.sto-book__cover.is-latin { padding: 6px 5px 14px; place-items: start; }
.sto-book__cover-latin { display: block; max-height: 52px; overflow: hidden; font-family: var(--tbc-font-serif); font-size: 9.5px; font-weight: 700; line-height: 1.25; letter-spacing: .02em; word-break: break-word; }
.sto-book__note { font-size: var(--tbc-fs-small); color: var(--sto-warn); font-weight: 600; line-height: 1.5; }
.sto-book__title .tbc-tag--lang, .sto-bookhead__title .tbc-tag--lang { margin-left: var(--tbc-s2); vertical-align: 3px; font-family: var(--tbc-font-ui); }

/* ── 頁首切換任務模式與自由模式：一條分段的切換，每一段寫名稱與一句說明，現在的那一段浮起來、名稱標朱紅 ── */
.sto-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--sto-radius); background: var(--tbc-surface); }
.sto-mode { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: var(--tbc-s2) var(--tbc-s3); border-radius: 10px; color: var(--tbc-ink-2); text-decoration: none; }
.sto-mode:hover { color: var(--tbc-ink); }
.sto-mode:focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: 1px; }
.sto-mode[aria-current="page"] { background: var(--tbc-raised); color: var(--tbc-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.sto-mode__k { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; line-height: 1.4; }
.sto-mode__k .tbc-icon { width: 18px; height: 18px; }
.sto-mode[aria-current="page"] .sto-mode__k { color: var(--tbc-accent); }
.sto-mode__d { font-size: 12px; line-height: 1.5; color: var(--tbc-ink-3); }

/* ── 任務模式的進度：設定集 → 細綱 → 寫 → 校對 → 上架。步驟條（圓點連成一條線，不是一排按鈕卡）：窄的畫面直排、寬的橫排；
   每一格是連結（按了到那一步還沒做完的地方），現在該做的那一步標朱紅 ── */
.sto-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sto-step { position: relative; min-width: 0; }
.sto-step__go { position: relative; z-index: 1; display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-areas: "dot k" ". d"; align-items: center; gap: 0 var(--tbc-s3); min-height: 44px; padding: var(--tbc-s2); border-radius: 10px; color: var(--tbc-ink); text-decoration: none; }
/* 每一格是連到那一步的連結：滑過名稱加底線、按下圓點縮一下，不畫整格的底色（橫排時整格很寬，底色框會偏到右邊的空白） */
@media (hover: hover) { .sto-step__go:hover .sto-step__k { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } }
.sto-step__go:active .sto-step__dot { transform: scale(.88); }
.sto-step__go:focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: 2px; }
/* 連起各步的線：從這一步的圓點接到下一步的圓點；做完的那一段深色 */
.sto-step:not(:last-child)::after { content: ''; position: absolute; left: calc(var(--tbc-s2) + 10px); top: calc(var(--tbc-s2) + 22px); bottom: calc(-1 * var(--tbc-s2)); width: 2px; background: var(--tbc-line); }
.sto-step.is-done:not(:last-child)::after { background: var(--tbc-ink-3); }
.sto-step__dot { grid-area: dot; position: relative; z-index: 1; transition: transform .12s ease; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tbc-paper); box-shadow: inset 0 0 0 1.5px var(--tbc-line); color: var(--tbc-paper); }
.sto-step__dot .tbc-icon { width: 14px; height: 14px; stroke-width: 2.6; }
.sto-step__k { grid-area: k; font-weight: 700; font-size: 14px; line-height: 1.4; }
.sto-step__d { grid-area: d; font-size: 12px; line-height: 1.45; color: var(--tbc-ink-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sto-step.is-done .sto-step__dot { background: var(--tbc-ink); box-shadow: none; }
.sto-step.is-now .sto-step__dot { box-shadow: inset 0 0 0 2px var(--tbc-accent), 0 0 0 3px var(--tbc-accent-soft); }
.sto-step.is-now .sto-step__k { color: var(--tbc-accent); }
.sto-step__opt { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--tbc-surface); color: var(--tbc-ink-3); font-size: 11px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
@media (min-width: 720px) {
  .sto-steps { flex-direction: row; }
  .sto-step { flex: 1 1 0; }
  .sto-step__go { grid-template-columns: minmax(0, 1fr); grid-template-areas: "dot" "k" "d"; justify-items: start; align-content: start; gap: var(--tbc-s1); width: fit-content; max-width: 100%; box-sizing: border-box; }
  .sto-step:not(:last-child)::after { left: calc(var(--tbc-s2) + 26px); right: calc(4px - var(--tbc-s2)); top: calc(var(--tbc-s2) + 10px); bottom: auto; width: auto; height: 2px; }
}

/* ── 任務模式的三個折疊區：下一步、校對這一單元、一路寫下去（同時只開一個）── */
.sto-taskboxes { display: flex; flex-direction: column; gap: var(--tbc-s2); }
.sto-taskbox { border: 1px solid var(--tbc-line); border-radius: var(--sto-radius); background: var(--tbc-raised); }
.sto-taskbox[open] { background: var(--tbc-surface); border-color: transparent; }
.sto-taskbox__sum { display: flex; align-items: center; gap: var(--tbc-s2); min-height: 48px; padding: 0 var(--tbc-s4); cursor: pointer; font-weight: 700; color: var(--tbc-ink); list-style: none; }
.sto-taskbox__sum::-webkit-details-marker { display: none; }
.sto-taskbox__t { display: inline-flex; align-items: center; gap: var(--tbc-s2); }
.sto-taskbox__t .tbc-icon { width: 22px; height: 22px; color: var(--tbc-ink-2); }
.sto-taskbox__sum::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--tbc-ink-3); border-bottom: 2px solid var(--tbc-ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.sto-taskbox[open] > .sto-taskbox__sum::after { transform: rotate(-135deg) translate(-2px, -2px); }
.sto-taskbox__sum:focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: -2px; border-radius: var(--sto-radius); }
.sto-taskbox__body { padding: 0 var(--tbc-s4) var(--tbc-s4); }
/* 開書表單最下面的「一路寫下去」：跟任務模式打開的那一塊同一個樣子，固定打開、不能收 */
.sto-taskbox--static { margin-top: var(--tbc-s2); background: var(--tbc-surface); }
.sto-taskbox--static > .sto-taskbox__sum { cursor: default; }
.sto-taskbox--static > .sto-taskbox__sum::after { content: none; }
/* 連到別頁的一張卡（進階裡的共用設定）：整張可按，名稱加底線是滑過的回饋 */
.sto-linkcard { display: flex; align-items: center; gap: var(--tbc-s3); min-height: 56px; color: var(--tbc-ink); text-decoration: none; }
.sto-linkcard > .tbc-icon { flex: none; width: 20px; height: 20px; color: var(--tbc-ink-2); }
.sto-linkcard__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sto-linkcard__t { font-weight: 700; }
.sto-linkcard__d { font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.sto-linkcard:hover .sto-linkcard__t { text-decoration: underline; text-underline-offset: 3px; }
.sto-linkcard:focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: 2px; }
@media (min-width: 720px) { .sto-taskbox__body { padding: 0 var(--tbc-s5) var(--tbc-s4); } .sto-taskbox__sum { padding: 0 var(--tbc-s5); } }
@media (prefers-reduced-motion: reduce) { .sto-taskbox__sum::after, .sto-step__dot { transition: none; } }

/* ── 從進度按過來的落點：捲到分頁列下面看得到，淡淡標一下 ── */
.tbc-studio [data-at] { scroll-margin-top: 120px; }
.tbc-studio .is-landed { animation: sto-landed 2.4s ease-out 1; }
@keyframes sto-landed { from { box-shadow: 0 0 0 3px var(--tbc-accent-soft); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .tbc-studio .is-landed { animation: none; box-shadow: 0 0 0 3px var(--tbc-accent-soft); } }

/* ── 會讓 AI 開始跑的地方（MarkuUI 的 MarkuAiRun）：說明、設定、選模型與主要按鈕、用量 ── */
.sto-send > * + * { margin-top: var(--tbc-s2); }
.tbc-studio .Marku-AiRun { --marku-color-font-default-main: var(--tbc-ink); --marku-color-font-default-support: var(--tbc-ink-2); }
.tbc-studio .Marku-AiRunDescription { font-size: 14px; line-height: 1.65; }
.tbc-studio .Marku-AiRunRow > .sto-field, .tbc-studio .Marku-AiRunRow > .sto-check-field { margin-top: 0; }
.tbc-studio .Marku-AiRunGo .sto-planchip { background: rgba(255, 255, 255, .22); color: inherit; }
/* 窄的畫面主要按鈕的字換成兩行時兩行一樣長（不剩一個字在第二行；按鈕的字只有一兩行） */
.tbc-studio .Marku-AiRunGo > span { text-wrap: balance; }
.tbc-studio .Marku-AiRunUsage > * + * { margin-top: var(--tbc-s1); }
.tbc-studio .Marku-AiRunUsage .sto-help, .tbc-studio .Marku-AiRunUsage .sto-charge { margin: 0; }
.sto-bible-todo .sto-h3 { margin: 0 0 var(--tbc-s2); }
.sto-send__why { margin: 0; font-size: 14px; line-height: 1.65; color: var(--tbc-ink-2); }
.sto-send__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2) var(--tbc-s3); }
.sto-send__row > .tbc-btn { flex: 0 1 auto; max-width: 100%; }
.sto-send__row > .tbc-btn span { overflow-wrap: anywhere; }
.sto-send__est { margin: 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); line-height: 1.6; font-variant-numeric: tabular-nums; }
.sto-send__est > * + * { margin-top: 2px; }
.sto-send__fits { margin: 0; }
.sto-send .sto-notice { margin-top: var(--tbc-s3); }
.sto-send .sto-charge { margin-top: var(--tbc-s2); }
.sto-links__gap { display: inline-flex; align-items: center; min-height: 36px; padding: 0 2px; color: var(--tbc-ink-3); }
.sto-planchip { margin-left: var(--tbc-s2); padding: 1px 8px; border-radius: 999px; background: var(--tbc-accent-soft); color: var(--tbc-accent); font-size: 12px; font-weight: 700; }
.tbc-btn--primary .sto-planchip { background: rgba(255, 255, 255, .22); color: inherit; }
.sto-select--s { min-height: 44px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
/* 選模型與「用什麼付」（MarkuUI 的 MarkuModelPicker）：下拉、選單與開關的外框、底照請看下回的線與紙色（工作室其他地方的 MarkuUI 卡片是提醒的顏色）。
   會讓 AI 開始跑的地方收成主要按鈕左邊的小鈕（Menu：金鑰或積木的圖示加級別，下拉才列完整的模型），比主要按鈕次要；「進階」的這本書的模型自己排成一塊 */
.tbc-studio .Marku-ModelPicker { --marku-color-default-border: var(--tbc-line); --marku-color-default-block: var(--tbc-surface);
  --marku-color-default-surface: var(--tbc-paper); --marku-border-radius-card: 10px; }
.sto-bookmodel .sto-help { margin-top: var(--tbc-s1); }
.sto-keystop { display: flex; flex-direction: column; gap: var(--tbc-s2); }
.sto-keystop__done { margin: 0; color: var(--tbc-ink-2); font-size: var(--tbc-fs-small); }

/* ── 寫的過程：每一步一張卡 ── */
.sto-items-run { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; display: grid; gap: var(--tbc-s2); }
.sto-itemcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "m t s" "m go go"; align-items: center; gap: 2px var(--tbc-s3); min-height: 48px; padding: var(--tbc-s2) var(--tbc-s3); border: 1px solid var(--tbc-line); border-radius: 10px; background: var(--tbc-paper); font-size: 14px; color: var(--tbc-ink-3); }
.sto-itemcard__mark { grid-area: m; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--tbc-line); }
.sto-itemcard__mark .tbc-icon { width: 13px; height: 13px; stroke-width: 2.6; }
.sto-itemcard__t { grid-area: t; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sto-itemcard__s { grid-area: s; font-size: 12px; text-align: right; }
.sto-itemcard__go { grid-area: go; justify-self: start; display: inline-flex; align-items: center; min-height: 32px; color: var(--tbc-accent); font-weight: 700; text-decoration: none; }
.sto-itemcard.is-running { border-color: var(--tbc-accent); color: var(--tbc-ink); }
.sto-itemcard.is-running .sto-itemcard__mark { box-shadow: inset 0 0 0 1.5px var(--tbc-accent); }
.sto-itemcard.is-done { color: var(--tbc-ink); }
.sto-itemcard.is-done .sto-itemcard__mark { background: var(--tbc-ink); color: var(--tbc-paper); box-shadow: none; }
.sto-itemcard.is-failed, .sto-itemcard.is-stopped { color: var(--sto-warn); }

/* ── 設定集照文件排好（不顯示 Markdown 的符號）── */
.sto-doc__body { margin-top: var(--tbc-s4); }
.sto-seg { position: relative; padding: var(--tbc-s1) 48px var(--tbc-s1) 0; }
.sto-seg + .sto-seg { margin-top: var(--tbc-s2); }
.sto-seg.is-author, .sto-seg.is-locked { padding-left: var(--tbc-s3); border-left: 3px solid var(--tbc-line); }
.sto-seg.is-author { border-left-color: var(--tbc-ink-3); }
.sto-seg.is-locked { border-left-color: var(--sto-warn-line); }
.sto-seg__tags { display: flex; flex-wrap: wrap; gap: var(--tbc-s1); margin: 0 0 var(--tbc-s1); }
.sto-seg__tags .tbc-tag .tbc-icon { width: 12px; height: 12px; margin-right: 2px; vertical-align: -1px; }
.sto-seg__lock { position: absolute; right: 0; top: 0; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--tbc-ink-3); cursor: pointer; }
.sto-seg__lock:hover { background: var(--tbc-surface); color: var(--tbc-ink); }
.sto-seg__lock[aria-pressed="true"] { color: var(--sto-warn); }
.sto-seg__lock .tbc-icon { width: 18px; height: 18px; }
.sto-seg__lock[disabled] { opacity: .4; cursor: not-allowed; }
.sto-md { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.sto-md > :first-child { margin-top: 0; }
.sto-md > :last-child { margin-bottom: 0; }
.sto-md p, .sto-md ul, .sto-md ol, .sto-md blockquote, .sto-md .sto-md__table { margin: var(--tbc-s2) 0; }
.sto-md ul, .sto-md ol { padding-left: 1.4em; }
.sto-md li + li { margin-top: 4px; }
.sto-md__h { margin: var(--tbc-s3) 0 var(--tbc-s1); font-family: var(--tbc-font-serif); letter-spacing: .04em; line-height: 1.45; }
h2.sto-md__h { font-size: 22px; }
h3.sto-md__h { font-size: 18px; }
h4.sto-md__h, h5.sto-md__h, h6.sto-md__h { font-size: 16px; }
.sto-md blockquote { padding: var(--tbc-s2) var(--tbc-s3); border-left: 3px solid var(--tbc-accent); border-radius: 0 8px 8px 0; background: var(--tbc-surface); color: var(--tbc-ink-2); }
.sto-md hr { border: 0; border-top: 1px dashed var(--tbc-line); margin: var(--tbc-s4) 0; }
.sto-md code { padding: 1px 5px; border-radius: 5px; background: var(--tbc-surface); font-size: .92em; }
.sto-md__table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sto-md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sto-md th, .sto-md td { padding: 8px 10px; border-bottom: 1px solid var(--tbc-line); text-align: left; vertical-align: top; }
.sto-md th { font-weight: 700; color: var(--tbc-ink-2); white-space: nowrap; }
.sto-lockhelp { display: flex; align-items: center; gap: var(--tbc-s2); }
.sto-lockhelp .tbc-icon { flex: none; width: 15px; height: 15px; }

/* ── 建議：照建議改、不用；一次照好幾則改 ── */
.sto-suggest { border-color: var(--sto-warn-line); }
.sto-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: var(--tbc-s1); padding: 0 6px; border-radius: 999px; background: var(--sto-warn-bg); color: var(--sto-warn); font-size: 12px; vertical-align: 1px; }
.sto-suggest__list { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-suggest__item { padding: var(--tbc-s3) 0; border-top: 1px solid var(--tbc-line); }
.sto-suggest__item .sto-actions { margin-top: var(--tbc-s2); }
.sto-suggest__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s1) var(--tbc-s2); margin: 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-3); }
.sto-suggest__detail { margin: var(--tbc-s2) 0 0; line-height: 1.7; }
.sto-suggest__row { display: flex; gap: var(--tbc-s2); margin: var(--tbc-s1) 0 0; font-size: 14px; line-height: 1.65; }
.sto-suggest__row .sto-change__k { flex: none; }
.sto-versions__sum { display: flex; align-items: center; gap: var(--tbc-s2); min-height: 44px; cursor: pointer; list-style: none; }
.sto-versions__sum::-webkit-details-marker { display: none; }
.sto-versions__sum .tbc-icon { width: 18px; height: 18px; color: var(--tbc-ink-2); }

/* ── 單元與細綱：讀的樣子、誰寫的、照意見改 ── */
.sto-plans--read .sto-plan { padding: var(--tbc-s3) 0; }
.sto-plan__read { min-width: 0; }
.sto-plan__t { margin: 0; font-weight: 700; line-height: 1.5; }
.sto-plan__t .tbc-tag { margin-left: var(--tbc-s1); vertical-align: 1px; }
.sto-plan__p { margin: 4px 0 0; font-size: 14px; line-height: 1.75; color: var(--tbc-ink-2); }
@media (min-width: 720px) { .sto-plans--read .sto-plan__n { padding-top: 2px; } }
.sto-revise { margin-top: var(--tbc-s4); padding-top: var(--tbc-s3); border-top: 1px dashed var(--tbc-line); }
.sto-revise .sto-send { margin-top: var(--tbc-s2); }
.sto-unit__body > .sto-send { margin-top: var(--tbc-s4); }
.sto-plans__empty .sto-send { margin-top: var(--tbc-s3); }
.sto-plans__empty .Marku-AiRunBar { justify-content: center; }

/* ── 稿：不是現在的語言、寫哪幾回 ── */
.sto-relang .sto-h3 { display: flex; align-items: center; gap: var(--tbc-s2); }
.sto-relang__list { list-style: none; margin: var(--tbc-s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--tbc-s4); }
.sto-range-card > .sto-help { margin-top: var(--tbc-s2); }
.sto-tag--lang { color: var(--tbc-ink-2); background: none; box-shadow: inset 0 0 0 1px var(--tbc-ink-3); }

/* ── 上架：一次改好幾回的開放方式、頁還在產 ── */
.sto-relbar { flex-wrap: wrap; }
.sto-relbar__batch { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); }
.sto-relbar__batch .sto-select { width: auto; min-width: 9.5em; }
@media (max-width: 420px) {
  .sto-relbar > .tbc-btn, .sto-relbar__batch { flex: 1 1 100%; }
  .sto-relbar__batch .sto-select { flex: 1 1 auto; }
}
.sto-blurb__count.is-over { color: var(--marku-color-danger); font-weight: 700; }

/* ── 進階：書的語言、直接改設定集 ── */
.sto-lang .sto-h2 { display: flex; align-items: center; gap: var(--tbc-s2); }
.sto-lang .sto-h2 .tbc-icon { width: 18px; height: 18px; }
.sto-lang__ask { margin-top: var(--tbc-s3); padding: var(--tbc-s3) var(--tbc-s4); border-radius: 12px; background: var(--tbc-surface); }
.sto-lang__ask > * + * { margin-top: var(--tbc-s2); }
.sto-lang__adv { margin-top: var(--tbc-s4); padding-top: var(--tbc-s2); border-top: 1px solid var(--tbc-line); }
.sto-lang__adv > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.sto-doc--edit > .sto-doc__sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--tbc-s2); min-height: 44px; cursor: pointer; list-style: none; }
.sto-doc--edit > .sto-doc__sum::-webkit-details-marker { display: none; }

/* ── 編輯流程（共用設定的一張卡）：整張預設收起，只露出標題與一句說明；展開後四區（寫一回、照意見重寫、照問題改、寫設定集），每一區預設收起，
   露出名稱、預設或自己排的與現在怎麼排的一句。開關是標題裡的按鈕，蓋住整列（::after），箭頭不接點擊（點箭頭也是按到開關），聚焦的框畫在整列上、滑過時名稱加底線；
   不能自己排的四區是一列一列的字（沒有框、沒有開關），看得出打不開 ── */
.sto-flow__sum { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--tbc-s3); }
.sto-flow__sum > :not(.sto-flow__chev) { grid-column: 1; }
.sto-flow__chev { grid-column: 2; pointer-events: none; grid-row: 1 / span 2; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--tbc-ink-3); border-bottom: 2px solid var(--tbc-ink-3); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.sto-flow.is-open > .sto-flow__sum > .sto-flow__chev, .sto-flow__kind.is-open > .sto-flow__sum > .sto-flow__chev { transform: translateY(2px) rotate(-135deg); }
/* 卡的箭頭對著標題那一列（說明有好幾行時不跑到說明旁邊） */
.sto-flow > .sto-flow__sum > .sto-flow__chev { grid-row: 1; }
.sto-flow__toggle { display: inline-flex; align-items: center; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.sto-flow__toggle::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 12px; }
.tbc-studio .sto-flow__toggle:focus-visible { outline: none; }
.tbc-studio .sto-flow__toggle:focus-visible::after { outline: 2px solid var(--tbc-accent); outline-offset: 2px; }
@media (hover: hover) {
  .sto-flow__sum:hover .sto-flow__toggle .sto-flow__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .sto-flow__sum:hover > .sto-flow__chev { border-color: var(--tbc-ink); }
}
.sto-flow__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s1) 0; }
.sto-flow__title .tbc-icon { flex: none; width: 20px; height: 20px; margin-right: var(--tbc-s2); color: var(--tbc-ink-2); }
.sto-flow > .sto-flow__sum > .sto-flow__help { margin-top: var(--tbc-s1); text-wrap: pretty; }
.sto-flow__region > .sto-notice { margin-top: var(--tbc-s4); }
.sto-flow__kinds { display: flex; flex-direction: column; gap: var(--tbc-s2); margin-top: var(--tbc-s4); }
.sto-flow__kind { border: 1px solid var(--tbc-line); border-radius: 12px; background: var(--tbc-raised); }
.sto-flow__kind.is-open { background: var(--tbc-surface); border-color: transparent; }
.sto-flow__kind > .sto-flow__sum { min-height: 48px; padding: var(--tbc-s3) var(--tbc-s4); }
.sto-flow__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s1) var(--tbc-s2); }
.sto-flow__say { margin: 2px 0 0; color: var(--tbc-ink-2); font-size: var(--tbc-fs-small); line-height: 1.6; text-wrap: pretty; }
/* 打開的那一區底色換成淡底：「自己排的」標籤換成卡的底色，才看得出是標籤 */
.sto-flow__kind.is-open .sto-tag--draft { background: var(--tbc-raised); }
.sto-flow__kinds.is-static { gap: 0; margin-top: var(--tbc-s3); }
.sto-flow__kinds.is-static > .sto-flow__kind { border: 0; border-radius: 0; background: none; }
.sto-flow__kinds.is-static > .sto-flow__kind + .sto-flow__kind { border-top: 1px solid var(--tbc-line); }
.sto-flow__kinds.is-static > .sto-flow__kind > .sto-flow__sum { padding: var(--tbc-s3) 0; }
/* 打開的那一區：這一種是什麼、排法（每一次一格，格裡是合在同一次做的角色；「分開」「合起來」在格裡與格之間）、跳過與幾輪、改回預設、讓 AI 記住讀過的內容 */
.sto-flow__body { margin: 0 var(--tbc-s4); padding: var(--tbc-s3) 0 var(--tbc-s4); border-top: 1px solid var(--tbc-line); }
.sto-flow__body[hidden] { display: none; }
.sto-flow__body > * + * { margin-top: var(--tbc-s3); }
.sto-flow__what { margin: 0; }
.sto-flow__passes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); }
.sto-flow__step { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); min-width: 0; max-width: 100%; }
/* 手機上每一次一列：「合起來」排在那一次的前面，不會有一顆鈕單獨掛在上一列的尾巴 */
@media (max-width: 599px) { .sto-flow__step { flex: 1 1 100%; flex-wrap: nowrap; align-items: flex-start; } .sto-flow__join { flex: none; } .sto-flow__pass { flex: 1 1 auto; } }
.sto-flow__pass { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--tbc-s2); min-width: 0; max-width: 100%; min-height: 54px; padding: 4px 10px 4px 8px; border: 1px solid var(--tbc-line); border-radius: 14px; background: var(--tbc-raised); }
.sto-flow__no { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--tbc-ink); color: var(--tbc-paper); font-size: 12px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.sto-flow__roles { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sto-flow__role { padding: 5px 12px; border-radius: 999px; background: var(--tbc-surface); color: var(--tbc-ink); font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
/* 按得到的範圍 44px 高；看得到的是裡面的虛線小膠囊 */
.sto-flow__cut, .sto-flow__join { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--tbc-ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sto-flow__pill { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 1px dashed var(--tbc-ink-3); border-radius: 999px; }
.sto-flow__pill .tbc-icon { width: 14px; height: 14px; }
.sto-flow__cut:hover .sto-flow__pill, .sto-flow__join:hover .sto-flow__pill { border-color: var(--tbc-accent); border-style: solid; color: var(--tbc-accent); background: var(--tbc-accent-soft); }
.tbc-studio .sto-flow__cut:focus-visible, .tbc-studio .sto-flow__join:focus-visible { outline: none; }
.tbc-studio .sto-flow__cut:focus-visible .sto-flow__pill, .tbc-studio .sto-flow__join:focus-visible .sto-flow__pill { outline: 2px solid var(--tbc-accent); outline-offset: 2px; }
.sto-flow__opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 var(--tbc-s4); }
.sto-flow__body > .sto-flow__opts { margin-top: var(--tbc-s1); }
.sto-flow__opts .sto-check-field { margin-top: var(--tbc-s2); }
.sto-flow__opts .sto-field { flex: 0 1 220px; margin-top: var(--tbc-s2); }
.sto-flow__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--tbc-s2) var(--tbc-s3); }
.sto-flow__foot .sto-help { margin: 0; }
.sto-flow__cache { padding-top: var(--tbc-s3); border-top: 1px solid var(--tbc-line); }
.sto-flow__cache .sto-field { margin-top: 0; }
.sto-flow > .sto-notice { margin-top: var(--tbc-s3); }
@media (prefers-reduced-motion: reduce) { .sto-flow__chev { transition: none; } }
.sto-checkline .sto-planchip { margin-left: 0; }
.sto-checkline input:disabled + span { color: var(--tbc-ink-3); }

/* ── 改了設定之後：先問要不要一併處理、一併處理暫停 ── */
.sto-impact { border-color: var(--tbc-accent); box-shadow: inset 4px 0 0 var(--tbc-accent); }
.sto-impact > * + * { margin-top: var(--tbc-s3); }
.sto-impact > .sto-h2 + .sto-sub { margin-top: var(--tbc-s2); }
.sto-impact--paused { border-color: var(--sto-warn-line); background: var(--sto-warn-bg); box-shadow: inset 4px 0 0 var(--sto-warn); }
.sto-impact__t { display: flex; align-items: flex-start; gap: var(--tbc-s2); }
.sto-impact__t .tbc-icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--sto-warn); }
.sto-impact--paused > .sto-help { margin-top: var(--tbc-s1); }
.sto-swaps { list-style: none; margin: var(--tbc-s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--tbc-s2); }
.sto-swap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 12px; border-radius: 999px; background: var(--tbc-surface); font-size: 14px; }
.sto-swap del { color: var(--tbc-ink-3); overflow-wrap: anywhere; }
.sto-swap ins { color: var(--tbc-ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.sto-swap .tbc-icon { flex: none; width: 14px; height: 14px; color: var(--tbc-ink-3); }
.sto-impact__choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s3); }
@media (min-width: 720px) { .sto-impact__choices { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.sto-impact__choice { padding: var(--tbc-s3) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: 12px; background: var(--tbc-paper); }
.sto-impact__choice > * + * { margin-top: var(--tbc-s2); }
.sto-impact__choice .sto-check-field { margin-top: var(--tbc-s2); }
.sto-impact__choice .sto-actions { margin-top: var(--tbc-s3); }
.sto-impact__cost { margin: var(--tbc-s2) 0 0; padding-left: 1.2em; font-size: var(--tbc-fs-small); color: var(--tbc-ink); line-height: 1.7; font-variant-numeric: tabular-nums; }

/* ── 狀態：追蹤的項目分現值與累積（累積的列出每一筆與第幾回）── */
.sto-track__body { flex: 1; min-width: 0; }
/* 手機上「拿掉」放到項目的下面，欄位與每一筆用整個寬 */
@media (max-width: 599px) { .sto-item.sto-track { flex-direction: column; } .sto-item.sto-track > .tbc-btn { margin-top: 0; align-self: flex-end; } }
.sto-track__body > .sto-grid2 .sto-field { margin-top: 0; }
@media (max-width: 599px) { .sto-track__body > .sto-grid2 .sto-field + .sto-field { margin-top: var(--tbc-s3); } }
.sto-entries { margin-top: var(--tbc-s3); padding: var(--tbc-s3); border-radius: 12px; background: var(--tbc-surface); }
.sto-entries__k { margin: 0 0 var(--tbc-s2); font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .04em; color: var(--tbc-ink-2); }
.sto-entries__list { list-style: none; margin: 0; padding: 0; }
/* 窄的畫面第幾回在上一行、內容在下一行；寬的一行排完 */
.sto-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n x" "t x"; align-items: center; gap: 0 var(--tbc-s2); padding: 6px 0; border-bottom: 1px solid var(--tbc-line); font-size: 14px; line-height: 1.6; }
@media (min-width: 600px) { .sto-entry { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "n t x"; gap: var(--tbc-s2) var(--tbc-s3); padding: 4px 0; } }
.sto-entry:last-child { border-bottom: 0; }
.sto-entry__n { grid-area: n; color: var(--tbc-ink-2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sto-entry__t { grid-area: t; min-width: 0; overflow-wrap: anywhere; color: var(--tbc-ink); }
.sto-entry__t .tbc-tag { vertical-align: 1px; }
.sto-entry__x { grid-area: x; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--tbc-ink-3); cursor: pointer; }
.sto-entry__x:hover { background: var(--tbc-paper); color: var(--tbc-accent); }
.sto-entry__x .tbc-icon { width: 16px; height: 16px; }
.sto-entries > .sto-link { margin-top: 0; }
.sto-entry-add { display: grid; grid-template-columns: minmax(0, 5.5em) minmax(0, 1fr); align-items: end; gap: var(--tbc-s2); margin-top: var(--tbc-s2); }
.sto-entry-add .sto-field { margin-top: 0; }
.sto-entry-add > .tbc-btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 600px) {
  .sto-entry-add { grid-template-columns: minmax(0, 6em) minmax(0, 1fr) auto; }
  .sto-entry-add > .tbc-btn { grid-column: auto; }
}

/* ── 分類設定：照種類分組，一筆一張；一字不差沿用的原文照內文的字排，之後的變化列在底下 ── */
.sto-records > .sto-notice { margin-top: var(--tbc-s3); }
.sto-records__tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--tbc-s3); margin-top: var(--tbc-s3); }
@media (min-width: 600px) { .sto-records__tools { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .sto-records__tools .sto-field { margin-top: 0; } }
.sto-recs { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; }
.sto-rec { padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); }
.sto-rec:last-child { border-bottom: 0; }
.sto-rec.is-editing { padding: var(--tbc-s3); margin: var(--tbc-s2) 0; border: 1px solid var(--tbc-accent); border-radius: 12px; }
.sto-rec__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s1) var(--tbc-s2); }
.sto-rec__name { font-weight: 700; color: var(--tbc-ink); overflow-wrap: anywhere; }
.sto-rec__meta { color: var(--tbc-ink-2); font-size: 13px; }
.sto-rec__head > .tbc-btn { margin-left: auto; }
.sto-rec__text { margin: var(--tbc-s2) 0 0; padding: var(--tbc-s2) var(--tbc-s3); border-left: 3px solid var(--tbc-ink-3); border-radius: 0 10px 10px 0; background: var(--tbc-surface); font-family: var(--tbc-font-serif); font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.sto-rec__detail { margin: var(--tbc-s2) 0 0; color: var(--tbc-ink-2); font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.sto-rec__written { margin: 4px 0 0; font-size: 13px; color: var(--tbc-ink); }
.sto-rec__written span { margin-right: var(--tbc-s2); color: var(--tbc-ink-2); }
.sto-recform .sto-grid3 .sto-field:first-child { margin-top: 0; }
@media (min-width: 600px) { .sto-recform .sto-grid3 .sto-field { margin-top: 0; } }
.sto-recadd { margin-top: var(--tbc-s3); padding-top: var(--tbc-s3); border-top: 1px dashed var(--tbc-line); }
.sto-recadd > .sto-h3 { margin-bottom: var(--tbc-s3); }
.sto-recadd__list { list-style: none; margin: 0 0 var(--tbc-s3); padding: 0; }
.sto-recadd__item { display: flex; align-items: flex-start; gap: var(--tbc-s2); padding: var(--tbc-s3) 0; border-bottom: 1px dashed var(--tbc-line); }
.sto-recadd__item:first-child { padding-top: 0; }
.sto-recadd__item > .sto-recform { flex: 1; min-width: 0; }
.sto-recadd__item > .tbc-btn { margin-top: 26px; }
.sto-revise-card .sto-send { margin-top: var(--tbc-s3); }
.sto-organize > .sto-help { margin: var(--tbc-s1) 0 0; }
.sto-organize .sto-send { margin-top: var(--tbc-s3); }
.sto-organize--inline { margin-top: var(--tbc-s3); padding: var(--tbc-s3); border: 1px solid var(--tbc-line); border-radius: 12px; background: var(--tbc-surface); }
.sto-organize__t { display: flex; align-items: flex-start; gap: var(--tbc-s2); margin: 0; font-weight: 600; line-height: 1.6; }
.sto-organize__t .tbc-icon { flex: none; margin-top: 3px; }
.sto-organize--inline .sto-send { margin-top: var(--tbc-s2); }
.sto-entry-card__foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--tbc-s2); margin-top: var(--tbc-s2); }
.sto-entry-card__foot > .sto-costume { flex: 1 1 auto; margin-top: 0; }
.sto-entry-card__foot > .tbc-btn { margin-left: auto; }
.sto-records__through { display: flex; align-items: center; gap: var(--tbc-s1); margin: var(--tbc-s2) 0 0; }
.sto-kindgroup { margin-top: var(--tbc-s4); }
.sto-kindgroup__h { display: flex; align-items: baseline; gap: var(--tbc-s2); margin: 0; padding-bottom: var(--tbc-s1); border-bottom: 2px solid var(--tbc-line); font-family: var(--tbc-font-serif); letter-spacing: .04em; }
.sto-kindgroup__n { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--tbc-ink-3); }
.sto-kindgroup > .sto-recs { margin-top: 0; }
.sto-entry-card .sto-rec__name { font-family: var(--tbc-font-serif); font-size: 17px; letter-spacing: .04em; }
.sto-entry-card__sum { margin: var(--tbc-s1) 0 0; color: var(--tbc-ink); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.sto-entry-card__k { display: inline-block; margin-right: var(--tbc-s2); color: var(--tbc-ink-2); font-size: 13px; font-weight: 600; }
.sto-entry-card__attrs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--tbc-s3); margin: var(--tbc-s2) 0 0; font-size: 14px; line-height: 1.6; }
.sto-entry-card__attrs dt { color: var(--tbc-ink-2); }
.sto-entry-card__attrs dd { margin: 0; overflow-wrap: anywhere; }
.tbc-studio .sto-entry-card__rel { min-height: 0; margin: 0; padding: 0; font-size: inherit; font-weight: 600; }
.sto-entry-card__seen { margin: var(--tbc-s2) 0 0; }
.sto-entry-card__changes { margin-top: var(--tbc-s3); }
.sto-changes { list-style: none; margin: var(--tbc-s1) 0 0; padding: 0 0 0 var(--tbc-s3); border-left: 3px solid var(--tbc-line); }
.sto-change { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--tbc-s2); padding: var(--tbc-s1) 0; font-size: 14px; line-height: 1.6; }
.sto-change__at { flex: none; color: var(--tbc-ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.sto-change__t { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.sto-change__q { margin-left: var(--tbc-s1); font-family: var(--tbc-font-serif); color: var(--tbc-ink-2); }
.sto-change__acts { display: flex; gap: var(--tbc-s1); margin-left: auto; }
.sto-change.is-editing { display: block; padding: var(--tbc-s2); border: 1px solid var(--tbc-accent); border-radius: 10px; }

/* ── 插圖與書封：上架那一頁的書封、挑書封、分類設定裡人物的定裝 ── */
.sto-cover__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--tbc-s4); margin-top: var(--tbc-s3); }
.sto-cover__frame { flex: none; width: 132px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--tbc-surface); box-shadow: var(--tbc-shadow); }
.sto-cover__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sto-cover__frame .sto-book__cover { width: 100%; height: 100%; border-radius: 0; }
.sto-cover__frame .sto-book__cover-t { font-size: 22px; }
.sto-cover__frame .sto-book__cover.is-two .sto-book__cover-t { font-size: 19px; }
.sto-cover__frame .sto-book__cover.is-three .sto-book__cover-t { font-size: 16px; }
.sto-cover__frame .sto-book__cover.is-four .sto-book__cover-t { font-size: 13px; }
.sto-cover__frame .sto-book__cover.is-latin { padding: 14px 12px 28px; }
.sto-cover__frame .sto-book__cover-latin { max-height: 112px; font-size: 15px; }
.sto-cover__frame .sto-book__seal { left: 12px; bottom: 12px; width: 12px; height: 12px; }
.sto-cover__side { flex: 1; min-width: 200px; }
.sto-cover__side > .sto-help { margin: 0 0 var(--tbc-s2); }
.sto-cover__side .sto-actions { margin-top: var(--tbc-s3); }
.sto-cover__side .sto-notice { margin-top: var(--tbc-s3); }
.sto-dialog--wide { max-width: 640px; max-height: calc(100vh - 2 * var(--tbc-s4)); overflow-y: auto; }
.sto-pick { list-style: none; margin: var(--tbc-s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--tbc-s2); }
.sto-pick__tile { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--tbc-surface); cursor: pointer; }
.sto-pick__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sto-pick__tile:hover, .sto-pick__tile:focus-visible { border-color: var(--tbc-accent); }
.sto-pick__tile.is-current { border-color: var(--tbc-accent); }
.sto-pick__tile[disabled] { cursor: wait; }
.sto-pick__busy { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .35); color: #fff; }
.sto-costume { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s3); margin-top: var(--tbc-s2); }
.sto-costume__pic { display: block; width: auto; max-width: 100%; height: 96px; border-radius: 8px; border: 1px solid var(--tbc-line); background: var(--tbc-surface); object-fit: contain; }
.sto-costume__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); }

/* 不能直接改字的作者看狀態、單元的方向：只列出來（名稱在上、內容在下），跟可以改的版面同一個間距 */
.sto-item--read { display: block; }
/* 撰寫筆記看的樣子：人物、伏筆排成表，欄名只寫一次 */
.sto-readtable { margin-top: var(--tbc-s3); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sto-readtable table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sto-readtable th, .sto-readtable td { padding: var(--tbc-s2) var(--tbc-s3) var(--tbc-s2) 0; border-bottom: 1px solid var(--tbc-line); text-align: left; vertical-align: top; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.sto-readtable th { padding-top: 0; font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .04em; color: var(--tbc-ink-2); white-space: normal; overflow-wrap: normal; }
.sto-readtable tr:last-child td { border-bottom: 0; }
.sto-readtable td:last-child, .sto-readtable th:last-child { padding-right: 0; }
.sto-readtable .is-key { width: 30%; font-weight: 700; }
.sto-readtable .is-num { width: 5.5em; font-variant-numeric: tabular-nums; color: var(--tbc-ink-2); }
.sto-readtable td.is-num { white-space: nowrap; }
.sto-readlist { display: grid; gap: var(--tbc-s3); margin: 0; }
.sto-readlist dt { margin-bottom: var(--tbc-s1); font-size: var(--tbc-fs-small); font-weight: 700; letter-spacing: .04em; color: var(--tbc-ink-2); }
.sto-readlist dd { margin: 0; white-space: pre-wrap; line-height: 1.7; color: var(--tbc-ink); }
@media (min-width: 720px) { .sto-item--read:not(.sto-track) .sto-readlist { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.sto-item--read .sto-entries { margin-top: var(--tbc-s3); }
.sto-readtext { margin: 0; white-space: pre-wrap; line-height: 1.7; color: var(--tbc-ink); }
