/* ========================================
   小说阅读网 - 主样式文件
   风格参考：91ketang.com
   布局参考：xpxs.net
======================================== */

/* CSS变量 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --primary-dark: #096dd9;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #777777;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --container-width: 1200px;
    --header-height: 60px;
    --nav-height: 50px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

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

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ========================================
   顶部区域
======================================== */

.header {
    background: var(--bg-header);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    height: var(--header-height);
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 30px;
}

.logo-icon {
    font-size: 24px;
}

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

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-page);
    border-radius: 20px;
    padding: 0 15px;
    width: 280px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
}

.search-box button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--primary-hover);
}

.user-menu {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
}

.user-menu a:hover {
    color: var(--primary-color);
}

/* ========================================
   导航栏
======================================== */

.nav-bar {
    background: var(--primary-color);
    display: block;
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    height: var(--nav-height);
}

.nav-list {
    display: flex;
    align-items: center;
    height: var(--nav-height);
}

.nav-item a {
    display: block;
    padding: 0 18px;
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    line-height: var(--nav-height);
    transition: all 0.3s;
    font-weight: 500;
}

.nav-item a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-item.active a {
    background: #2c3e50;
    color: #fff;
    font-weight: 700;
}

/* ========================================
   主内容区
======================================== */

.main-content {
    padding: 15px 0;
}

/* ========================================
   分类页布局：左右分栏（默认）
======================================== */

.row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

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

.col-side {
    width: 280px;
    flex-shrink: 0;
}

.col-main .card {
    margin-bottom: 15px;
}

/* 面包屑 */
.breadcrumb {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.breadcrumb span {
    margin: 0 5px;
}

/* ========================================
   第一区块：热门推荐 + 排行榜（高度对齐）
======================================== */

.section-hot {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: stretch;
}

.hot-books {
    flex: 1;
    min-width: 0;
    display: flex;
}

.hot-books .card-hot {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hot-books .card-hot .card-body {
    flex: 1;
}

.hot-rank {
    width: 300px;
    flex-shrink: 0;
    display: flex;
}

.hot-rank .sidebar-rank {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hot-rank .sidebar-rank .card-body {
    flex: 1;
}

/* 卡片通用 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title .icon {
    font-size: 18px;
}

.card-more {
    font-size: 14px;
    color: var(--text-muted);
}

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

/* 查看全部按钮（book.php 新增） */
.card-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s;
}
.card-more-btn:hover {
    background: var(--primary-hover);
    color: #fff;
}

.card-body {
    padding: 12px 15px;
}

/* 热门推荐 - 字体加大 */
.hot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.hot-book-item {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.hot-book-item:nth-child(odd) {
    border-right: 1px solid var(--border-color);
}

.hot-book-item:hover {
    background: var(--bg-page);
}

.hot-cover {
    width: 90px;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    flex-shrink: 0;
}

.hot-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.hot-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.hot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    align-items: center;
}

.hot-author {
    color: var(--text-secondary);
}

.hot-author a {
    color: var(--text-secondary);
    text-decoration: none;
}

.hot-author a:hover {
    color: var(--primary);
}

.hot-words {
    color: var(--text-muted);
}

.hot-desc {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.8;
}

/* 人气排行 - 字体加大、行距加大、高度对齐 */
.sidebar-rank {
    height: 100%;
}

.sidebar-rank .card-header {
    padding: 12px 15px;
}

.sidebar-rank .card-title {
    font-size: 17px;
}

.rank-body {
    padding: 8px 15px 12px;
}

.rank-list-item {
    display: flex;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px dashed var(--border-color);
    line-height: 1.8;
}

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

.rank-list-item .rank {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.rank-list-item .rank.top1 { background: #ff6b6b; color: #fff; }
.rank-list-item .rank.top2 { background: #ffa94d; color: #fff; }
.rank-list-item .rank.top3 { background: #ffd43b; color: #fff; }

.rank-list-item .title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.rank-list-item .rank-author {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 10px;
}

/* ========================================
   分类页推荐书籍（横向卡片，默认样式）
======================================== */

.book-card-h {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

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

.book-card-h:hover {
    background: #f8fbff;
}

.book-card-h .book-cover {
    width: 90px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-page);
}

.book-card-h .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card-h .book-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.book-card-h .book-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 8px;
}

.book-card-h .book-title:hover {
    color: var(--primary-color);
}

.book-card-h .book-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.book-card-h .book-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   第二区块：分类推荐（1行3个）
======================================== */

.category-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: stretch;
}

.category-card {
    flex: 1;
    min-width: 0;
}

.category-card .card {
    height: 100%;
}

.category-card .card-header {
    padding: 10px 15px;
}

.category-card .card-title {
    font-size: 17px;
}

.category-card .card {
    transition: box-shadow 0.3s, transform 0.3s;
}

.category-card .card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.cat-body {
    padding: 12px 15px 15px;
}

.cat-featured {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.cat-cover {
    width: 85px;
    height: 115px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    flex-shrink: 0;
}

.cat-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.cat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cat-desc {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
}

.cat-list {
    display: flex;
    flex-direction: column;
}

.cat-item {
    display: flex;
    align-items: center;
    padding: 7px 5px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: background 0.3s;
    margin: 1px 0;
}

.cat-item:hover {
    background: #f0f7ff;
}

.cat-item .rank {
    width: 20px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
}

.cat-item a {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.cat-item a:hover {
    color: var(--primary-color);
}

.cat-item .author {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 8px;
}

.cat-item .author a {
    color: inherit;
    text-decoration: none;
}

.cat-item .author a:hover {
    color: var(--primary-color);
}

/* ========================================
   第三区块：最近更新 + 最新入库（高度对齐）
======================================== */

.section-bottom {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.bottom-main {
    flex: 1;
    min-width: 0;
    display: flex;
}

.bottom-main .card-update {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.bottom-main .card-update .card-body {
    flex: 1;
}

.bottom-side {
    width: 300px;
    flex-shrink: 0;
    display: flex;
}

.bottom-side .sidebar-new {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.bottom-side .sidebar-new .card-body {
    flex: 1;
}

/* 最近更新 - 5列布局 */
.card-update {
    height: 100%;
}

.update-body {
    padding: 0;
}

/* 表头 - float布局 */
.update-header {
    height: 45px;
    line-height: 45px;
    padding: 0 15px;
    background: var(--bg-page);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.update-header span {
    float: left;
}

.update-header .col-cat { width: 60px; text-align: center; }
.update-header .col-book { width: 260px; margin-left: 10px; }
.update-header .col-chapter { width: calc(100% - 560px); margin: 0 5px; }
.update-header .col-author { width: 90px; margin: 0 5px; }
.update-header .col-time { float: right; width: 120px; text-align: right; }

/* 更新列表 - float布局 */
.update-list-item {
    padding: 0 15px;
    height: 45px;
    line-height: 45px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    transition: background 0.3s;
}

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

.update-list-item:hover {
    background: #f8fbff;
}

.update-list-item .category,
.update-list-item .book-name,
.update-list-item .chapter,
.update-list-item .author {
    float: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.update-list-item .time {
    float: right;
    text-align: right;
}

/* 分类标签 */
.update-list-item .category {
    width: 60px;
    text-align: center;
    background: var(--bg-page);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 20px;
    margin-top: 12px;
    height: 20px;
}

/* 书名列 */
.update-list-item .book-name {
    width: 260px;
    font-size: 15px;
    margin-left: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.update-list-item .book-name:hover {
    color: var(--primary-color);
}

/* 章节列 */
.update-list-item .chapter {
    width: calc(100% - 560px);
    margin: 0 5px;
    font-size: 14px;
    color: var(--text-secondary);
}

.update-list-item .chapter:hover {
    color: var(--primary-color);
}

/* 作者列 */
.update-list-item .author {
    width: 90px;
    margin: 0 5px;
    font-size: 14px;
    color: var(--text-muted);
}

.update-list-item .author a {
    color: inherit;
    text-decoration: none;
}

.update-list-item .author a:hover {
    color: var(--primary-color);
}

/* 时间列 */
.update-list-item .time {
    width: 120px;
    font-size: 13px;
    color: var(--text-muted);
}

/* 最新入库 - 高度对齐 */
.sidebar-new {
    height: 100%;
}

.sidebar-new .card-header {
    padding: 12px 15px;
}

.sidebar-new .card-title {
    font-size: 17px;
}

.new-body {
    padding: 8px 15px 12px;
}

.book-list-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    line-height: 1.8;
}

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

.book-list-item .rank {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.book-list-item .rank.top3 {
    background: var(--primary-color);
    color: #fff;
}

.book-list-item .title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.book-list-item .author {
    color: var(--text-muted);
    font-size: 14px;
}

.book-list-item .author a {
    color: inherit;
    text-decoration: none;
}

.book-list-item .author a:hover {
    color: var(--primary-color);
}

/* ========================================
   侧边栏通用
======================================== */

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.sidebar-card:last-child {
    margin-bottom: 0;
}

/* ========================================
   状态标签
======================================== */

.status-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.status-tag.complete {
    background: #e6f7ff;
    color: var(--primary-color);
}

.status-tag.serial {
    background: #f6ffed;
    color: var(--success-color);
}

/* ========================================
   书籍详情页
======================================== */

.book-detail {
    display: flex;
    gap: 25px;
    padding: 20px;
}

.book-detail .book-cover {
    width: 160px;
    height: 215px;
    flex-shrink: 0;
}

.book-detail .book-info {
    flex: 1;
}

.book-detail .book-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.book-detail .book-meta {
    font-size: 14px;
    margin-bottom: 12px;
}

.book-detail .book-meta span {
    margin-right: 15px;
}

.book-detail .book-desc {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.book-actions {
    display: flex;
    gap: 12px;
}

.book-cover {
    width: 100px;
    height: 135px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    flex-shrink: 0;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-default {
    background: var(--bg-page);
    color: var(--text-secondary);
}

.btn-default:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ========================================
   章节列表
======================================== */

.chapter-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.chapter-item {
    padding: 10px 14px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s;
}

.chapter-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ========================================
   最新章节（book.php - 1行3列网格，新增）
======================================== */

.latest-chapters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.latest-chapter-item {
    padding: 10px 14px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    line-height: 1.6;
}

.latest-chapter-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ========================================
   全部章节字体加大（新增）
======================================== */

.chapter-list-lg .chapter-item {
    font-size: 15px;
    padding: 10px 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   阅读页面
======================================== */

.reader-container {
    max-width: 800px;
    margin: 0 auto;
}

.reader-header {
    text-align: center;
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
}

.reader-header .book-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.reader-header .chapter-title {
    font-size: 20px;
    font-weight: 600;
}

.reader-content {
    padding: 25px 35px;
    font-size: 20px;
    line-height: 2;
    color: var(--text-primary);
}

.reader-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.reader-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 25px;
    border-top: 1px solid var(--border-color);
}

.reader-nav .btn {
    min-width: 110px;
}

/* ========================================
   分页
======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 15px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: #fff;
}

.pagination .current {
    background: var(--primary-color);
    color: #fff;
}

.pagination .disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ========================================
   标签
======================================== */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-page);
    border-radius: 15px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ========================================
   页脚
======================================== */

.footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.7);
    padding: 30px 0 20px;
    margin-top: 30px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: #fff;
}

.footer-info {
    text-align: center;
    font-size: 13px;
    line-height: 2;
}

/* ========================================
   回到顶部
======================================== */

.back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    z-index: 999;
    border: none;
    font-size: 18px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* ========================================
   分类页推荐网格（一行3个竖向卡片，新增）
======================================== */

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 15px;
}

.book-card-v {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    background: var(--bg-card);
}
.book-card-v:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary-color);
}
.book-card-v .book-cover {
    width: 120px;
    height: 160px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}
.book-card-v .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-card-v .book-info {
    width: 100%;
    text-align: center;
}
.book-card-v .book-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}
.book-card-v .book-title:hover {
    color: var(--primary-color);
}
.book-card-v .book-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.book-card-v .book-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
    padding: 0 5px;
}

/* ========================================
   分类页单栏布局（参考 xpxs.net，新增）
======================================== */

/* 在 category.php 的 <body> 加上 class="category-page" 即可生效 */
body.category-page .col-side {
    display: none !important;
}
body.category-page .row {
    flex-direction: column;
}
body.category-page .col-main {
    max-width: 100%;
}

/* 最新入库（分类页单栏版，新增） */
.new-books-section .card-body {
    padding: 8px 15px 12px;
}

/* ========================================
   响应式设计
======================================== */

@media (max-width: 1100px) {
    .category-row {
        flex-wrap: wrap;
    }
    
    .category-card {
        width: calc(50% - 8px);
    }
    
    .category-card:nth-child(3) {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .col-side {
        display: none;
    }
    
    .row {
        flex-direction: column;
    }
    
    .hot-rank,
    .bottom-side {
        display: none;
    }
    
    .section-hot,
    .section-bottom {
        flex-direction: column;
    }
    
    .chapter-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 推荐网格响应式 */
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .nav-list {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 0;
    }
    
    .nav-item a {
        padding: 6px 10px;
        line-height: 1.5;
        font-size: 15px;
    }
    
    .hot-grid {
        grid-template-columns: 1fr;
    }
    
    .hot-book-item:nth-child(odd) {
        border-right: none;
    }
    
    .category-card {
        width: 100%;
    }
    
    .book-detail {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .book-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .chapter-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reader-content {
        padding: 20px 15px;
    }
    
    .update-list-item {
        flex-wrap: wrap;
        font-size: 14px;
    }
    
    .update-list-item .chapter {
        max-width: 100%;
        order: 1;
        flex: 1;
    }
    
    /* 推荐网格手机端 */
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    .book-card-v .book-cover {
        width: 90px;
        height: 120px;
    }
    .book-card-v .book-title {
        font-size: 13px;
    }
    .book-card-v .book-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .chapter-list {
        grid-template-columns: 1fr;
    }
    
    .recommend-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   工具类
======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }