/* ===================================================================
 * Bytell 漫画馆 · 设计系统 v3
 * 1) 深色书库（多书，边距对齐站点 1200/15）  2) 作品页
 * 3) 双模式阅读器：默认竖滑卷阅 flow，可切一屏页阅 stage
 * 4) 道具化知识插页 / 时间码 / 登场人物表 / 悬念条
 * 品牌：墨黑 #0c0a12 / 热血红 #e4473c / 鎏金 #f2a93b
 * =================================================================== */

:root {
    --ink-0: #0c0a12;
    --ink-1: #15121e;
    --ink-2: #1e1a2a;
    --ink-3: #2a2538;
    --cream: #f4ecdd;
    --cream-dim: #b7ad9e;
    --cream-faint: #7d7588;
    --red: #e4473c;
    --red-deep: #c2332a;
    --amber: #f2a93b;
    --teal: #2fae9d;
    --blue: #4a93d1;
    --purple: #8a5cc0;
    --line: rgba(244, 236, 221, .12);
    --wk: 'LXGW WenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif;
    --sf: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    /* 与站点首页 Bootstrap .container 完全一致的容器宽度断点 */
    --cw: 100%;
}
@media (min-width: 576px)  { :root { --cw: 540px; } }
@media (min-width: 768px)  { :root { --cw: 720px; } }
@media (min-width: 992px)  { :root { --cw: 960px; } }
@media (min-width: 1200px) { :root { --cw: 1140px; } }
@media (min-width: 1400px) { :root { --cw: 1320px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--ink-0);
    color: var(--cream);
    font-family: var(--sf);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { -webkit-user-drag: none; user-select: none; }

/* ================= 顶部条（书库 / 作品页） ================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    /* 与站点首页 Bootstrap .container 左右边距严格对齐（12px 容器内边距） */
    padding-left: max(12px, calc((100% - var(--cw)) / 2 + 12px));
    padding-right: max(12px, calc((100% - var(--cw)) / 2 + 12px));
    background: rgba(12, 10, 18, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cream-dim);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.topbar a:hover { color: var(--amber); }
.topbar .crumb-sep { color: var(--cream-faint); }
.topbar .brand {
    font-family: var(--wk);
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--cream);
}
.topbar .brand b { color: var(--red); }
.topbar .spacer { flex: 1; }
.topbar .pill {
    padding: 3px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red), var(--amber));
    color: #23130a;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.wrap {
    width: 100%;
    max-width: var(--cw);
    margin: 0 auto;
    padding: 0 12px 70px;
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    /* 全站大区块统一 44px；标题与下属内容成组，组内间距交给组件自身 */
    margin: 44px 0 0;
}
.sec-head h2 {
    margin: 0;
    font-family: var(--wk);
    font-size: 1.5rem;
    letter-spacing: 2px;
}
.sec-head span {
    font-size: .7rem;
    letter-spacing: 2px;
    color: var(--cream-faint);
}
.sec-head .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

/* ===================================================================
 * 漫画馆首页 · 书库
 * =================================================================== */
.feature {
    position: relative;
    margin-top: 24px;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 30px;
    align-items: center;
    padding: 30px 34px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background:
        radial-gradient(520px 340px at 88% 12%, rgba(228, 71, 60, .22), transparent 65%),
        radial-gradient(460px 320px at 12% 96%, rgba(242, 169, 59, .13), transparent 60%),
        var(--ink-1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    overflow: hidden;
}
.feature-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .14);
}
.feature-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, .12), transparent 40%);
    pointer-events: none;
}
.feature-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 13px;
    border-radius: 999px;
    border: 1px solid rgba(242, 169, 59, .5);
    color: var(--amber);
    font-size: .72rem;
    letter-spacing: 2px;
    margin-bottom: 14px;
}
.feature h1 {
    margin: 0 0 6px;
    font-family: var(--wk);
    font-size: 3rem;
    letter-spacing: 4px;
    line-height: 1.08;
}
.feature h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--red), var(--amber));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.feature .f-sub {
    margin: 0 0 8px;
    font-family: var(--wk);
    font-size: 1.02rem;
    color: var(--cream-dim);
    letter-spacing: 1px;
}
.feature .f-desc {
    margin: 0 0 18px;
    max-width: 600px;
    font-size: .86rem;
    line-height: 1.85;
    color: var(--cream-dim);
}
.f-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.f-chips span {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    font-size: .72rem;
    color: var(--cream-dim);
}
.f-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* 作品元信息条：话数 / 字数 / 平均分 / 作者 ｜ 我的评分 */
.meta-row {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: 16px;
    padding: 13px 0; margin: 2px 0 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.meta-left { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.meta-right { display: flex; align-items: center; gap: 6px; }
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item i { font-size: 1rem; line-height: 1; color: var(--amber); }
.meta-item .mv { font-weight: 700; font-size: 1rem; color: var(--cream); }
.meta-item .ml { font-size: .78rem; color: var(--cream-faint); margin-left: 2px; }
.meta-item.rate i { color: var(--red); }
.meta-item.rate .mv { color: var(--red); display: inline-block; width: 26px; text-align: center; }
.meta-item.author .mv { color: var(--amber); }
.ur-label { font-size: .82rem; color: var(--cream-dim); white-space: nowrap; }
.ur-tip { font-size: .74rem; color: var(--cream-faint); white-space: nowrap; }
.ur-tip.done { color: var(--teal); }
/* 评分星星 */
.star-rate { display: inline-flex; gap: 1px; margin-left: 4px; cursor: pointer; user-select: none; }
.star-rate i { font-size: .82rem; line-height: 1; color: var(--cream-faint); transition: color .12s; }
.star-rate i.on { color: var(--amber); }
.star-rate i.hover { color: var(--amber); }
.star-rate i.rated { color: var(--red); }
.star-rate.readonly { cursor: default; }
.star-rate.readonly i { pointer-events: none; }
@media (max-width: 576px) {
    .meta-row { gap: 14px; }
    .meta-item .ml { display: none; }
    .meta-left { gap: 14px; }
}
/* 竖排品牌金句栏：仅宽屏（容器 1320）出现，吃掉右侧死空 */
.f-saying { display: none; }

/* 中宽屏（容器 1140）：封面与文案略放宽 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .feature { grid-template-columns: 250px minmax(0, 1fr); }
    .feature .f-desc { max-width: 700px; }
}
/* 宽屏（容器 1320）：封面放大 + 竖排金句第三列 */
@media (min-width: 1400px) {
    .feature {
        grid-template-columns: 280px minmax(0, 1fr) auto;
        gap: 40px;
        padding: 36px 44px;
    }
    .feature h1 { font-size: 3.3rem; }
    .feature .f-sub { font-size: 1.12rem; }
    .feature .f-desc { max-width: 740px; font-size: .9rem; }
    .f-saying {
        display: flex;
        align-self: stretch;
        align-items: center;
        writing-mode: vertical-rl;
        font-family: var(--wk);
        font-size: 1.55rem;
        letter-spacing: 8px;
        line-height: 1.4;
        color: rgba(244, 236, 221, .8);
        white-space: nowrap;
        border-left: 1px solid var(--line);
        padding-left: 28px;
    }
    .f-saying::before,
    .f-saying::after {
        font-size: 1.1em;
        color: var(--amber);
        letter-spacing: 0;
    }
    .f-saying::before { content: '「'; margin-bottom: 10px; }
    .f-saying::after { content: '」'; margin-top: 10px; }
    /* 作品页 hero 同步：封面等比放大，避免留白 */
    .bk-hero { grid-template-columns: 250px 1fr; gap: 34px; }
    .bk-hero h1 { font-size: 2.8rem; }
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .92rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 10px 26px rgba(228, 71, 60, .38); }
.btn-red:hover { background: var(--red-deep); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: var(--cream); background: rgba(255, 255, 255, .05); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-amber { background: var(--amber); color: #2a1c05; box-shadow: 0 10px 26px rgba(242, 169, 59, .32); }
.btn-dark { background: #fff; color: var(--ink-0); }

/* 书架 */
/* ========== 书库轮播 ========== */
.shelf-carousel {
    position: relative;
    /* 与 .shelf-viewport 内边距配合：8 + 18 = 26px（标题→封面），上浮不贴顶 */
    margin-top: 8px;
    --per: 2.15;   /* 移动端露出下一卡 15% 作可滑提示 */
    --gap: 14px;
}
/* 裁切容器内部留白：悬停上浮 5px 与四周红色光晕不被 overflow:hidden 切掉
   （左右负外边距抵消内边距，卡片计算宽度与视口几何保持不变） */
.shelf-viewport { overflow: hidden; padding: 18px 12px 8px; margin: 0 -12px; }
.shelf-track {
    display: flex;
    gap: var(--gap);
    transition: transform .55s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    touch-action: pan-y;
}
.shelf-carousel .book {
    flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
    min-width: 0;
}
.shelf-track.dragging { transition: none; cursor: grabbing; }
.shelf-track.dragging .book-cover { transition: none; transform: none; }

.shelf-nav {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(20, 17, 30, .72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--cream);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.shelf-nav.prev { left: -21px; }
.shelf-nav.next { right: -21px; }
.shelf-nav:hover:not(:disabled) {
    background: var(--red);
    border-color: transparent;
    color: #fff;
}
.shelf-nav:disabled { opacity: .28; cursor: default; }

.shelf-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    /* 抵消 viewport 底部 8px 内边距，指示点位置保持不变 */
    margin-top: 12px;
}
.shelf-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(244, 236, 221, .25);
    cursor: pointer;
    transition: width .3s ease, background .3s ease;
}
.shelf-dot.on { width: 22px; background: var(--amber); }

.book { text-decoration: none; color: inherit; display: block; }
.book-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    background: var(--ink-2);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
    transition: transform .22s ease, box-shadow .22s ease;
}
.book:hover .book-cover {
    transform: translateY(-5px);
    box-shadow: 0 22px 44px rgba(228, 71, 60, .22), 0 10px 26px rgba(0, 0, 0, .5);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover .ribbon {
    position: absolute;
    top: 10px;
    left: -6px;
    padding: 3px 11px 3px 9px;
    background: linear-gradient(135deg, var(--red), var(--red-deep));
    color: #fff;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 0 999px 999px 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.book-cover .veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(8, 7, 14, .85));
}
.book-cover .cover-name {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    font-family: var(--wk);
    font-size: 1.12rem;
    letter-spacing: 1px;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}
.book-meta { margin-top: 9px; }
.book-meta b { display: block; font-size: .88rem; }
.book-meta span { font-size: .7rem; color: var(--cream-faint); }

/* 待开新书：主题色由 --tone 注入，纯 CSS 封面 */
.book-soon { cursor: default; }
.book-soon .book-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    text-align: center;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--tone, #8b7bf0) 34%, transparent);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .028) 0 10px, transparent 10px 22px),
        radial-gradient(130% 95% at 82% -8%, color-mix(in srgb, var(--tone, #8b7bf0) 26%, transparent), transparent 58%),
        linear-gradient(165deg, #181424, #0d0b15 72%);
}
.book-soon:hover .book-cover {
    transform: translateY(-5px);
    box-shadow: 0 22px 44px rgba(228, 71, 60, .22), 0 10px 26px rgba(0, 0, 0, .5);
}
.book-soon .s-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 9px;
    border-radius: 999px;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
}
.book-soon .s-ic {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1.5px dashed color-mix(in srgb, var(--tone) 55%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--tone);
}
.book-soon .s-cap {
    font-family: var(--wk);
    font-size: 1.02rem;
    letter-spacing: 2px;
    line-height: 1.5;
    color: var(--cream);
}
.book-soon .s-cap small {
    display: block;
    font-family: var(--sf);
    font-size: .54rem;
    letter-spacing: 1px;
    opacity: .55;
    margin-top: 3px;
}
.book-soon .book-meta b { color: var(--cream-dim); }

/* 厂牌说明 */
.studio {
    margin-top: 44px;
    padding: 26px 28px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--ink-1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.studio-item i { font-size: 1.4rem; color: var(--amber); }
.studio-item b { display: block; margin: 8px 0 4px; font-size: .95rem; }
.studio-item p { margin: 0; font-size: .76rem; line-height: 1.7; color: var(--cream-dim); }

.foot {
    margin-top: 44px;
    padding: 26px 0 8px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px;
}
.foot-brand { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.foot-slogan {
    margin: 0;
    font-family: var(--wk);
    font-size: 1.34rem;
    line-height: 1.3;
    letter-spacing: 4px;
    color: var(--cream);
}
.foot-slogan span { color: var(--amber); }
.foot-copy { font-size: .72rem; letter-spacing: .5px; color: var(--cream-faint); }
.foot a {
    color: var(--cream-dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.foot a:hover { color: var(--amber); }
/* 动态返回：胶囊按钮，不再是裸链接 */
.foot-back {
    flex: none;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .78rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, .03);
    white-space: nowrap;
}
.foot-back:hover { border-color: var(--amber); background: rgba(242, 169, 59, .08); }
.foot-back i { font-size: .85rem; }
@media (max-width: 600px) {
    .foot { align-items: flex-start; }
    .foot-slogan { font-size: 1.12rem; letter-spacing: 3px; }
    .foot-back { padding: 8px 15px; }
}

/* ===================================================================
 * 作品页
 * =================================================================== */
.bk-hero {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: center;
    padding: 26px 30px;
    border-radius: 22px;
    border: 1px solid var(--line);
    overflow: hidden;   /* 裁切封面图 box-shadow 溢出，避免盖住卡片左下边框 */
    background:
        radial-gradient(500px 300px at 90% 0%, rgba(228, 71, 60, .2), transparent 65%),
        var(--ink-1);
}
.bk-hero .feature-cover { box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.bk-hero h1 { margin: 0 0 4px; font-family: var(--wk); font-size: 2.4rem; letter-spacing: 3px; }
.bk-hero .f-sub { margin-bottom: 12px; }

/* 故事线简介：跟随 .wrap 容器宽度 */
.storyline-p {
    /* 全站统一：.sec-head 标题到下属组件 26px（与漫画馆轮播标题→封面等距） */
    margin: 26px 0 0;
    font-size: .9rem;
    line-height: 2;
    color: var(--cream-dim);
}

/* 人物图鉴 */
.cast-grid {
    display: grid;
    /* auto-fit：五位主角卡片折叠空轨道、均分整行，跟随 .wrap 容器宽度 */
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    /* 全站统一：.sec-head 标题到下属组件 26px（与漫画馆轮播标题→封面等距） */
    margin-top: 26px;
}
.cast-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--ink-1);
    border: 1px solid var(--line);
}
.cast-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 16%;
    background: var(--ink-2);
}
.cast-info { padding: 11px 13px 13px; }
.cast-name { display: flex; align-items: center; gap: 7px; font-family: var(--wk); font-size: 1.15rem; }
.cast-name small {
    font-family: var(--sf);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #fff;
}
.tag-hero { background: var(--red); }
.tag-heroine { background: #d98a2b; }
.tag-mentor { background: var(--teal); }
.tag-foe { background: #6a6578; }
.tag-boss { background: #39476b; }
.cast-info p { margin: 6px 0 0; font-size: .73rem; line-height: 1.65; color: var(--cream-dim); }

/* 企划时间线（话数） */
/* 全站统一：.sec-head 标题到下属组件 26px（与漫画馆轮播标题→封面等距） */
.ep-list { display: grid; gap: 12px; margin-top: 26px; }
.ep {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 15px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--ink-1);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
a.ep:hover { transform: translateY(-2px); border-color: rgba(228, 71, 60, .6); box-shadow: 0 12px 28px rgba(228, 71, 60, .15); }
.ep-no {
    flex: none;
    width: 54px;
    height: 66px;
    border-radius: 10px;
    /* 完结盒集：暗色微渐变 + 发丝描边 + 提亮数字，精致但不抢红色重点 */
    background: linear-gradient(160deg, #2d2836, #231f2b);
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--wk);
    line-height: 1.1;
}
.ep-no b { font-size: 1.6rem; }
.ep-no span { font-size: .6rem; letter-spacing: 2px; color: var(--cream-faint); }
.ep.now .ep-no { background: linear-gradient(160deg, var(--red), var(--red-deep)); border-color: transparent; color: #fff; }
.ep.now .ep-no span { color: rgba(255, 255, 255, .82); }
.ep-body { flex: 1; min-width: 0; }
.ep-body h3 { margin: 0 0 4px; font-size: 1.02rem; font-family: var(--wk); letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.ep-body h3 .new { font-family: var(--sf); font-size: .58rem; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 999px; letter-spacing: 1px; }
.ep-body p { margin: 0 0 7px; font-size: .76rem; line-height: 1.55; color: var(--cream-dim); }
.ep-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ep-tags span { font-size: .62rem; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--cream-dim); }
.ep-go {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ep.lock { opacity: .62; }
.ep.lock .ep-no { background: #252130; color: #6f6878; }
.ep-lock { font-size: .68rem; color: var(--cream-faint); display: inline-flex; gap: 5px; align-items: center; }

/* ===================================================================
 * 阅读器 · 一屏一格剧场
 * =================================================================== */
body.reader { background: var(--ink-0); }

.rd-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 14px;
    color: var(--cream-dim);
    background: linear-gradient(180deg, rgba(10, 8, 16, .92) 0%, rgba(10, 8, 16, .55) 72%, transparent);
}
.rd-bar a { color: var(--cream-dim); text-decoration: none; font-size: .85rem; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; }
.rd-bar a:hover { color: var(--amber); }
.rd-bar .rd-title { font-family: var(--wk); font-size: .86rem; letter-spacing: 2px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-bar .spacer { flex: 1; }
.rd-count {
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    color: var(--cream-dim);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
}
.rd-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--red), var(--amber)); transition: width .12s linear; }

/* 模式切换按钮（顶栏常驻） */
.rd-mode {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .07);
    color: var(--cream-dim);
    font-family: var(--sf);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
}
.rd-mode:hover { color: #fff; border-color: rgba(255, 255, 255, .28); }
.rd-mode i { font-size: .8rem; }

/* ===================================================================
 * 阅读区 · 双模式
 * 默认 flow：竖滑卷阅（webtoon 式连续滚动，分镜节奏可长可短）
 * body.stage：一屏页阅（剧场式单屏，滚动吸附、点击区翻页）
 * =================================================================== */
.reader main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 56px 0 44px;
}

.rd-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 10px;
    overflow: hidden;
    isolation: isolate;
}
/* 卷阅模式：分镜带氛围底的独立卡片，卡间留黑缝形成阅读节奏 */
body.reader:not(.stage) .rd-stage.has-amb {
    width: calc(100% - 16px);
    align-self: center;
    border-radius: 22px;
}

/* 一屏页阅模式 */
html.stage { scroll-snap-type: y proximity; }
body.stage.reader main { gap: 0; padding: 0 0 80px; }
body.stage .rd-stage {
    min-height: 100vh;
    min-height: 100svh;
    padding: 60px 12px 30px;
    scroll-snap-align: start;
}

/* 氛围底：用本格画面模糊铺场 */
.rd-stage.has-amb::before {
    content: '';
    position: absolute;
    inset: -40px;
    background-image: var(--amb);
    background-size: cover;
    background-position: center;
    filter: blur(46px) brightness(.32) saturate(1.15);
    transform: scale(1.12);
    z-index: -2;
}
.rd-stage.has-amb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(8, 7, 14, .72));
    z-index: -1;
}

/* 画框：用比例类决定尺寸，容器查询驱动字号 */
.art {
    --r: .75;
    position: relative;
    /* 卷阅：固定阅读宽度，高度随图片比例自然延展 */
    width: min(calc(100vw - 40px), 560px);
    aspect-ratio: var(--r);
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, .65);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
    background: #14111c;
    container-type: inline-size;
    line-height: 0;
}
.art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.r-916 { --r: 9 / 16; }
.art.r-34 { --r: 3 / 4; }
.art.r-169 { --r: 16 / 9; }
/* 横格在卷阅时放宽，保证电影感 */
.art.wide { width: min(calc(100vw - 32px), 760px); }
/* 页阅模式：宽高同时受视口约束，保证一屏一格不裁切
   预留 168px = 顶栏/舞台上垫 + 时间码条 + 底部翻页胶囊(68)与安全间距，
   避免画框内 .cap 等底部文字被悬浮翻页胶囊遮挡 */
body.stage .art { width: min(calc(100vw - 24px), 620px, calc((100svh - 168px) * var(--r))); }
body.stage .art.wide { width: min(calc(100vw - 32px), 760px, calc((100svh - 168px) * var(--r))); }
/* 悬念屏：画框下方还有 .hook-bar，按其换行行数分档预留高度，防止悬念条被悬浮翻页胶囊遮挡
   预留 R = 悬念条高 + 40 + 2×(翻页胶囊占位68 + 安全间隙)；实测：宽屏 2 行 67→270，窄屏 3 行 87→290 */
body.stage .rd-stage:has(.hook-bar) .art { width: min(calc(100vw - 24px), 620px, calc((100svh - 290px) * var(--r))); }
@media (min-width: 560px) {
    body.stage .rd-stage:has(.hook-bar) .art { width: min(calc(100vw - 24px), 620px, calc((100svh - 270px) * var(--r))); }
}
@media (max-width: 360px) {
    body.stage .rd-stage:has(.hook-bar) .art { width: min(calc(100vw - 24px), 620px, calc((100svh - 310px) * var(--r))); }
}

/* ---------- 叠加层（cqw 随画框缩放） ---------- */
/* 画框底部解说字幕（DD-001 设计决策，2026-10-24 编辑确认，三话及以后默认样式）：
   渐隐只允许发生在顶部内边距区，第一行文字处遮罩必须 ≥.92、到底 ≥.96，
   保证白字与琥珀标签在高亮/杂乱背景上都清晰；软边渐变不用实底条，保持条漫沉浸感。
   渐变坐标相对 .cap 字幕盒自身，非整个画框，3:4 / 16:9 / 9:16 自动等比适配。 */
.cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 9cqw 3.5cqw 1.8cqw;
    font-size: clamp(9.5px, 2.9cqw, 13px);
    line-height: 1.5;
    color: #fff;
    background: linear-gradient(180deg, rgba(10, 8, 16, 0) 0%, rgba(10, 8, 16, .72) 28%, rgba(10, 8, 16, .92) 46%, rgba(10, 8, 16, .96) 100%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .65), 0 0 1px rgba(0, 0, 0, .6);
    display: flex;
    gap: 1.6cqw;
    align-items: baseline;
    pointer-events: none;
}
.cap b { color: var(--amber); font-family: var(--wk); font-size: clamp(10px, 3.2cqw, 14px); letter-spacing: 1px; flex: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 1px rgba(0, 0, 0, .8); }

.bub {
    position: absolute;
    max-width: 74%;
    padding: 2cqw 3cqw;
    background: #fff;
    border: clamp(1.5px, .5cqw, 2.5px) solid #221e2a;
    border-radius: 4cqw;
    font-size: clamp(11.5px, 3.6cqw, 17px);
    line-height: 1.48;
    font-weight: 600;
    color: #221e2a;
    box-shadow: 0 .8cqw 0 rgba(34, 30, 42, .18);
    line-height: 1.5;
}
.bub b { color: var(--red-deep); }
.bub.sm { font-size: clamp(10px, 3.1cqw, 14px); padding: 1.5cqw 2.4cqw; max-width: 60%; }
/* 气泡尾巴：单片 SVG——填充三角 base 在元素顶缘（伸入框内只做同色遮罩盖掉 border），描边 V 画全长但用 clipPath 裁到 y≥4.6（恰为框缘外沿），水平裁口与边框 T 接，故根部无横线、斜边不进框、两侧无缺口 */
.bub::before,
.bub::after {
    content: none;
}
.bub[class*="t-"]::before {
    content: '';
    position: absolute;
    width: clamp(15px, 4cqw, 23px);
    height: clamp(13px, 4cqw, 23px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CclipPath id='tc'%3E%3Crect x='0' y='4.6' width='24' height='19.4'/%3E%3C/clipPath%3E%3C/defs%3E%3Cpath d='M1 0L12 23L23 0Z' fill='%23ffffff'/%3E%3Cpath d='M1 0L12 23L23 0' fill='none' stroke='%23221e2a' stroke-width='2.4' stroke-linejoin='round' clip-path='url(%23tc)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}
/* 下指尾：元素顶缘嵌入框内 E=clamp(2.5px,.75cqw,4.5px) 遮断 border；bottom=-(H-E)；SVG y=6 经缩放恰为 E+border/2，描边在边框中线起笔 */
.bub[class*="t-b"]::before { bottom: clamp(-18.5px, -3.25cqw, -10.5px); }
.bub.t-bl::before { left: 3.4cqw; }
.bub.t-br::before { right: 3.4cqw; }
.bub.t-bm::before { left: 50%; transform: translateX(-50%); }
/* 上指尾：同一图形旋转 180°，同样根部嵌入 */
.bub[class*="t-t"]::before { top: clamp(-18.5px, -3.25cqw, -10.5px); transform: rotate(180deg); }
.bub.t-tl::before { left: 3.4cqw; }
.bub.t-tr::before { right: 3.4cqw; }

.bub.dark { background: #2b2633; color: #fdf4e3; border-color: #17131d; box-shadow: 0 .8cqw 0 rgba(0, 0, 0, .3); }
.bub.dark[class*="t-"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CclipPath id='tc'%3E%3Crect x='0' y='4.6' width='24' height='19.4'/%3E%3C/clipPath%3E%3C/defs%3E%3Cpath d='M1 0L12 23L23 0Z' fill='%232b2633'/%3E%3Cpath d='M1 0L12 23L23 0' fill='none' stroke='%2317131d' stroke-width='2.4' stroke-linejoin='round' clip-path='url(%23tc)'/%3E%3C/svg%3E");
}
.bub.dark b { color: var(--amber); }

.narr {
    position: absolute;
    max-width: 90%;
    padding: 2cqw 3cqw;
    background: rgba(253, 244, 227, .95);
    border-left: .9cqw solid var(--red);
    border-radius: 0 2.6cqw 2.6cqw 0;
    font-family: var(--wk);
    font-size: clamp(10.5px, 3.3cqw, 15.5px);
    line-height: 1.6;
    color: #3a3428;
    box-shadow: 0 .8cqw 3cqw rgba(0, 0, 0, .3);
}
.narr b { color: var(--red-deep); }
.narr.alt { border-left: 0; border-right: .9cqw solid var(--red); border-radius: 2.6cqw 0 0 2.6cqw; }

.os {
    position: absolute;
    max-width: 62%;
    padding: 1.8cqw 2.6cqw;
    background: #f2f0ff;
    border: .5cqw dashed #6b62a8;
    border-radius: 3.6cqw;
    font-size: clamp(9.5px, 3cqw, 14px);
    line-height: 1.5;
    color: #453f73;
    font-weight: 600;
}
.os::before {
    content: '';
    position: absolute;
    width: 2.2cqw;
    height: 2.2cqw;
    min-width: 7px;
    min-height: 7px;
    border-radius: 50%;
    background: #f2f0ff;
    border: 2px solid #6b62a8;
    left: 4.5cqw;
    bottom: -2cqw;
}
.os::after {
    content: '';
    position: absolute;
    width: 1.3cqw;
    height: 1.3cqw;
    min-width: 4px;
    min-height: 4px;
    border-radius: 50%;
    background: #f2f0ff;
    border: 1.5px solid #6b62a8;
    left: 3cqw;
    bottom: -3.6cqw;
}
/* 右拖尾变体：思考者在气泡右下方时使用（拖尾圆点串固定右下，指向右下方角色头部）；默认拖尾在左下 */
.os.dot-r::before { left: auto; right: 4.5cqw; }
.os.dot-r::after { left: auto; right: 3cqw; }

.yell {
    position: absolute;
    max-width: 78%;
    padding: 2.8cqw 3.4cqw;
    background: #fff4d6;
    border: .6cqw solid var(--ink-0);
    font-size: clamp(11.5px, 3.9cqw, 18.5px);
    font-weight: 800;
    line-height: 1.45;
    color: var(--red-deep);
    clip-path: polygon(0% 50%, 6% 28%, 0% 12%, 14% 8%, 18% 0%, 34% 7%, 50% 0%,
        66% 7%, 82% 2%, 84% 14%, 100% 12%, 92% 34%, 100% 52%, 90% 68%, 100% 88%,
        82% 90%, 70% 100%, 52% 94%, 36% 100%, 26% 90%, 8% 94%, 10% 74%, 0% 62%);
    filter: drop-shadow(0 .9cqw 0 rgba(34, 30, 42, .28));
}
.sfx {
    position: absolute;
    font-family: var(--wk);
    font-weight: 700;
    color: #ffe0d8;
    -webkit-text-stroke: .5cqw var(--ink-0);
    text-shadow: .9cqw .9cqw 0 var(--red-deep);
    letter-spacing: 1cqw;
    pointer-events: none;
    user-select: none;
}

/* 封面格叠加：高对比文字系统——任何靓丽画面前都清晰
   策略：顶/底柔光屏 + 磨砂墨色胶囊 + 琥珀描边金章 + 分层文字阴影 */
.cover-art::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 22cqw;
    background: linear-gradient(180deg, rgba(8, 7, 14, .5) 0%, rgba(8, 7, 14, .18) 58%, transparent 100%);
    pointer-events: none;
}
.cover-tag {
    position: absolute;
    top: 4.5cqw;
    left: 5cqw;
    z-index: 1;
    padding: 1.3cqw 3.4cqw;
    border-radius: 999px;
    background: rgba(10, 8, 16, .55);
    border: .35cqw solid rgba(255, 255, 255, .35);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    backdrop-filter: blur(8px) saturate(1.2);
    color: #fff;
    font-size: clamp(9px, 2.8cqw, 12px);
    line-height: 1.5;
    letter-spacing: 2px;
    text-shadow: 0 .35cqw .9cqw rgba(0, 0, 0, .6);
    box-shadow: 0 .8cqw 2.4cqw rgba(0, 0, 0, .3);
}
.cover-topright {
    position: absolute;
    top: 4.5cqw;
    right: 5cqw;
    z-index: 1;
    padding: 1.1cqw 2.8cqw;
    border-radius: 999px;
    background: rgba(10, 8, 16, .55);
    border: .35cqw solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    backdrop-filter: blur(8px) saturate(1.2);
    color: #fff;
    font-size: clamp(8.5px, 2.6cqw, 11px);
    line-height: 1.5;
    text-shadow: 0 .35cqw .9cqw rgba(0, 0, 0, .6);
    box-shadow: 0 .8cqw 2.4cqw rgba(0, 0, 0, .3);
}
.cover-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 17cqw 5.5cqw 6cqw;
    background: linear-gradient(180deg, transparent 0%, rgba(8, 7, 14, .42) 26%, rgba(8, 7, 14, .88) 64%, rgba(8, 7, 14, .96) 100%);
    color: #fff;
}
.cover-ep {
    display: inline-flex;
    align-items: center;
    font-family: var(--wk);
    color: var(--amber);
    letter-spacing: 3px;
    font-size: clamp(10px, 3.1cqw, 14px);
    line-height: 1.5;
    margin: 0 0 2cqw;
    padding: 1.1cqw 2.8cqw;
    border-radius: 999px;
    background: rgba(10, 8, 16, .66);
    border: .35cqw solid rgba(242, 169, 59, .65);
    box-shadow: 0 .8cqw 2.2cqw rgba(0, 0, 0, .35), inset 0 0 2cqw rgba(242, 169, 59, .12);
    text-shadow: 0 .35cqw .9cqw rgba(0, 0, 0, .7);
}
.cover-title {
    margin: 0;
    font-family: var(--wk);
    font-size: clamp(26px, 9.4cqw, 46px);
    line-height: 1.14;
    letter-spacing: 2px;
    text-shadow: 0 .4cqw 1.2cqw rgba(0, 0, 0, .75), 0 1cqw 3.5cqw rgba(0, 0, 0, .55);
}
.cover-hook {
    margin: 2.4cqw 0 0;
    font-size: clamp(10.5px, 3.2cqw, 14.5px);
    color: rgba(255, 255, 255, .92);
    line-height: 1.6;
    text-shadow: 0 .3cqw 1cqw rgba(0, 0, 0, .7);
}

/* ---------- 幕标题页 ---------- */
.rd-stage.act-page {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    /* 卷阅：章节呼吸卡，不全屏压节奏 */
    width: calc(100% - 20px);
    min-height: min(66vh, 580px);
    border-radius: 22px;
    border: 1px solid var(--line);
    background:
        radial-gradient(700px 400px at 50% 110%, rgba(228, 71, 60, .22), transparent 60%),
        var(--ink-0);
}
body.stage .rd-stage.act-page {
    width: auto;
    min-height: 100svh;
    border-radius: 0;
    border: 0;
}
.act-kicker { font-size: .78rem; letter-spacing: 5px; color: var(--cream-faint); }
.act-glyph {
    font-family: var(--wk);
    font-size: clamp(84px, 20vh, 168px);
    line-height: 1;
    background: linear-gradient(160deg, var(--amber), #e07a2f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 20px 60px rgba(242, 169, 59, .25);
}
.act-word { font-family: var(--wk); font-size: clamp(32px, 8vh, 60px); letter-spacing: 14px; text-indent: 14px; margin: 4px 0; }
.act-meta { font-size: .8rem; color: var(--cream-dim); letter-spacing: 1px; }
.act-hint {
    margin-top: 34px;
    font-size: .72rem;
    color: var(--cream-faint);
    animation: floatHint 1.8s ease-in-out infinite;
}
@keyframes floatHint { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(6px); opacity: 1; } }
.act-page.cool { background: radial-gradient(700px 400px at 50% 110%, rgba(47, 174, 157, .2), transparent 60%), var(--ink-0); }
.act-page.cool .act-glyph { background: linear-gradient(160deg, #6fd8c8, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.act-page.gold { background: radial-gradient(700px 400px at 50% 110%, rgba(242, 169, 59, .2), transparent 60%), var(--ink-0); }

/* ---------- 插页通用 ---------- */
.insert-card {
    width: min(680px, calc(100vw - 28px));
    border-radius: 20px;
    padding: 22px 22px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
/* 页阅模式：插页超高时卡内滚动，不被一屏裁切 */
body.stage .insert-card { max-height: calc(100svh - 150px); overflow-y: auto; }
.insert-card::-webkit-scrollbar { width: 5px; }
.insert-card::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }
.insert-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.insert-tag {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--ink-0);
    color: var(--amber);
    font-size: .68rem;
    letter-spacing: 2px;
    border: 1px solid rgba(242, 169, 59, .4);
}
.insert-head h2 { margin: 0; font-family: var(--wk); font-size: 1.5rem; line-height: 1.2; letter-spacing: 2px; }
.insert-head .src { margin-left: auto; font-size: .68rem; color: var(--cream-faint); white-space: nowrap; }

/* 黑板插页 */
.chalk {
    background:
        radial-gradient(300px 160px at 12% 0%, rgba(255, 255, 255, .05), transparent 70%),
        #2a4a3d;
    border: 12px solid #7a5633;
    box-shadow: 0 0 0 3px #5b3e23, 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 60px rgba(0, 0, 0, .28);
    color: #f5f1e4;
    font-family: var(--wk);
}
/* 仅限卡片直接子级 h2；插卡头部 .insert-head 内的 h2 由 .insert-head h2 统管（margin:0 居中对齐徽章） */
.chalk > h2 { font-size: 1.45rem; text-align: center; margin: 0 0 10px; letter-spacing: 3px; text-shadow: 1px 1px 0 rgba(255, 255, 255, .15); }
.chalk .chalk-say { font-size: .76rem; line-height: 1.55; color: rgba(245, 241, 228, .85); margin: 0 0 4px; }
.chalk .chalk-say b { color: #ffd98a; }
.chalk-row { display: grid; gap: 6px; margin: 10px 0 12px; padding: 10px 12px; border: 1.5px dashed rgba(255, 255, 255, .35); border-radius: 10px; }
.chalk-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.chalk-box { border: 2px dashed rgba(255, 255, 255, .65); border-radius: 10px; padding: 9px 5px 8px; text-align: center; }
.chalk-box i { display: block; font-style: normal; font-size: 1.15rem; margin-bottom: 3px; }
.chalk-box b { display: block; font-size: .86rem; letter-spacing: 1px; }
.chalk-box span { display: block; font-size: .6rem; line-height: 1.4; margin-top: 3px; color: rgba(245, 241, 228, .72); font-family: var(--sf); }
.chalk-formula { text-align: center; font-size: .95rem; letter-spacing: 1px; margin: 8px 0 2px; }
.chalk-formula em { font-style: normal; color: var(--amber); padding: 0 3px; }
.chalk-mini { font-family: var(--sf); font-size: .67rem; line-height: 1.55; color: rgba(245, 241, 228, .75); margin: 8px 0 0; }
.chalk-mini b { color: #ffd98a; }

/* 翻牌 · 四张底牌 */
.flips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    perspective: 1200px;
}
.flip { position: relative; aspect-ratio: 2.1 / 1; cursor: pointer; outline: none; }
.flip-in { position: absolute; inset: 0; transition: transform .55s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip-face {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 9px 10px;
}
.flip-front { color: #fff; gap: 4px; }
.flip-front i { font-size: 1.5rem; }
.flip-front b { font-family: var(--wk); font-size: .98rem; letter-spacing: 1px; }
.flip-front span { font-size: .58rem; opacity: .75; letter-spacing: 1px; }
.flip:nth-child(1) .flip-front { background: linear-gradient(150deg, #3f86c2, #2a6298); }
.flip:nth-child(2) .flip-front { background: linear-gradient(150deg, #2fae9d, #1e7d70); }
.flip:nth-child(3) .flip-front { background: linear-gradient(150deg, #e4473c, #b52c24); }
.flip:nth-child(4) .flip-front { background: linear-gradient(150deg, #8a5cc0, #633f96); }
.flip-back {
    transform: rotateY(180deg);
    background: #fffdf4;
    color: #3a3428;
    font-size: .68rem;
    line-height: 1.55;
    justify-content: center;
    gap: 3px;
}
.flip-back b { color: var(--red-deep); font-size: .72rem; }
.flip-hint { text-align: center; font-size: .68rem; color: var(--cream-faint); margin: 10px 0 0; }
.flip-hint i { color: var(--amber); }
.flip-foot { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: .74rem; line-height: 1.6; color: var(--cream-dim); }
.flip-foot b { color: var(--amber); }
.insert-dark { background: var(--ink-1); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); color: var(--cream); }

/* 舞台陈词 */
.speech {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(460px 220px at 50% -10%, rgba(242, 169, 59, .26), transparent 70%),
        radial-gradient(300px 300px at 100% 110%, rgba(228, 71, 60, .14), transparent 70%),
        #1c1826;
    border: 1px solid rgba(242, 169, 59, .35);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.speech-tag { font-size: .7rem; letter-spacing: 2px; color: var(--amber); margin-bottom: 12px; }
.speech p {
    margin: 0 0 10px;
    padding-left: 28px;
    text-indent: -28px;
    font-family: var(--wk);
    font-size: .92rem;
    line-height: 1.75;
    color: #f1e8d8;
}
.speech p:last-of-type { margin-bottom: 0; }
.speech b { color: var(--amber); }
.speech .n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: .68rem;
    font-family: var(--sf);
    margin-right: 7px;
}

/* 军规铭牌 */
.laws { display: grid; gap: 9px; margin: 0; }
.law { display: flex; gap: 12px; align-items: center; padding: 10px 13px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.law-no {
    flex: none;
    width: 37px;
    height: 37px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--wk);
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
}
.law:nth-child(1) .law-no { background: var(--red); }
.law:nth-child(2) .law-no { background: var(--blue); }
.law:nth-child(3) .law-no { background: var(--teal); }
.law:nth-child(4) .law-no { background: var(--purple); }
.law:nth-child(5) .law-no { background: #c47d1e; }
.law b { font-size: .88rem; display: block; }
.law .en { display: block; font-size: .6rem; font-style: italic; color: var(--cream-faint); margin: 1px 0 4px; line-height: 1.35; }
.law p { margin: 0; font-size: .7rem; line-height: 1.55; color: var(--cream-dim); }
.law p em { font-style: normal; color: var(--amber); }
.spectrum { margin: 6px 0 2px; padding: 8px 12px 6px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.spectrum-bar { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, #4a93d1, #2fae9d 55%, #e4473c); margin: 18px 0 11px; }
.spectrum-bar i { position: absolute; top: 11px; transform: translateX(-50%); font-size: .58rem; color: var(--cream-dim); white-space: nowrap; }
.spectrum-bar i::before { content: ''; position: absolute; left: 50%; top: -8px; width: 2px; height: 5px; background: var(--cream-dim); transform: translateX(-50%); }
.spectrum-dot { position: absolute; top: -8px; left: 38%; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--amber); transform: translateX(-50%); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.spectrum-dot::after { content: '大梁的选择'; position: absolute; top: -21px; left: 50%; transform: translateX(-50%); font-size: .58rem; color: var(--amber); font-weight: 700; white-space: nowrap; }

/* 老墨便签 */
.sticky {
    background: #fff3c7;
    color: #4a3a16;
    border-radius: 8px;
    padding: 26px 26px 20px;
    max-width: 480px;
    transform: rotate(-1.2deg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    font-family: var(--wk);
    position: relative;
}
.sticky::before {
    content: '墨缸的便签';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--red);
    color: #fff;
    font-size: .66rem;
    padding: 4px 12px;
    border-radius: 5px;
    letter-spacing: 2px;
}
.sticky p { margin: 5px 0; font-size: 1.05rem; line-height: 1.85; }
.sticky b { color: #b32e26; }
.sticky .sig { text-align: left; font-size: .78rem; color: #9a7d34; margin-top: 8px; padding-left: 2.4em; text-indent: -2.4em; }

/* 章末卡 */
.endcard {
    width: min(560px, calc(100vw - 28px));
    padding: 34px 28px;
    border-radius: 22px;
    background:
        radial-gradient(420px 200px at 80% 0%, rgba(242, 169, 59, .18), transparent 70%),
        var(--ink-1);
    border: 1px solid var(--line);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.endcard .ep { font-family: var(--wk); color: var(--amber); letter-spacing: 4px; font-size: .86rem; }
.endcard h3 { font-family: var(--wk); font-size: 1.5rem; margin: 10px 0 8px; letter-spacing: 2px; }
.endcard p { margin: 0 0 20px; font-size: .8rem; line-height: 1.75; color: var(--cream-dim); }
.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 时间码（画框上方，连续分镜不重复） ---------- */
.tc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100vw - 40px);
    padding: 4px 13px;
    border-radius: 999px;
    background: rgba(20, 17, 28, .66);
    border: 1px solid var(--line);
    color: var(--cream-dim);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.tc i { color: var(--amber); font-size: .78rem; }
.tc span { color: var(--cream-faint); overflow: hidden; text-overflow: ellipsis; }
.tc span::before { content: '\00B7'; margin: 0 8px; color: var(--cream-faint); }

/* ---------- 本话登场人物表 ---------- */
.roster-card {
    width: min(680px, calc(100vw - 28px));
    border-radius: 20px;
    padding: 22px 22px 20px;
    background:
        radial-gradient(420px 240px at 92% -8%, rgba(228, 71, 60, .16), transparent 65%),
        var(--ink-1);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
body.stage .roster-card { max-height: calc(100svh - 150px); overflow-y: auto; }
.roster-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.roster-sub { font-size: .7rem; color: var(--cream-faint); letter-spacing: 1px; }
.roster { display: grid; gap: 10px; }
.roster-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    column-gap: 13px;
    padding: 10px 14px 10px 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
}
.roster-item img {
    grid-row: span 2;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 16%;
    border: 2px solid rgba(242, 169, 59, .5);
    background: var(--ink-2);
    align-self: center;
}
.roster-item b {
    font-family: var(--wk);
    font-size: 1.02rem;
    letter-spacing: 1px;
    align-self: end;
}
.roster-item b i {
    font-family: var(--sf);
    font-style: normal;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(242, 169, 59, .14);
    color: var(--amber);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.roster-item p { margin: 2px 0 0; font-size: .73rem; line-height: 1.55; color: var(--cream-dim); align-self: start; }

/* ---------- 悬念条（画框外，不遮画面） ---------- */
.hook-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(calc(100vw - 48px), 540px);
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(228, 71, 60, .2), rgba(242, 169, 59, .12));
    border: 1px solid rgba(228, 71, 60, .5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    color: var(--cream);
    font-size: .8rem;
    line-height: 1.6;
}
.hook-bar i { flex: none; color: var(--amber); font-size: 1.08rem; }
.hook-bar b { color: var(--amber); }

/* 控制件 */
/* 点击翻页区：仅一屏页阅模式 + 精准指针设备显示（卷阅时不能挡滚动） */
.rd-zone { position: fixed; top: 0; bottom: 0; width: 30%; z-index: 30; display: none; }
.rd-zone.prev { left: 0; }
.rd-zone.next { right: 0; }
.rd-zone { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
    body.stage .rd-zone { display: block; }
    .rd-zone.prev,
    .rd-zone.next { width: 24%; }
}
.rd-ctl {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 40;
    /* 仅页阅模式显示；卷阅时手滑即可，顶栏已有计数与进度 */
    display: none;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(20, 17, 28, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity .3s ease;
}
body.stage .rd-ctl { display: flex; }
/* 页阅模式：高度受限视口（桌面宽屏）下 3:4 画框底边会与悬浮翻页胶囊相切，
   给字幕遮罩加底部内边距把文字抬到胶囊之上；遮罩仍铺满画框，画稿尺寸零改动 */
body.stage .rd-stage .art .cap { padding-bottom: calc(1.8cqw + 20px); }
.rd-ctl button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--cream-dim);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rd-ctl button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rd-ctl .rd-page { font-size: .72rem; color: var(--cream-dim); font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }

/* ================= 响应式 ================= */
@media (max-width: 480px) {
    .insert-head { gap: 8px 10px; flex-wrap: wrap; }
    .insert-head h2 { font-size: 1.12rem; letter-spacing: 1px; flex: 1 1 100%; min-width: 0; white-space: normal; }
    .insert-tag { font-size: .62rem; padding: 3px 9px; letter-spacing: 1px; }
    .insert-head .src { display: none; }
    .spectrum-bar i:nth-child(2) { left: 57% !important; }
}
@media (max-width: 760px) {
    .rd-bar .hide-sm { display: none; }
    /* 窄屏隐藏漫画页头的卷阅切换与页码，与小说页头保持同构（2026-10-28） */
    .topbar .hide-sm { display: none; }
    /* 窄屏隐藏区块标题的附加计数，避免长中文标题被挤折行 */
    .sec-head .hide-sm { display: none; }
    /* 移动端上下堆叠，避免小封面在高卡片中悬空 */
    .feature { grid-template-columns: 1fr; gap: 16px; padding: 20px 18px; align-items: start; }
    .feature h1 { font-size: 2rem; letter-spacing: 2px; }
    .feature .f-desc { font-size: .8rem; }
    .feature .feature-cover { width: 132px; justify-self: start; border-radius: 10px; }
    /* .bk-hero 封面跟随 108px 列宽，避免全局 132px 溢出压住右栏文字 */
    .bk-hero .feature-cover { width: 100%; justify-self: stretch; border-radius: 10px; }
    .bk-hero { grid-template-columns: 108px 1fr; gap: 16px; padding: 20px 18px; }
    .bk-hero h1 { font-size: 1.7rem; letter-spacing: 2px; }
    .studio { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
    /* 轮播箭头收入卡内，避免贴边 */
    .shelf-nav { width: 36px; height: 36px; font-size: .92rem; top: 40%; }
    .shelf-nav.prev { left: 6px; }
    .shelf-nav.next { right: 6px; }
    .sec-head h2 { font-size: 1.28rem; }
}
/* 书库每屏可见卡数（整数为分页步长，小数 2.15 露出下一卡提示可滑） */
@media (min-width: 760px)  { .shelf-carousel { --per: 3; --gap: 18px; } }
@media (min-width: 992px)  { .shelf-carousel { --per: 5; } }
@media (min-width: 1200px) { .shelf-carousel { --per: 6; } }

@media (min-width: 761px) {
    body.stage .rd-stage { padding: 64px 24px 40px; }
    .rd-stage { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .act-hint { animation: none; }
    * { transition: none !important; }
}

/* 矮屏保护：仅页阅模式需要按视口高收紧画框 */
@media (max-height: 720px) {
    body.stage .rd-stage { padding-top: 54px; }
    body.stage .art { width: min(calc(100vw - 24px), 620px, calc((100svh - 168px) * var(--r))); }
    body.stage .art.wide { width: min(calc(100vw - 32px), 760px, calc((100svh - 168px) * var(--r))); }
}

/* ============ 登录 / 用户区（js/auth.js 渲染，2026-10-28） ============ */
/* 全馆深色：给 auth 弹窗（登录 / 注册 / 个人中心）下发深色令牌 */
body.lib,
body.reader {
    --ba-bg: #141c29;
    --ba-fg: #e2e8f0;
    --ba-muted: #94a3b8;
    --ba-border: rgba(148, 163, 184, .22);
    --ba-input-bg: #0d1420;
    --ba-hover: rgba(45, 180, 138, .14);
}

/* 顶部条内的挂载点与按钮尺寸 */
.topbar #user-slot,
.rd-bar #user-slot {
    display: inline-flex;
    align-items: center;
    flex: none;
}

.topbar #user-slot {
    margin-left: 14px;
}

.rd-bar #user-slot {
    margin: 0 2px 0 10px;
}

.topbar .ba-login-btn {
    padding: 5px 15px;
    font-size: 13px;
    font-weight: 600;
}

.rd-bar .ba-login-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 头像按钮：漫画馆深色顶栏下不带外框，只留图标本身（悬停时给极淡的底色提示） */
.topbar .ba-avatar-btn,
.rd-bar .ba-avatar-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    font-size: 19px;
}

.topbar .ba-avatar-btn:hover,
.rd-bar .ba-avatar-btn:hover {
    background: rgba(255, 255, 255, .08);
}

.topbar .ba-user,
.rd-bar .ba-user {
    margin-left: 0;
}

/* 头像下拉菜单：auth.js 默认是 top:100% + margin-top:8px；
   此前误用 top:calc(100%+8px) 与默认 margin 叠加出 16px 间隙，
   超过 ::after 桥接高度（10px），鼠标横穿间隙即触发 mouseleave 收走菜单。
   此处 top 偏移 + margin-top:0 只留 6px 间隙，桥接加宽到 14px 兜底。 */
.topbar .ba-menu,
.rd-bar .ba-menu {
    top: calc(100% + 6px);
    margin-top: 0;
}

.topbar .ba-menu::after,
.rd-bar .ba-menu::after {
    height: 14px;
}
