@charset "utf-8";
/* ============================================================
   小说模板 1 · 共享样式（参考起点中文网风格）
   单一来源：所有页面的视觉系统都在这里维护。
   页面只保留结构 / PHP / 模板标签 / JS，样式统一走本文件。
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
    --brand: #e3262b;          /* 主品牌红（起点红） */
    --brand-strong: #c4161c;   /* hover / 按下 */
    --brand-soft: #fff5f5;     /* 浅红底色 */
    --brand-line: #f6d8d8;     /* 浅红描边 */

    --accent: #ff7a2e;         /* 连载 / 次序橙 */
    --gold: #f5a623;           /* 第三名 */
    --done: #3a8ee6;           /* 完本 / 完结蓝 */

    --page-bg: #f4f5f7;        /* 页面底 */
    --surface: #ffffff;        /* 卡片面 */
    --surface-2: #fafbfc;      /* 次级面 / 表头 */

    --ink: #1f2329;            /* 主文字 */
    --ink-2: #555b63;          /* 次文字 */
    --ink-3: #8a9099;          /* 弱文字 */

    --line: #ededf0;           /* 实线分隔 */
    --line-dash: #ebebee;      /* 虚线分隔 */

    --radius: 4px;
    --radius-lg: 6px;

    --shadow-sm: 0 1px 3px rgba(20, 23, 28, .06);
    --shadow-md: 0 8px 24px rgba(20, 23, 28, .10);

    --maxw: 1200px;
    --gutter: 16px;

    --ease: cubic-bezier(.22, 1, .36, 1); /* ease-out-quint，自然减速 */

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", Arial, sans-serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { overflow-y: scroll; }

body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color .15s var(--ease);
}

a:hover {
    color: var(--brand);
    text-decoration: none;
}

img { border: 0; }

::selection { background: rgba(227, 38, 43, .14); }

/* 焦点可见性（键盘可达） */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ============================================================
   通用容器 / 卡片 / 标题 / 面包屑 / 页脚
   ============================================================ */
.bqg-wrap,
.read-wrap,
.bqg-crumb,
.read-crumb,
.catalog-wrap,
.catalog-crumb,
.catalog-box,
.bookstore-wrap,
.bookstore-crumb,
.bookstore-category,
.bookstore-main,
.novel-crumb,
.rank-tabs,
.rank-box,
.search-wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    box-sizing: border-box;
}

/* 面包屑 */
.bqg-crumb,
.read-crumb,
.catalog-crumb,
.bookstore-crumb,
.novel-crumb,
.search-crumb {
    margin-top: 18px;
    margin-bottom: 12px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.8;
}

.search-crumb { margin-top: 0; }

.bqg-crumb a,
.read-crumb a,
.catalog-crumb a,
.bookstore-crumb a,
.novel-crumb a,
.search-crumb a { color: var(--ink-2); }

/* 卡片容器 */
.bqg-box,
.bookstore-box,
.rank-box,
.catalog-box,
.search-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 卡片标题：统一的红色竖条 + 标题 + 副标题 */
.bqg-box-title,
.bookstore-box-title,
.search-title {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
    box-sizing: border-box;
}

.bqg-box-title::before,
.bookstore-box-title::before,
.search-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--brand);
    flex-shrink: 0;
}

.bqg-box-title small,
.bookstore-box-title small,
.search-title small {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-3);
}

.search-title em {
    color: var(--brand);
    font-style: normal;
}

/* 页脚 */
.bqg-footer,
.catalog-footer,
.bookstore-footer,
.novel-footer {
    width: 100%;
    max-width: var(--maxw);
    margin: 24px auto 0;
    padding: 22px var(--gutter) 40px;
    color: var(--ink-3);
    text-align: center;
    line-height: 2;
    font-size: 13px;
    border-top: 1px solid var(--line);
    box-sizing: border-box;
}

/* 状态徽标：连载 / 全本（统一规则） */
.bqg-status,
.detail-status,
.bookstore-status,
.rank-status,
.search-status {
    display: inline-block;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    border-radius: 3px;
    vertical-align: middle;
}

.bqg-status.end,
.detail-status.end,
.bookstore-status.end,
.rank-status.end,
.search-status.end { background: var(--done); }

/* ============================================================
   头部（header.html，亦内联于 catalog / history）
   起点风：白底顶栏 + 白底导航 + 红色高亮下划线
   保留 !important 以防 history 页 LayUI 注入样式干扰。
   ============================================================ */
.bqg-top,
.bqg-top *,
.bqg-main-nav,
.bqg-main-nav * { box-sizing: border-box !important; }

.bqg-top {
    width: 100% !important;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.bqg-top-inner {
    width: 100% !important;
    max-width: var(--maxw) !important;
    height: 72px !important;
    margin: 0 auto !important;
    padding: 0 var(--gutter) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    overflow: visible !important;
}

.bqg-logo {
    height: 72px !important;
    line-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    color: var(--ink) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.bqg-logo a,
.bqg-logo a:hover {
    color: var(--ink) !important;
    text-decoration: none !important;
}

.bqg-logo span { color: var(--brand) !important; }

.bqg-top-right {
    height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 24px !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
}

/* 搜索：圆角输入 + 红色按钮（起点风） */
.bqg-top-search {
    width: auto !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
}

.bqg-top-search input {
    display: block !important;
    width: 300px !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid var(--line) !important;
    border-right: none !important;
    border-radius: 20px 0 0 20px !important;
    background: var(--surface-2) !important;
    color: var(--ink) !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-family: var(--font) !important;
    transition: border-color .15s ease, background .15s ease !important;
}

.bqg-top-search input:focus {
    border-color: var(--brand) !important;
    background: #fff !important;
}

.bqg-top-search button {
    display: block !important;
    width: 76px !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--brand) !important;
    border-radius: 0 20px 20px 0 !important;
    background: var(--brand) !important;
    color: #fff !important;
    cursor: pointer !important;
    text-align: center !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    font-family: var(--font) !important;
    transition: background .15s ease, border-color .15s ease !important;
}

.bqg-top-search button:hover {
    background: var(--brand-strong) !important;
    border-color: var(--brand-strong) !important;
    color: #fff !important;
}

/* 顶栏右侧入口 */
.bqg-user-nav {
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    font-size: 0 !important;
    overflow: visible !important;
}

.bqg-user-nav a {
    display: inline-block !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 0 0 18px !important;
    padding: 0 !important;
    color: var(--ink-2) !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    vertical-align: top !important;
}

.bqg-user-nav a:hover,
.bqg-user-nav a.active {
    color: var(--brand) !important;
    background: transparent !important;
    text-decoration: none !important;
}

/* 主导航：白底，红色高亮 + 下划线 */
.bqg-main-nav {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: visible !important;
}

.bqg-main-nav-inner {
    width: 100% !important;
    max-width: var(--maxw) !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 auto !important;
    padding: 0 calc(var(--gutter) - 4px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 0 !important;
}

.bqg-main-nav-inner a {
    position: relative !important;
    display: inline-block !important;
    height: 38px !important;
    line-height: 38px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    color: var(--ink-2) !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    vertical-align: top !important;
    transition: color .15s ease !important;
}

.bqg-main-nav-inner a::after {
    content: "" !important;
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 0 !important;
    height: 3px !important;
    background: var(--brand) !important;
    transform: scaleX(0) !important;
    transform-origin: center !important;
    transition: transform .2s var(--ease) !important;
}

.bqg-main-nav-inner a:hover,
.bqg-main-nav-inner a.active {
    color: var(--brand) !important;
    background: transparent !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.bqg-main-nav-inner a:hover::after,
.bqg-main-nav-inner a.active::after { transform: scaleX(1) !important; }

/* ============================================================
   首页（index.html）
   ============================================================ */
.bqg-layout {
    width: 100%;
    max-width: var(--maxw);
    margin: 18px auto 0;
    padding: 0 var(--gutter);
    display: flex;
    gap: 16px;
    box-sizing: border-box;
}

.bqg-left { flex: 1; min-width: 0; }

.bqg-right {
    width: 320px;
    flex-shrink: 0;
}

/* 书目列表（封面在左，信息在右）—— 无边框行，hover 浅红底，避免卡中卡 */
.bqg-book-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 12px;
    box-sizing: border-box;
}

.bqg-book-item {
    display: flex;
    min-width: 0;
    height: 134px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
    transition: background .18s var(--ease);
}

.bqg-book-item:hover { background: var(--brand-soft); }

/* 封面（背景图形式）：3:4，圆角 + 阴影，hover 微抬升 */
.bqg-cover {
    width: 80px;
    height: 107px;
    flex: 0 0 80px;
    margin-right: 14px;
    background-color: var(--surface-2);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(20, 23, 28, .14);
    box-sizing: border-box;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.bqg-book-item:hover .bqg-cover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(20, 23, 28, .20);
}

.bqg-book-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.bqg-book-name {
    height: 24px;
    line-height: 24px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 7px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bqg-book-name a { color: var(--ink); }
.bqg-book-name a:hover { color: var(--brand); }
.bqg-book-name .bqg-status { margin-left: 6px; }

.bqg-meta {
    height: 22px;
    line-height: 22px;
    color: var(--ink-3);
    font-size: 12px;
    margin-bottom: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bqg-meta span { margin-right: 10px; }

.bqg-desc {
    height: 40px;
    line-height: 20px;
    color: var(--ink-2);
    font-size: 13px;
    overflow: hidden;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 右栏榜单列表 */
.bqg-rank {
    padding: 6px 16px 12px;
    margin: 0;
    list-style: none;
    counter-reset: ranknum;
}

.bqg-rank li {
    position: relative;
    height: 38px;
    line-height: 38px;
    padding-left: 28px;
    border-bottom: 1px dashed var(--line-dash);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    counter-increment: ranknum;
}

.bqg-rank li:last-child { border-bottom: none; }

.bqg-rank li::before {
    content: counter(ranknum);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 3px;
    background: #c3c7cd;
    color: #fff;
    font-size: 12px;
    font-style: normal;
}

.bqg-rank li:nth-child(1)::before { background: var(--brand); }
.bqg-rank li:nth-child(2)::before { background: var(--accent); }
.bqg-rank li:nth-child(3)::before { background: var(--gold); }

.bqg-rank .type {
    color: var(--ink-3);
    margin-right: 6px;
    font-size: 12px;
}

.bqg-rank .author {
    float: right;
    color: var(--ink-3);
    font-size: 12px;
    margin-left: 10px;
    max-width: 84px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 友情链接 */
.bqg-link {
    padding: 14px 18px;
    line-height: 30px;
}

.bqg-link a {
    margin-right: 14px;
    color: var(--ink-2);
}

/* ============================================================
   详情页（detail.html）
   ============================================================ */
.detail-main {
    padding: 24px;
    display: flex;
    box-sizing: border-box;
}

.detail-cover {
    width: 220px;
    height: 293px;
    flex: 0 0 220px;
    margin-right: 32px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 18px rgba(20, 23, 28, .18);
    box-sizing: border-box;
}

.detail-cover img {
    display: block;
    width: 220px;
    height: 293px;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.detail-cover-empty,
.similar-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    font-size: 13px;
    background: var(--surface-2);
    z-index: 1;
}

.detail-info { flex: 1; min-width: 0; }

.detail-title {
    line-height: 1.3;
    margin-bottom: 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.detail-title .detail-status {
    height: 22px;
    line-height: 22px;
    padding: 0 8px;
    margin-left: 10px;
    font-size: 12px;
    vertical-align: 4px;
}

.detail-remarks {
    display: inline-block;
    max-width: 100%;
    height: 28px;
    line-height: 26px;
    padding: 0 12px;
    margin-bottom: 14px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 14px;
}

.detail-meta-main,
.detail-meta-stats,
.detail-meta-update {
    display: contents;
}

.detail-meta span {
    height: 32px;
    line-height: 32px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.detail-meta em {
    color: var(--ink);
    font-style: normal;
    font-weight: 500;
}

.detail-latest {
    margin-top: 14px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink-2);
    line-height: 24px;
}

.detail-latest a { color: var(--brand); font-weight: 700; }

.detail-tags {
    margin-top: 14px;
    line-height: 28px;
}

.detail-tags .detail-tag-item,
.detail-tags .detail-tag-item:link,
.detail-tags .detail-tag-item:visited {
    display: inline-block;
    height: 26px;
    line-height: 26px;
    padding: 0 11px;
    margin: 0 7px 7px 0;
    background: var(--surface-2) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink-2) !important;
    border-radius: 13px;
    font-size: 12px;
    text-decoration: none !important;
    transition: all .15s ease;
}

.detail-tags .detail-tag-item:hover,
.detail-tags .detail-tag-item:active {
    border-color: var(--brand-line) !important;
    background: var(--brand-soft) !important;
    color: var(--brand) !important;
    text-decoration: none !important;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-top: 20px;
}

.detail-actions a {
    display: inline-block;
    min-width: 124px;
    height: 40px;
    line-height: 38px;
    text-align: center;
    border-radius: var(--radius);
    font-size: 15px;
    box-sizing: border-box;
    transition: all .15s ease;
}

.btn-read {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #fff;
}

.btn-read:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: #fff;
}

.btn-catalog {
    background: #fff;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.btn-catalog:hover { background: var(--brand-soft); color: var(--brand); }

.btn-bookshelf {
    background: #fff;
    border: 1px solid #f59e0b;
    color: #b45309;
}

.btn-bookshelf:hover {
    background: #fffbeb;
    color: #92400e;
}

.btn-bookshelf.is-added {
    background: #f8fafc;
    border-color: var(--line);
    color: var(--ink-3);
}

.btn-bookshelf.is-loading {
    opacity: .72;
    cursor: default;
}

.bookshelf-msg {
    min-height: 20px;
    line-height: 20px;
    font-size: 13px;
}

.bookshelf-msg.ok { color: #16a34a; }
.bookshelf-msg.err { color: var(--brand); }

.detail-content {
    padding: 18px 24px 24px;
    line-height: 2;
    color: var(--ink-2);
    font-size: 14px;
    word-break: break-word;
}

.detail-chapter { padding: 8px 24px 18px; }

.detail-chapter-row {
    min-height: 42px;
    line-height: 42px;
    border-bottom: 1px dashed var(--line-dash);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.detail-chapter-row:last-child { border-bottom: none; }

.detail-chapter-row a {
    color: var(--ink);
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.detail-chapter-row a:hover { color: var(--brand); }

.detail-chapter-row span {
    color: var(--ink-3);
    font-size: 13px;
    flex-shrink: 0;
}

.detail-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--ink-3);
}

/* 同类推荐 */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 16px;
    box-sizing: border-box;
}

.similar-item {
    display: flex;
    min-width: 0;
    height: 124px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
    transition: background .18s var(--ease);
}

.similar-item:hover { background: var(--brand-soft); }

.similar-cover {
    display: block;
    width: 72px;
    height: 96px;
    flex: 0 0 72px;
    margin-right: 12px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(20, 23, 28, .14);
    box-sizing: border-box;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.similar-item:hover .similar-cover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(20, 23, 28, .20);
}

.similar-cover img {
    display: block;
    width: 72px;
    height: 96px;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.similar-cover-empty { font-size: 12px; }

.similar-info { flex: 1; min-width: 0; overflow: hidden; }

.similar-name {
    height: 24px;
    line-height: 24px;
    margin-bottom: 5px;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.similar-name a:hover { color: var(--brand); }

.similar-meta {
    height: 22px;
    line-height: 22px;
    color: var(--ink-3);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.similar-desc {
    height: 40px;
    line-height: 20px;
    margin-top: 5px;
    color: var(--ink-2);
    font-size: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================================
   阅读页（read.html）—— 克制、聚焦、护眼
   ============================================================ */
.read-wrap { max-width: 860px; }      /* 收窄阅读列宽，控制行长 */
.read-crumb { max-width: 860px; }

.read-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    margin-bottom: 16px;
    overflow: hidden;
}

.read-title {
    padding: 30px 24px 18px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.read-title h1 {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.4;
    color: var(--ink);
    font-weight: 700;
    text-wrap: balance;
}

.read-meta {
    color: var(--ink-3);
    font-size: 13px;
    line-height: 24px;
}

.read-meta span { margin: 0 8px; }
.read-meta a { color: var(--ink-2); }

/* 章节导航条 */
.read-nav {
    height: 52px;
    line-height: 52px;
    text-align: center;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.read-nav.bottom { border-top: 1px solid var(--line); border-bottom: none; }

.read-nav a,
.read-nav span {
    display: inline-block;
    min-width: 84px;
    height: 32px;
    line-height: 30px;
    margin: 0 4px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    border-radius: var(--radius);
    box-sizing: border-box;
    transition: all .15s ease;
}

.read-nav a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.read-nav .disabled {
    background: var(--surface-2);
    color: var(--ink-3);
    cursor: not-allowed;
}

/* 阅读设置工具条 */
.read-tools {
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
}

.read-tools button {
    height: 30px;
    line-height: 28px;
    margin: 0 3px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    transition: all .15s ease;
}

.read-tools button:hover { border-color: var(--brand); color: var(--brand); }

/* 正文 */
.read-content {
    padding: 32px 40px 40px;
    font-size: 19px;
    line-height: 2;
    color: #2b2f36;
    word-break: break-word;
    cursor: default;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.read-content * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.read-content p { margin: 0 0 1.1em; text-indent: 2em; }

.read-notice {
    padding: 18px 24px;
    color: var(--ink-3);
    line-height: 1.9;
    font-size: 13px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}

.read-empty {
    padding: 90px 20px;
    text-align: center;
    color: var(--ink-3);
    font-size: 16px;
}

/* 护眼主题（暖色羊皮纸） */
body.read-bg-soft { background: #ece2cb; }

body.read-bg-soft .read-box,
body.read-bg-soft .read-nav,
body.read-bg-soft .read-tools { background: #f4ecd8; border-color: #e0d4b6; }

body.read-bg-soft .read-box { box-shadow: none; }
body.read-bg-soft .read-title,
body.read-bg-soft .read-notice { border-color: #e0d4b6; }
body.read-bg-soft .read-content { color: #4a4133; }
body.read-bg-soft .read-title h1 { color: #3a3327; }
body.read-bg-soft .read-nav a,
body.read-bg-soft .read-tools button { background: #f9f2e2; border-color: #ddd0b2; }

/* 夜间主题 */
body.read-bg-dark { background: #15171a; color: #9aa0a8; }

body.read-bg-dark .read-box,
body.read-bg-dark .read-nav,
body.read-bg-dark .read-tools,
body.read-bg-dark .read-notice { background: #1f2226; border-color: #2c3036; }

body.read-bg-dark .read-box { box-shadow: none; }
body.read-bg-dark .read-title { border-color: #2c3036; }
body.read-bg-dark .read-title h1 { color: #d6dae0; }
body.read-bg-dark .read-content { color: #b4bac1; }
body.read-bg-dark .read-meta,
body.read-bg-dark .read-notice { color: #6f757d; }
body.read-bg-dark a { color: #b4bac1; }
body.read-bg-dark a:hover { color: var(--accent); }

body.read-bg-dark .read-nav a,
body.read-bg-dark .read-tools button {
    background: #262a2f;
    color: #b4bac1;
    border-color: #353a41;
}

body.read-bg-dark .read-nav a:hover,
body.read-bg-dark .read-tools button:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ============================================================
   章节目录页（catalog.html）
   ============================================================ */
.catalog-book-head {
    padding: 26px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.catalog-book-head h1 {
    margin: 0 0 12px;
    font-size: 26px;
    line-height: 1.3;
    color: var(--ink);
    font-weight: 700;
    text-wrap: balance;
}

.catalog-book-meta {
    color: var(--ink-3);
    font-size: 13px;
    line-height: 28px;
}

.catalog-book-meta span {
    display: inline-block;
    margin: 0 10px;
    white-space: nowrap;
}

.catalog-book-meta em { color: var(--ink); font-style: normal; font-weight: 500; }

.catalog-actions { margin-top: 16px; }

.catalog-actions a,
.catalog-actions button {
    display: inline-block;
    min-width: 96px;
    height: 36px;
    line-height: 34px;
    margin: 0 5px 8px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    box-sizing: border-box;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    vertical-align: middle;
    transition: all .15s ease;
}

.catalog-actions a:hover,
.catalog-actions button:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
}

.catalog-actions .btn-primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.catalog-actions .btn-primary:hover {
    border-color: var(--brand-strong);
    background: var(--brand-strong);
    color: #fff;
}

/* 目录区标题（带红条 + 右侧提示） */
.catalog-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    border-bottom: 1px solid var(--line);
    padding: 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    box-sizing: border-box;
}

.catalog-title-main { display: flex; align-items: center; }

.catalog-title-main::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--brand);
    flex-shrink: 0;
}

.catalog-title small {
    margin-left: 10px;
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 400;
}

.catalog-title-extra { color: var(--ink-3); font-size: 13px; font-weight: 400; }

/* 章节网格 */
.catalog-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    padding: 12px 24px 20px;
    box-sizing: border-box;
}

.catalog-list.reverse { direction: rtl; }
.catalog-list.reverse .catalog-chapter-item { direction: ltr; }

.catalog-chapter-item {
    min-width: 0;
    height: 42px;
    line-height: 42px;
    border-bottom: 1px dashed var(--line-dash);
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.catalog-chapter-item a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--ink-2);
}

.catalog-chapter-item a:hover { color: var(--brand); }

.catalog-chapter-item.new a::after {
    content: "新";
    display: inline-block;
    height: 16px;
    line-height: 16px;
    margin-left: 7px;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    vertical-align: 1px;
}

.catalog-empty { padding: 40px 15px; text-align: center; color: var(--ink-3); }

/* ============================================================
   书库 / 分类页（type.html）
   ============================================================ */
.bookstore-category {
    margin-bottom: 16px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.bookstore-category-title {
    display: inline-block;
    min-width: 76px;
    margin-right: 8px;
    font-weight: 700;
    color: var(--ink);
}

.bookstore-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 6px 0;
}

.bookstore-filter-row:first-child { margin-top: 0; }
.bookstore-filter-row:last-child { margin-bottom: 0; }

.bookstore-category a {
    display: inline-block;
    min-width: 76px;
    height: 34px;
    line-height: 34px;
    margin: 4px 8px 4px 0;
    padding: 0 14px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 17px;
    box-sizing: border-box;
    transition: all .15s ease;
}

.bookstore-category a.active,
.bookstore-category a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* 书库网格（3 列） */
.bookstore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 16px;
    box-sizing: border-box;
}

.bookstore-book {
    display: flex;
    min-width: 0;
    height: 138px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
    transition: background .18s var(--ease);
}

.bookstore-book:hover { background: var(--brand-soft); }

.bookstore-cover {
    display: block;
    width: 80px;
    height: 107px;
    flex: 0 0 80px;
    margin-right: 12px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(20, 23, 28, .14);
    box-sizing: border-box;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.bookstore-book:hover .bookstore-cover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(20, 23, 28, .20);
}

.bookstore-cover img {
    display: block;
    width: 80px;
    height: 107px;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.bookstore-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    font-size: 12px;
    background: var(--surface-2);
    z-index: 1;
}

.bookstore-book-info { flex: 1; min-width: 0; overflow: hidden; }

.bookstore-book-title {
    height: 24px;
    line-height: 24px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 7px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bookstore-book-title a { color: var(--ink); }
.bookstore-book-title a:hover { color: var(--brand); }
.bookstore-book-title .bookstore-status { margin-left: 6px; }

.bookstore-meta {
    height: 22px;
    line-height: 22px;
    color: var(--ink-3);
    font-size: 12px;
    margin-bottom: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bookstore-meta span { margin-right: 10px; }

.bookstore-desc {
    height: 40px;
    line-height: 20px;
    color: var(--ink-2);
    font-size: 13px;
    overflow: hidden;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bookstore-empty { padding: 44px 15px; text-align: center; color: var(--ink-3); }

/* ============================================================
   排行榜（rank.html + rank_grid_item / rank_table_item）
   ============================================================ */
.rank-tabs {
    margin-bottom: 16px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.rank-tabs a {
    display: inline-block;
    min-width: 78px;
    height: 36px;
    line-height: 36px;
    margin: 0 10px 6px 0;
    padding: 0 14px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 18px;
    box-sizing: border-box;
    transition: all .15s ease;
}

.rank-tabs a.active,
.rank-tabs a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.rank-box-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    border-bottom: 1px solid var(--line);
    padding: 0 18px;
    box-sizing: border-box;
}

.rank-box-title-main {
    display: flex;
    align-items: center;
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    padding: 10px 0;
}

.rank-box-title-main::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--brand);
    flex-shrink: 0;
}

.rank-box-title small {
    margin-left: 10px;
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 400;
}

.rank-box-total {
    flex-shrink: 0;
    margin-left: 16px;
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.rank-box-total em { font-style: normal; font-weight: 700; color: var(--brand); }

.rank-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 32px;
    padding: 20px 20px 2px;
    box-sizing: border-box;
    overflow: hidden;
}

.rank-book-item {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 162px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--line-dash);
    box-sizing: border-box;
    overflow: hidden;
}

.rank-book-cover {
    display: block;
    width: 90px;
    height: 122px;
    flex: 0 0 90px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 3px 10px rgba(20, 23, 28, .16);
    background: var(--surface-2);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.rank-book-cover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(20, 23, 28, .22);
}

.rank-book-cover img {
    display: block;
    width: 90px;
    height: 122px;
    object-fit: cover;
}

.rank-status {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 2px 8px;
    height: auto;
    line-height: 16px;
    border-radius: 0;
}

.rank-book-info {
    flex: 1;
    min-width: 0;
    padding-left: 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.rank-book-title {
    height: 28px;
    line-height: 28px;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-book-title a { color: var(--ink); }
.rank-book-title a:hover { color: var(--brand); }

.rank-num {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    margin-right: 8px;
    text-align: center;
    background: #c3c7cd;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    vertical-align: 1px;
}

.rank-num.top1,
.rank-num.n1 { background: var(--brand); }
.rank-num.top2,
.rank-num.n2 { background: var(--accent); }
.rank-num.top3,
.rank-num.n3 { background: var(--gold); }

.rank-book-author {
    height: 24px;
    line-height: 24px;
    color: var(--ink-2);
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-book-desc {
    height: 48px;
    line-height: 24px;
    margin-top: 6px;
    color: var(--ink-3);
    font-size: 13px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rank-book-meta {
    height: 24px;
    line-height: 24px;
    margin-top: 8px;
    color: var(--ink-3);
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* rank_table_item（表格备用样式） */
.rank-td-center { text-align: center; }
.rank-book-name { font-size: 15px; font-weight: 700; }
.rank-book-name a { color: var(--ink); }
.rank-book-name a:hover { color: var(--brand); }
.rank-book-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* ============================================================
   搜索结果（search.html + search_item）—— 卡片网格
   ============================================================ */
.search-tabs {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.search-tabs a {
    display: inline-block;
    min-width: 86px;
    height: 36px;
    line-height: 36px;
    margin: 0 10px 6px 0;
    padding: 0 14px;
    text-align: center;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    border-radius: 18px;
    box-sizing: border-box;
    transition: all .15s ease;
}

.search-tabs a.active,
.search-tabs a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.search-tag-cloud {
    padding: 12px 18px 6px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    line-height: 30px;
}

.search-tag-label {
    display: inline-block;
    margin-right: 8px;
    color: var(--ink-3);
    font-size: 13px;
}

.search-tag-cloud a {
    display: inline-block;
    height: 26px;
    line-height: 26px;
    padding: 0 11px;
    margin: 0 7px 7px 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12px;
    text-decoration: none;
    transition: all .15s ease;
}

.search-tag-cloud a:hover {
    border-color: var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand);
}

.search-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.search-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-sizing: border-box;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.search-item:hover {
    border-color: var(--brand-line);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.search-cover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    flex: 0 0 auto;
    position: relative;
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20, 23, 28, .12);
}

.search-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-status {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 2px 8px;
    height: auto;
    line-height: 16px;
    border-radius: 0;
}

.search-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding-top: 14px;
}

.search-name {
    height: 28px;
    line-height: 28px;
    font-size: 17px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-name a { color: var(--ink); }
.search-name a:hover { color: var(--brand); }

.search-meta {
    min-height: 44px;
    line-height: 22px;
    color: var(--ink-3);
    font-size: 13px;
    overflow: hidden;
    margin-top: 6px;
}

.search-meta span { display: inline-block; margin-right: 12px; }

.search-desc {
    color: var(--ink-2);
    line-height: 22px;
    height: 66px;
    overflow: hidden;
    margin: 8px 0;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.search-latest {
    margin-top: auto;
    line-height: 22px;
    color: var(--ink-3);
    font-size: 13px;
    overflow: hidden;
}

.search-latest a { color: var(--brand); }

.search-date { display: block; margin-top: 6px; color: var(--ink-3); }

/* ============================================================
   分页（type / rank / search 共用风格）
   ============================================================ */
.bookstore-page,
.rank-page,
.search-page {
    padding: 22px 10px 26px;
    text-align: center;
    border-top: 1px solid var(--line);
}

.bookstore-page a, .bookstore-page span,
.rank-page a, .rank-page span,
.search-page a, .search-page span {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 3px 6px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    border-radius: var(--radius);
    box-sizing: border-box;
    transition: all .15s ease;
}

.bookstore-page a:hover,
.rank-page a:hover,
.search-page a:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.bookstore-page .current,
.rank-page .current,
.search-page .current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.bookstore-page .disabled,
.rank-page .disabled,
.search-page .disabled {
    color: var(--ink-3);
    background: var(--surface-2);
    cursor: not-allowed;
}

.bookstore-page .page-total,
.rank-page .page-total,
.search-page .page-total {
    border: none;
    background: none;
    color: var(--ink-3);
}

/* ============================================================
   临时书架（history.html）—— 表格
   ============================================================ */
.bqg-box-title strong { font-weight: 700; }

.bqg-box-title strong::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--brand);
    vertical-align: -2px;
}

.history-clear {
    display: inline-block;
    height: 30px;
    line-height: 30px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all .15s ease;
}

.history-clear:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: #fff;
}

.history-note {
    padding: 14px 18px;
    line-height: 24px;
    color: var(--ink-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.history-table-wrap { padding: 0 18px 18px; box-sizing: border-box; }

.history-table { width: 100%; border-collapse: collapse; }

.history-table th,
.history-table td {
    height: 48px;
    line-height: 48px;
    padding: 0 10px;
    border-bottom: 1px dashed var(--line-dash);
    font-size: 13px;
    box-sizing: border-box;
    white-space: nowrap;
}

.history-table th {
    color: var(--ink-2);
    background: var(--surface-2);
    font-weight: 500;
    text-align: left;
}

.history-table .book-name { width: 240px; font-size: 14px; font-weight: 700; }

.history-table .book-name a {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.history-table .history-chapter a,
.history-table .latest-chapter a {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.history-table .cat,
.history-table .author,
.history-table .time { color: var(--ink-3); }

.history-actions { width: 200px; text-align: right; white-space: nowrap; }

.history-btn {
    display: inline-block;
    height: 32px;
    line-height: 30px;
    min-width: 58px;
    padding: 0 12px;
    margin-left: 6px;
    text-align: center;
    border-radius: var(--radius);
    box-sizing: border-box;
    font-size: 13px;
    transition: all .15s ease;
}

.history-btn-read {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #fff;
}

.history-btn-read:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: #fff;
}

.history-btn-catalog {
    background: #fff;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.history-btn-catalog:hover { background: var(--brand-soft); color: var(--brand); }

.history-btn-delete {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.history-btn-delete:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }

.history-empty {
    padding: 64px 20px;
    text-align: center;
    color: var(--ink-3);
    line-height: 28px;
}

.history-empty a { color: var(--brand); }

/* ============================================================
   动效降级
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* ============================================================
   评论 / 留言（gbook/index.html）—— 左列表 + 右表单
   ============================================================ */
.gb-layout {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    gap: 16px;
    box-sizing: border-box;
}

.gb-list-col { flex: 1; min-width: 0; }

.gb-form-col {
    width: 340px;
    flex-shrink: 0;
}

/* 列表项 */
.gb-list {
    padding: 6px 12px 12px;
}

.gb-card {
    display: flex;
    gap: 12px;
    padding: 16px 6px;
    border-bottom: 1px dashed var(--line-dash);
}

.gb-card:last-child { border-bottom: none; }

.gb-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.gb-body { flex: 1; min-width: 0; }

.gb-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 6px;
}

.gb-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.gb-time {
    font-size: 12px;
    color: var(--ink-3);
}

.gb-badge {
    font-size: 12px;
    line-height: 18px;
    padding: 0 7px;
    border-radius: 3px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--brand-line);
}

.gb-content {
    margin: 0;
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.75;
    word-break: break-word;
    white-space: pre-wrap;
}

.gb-reply {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.7;
}

.gb-reply b { color: var(--brand); font-weight: 700; }
.gb-reply .gb-reply-time { color: var(--ink-3); font-size: 12px; margin-left: 6px; }

/* 空状态 */
.gb-empty {
    padding: 56px 16px;
    text-align: center;
    color: var(--ink-3);
}

.gb-empty .gb-empty-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    opacity: .35;
}

.gb-empty p { margin: 0; }
.gb-empty .gb-empty-title { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.gb-empty .gb-empty-sub { font-size: 13px; margin-top: 6px; }

/* 右侧表单 */
.gb-form-body { padding: 16px 18px 18px; }

.gb-textarea {
    display: block;
    width: 100%;
    height: 132px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 14px;
    font-family: var(--font);
    line-height: 1.7;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, background .15s ease;
}

.gb-textarea::placeholder { color: var(--ink-3); }

.gb-textarea:focus {
    border-color: var(--brand);
    background: #fff;
}

.gb-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ink-3);
}

.gb-counter em { font-style: normal; color: var(--brand); }

.gb-captcha {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.gb-captcha img {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}

.gb-captcha input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, background .15s ease;
}

.gb-captcha input:focus { border-color: var(--brand); background: #fff; }

.gb-msg {
    margin-top: 12px;
    min-height: 18px;
    font-size: 13px;
    line-height: 1.5;
}

.gb-msg.ok { color: var(--done); }
.gb-msg.err { color: var(--brand); }

.gb-submit {
    width: 100%;
    height: 44px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.gb-submit:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

.gb-submit:disabled {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink-3);
    cursor: not-allowed;
}

.gb-submit svg { width: 16px; height: 16px; }

.gb-note {
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--ink-3);
    line-height: 1.7;
}

/* ============================================================
   详情页内嵌评论模块（novel/detail.html + comment/ajax.html）
   复用 .gb-* 卡片 / 表单样式，单列布局
   ============================================================ */
.nc-wrap { padding: 16px 18px 20px; }

.nc-form { margin: 0; }

.nc-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 10px;
}

.nc-tools .gb-captcha { margin-top: 0; }

/* 右侧分组：验证码图 + 验证码输入框 + 发表评论按钮，固定宽度不再撑满 */
.nc-tools .gb-captcha input {
    flex: none;
    width: 130px;
}

.nc-tools-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nc-tools-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.nc-count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.nc-count em { font-style: normal; color: var(--brand); }

.nc-submit {
    width: auto;
    min-width: 140px;
    margin-top: 0;
    padding: 0 26px;
}

/* 评论列表（异步注入） */
.nc-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.nc-loading {
    padding: 32px 0;
    text-align: center;
    color: var(--ink-3);
}

.nc-listhead {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}
.nc-listhead em { font-style: normal; color: var(--brand); }

.nc-list { margin-top: 6px; }

/* 子评论（回复） */
.gb-child {
    margin-top: 10px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.gb-child:last-child { margin-bottom: 0; }
.gb-child .gb-avatar { width: 32px; height: 32px; }

.nc-page {
    border-top: none;
    padding-top: 18px;
    padding-bottom: 4px;
}

/* ============================================================
   响应式
   ============================================================ */
@media screen and (max-width: 1100px) {
    .rank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bookstore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 768px) {
    /* 头部 */
    .bqg-top-inner {
        height: auto !important;
        padding: 14px var(--gutter) !important;
        display: block !important;
    }

    .bqg-logo { height: auto !important; line-height: 1.4 !important; font-size: 22px !important; }

    .bqg-top-right {
        height: auto !important;
        display: block !important;
        margin-top: 12px !important;
    }

    .bqg-top-search { width: 100% !important; }
    .bqg-top-search input { width: 100% !important; }

    .bqg-user-nav {
        height: auto !important;
        line-height: 30px !important;
        margin-top: 12px !important;
    }

    .bqg-user-nav a {
        height: 30px !important;
        line-height: 30px !important;
        margin: 0 16px 0 0 !important;
    }

    .bqg-main-nav-inner {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .bqg-main-nav-inner a { padding: 0 14px !important; }

    /* 首页 */
    .bqg-layout { display: block; margin-top: 12px; }
    .bqg-left, .bqg-right { width: auto; }
    .bqg-right { margin-top: 0; }
    .bqg-book-list { grid-template-columns: 1fr; }

    /* 详情 */
    .detail-main { display: block; padding: 18px; }
    .detail-cover { float: left; width: 132px; height: 176px; margin: 0 16px 10px 0; }
    .detail-cover img { width: 132px; height: 176px; }
    .detail-title { font-size: 21px; line-height: 1.35; white-space: normal; }
    .detail-meta { display: block; }
    .detail-meta-main { display: block; }
    .detail-meta-main span {
        display: block;
        height: auto;
        line-height: 28px;
        white-space: normal;
    }
    .detail-meta-stats {
        clear: both;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 14px;
        margin-top: 6px;
    }
    .detail-meta-stats span {
        display: block;
        height: auto;
        line-height: 28px;
        white-space: normal;
    }
    .detail-meta-update {
        display: block;
    }
    .detail-meta-update span {
        display: block;
        height: auto;
        line-height: 28px;
        white-space: normal;
    }
    .detail-actions { clear: both; gap: 8px; padding-top: 12px; }
    .detail-actions a { min-width: calc(50% - 4px); margin: 0; }
    .bookshelf-msg { width: 100%; }
    .similar-grid { grid-template-columns: 1fr; }
    .similar-item { height: auto; min-height: 120px; }

    /* 阅读 */
    .read-title { padding: 22px 16px 14px; }
    .read-title h1 { font-size: 21px; }
    .read-nav { height: auto; line-height: normal; padding: 10px 6px; }
    .read-nav a, .read-nav span { min-width: 72px; margin: 3px 2px; padding: 0 8px; }
    .read-tools { padding: 12px 8px; line-height: 36px; }
    .read-content { padding: 22px 18px 30px; font-size: 18px; }

    /* 目录 */
    .catalog-book-head { padding: 20px 14px 16px; }
    .catalog-book-head h1 { font-size: 21px; }
    .catalog-book-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 12px;
        text-align: left;
        max-width: 260px;
        margin: 0 auto;
    }
    .catalog-book-meta span {
        display: block;
        margin: 0;
        white-space: normal;
        line-height: 26px;
    }
    .catalog-book-meta span:last-child { grid-column: 1 / -1; }
    .catalog-title { min-height: 0; padding: 12px; display: block; }
    .catalog-title-extra { display: block; margin-top: 6px; }
    .catalog-list { grid-template-columns: 1fr; padding: 8px 14px 16px; column-gap: 0; }

    /* 书库 / 排行 / 列表 */
    .bookstore-category a { min-width: auto; padding: 0 14px; }
    .bookstore-grid { grid-template-columns: 1fr; }
    .bookstore-book { height: auto; min-height: 130px; }
    .rank-grid { grid-template-columns: 1fr; padding: 16px 16px 2px; column-gap: 0; }
    .rank-box-title { display: block; padding: 12px 18px; }
    .rank-box-title-main { padding: 0; }
    .rank-box-total { display: block; margin: 6px 0 0; }

    /* 搜索 */
    .search-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
    .search-item { padding: 12px; }
    .search-name { font-size: 16px; }
    .search-desc { height: 44px; -webkit-line-clamp: 2; }

    /* 评论 / 留言 */
    .gb-layout { display: block; }
    .gb-list-col, .gb-form-col { width: auto; }
    .gb-form-col { margin-top: 0; }

    /* 书架表格横向滚动 */
    .history-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .history-table { min-width: 760px; }
    .bqg-box-title {
        min-height: 0;
        padding: 12px 18px;
        align-items: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .search-list { grid-template-columns: 1fr; }
}
