/* =============================================================
   出版＋ 設計系統
   1. 變數  2. 基礎  3. 元件  4. 前台  5. 後台  6. 手機
   ============================================================= */

/* ---- 1. 變數 ------------------------------------------------ */
:root {
    /* 品牌色：取自印章 */
    --paper: #f5f0e6;        /* 紙：頁面底色 */
    --sheet: #fffdf8;        /* 宣紙白：卡片、表格、輸入框 */
    --ink: #2a2724;          /* 墨：主要文字 */
    --ink-2: #4a443e;        /* 次要文字 */
    --muted: #6b625a;        /* 說明文字（在紙色上對比 5.3:1） */
    --line: #e3dccd;         /* 界線 */
    --line-strong: #cfc5b3;
    --vermilion: #b8471f;    /* 朱：品牌、主要按鈕 */
    --vermilion-dark: #8f3515;
    --vermilion-soft: #f6e4da;

    /* 狀態色：與品牌朱紅區隔，亮度也不同，色弱也分得出來 */
    --ok: #2f6b4f;      --ok-soft: #e3efe7;
    --info: #2c5a7a;    --info-soft: #e1ebf2;
    --warn: #8a5a0b;    --warn-soft: #f6ead2;
    --danger: #a3261c;  --danger-soft: #f7e0dd;
    --neutral-soft: #ece6da;

    /* 管理後台側欄 */
    --ink-panel: #2a2724;
    --ink-panel-2: #3a3530;
    --on-ink: #efe8db;
    --on-ink-muted: #b9ae9f;

    --font-serif: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", serif;
    --font-sans: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif;

    --radius-s: 4px;     /* 輸入框、標籤 */
    --radius-m: 8px;     /* 區塊 */
    --shadow-pop: 0 12px 32px rgba(42, 39, 36, .18);   /* 只用在浮起的對話框、選單 */

    --sidebar: 248px;
    --focus: 0 0 0 3px rgba(184, 71, 31, .35);
}

/* ---- 2. 基礎 ------------------------------------------------ */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.4; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--vermilion); text-underline-offset: 3px; }
a:hover { color: var(--vermilion-dark); }
img, svg { max-width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-s); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.is-ok { color: var(--ok); }
.is-ng { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- 3. 元件 ------------------------------------------------ */

/* 按鈕 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--radius-s);
    font: inherit; font-size: 15px; font-weight: 500; line-height: 1;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--vermilion); color: #fff; }
.btn--primary:hover { background: var(--vermilion-dark); color: #fff; }
.btn--secondary { background: var(--sheet); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--neutral-soft); color: var(--ink); }
.btn--danger { background: var(--sheet); color: var(--danger); border-color: #e2b8b2; }
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* 表單 */
.form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field__required { color: var(--danger); margin-left: 2px; }
.field__help { font-size: 13px; color: var(--muted); line-height: 1.6; }
.field__error { font-size: 13px; color: var(--danger); line-height: 1.6; }
.input, .select, .textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    font: inherit; font-size: 15px; color: var(--ink);
    background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; line-height: 1.7; resize: vertical; }
.select { appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b625a' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--vermilion); box-shadow: var(--focus); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--vermilion); flex: none; }
.choice-group { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
    display: block; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
    background: var(--sheet); font-size: 15px; cursor: pointer;
}
.choice input:checked + span { border-color: var(--vermilion); background: var(--vermilion-soft); color: var(--vermilion-dark); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

/* 上傳區 */
.dropzone {
    display: grid; place-items: center; gap: 6px; padding: 32px 20px; text-align: center;
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius-m); background: var(--sheet);
    cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--vermilion); background: var(--vermilion-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone__title { font-weight: 500; }
.dropzone__file { font-size: 14px; color: var(--vermilion-dark); }

/* 狀態標籤 */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px;
    font-size: 13px; line-height: 22px; font-weight: 500; white-space: nowrap;
    border-radius: 999px; background: var(--neutral-soft); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--brand { background: var(--vermilion-soft); color: var(--vermilion-dark); }

/* 提示訊息 */
.alert {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border-radius: var(--radius-m); border: 1px solid; font-size: 15px; line-height: 1.7;
}
.alert__body { flex: 1; }
.alert__body strong { display: block; }
.alert--ok { background: var(--ok-soft); border-color: #bcd8c7; color: #234f3b; }
.alert--info { background: var(--info-soft); border-color: #bccfdf; color: #22465f; }
.alert--warn { background: var(--warn-soft); border-color: #e6cf9f; color: #6b4608; }
.alert--danger { background: var(--danger-soft); border-color: #e9bdb7; color: #7e1d15; }
.alert__close { margin: -6px -8px -6px 0; min-height: 32px; padding: 0 8px; background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; opacity: .7; }
.alert__close:hover { opacity: 1; }

/* 區塊 */
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel__title { margin: 0; font-size: 17px; }
.panel__body { padding: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 13px; font-weight: 500; color: var(--muted); background: #faf6ee; white-space: nowrap; }
.table tbody tr:hover { background: #fbf8f1; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .is-right { text-align: right; }
.table__title { font-weight: 500; color: var(--ink); text-decoration: none; }
.table__title:hover { color: var(--vermilion); }
.table__sub { display: block; font-size: 13px; color: var(--muted); }

/* 篩選列 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.toolbar__spacer { flex: 1; }

/* 分頁 */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pagination__pages { display: flex; gap: 4px; }
.pagination__pages a, .pagination__pages span {
    display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none;
}
.pagination__pages a:hover { background: var(--neutral-soft); color: var(--ink); }
.pagination__pages .is-current { background: var(--ink); color: var(--paper); }

/* 頁籤 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; padding: 10px 14px; color: var(--muted); margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--ink); border-bottom-color: var(--vermilion); font-weight: 500; }
.tabs button:focus-visible { outline: 2px solid var(--vermilion); outline-offset: -2px; border-radius: 4px 4px 0 0; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--vermilion); font-weight: 500; }

/* 數字摘要 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); }
.stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat__label { font-size: 14px; color: var(--muted); }
.stat__value { font-family: var(--font-serif); font-size: 28px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat__note { font-size: 13px; color: var(--muted); }

/* 空狀態 */
.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; text-align: center; }
.empty__mark { width: 48px; opacity: .35; filter: grayscale(1); }
.empty__title { font-size: 17px; font-weight: 500; margin: 8px 0 0; }
.empty p { color: var(--muted); max-width: 32em; margin: 0 0 8px; }

/* 對話框 */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(42, 39, 36, .45); }
.modal.is-open { display: flex; }
.modal__dialog { width: 100%; max-width: 440px; background: var(--sheet); border-radius: var(--radius-m); box-shadow: var(--shadow-pop); }
.modal__head { padding: 20px 24px 0; }
.modal__title { margin: 0; font-size: 18px; }
.modal__body { padding: 12px 24px 4px; color: var(--ink-2); }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }

/* 定義清單（書籍資料等） */
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 15px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

/* ---- 4. 前台 ------------------------------------------------ */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.site-logo { display: block; line-height: 0; }
.site-logo img { height: 40px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.site-nav a:not(.btn):hover { color: var(--vermilion); }

/* 首頁主視覺：直排標題 */
.hero { border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 64px; padding: 72px 24px 80px; }
.hero__lead { max-width: 30em; font-size: 18px; line-height: 1.9; color: var(--ink-2); margin-bottom: 32px; }
.hero__lead strong { color: var(--ink); font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__formats { margin: 40px 0 0; font-size: 14px; color: var(--muted); }
.hero__vertical { position: relative; display: flex; gap: 20px; padding-right: 8px; }
.hero__title {
    writing-mode: vertical-rl;
    margin: 0;
    font-family: var(--font-serif); font-weight: 900;
    font-size: clamp(40px, 5.4vw, 64px); line-height: 1.6; letter-spacing: .08em;
}
.hero__title span { display: block; }
.hero__title span + span { margin-right: .35em; }
.hero__seal { position: absolute; left: -84px; bottom: 2px; width: 68px; transform: rotate(-4deg); }

.section { padding: 80px 0; }
.section--sheet { background: var(--sheet); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__title { font-family: var(--font-serif); font-size: 30px; font-weight: 700; margin-bottom: 40px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { padding: 0 32px; border-left: 1px solid var(--line); }
.step:first-child { padding-left: 0; border-left: 0; }
.step__no { display: block; font-family: var(--font-serif); font-size: 40px; font-weight: 900; color: var(--vermilion); line-height: 1; margin-bottom: 16px; }
.step h3 { font-size: 19px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.plan { padding: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--paper); }
.plan__name { font-family: var(--font-serif); font-size: 21px; margin-bottom: 4px; }
.plan__who { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.plan__rate { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.plan__rate strong { font-family: var(--font-serif); font-size: 48px; font-weight: 900; color: var(--vermilion); line-height: 1; }
.plan ul { margin: 0; padding-left: 1.2em; color: var(--ink-2); font-size: 15px; }
.note { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* 登入、註冊頁 */
.auth { display: grid; place-items: center; min-height: calc(100vh - 72px - 89px); padding: 48px 20px; }
.auth__card { width: 100%; max-width: 420px; padding: 40px 36px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); }
.auth__mark { display: block; width: 56px; margin: 0 auto 20px; }
.auth__title { text-align: center; font-family: var(--font-serif); font-size: 24px; margin-bottom: 28px; }
.auth__foot { margin-top: 24px; text-align: center; font-size: 15px; color: var(--muted); }
.auth__row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

/* 收費方案選擇 */
.plan-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-choice { position: relative; display: block; cursor: pointer; }
.plan-choice input { position: absolute; opacity: 0; }
.plan-choice__box { display: grid; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--sheet); font-size: 15px; }
.plan-choice__rate { font-family: var(--font-serif); font-size: 22px; font-weight: 900; color: var(--vermilion); }
.plan-choice input:checked + .plan-choice__box { border-color: var(--vermilion); box-shadow: inset 0 0 0 1px var(--vermilion); background: var(--vermilion-soft); }
.plan-choice input:focus-visible + .plan-choice__box { box-shadow: var(--focus); }

/* 上架通路 */
.channel-list { display: grid; gap: 10px; }
.channel { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.channel:hover { border-color: var(--line-strong); }
.channel input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--vermilion); flex: none; }
.channel__body { display: grid; gap: 2px; font-size: 15px; }
.channel__note { font-size: 13px; color: var(--muted); }
.channel.is-disabled-choice { opacity: .55; cursor: not-allowed; }

/* 封面 */
.cover-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.cover-thumb { flex: none; display: grid; place-items: center; width: 120px; aspect-ratio: 5 / 8; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; font-size: 13px; }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 上傳進度 */
.upload-form { display: grid; gap: 12px; justify-items: start; }
.upload-form .dropzone { width: 100%; position: relative; }
.upload-progress { width: 100%; height: 6px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.upload-progress__bar { width: 0; height: 100%; background: var(--vermilion); transition: width .2s; }
.upload-status { margin: 0; }
.upload-status.is-ng { color: var(--danger); }

/* 送出前檢查 */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist__item { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.checklist__item a { color: var(--ink); text-decoration: none; font-weight: 500; }
.checklist__mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 13px; color: #fff; }
.checklist__item.is-done .checklist__mark { background: var(--ok); border-color: var(--ok); }
.checklist__msg { display: block; font-size: 13px; color: var(--danger); }
.submit-aside { position: sticky; top: 24px; }

/* 帳單與匯款資訊 */
.bill-box { border-color: #e6cf9f; }
.bank-info { padding: 12px 14px; border-radius: var(--radius-s); background: var(--paper); font-size: 15px; line-height: 1.8; }

/* 合約全文 */
.contract-text { max-height: 60vh; overflow-y: auto; font-size: 15px; line-height: 1.95; color: var(--ink-2); }
.contract-text p:last-child { margin-bottom: 0; }

/* 錯誤頁 */
.error-page { text-align: center; padding: 120px 0; }
.error-page__code { font-family: var(--font-serif); font-size: 72px; font-weight: 900; color: var(--vermilion); margin: 0; line-height: 1; }
.error-page__message { font-size: 18px; color: var(--ink-2); margin: 16px 0 32px; }

.site-footer { padding: 32px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.copyright a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }
.copyright a:hover { color: var(--vermilion); text-decoration-color: currentColor; }
.app--admin .copyright a { text-decoration-color: var(--ink-panel-2); }
.app--admin .copyright a:hover { color: var(--on-ink); }
.env-badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; }

/* ---- 5. 後台（作者、管理員共用骨架） ---------------------------- */
.app { display: flex; min-height: 100vh; }
.app__sidebar {
    flex: none; width: var(--sidebar); display: flex; flex-direction: column;
    background: var(--sheet); border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app__brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; text-decoration: none; }
.app__brand img { height: 34px; width: auto; }
.app__role { margin: 0 20px 8px; font-size: 13px; color: var(--muted); }
.app__nav { padding: 8px 12px 24px; display: grid; gap: 2px; }
.app__nav-group { margin: 16px 8px 4px; font-size: 13px; color: var(--muted); }
.app__nav a {
    display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
    border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none; font-size: 15px;
}
.app__nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.app__nav a:hover { background: var(--neutral-soft); color: var(--ink); }
.app__nav a.is-active { background: var(--vermilion-soft); color: var(--vermilion-dark); font-weight: 500; }
.app__nav-count { margin-left: auto; font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--vermilion); color: #fff; line-height: 20px; }
.app__sidebar-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app__topbar { display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--paper); }
.app__menu-btn { display: none; }
.app__crumbs { font-size: 14px; color: var(--muted); }
.app__crumbs a { color: var(--muted); text-decoration: none; }
.app__crumbs a:hover { color: var(--vermilion); }
.app__user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.app__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--font-serif); font-weight: 700; font-size: 15px; }
.app__content { padding: 32px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head__title { margin: 0; font-size: 26px; }
.page-head__desc { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.stack > .page-head, .stack > .tabs { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }

/* 管理後台：墨色側欄 */
.app--admin .app__sidebar { background: var(--ink-panel); border-right-color: var(--ink-panel); }
.app--admin .app__role, .app--admin .app__nav-group, .app--admin .app__sidebar-foot { color: var(--on-ink-muted); }
.app--admin .app__sidebar-foot { border-top-color: var(--ink-panel-2); }
.app--admin .app__nav a { color: var(--on-ink); }
.app--admin .app__nav a:hover { background: var(--ink-panel-2); color: #fff; }
.app--admin .app__nav a.is-active { background: var(--vermilion); color: #fff; }
.app--admin .app__nav-count { background: var(--paper); color: var(--ink); }
.app--admin .app__content { max-width: 1440px; }
.app--admin .table th, .app--admin .table td { padding: 10px 14px; font-size: 14px; }

/* 側欄遮罩（手機） */
.app__scrim { display: none; }

/* 轉檔成品 */
.output-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.output-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.output-item:first-child { padding-top: 0; }
.output-item__body { display: grid; gap: 2px; min-width: 0; }
.output-item__body .muted { font-size: 13px; }
.output-item__note { font-size: 13px; color: var(--muted); }
.output-item .btn { flex: none; }
.output-item .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; margin-right: 4px; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--vermilion); border-radius: 50%; animation: pp-spin 1s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* 線上預覽 */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.reader-panel { overflow: hidden; }
/* 工具列盡量排成一列：章節選單可縮短，按鈕緊湊；太窄時（手機）才換行 */
.reader-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.reader-toolbar > * { flex: none; }
.reader-toolbar .seg__item { padding: 6px 10px; white-space: nowrap; }
.reader-toolbar > strong { white-space: nowrap; font-size: 14px; }
.reader-toolbar .reader-select { flex: 1 1 120px; min-width: 96px; width: auto; max-width: 240px; min-height: 34px; padding-top: 4px; padding-bottom: 4px; text-overflow: ellipsis; }
.reader-nav { display: flex; align-items: center; gap: 2px; }
.reader-nav .btn, .reader-zoom .btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.reader-nav.is-rtl { flex-direction: row-reverse; }
.reader-pos { font-size: 13px; min-width: 44px; text-align: center; white-space: nowrap; }
.reader-download { margin-left: auto; font-size: 14px; white-space: nowrap; }
.reader { background: #fff; height: calc(100vh - 300px); min-height: 480px; }
/* 捲動區：放大後內容超出時可上下左右捲動；margin:auto 置中且不會裁掉左上方 */
.reader__stage { position: absolute; inset: 0; overflow: auto; display: flex; }
.reader__stage > * { margin: auto; flex: none; }
.reader__frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.reader__page { max-width: 100%; max-height: 100%; object-fit: contain; display: block; box-shadow: 0 1px 4px rgba(42, 39, 36, .15); }
.reader__page.is-zoomed { max-width: none; max-height: none; }
.reader-zoom { display: flex; align-items: center; gap: 2px; }
.reader-zoom .btn { min-width: 32px; }
.reader-zoom .reader-zoom__level { min-width: 52px; padding-left: 4px; padding-right: 4px; font-size: 13px; }
/* 依預覽區本身的寬度調整：不夠寬時翻頁鈕只留箭頭；再窄（手機）才換行 */
.reader-panel { container-type: inline-size; }
@container (max-width: 700px) { .reader-nav__text { display: none; } }
@container (max-width: 540px) { .reader-toolbar { flex-wrap: wrap; } .reader-download { margin-left: 0; } }
.reader-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg__item { padding: 6px 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg__item + .seg__item { border-left: 1px solid var(--line); }
.seg__item.is-active { background: var(--ink); color: #fff; }
.preview-aside { position: sticky; top: 24px; }
/* 側欄＋說明欄同時出現時預覽區太窄（1024px 只剩約 350px）：1200px 以下說明欄移到預覽下方 */
@media (max-width: 1200px) { .preview-layout { grid-template-columns: minmax(0, 1fr); } .preview-aside { position: static; } }
.quota { margin: 0; }
.quota strong { font-size: 1.3em; color: var(--vermilion-dark); }
.dropzone--compact { padding: 14px 16px; gap: 2px; }
#revise .field { width: 100%; align-self: stretch; }
#revise .textarea { width: 100%; box-sizing: border-box; }

/* 系統設定 */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.settings-aside { position: sticky; top: 24px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 20px; }
.settings-grid__wide { grid-column: 1 / -1; }
.input-unit { display: flex; align-items: stretch; }
.input-unit .input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-unit__suffix { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-s, 4px) var(--radius-s, 4px) 0; background: var(--paper); color: var(--muted); font-size: 14px; white-space: nowrap; }
.input-unit .input:only-child { border-radius: var(--radius-s, 4px); }
.input:disabled, .textarea:disabled { background: var(--paper); color: var(--muted); }

/* 書籍審核、帳單 */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.review-aside { position: sticky; top: 24px; }
.output-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--sheet); }
.output-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.output-card__head .muted { font-size: 13px; }
.output-card__dl { margin-left: auto; font-size: 14px; }
.output-card__notes { margin: 8px 0 0; padding-left: 1.2em; font-size: 14px; color: var(--muted); }
.output-card__check { margin-top: 8px; font-size: 13px; }
.output-card__check summary { cursor: pointer; color: var(--muted); }
.output-card__check ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.timeline > li > .muted:first-child { display: block; font-size: 12px; }
.remit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.remit-form .field { flex: 1; min-width: 160px; }

/* 管理員權限 */
.perm-list { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.perm-list legend { padding: 0; margin-bottom: 6px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sheet); cursor: pointer; }
.perm input { margin-top: 4px; }
.perm > span { display: grid; gap: 2px; }
.perm .muted { font-size: 13px; }
.password-once { display: block; margin: 6px 0; font-size: 20px; letter-spacing: .08em; font-weight: 600; user-select: all; }

/* 通路上架 */
.code-block { margin: 12px 0 0; padding: 12px; max-height: 420px; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12px; line-height: 1.5; white-space: pre; }
.steps-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; }
.kdp-meta dd { word-break: break-word; }
.copy-meta dd { word-break: break-word; }
.copy-meta .copy-val { cursor: copy; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; transition: background-color .15s; }
.copy-meta .copy-val:hover { background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.copy-meta .copy-val.is-copied { background: #e3f1e5; box-shadow: 0 0 0 1px #9ccaa3; }
.copy-tip { margin-left: 8px; font-size: 12px; color: #2f7a3b; white-space: nowrap; }
.listing-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.listing-row__name { display: grid; gap: 2px; }
.listing-row__name a { font-size: 13px; }
.channel-action { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.channel-action > summary { cursor: pointer; font-weight: 500; color: var(--vermilion-dark); }

/* ---- 6. 手機與平板 ------------------------------------------- */
@media (max-width: 960px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(3) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .submit-aside, .preview-aside, .settings-aside, .review-aside { position: static; }
    .review-layout { grid-template-columns: minmax(0, 1fr); }
    .settings-layout { grid-template-columns: minmax(0, 1fr); }
    .preview-layout { grid-template-columns: minmax(0, 1fr); }
    .reader { height: 70vh; min-height: 360px; }
    .reader-download { margin-left: 0; }

    .app__sidebar { position: fixed; z-index: 90; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
    .app.is-nav-open .app__sidebar { transform: none; box-shadow: var(--shadow-pop); }
    .app.is-nav-open .app__scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(42, 39, 36, .35); }
    .app__menu-btn { display: inline-flex; }
    .app__topbar { padding: 0 16px; }
    .app__content { padding: 24px 16px; }
}
@media (max-width: 720px) {
    .site-nav a:not(.btn) { display: none; }
    .hero__inner { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px 56px; }
    .hero__vertical { order: -1; justify-self: center; margin-left: 84px; }
    .hero__title { font-size: 40px; }
    .steps, .plans, .form-row, .plan-choices { grid-template-columns: 1fr; }
    .step { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 24px; }
    .step:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
    .section { padding: 56px 0; }
    .auth__card { padding: 32px 24px; }
    .toolbar .input, .toolbar .select { width: 100%; }
    .pagination { flex-direction: column; }
    .app__user-name { display: none; }
}

/* ---- 銷售報表 ---- */
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat--brand .stat__value { color: var(--vermilion); }
.stat__value small { font-size: 15px; font-weight: 400; color: var(--muted); }
.sales-upload { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 120px; gap: 16px 20px; align-items: start; }
.sales-upload__file { grid-column: 1 / 3; }
.sales-upload__submit { align-self: end; padding-bottom: 2px; }
.sales-period { display: flex; align-items: center; gap: 8px; }
.sales-period .input { min-width: 0; }
.sales-help { margin-top: 16px; font-size: 14px; color: var(--muted); }
.sales-help summary { cursor: pointer; color: var(--ink); }
.sales-help ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.sales-file { word-break: break-all; }
.sales-stats { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.sales-errors { margin: 0 0 12px; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.rate-row .input-unit .input { min-width: 0; }
.unmatched-list { list-style: none; margin: 0; padding: 0; }
.unmatched { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.unmatched__id { font-weight: 600; word-break: break-all; }
.unmatched__form { display: flex; align-items: center; gap: 8px; }
.unmatched__form .input { width: 170px; }
.unmatched__form .check { white-space: nowrap; font-size: 14px; }
.month-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.month-bars__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(120px, auto); gap: 12px; align-items: center; }
.month-bars__label { color: var(--muted); font-size: 14px; }
.month-bars__track { height: 14px; background: var(--neutral-soft); border-radius: 7px; overflow: hidden; }
.month-bars__bar { display: block; height: 100%; min-width: 2px; background: var(--vermilion); border-radius: 7px; }
.month-bars__value { text-align: right; }
@media (max-width: 960px) {
    .stats--3 .stat:nth-child(n+3) { border-top: 0; }
    .unmatched { grid-template-columns: minmax(0, 1fr); }
    .unmatched__form { flex-wrap: wrap; }
}
@media (max-width: 720px) {
    .sales-upload { grid-template-columns: minmax(0, 1fr); }
    .sales-upload__file { grid-column: auto; }
    .stats--3 { grid-template-columns: minmax(0, 1fr); }
    .stats--3 .stat { border-left: 0; border-top: 1px solid var(--line); }
    .stats--3 .stat:first-child { border-top: 0; }
    .unmatched__form .input { flex: 1; width: auto; min-width: 0; }
    .month-bars__row { grid-template-columns: 56px minmax(0, 1fr); }
    .month-bars__value { grid-column: 1 / -1; text-align: left; padding-left: 68px; margin-top: -6px; }
    .sales-filter .input[type="month"] { width: calc(50% - 20px); min-width: 0; }
    .rate-row { grid-template-columns: minmax(0, 1fr); }
}
.table--sales td:first-child { min-width: 11em; }
.table--sales .sales-file { word-break: normal; overflow-wrap: anywhere; }

/* ---- 版稅與請款 ---- */
.royalty-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: start; }
.balance-card__value { font-family: var(--font-serif); font-size: 36px; font-weight: 700; color: var(--vermilion); line-height: 1.3; }
.withdraw-calc { padding: 12px 14px; background: var(--paper); border-radius: var(--radius-m); }
.amount-pos { color: var(--ok); }
.amount-neg { color: var(--danger); }
.row-group td { background: var(--paper); }
.row-sub td:first-child { padding-left: 32px; }
.profile-form { display: grid; gap: 20px; }
@media (max-width: 960px) {
    .royalty-top { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    .app__sidebar, .app__topbar, .page-head .btn, .alert { display: none !important; }
    .app__content { padding: 0; }
}

/* ---- 前台：收費方案說明 ---- */
.pricing-hero { padding-bottom: 48px; }
.pricing-eyebrow { color: var(--vermilion); font-weight: 500; letter-spacing: .1em; margin-bottom: 12px; }
.pricing-title { font-family: var(--font-serif); font-size: 36px; font-weight: 700; line-height: 1.5; margin-bottom: 20px; }
.pricing-lead { max-width: 36em; font-size: 17px; line-height: 1.9; color: var(--ink-2); margin-bottom: 24px; }
.pricing-sub { max-width: 44em; color: var(--ink-2); margin: -24px 0 24px; line-height: 1.8; }
.pricing-compare { margin-top: 28px; padding: 20px 24px; border-left: 3px solid var(--vermilion); background: var(--paper); border-radius: 0 var(--radius-m) var(--radius-m) 0; }
.pricing-compare p { margin: 0; line-height: 1.9; }
.pricing-compare p + p { margin-top: 8px; }
.pricing-compare .table-wrap { margin: 12px 0 4px; }
.pricing-compare__table { background: var(--sheet); }
.pricing-compare__table td .badge { margin-left: 8px; vertical-align: 2px; }
@media (max-width: 600px) {
  .pricing-compare { padding: 16px; }
  .pricing-compare .table-wrap { overflow: visible; }
  .pricing-compare__table thead { display: none; }
  .pricing-compare__table, .pricing-compare__table tbody, .pricing-compare__table tr, .pricing-compare__table td { display: block; width: 100%; }
  .pricing-compare__table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .pricing-compare__table td { padding: 0; border: 0; background: transparent !important; text-align: left; }
  .pricing-compare__table td.num { display: flex; justify-content: space-between; margin-top: 6px; }
  .pricing-compare__table td.num::before { content: attr(data-label); color: var(--muted); font-size: 14px; }
  .pricing-compare__pick { background: color-mix(in srgb, var(--vermilion) 6%, var(--sheet)); }
}
.pricing-compare__pick td { background: var(--paper); background: color-mix(in srgb, var(--vermilion) 6%, var(--sheet)); }
.plan__tip { margin: 16px 0 0; padding: 10px 14px; font-size: 14px; line-height: 1.7; background: var(--sheet); border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--radius-m); }
.pricing-table .table { background: var(--sheet); }
.pricing-table td:first-child { font-weight: 500; }
/* 基本費用表：固定欄寬，文字在格內換行，不撐破版面 */
.fee-table { table-layout: fixed; width: 100%; }
.fee-table .fee-table__item { width: 24%; }
.fee-table .fee-table__plan { width: 15%; }
.fee-table .fee-table__note { width: 46%; }
.fee-table th, .fee-table td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; vertical-align: top; line-height: 1.7; }
.pricing-group th { background: var(--paper); font-family: var(--font-serif); font-size: 15px; text-align: left; color: var(--vermilion-dark); }
.pricing-calc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.pricing-calc-wrap .pricing-sub { margin-top: -16px; }
.pricing-rates { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.pricing-rates dt { color: var(--muted); }
.pricing-rates dd { margin: 0; }
.pricing-result { padding: 14px 16px; background: var(--paper); border-radius: var(--radius-m); }
.pricing-faq details { padding: 16px 0; border-bottom: 1px solid var(--line); max-width: 48em; }
.pricing-faq summary { cursor: pointer; font-weight: 500; font-size: 17px; }
.pricing-faq details p { margin: 10px 0 0; color: var(--ink-2); line-height: 1.9; }
.pricing-cta { text-align: center; }
.pricing-cta .pricing-lead { margin-left: auto; margin-right: auto; }
@media (max-width: 960px) {
    .pricing-calc-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 720px) {
    .pricing-title { font-size: 26px; }
    .pricing-title br { display: none; }
    .fee-table { font-size: 14px; }
    .fee-table th, .fee-table td { padding: 10px 8px; }
    .fee-table .fee-table__item { width: 25%; }
    .fee-table .fee-table__plan { width: 18%; }
    .fee-table .fee-table__note { width: 39%; }
}

@media (max-width: 600px) {
    /* 手機：每列改成卡片，金額不在數字中間斷行 */
    .fee-table { table-layout: auto; }
    .fee-table colgroup, .fee-table thead { display: none; }
    .fee-table, .fee-table tbody, .fee-table tr, .fee-table th, .fee-table td { display: block; width: 100%; }
    .fee-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .fee-table .pricing-group { padding: 0; }
    .fee-table .pricing-group th { padding: 10px 14px; border: 0; }
    .fee-table td { padding: 0; border: 0; }
    .fee-table .fee-table__name { font-size: 15px; margin-bottom: 4px; }
    .fee-table .fee-table__amt { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; word-break: normal; overflow-wrap: break-word; }
    .fee-table .fee-table__amt::before { content: attr(data-label); color: var(--muted); flex: none; }
    .fee-table .fee-table__desc { margin-top: 6px; color: var(--ink-2); font-size: 13px; }
    .fee-table .fee-table__desc:empty { display: none; }
}

/* 收費頁：上架通路、加購服務 */
.channel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.channel-card { padding: 28px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-m); display: flex; flex-direction: column; gap: 14px; }
.channel-card__name { font-family: var(--font-serif); font-size: 21px; margin: 0; }
.channel-card__mode { margin: -8px 0 0; font-size: 14px; color: var(--muted); }
.channel-card__fees { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.channel-card__fees dt { font-size: 13px; color: var(--muted); }
.channel-card__fees dd { margin: 2px 0 0; font-size: 20px; font-weight: 500; }
.channel-card__specs { margin: 0; padding-left: 1.2em; font-size: 15px; color: var(--ink-2); display: grid; gap: 4px; }
.channel-card--soon { background: transparent; border-style: dashed; justify-content: center; }
.channel-card__soon { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.8; }
.addon-list { display: grid; gap: 16px; max-width: 880px; }
.addon { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 28px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius-m); }
.addon__name { font-size: 19px; margin: 0 0 6px; }
.addon__desc { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.addon__price { margin: 0; font-family: var(--font-serif); font-size: 28px; font-weight: 700; color: var(--vermilion); white-space: nowrap; }
.addon__price span { font-family: var(--font-sans, inherit); font-size: 15px; font-weight: 400; color: var(--muted); }
@media (max-width: 720px) {
    .addon { flex-direction: column; align-items: flex-start; }
}

/* ---- 系統設定：轉檔費即時試算 ---- */
.conv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.conv > * { min-width: 0; }
.conv-h { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.conv-formula { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 16px 18px; background: var(--paper); border-radius: var(--radius-m); }
.conv-formula__base { display: grid; gap: 6px; width: 180px; }
.conv-formula__eq { margin: 0 0 10px; font-family: var(--font-serif); font-size: 18px; font-weight: 700; }
.conv-formula__eq span { display: block; font-family: inherit; font-size: 13px; font-weight: 400; color: var(--muted); }
.conv-matrix { min-width: 560px; }
.conv-matrix th, .conv-matrix td { padding: 10px 8px; }
.conv-matrix th { vertical-align: bottom; font-weight: 500; }
.conv-matrix thead th { text-align: center; }
.conv-matrix tbody th { text-align: left; white-space: nowrap; }
.conv-matrix__corner { text-align: left !important; color: var(--muted); font-size: 13px; vertical-align: middle !important; }
.conv-matrix__label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.conv-input--sm { width: 78px; margin: 0 auto; }
.conv-input--sm .input { padding: 6px 8px; min-width: 0; }
.conv-input--sm .input-unit__suffix { padding: 0 5px; font-size: 12px; }
tbody .conv-input--sm { margin: 0; }
.conv-matrix .conv-matrix__cell { text-align: center; font-size: 16px; font-weight: 500; white-space: nowrap; }
.conv-matrix__cell.is-na { color: var(--line-strong); background: var(--paper); }
.conv-input.has-error .input { border-color: var(--danger); }
.conv-tiers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.conv-tiers__inputs { display: grid; gap: 12px; }
.conv-try { padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }
.conv-try__row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; }
.conv-try__row .select, .conv-try__row .input { min-width: 0; }
.conv-try__result { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.conv-try__result strong { font-family: var(--font-serif); font-size: 24px; color: var(--vermilion); margin-left: 4px; }
[data-conv-examples] tr.is-changed td { color: var(--vermilion-dark); }
.conv-was { text-decoration: line-through; }
@media (max-width: 960px) {
    .conv-tiers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .conv-try__row { grid-template-columns: 1fr 1fr; }
    .conv-try__row .input-unit { grid-column: 1 / -1; }
}

/* ---- 頁尾：網站資訊、版權 ---- */
/* 頁尾：品牌＋連結欄，下方公司資訊與版權 */
.site-info { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 48px; padding-top: 24px; padding-bottom: 40px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.site-info__brand p { margin: 16px 0 0; line-height: 1.8; color: var(--ink-2); }
.site-info__logo { display: inline-block; }
.site-info__logo img { display: block; height: 40px; width: auto; }
.site-info__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 32px; }
.site-info__col--contact { min-width: max-content; }
.site-info__title { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink); margin: 0 0 14px; }
.site-info__col a { color: var(--ink-2); text-decoration: none; }
.site-info__col a:hover { color: var(--vermilion); text-decoration: underline; }
.site-info__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; line-height: 1.6; }
.site-info__contact li { display: grid; gap: 2px; color: var(--ink-2); }
.site-info__contact span { font-size: 12px; color: var(--muted); }
.site-info__contact a { white-space: nowrap; }
.site-footer__inner { align-items: flex-end; }
.site-footer__legal { display: grid; gap: 6px; }
.site-footer__legal p { margin: 0; }
.site-footer__corp { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 760px) {
    .site-info { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .site-info__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
    .site-info__col--contact { grid-column: 1 / -1; min-width: 0; }
}
.copyright__credit::before { content: "・"; color: var(--line-strong); }
.app__sidebar-foot .copyright__owner, .app__sidebar-foot .copyright__credit { display: block; }
.app__sidebar-foot .copyright__credit::before { content: none; }
/* ---- 網站頁面 ---- */
.prose-page { max-width: 820px; }
.prose { margin-top: 32px; line-height: 2; color: var(--ink-2); }
.prose h2 { font-family: var(--font-serif); font-size: 22px; color: var(--ink); margin: 36px 0 12px; }
.prose h3 { font-size: 18px; color: var(--ink); margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.4em; }
.prose a { color: var(--vermilion); }
.page-editor { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.8; }
.markup-help dd code { font-size: 13px; }
.input-unit--prefix .input-unit__suffix { border-left: 1px solid var(--line-strong); border-right: 0; order: -1; }

/* 儲存空間 */
.storage-meter { position: relative; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--neutral-soft); }
.storage-meter span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.storage-meter--warn span { background: var(--warn); }
.storage-meter--danger span { background: var(--danger); }
.storage-meter i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); opacity: .45; }
.storage-cat__head { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.storage-cat__bar { height: 6px; margin: 6px 0 4px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.storage-cat__bar span { display: block; height: 100%; background: var(--vermilion); }
.storage-cat__note { font-size: 13px; color: var(--muted); }
.storage-items { margin-top: 4px; font-size: 14px; }
.storage-items summary { cursor: pointer; color: var(--vermilion); }
.storage-items ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; word-break: break-all; }
.purged { color: var(--muted); }
.storage-runs { min-width: 640px; }

/* 頁內分頁：JS 載入前不顯示分頁列（內容依序顯示） */
[data-tabs] > .tabs { display: none; }
[data-tabs].is-ready > .tabs { display: flex; }
[data-tabs] > .tabs .badge { font-weight: 400; }
[data-tabs] > [role="tabpanel"] + [role="tabpanel"] { margin-top: 24px; }
[data-tabs].is-ready > [role="tabpanel"] { margin-top: 0; }
[data-tabs] > [role="tabpanel"]:focus { outline: none; }

/* 回到頂端 */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink); font: 700 13px/1 var(--font-sans, inherit); letter-spacing: .06em;
  box-shadow: 0 6px 18px rgba(42, 39, 36, .16); cursor: pointer; transition: transform .15s, background .15s, color .15s; }
.to-top::before { content: ""; display: block; width: 8px; height: 8px; margin: 0 auto 3px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.to-top:hover { background: var(--vermilion); border-color: var(--vermilion); color: #fff; transform: translateY(-2px); }
.to-top:focus-visible { outline: 3px solid var(--vermilion); outline-offset: 2px; }
.to-top[hidden] { display: none; }
@media (max-width: 720px) { .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; font-size: 12px; } }
@media print { .to-top { display: none !important; } }
main[tabindex="-1"]:focus { outline: none; }
.tabs .badge { padding: 1px 7px; min-width: 20px; justify-content: center; }
.tabs .badge::before { display: none; }
@media (max-width: 720px) { .tabs button, .tabs a { padding: 10px 10px; } }

/* 分頁列：分隔線改用 inset 陰影，頁籤底線不再凸出 1px（避免 Windows 出現上下捲軸） */
.tabs { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tabs a, .tabs button { margin-bottom: 0; }
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

/* 批次帳單 */
.bill-books__title { margin: 20px 0 8px; font-size: 15px; color: var(--muted); font-weight: 500; }
.bill-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bill-books li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.bill-books li a { overflow-wrap: anywhere; }

/* 批次上傳 */
.dropzone__hint { font-size: 14px; color: var(--muted); }
.dropzone { position: relative; }
.batch-list { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.batch-list__head, .batch-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(140px, auto) 32px; gap: 12px; align-items: center; }
.batch-list__head { padding: 10px 14px; background: var(--neutral-soft); font-size: 13px; color: var(--muted); }
.batch-list ol { list-style: none; margin: 0; padding: 0; }
.batch-item { padding: 10px 14px; border-top: 1px solid var(--line); }
.batch-item .input { padding-top: 8px; padding-bottom: 8px; }
.batch-item__file { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.batch-item__state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.batch-item__msg { flex-basis: 100%; font-size: 13px; color: var(--danger); }
.batch-item__remove { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 6px; }
.batch-item__remove:hover { background: var(--neutral-soft); color: var(--ink); }
.batch-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.batch-table .table__sub { white-space: normal; }
.batch-files { font-size: 14px; overflow-wrap: anywhere; }
.batch-files .is-matched::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.batch-state { min-width: 160px; }
.batch-msgs { margin: 6px 0 0; padding-left: 1.1em; font-size: 13px; color: var(--danger); }
.batch-msgs--warn { color: var(--warn); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--sheet); position: sticky; top: 0; z-index: 5; }
.bulk-bar [data-bulk-submit] { margin-left: auto; }
.bulk-col { width: 44px; text-align: center; }
.bulk-col input { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .batch-list__head { display: none; }
  .batch-item { grid-template-columns: minmax(0, 1fr) 32px; }
  .batch-item .input { grid-column: 1; }
  .batch-item__file, .batch-item__state { grid-column: 1; }
  .batch-item__remove { grid-column: 2; grid-row: 1; }
}
@media (max-width: 720px) {
  .books-table { min-width: 640px; }
  .batch-table { min-width: 620px; }
  .bulk-bar { padding: 12px 16px; }
}
.books-table td { white-space: nowrap; }
.books-table td:has(.table__title) { white-space: normal; min-width: 180px; }
.batch-table td:nth-child(2) { min-width: 170px; }

/* 自動產生封面 */
.cover-thumb { position: relative; }
.cover-thumb__auto { opacity: .92; }
.cover-thumb__tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(42, 39, 36, .78); color: #fff; font-size: 11px; }
.cover-auto-note { flex: 1 1 220px; margin: 0; font-size: 14px; color: var(--muted); }
.checklist__msg--info { color: var(--muted); }
.cover-side { flex: 1 1 260px; min-width: 0; display: grid; gap: 12px; }
.cover-side .cover-auto-note { flex: none; }
.cover-thumb__fallback { padding: 10px; font-size: 12px; text-align: center; line-height: 1.5; }

/* EPUB 處理方式 */
.epub-mode { display: grid; gap: 12px; padding-top: 4px; border-top: 1px dashed var(--line); }
.epub-mode__facts { margin: 8px 0 0; font-size: 14px; }
.epub-errors { margin-top: 8px; }
.epub-errors summary { cursor: pointer; font-weight: 700; }
.epub-errors ul { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; max-height: 260px; overflow: auto; }
.epub-errors code { font-size: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.choice input:disabled + span { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

/* ---- 上架流程：體驗版（TXT → 線上預覽） -------------------- */
.how-hero { padding-bottom: 40px; }
.demo-section { padding-top: 56px; }
.demo { position: relative; max-width: 960px; margin: 0 auto; padding: 28px 32px 32px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-m); }
.demo__autoplay { position: absolute; top: -14px; right: 24px; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; font-size: 13px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: 0 2px 8px rgba(42, 39, 36, .08); }
.demo__autoplay[hidden] { display: none; }
.demo__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--vermilion); animation: demo-pulse 1.2s ease-in-out infinite; }
@keyframes demo-pulse { 50% { opacity: .25; } }

.demo-steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.demo-steps__btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink-2); text-align: left; background: transparent; border: 0; border-bottom: 3px solid var(--line); cursor: pointer; }
.demo-steps__btn:disabled { color: var(--muted); opacity: .6; cursor: default; }
.demo-steps__btn:not(:disabled):hover { border-bottom-color: var(--line-strong); }
.demo-steps__btn:focus-visible { outline: none; box-shadow: var(--focus); }
.demo-steps__no { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; font-size: 13px; font-weight: 700; border-radius: 50%; background: var(--neutral-soft); color: var(--ink-2); }
.demo-steps__btn[aria-selected="true"] { color: var(--vermilion-dark); font-weight: 700; border-bottom-color: var(--vermilion); }
.demo-steps__btn[aria-selected="true"] .demo-steps__no { background: var(--vermilion); color: #fff; }
.demo-steps__btn.is-done .demo-steps__no { background: var(--ok-soft); color: var(--ok); }
.demo-steps__btn.is-done { border-bottom-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

.demo-panel { animation: demo-in .25s ease-out; }
.demo-panel[hidden] { display: none; }
@keyframes demo-in { from { opacity: 0; transform: translateY(6px); } }
.demo-panel__head { margin-bottom: 18px; }
.demo-panel__title { font-family: var(--font-serif); font-size: 22px; margin: 0 0 4px; }
.demo-panel__desc { margin: 0; color: var(--muted); font-size: 15px; }
.demo-panel__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.demo-text { width: 100%; box-sizing: border-box; font-family: var(--font-serif); font-size: 16px; line-height: 1.9; }
.demo-text__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 14px; }
.demo-file { position: relative; overflow: hidden; }
.demo-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.demo-file:focus-within { box-shadow: var(--focus); }
.demo-fieldset { border: 0; padding: 0; margin: 18px 0 0; }
.demo-fieldset legend { padding: 0; margin-bottom: 6px; }
.demo.is-autoplay .demo-panel { pointer-events: none; }

.demo-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-height: 280px; }
.demo-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); animation: demo-in .3s ease-out; }
.demo-check strong { display: block; font-size: 15px; }
.demo-check span:not(.demo-check__mark) { display: block; color: var(--ink-2); font-size: 14px; }
.demo-check__mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; font-size: 13px; font-weight: 700; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.demo-check.is-done-all { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.demo-check.is-done-all .demo-check__mark { background: var(--ok); color: #fff; }
.demo-check.is-error .demo-check__mark { background: var(--danger-soft); color: var(--danger); }

/* 閱讀器 */
.demo-reader { --page-w: 400px; --page-h: 560px; }
.demo-reader__bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-bottom: 16px; }
.demo-reader__toc { width: auto; min-width: 200px; max-width: 100%; }
.demo-reader__modes { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; background: var(--sheet); }
.demo-reader__mode { padding: 8px 16px; font: inherit; font-size: 14px; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; }
.demo-reader__mode + .demo-reader__mode { border-left: 1px solid var(--line-strong); }
.demo-reader__mode[aria-pressed="true"] { background: var(--vermilion-soft); color: var(--vermilion-dark); font-weight: 700; }
.demo-reader__mode:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--vermilion); }
.demo-reader__stage { display: flex; justify-content: center; align-items: center; gap: 16px; }
.demo-reader__nav { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ink-2); background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; }
.demo-reader__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.demo-reader__nav:hover:not(:disabled) { color: var(--vermilion-dark); border-color: var(--vermilion); }
.demo-reader__nav:disabled { opacity: .35; cursor: default; }
.demo-reader__nav:focus-visible { outline: none; box-shadow: var(--focus); }
.demo-reader__device { width: var(--page-w); max-width: 100%; padding: 14px 14px 10px; background: #e9e4d8; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 10px 30px rgba(42, 39, 36, .12); }
.demo-reader__viewport { position: relative; width: 100%; height: var(--page-h); overflow: hidden; background: #fbf8f1; border-radius: 6px; cursor: pointer; }
.demo-reader__viewport:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vermilion-soft), 0 0 0 1px var(--vermilion); }
.demo-reader__progress { height: 3px; margin-top: 10px; background: rgba(42, 39, 36, .1); border-radius: 2px; overflow: hidden; display: flex; }
.demo-reader__progress.is-rtl { justify-content: flex-end; }
.demo-reader__progress span { display: block; height: 100%; background: var(--vermilion); transition: width .25s; }
.demo-reader__count { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 一頁電子書（與正式轉檔的 EPUB 樣式一致：行高 1.8、首行縮排 1 字、章名 1.4 倍） */
.demo-page { box-sizing: border-box; width: 100%; height: 100%; padding: 30px 26px; overflow: hidden; font-family: var(--font-serif); font-weight: 400; font-size: 17px; line-height: 1.8; color: #2a2724; text-align: justify; font-feature-settings: "palt" 0; }
.demo-page p { margin: 0; text-indent: 1em; }
.demo-page p.cont { text-indent: 0; }
.demo-page p.scene { text-indent: 0; text-align: center; margin: 1em 0; color: #6b625a; }
.demo-page h1 { font-size: 1.4em; font-weight: 700; line-height: 1.5; margin: 0 0 1.4em; text-indent: 0; }
.demo-page .tcy { text-combine-upright: all; -webkit-text-combine: horizontal; }
.demo-page--v { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; }
.demo-page--v h1 { margin: 0 0 0 1.6em; }
.demo-page--v p.scene { margin: 0 1em; }
.demo-page.is-from-left { animation: demo-page-l .28s ease-out; }
.demo-page.is-from-right { animation: demo-page-r .28s ease-out; }
@keyframes demo-page-l { from { opacity: 0; transform: translateX(-28px); } }
@keyframes demo-page-r { from { opacity: 0; transform: translateX(28px); } }
.demo-measure { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
.demo-measure .demo-page { width: var(--page-w); height: var(--page-h); }

/* 目錄頁 */
.demo-toc h1 { font-size: 1.3em; }
.demo-toc ol { list-style: none; margin: 0; padding: 0; }
.demo-toc li { margin: .2em 0; }
.demo-page--v .demo-toc li { margin: 0 .2em; }
.demo-toc button { padding: 0; font: inherit; color: inherit; text-align: inherit; background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(42, 39, 36, .25); text-underline-offset: .25em; }
.demo-toc button:hover { color: var(--vermilion-dark); }

/* 自動封面（示意，正式轉檔由 CoverGenerator 產生 1600×2560 圖片） */
.demo-page--cover { padding: 0; }
.demo-cover { --bg: #2f4a40; --fg: #f3ecdc; --sub: #cfc4ad; --acc: #d9a441; height: 100%; padding: 16px; box-sizing: border-box; background: var(--bg); color: var(--fg); }
.demo-cover--p1 { --bg: #2a2724; --fg: #f3ecdc; --sub: #c9bfae; --acc: #c9603a; }
.demo-cover--p2 { --bg: #f2ead9; --fg: #2a2724; --sub: #6b625a; --acc: #b8471f; }
.demo-cover--p3 { --bg: #22324a; --fg: #f1ebdd; --sub: #c4c9d3; --acc: #d9a441; }
.demo-cover__frame { position: relative; height: 100%; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 24px 70px; text-align: center; }
.demo-cover__title { margin: 0; font-family: var(--font-serif); font-weight: 900; font-size: 34px; line-height: 1.35; overflow-wrap: anywhere; }
.demo-cover__rule { width: 44px; height: 3px; background: var(--acc); }
.demo-cover__author { margin: 0; font-size: 17px; color: var(--sub); letter-spacing: .05em; }
.demo-cover__logo { position: absolute; left: 0; right: 0; bottom: 22px; margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: 14px; letter-spacing: .1em; color: var(--sub); }
.demo-cover__logo b { color: var(--acc); }
.demo-cover--v .demo-cover__frame { flex-direction: row-reverse; align-items: center; gap: 28px; }
.demo-cover--v .demo-cover__title { writing-mode: vertical-rl; font-size: 40px; max-height: 78%; letter-spacing: .08em; }
.demo-cover--v .demo-cover__rule { width: 3px; height: 44px; align-self: flex-end; margin-bottom: 18%; }
.demo-cover--v .demo-cover__author { writing-mode: vertical-rl; align-self: flex-end; margin-bottom: 18%; letter-spacing: .15em; }

.demo-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo-cta > div:first-child { flex: 1 1 320px; }
.demo-cta__title { margin: 0 0 4px; font-family: var(--font-serif); font-weight: 700; font-size: 18px; }
.demo-cta .muted { margin: 0; font-size: 14px; }
.demo-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-note { text-align: center; }
.steps--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps--five .step { padding: 0 20px; }
.steps--five .step:first-child { padding-left: 0; }
.how-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.site-nav a[aria-current="page"] { color: var(--vermilion-dark); }

@media (max-width: 960px) {
  .steps--five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 0; }
  .steps--five .step:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 720px) {
  .demo { padding: 20px 16px 22px; }
  .demo__autoplay { right: 12px; left: 12px; justify-content: space-between; }
  .demo-steps { gap: 4px; }
  .demo-steps__btn { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 13px; text-align: center; }
  .demo-reader { --page-w: 100%; --page-h: min(520px, 68vh); }
  .demo-reader__stage { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "dev dev" "l r"; gap: 12px 0; }
  .demo-reader__device { grid-area: dev; margin: 0 auto; width: 100%; box-sizing: border-box; padding: 10px 10px 8px; border-radius: 14px; }
  .demo-reader__nav--left { grid-area: l; justify-self: start; }
  .demo-reader__nav--right { grid-area: r; justify-self: end; }
  .demo-reader__count { margin-top: -44px; line-height: 44px; pointer-events: none; }
  .demo-page { padding: 24px 22px; font-size: 16px; }
  .demo-cover--v .demo-cover__title { font-size: 34px; }
  .demo-panel__actions .btn { flex: 1 1 auto; }
  .steps--five { grid-template-columns: 1fr; }
  .steps--five .step { padding: 0 0 0 0; border-left: 0; }
}

/* ---- 版權頁（作者書籍頁的預覽；與 EPUB 內的版型一致） ---- */
.colophon-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.colophon-preview { box-sizing: border-box; min-height: 260px; padding: 22px 20px; background: #fbf8f1; border: 1px solid var(--line-strong); border-radius: var(--radius-m); font-family: var(--font-serif); font-size: 15px; line-height: 1.7; color: #2a2724; display: flex; flex-direction: column; justify-content: flex-end; }
.colophon-preview.is-off { justify-content: center; text-align: center; font-family: var(--font-sans); }
.colophon-preview .pp-colophon p { margin: 0; text-indent: 0; }
.colophon-preview .pp-title { font-size: 1.12em; font-weight: 700; margin-bottom: .7em !important; }
.colophon-preview .pp-k { display: inline-block; min-width: 5.5em; color: #6b625a; }
.colophon-preview .pp-rule { border-top: 1px solid #b9ae9f; margin: .7em 0; }
.colophon-preview .pp-rights { margin-top: .2em !important; }
.colophon-preview .pp-notice { font-size: .85em; color: #6b625a; margin-top: .3em !important; }
.colophon-preview.is-vertical { height: 400px; writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; overflow-x: auto; justify-content: flex-start; }
.colophon-preview.is-vertical.is-off { writing-mode: horizontal-tb; }
.colophon-preview.is-vertical .pp-title { margin: 0 0 0 .7em !important; }
.colophon-preview.is-vertical .pp-k { min-width: 0; min-height: 5.5em; }
.colophon-preview.is-vertical .pp-rule { border-top: 0; border-right: 1px solid #b9ae9f; margin: 0 .7em; }
.colophon-preview.is-vertical .pp-rights { margin: 0 .2em 0 0 !important; }
.colophon-preview.is-vertical .pp-notice { margin: 0 .3em 0 0 !important; }
.colophon-preview .tcy { text-combine-upright: all; -webkit-text-combine: horizontal; }
.colophon-side .field__label .muted { font-weight: 400; }
.radio-line { display: flex; gap: 8px; align-items: baseline; font-size: 15px; line-height: 1.6; cursor: pointer; }
.radio-line input { flex: none; accent-color: var(--vermilion); }
.colophon-check { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.6; }
.colophon-check input { flex: none; accent-color: var(--vermilion); }
@media (max-width: 720px) {
  .colophon-row { grid-template-columns: 1fr; }
  .colophon-preview.is-vertical { height: 380px; }
}
.colophon-confirm { padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); font-size: 14px; }
.colophon-confirm .btn { margin-bottom: 8px; }
.reader__frame--fxl { width: 100%; height: 100%; border: 0; background: #fff; }
/* 依頁面尺寸縮放後的固定版面頁（版權頁），外觀和圖片頁一致 */
.reader__frame--fxl.is-fitted { flex: none; box-shadow: 0 1px 4px rgba(42, 39, 36, .15); }

/* 體驗版的版權頁（與正式版型一致） */
.demo-page .pp-colophon { font-size: .85em; line-height: 1.7; }
.demo-page .pp-colophon p { text-indent: 0; }
.demo-page .pp-title { font-size: 1.15em; font-weight: 700; margin-bottom: .8em; }
.demo-page .pp-k { display: inline-block; min-width: 5.5em; color: #6b625a; }
.demo-page .pp-rule { border-top: 1px solid #b9ae9f; margin: .8em 0; }
.demo-page .pp-notice { font-size: .9em; color: #6b625a; margin-top: .3em; }
.demo-page--v .pp-title { margin: 0 0 0 .8em; }
.demo-page--v .pp-k { min-width: 0; min-height: 5.5em; }
.demo-page--v .pp-rule { border-top: 0; border-right: 1px solid #b9ae9f; margin: 0 .8em; }
.demo-page--v .pp-notice { margin: 0 .3em 0 0; }
.demo-page--colophon:not(.demo-page--v) { display: flex; flex-direction: column; justify-content: flex-end; }

/* ---- ISBN 批次填入 ---- */
.isbn-batch { display: grid; gap: 20px; }
.isbn-batch__input { max-width: 200px; }
.isbn-batch__input.is-invalid { border-color: var(--danger); }
.isbn-batch__table tr.is-matched td { background: var(--ok-soft); }
.isbn-batch__table tr.has-error td { background: var(--danger-soft); }
.isbn-batch__table .field__help { display: block; margin: 4px 0 0; font-size: 13px; }
.isbn-unmatched { margin: 0; padding-left: 1.2em; color: var(--danger); font-size: 14px; }

/* ---- 建議售價 ---- */
.price-advice { margin: 4px 0 20px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); }
.price-advice__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 10px; }
.price-advice__basis { font-size: 14px; }
.price-advice__rec { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 12px; }
.price-advice__big { font-family: var(--font-serif); font-size: 28px; font-weight: 900; color: var(--vermilion); line-height: 1.1; }
.price-advice__table { background: var(--sheet); font-size: 14px; }
.price-advice__table th .table__sub { font-weight: 400; }
.price-advice__table td .badge { margin-left: 6px; vertical-align: 1px; }
.price-advice__table tr.is-rec td { background: color-mix(in srgb, var(--ok) 7%, var(--sheet)); }
.price-advice__table tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--vermilion); }
.price-advice__warn { margin: 10px 0 0; padding: 8px 12px; font-size: 14px; border-radius: var(--radius-s); }
.price-advice__warn--info { background: var(--info-soft); color: var(--info); }
.price-advice__warn--warn { background: var(--warn-soft); color: var(--warn); }
.price-advice__note { margin: 10px 0 0; font-size: 13px; }
.link-btn { padding: 0; font: inherit; font-size: 13px; color: var(--vermilion-dark); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.pricing-howto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.pricing-howto ol { margin: 0; padding-left: 1.3em; line-height: 1.9; }
.pricing-howto ol li + li { margin-top: 10px; }
.pricing-howto .price-advice { margin: 0; background: var(--sheet); }
.pricing-howto .form-row { margin-bottom: 12px; }
@media (max-width: 960px) { .pricing-howto { grid-template-columns: minmax(0, 1fr); } }
.price-hint { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-family: var(--font-sans); }
.price-hint.is-off { color: var(--warn); }
.price-hint__warn { display: block; color: var(--warn); }

/* ---- 作者預覽「試閱」浮水印（固定版面的圖片頁；可重排頁面由伺服器加在頁面裡） ---- */
.reader { position: relative; }
.reader__watermark { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.reader__watermark span { font: 700 clamp(48px, 14vmin, 160px)/1 sans-serif; color: rgba(184, 71, 31, .16); letter-spacing: .2em; transform: rotate(-30deg); white-space: nowrap; user-select: none; }

/* ---- 電子書檔案下載／取回 ---- */
.download-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.download-list .btn { justify-content: center; }
.retrieval-cost { width: 100%; font-size: 14px; border-collapse: collapse; }
.retrieval-cost td { padding: 4px 0; }
.retrieval-cost td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.retrieval-cost tr.is-total td { border-top: 1px solid var(--line, #e3dccd); padding-top: 8px; font-weight: 700; }
.output-item__actions { display: flex; gap: 8px; flex: none; }
.preview-aside .btn svg, .output-item__actions .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; margin-right: 6px; vertical-align: -3px; }
.plan-download { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 32px; align-items: start; }
.plan-download ul { margin: 0; }
@media (max-width: 760px) { .plan-download { grid-template-columns: minmax(0, 1fr); } }
.plan-download .plan__rate { flex-wrap: wrap; row-gap: 4px; }
.plan-download .plan__rate span { white-space: nowrap; }
.term-box { margin-top: 12px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); font-size: 15px; line-height: 1.7; }
.choice.is-disabled-choice { opacity: .55; cursor: not-allowed; }
.declare-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.declare-group .field__label { padding: 0; margin-bottom: 4px; }
.risk-meta dd.is-flag { color: var(--vermilion, #b8471f); font-weight: 600; }
.risk-dupes ul { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: 14px; }
.review-checks { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.contract-text--full { max-height: none; overflow: visible; }

/* 側欄捲軸：細、無軌道，滑鼠移到側欄或捲動時才顯示 */
.app__sidebar { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.app__sidebar:hover, .app__sidebar:focus-within { scrollbar-color: var(--line-strong) transparent; }
.app--admin .app__sidebar:hover, .app--admin .app__sidebar:focus-within { scrollbar-color: rgba(255, 253, 248, .22) transparent; }
.app__sidebar::-webkit-scrollbar { width: 6px; }
.app__sidebar::-webkit-scrollbar-track { background: transparent; }
.app__sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.app__sidebar:hover::-webkit-scrollbar-thumb { background: var(--line-strong); }
.app--admin .app__sidebar:hover::-webkit-scrollbar-thumb { background: rgba(255, 253, 248, .22); }
.app--admin .app__sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 253, 248, .38); }
/* 合約等內容框的捲軸也統一成細款 */
.contract-text { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.contract-text::-webkit-scrollbar { width: 6px; }
.contract-text::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

/* 卡片標題右邊的備註（例：收費方案「送出時確定、之後不能更改」） */
.panel__head--note { justify-content: flex-start; flex-wrap: wrap; row-gap: 4px; }
.panel__note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ---- 系統維護 ---- */
.maintenance-bar { background: #6b4608; color: #fff8e8; font-size: 14px; line-height: 1.6; }
.maintenance-bar .container { display: flex; align-items: flex-start; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.maintenance-bar svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.maintenance-bar strong { margin-right: 8px; }
.maintenance-page { padding: 64px 0 80px; }
.maintenance-page__card { text-align: center; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-l, 16px); padding: 48px 32px; }
.maintenance-page__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--warn-soft); color: #6b4608; margin-bottom: 16px; }
.maintenance-page__icon svg { width: 30px; height: 30px; }
.maintenance-page__title { margin: 0 0 12px; font-size: 28px; }
.maintenance-page__lead { margin: 0 auto; max-width: 30em; color: var(--muted); line-height: 1.8; }
.maintenance-page__note { margin: 24px auto 0; max-width: 30em; padding: 14px 18px; background: var(--warn-soft); border: 1px solid #e6cf9f; border-radius: var(--radius-m); color: #6b4608; line-height: 1.7; text-align: left; overflow-wrap: anywhere; }
.maintenance-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
@media (max-width: 600px) {
    .maintenance-page { padding: 32px 0 48px; }
    .maintenance-page__card { padding: 32px 20px; }
    .maintenance-page__lead br { display: none; }
}
.app__nav-badge { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #e0a43a; color: #2a2724; font-size: 12px; font-weight: 700; line-height: 1.6; }
.maint-status__body { display: flex; align-items: center; gap: 16px; }
.maint-status__dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ok, #2f7a55); box-shadow: 0 0 0 5px var(--ok-soft); }
.maint-status.is-on { border-color: #e6cf9f; background: var(--warn-soft); }
.maint-status.is-on .maint-status__dot { background: #c98a1b; box-shadow: 0 0 0 5px #f3dfb3; }
.maint-status__label { margin: 0; font-size: 13px; color: var(--muted); }
.maint-status__value { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.maint-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); font-size: 14px; }
.maint-scope__title { margin: 0 0 4px; font-weight: 700; }
.maint-scope ul { margin: 0; padding-left: 1.2em; line-height: 1.8; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 600px) { .maint-scope { grid-template-columns: 1fr; } }
.maintenance-bar svg, .maintenance-page__icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---- 最新消息 ---- */
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.news-page { max-width: 880px; }
.news-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; }
.news-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); }
.news-card--text { grid-template-columns: minmax(0, 1fr); }
.news-card__thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; background: var(--paper); }
.news-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card__meta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.news-card__title { margin: 0 0 6px; font-size: 20px; line-height: 1.5; }
.news-card__title a { color: var(--ink); text-decoration: none; }
.news-card__title a:hover { color: var(--vermilion); }
.news-card__excerpt { margin: 0; color: var(--ink-2); line-height: 1.8; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; }
.news-article__back { margin: 0 0 12px; font-size: 14px; }
.news-article__title { margin-bottom: 8px; }
.news-content { overflow-wrap: anywhere; }
.news-content img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 8px 0; }
.news-content blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.news-content .ql-align-center { text-align: center; }
.news-content .ql-align-right { text-align: right; }
.news-content .ql-align-justify { text-align: justify; }
.news-content img.ql-align-center, .news-content p.ql-align-center img { margin-left: auto; margin-right: auto; }
.news-content .ql-indent-1 { padding-left: 2em; } .news-content .ql-indent-2 { padding-left: 4em; } .news-content .ql-indent-3 { padding-left: 6em; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__head .section__title { margin-bottom: 0; }
.section__more { font-size: 15px; white-space: nowrap; }
.news-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.news-tile a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; }
.news-tile a:hover { border-color: var(--vermilion); }
.news-tile__thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; margin-bottom: 6px; background: var(--paper); }
.news-tile__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-tile .news-card__meta { margin: 0; }
.news-tile__title { font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .news-grid { grid-template-columns: minmax(0, 1fr); }
    .news-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
    .news-card__title { font-size: 18px; }
}
/* 後台編輯器 */
.news-editor { border-radius: var(--radius-m); background: var(--sheet); }
.news-editor .ql-toolbar.ql-snow { border-color: var(--line); border-radius: var(--radius-m) var(--radius-m) 0 0; background: var(--paper); font-family: inherit; flex-wrap: wrap; }
.news-editor .ql-container.ql-snow { border-color: var(--line); border-radius: 0 0 var(--radius-m) var(--radius-m); font-family: inherit; font-size: 16px; }
.news-editor .ql-editor { min-height: 380px; line-height: 1.9; }
.news-editor .ql-editor img { max-width: 100%; height: auto; }
.news-editor .ql-editor h2 { font-size: 22px; } .news-editor .ql-editor h3 { font-size: 18px; }
.news-editor__status.is-ng { color: var(--danger); }
.news-cover__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.news-cover__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.news-cover__actions label { cursor: pointer; }

/* ---- 優惠活動 ---- */
.price-was { color: var(--muted); font-weight: 400; margin-right: 2px; }
.price-now { color: var(--vermilion-dark); }
.promo-banner { display: grid; gap: 10px; margin-top: 24px; }
.promo-banner-wrap .promo-banner { margin: 0; padding-top: 24px; }
.promo-banner__item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 14px 18px; background: var(--vermilion-soft); border: 1px solid #efc4b3; border-radius: var(--radius-m); }
.promo-banner__tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 10px; border-radius: 999px; background: var(--vermilion); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.promo-banner__tag svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.promo-banner__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--ink); }
.promo-banner__text strong { font-size: 17px; color: var(--vermilion-dark); }
.promo-banner__period { font-size: 14px; color: var(--ink-2); }
.promo-banner__note { flex-basis: 100%; font-size: 14px; color: var(--ink-2); }
.promo-channels { display: grid; gap: 6px; }
.plan-choice__promo { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--vermilion-dark); }
.plan-choice__promo svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---- 數據分析 ---- */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--sheet); }
.segmented__item { padding: 6px 14px; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.segmented__item + .segmented__item { border-left: 1px solid var(--line); }
.segmented__item[aria-current="page"] { background: var(--ink); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); }
.kpi__label { margin: 0; font-size: 13px; color: var(--muted); }
.kpi__value { margin: 4px 0 2px; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.kpi__value small { font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi__delta { font-size: 13px; color: var(--muted); }
.kpi__delta.is-up { color: var(--ok); }
.kpi__delta.is-down { color: var(--danger); }
.trend { margin: 0; }
.trend__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.trend__title { font-weight: 700; }
.legend { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }
.legend__swatch--a { background: #b8471f; }
.legend__swatch--b { background: #2f6fa8; }
.trend__plot { position: relative; outline: none; }
.trend__plot:focus-visible { box-shadow: var(--focus); border-radius: 6px; }
.trend__plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend__grid { stroke: var(--line); stroke-width: 1; }
.trend__axis { font-size: 11px; fill: var(--muted); font-family: inherit; }
.trend__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend__line--a { stroke: #b8471f; }
.trend__line--b { stroke: #2f6fa8; }
.trend__cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.trend__dot { stroke: var(--sheet); stroke-width: 2; }
.trend__dot--a { fill: #b8471f; }
.trend__dot--b { fill: #2f6fa8; }
.trend__tip { position: absolute; top: 0; display: grid; gap: 2px; padding: 8px 10px; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(42, 39, 36, .12); font-size: 13px; color: var(--ink); white-space: nowrap; pointer-events: none; }
.trend__tip span { display: flex; align-items: center; gap: 6px; }
.trend__table { margin-top: 8px; font-size: 14px; }
.trend__table summary { cursor: pointer; color: var(--muted); }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.analytics-grid--flat { gap: 24px 32px; }
.analytics-sub { margin: 0 0 10px; font-size: 15px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars__row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.hbars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbars__track { height: 10px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.hbars__bar { display: block; height: 100%; background: #b8471f; border-radius: 0 4px 4px 0; }
.hbars__value { color: var(--ink); white-space: nowrap; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.funnel__step { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 4.5em 8.5em; align-items: center; gap: 12px; font-size: 14px; }
.funnel__label { display: grid; color: var(--ink); font-weight: 700; }
.funnel__hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.funnel__track { height: 18px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.funnel__bar { display: block; height: 100%; background: #b8471f; border-radius: 0 4px 4px 0; }
.funnel__value { text-align: right; font-weight: 700; }
.funnel__rate { color: var(--muted); font-size: 13px; }
.ga-setup { margin: 0; padding-left: 1.4em; line-height: 1.9; }
.ga-setup code { overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .analytics-grid { grid-template-columns: minmax(0, 1fr); }
    .hbars__row { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; }
    .funnel__step { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .funnel__track { grid-column: 1 / -1; grid-row: 2; }
    .funnel__rate { grid-column: 1 / -1; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi__value { font-size: 20px; }
    .page-head__actions { width: 100%; }
    .segmented { max-width: 100%; overflow-x: auto; }
}
.kpis { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.funnel__step--visitors .funnel__bar { background: #e9c3b3; }
.news-editor .ql-container { height: auto; }
/* Quill 標題選單改成中文 */
.news-editor .ql-snow .ql-picker.ql-header { width: 92px; }
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-label::before,
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: '內文'; }
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: '大標題'; }
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.news-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: '小標題'; }
@media (max-width: 600px) {
    .trend__plot { overflow-x: auto; }
    .trend__plot svg { min-width: 560px; }
}

/* ---- 側欄手風琴（管理後台）---- */
.app__nav--accordion { gap: 0; }
.app__nav-section + .app__nav-section { margin-top: 4px; }
.app__nav-toggle { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 2px; padding: 8px 10px; background: none; border: 0; border-radius: var(--radius-m); font: inherit; font-size: 13px; color: var(--muted); text-align: left; cursor: pointer; }
.app__nav-toggle:hover { background: var(--neutral-soft); color: var(--ink); }
.app__nav-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.app__nav-toggle-label { flex: 1; letter-spacing: .04em; }
.app__nav-chevron { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.app__nav-section.is-open .app__nav-chevron { transform: rotate(180deg); }
.app__nav-sum { margin-left: 0; }
.app__nav-section.is-open .app__nav-sum { display: none; }   /* 展開時各項目自己顯示筆數 */
.app__nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease, visibility 0s linear 0s; }
.app__nav-inner { min-height: 0; overflow: hidden; display: grid; gap: 2px; }
.has-js .app__nav-section:not(.is-open) .app__nav-items { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .22s ease, visibility 0s linear .22s; }
.app--admin .app__nav-toggle { color: var(--on-ink-muted); }
.app--admin .app__nav-toggle:hover { background: var(--ink-panel-2); color: #fff; }
@media (prefers-reduced-motion: reduce) {
    .app__nav-items, .has-js .app__nav-section:not(.is-open) .app__nav-items, .app__nav-chevron { transition: none; }
}

/* ---- 暫停撥付 ---- */
.hold-list { margin: 6px 0 0; padding-left: 1.2em; font-size: 14px; line-height: 1.7; }
.hold-list__reason { display: block; color: var(--muted); }
.hold-release { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hold-release .input { min-height: 32px; padding: 4px 8px; font-size: 13px; width: 11em; }

/* 數據分析：背景讀取 GA 報表時的畫面 */
.analytics-body { display: flex; flex-direction: column; gap: 24px; }
.analytics-loading { padding: 24px; }
.analytics-loading__body { display: flex; align-items: center; gap: 16px; }
.analytics-loading__spinner { flex: none; width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--vermilion); border-radius: 50%; animation: pp-spin .9s linear infinite; }
.analytics-loading__title { margin: 0; font-weight: 700; }
.analytics-loading__note { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.analytics-loading__elapsed { margin-left: 8px; }
.analytics-skeleton { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.analytics-skeleton__kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.analytics-skeleton__kpis span, .analytics-skeleton__chart { display: block; border-radius: var(--radius-m, 8px); background: linear-gradient(90deg, var(--paper) 0%, #ebe4d6 50%, var(--paper) 100%); background-size: 200% 100%; animation: pp-shimmer 1.4s ease-in-out infinite; }
.analytics-skeleton__kpis span { height: 96px; }
.analytics-skeleton__chart { height: 240px; }
@keyframes pp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (max-width: 720px) { .analytics-skeleton__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .analytics-skeleton__kpis span:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { .analytics-loading__spinner, .analytics-skeleton__kpis span, .analytics-skeleton__chart { animation: none; } }

/* 作者停用與刪除測試資料 */
.panel--warn { border-color: #e7c88d; }
.panel--danger { border-color: #e2b8b2; }
.panel--danger .panel__title { color: var(--danger); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checklist__item.is-ok .checklist__mark { background: var(--ok); border-color: var(--ok); }
.checklist__item:not(.is-ok) .checklist__mark { background: var(--warn, #b7791f); border-color: var(--warn, #b7791f); }
.checklist__detail { display: block; font-size: 13px; color: var(--muted); }
.closed-facts { margin: 0 0 24px; padding-left: 1.2em; display: grid; gap: 10px; font-size: 15px; line-height: 1.7; color: var(--ink-soft, #4a443e); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 8px; }


/* 需要先產生檔案的下載連結：處理中 */
a.is-busy { pointer-events: none; color: var(--muted); text-decoration: none; cursor: progress; }
.download-note { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.download-note--error { color: var(--danger, #a3352a); }

/* 已核准的書：退回作者修改（收在摺疊區，避免誤按） */
.return-approved { border-top: 1px solid var(--line); padding-top: 14px; }
.return-approved > summary { cursor: pointer; color: var(--ink-2, #4a443e); font-weight: 600; }
.return-approved > summary:hover { color: var(--vermilion); }

/* 標籤輸入（data-tags） */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-s, 4px); background: var(--sheet); cursor: text; }
.tags:hover { border-color: var(--muted); }
.tags:focus-within { border-color: var(--vermilion); box-shadow: var(--focus); }
.tags__chip { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: #f1e7dc; color: var(--ink); font-size: 15px; line-height: 1; white-space: nowrap; }
.tags__remove { display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.tags__remove:hover, .tags__remove:focus-visible { background: rgba(0, 0, 0, .08); color: var(--ink); }
.tags__input { flex: 1 1 48px; min-width: 48px; width: 48px; height: 32px; margin: 0; padding: 0 4px; border: 0; outline: 0; border-radius: 0; background: transparent; box-shadow: none; font: inherit; font-size: 15px; color: var(--ink); -webkit-appearance: none; appearance: none; }
/* 外框已經有聚焦效果，裡面的輸入區不要再畫框；也隱藏瀏覽器替建議清單加的下拉箭頭 */
.tags__input:focus, .tags__input:focus-visible { outline: 0; box-shadow: none; border-radius: 0; }
.tags__input::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; }
.tags__input::-webkit-list-button { display: none; }
.tags__input:disabled { cursor: default; }
.tags.is-full .tags__input { display: none; }

/* 表格列的操作連結（作者列表：停權、刪除） */
.table__actions { white-space: nowrap; text-align: right; }
.table__actions a { font-size: 14px; margin-left: 12px; }
.table__actions a:first-child { margin-left: 0; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: #7e1d15; }
/* 摺疊區的標題做成連結樣式 */
summary.link-like { cursor: pointer; color: var(--vermilion); font-weight: 500; }
summary.link-like:hover { text-decoration: underline; }

/* 字數提示 */
.char-count { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.char-count.is-ok { color: var(--ok); }

/* ISBN 申請包：封面、書名頁、版權頁預覽與目次 */
.proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.proof-card { margin: 0; display: grid; gap: 8px; }
.proof-card__shot { display: block; aspect-ratio: 1600 / 2263; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; overflow: hidden; }
.proof-card__shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.proof-card__shot--empty { display: grid; place-items: center; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); background: var(--paper); }
.proof-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.proof-toc { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.proof-toc__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.proof-toc__text { margin: 0; max-height: 260px; overflow: auto; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); font-family: var(--font-sans); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
@media (max-width: 640px) {
    .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* KDP 分類建議 */
.panel__foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.kdp-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.kdp-group { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.kdp-group__no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--line-strong); font-weight: 600; font-size: 14px; }
.kdp-group__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }
.kdp-group__reason { grid-column: 1 / -1; }
.kdp-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.kdp-list__top { font-weight: 600; }
.kdp-list__top.is-unknown { color: var(--danger); text-decoration: line-through; }
.kdp-list__path { color: var(--ink-2); }
.kdp-table td { vertical-align: top; }
.kdp-table tr.is-group td { background: var(--paper); }
.kdp-suggest { display: grid; gap: 14px; }
.kdp-suggest__author { margin: 0; font-size: 14px; }
@media (max-width: 720px) {
    .kdp-group { grid-template-columns: minmax(0, 1fr); }
    .kdp-group__fields { grid-template-columns: minmax(0, 1fr); }
}

/* KDP 每週額度、Amazon 上架排隊 */
.kdp-usage { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sheet); padding: 12px 16px; margin-bottom: 20px; display: grid; gap: 6px; }
.kdp-usage.is-full { border-color: #e0b866; background: #fdf6e7; }
.kdp-usage__line { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.kdp-usage__meter b { font-size: 17px; }
.kdp-usage__meter.is-full b { color: var(--danger); }
.kdp-usage__help { margin: 0; font-size: 13px; color: var(--ink-2); }
.kdp-adjust-form { display: grid; gap: 12px; margin-top: 10px; }
.kdp-adjust-form__row { display: grid; grid-template-columns: 120px 120px minmax(0, 1fr); gap: 12px; }
.kdp-steps { display: grid; gap: 14px; margin: 0; padding-left: 1.4em; }
.kdp-steps > li > .stack { margin-top: 8px; }
.kdp-done { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; }
.kdp-done form { display: inline; }
.kdp-queue td { vertical-align: middle; }
.kdp-queue tr.is-suggest td { background: #eef6ee; }
.kdp-queue tr.is-dragging { opacity: .5; }
.kdp-queue__handle { cursor: grab; user-select: none; color: var(--ink-2); font-size: 18px; padding: 0 4px; }
.kdp-queue__order { width: 56px; text-align: center; }
.kdp-queue__note { min-width: 200px; }
.kdp-queue-summary { display: grid; gap: 4px; margin: 0; }
@media (max-width: 720px) {
    .kdp-adjust-form__row { grid-template-columns: 1fr 1fr; }
    .kdp-adjust-form__note { grid-column: 1 / -1; }
}
button.link-like { background: none; border: 0; padding: 0; font: inherit; color: var(--vermilion); text-decoration: underline; cursor: pointer; }
.bisac-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bisac-row { display: grid; grid-template-columns: 32px 150px minmax(0, 1fr); gap: 12px; align-items: start; }
.bisac-row .kdp-group__no { margin-top: 30px; }
.bisac-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.bisac-list code { font-family: inherit; font-weight: 600; font-variant-numeric: tabular-nums; }
.apply-default { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
@media (max-width: 720px) {
    .bisac-row { grid-template-columns: 28px minmax(0, 1fr); }
    .bisac-row > .field:last-child { grid-column: 2; }
}
.channel-fieldset { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.channel-fieldset > legend { padding: 0 6px; font-weight: 600; }

/* 圖片替代文字 */
.alt-guide { margin-bottom: 20px; }
.alt-guide ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 14px; }
.alt-example { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.alt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.alt-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 16px; margin: 0; }
.alt-item.has-error { border-color: var(--danger); }
.alt-item__img { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); display: grid; place-items: center; min-height: 140px; overflow: hidden; }
.alt-item__img img { max-width: 100%; max-height: 260px; display: block; }
.alt-item__fields { display: grid; gap: 8px; align-content: start; }
.alt-actions { margin-top: 20px; position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; }
@media (max-width: 720px) {
    .alt-item { grid-template-columns: minmax(0, 1fr); }
}

/* 後台：作者合約 */
.contract-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.contract-cards__version { margin: 0; font-size: 24px; font-weight: 700; }
.contract-summary { white-space: normal; line-height: 1.8; }
.contract-sub { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.contract-people { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.contract-people li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.contract-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.contract-form__content { font-size: 15px; line-height: 1.8; min-height: 420px; }
.apply-default.has-error { color: var(--danger); }

/* KDP 分類挑選器 */
.kdp-group__path { grid-column: 1 / -1; }
.kdp-warn { color: var(--warn); }
.kdp-picker { position: relative; }
.kdp-picker__list {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: 4px 0; list-style: none; max-height: 320px; overflow-y: auto;
    background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius-s); box-shadow: var(--shadow-pop);
}
.kdp-picker__list [role="option"] { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.kdp-picker__list [role="option"][aria-selected="true"], .kdp-picker__list [role="option"]:hover { background: var(--vermilion-soft); }
.kdp-picker__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kdp-picker__trail { color: var(--muted); }
.kdp-picker__text strong { font-weight: 600; color: var(--ink); }
.kdp-picker__drill { flex: none; font-size: 13px; color: var(--vermilion); padding: 2px 6px; border-radius: var(--radius-s); white-space: nowrap; }
.kdp-picker__drill:hover { background: var(--sheet); text-decoration: underline; }
.kdp-picker__note { padding: 7px 12px; font-size: 13px; color: var(--muted); }

/* KDP 分類樹 */
.kdp-tree-stats { margin: -4px 0 16px; font-size: 14px; }
.kdp-tree-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 20px; align-items: start; }
.kdp-tree-panel__head { flex-wrap: wrap; }
.kdp-tree-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; justify-content: flex-end; }
.kdp-tree-tools .input { flex: 1 1 200px; max-width: 320px; min-height: 36px; }
.kdp-tree-result { margin: 0; padding: 10px 20px 0; font-size: 14px; }
.kdp-tree { position: relative; max-height: calc(100vh - 220px); min-height: 320px; overflow-y: auto; padding: 10px 12px 16px; }
.kdp-tree__list { list-style: none; margin: 0; padding: 0; }
.kdp-tree__list[data-tree-root] { padding-left: 16px; }   /* 左邊留給拖曳握把 */
.kdp-tree__list .kdp-tree__list { margin-left: 11px; padding-left: 12px; border-left: 1px solid var(--line); }
.kdp-tree summary, .kdp-tree__leaf { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; position: relative; padding: 3px 4px 3px 20px; border-radius: var(--radius-s); line-height: 1.5; font-size: 15px; }
.kdp-tree summary { cursor: pointer; list-style: none; }
.kdp-tree summary::-webkit-details-marker { display: none; }
.kdp-tree summary::before { content: ""; position: absolute; left: 6px; top: 50%; margin-top: -4px; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.kdp-tree details[open] > summary::before { transform: rotate(90deg); }
.kdp-tree summary:hover, .kdp-tree__leaf:hover { background: var(--paper); }
.kdp-tree__name { color: var(--ink); text-decoration: none; }
.kdp-tree__name:hover { color: var(--vermilion); text-decoration: underline; }
.kdp-tree__name.is-current { color: var(--vermilion); font-weight: 700; }
.kdp-tree__name.is-match { background: var(--warn-soft); border-radius: 2px; padding: 0 2px; }
.kdp-tree__count { font-size: 12px; color: var(--muted); }
.kdp-tree__note { font-size: 12px; color: var(--info); border: 1px solid #bccfdf; border-radius: 10px; padding: 0 6px; }
.kdp-tree .badge { font-size: 12px; }
.kdp-node-panel { display: grid; gap: 20px; position: sticky; top: 20px; }
.kdp-node__head { display: block; }
.kdp-node__crumbs { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; font-size: 15px; line-height: 1.5; }
.kdp-node__crumbs strong { font-size: 17px; }
.kdp-node__crumbs span { color: var(--muted); }
.kdp-node__meta { margin: 4px 0 0; font-size: 13px; }
.kdp-node__block { border-top: 1px solid var(--line); padding-top: 18px; }
.kdp-node__title { font-size: 15px; margin: 0 0 10px; }
.kdp-node__order { display: flex; flex-wrap: wrap; gap: 6px; }
.kdp-node__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.kdp-node__usage { margin: 0; padding-left: 1.2em; font-size: 14px; display: grid; gap: 4px; }
.kdp-help p { font-size: 14px; }
.kdp-import-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.kdp-import-sum li { display: grid; padding: 10px 16px; min-width: 110px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.kdp-import-sum strong { font-size: 22px; line-height: 1.3; }
.kdp-import-sum span { font-size: 13px; color: var(--muted); }
.kdp-import-warn { margin: 6px 0 0; padding-left: 1.2em; font-size: 14px; }
.kdp-import-list { margin: 8px 0 0; padding-left: 1.6em; font-size: 14px; max-height: 360px; overflow-y: auto; columns: 2 340px; column-gap: 28px; }
.kdp-import-list li { break-inside: avoid; }
.kdp-import-text { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; tab-size: 4; white-space: pre; overflow-x: auto; }
@media (max-width: 960px) {
    .kdp-tree-layout { grid-template-columns: minmax(0, 1fr); }
    .kdp-node-panel { position: static; }
    .kdp-tree-layout.is-selected .kdp-node-panel { order: -1; }
    .kdp-tree { max-height: 70vh; }
}
@media (max-width: 720px) {
    .kdp-tree-tools { justify-content: flex-start; }
    .kdp-tree-tools .input { max-width: none; flex-basis: 100%; }
    .kdp-tree summary, .kdp-tree__leaf { padding-top: 6px; padding-bottom: 6px; }
}
.kdp-node-panel__inner { display: grid; gap: 20px; }
.kdp-node-panel__inner.is-loading { opacity: .55; transition: opacity .15s .12s; }
.kdp-node-flash:empty { display: none; }
.kdp-node-flash .alert { margin: 0; }
/* KDP 分類樹：拖曳排序握把 */
.kdp-tree__drag {
    /* 放在每一列左邊的縮排空白裡，不佔版面，名稱才會對齊 */
    position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 16px; height: 24px; margin: 0; padding: 0;
    border: 0; border-radius: var(--radius-s); background: var(--sheet); color: var(--muted); cursor: grab; touch-action: none;
    opacity: 0; transition: opacity .12s;
}
.kdp-tree__drag svg { width: 10px; height: 16px; fill: currentColor; stroke: none; }
.kdp-tree summary:hover > .kdp-tree__drag, .kdp-tree__leaf:hover > .kdp-tree__drag, .kdp-tree__drag:focus-visible, .kdp-tree.is-sorting .is-dragging .kdp-tree__drag { opacity: 1; }
.kdp-tree__drag:hover { color: var(--ink); background: var(--neutral-soft); }
.kdp-tree.is-sorting, .kdp-tree.is-sorting * { cursor: grabbing !important; user-select: none; }
.kdp-tree li.is-dragging { opacity: .45; }
.kdp-tree li.is-dragging > details > summary, .kdp-tree li.is-dragging > .kdp-tree__leaf { background: var(--neutral-soft); }
.kdp-tree__dropline { position: absolute; height: 2px; background: var(--vermilion); border-radius: 1px; pointer-events: none; z-index: 2; }
.kdp-tree__dropline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--vermilion); background: var(--sheet); }
.kdp-tree .is-drop-into { background: var(--vermilion-soft) !important; box-shadow: inset 0 0 0 2px var(--vermilion); }
.kdp-undo { margin-left: 6px; font-weight: 600; }
.kdp-tree li.is-dropped > details > summary, .kdp-tree li.is-dropped > .kdp-tree__leaf { background: var(--ok-soft); transition: background .6s; }
@media (hover: none) { .kdp-tree__drag { opacity: .6; } }
.kdp-tree.is-sorting li:not(.is-dragging) > details > summary:hover, .kdp-tree.is-sorting li:not(.is-dragging) > .kdp-tree__leaf:hover { background: none; }
.kdp-tree.is-sorting li:not(.is-dragging) .kdp-tree__drag { opacity: 0; }
.kdp-tree.is-sorting .kdp-tree__name:hover { text-decoration: none; color: inherit; }

/* reCAPTCHA：隱藏右下角徽章（表單下方已有揭露文字，Google 允許） */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-note { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.recaptcha-note a { color: inherit; }
.listing-row__note { margin: -2px 0 0; padding: 10px 12px; font-size: 14px; line-height: 1.7; color: var(--ink-soft, var(--ink)); background: var(--paper); border-radius: var(--radius-s); border-bottom: 1px solid var(--line); }
