/* --- 基础重置 --- */
* { margin:0; padding:0; box-sizing: border-box; }
body { background: #f4f7f6; color: #333; font-family: "Microsoft Yahei", sans-serif; font-size: 14px; line-height: 1.6; }
.wrap { width: 1200px; margin: 0 auto; }
.flex { display: flex; }
.flex-row { display: flex; justify-content: space-between; align-items: flex-start; }
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }
a { text-decoration: none; color: #333; transition: 0.2s; }
a:hover { color: #ff6600; }
ul { list-style: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* --- 公共组件 --- */
.box { background: #fff; padding: 20px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); margin-bottom: 15px; }
.box-title { font-size: 18px; font-weight: bold; border-left: 4px solid #ff6600; padding-left: 12px; margin-bottom: 20px; line-height: 1.2; }
.breadcrumb { padding: 10px 0; color: #888; font-size: 13px; }

/* --- 头部 --- */
.header { background: #333; color: #fff; padding: 15px 0; }
.logo a { font-size: 26px; color: #fff; font-weight: bold; }
.nav { display: flex; margin-left: 40px; }
.nav-item { color: #eee; margin: 0 15px; font-size: 16px; line-height: 35px; }
.search-bar input { padding: 8px; border: none; border-radius: 4px 0 0 4px; width: 200px; }
.search-bar button { padding: 8px 15px; background: #ff6600; color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; }

/* --- 首页布局与大封推 --- */
.left-col { width: 860px; flex-shrink: 0; }
.right-col { width: 320px; flex-shrink: 0; }
.home-focus { width: 860px; min-height: 400px; }
.home-side-rank { width: 300px; }

.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 10px 0; }
.focus-item { display: flex; height: 120px; overflow: hidden; }
.focus-item .cover img { width: 90px; height: 120px; object-fit: cover; border-radius: 4px; }
.focus-item .info { margin-left: 15px; flex: 1; min-width: 0; }
.focus-item h4 { font-size: 16px; margin-bottom: 6px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-item .author { color: #888; font-size: 13px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-item .intro-short { font-size: 12px; color: #666; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* --- 更新列表与推荐行 --- */
.update-list li { display: flex; line-height: 40px; border-bottom: 1px solid #f5f5f5; transition: background 0.2s; }
.update-list li:hover { background: #fffcf9; }
.update-list .cat { width: 80px; color: #999; }
.update-list .name { width: 150px; font-weight: 500; color: #333; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-list .chapter { flex: 1; color: #666; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-list .author { width: 100px; color: #888; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-list .time { width: 70px; color: #ccc; text-align: right; font-size: 12px; }

.category-rec-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat-rec-item { display: flex; justify-content: space-between; background: #f8f9fa; padding: 12px; border-radius: 4px; min-width: 0; }
.cat-rec-item .tag { color: #ff6600; font-weight: bold; margin-right: 8px; }
.cat-rec-item .tit { flex: 1; min-width: 0; margin: 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-rec-item .auth { color: #bbb; font-size: 12px; }

/* --- 侧边栏组件 --- */
.new-book-item { display: flex; align-items: center; margin-bottom: 15px; height: 60px; overflow: hidden; }
.new-book-item img { width: 45px; height: 60px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.nb-info { margin-left: 12px; flex: 1; min-width: 0; }
.nb-info h5 { font-size: 14px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-info p { font-size: 12px; color: #999; }

.rank-list-mini li { display: flex; align-items: center; height: 35px; border-bottom: 1px dashed #f5f5f5; }
.rank-list-mini .num { width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; color: #fff; background: #ccc; border-radius: 2px; margin-right: 8px; }
.rank-list-mini .num.top { background: #ff6600; }
.rank-list-mini a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- 详情页 --- */
.book-info-panel .book-cover img { width: 210px; height: 280px; border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.book-right { margin-left: 40px; flex: 1; }
.book-right h1 { font-size: 30px; margin-bottom: 20px; }
.book-right .meta { margin-bottom: 15px; color: #666; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.book-right .meta span { margin-right: 25px; }
.action-btns .btn-read { background: #ff6600; color: #fff; padding: 12px 35px; border-radius: 4px; font-size: 16px; display: inline-block; }
.action-btns .btn-menu { border: 1px solid #ff6600; color: #ff6600; padding: 11px 35px; border-radius: 4px; font-size: 16px; display: inline-block; margin-left: 15px; }
.book-intro-text { line-height: 2; color: #444; font-size: 15px; }

/* --- 目录页 --- */
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chapter-grid a { padding: 8px; border-bottom: 1px solid #f9f9f9; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- 阅读页 --- */
.read-box { background: #f6f1e7; padding: 50px; max-width: 900px; margin: 0 auto; border: 1px solid #eaddc0; }
.read-head { text-align: center; margin-bottom: 40px; }
.read-head h1 { font-size: 32px; color: #2c3e50; }
@font-face {
    font-family: 'AntiScrapingFont';
    src: url('/static/template/common/woff/custom.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
.read-content {
    font-family: 'AntiScrapingFont', 'PingFang SC', 'Helvetica Neue', Helvetica, 'Microsoft YaHei', sans-serif;
    font-size: 20px;
    line-height: 1.8; /* 专业阅读行距：1.8 是移动端的黄金比例 */
    letter-spacing: 1px; /* 稍微拉开字间距，减少视觉疲劳 */
    color: #333333 !important;
    text-align: justify; /* 两端对齐，让右侧边缘像出版书一样整齐 */
    text-justify: inter-ideograph; /* 针对中文的对齐优化 */
    min-height: 60vh;

    /* 注意：如果你的内容全挤在一起没有换行，说明你后端返回的是纯文本，必须保留下面这行；
       如果后端返回的是带 <p> 标签的 HTML，可以将这一行注释掉 */
    white-space: pre-line;
    text-indent: 2em;
}
.read-nav { text-align: center; margin: 30px 0; background: rgba(0,0,0,0.03); padding: 15px; border-radius: 4px; }
.read-nav a { margin: 0 25px; font-size: 18px; font-weight: bold; color: #5d4037; }

/* --- 排行榜页 --- */
.rank-index-main { width: 880px; }
.rank-side { width: 300px; }
.rank-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.sub-title { font-size: 16px; margin-bottom: 15px; color: #ff6600; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.rank-nav-side { width: 180px; }
.rank-main-list { width: 700px; }
.rank-nav-list li a { display: block; padding: 12px 15px; border-bottom: 1px solid #f9f9f9; }
.rank-nav-list li a.active { background: #ff6600; color: #fff; border-radius: 4px; }
.rank-book-item { padding: 20px 0; border-bottom: 1px solid #eee; position: relative; }
.rank-index-num { position: absolute; left: -10px; top: 20px; width: 24px; height: 24px; background: #999; color: #fff; text-align: center; line-height: 24px; border-radius: 50%; z-index: 10; font-size: 12px; }
.rank-index-num.top { background: #ff6600; }
.rank-cover img { width: 90px; height: 120px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.rank-info { margin-left: 20px; flex: 1; }
.rank-info h3 { font-size: 18px; margin-bottom: 8px; }
.rank-info .intro { font-size: 13px; color: #777; height: 60px; overflow: hidden; }

/* --- 分类与搜索页 --- */
.cat-book-item { display: flex; padding: 20px 0; border-bottom: 1px solid #eee; }
.cat-book-item img { width: 100px; height: 135px; border-radius: 4px; object-fit: cover; }
.cat-book-info { margin-left: 20px; flex: 1; }
.cat-book-info h3 { font-size: 19px; margin-bottom: 10px; }
.cat-meta { color: #888; margin-bottom: 10px; font-size: 13px; }
.cat-intro { color: #666; font-size: 14px; line-height: 1.6; height: 45px; overflow: hidden; }

/* --- 通用组件：分页与页脚 --- */
.pagination { text-align: center; padding: 30px 0; }
.page-btn { padding: 8px 20px; border: 1px solid #ddd; background: #fff; border-radius: 4px; margin: 0 10px; }
.page-current { color: #ff6600; font-weight: bold; }
.footer { padding: 40px 0; border-top: 1px solid #ddd; color: #999; text-align: center; background: #fff; }
/* 18log.com */