/* ==========================================================================
   Base & Reset
   ========================================================================== */
:root {
    --primary-color: #ff9a9e;     /* 可爱粉 */
    --secondary-color: #fecfef;   /* 柔和粉蓝/浅紫 */
    --text-main: #555555;
    --text-muted: #999999;
    --bg-page: #fffbfb;           /* 暖白底色 */
    --bg-box: #ffffff;
    --border-radius: 16px;
    --box-shadow: 0 4px 20px rgba(255, 154, 158, 0.15);
    --hover-shadow: 0 8px 25px rgba(255, 154, 158, 0.3);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background-color: var(--bg-page); color: var(--text-main); line-height: 1.6; }
a { color: var(--text-main); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-color); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; border-radius: 8px; }

/* ==========================================================================
   Layout & Utilities
   ========================================================================== */
.wrap { width: 1200px; margin: 0 auto; }
.mt20 { margin-top: 20px; }
.flex-row { display: flex; gap: 20px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* 文本溢出处理 */
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
.multi-ellipsis { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* 统一可爱风盒子 */
.cute-box {
    background: var(--bg-box);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}
.box-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--secondary-color);
    position: relative;
}
.box-title::before {
    content: "🌸";
    margin-right: 8px;
    font-size: 16px;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.cute-header { background: var(--bg-box); box-shadow: var(--box-shadow); padding: 15px 0; position: sticky; top: 0; z-index: 100; }
.logo a { font-size: 26px; font-weight: bold; color: var(--primary-color); text-shadow: 1px 1px 2px var(--secondary-color); }
.main-nav ul { display: flex; gap: 25px; }
.main-nav a { font-size: 16px; font-weight: 500; padding: 5px 10px; border-radius: 20px; }
.main-nav a:hover, .main-nav a.active { background: var(--secondary-color); color: var(--primary-color); }

.search-box form { display: flex; background: var(--bg-page); border-radius: 25px; overflow: hidden; border: 2px solid var(--secondary-color); }
.search-box input { border: none; background: transparent; padding: 8px 15px; outline: none; width: 180px; color: var(--text-main); }
.search-box button { background: var(--primary-color); color: #fff; border: none; padding: 0 20px; cursor: pointer; font-weight: bold; transition: var(--transition); }
.search-box button:hover { background: #fa8288; }

/* ==========================================================================
   Lists (ul > li > a focus)
   ========================================================================== */
/* 通用带图标列表 */
.cute-list { display: flex; flex-direction: column; gap: 10px; }
.cute-list li { display: flex; align-items: center; }
.cute-list li::before { content: "🎀"; font-size: 12px; margin-right: 6px; }
.cute-list a { flex: 1; }

/* 图文网格列表 */
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.grid-list li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.grid-list .cover-wrap { width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.grid-list .cover-wrap img { width: 100%; height: 180px; object-fit: cover; transition: var(--transition); }
.grid-list .cover-wrap:hover img { transform: scale(1.05); }
.grid-list .tit { font-size: 14px; font-weight: bold; width: 100%; }
.grid-list .auth { font-size: 12px; color: var(--text-muted); width: 100%; }

/* 排行榜列表 */
.rank-list li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px dashed #f0f0f0; }
.rank-list li:last-child { border-bottom: none; }
.rank-list .num { width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: #eee; color: #999; font-size: 12px; margin-right: 10px; font-style: normal; font-weight: bold; }
.rank-list .num.top { background: var(--primary-color); color: #fff; }

/* 详细图文列表 (Category/Search) */
.detail-list { display: flex; flex-direction: column; gap: 20px; }
.detail-list li { display: flex; gap: 20px; background: #fafafa; padding: 15px; border-radius: 12px; transition: var(--transition); }
.detail-list li:hover { background: var(--secondary-color); transform: translateY(-2px); }
.detail-list .cover { width: 110px; flex-shrink: 0; }
.detail-list .info { flex: 1; min-width: 0; }
.detail-list .info h3 { font-size: 18px; margin-bottom: 8px; }
.detail-list .info .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.detail-list .info .intro { font-size: 14px; color: var(--text-main); line-height: 1.8; }

/* ==========================================================================
   Page Specific
   ========================================================================== */
/* 首页布局 */
.home-main { flex: 3; min-width: 0; }
.home-side { flex: 1; min-width: 0; }

/* 更新列表 */
.update-table { width: 100%; }
.update-table li { display: flex; padding: 10px 0; border-bottom: 1px dashed #eee; font-size: 14px; }
.update-table li.thead { font-weight: bold; color: var(--primary-color); border-bottom: 2px solid var(--secondary-color); }
.update-table .cat { width: 80px; color: var(--text-muted); }
.update-table .name { width: 180px; font-weight: bold; }
.update-table .chap { flex: 1; min-width: 0; }
.update-table .auth { width: 100px; color: var(--text-muted); }
.update-table .time { width: 60px; color: var(--text-muted); text-align: right; }

/* 书籍详情页 */
.breadcrumb { margin-bottom: 15px; font-size: 14px; color: var(--text-muted); }
.breadcrumb ul { display: flex; flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin: 0 8px; color: #ccc; }

.book-head { display: flex; gap: 30px; }
.book-head .cover { width: 200px; flex-shrink: 0; padding: 10px; background: #fff; border: 1px solid var(--secondary-color); border-radius: 12px; box-shadow: var(--box-shadow); }
.book-head .info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.book-head h1 { font-size: 28px; margin-bottom: 15px; color: var(--primary-color); }
.book-head .meta { font-size: 14px; color: var(--text-muted); line-height: 2; margin-bottom: 20px; }
.btn-group { display: flex; gap: 15px; }
.btn-cute { padding: 10px 25px; border-radius: 25px; font-size: 16px; font-weight: bold; text-align: center; transition: var(--transition); }
.btn-primary { background: var(--primary-color); color: #fff; box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4); }
.btn-primary:hover { background: #fa8288; color: #fff; transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--primary-color); color: var(--primary-color); background: transparent; }
.btn-outline:hover { background: var(--secondary-color); color: var(--primary-color); }

.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.chapter-grid a { background: #fdfafb; padding: 10px 15px; border-radius: 8px; border: 1px solid #feedf2; font-size: 14px; transition: var(--transition); }
.chapter-grid a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* 阅读页 */
.read-box { background: #fdf5e6; /* 护眼淡黄色 */ border-radius: 20px; padding: 40px; box-shadow: var(--box-shadow); }
.read-title { text-align: center; margin-bottom: 20px; font-size: 28px; color: #444; }
.read-meta { text-align: center; color: #888; font-size: 14px; margin-bottom: 40px; border-bottom: 1px dashed #ccc; padding-bottom: 20px; }
@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;
    letter-spacing: 1px; color: var(--rd-text) !important;
    text-align: justify; text-justify: inter-ideograph;
    min-height: 60vh; white-space: pre-line;
}
.read-nav { display: flex; justify-content: center; gap: 20px; margin-top: 40px; }

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 30px; }
.page-btn { padding: 8px 20px; background: #fff; border: 1px solid var(--primary-color); color: var(--primary-color); border-radius: 20px; }
.page-btn:hover { background: var(--primary-color); color: #fff; }
.page-current { color: var(--text-muted); font-size: 14px; }

/* Footer */
.cute-footer { text-align: center; padding: 30px 0; margin-top: 40px; color: var(--text-muted); font-size: 14px; }
.cute-footer ul { display: flex; justify-content: center; gap: 15px; margin-bottom: 10px; }

/* ==========================================================================
   Rank Index Page - Enhanced Cute Style
   ========================================================================== */

/* 榜单大容器 */
.rank-hero-flex { display: flex; gap: 20px; margin-bottom: 25px; }
.rank-main-card { flex: 2; min-width: 0; }
.rank-sub-side { flex: 1; min-width: 0; }

/* 榜单卡片 */
.rank-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(255, 154, 158, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    height: 100%;
}
.rank-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 35px rgba(255, 154, 158, 0.2);
}

/* 榜单标题头 */
.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #ffe4e6;
}
.rank-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}
.rank-header h2::before { content: "🏆"; margin-right: 8px; font-size: 18px; }
.rank-header .more-btn {
    font-size: 13px;
    color: var(--text-muted);
    background: #fff5f6;
    padding: 3px 12px;
    border-radius: 12px;
}
.rank-header .more-btn:hover { background: var(--primary-color); color: #fff; }

/* 列表美化 */
.cute-rank-ul li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #fff0f0;
}
.cute-rank-ul li:last-child { border-bottom: none; }

/* 勋章排名数字 */
.badge-num {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    border-radius: 8px;
    margin-right: 12px;
    background: #f0f0f0;
    color: #bbb;
    flex-shrink: 0;
}
/* 前三名专属色 */
.badge-num.top-1 { background: #ffd700; color: #fff; box-shadow: 0 3px 8px rgba(255, 215, 0, 0.4); }
.badge-num.top-2 { background: #c0c0c0; color: #fff; box-shadow: 0 3px 8px rgba(192, 192, 192, 0.4); }
.badge-num.top-3 { background: #cd7f32; color: #fff; box-shadow: 0 3px 8px rgba(205, 127, 50, 0.4); }

.rank-book-link { flex: 1; font-weight: 500; font-size: 15px; min-width: 0; }
.rank-author-tag { font-size: 12px; color: var(--text-muted); margin-left: 10px; }

/* 网格布局：2列或3列 */
.rank-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
/* 18fix.com */