/* ==========================================================================
   单本小说阅读站 · 补充样式
   依赖 app.css 设计令牌（--brand / --surface / --text / --line ...），
   在此仅新增小说相关组件：书封、目录、阅读器、评论区、催更、更新提醒。
   ========================================================================== */

/* ------------------------------------------------------------------ 书封 */
.book-cover {
    position: relative;
    width: 168px;
    height: 238px;
    border-radius: 10px 14px 14px 10px;
    background: linear-gradient(150deg, #6d8cf0 0%, #7c6de0 42%, #9a5ce0 78%, #f093fb 118%);
    box-shadow: 0 22px 48px rgba(93, 70, 190, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: flex-start;
    padding: 18px 16px;
    flex: none;
    overflow: hidden;
}
.book-cover::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 6px;
    background: rgba(0, 0, 0, 0.18);
}
.book-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 70% at 100% 100%, rgba(255, 255, 255, 0.20), transparent 46%),
        radial-gradient(90% 60% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 50%);
    pointer-events: none;
}
.book-cover__title {
    position: relative;
    z-index: 2;
    font-weight: 800;
    font-size: 20px;
    line-height: 1.35;
    color: #fff;
    letter-spacing: 0.04em;
    writing-mode: vertical-rl;
    max-height: 100%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.book-cover[data-empty="true"] { cursor: default; }
.book-cover img.cover-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}

/* -------------------------------------------------------------- 首页 Hero */
.nv-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: start;
}
@media (max-width: 640px) {
    .nv-hero { grid-template-columns: 1fr; gap: 22px; }
    .book-cover { width: 132px; height: 188px; }
}
.nv-title { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.nv-author { color: var(--text-2); font-weight: 600; margin-top: 2px; }
.nv-author .tagline { color: var(--text-3); font-weight: 500; }
.nv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nv-tag {
    font-size: 12px; font-weight: 700; color: var(--brand-2);
    background: rgba(124, 109, 224, 0.12); border: 1px solid rgba(124, 109, 224, 0.20);
    padding: 4px 11px; border-radius: var(--r-pill);
}
.nv-status { display: inline-flex; align-items: center; gap: 6px; }
.nv-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 169, 122, 0.16); }
.nv-status.is-done .dot { background: var(--text-3); box-shadow: none; }
.nv-intro { color: var(--text-2); line-height: 1.85; margin-top: 14px; max-width: 720px; }
.nv-stats {
    display: flex; flex-wrap: wrap; gap: 26px; margin-top: 20px;
}
.nv-stats .s { display: flex; flex-direction: column; }
.nv-stats .s b { font-size: 20px; font-weight: 800; }
.nv-stats .s span { font-size: 12px; color: var(--text-3); }

.nv-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.nv-remind-badge {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--gold-2); font-weight: 700; font-size: 13px;
    background: rgba(247, 185, 85, 0.14); border: 1px solid rgba(247, 185, 85, 0.26);
    padding: 8px 14px; border-radius: var(--r-pill);
}

/* --------------------------------------------------------------- 章节目录 */
.nv-toc { display: flex; flex-direction: column; }
.nv-toc__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px; flex-wrap: wrap; gap: 8px;
}
.nv-toc-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: var(--r-sm);
    color: var(--text-2); font-weight: 600;
    transition: background var(--t), transform var(--t);
    position: relative;
}
.nv-toc-item:hover { background: var(--surface-2); transform: translateX(2px); color: var(--text); }
.nv-toc-item .idx { width: 30px; color: var(--text-3); font-weight: 700; font-size: 13px; flex: none; }
.nv-toc-item .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-toc-item .meta { font-size: 12px; color: var(--text-3); font-weight: 500; flex: none; }
.nv-toc-item .read-mark { color: var(--ok); font-size: 13px; flex: none; }
.nv-toc-item.is-current {
    background: linear-gradient(135deg, rgba(124, 109, 224, 0.16), rgba(109, 140, 240, 0.10));
    color: var(--brand);
}
.nv-toc-item.is-current .idx, .nv-toc-item.is-current .t { color: var(--brand); }

/* --------------------------------------------------------------- 阅读器 */
body.reader-mode { background: var(--reader-bg, #f3efe4); }
body.reader-mode .app-bg, body.reader-mode .nav, body.reader-mode .tabbar,
body.reader-mode .footer, body.reader-mode .fab, body.reader-mode .cmdk { display: none !important; }

.reader { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; min-height: 100vh; position: relative; }
.reader__bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px; margin-bottom: 8px;
    background: linear-gradient(180deg, var(--reader-bg), rgba(243, 239, 228, 0));
    backdrop-filter: blur(6px);
}
.reader__bar .spacer { flex: 1; }
.reader__bar .crumb { color: var(--text-3); font-size: 13px; }

.reader__article {
    margin: 0 auto;
    max-width: 720px;
    font-family: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", serif;
    color: var(--reader-text, #2a2722);
    line-height: var(--reader-line, 1.9);
    font-size: var(--reader-size, 18px);
    letter-spacing: 0.02em;
}
.reader__article h1 {
    font-size: 26px; font-weight: 800; line-height: 1.4;
    margin: 28px 0 6px; text-align: center;
}
.reader__article .byline { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 30px; }
.reader__article p { margin: 0 0 1.2em; text-align: justify; text-indent: 2em; }

.reader__end { text-align: center; margin: 40px 0 8px; color: var(--text-3); font-size: 13px; }
.reader__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0; }

/* 阅读设置面板 */
.reader-tools {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    display: flex; flex-direction: column; gap: 10px;
}
.reader-tools .round {
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--text);
    box-shadow: var(--shadow-1); border: 1px solid var(--line);
    cursor: pointer; font-size: 17px; transition: transform var(--t), box-shadow var(--t);
}
.reader-tools .round:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.reader-panel {
    position: fixed; right: 18px; bottom: 78px; z-index: 61;
    width: 280px; padding: 18px; border-radius: var(--r-md);
    background: var(--surface-3); border: 1px solid var(--line);
    box-shadow: var(--shadow-2); display: none;
}
.reader-panel.is-show { display: block; }
.reader-panel h4 { margin: 14px 0 10px; font-size: 13px; color: var(--text-3); font-weight: 700; }
.reader-panel h4:first-child { margin-top: 0; }
.reader-panel .opts { display: flex; gap: 8px; }
.reader-panel .opt {
    flex: 1; text-align: center; padding: 8px 0; border-radius: var(--r-xs);
    background: var(--surface-2); border: 1px solid var(--line); cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--text-2); transition: all var(--t);
}
.reader-panel .opt.is-active { background: rgba(124, 109, 224, 0.14); color: var(--brand); border-color: var(--brand); }
.reader-panel .swatches { display: flex; gap: 10px; }
.reader-panel .swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }

/* 抽屉式目录 */
.reader-toc {
    position: fixed; inset: 0; z-index: 70; display: none;
}
.reader-toc.is-show { display: block; }
.reader-toc__mask { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.40); backdrop-filter: blur(2px); }
.reader-toc__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw);
    background: var(--solid); padding: 20px; overflow-y: auto;
    box-shadow: -18px 0 50px rgba(15, 23, 42, 0.25);
}

/* --------------------------------------------------------------- 评论区 */
.cmt-box { display: flex; gap: 12px; align-items: flex-start; }
.cmt-box textarea {
    flex: 1; min-height: 78px; resize: vertical;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-sm); padding: 12px 14px; color: var(--text);
    font: inherit; line-height: 1.6;
}
.cmt-box textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--glow); }

.cmt-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.cmt { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: 0; }
.cmt__avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, #7c6de0, #6d8cf0);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; overflow: hidden;
}
.cmt__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cmt__body { flex: 1; min-width: 0; }
.cmt__name { font-weight: 700; font-size: 14px; color: var(--text); }
.cmt__name .tag-author { font-size: 11px; color: var(--gold-2); background: rgba(247,185,85,0.16); padding: 1px 7px; border-radius: 99px; margin-left: 6px; font-weight: 700; }
.cmt__time { font-size: 12px; color: var(--text-3); margin-left: 8px; font-weight: 500; }
.cmt__content { margin-top: 4px; color: var(--text-2); line-height: 1.75; word-break: break-word; }
.cmt__ref { font-size: 12px; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; margin-bottom: 4px; display: inline-block; }
.cmt__actions { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.cmt__actions button { background: none; border: 0; cursor: pointer; color: inherit; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; }
.cmt__actions button:hover, .cmt__actions button.is-liked { color: var(--brand); }
.cmt__children { margin-left: 44px; padding-left: 14px; border-left: 2px solid var(--line); margin-top: 4px; }

.cmt-empty { text-align: center; padding: 40px 10px; color: var(--text-3); }

/* --------------------------------------------------------------- 通知 */
.notif { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.notif.is-unread { background: rgba(124, 109, 224, 0.10); }
.notif__ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(124,109,224,0.16); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.notif__body { flex: 1; }
.notif__body .t { font-weight: 700; color: var(--text); }
.notif__body .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* -------------------------------------------------------------- 响应式 */
@media (max-width: 640px) {
    .nv-title { font-size: 26px; }
    .nv-hero .book-cover { margin: 0 auto; }
    .nv-cta { flex-direction: column; align-items: stretch; }
    .nv-cta .btn { width: 100%; justify-content: center; }
    .nv-stats { gap: 18px; }
    .reader { padding: 0 16px 40px; }
    .reader__article { font-size: calc(var(--reader-size, 18px) - 1px); }
    .reader__article h1 { font-size: 22px; margin-top: 20px; }
    .reader__nav { grid-template-columns: 1fr; gap: 10px; }
    .reader__nav .btn { width: 100%; justify-content: center; }
    .cmt__children { margin-left: 18px; padding-left: 10px; }
    .cmt-box textarea { font-size: 16px; }
    .reader-tools { right: 12px; bottom: 12px; }
    .reader-panel { right: 12px; bottom: 68px; width: 260px; }
}