
/* 全局重置 & 基础样式（复用分类页） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", "Ma Shan Zheng", cursive, sans-serif;
}
a {
    text-decoration: none;
}

button {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
    white-space: nowrap !important;
    width: auto !important;
    direction: ltr !important;
    unicode-bidi: normal !important;
}

body {
    background-color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23e2e8f0' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* 滚动条美化（复用） */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e879f9, #6366f1);
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}
::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 6px;
}

/* 导航栏（复用，排行榜设为active） */
header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo::before {
    content: "✨";
    font-size: 20px;
    animation: sparkle 2s infinite alternate;
}
@keyframes sparkle {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}
.nav-menu {
    display: flex;
    gap: 35px;
}
.nav-menu a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    padding: 8px 0;
    transition: all 0.3s ease;
}
.nav-menu a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #e879f9, #6366f1);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nav-menu a:hover {
    color: #fff;
    transform: translateY(-2px);
}
.nav-menu a:hover::after, .nav-menu a.active::after {
    width: 100%;
}

/* 搜索框（复用） */
.search-box {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.search-box input {
    padding: 8px 16px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    width: 200px;
    color: #fff;
    transition: all 0.3s ease;
    background-image: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1)),
                        linear-gradient(135deg, #e879f9, #6366f1);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}
.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}
.search-box input:focus {
    width: 220px;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(232, 121, 249, 0.2);
}
.search-box button {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #e879f9, #6366f1);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(232, 121, 249, 0.2);
}
.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(232, 121, 249, 0.3);
    background: linear-gradient(135deg, #d946ef, #4f46e5);
}

/* 主内容区 */
main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 优化：友情链接样式（灵活自适应版） */
.friend-links {
    background: linear-gradient(135deg, #fff 0%, #fef7fb 100%);
    border-radius: 16px;
    padding: 20px 20px;
    box-shadow: 0 8px 24px rgba(232, 121, 249, 0.15);
    border: 2px solid #f0abfc;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.friend-links::before {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e879f9, #6366f1);
    border-radius: 50%;
    opacity: 0.1;
    z-index: 0;
}
.friend-links-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.friend-links-title::before {
    content: "🔗";
    font-size: 24px;
    animation: linkIcon 2s infinite alternate;
}
@keyframes linkIcon {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}
/* ========== 核心修改1：基础Grid布局（大屏自适应） ========== */
.friend-links-list {
    display: grid;
    /* 大屏下自动填充，最小宽度120px */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 7px;
    position: relative;
    z-index: 1;
}
.friend-link-item {
    text-decoration: none;
    color: #ec7ffffc;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 5px;
    border-radius: 10px;
    transition: all 0.4s ease;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f8ff 100%);
    border: 2px solid #e0e7ff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ========== 核心修改结束 ========== */
.friend-link-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: all 0.6s ease;
}
.friend-link-item:hover {
    background: linear-gradient(135deg, #e879f9, #6366f1);
    color: #fff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(232, 121, 249, 0.4);
    border-color: #fff;
}
.friend-link-item:hover::before {
    left: 100%;
}

/* 标题通用样式（复用） */
.section-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1e293b;
    position: relative;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #e879f9, #6366f1);
    border-radius: 2px;
}
.section-title span {
    background: linear-gradient(135deg, #e879f9, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 排行榜标签切换样式（核心新增） */
.rank-tabs {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.rank-tab-item {
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}
.rank-tab-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}
.rank-tab-item.active {
    background: linear-gradient(135deg, #e879f9, #6366f1);
    color: #fff;
    box-shadow: 0 4px 10px rgba(232, 121, 249, 0.2);
}

/* 排行榜列表样式（核心新增） */
.rank-list {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: 1px solid #f1f5f9;
    margin-bottom: 50px;
}
.rank-item {
    display: flex;
    align-items: flex-start; /* 改为flex-start，避免简介文字垂直居中导致排版乱 */
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}
.rank-item:last-child {
    border-bottom: none;
}
.rank-item:hover {
    background: #f8fafc;
    padding-left: 10px;
    border-radius: 8px;
}

/* 排名标识样式（Top1-3特殊样式） */
.rank-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-right: 20px;
    flex-shrink: 0;
    margin-top: 2px; /* 微调排名数字垂直位置 */
}
.rank-num.top1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
}
.rank-num.top2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.3);
}
.rank-num.top3 {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}
.rank-num.other {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #64748b;
}

/* 榜单封面样式 */
.rank-cover {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* 榜单信息样式 */
.rank-info {
    flex: 1;
}
.rank-title {
    font-size: 18px;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}
.rank-item:hover .rank-title {
    color: #6366f1;
}
.rank-desc {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #475569;
}
.rank-score {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rank-score .star {
    color: #fbbf24;
    font-size: 16px;
}
.rank-hot {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rank-hot::before {
    content: "🔥";
    font-size: 14px;
}
.rank-progress {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.rank-progress.serial {
    background: #fef3c7;
    color: #d97706;
}
.rank-progress.end {
    background: #e0e7ff;
    color: #4f46e5;
}
.rank-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 8px; /* 新增：给标签和简介留间距 */
}
.comic-tag-item {
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    border-radius: 4px;
}
.rank-tag-item {
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
}
/* 新增：简介样式 - PC端显示，移动端隐藏 */
.rank-intro {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 10px;
    margin-top: 5px;
    display: block; /* PC端默认显示 */
}

/* 空数据提示（复用） */
.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 16px;
}
.empty-tip i {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
    color: #cbd5e1;
}

/* 页脚（复用） */
footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
}
.footer-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.footer-title::after, .footer-title::before {
    content: "";
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e879f9, transparent);
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .rank-desc {
        flex-wrap: wrap;
        gap: 10px;
    }
}
@media (max-width: 768px) {
    /* 移动端隐藏简介 */
    .rank-intro {
        display: none !important;
    }
    .nav-menu {
        gap: 20px;
    }
    .search-box input {
        width: 160px;
    }
    .search-box input:focus {
        width: 180px;
    }
    .rank-tabs {
        padding: 5px 5px;
        gap: 5px;
    }
    .rank-tab-item {
        padding: 8px 15px;
        font-size: 15px;
    }
    .rank-list {
        padding: 20px;
    }
    .rank-num {
        width: 35px;
        height: 35px;
        font-size: 16px;
        margin-right: 15px;
    }
    .rank-cover {
        width: 70px;
        height: 95px;
        margin-right: 15px;
    }
    .rank-title {
        font-size: 16px;
    }
    /* 仅微调移动端友情链接的内边距 */
    .friend-links {
        padding: 15px 15px;
    }
    .friend-links-title {
        font-size: 18px;
    }
    .friend-link-item {
        font-size: 15px;
        padding: 8px 6px;
        min-height: 40px;
    }
}
@media (max-width: 480px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    .logo {
        width: 100%;
        justify-content: center;
    }
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    .search-box {
        width: 100%;
        justify-content: center;
    }
    .search-box input {
        width: 100%;
        max-width: 300px;
    }
    .rank-item {
        flex-wrap: wrap;
        padding: 12px 0;
    }
    .rank-info {
        width: 100%;
        margin-top: 10px;
    }
    .rank-desc {
        margin-bottom: 5px;
    }
    /* 关键：手机端友情链接强制3列 */
    .friend-links-list {
        grid-template-columns: repeat(3, 1fr) !important;
        /* 可选：调整移动端间距，让显示更紧凑 */
        gap: 6px;
    }
    .friend-link-item {
        min-width: unset; /* 取消最小宽度限制，适配3列布局 */
    }
    .footer-title::after, .footer-title::before {
        width: 30px;
    }
}
