/* --- 导航与头部增强 --- */
.header { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 0; position: sticky; top: 0; z-index: 1000; }
.header-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.logo-url { font-size: 0.7rem; color: var(--text-muted); margin-top: -5px; }

/* 搜索框美化 */
.header_search { flex: 1; max-width: 500px; position: relative; }
.search-input { width: 100%; padding: 10px 20px; border: 2px solid #edf2f7; border-radius: 25px; outline: none; transition: 0.3s; background: #f7fafc; }
.search-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.search-btn { position: absolute; right: 5px; top: 5px; bottom: 5px; background: var(--primary); color: #fff; border: none; padding: 0 20px; border-radius: 20px; cursor: pointer; }

/* 菜单导航 */
.nav { background: #1e293b; color: rgba(255,255,255,0.8); }
.nav-list { display: flex; overflow-x: auto; white-space: nowrap; }
.nav-list li a { display: block; padding: 12px 20px; font-size: 0.95rem; font-weight: 500; }
.nav-list li a:hover, .nav-list li.active a { color: #fff; background: rgba(255,255,255,0.1); }

/* 移动端处理 */
@media (max-width: 768px) {
    .header_search { display: none; } /* 手机端默认隐藏搜索框，点击图标再弹出 */
    .header_user { display: none; }
    .nav-list { -webkit-overflow-scrolling: touch; }
    .nav-list li a { padding: 10px 15px; font-size: 0.9rem; }
}
/* --- 现代小说网全量核心样式表 --- */
:root {
    --primary: #3b82f6; --accent: #f97316; --bg-body: #f1f5f9;
    --bg-card: #ffffff; --text-main: #1e293b; --text-muted: #64748b;
    --border: #e2e8f0; --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
.clear { clear: both; }

/* 容器与布局 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin: 20px 0; }

/* 通用盒子结构 */
.box_con { background: var(--bg-card); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border); overflow: hidden; }
.box_con h2 { padding: 12px 18px; font-size: 1.1rem; border-bottom: 1px solid var(--border); background: linear-gradient(to right, #ffffff, #f8fafc); position: relative; }
.box_con h2::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; background: var(--primary); }

/* 热门推荐（item 模式） */
.hot-list { padding: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.item { display: flex; gap: 12px; padding: 10px; border: 1px solid #f1f5f9; border-radius: 8px; }
.item .image img { width: 90px; height: 120px; border-radius: 4px; object-fit: cover; }
.item dl { flex: 1; min-width: 0; }
.item dt { font-weight: bold; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item dd { font-size: 0.85rem; color: var(--text-muted); height: 60px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.item .btm { font-size: 0.75rem; margin-top: 8px; color: var(--primary); }

/* 分类块 */
.novelslist-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.novelslist-row ul { padding: 10px 15px; }
.novelslist-row li { line-height: 2.2; border-bottom: 1px dashed #eee; font-size: 0.9rem; display: flex; justify-content: space-between; }
.novelslist-row li i { color: #94a3b8; font-size: 0.8rem; font-style: normal; }

/* 数据列表（最新入库/最新更新） */
.list-table { padding: 10px 0; }
.list-table li { display: flex; padding: 10px 18px; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; align-items: center; }
.list-table li:hover { background: #f8fafc; }
.list-table span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-table .s1 { width: 80px; color: var(--text-muted); } /* 分类 */
.list-table .s2 { flex: 2; font-weight: 500; } /* 书名 */
.list-table .s3 { flex: 3; color: var(--text-muted); padding: 0 10px; } /* 最新章节 */
.list-table .s4 { width: 100px; color: #64748b; text-align: right; } /* 作者 */
.list-table .s5 { width: 120px; color: #94a3b8; text-align: right; font-size: 0.8rem; } /* 时间 */

/* 响应式调整 */
@media (max-width: 992px) {
    .grid-2-1, .novelslist-row { grid-template-columns: 1fr; }
    .list-table .s3, .list-table .s5 { display: none; } /* 手机端隐藏章节和时间，防止太挤 */
    .hot-list { grid-template-columns: 1fr; }
}
/* --- 书籍详情页专用 --- */
/* --- 经典紧凑型样式 --- */
.section-margin { margin-top: 15px; border: 1px solid #ddd; background: #fff; }
.section-title { padding: 10px 15px; background: #f8f8f8; border-bottom: 1px solid #ddd; font-size: 16px; font-weight: bold; }

/* 头部布局 */
.book-detail-header { background: #fff; border: 1px solid #ddd; padding: 20px; margin-top: 15px; }
.book-layout { display: flex; gap: 20px; }
.book-cover img { width: 140px; height: 185px; border: 1px solid #eee; padding: 2px; }

.book-main h1 { font-size: 24px; margin-bottom: 10px; color: #333; }
.book-meta { font-size: 14px; color: #666; margin-bottom: 12px; border-bottom: 1px dashed #eee; padding-bottom: 10px; }
.book-meta .status { color: #ff6600; font-weight: bold; }
.book-update { font-size: 14px; margin-bottom: 12px; }
.book-update a { color: #3b82f6; font-weight: bold; }
.book-update span { color: #999; font-size: 12px; margin-left: 10px; }

.book-intro-simple { font-size: 14px; line-height: 1.8; color: #555; height: 50px; overflow: hidden; margin-bottom: 15px; }

/* 按钮样式：更硬朗 */
.book-actions { display: flex; gap: 10px; }
.book-actions a { padding: 8px 20px; font-size: 14px; text-align: center; border-radius: 2px; }
.btn-read { background: #ff6600; color: #fff !important; }
.btn-list { background: #f0f0f0; color: #333 !important; border: 1px solid #ccc; }
.btn-fav { background: #fff; color: #666 !important; border: 1px solid #ccc; }

/* 章节列表：高密度格子 */
.chapter-grid-wrap { display: flex; flex-wrap: wrap; padding: 10px; }
.ch-item { width: 33.33%; padding: 10px 15px; box-sizing: border-box; border-bottom: 1px solid #f2f2f2; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-item:hover { color: #ff6600; background: #fafafa; }

/* 推荐标签：紧凑型 */
.rec-tags { padding: 15px; }
.rec-tags a { display: inline-block; margin: 0 10px 10px 0; padding: 5px 12px; background: #f4f4f4; font-size: 13px; color: #444; border: 1px solid #e0e0e0; }
.rec-tags a:hover { border-color: #ff6600; color: #ff6600; }

/* 手机端屏蔽复杂布局 */
@media (max-width: 768px) {
    .book-layout { flex-direction: row; }
    .book-cover img { width: 100px; height: 135px; }
    .book-main h1 { font-size: 18px; }
    .book-meta { font-size: 12px; }
    .ch-item { width: 100%; } /* 手机端一列展示 */
    .book-intro-simple { height: auto; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; }
}



/*/*
/* --- 目录页专项优化 --- */
.path-nav { padding: 15px 0; font-size: 14px; color: #666; }

/* 目录简易头部 */
.list-header-simple { padding: 20px; border-bottom: 2px solid var(--primary); }
.list-header-simple h1 { font-size: 22px; color: #333; }
.list-header-simple h1 span { font-size: 14px; color: #888; margin-left: 15px; font-weight: normal; }
.list-header-simple p { margin-top: 8px; font-size: 13px; color: #999; }

/* 分页组件 */
.page-control { display: flex; justify-content: center; margin: 15px 0; }
.page-btns { display: flex; align-items: center; gap: 8px; }
.page-btn { 
    display: inline-block; 
    padding: 6px 18px; 
    border: 1px solid #ddd; 
    background: #fff; 
    color: #444; 
    font-size: 14px; 
    border-radius: 3px;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.disabled { background: #f5f5f5; color: #ccc; cursor: not-allowed; }

.page-select-wrap select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    outline: none;
    font-size: 14px;
}

/* 全量章节列表：高密度网格 */
.chapter-list-full { 
    display: flex; 
    flex-wrap: wrap; 
    background: #fff; 
    padding: 10px 0;
}
.chapter-list-full a {
    width: 25%; /* PC端每行4列 */
    display: block;
    padding: 12px 15px;
    box-sizing: border-box;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-list-full a:hover {
    background: #f9fbff;
    color: var(--primary);
    text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 992px) {
    .chapter-list-full a { width: 33.33%; } /* 平板端3列 */
}

@media (max-width: 768px) {
    .chapter-list-full a { width: 50%; padding: 10px; } /* 手机端2列 */
    .list-header-simple h1 { font-size: 18px; }
    .page-btn { padding: 5px 12px; font-size: 13px; }
}


/* --- 阅读页专项优化 --- */
.read-page { background: #f6f4ec; color: #333; } /* 经典米黄护眼底色 */

.read-path { padding: 15px 0; font-size: 13px; color: #777; }

.read-container { 
    max-width: 850px; /* 限制阅读宽度，防止视线太长疲劳 */
    margin: 0 auto; 
    background: #f6f4ec; 
    padding: 0 10px;
}

.read-title { 
    font-size: 28px; 
    font-weight: 500; 
    text-align: center; 
    padding: 30px 0; 
    border-bottom: 1px dashed #d6d3c7;
    margin-bottom: 30px;
}

/* 正文排版 */
.read-content { 
    font-size: 20px;       /* 默认大号字体 */
    line-height: 1.8;      /* 舒适行高 */
    word-wrap: break-word; 
    min-height: 500px;
    color: #2c3e50;
    font-family: "PingFang SC", "Microsoft YaHei", serif;
}

.read-content p { 
    margin-bottom: 25px;   /* 段落间距 */
    text-indent: 2em;      /* 首行缩进 */
}

/* 翻页按钮 */
.read-actions { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    padding: 40px 0; 
}
.read-btn { 
    display: inline-block;
    padding: 10px 35px;
    background: #ebe8dc;
    border: 1px solid #d6d3c7;
    color: #555;
    border-radius: 4px;
    font-size: 16px;
    transition: 0.2s;
}
.read-btn:hover { 
    background: #3b82f6; 
    color: #fff !important; 
    border-color: #3b82f6; 
}

.read-tips { 
    text-align: center; 
    font-size: 12px; 
    color: #999; 
    padding-bottom: 30px; 
}

/* 移动端适配 */
@media (max-width: 768px) {
    .read-page { background: #fdfdfd; } /* 手机端白色更清晰 */
    .read-container { background: #fdfdfd; padding: 0 15px; }
    .read-title { font-size: 22px; padding: 20px 0; }
    .read-content { font-size: 18px; line-height: 1.6; }
    .read-content p { margin-bottom: 15px; }
    .read-btn { padding: 8px 20px; font-size: 14px; flex: 1; text-align: center; }
}
/* --- 阅读设置条 --- */
.read-settings { background: #fff; border-bottom: 1px solid #ddd; padding: 10px 0; position: sticky; top: 60px; z-index: 99; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.setting-wrap { display: flex; gap: 30px; align-items: center; }
.set-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.btn-set { padding: 4px 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; border-radius: 3px; }
.btn-set.active { border-color: var(--primary); color: var(--primary); font-weight: bold; }

/* 背景色定义 */
.bg-default { background: #f6f4ec !important; }
.bg-green { background: #c7edcc !important; }
.bg-night { background: #1a1a1a !important; color: #fff; }

/* 主题类切换逻辑 */
#read-body.theme-default { background: #f6f4ec; }
#read-body.theme-default .read-container { background: #f6f4ec; }

#read-body.theme-green { background: #c7edcc; }
#read-body.theme-green .read-container { background: #c7edcc; }
#read-body.theme-green .read-content { color: #2c3e50; }

#read-body.theme-night { background: #1a1a1a; }
#read-body.theme-night .read-container { background: #1a1a1a; color: #888; }
#read-body.theme-night .read-content { color: #888; }
#read-body.theme-night .read-title { color: #666; border-color: #333; }
#read-body.theme-night .read-btn { background: #222; border-color: #333; color: #666; }
#read-body.theme-night .read-path { color: #444; }

/* 正文基础样式 */
.read-content { font-size: 20px; line-height: 1.8; padding: 20px 0; }
.read-content p { margin-bottom: 25px; text-indent: 2em; }

@media (max-width: 768px) {
    .read-settings { top: 50px; }
    .setting-wrap { gap: 10px; justify-content: center; }
    .set-label { display: none; } /* 手机端隐藏“背景”字样节省空间 */
}



/* --- 分类页整体容器 --- */
.sort-page-container { background: #fff; padding-bottom: 30px; }

/* 头部装饰 */
.sort-header-bar { padding: 20px 0; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.sort-header-bar h1 { font-size: 24px; color: #333; margin: 0; }
.sort-header-bar p { color: #999; margin-top: 5px; font-size: 13px; }

/* 标题横线 */
.sort-title-line { border-bottom: 2px solid #333; margin-bottom: 15px; height: 35px; }
.sort-title-line span { background: #333; color: #fff; padding: 5px 15px; display: inline-block; font-size: 14px; }

/* --- 热门推荐列表修正 --- */
/* 这里假设系统 fengmian 标签输出的是带 <a> 和 <img> 的 div 或 li */
.hot-flex-list { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; }
.hot-flex-list > * { width: calc(16.66% - 13px); text-align: center; } /* PC端一行6个 */
.hot-flex-list img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* --- 核心：系统列表重置 --- */
.system-output-wrap { border: 1px solid #eee; border-radius: 4px; overflow: hidden; }
/* 重点：锁定系统生成的 li 或 tr 样式 */
.system-output-wrap li, .system-output-wrap tr {
    display: flex !important;
    align-items: center;
    padding: 12px 10px !important;
    border-bottom: 1px solid #f5f5f5 !important;
    background: #fff !important;
    margin: 0 !important;
}
.system-output-wrap li:hover { background: #fcfcfc !important; }

/* 针对系统内部 span 的定位（根据你的系统 s1-s5 顺序） */
.system-output-wrap span, .system-output-wrap td {
    display: inline-block !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.system-output-wrap .s1 { width: 80px; color: #999; font-size: 12px; } /* 分类 */
.system-output-wrap .s2 { flex: 1; font-weight: bold; color: #333; padding: 0 10px; } /* 书名 */
.system-output-wrap .s3 { width: 40%; color: #666; } /* 章节 */
.system-output-wrap .s4 { width: 100px; text-align: right; color: #999; } /* 时间/作者 */

/* --- 分页美化 --- */
.custom-pagination { text-align: center; margin-top: 30px; }
.custom-pagination a, .custom-pagination span {
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}
.custom-pagination strong, .custom-pagination .current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* --- 手机端适配 --- */
@media (max-width: 768px) {
    .hot-flex-list > * { width: calc(33.33% - 10px); } /* 手机端一行3个 */
    .system-output-wrap .s1, .system-output-wrap .s4 { display: none !important; } /* 隐藏分类和时间 */
    .system-output-wrap .s2 { width: 40% !important; flex: none; }
    .system-output-wrap .s3 { width: 60% !important; font-size: 13px; }
}
/* --- PC端布局：一行3个 --- */
.mobile-adaptive-box {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

/* 强行覆盖系统自带的 col-md-4 和 col-xs-4 */
.mobile-adaptive-box .book-coverlist {
    width: 33.33% !important; /* PC端 3列 */
    padding: 10px !important;
    float: left !important;
    box-sizing: border-box;
}

.mobile-adaptive-box .book-coverlist .row {
    margin: 0;
    display: flex;
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
    height: 100%;
}

/* 封面比例锁定 */
.mobile-adaptive-box .col-md-5 {
    width: 90px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.mobile-adaptive-box .thumbnail {
    width: 90px !important;
    height: 120px !important;
    margin: 0 !important;
    object-fit: cover;
}

/* 内容区域 */
.mobile-adaptive-box .col-md-7 {
    width: calc(100% - 100px) !important;
    padding-left: 15px !important;
    flex: 1;
}

.mobile-adaptive-box h4 {
    font-size: 16px;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 简介隐藏/截断控制 */
.mobile-adaptive-box .caption p {
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ---------------- 手机端极致自适应 ---------------- */
@media (max-width: 768px) {
    /* 1. 强行改成一行 1 个 */
    .mobile-adaptive-box .book-coverlist {
        width: 100% !important; 
        padding: 5px 10px !important;
    }

    .mobile-adaptive-box .book-coverlist .row {
        border: none;
        border-bottom: 1px solid #f5f5f5;
        border-radius: 0;
        padding: 10px 0;
    }

    /* 2. 封面在手机上缩小一点点 */
    .mobile-adaptive-box .col-md-5 {
        width: 75px !important;
    }
    
    .mobile-adaptive-box .thumbnail {
        width: 75px !important;
        height: 100px !important;
    }

    /* 3. 让简介在手机上强制显示（覆盖 hidden-xs） */
    .mobile-adaptive-box .hidden-xs {
        display: -webkit-box !important; 
        margin-top: 5px;
        -webkit-line-clamp: 2; /* 手机端只给2行简介空间 */
    }

    .mobile-adaptive-box .col-md-7 {
        width: calc(100% - 85px) !important;
    }
    
    .mobile-adaptive-box h4 {
        font-size: 15px;
    }
}
/* 阅读记录列表容器 */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.history-list li:hover {
    background: #fcfcfc;
}

/* 各列宽度分配 */
.history-list .s1 { width: 25%; font-weight: bold; font-size: 15px; } /* 书名 */
.history-list .s2 { width: 15%; color: #666; } /* 作者 */
.history-list .s3 { width: 40%; color: #888; font-size: 13px; } /* 阅读进度 */
.history-list .s5 { width: 20%; text-align: right; } /* 操作按钮 */

/* 书名链接 */
.history-list .s1 a { color: #333; text-decoration: none; }
.history-list .s1 a:hover { color: #3b82f6; }

/* 按钮样式优化 */
.xsdel {
    color: #ff4d4f;
    margin-right: 15px;
    font-size: 12px;
    text-decoration: none;
}

.a3 {
    background: #3b82f6;
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none !important;
}

.a3:hover { background: #2563eb; }

/* ---------------- 手机端自适应 ---------------- */
@media (max-width: 768px) {
    .history-list li {
        position: relative;
        padding: 12px 0;
    }
    
    .history-list .s1 { width: 100%; margin-bottom: 5px; }
    .history-list .s2 { width: 50%; font-size: 12px; }
    .history-list .s3 { width: 100%; margin: 5px 0; font-size: 12px; color: #999; }
    
    /* 按钮在手机端移到右上角或调整位置 */
    .history-list .s5 {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
    
    .xsdel {
        float: right;
        margin-right: 0;
    }
}

/* 搜索结果列表整体美化 */
.search-result-list {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

/* 兼容系统输出的 li 或 tr 结构 */
.search-result-list li, .search-result-list tr {
    display: block !important;
    padding: 15px 10px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    line-height: 1.8;
}

.search-result-list li:hover {
    background: #f9f9f9;
}

/* 调整系统输出的 span 间距 (s1分类, s2书名, s3章节, s4作者) */
.search-result-list span {
    margin-right: 10px;
}

.search-result-list .s2 {
    font-size: 16px;
    font-weight: bold;
}

.search-result-list .s2 a {
    color: #333;
    text-decoration: none;
}

/* 移动端自适应：隐藏多余列，防止重叠 */
@media (max-width: 768px) {
    .search-result-list .s1, .search-result-list .s4, .search-result-list .s5 {
        display: none !important;
    }
    .search-result-list .s2 {
        display: block !important;
        width: 100%;
        margin-bottom: 5px;
    }
    .search-result-list .s3 {
        display: block !important;
        font-size: 13px;
        color: #888;
    }
}
