/* ============================================================
   全局样式表 - 爱阅读中文网
   色彩体系：玫瑰红 + 梦幻紫 + 暖纸色
   ============================================================ */

/* ===== Vue/模板加载态防闪烁（双层防御） ===== */
/* 第一层：[v-cloak] 属性隐藏（Vue 官方推荐，挂载成功后会被自动移除）。
   但注意 #app 本身同时带 v-cloak 和 app-loading 类时，下面的骨架屏规则会覆盖。 */
[v-cloak] {
    display: none !important;
}

/* 全局 Vue 挂载点加载骨架（在 Vue 脚本加载编译完成前显示） */
/* 骨架屏状态：强制覆盖 [v-cloak] 的 display:none，让骨架能正常显示 */
#app.app-loading {
    display: block !important;
    min-height: 60vh;
    background: var(--bg-page);
    position: relative;
    overflow: hidden;
}

/* ⚠️ 关键修复（2026-09-03）：
   骨架屏状态下，#app 内除 .app-loading-inner 骨架外的所有真实 Vue 模板子元素
   全部强制隐藏，彻底杜绝 {{xxx}} 表达式裸露（Foucault/FOUC）。
   之前的 CSS 只有 [v-cloak] 单层防御，当浏览器缓存旧 CSS 或 Vue 挂载流程
   异常中断导致 v-cloak 属性未被移除时，模板就会直接暴露给用户看到原始代码。
   现在即使 Vue 完全崩溃，骨架屏仍然保持干净，不露出任何模板代码。 */
#app.app-loading > *:not(.app-loading-inner) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 兜底：如果真实模板在更深层也带了 v-cloak 或有内联 display，一并压掉 */
#app.app-loading [v-cloak] {
    display: none !important;
}
#app.app-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%),
        linear-gradient(180deg, #f5f0ea 0%, #efe7dd 100%);
    background-size: 200% 100%, 100% 100%;
    animation: app-loading-shimmer 1.4s infinite linear;
}
#app.app-loading .app-loading-inner {
    position: relative;
    z-index: 999;  /* 骨架层永远置顶，高于任何可能残留的真实内容 */
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
#app.app-loading .skel-bar {
    height: 48px;
    background: rgba(214,51,108,0.08);
    border-radius: 12px;
    width: 100%;
}
#app.app-loading .skel-title {
    height: 32px;
    width: 280px;
    background: rgba(0,0,0,0.06);
    border-radius: 6px;
    margin-top: 20px;
}
#app.app-loading .skel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}
#app.app-loading .skel-card {
    height: 240px;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
#app.app-loading .skel-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: app-loading-shimmer 1.4s infinite;
}
@keyframes app-loading-shimmer {
    0% { background-position: -1000px 0, 0 0; }
    100% { background-position: 1000px 0, 0 0; }
}

/* ===== 设计令牌（CSS变量） ===== */
:root {
    /* 主色调 */
    --primary: #D6336C;
    --primary-dark: #B81E54;
    --primary-light: #E85D8A;
    --primary-gradient: linear-gradient(135deg, #D6336C 0%, #8B5CF6 100%);
    --primary-gradient-hover: linear-gradient(135deg, #B81E54 0%, #7C3AED 100%);
    /* 品牌渐变（与 primary-gradient 同步） */
    --brand-gradient: var(--primary-gradient);
    --brand-gradient-hover: var(--primary-gradient-hover);

    /* 辅助色 */
    --accent: #8B5CF6;
    --accent-light: #A78BFA;
    --accent-dark: #7C3AED;
    --warm-gold: #E8A838;
    --warning: #F59E0B;
    --success: #16A34A;
    --danger: #EF4444;
    --info: #2563EB;

    /* 背景色 */
    --bg-page: #FAF7F2;
    --bg-card: #FFFFFF;
    --bg-hover: #F5F0EA;
    --bg-navbar: rgba(255, 255, 255, 0.88);

    /* 文字色 */
    --text-primary: #2D2A28;
    --text-secondary: #5C5552;
    --text-muted: #9B9491;
    --text-light: #C4BCB8;
    --text-white: #ffffff;

    /* 边框 */
    --border-color: #e9ecef;

    /* 圆角 - 统一三级 */
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;

    /* 阴影 - 统一三级 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* 间距 - 8px 节奏 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* 过渡 */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* 布局 */
    --max-width: 1280px;
    --navbar-height: 64px;

    /* 封面尺寸 - 统一 3:4 竖版比例（小说封面标准）
     * 注意：--cover-ratio 必须是纯小数（0.75），不能写成 "3 / 4"。
     * 原因：calc(var(--l) / var(--ratio)) 做的是纯文本替换，
     * 若变量值是 "3 / 4"，calc 会被解析成 calc(150px / 3 / 4) = 12.5px（左结合），
     * 而不是预期的 150px / 0.75 = 200px。 */
    --cover-ratio: 0.75;
    --cover-xs: 60px;   /* 迷你：排行榜、推荐位 */
    --cover-s: 90px;    /* 小：书单、探索区 */
    --cover-m: 120px;   /* 中：作者中心、首页完本 */
    --cover-l: 150px;   /* 大：首页推荐、主编推荐 */
    --cover-xl: 200px;  /* 超大：作品详情页主封面 */

    /* 封面视觉增强变量 */
    --cover-radius: 8px;
    --cover-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --cover-shadow-hover: 0 6px 20px rgba(0,0,0,0.18);
    --cover-skeleton: linear-gradient(90deg, #f0f1f3 25%, #e4e5e9 50%, #f0f1f3 75%);
    --cover-transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease;

    /* 语义化封面尺寸快捷类 (通过 data-size 属性使用) */
    --cover-xs-h: calc(var(--cover-xs) / var(--cover-ratio));
    --cover-s-h: calc(var(--cover-s) / var(--cover-ratio));
    --cover-m-h: calc(var(--cover-m) / var(--cover-ratio));
    --cover-l-h: calc(var(--cover-l) / var(--cover-ratio));
    --cover-xl-h: calc(var(--cover-xl) / var(--cover-ratio));

    /* 字号层级 */
    --font-xs: 12px;
    --font-sm: 13px;
    --font-base: 14px;
    --font-md: 15px;
    --font-lg: 18px;
    --font-xl: 22px;
    --font-2xl: 28px;
}

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 平滑滚动 - 提升页面导航体验 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 文学字体工具类 - 标题/书名/章节名使用衬线字体，体现文学气质 */
.font-serif, .section-title, .book-title, .chapter-title, .logo, h1, h2, h3 {
    font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', 'Georgia', serif;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

/* ===== 导航栏 - 毛玻璃吸顶 ===== */
.header {
    background: var(--bg-navbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    height: var(--navbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.logo a {
    color: inherit;
    -webkit-text-fill-color: inherit;
}

.nav {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--primary);
    background: rgba(214, 51, 108, 0.06);
}

.nav a.active {
    /* ============================================================
       全站统一导航栏 active 样式：与首页/分类/排行榜/作家区一致
       - 不使用粉色背景色块 + 底部渐变下划线（社区页面不再特殊）
       - 仅粉色加粗文字提示当前页，简洁大气
       ============================================================ */
    color: var(--primary);
    font-weight: 700;
    background: transparent;
    position: relative;
}
/* 移除原有的渐变下划线装饰，避免社区页面出现与其他页面不一致的高亮块 */
.nav a.active::after {
    display: none !important;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border: 2px solid var(--border-color);
    border-radius: 28px;
    overflow: hidden;
    transition: var(--transition-fast);
    flex: 0 1 320px;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.1);
}

.search-box input {
    padding: 8px 16px;
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.search-box button {
    padding: 8px 20px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.search-box button:hover {
    opacity: 0.9;
}

.user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.user-bar a {
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.user-bar a:hover {
    color: var(--primary);
    background: rgba(214, 51, 108, 0.06);
}

/* ===== 容器 ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 32px;
}

/* ===== 区块标题 ===== */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* ===== 书籍列表/卡片 ===== */
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(214, 51, 108, 0.2);
}

.book-card .book-cover {
    width: 100%;
    aspect-ratio: var(--cover-ratio);
    object-fit: cover;
    border-radius: var(--cover-radius) var(--cover-radius) 0 0;
    box-shadow: var(--cover-shadow);
    transition: var(--cover-transition);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.book-card .book-cover:hover {
    box-shadow: var(--cover-shadow-hover);
}

.book-card:hover .book-cover {
    transform: scale(1.04);
}

/* 封面加载骨架屏 */
.book-card .book-cover.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--cover-skeleton);
    background-size: 200% 100%;
    animation: cover-skeleton-loading 1.4s ease-in-out infinite;
    z-index: 1;
}

@keyframes cover-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 封面加载失败占位 */
.book-card .book-cover.is-error {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    background: linear-gradient(135deg, #f0f1f3, #e4e5e9);
}

/* 封面图片淡入效果 */
.book-card .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.book-card .book-cover img.loaded {
    opacity: 1;
}

/* ==================== P0: 全局图片懒加载 ==================== */
/* 原生 loading="lazy" 支持（现代浏览器） */
/* 仅对未加载完成的图片设置透明，避免首屏已加载图片闪烁 */
img[loading="lazy"]:not(.loaded):not(.is-loaded) {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"].is-loaded {
    opacity: 1;
}

/* 懒加载占位骨架 */
img.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lazy-shimmer 1.5s infinite;
}
@keyframes lazy-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 头像懒加载占位 */
.avatar-lazy {
    background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.avatar-lazy::after {
    content: '👤';
    font-size: 0.8em;
    color: #ccc;
}

.book-card .book-body {
    padding: 12px 14px;
}

.book-card .book-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-card .book-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.book-card .book-intro {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.book-card .book-info {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 8px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

.btn-accent {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}
/* 兼容旧类名 */
.btn-orange {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(214, 51, 108, 0.06);
}

.btn-success {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

/* ===== 表单 ===== */
.form-row {
    margin-bottom: var(--space-md);
}

.form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition-fast);
    outline: none;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.06);
    border-radius: var(--border-radius-sm);
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.form-success {
    color: var(--success);
    font-size: 14px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(22, 163, 74, 0.06);
    border-radius: var(--border-radius-sm);
    display: none;
}

.form-success:not(:empty) {
    display: block;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* ===== 标签/徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: rgba(214, 51, 108, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.badge-accent {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
}

.badge-vip {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: white;
}

/* ===== 标签云（分类标签） ===== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    display: inline-block;
    background: var(--bg-card);
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.tag-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ===== 排行榜 ===== */
.ranking-list {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--bg-hover);
}

.rank-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--bg-page);
    color: var(--text-muted);
    flex-shrink: 0;
}

.rank-num.top1 {
    background: #F5A623;
    color: white;
}
.rank-num.top2 {
    background: #95A5A6;
    color: white;
}
.rank-num.top3 {
    background: #C47C3E;
    color: white;
}

/* ===== Tab选项卡 ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab {
    padding: 10px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== 空状态/加载 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 15px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 页脚 ===== */
.footer {
    /* 页脚使用暖墨色背景，沉稳收束页面 */
    background: #2D2A28;
    color: var(--text-light);
    text-align: center;
    padding: 32px 24px;
    margin-top: 60px;
}

.footer a {
    color: var(--text-light);
}

.footer a:hover {
    color: white;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }

    .logo {
        font-size: 18px;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }

    .nav a {
        padding: 6px 12px;
        font-size: 14px;
        white-space: nowrap;
    }

    .search-box {
        flex: 1;
        order: 2;
    }

    .user-bar {
        order: 1;
    }

    .container {
        padding: 20px 16px;
    }

    .book-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .book-card .book-cover {
        /* 使用 aspect-ratio 替代固定高度，自适应卡片宽度 */
    }

    .section-title {
        font-size: 18px;
    }

    .tabs {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .book-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .book-card .book-cover {
        /* 已由 aspect-ratio 自适应 */
    }

    .book-card .book-body {
        padding: 8px 10px;
    }
}

/* ===== 动画工具类 ===== */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    /* 基础样式：柔和淡色背景 + 边框 + 阴影，确保在任何背景下都清晰可见 */
    background: #FFFFFF;
    color: var(--text-primary, #111827);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-left: 5px solid var(--primary);
    animation: slideInRight 0.3s ease;
    max-width: 320px;
}

.toast-item.success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    border-left-color: var(--success);
    color: #065F46;
}
.toast-item.danger {
    background: #FEF2F2;
    border-color: #FECACA;
    border-left-color: var(--danger);
    color: #991B1B;
}
.toast-item.warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    border-left-color: var(--accent);
    color: #92400E;
}
.toast-item.info {
    background: #FDF2F8;
    border-color: #F9A8D4;
    border-left-color: var(--primary);
    color: #9D174D;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   UI 增强（骨架屏 / Toast / 空状态 / 补充组件）
   ============================================================ */

/* ===== 骨架屏（加载占位） ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    line-height: 1;
}
@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.skeleton-text { width: 100%; height: 14px; margin: 4px 0; }
.skeleton-text.short { width: 60%; }
.skeleton-cover { width: 100%; aspect-ratio: 3/4; border-radius: var(--border-radius-sm); }
.skeleton-card { width: 100%; height: 120px; border-radius: var(--border-radius); }

/* ===== Toast 布局增强 ===== */
.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.toast-item.success::before { background: var(--success); }
.toast-item.danger::before  { background: var(--danger); }
.toast-item.warning::before { background: var(--warning, var(--accent)); }
.toast-item.info::before    { background: var(--primary); }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    font-size: 72px;
    color: #dde0e6;
    margin-bottom: 20px;
    display: block;
}
.empty-state h3 {
    color: var(--text-secondary);
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 500;
}
.empty-state p {
    margin: 0 0 20px;
    font-size: 14px;
}
.empty-state .btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== 补充按钮类 ===== */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(214, 51, 108, 0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 51, 108, 0.3);
}
.btn-primary-gradient {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-primary-gradient:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 51, 108, 0.3);
    color: white;
}

/* ===== 移动端适配补丁（详情页/阅读器/操作栏） ===== */
@media (max-width: 768px) {
    /* 作品详情页：信息区竖排 */
    .book-info,
    .book-detail-info {
        flex-direction: column !important;
        gap: 16px !important;
    }
    .book-info .book-cover,
    .book-detail-info .book-cover {
        width: var(--cover-m) !important;
        height: var(--cover-m-h) !important;
        margin: 0 auto !important;
    }
    /* 操作按钮区域：允许换行 + 等分布局 */
    .action-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .action-bar .btn,
    .action-bar button {
        flex: 1 1 calc(50% - 4px);
        min-width: 0 !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    .chapter-content {
        padding: 16px 12px !important;
        font-size: 16px !important;
    }
    /* 统计栏横向滚动 */
    .book-stats {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        gap: 16px !important;
        padding-bottom: 4px;
    }
    .book-stats::-webkit-scrollbar { height: 4px; }
    /* 评论区表单竖排 */
    .comment-form {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    /* 操作按钮：极小屏单列 */
    .action-bar .btn,
    .action-bar button {
        flex: 1 1 100%;
    }
}

/* ===== 表格容器横向滚动（防溢出） ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
}

/* ===== 键盘可访问性 ===== */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== 徽章/标签 ===== */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

/* ===== 页脚 ===== */
.footer-enhanced {
    background: #1A1715;
    color: #D4C8C0;
    border-top: 1px solid var(--border-color);
    padding: 56px 32px 24px;
    margin-top: 60px;
}

/* 页脚网格布局 - 更宽敞的列间距 */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.footer-enhanced .footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}
.footer-enhanced .footer-brand h4 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}
.footer-enhanced .footer-brand p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}
.footer-enhanced .footer-col h5 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}
.footer-enhanced .footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-enhanced .footer-col li {
    margin-bottom: 8px;
}
.footer-enhanced .footer-col a {
    color: var(--text-muted);
    font-size: 13px;
    transition: var(--transition-fast);
}
.footer-enhanced .footer-col a:hover {
    color: var(--primary);
}
.footer-enhanced .footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .footer-enhanced .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}
@media (max-width: 480px) {
    .footer-enhanced .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ===== 深色模式支持 - 暖色暗调，延续文学气质 ===== */
[data-theme="dark"] {
    --bg-page: #1A1520;
    --bg-card: #261F2D;
    --bg-hover: #362B3F;
    --bg-navbar: rgba(38, 31, 45, 0.88);
    --text-primary: #F5EDE8;
    --text-secondary: #D4C8C0;
    --text-muted: #9B8E88;
    --text-light: #6B5E58;
    --border-color: #3A2F3D;
}
[data-theme="dark"] body {
    background: var(--bg-page);
    color: var(--text-primary);
}
[data-theme="dark"] .header {
    background: var(--bg-navbar);
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .book-card,
[data-theme="dark"] .data-card,
[data-theme="dark"] .stat-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}
[data-theme="dark"] .nav a {
    color: var(--text-secondary);
}
[data-theme="dark"] .nav a:hover {
    background: rgba(214, 51, 108, 0.15);
}
[data-theme="dark"] .nav a.active {
    /* 深色模式：同样移除色块背景，与全站首页/分类等导航栏风格统一 */
    background: transparent;
    color: var(--primary-light);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #1a1520;
    border-color: #3a2d45;
    color: var(--text-primary);
}

/* ===== 右侧浮动快捷栏 ===== */
.floating-quick-bar {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* 默认状态：半透明 + 缩小，鼠标悬停后完全展开 */
    opacity: 0.55;
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
    /* 鼠标快速穿过时不闪烁：容器自身维持 hover 区域，padding 扩大感应带 */
    padding: 12px 6px 12px 0;
    margin-right: -6px;
}
/* 鼠标移到右侧悬浮栏区域（或其延伸感应区）就展开为清晰显示 */
.floating-quick-bar:hover {
    opacity: 1;
    filter: saturate(1.05);
}
/* 鼠标悬停时，每个按钮从缩小恢复正常（轻微放大动画） */
.floating-quick-bar .fqb-item {
    transform: scale(0.9);
    transform-origin: right center;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                background 0.25s ease,
                color 0.25s ease,
                box-shadow 0.25s ease,
                border-color 0.25s ease;
}
.floating-quick-bar:hover .fqb-item {
    transform: scale(1);
}
.fqb-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #4B5563;
    padding: 8px 4px;
}
.fqb-item:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(214,51,108,0.2), 0 2px 6px rgba(0,0,0,0.06);
    border-color: rgba(214,51,108,0.35);
    color: var(--primary);
}
.fqb-item svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.fqb-item .fqb-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    color: inherit;
    white-space: nowrap;
}
.fqb-item .fqb-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #1F2937;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.fqb-item .fqb-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1F2937;
}
.fqb-item:hover .fqb-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}
.fqb-item.fqb-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
}
.fqb-item.fqb-primary:hover {
    box-shadow: 0 8px 24px rgba(214,51,108,0.35);
    color: #fff;
}
.fqb-item.fqb-primary svg {
    stroke: #fff;
}
.fqb-item.fqb-primary .fqb-label {
    color: #fff;
}
.fqb-divider {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08), transparent);
    margin: 2px auto;
}

/* 按钮激活态（阅读器：书签/设置） */
.fqb-item.fqb-active,
.fqb-item.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}
.fqb-item.fqb-active svg,
.fqb-item.active svg {
    stroke: #fff;
}
.fqb-item.fqb-active .fqb-label,
.fqb-item.active .fqb-label {
    color: #fff;
}
.fqb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239,68,68,0.4);
    border: 2px solid #fff;
}
[data-theme="dark"] .fqb-item {
    background: rgba(42,34,53,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-color: rgba(255,255,255,0.08);
    color: #D4C8C0;
}
[data-theme="dark"] .fqb-item:hover {
    background: #3A2D45;
    border-color: rgba(214,51,108,0.4);
}
[data-theme="dark"] .fqb-item .fqb-tooltip {
    background: #1A1520;
}
[data-theme="dark"] .fqb-item .fqb-tooltip::after {
    border-left-color: #1A1520;
}
[data-theme="dark"] .fqb-divider {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
@media (max-width: 768px) {
    .floating-quick-bar {
        right: 8px;
        gap: 6px;
        /* 移动端不做隐藏半透明效果，避免 hover 难以触发 */
        opacity: 1;
        padding: 0;
        margin-right: 0;
    }
    .fqb-item {
        width: 56px;
        height: 56px;
        padding: 6px 3px;
        gap: 3px;
    }
    .floating-quick-bar .fqb-item {
        transform: none; /* 移动端不缩小 */
    }
    .floating-quick-bar:hover .fqb-item {
        transform: none; /* 移动端不做放大动画 */
    }
    .fqb-item svg {
        width: 22px;
        height: 22px;
    }
    .fqb-item .fqb-label {
        font-size: 10px;
    }
    .fqb-item .fqb-tooltip {
        display: none;
    }
    .fqb-divider {
        width: 36px;
    }
}

/* 阅读器夜间模式：浮动快捷栏适配 */
body.night-mode .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active),
body.reader-night .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active) {
    background: rgba(42, 32, 53, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-color: rgba(255,255,255,0.08);
    color: #D4C8C0;
}
body.night-mode .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active) .fqb-label,
body.reader-night .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active) .fqb-label {
    color: #C8BDB5;
}
body.night-mode .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active):hover,
body.reader-night .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active):hover {
    border-color: rgba(214,51,108,0.4);
    color: var(--primary-light);
}
body.night-mode .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active):hover .fqb-label,
body.reader-night .fqb-item:not(.fqb-primary):not(.fqb-active):not(.active):hover .fqb-label {
    color: var(--primary-light);
}
body.night-mode .fqb-item .fqb-tooltip,
body.reader-night .fqb-item .fqb-tooltip {
    background: #1A1520;
}
body.night-mode .fqb-item .fqb-tooltip::after,
body.reader-night .fqb-item .fqb-tooltip::after {
    border-left-color: #1A1520;
}
body.night-mode .fqb-divider,
body.reader-night .fqb-divider {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.7);
}
[data-theme="dark"] .modal {
    background: var(--bg-card) !important;
}
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
    background-size: 400% 100%;
}
[data-theme="dark"] .empty-state .empty-icon {
    color: #475569;
}

/* ============================================================
   通用模态框（Modal）样式
   用于：打赏、投票、举报、分享等所有前台弹窗
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}
.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: var(--bg-hover);
    color: var(--primary);
    transform: rotate(90deg);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* 小模态框（确认/提示用） */
.modal-sm {
    max-width: 400px;
}

/* 大模态框（打赏/投票用） */
.modal-lg {
    max-width: 560px;
}

/* ============================================================
   通用下拉菜单（Dropdown）样式
   用于：更多操作、工具栏菜单
   ============================================================ */
.more-actions {
    position: relative;
    display: inline-block;
}
.more-btn {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 15px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.more-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}
.more-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 100;
    display: none;
    overflow: hidden;
    animation: dropdownIn 0.18s ease;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.more-dropdown.show { display: block; }
.more-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}
.more-dropdown-item:hover {
    background: rgba(214, 51, 108, 0.06);
    color: var(--primary);
}

/* ============================================================
   打赏组件（Reward）样式
   用于：作品详情页、阅读页打赏弹窗
   ============================================================ */
.reward-section { margin-top: 20px; }
.reward-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.reward-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    background: white;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
}
.reward-btn:hover {
    background: rgba(214, 51, 108, 0.06);
    transform: translateY(-1px);
}
.reward-btn.selected {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(214, 51, 108, 0.3);
}
.reward-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 520px) {
    .reward-options { grid-template-columns: repeat(3, 1fr); }
}
.reward-option {
    padding: 16px 6px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}
.reward-option:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.reward-option.selected {
    border-color: var(--primary);
    background: rgba(214, 51, 108, 0.06);
    color: var(--primary);
}
.reward-option .amount {
    font-size: 20px;
    font-weight: 700;
}
.reward-option .unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   月票/推荐票投票组件样式
   用于：作品详情页投月票、投推荐票
   ============================================================ */
.ticket-count-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(214, 51, 108, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}
.ticket-count-number {
    font-size: 40px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.ticket-count-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}
.ticket-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 520px) {
    .ticket-options { grid-template-columns: repeat(3, 1fr); }
}
.ticket-option {
    padding: 14px 6px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 600;
    user-select: none;
}
.ticket-option:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.ticket-option.selected {
    border-color: var(--primary);
    background: rgba(214, 51, 108, 0.08);
    color: var(--primary);
}
.ticket-option .num { font-size: 20px; }
.ticket-option .unit { font-size: 12px; color: var(--text-muted); }

/* 举报弹窗 */
.report-type { margin-bottom: 16px; }
.report-content textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: var(--transition-fast);
    background: var(--bg-page);
    color: var(--text-primary);
}
.report-content textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.12);
    background: var(--bg-card);
}

/* ============================================================
   评论/楼中楼（Comment）样式
   用于：作品详情页评论、阅读页本章说、回复列表
   ============================================================ */
.comment-section { margin-top: 40px; }
.comment-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}
.comment-input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
    font-family: inherit;
    background: var(--bg-page);
    color: var(--text-primary);
    transition: var(--transition-fast);
}
.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.12);
    background: var(--bg-card);
}
.comment-submit {
    text-align: right;
    margin-bottom: 20px;
}
.comment-list { margin-top: 20px; }
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.comment-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-nickname {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}
.comment-time {
    font-size: 12px;
    color: var(--text-muted);
}
.comment-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 8px;
}
.comment-user-info { flex: 1; }
.comment-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.comment-footer {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.comment-footer span {
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-footer span:hover { color: var(--primary); }
.comment-footer .liked { color: var(--primary); }
.empty-comments {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}
.comment-input-wrap {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.comment-input-wrap textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    resize: vertical;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-page);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: var(--transition-fast);
}
.comment-input-wrap textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.12);
}
.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.comment-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 0;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.comment-action-btn:hover { color: var(--primary); }
.comment-action-btn.liked { color: var(--primary); }
.comment-action-btn .like-icon { margin-right: 3px; }
.reply-toggle {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 0;
}
.reply-toggle:hover { text-decoration: underline; }
.reply-list-wrap {
    margin-left: 46px;
    margin-top: 10px;
}
.reply-list {
    padding: 8px 14px;
    background: var(--bg-page);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--border-color);
}
/* 多级嵌套：下级回复列表视觉上更紧凑，依靠左侧边框区分层级 */
.reply-list .reply-list {
    margin-top: 8px;
    padding: 6px 10px;
}
.reply-loading {
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 13px;
}
.reply-item {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}
.reply-item:last-child { border-bottom: none; }
.reply-item .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.reply-nickname {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}
.reply-arrow {
    color: var(--text-muted);
    font-size: 12px;
}
.reply-target {
    color: var(--text-secondary);
    font-size: 13px;
}
.reply-content {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 13px;
}
.reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.reply-time {
    font-size: 12px;
    color: var(--text-muted);
}
.reply-meta-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.reply-input-box {
    margin-left: 46px;
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.reply-input-box textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    resize: vertical;
    min-height: 56px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
    background: var(--bg-page);
    color: var(--text-primary);
}
.reply-input-box textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.12);
}
.reply-input-box .btn {
    padding: 8px 16px;
    white-space: nowrap;
}

/* ============================================================
   阅读器（Reader）样式
   包括：日夜模式、设置面板、目录面板、书签、快捷操作
   ============================================================ */

/* 日夜模式切换 */
body.reader-day { background: #f8f6f1; }
body.reader-day .chapter-content { background: white; color: #333; }
body.reader-day .chapter-header { background: white; }
body.reader-day .catalog-panel { background: white; }
body.reader-day .catalog-item { color: #333; }
body.reader-day .catalog-item:hover { background: #f5f5f5; }
body.reader-eye { background: #e8f5e9; }
body.reader-eye .chapter-content { background: #f1f8e9; color: #2e7d32; }
body.reader-eye .chapter-header { background: #f1f8e9; }
body.reader-eye .catalog-panel { background: #f1f8e9; }
body.reader-eye .catalog-item { color: #2e7d32; }
body.reader-eye .catalog-item:hover { background: #dcedc8; }
body.reader-night { background: #2D2A28; }
body.reader-night .chapter-content { background: #16213e; color: #c0c0c0; }
body.reader-night .header { background: #0f0f1a; }
body.reader-night .chapter-header { background: #16213e; }
body.reader-night .chapter-title { color: #c0c0c0; }
body.reader-night .chapter-info { color: #666; }
body.reader-night .vip-notice { background: #2D2A28; border-color: #333; color: #c0c0c0; }
body.reader-night .catalog-panel { background: #16213e; }
body.reader-night .catalog-item { color: #c0c0c0; }
body.reader-night .catalog-item:hover { background: #0f3460; }
body.reader-night .catalog-title { color: #c0c0c0; }
body.reader-night .comment-input-wrap { background: #16213e; border-color: #333; }
body.reader-night .comment-input-wrap textarea { background: #2D2A28; color: #c0c0c0; border-color: #333; }
body.reader-night .comment-item { border-bottom-color: #333; }
body.reader-night .quick-action-btn { background: #16213e; border-color: #333; color: #c0c0c0; }
body.reader-night .quick-action-btn:hover { border-color: var(--primary); }
body.reader-night .bookmark-btn { background: #16213e; color: #c0c0c0; }
body.reader-night .bookmark-btn.active { background: var(--primary-gradient); color: white; }
body.reader-night .bookmark-section-header { color: #c0c0c0; }
body.reader-night .bookmark-item:hover { background: #0f3460; }
body.reader-night .bookmark-item .bm-title { color: #c0c0c0; }

/* 阅读器章节区域 */
.chapter-header {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}
.chapter-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.chapter-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.chapter-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    line-height: 2;
    font-size: 18px;
    color: var(--text-primary);
    /* 默认正文字体栈：前台统一，可被后台配置或用户偏好覆盖 */
    font-family: "Source Han Serif SC", "Noto Serif SC", "SimSun", "宋体", "PingFang SC", "Microsoft YaHei", serif;
    /* 自动排版：强制换行 + 断词，避免长文本撑破容器 */
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    hyphens: auto;
}
.chapter-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
}
.nav-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
}
.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(214, 51, 108, 0.35);
}
.nav-btn:disabled {
    background: var(--text-light) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.vip-notice {
    background: linear-gradient(135deg, rgba(214, 51, 108, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(214, 51, 108, 0.25);
    padding: 24px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    margin-bottom: 20px;
}
.vip-notice p { margin-bottom: 12px; color: var(--text-secondary); }
.vip-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(214, 51, 108, 0.3);
    transition: var(--transition-fast);
}
.vip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 51, 108, 0.4);
}

/* ===== 阅读设置面板（展开时由JS动态定位到设置按钮左侧） ===== */
.settings-content {
    position: fixed;
    display: none;
    padding: 16px;
    min-width: 240px;
    max-width: 280px;
    z-index: 999;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-xl);
}
.settings-content.show { display: block; }
.setting-item { margin-bottom: 16px; }
.setting-item:last-child { margin-bottom: 0; }
.setting-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}
.mode-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.mode-btn {
    padding: 8px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    text-align: center;
    font-weight: 500;
}
.mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.mode-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(214, 51, 108, 0.3);
}
.font-size-slider {
    width: 100%;
    accent-color: var(--primary);
}
.font-size-value {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    float: right;
}
.line-spacing-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* 快捷操作按钮 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 640px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
.quick-action-btn {
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.quick-action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.quick-action-btn .emoji { font-size: 24px; }
.quick-action-btn .label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 浮动目录按钮（保留旧类，防未迁移页面异常） */
.catalog-btn {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(214, 51, 108, 0.4);
    display: none; /* 已迁移至 floating-quick-bar */
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

/* 目录面板（抽屉式） */
.catalog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.catalog-overlay.show {
    display: block;
    opacity: 1;
}
.catalog-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.catalog-panel.show { transform: translateX(0); }
.catalog-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}
.catalog-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}
.catalog-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.catalog-close:hover {
    background: var(--bg-hover);
    color: var(--primary);
}
.catalog-list {
    padding: 8px 0;
    flex: 1;
}
.catalog-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    transition: background 0.2s, padding-left 0.2s;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.catalog-item:hover {
    background: rgba(214, 51, 108, 0.05);
    padding-left: 26px;
    color: var(--primary);
}
.catalog-item.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(214, 51, 108, 0.08);
    border-left: 3px solid var(--primary);
}
.catalog-item .price {
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(214, 51, 108, 0.08);
}
.catalog-item .price.trial {
    color: var(--success, #16A34A);
    background: rgba(22, 163, 74, 0.1);
}
.catalog-item .price.vip {
    color: var(--warning, #F59E0B);
    background: rgba(245, 158, 11, 0.1);
}
.catalog-item .price.subscribed {
    color: var(--text-muted);
    background: var(--bg-page);
}
.catalog-item .price.login-required {
    color: var(--text-muted);
    background: var(--bg-page);
    font-size: 11px;
}
.catalog-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 旧独立书签按钮样式（已迁移至 floating-quick-bar） */
.bookmark-btn {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border-color);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    display: none;
    align-items: center;
    justify-content: center;
}
.bookmark-section {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}
.bookmark-section-header {
    padding: 14px 20px 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.bookmark-section-header .count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
}
.bookmark-list { padding: 0 0 10px; }
.bookmark-item {
    padding: 10px 20px 10px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: background 0.2s;
    position: relative;
    padding-right: 40px;
}
.bookmark-item:hover { background: var(--bg-hover); }
.bookmark-item .bm-title {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bookmark-item .bm-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 3px;
}
.bookmark-item .bm-preview {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bookmark-item .bm-delete {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: var(--transition-fast);
}
.bookmark-item .bm-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}
.bookmark-empty {
    padding: 16px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* 作品标签 */
.book-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.book-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: rgba(214, 51, 108, 0.08);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
}
.book-tag:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(214, 51, 108, 0.25);
}

/* 交互选项卡（本章说/作品评论） */
.interaction-section { margin-top: 40px; }
.interaction-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}
.interaction-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
}
.interaction-tab:hover { color: var(--primary); }
.interaction-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 作品详情页组件 */
.book-detail {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}
.book-info {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.book-cover {
    width: var(--cover-xl);
    height: var(--cover-xl-h);
    object-fit: cover;
    border-radius: var(--cover-radius);
    flex-shrink: 0;
    box-shadow: var(--cover-shadow);
    transition: var(--cover-transition);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.book-cover:hover {
    transform: translateY(-4px);
    box-shadow: var(--cover-shadow-hover);
}

/* 详情页封面加载骨架屏 */
.book-cover.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--cover-skeleton);
    background-size: 200% 100%;
    animation: cover-skeleton-loading 1.4s ease-in-out infinite;
    z-index: 1;
    border-radius: inherit;
}

/* 详情页封面图片淡入 */
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.book-cover img.loaded {
    opacity: 1;
}

/* 详情页封面加载失败 */
.book-cover.is-error::before {
    content: '暂无封面';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f1f3, #e4e5e9);
    color: #999;
    font-size: 14px;
    z-index: 1;
}
.book-meta {
    flex: 1;
    min-width: 260px;
}
.book-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.3;
}
.book-author {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 500;
}
.book-intro {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-top: 16px;
}
.book-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px 16px;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 13px;
}
.book-stats span {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.action-bar {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.chapter-list { margin-top: 32px; }
.chapter-list-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chapter-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
    border-radius: 6px;
}
.chapter-item:hover {
    background: rgba(214, 51, 108, 0.04);
    padding-left: 22px;
}
.chapter-name {
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}
.chapter-name:hover { color: var(--primary); }
.chapter-price {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 10px;
    background: rgba(214, 51, 108, 0.08);
}
.chapter-price.trial {
    color: var(--success, #16A34A);
    background: rgba(22, 163, 74, 0.1);
}
.chapter-price.vip {
    color: var(--warning, #F59E0B);
    background: rgba(245, 158, 11, 0.1);
}
.chapter-price.subscribed {
    color: var(--text-muted);
    background: var(--bg-page);
}
.chapter-price.login-required {
    color: var(--text-muted);
    background: var(--bg-page);
    font-size: 12px;
}
.chapter-item .chapter-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 12px;
    flex-shrink: 0;
}

/* 输入框错误态 */
.input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-page);
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.12);
    background: var(--bg-card);
}

/* 深色模式下新增组件适配 */
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.75); }
[data-theme="dark"] .book-detail,
[data-theme="dark"] .chapter-header,
[data-theme="dark"] .chapter-content { background: var(--bg-card); }

/* 深色模式封面适配 */
[data-theme="dark"] .book-cover {
    background: linear-gradient(135deg, #2a2d35, #1f2128);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
[data-theme="dark"] .book-cover.is-error::before {
    background: linear-gradient(135deg, #2a2d35, #1f2128);
    color: #666;
}
[data-theme="dark"] .book-cover.is-loading::after {
    background: linear-gradient(90deg, #2a2d35 25%, #353840 50%, #2a2d35 75%);
}
[data-theme="dark"] .book-card .book-cover {
    background: linear-gradient(135deg, #2a2d35, #1f2128);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .book-card .book-cover.is-loading::before {
    background: linear-gradient(90deg, #2a2d35 25%, #353840 50%, #2a2d35 75%);
}
[data-theme="dark"] .book-card .book-cover.is-error {
    background: linear-gradient(135deg, #2a2d35, #1f2128);
    color: #666;
}
[data-theme="dark"] .comment-input,
[data-theme="dark"] .form-input,
[data-theme="dark"] .reply-input-box textarea {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .comment-input:focus,
[data-theme="dark"] .form-input:focus {
    background: var(--bg-card);
}
[data-theme="dark"] .book-tag { background: rgba(214, 51, 108, 0.18); }
[data-theme="dark"] .book-tag:hover { background: var(--primary-gradient); }
[data-theme="dark"] .ticket-count-display {
    background: linear-gradient(135deg, rgba(214, 51, 108, 0.14) 0%, rgba(139, 92, 246, 0.14) 100%);
}
[data-theme="dark"] .vip-notice {
    background: linear-gradient(135deg, rgba(214, 51, 108, 0.14) 0%, rgba(139, 92, 246, 0.14) 100%);
    border-color: rgba(214, 51, 108, 0.3);
    color: var(--text-secondary);
}
[data-theme="dark"] .vip-notice p { color: var(--text-secondary); }
[data-theme="dark"] .reply-list,
[data-theme="dark"] .catalog-list { background: transparent; }
[data-theme="dark"] .bookmark-btn { background: var(--bg-card); border-color: #334155; }
[data-theme="dark"] .settings-panel { background: var(--bg-card); border-color: #334155; }
[data-theme="dark"] .bookmark-empty { color: var(--text-muted); }

/* ============================================================
   作品详情页操作栏分组样式
   ============================================================ */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    padding: 8px 0 0;
}
.action-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    align-items: center;
    transition: var(--transition-fast);
}
.action-group:hover {
    border-color: rgba(214, 51, 108, 0.2);
}
.action-group-primary {
    background: linear-gradient(135deg, rgba(214, 51, 108, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-color: rgba(214, 51, 108, 0.2);
}
.action-group-interact {
    /* 互动组 - 默认配色 */
}
.action-group-tools {
    /* 工具组 - 默认配色 */
}
.action-group .btn,
.action-group button {
    margin: 0 !important;
}
@media (max-width: 640px) {
    .action-bar {
        gap: 10px;
    }
    .action-group {
        width: 100%;
        justify-content: space-between;
    }
    .action-group .btn,
    .action-group button {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ============================================================
   阅读器设置面板增强（行距、字间距等）
   ============================================================ */
.spacing-btns,
.bg-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.spacing-btns button,
.bg-btns button {
    padding: 8px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    text-align: center;
    font-weight: 500;
}
.spacing-btns button:hover,
.bg-btns button:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.spacing-btns button.active,
.bg-btns button.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(214, 51, 108, 0.28);
}
.bg-btns .bg-day {
    background: #ffffff;
    color: #333;
}
.bg-btns .bg-eye {
    background: #f1f8e9;
    color: #2e7d32;
}
.bg-btns .bg-night {
    background: #16213e;
    color: #c0c0c0;
}

/* 阅读器章节内容过渡效果 */
.chapter-content {
    transition: font-size 0.2s ease, line-height 0.2s ease, letter-spacing: 0.2s ease, background 0.3s ease, color 0.3s ease;
}

/* ============================================================
   精细布局体系 v2（栅格 / 按钮高度 / 表单 / 空态 / 焦点态）
   ============================================================ */

/* --- 全局行高收紧：正文 1.55（阅读器除外）--- */
body { line-height: 1.55; }
p, li, span, div { line-height: inherit; }

/* --- Section 间距节奏：容器内 section 之间 32px，子分组 16px --- */
.container > section + section { margin-top: 32px; }
.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.section-title h2 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}
.section-title .section-subtitle {
    font-size: var(--font-sm);
    color: var(--text-muted);
}
.section-title .section-link {
    font-size: var(--font-sm);
    color: var(--text-muted);
    white-space: nowrap;
}
.section-title .section-link:hover {
    color: var(--primary);
}

/* --- 栅格体系：4 级栅格，统一 gap --- */
/* 首页/分类：书籍封面卡片栅格 */
.book-grid, .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
/* 列表型内容（书单/作者/帖子等）3列栅格 */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
/* 双列布局（概览+侧边栏信息） */
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}
/* 三列数据卡片（首页概览） */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* --- 卡片统一内边距密度 --- */
.card {
    padding: 16px;
}
.card-lg { padding: 20px; }
.card-sm { padding: 12px; }

/* 书籍封面卡片高度统一（封面 + 标题 2 行 + 作者 + 元信息） */
.book-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.book-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.book-card .cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover) center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.book-card h3.title {
    font-size: var(--font-md);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(var(--font-md) * 1.35 * 2);
}
.book-card .author {
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.book-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-xs);
    color: var(--text-muted);
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}
.book-card .meta .tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
}

/* --- 按钮高度分级（xs/sm/md/lg） --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px; /* 默认 md */
    padding: 0 16px;
    font-size: var(--font-base);
    line-height: 1;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: var(--font-sm);
}
.btn-xs {
    height: 28px;
    padding: 0 10px;
    font-size: var(--font-xs);
}
.btn-lg {
    height: 44px;
    padding: 0 22px;
    font-size: var(--font-md);
}
.btn-block {
    display: flex;
    width: 100%;
}

/* 按钮焦点态（统一 outline，提升可访问性） */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* --- 表单控件高度与按钮对齐 --- */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    height: 40px; /* 默认 md，与 .btn 对齐 */
    padding: 0 12px;
    font-size: var(--font-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}
textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
}
.form-control-sm,
.input-sm {
    height: 32px;
    padding: 0 10px;
    font-size: var(--font-sm);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.08);
    outline: none;
}
/* 表单标签：右对齐 + 固定最小宽度，视觉整洁 */
.form-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.form-group label.form-label {
    min-width: 96px;
    padding-top: 10px;
    text-align: right;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.form-group label.form-label .required {
    color: var(--danger);
    margin-right: 2px;
}
.form-group .form-wrap {
    flex: 1;
    min-width: 0;
}
.form-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 6px;
}

/* --- 统一空状态组件（替代各页零散 empty-state） --- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--text-muted);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
}
.empty .empty-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
}
.empty h3,
.empty .empty-title {
    font-size: var(--font-lg);
    color: var(--text-primary);
    margin: 0 0 8px;
    font-weight: 600;
}
.empty p,
.empty .empty-desc {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin: 0 0 20px;
    max-width: 360px;
    line-height: 1.6;
}
.empty .empty-text { max-width: 360px; }
.empty .empty-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.empty-sm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
}
.empty-sm .empty-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.empty-sm h3,
.empty-sm .empty-title {
    font-size: var(--font-md);
    color: var(--text-primary);
    margin: 0 0 6px;
    font-weight: 600;
}
.empty-sm p,
.empty-sm .empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}
.empty-sm .empty-text { max-width: 320px; }

/* 首页小型空态容器（用于分类、排行榜、公告、免费书籍等） */
.home-empty,
.home-empty-state {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 28px 16px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
    background: var(--bg-card) !important;
    border: 1px dashed var(--border-color) !important;
}
.home-empty-state .home-empty-state-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; line-height: 1;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 700;
}
.home-empty-state .home-empty-state-text,
.home-empty {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
}

/* --- 列表密度（书架/章节列表/评论列表） --- */
.dense-list .item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s ease;
}
.dense-list .item:last-child {
    border-bottom: none;
}
.dense-list .item:hover {
    background: var(--bg-hover);
}
.dense-list .item .title {
    flex: 1;
    min-width: 0;
    font-size: var(--font-base);
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dense-list .item .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}
.dense-list .item .meta .badge {
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 11px;
}

/* --- 分页 / 页码区：紧凑化 --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.12s ease;
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
    font-weight: 600;
}
.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- 标签/徽章圆角更小更克制 --- */
.badge, .tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    line-height: 1;
    white-space: nowrap;
}
.badge-primary { background: rgba(214,51,108,0.1); color: var(--primary); }
.badge-accent  { background: rgba(139,92,246,0.1); color: var(--accent); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-success { background: rgba(22,163,74,0.1);  color: var(--success); }
.badge-danger  { background: rgba(239,68,68,0.1);  color: var(--danger); }

/* --- 桌面端：>1280px 统一两侧留白，>1600px 最多 5 列封面 --- */
@media (min-width: 1600px) {
    :root { --max-width: 1440px; }
    .book-grid, .card-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1024px) {
    .two-col { grid-template-columns: 1fr; }
    .book-grid, .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .tile-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
    .form-group { flex-direction: column; gap: 6px; }
    .form-group label.form-label {
        min-width: auto;
        padding-top: 0;
        text-align: left;
    }
}
@media (max-width: 768px) {
    .book-grid, .card-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .tile-grid { grid-template-columns: 1fr; }
    .container > section + section { margin-top: 24px; }
    .book-card { padding: 8px; gap: 8px; }
    .card { padding: 12px; }
    .card-lg { padding: 16px; }
}

/* ===== 平板适配断点（1024px） ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 24px 20px;
    }
    .book-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .header, .footer, .footer-enhanced, .action-bar, .btn, .nav {
        display: none !important;
    }
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}

/* ===== 聊天在线状态圆点 ===== */
.status-dot{position:absolute;top:-2px;left:-2px;width:8px;height:8px;border-radius:999px;border:1.5px solid #fff;}
.status-dot.online{background:#22c55e;}
.status-dot.offline{background:#9ca3af;}
.status-dot.busy{background:#f59e0b;}

/* ===== 聊天表情面板 ===== */
.chat-emoji-panel{
    position:absolute;z-index:99;top:auto;bottom:100%;left:0;margin-bottom:8px;
    background:var(--bg-card,#fff);border:1px solid var(--border-color,#e5e7eb);
    border-radius:var(--border-radius,10px);padding:10px;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
    display:grid;grid-template-columns:repeat(8,30px);gap:4px;
}
.chat-emoji-panel span{
    width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;
    font-size:18px;cursor:pointer;border-radius:6px;transition:.12s;
}
.chat-emoji-panel span:hover{background:var(--bg-hover,#f3f4f6);}

/* ===== 聊天文件气泡 ===== */
.im-file-card{display:flex;align-items:center;gap:10px;min-width:240px;padding:8px 10px;border-radius:10px;background:rgba(0,0,0,.04);}
.im-msg.mine .im-file-card{background:rgba(255,255,255,.18);color:#fff;}
.im-file-icon{width:40px;height:40px;border-radius:8px;background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.im-file-meta{flex:1;min-width:0;}
.im-file-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.im-file-size{font-size:11px;opacity:.75;margin-top:2px;}
.im-file-link{color:inherit;text-decoration:none;}

/* ===== 论坛管理按钮（置顶/精华徽章） ===== */
.mod-btn{position:relative;display:inline-flex;align-items:center;gap:4px;padding:6px 12px;border-radius:20px;border:1px solid var(--border-color);background:#fff;font-size:12.5px;cursor:pointer;transition:.15s;color:#6b7280;}
.mod-btn:hover{transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.06);}
.mod-btn .mod-badge{position:absolute;top:-4px;right:-4px;min-width:14px;height:14px;padding:0 4px;border-radius:999px;color:#fff;font-size:10px;display:inline-flex;align-items:center;justify-content:center;font-weight:700;}
.mod-btn.mod-top-on{border-color:#fecaca;color:#b91c1c;}
.mod-btn.mod-top-on .mod-badge{background:#ef4444;}
.mod-btn.mod-essence-on{border-color:#fde68a;color:#b45309;}
.mod-btn.mod-essence-on .mod-badge{background:#f59e0b;}

/* ===== 排行榜筛选栏 ===== */
.rank-filter-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid var(--border-color);border-radius:var(--border-radius);padding:12px 16px;margin-bottom:14px;}
.rank-filter-item{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-secondary);}
.rank-filter-item label{font-weight:600;color:var(--text-primary);}
.rank-filter-select{padding:6px 12px;border-radius:8px;border:1px solid var(--border-color);background:#fff;font-size:13px;color:var(--text-primary);cursor:pointer;outline:none;min-width:120px;}
.rank-filter-select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(214,51,108,.08);}

/* ===== 空状态通用（common.css 版本兜底） ===== */
.empty-state-standard{background:#fff;border-radius:10px;padding:60px 24px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.06);border:1px solid rgba(0,0,0,.04);margin:0 auto;max-width:520px;width:100%;box-sizing:border-box;}
.empty-state-standard .empty-icon{width:72px;height:72px;margin:0 auto 14px;border-radius:50%;background:linear-gradient(135deg,rgba(139,92,246,.08),rgba(214,51,108,.08));display:flex;align-items:center;justify-content:center;font-size:32px;color:#8b5cf6;}
.empty-state-standard h4{font-size:16px;font-weight:700;color:var(--text-secondary);margin-bottom:6px;}
.empty-state-standard p{color:#8a837d;font-size:13px;margin-bottom:16px;}

/* ===== 图形验证码组件 ===== */
.captcha-row{display:flex;gap:var(--space-sm);align-items:center;margin-top:var(--space-sm);}
.captcha-row .captcha-input{flex:1;}
.captcha-img{height:40px;border-radius:var(--radius);border:1px solid var(--border-color);cursor:pointer;background:#fff;transition:transform .15s ease;}
.captcha-img:hover{transform:scale(1.02);border-color:var(--primary);}
.captcha-img:active{transform:scale(0.98);}
.captcha-tip{font-size:12px;color:var(--text-muted);margin-top:4px;}
:root[data-theme="dark"] .captcha-img{border-color:#3a3e55;background:#1e2130;}

/* ===== 后台通用：搜索栏 ===== */
.admin-search-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px;padding:14px 18px;background:#fff;border:1px solid var(--border-color);border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.03);}
.admin-search-bar .search-item{display:flex;align-items:center;gap:6px;}
.admin-search-bar .search-item label{font-size:13px;font-weight:600;color:var(--text-secondary);white-space:nowrap;}
.admin-search-bar .search-input{padding:8px 12px;border:1px solid var(--border-color);border-radius:8px;background:#fff;font-size:13px;color:var(--text-primary);outline:none;transition:border-color .15s,box-shadow .15s;min-width:200px;}
.admin-search-bar .search-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(214,51,108,.1);}
.admin-search-bar .search-select{padding:8px 30px 8px 12px;border:1px solid var(--border-color);border-radius:8px;background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%239ca3af'/></svg>") no-repeat right 10px center;font-size:13px;color:var(--text-primary);outline:none;cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none;min-width:120px;}
.admin-search-bar .search-select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(214,51,108,.1);}
.admin-search-bar .search-btn{padding:8px 18px;border:none;border-radius:8px;background:linear-gradient(135deg,#8b5cf6,#d6336c);color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:.2s;}
.admin-search-bar .search-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(214,51,108,.25);}
.admin-search-bar .reset-btn{padding:8px 18px;border:1px solid var(--border-color);border-radius:8px;background:#fff;color:var(--text-secondary);font-size:13px;font-weight:500;cursor:pointer;transition:.15s;}
.admin-search-bar .reset-btn:hover{border-color:var(--primary);color:var(--primary);background:rgba(139,92,246,.04);}

/* ===== 后台通用：分页控件 ===== */
.admin-pagination{display:flex;justify-content:center;align-items:center;gap:8px;padding:18px 16px;flex-wrap:wrap;}
.admin-pagination .pg-btn{min-width:36px;height:36px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border-color);background:#fff;border-radius:8px;font-size:13px;color:var(--text-primary);cursor:pointer;transition:.15s;user-select:none;font-weight:500;}
.admin-pagination .pg-btn:hover:not(:disabled):not(.pg-active){border-color:var(--primary);color:var(--primary);background:rgba(139,92,246,.05);}
.admin-pagination .pg-btn:disabled{opacity:.45;cursor:not-allowed;}
.admin-pagination .pg-btn.pg-active{background:linear-gradient(135deg,#8b5cf6,#d6336c);border-color:transparent;color:#fff;box-shadow:0 2px 8px rgba(214,51,108,.25);}
.admin-pagination .pg-info{color:var(--text-secondary);font-size:13px;padding:0 8px;}
.admin-pagination .pg-jumper{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text-secondary);}
.admin-pagination .pg-jumper input{width:56px;height:32px;padding:0 8px;text-align:center;border:1px solid var(--border-color);border-radius:8px;font-size:13px;outline:none;transition:.15s;}
.admin-pagination .pg-jumper input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(214,51,108,.1);}

/* ===== 后台通用：加载遮罩 ===== */
.loading-overlay{position:absolute;inset:0;background:rgba(255,255,255,.82);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:10px;backdrop-filter:blur(2px);}
.loading-overlay .spinner{width:42px;height:42px;border:4px solid #e5e7eb;border-top-color:#d6336c;border-right-color:#8b5cf6;border-radius:50%;animation:spin 0.85s linear infinite;box-shadow:0 0 20px rgba(139,92,246,.15);}
@keyframes spin{to{transform:rotate(360deg);}}

/* ===== 深色模式适配（后台搜索栏 / 分页 / 加载） ===== */
:root[data-theme="dark"] .admin-search-bar{background:#1e2130;border-color:#2e3350;box-shadow:none;}
:root[data-theme="dark"] .admin-search-bar .search-input,:root[data-theme="dark"] .admin-search-bar .search-select{background:#171a27;border-color:#2e3350;color:#e5e7eb;}
:root[data-theme="dark"] .admin-search-bar .search-select{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%239ca3af'/></svg>");}
:root[data-theme="dark"] .admin-search-bar .reset-btn{background:#171a27;border-color:#2e3350;color:#c7cbd4;}
:root[data-theme="dark"] .admin-pagination .pg-btn{background:#1e2130;border-color:#2e3350;color:#e5e7eb;}
:root[data-theme="dark"] .admin-pagination .pg-btn:hover:not(:disabled):not(.pg-active){background:#25293e;border-color:#8b5cf6;}
:root[data-theme="dark"] .admin-pagination .pg-jumper input{background:#171a27;border-color:#2e3350;color:#e5e7eb;}
:root[data-theme="dark"] .loading-overlay{background:rgba(30,33,48,.85);}


/* ============================================================
   面包屑导航（全站通用 cat-breadcrumb，对齐 categories.html 样式）
   每个前台页面只需引入 <nav class="cat-breadcrumb"><a href="/">首页</a></nav> 结构即可
   ============================================================ */
.cat-breadcrumb{padding:20px 0 12px;font-size:13px;color:var(--text-muted,#8a8a8a);line-height:1.6;}
.cat-breadcrumb a{color:var(--text-muted,#8a8a8a);text-decoration:none;transition:color .2s ease;}
.cat-breadcrumb a:hover{color:var(--primary,#D6336C);}
.cat-breadcrumb .sep{margin:0 8px;}
.cat-breadcrumb .current{color:var(--text-primary,#2d2a28);font-weight:600;}
