:root {
    --primary-red: #ff4757;
    --gold: #ffa502;
    --bg-black: #050505;
    --sidebar-bg: #0f0f0f;
    --card-bg: #181818;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-line: rgba(255, 255, 255, 0.08);
    --data-muted: #555555;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-black);
    color: var(--text-main);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}
a {
    text-decoration: none;
}
form {
    width: 100%;
}
/* --- Sidebar --- */
aside {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-line);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-section {
    padding: 40px 25px;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
}

.brand-section::after {
    content: "官"; font-size: 10px; -webkit-text-fill-color: var(--primary-red);
    border: 1px solid var(--primary-red); margin-left: 8px; padding: 1px 4px; border-radius: 2px;
}

.nav-scroll-area { flex: 1; overflow-y: auto; }
.nav-scroll-area::-webkit-scrollbar { width: 3px; }
.nav-scroll-area::-webkit-scrollbar-thumb { background: #333; }

.nav-group { margin-bottom: 30px; }
.group-title { padding: 0 25px; margin-bottom: 12px; font-size: 11px; color: #444; font-weight: bold; letter-spacing: 2px; }

.nav-item {
    padding: 12px 25px; display: flex; align-items: center; color: var(--text-muted);
    text-decoration: none; font-size: 0.95rem; transition: 0.3s; border-right: 3px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active {
    color: #fff; background: linear-gradient(90deg, rgba(255, 71, 87, 0.1), transparent);
    border-right: 3px solid var(--primary-red); font-weight: bold;
}

.sidebar-footer { 
    padding: 25px; 
    border-top: 1px solid var(--border-line); 
    background: rgba(0,0,0,0.2); 
}
.status-bar { 
    font-size: 11px; 
    color: var(--text-muted); 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
}
.status-bar span { color: #ccc; }

.copyright { 
    font-size: 9px; 
    color: #444; 
    margin-top: 15px; 
    text-align: center; 
    line-height: 1.5;
}

/* --- Main Content --- */
main { margin-left: 240px; flex: 1; min-width: 0; }

header {
    position: sticky; top: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    padding: 15px 40px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; border-bottom: 1px solid var(--border-line); z-index: 900; gap: 15px;
}

.menu-btn {
    display: none; background: transparent; border: none; color: #fff;
    font-size: 24px; cursor: pointer;
}

.search-box {
    background: #151515; border: 1px solid #222; border-radius: 4px;
    padding: 8px 15px; width: 350px; display: flex; align-items: center;
}
.search-box input { background: transparent; border: none; color: #fff; margin-left: 10px; width: 100%; outline: none; font-size: 14px; }

.top-tools { display: flex; gap: 15px; align-items: center; position: relative; }

.overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    z-index: 1500; display: none;
}

.notice-bar {
    margin: 0 40px 20px; padding: 12px 20px;
    background: rgba(255, 165, 2, 0.05);
    border: 1px dashed rgba(255, 165, 2, 0.3);
    border-radius: 4px; display: flex; align-items: center; gap: 12px;
}
.notice-icon { background: var(--gold); color: #000; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 2px; }
.notice-text { font-size: 12px; color: #ccc; flex: 1; }
.notice-text em { color: var(--primary-red); font-style: normal; font-weight: bold; }

.category-scroll { padding: 20px 40px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.tag { padding: 6px 16px; background: var(--card-bg); border: 1px solid var(--border-line); border-radius: 2px; font-size: 13px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.tag.active { border-color: var(--primary-red); color: var(--primary-red); }

/* --- 标题样式补丁 --- */
.section-title {
    margin: 30px 0 15px;
    font-size: 1.1rem;
    color: #fff;
    border-left: 3px solid var(--primary-red);
    padding-left: 12px;
    display: flex;
    align-items: center;
}
.section-title span {
    font-size: 10px;
    color: var(--data-muted);
    text-transform: uppercase;
    margin-left: 10px;
    letter-spacing: 1px;
}

.main-container { padding: 0 40px 40px; }
.grid-wrapper { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px;
    margin-bottom: 40px;
}

.item-card { background: var(--card-bg); border: 1px solid var(--border-line); border-radius: 4px; overflow: hidden; transition: 0.4s; cursor: pointer; }

/* 双图封面结构 */
.dual-cover { 
    width: 100%; 
    aspect-ratio: 16/9; 
    display: flex; 
    gap: 2px; 
    background: #000;
}
.dual-cover img { 
    width: 50%; 
    height: 100%; 
    object-fit: cover; 
    transition: 0.3s;
}
.item-card:hover img { opacity: 0.8; }

.card-body { padding: 15px; }
.card-body h3 { font-size: 14px; color: #fff; margin-bottom: 8px; line-height: 1.4; }
.card-meta { font-size: 11px; color: var(--data-muted); }

/* --- 响应式适配 --- */
@media (max-width: 768px) {
    aside { transform: translateX(-100%); width: 260px; }
    aside.active { transform: translateX(0); }
    main { margin-left: 0; }
    header { padding: 15px 20px !important;}
    .menu-btn { display: block; }
    .search-box { width: 100%; order: 3; margin-top: 5px; } 
    .top-tools { flex: 1; justify-content: flex-end; order: 2; }
    .notice-bar, .category-scroll, .main-container { padding-left: 15px; padding-right: 15px; margin-left: 0; margin-right: 0; }
    
    .grid-wrapper { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .dual-cover { aspect-ratio: 2/1; }
}




/* --- 极简图标分页 UI --- */
.pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* 电脑端间距 */
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; /* 统一成正方形 */
    height: 40px;
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-line) !important;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

/* 鼠标悬停：强力高亮 */
.pagination a:hover {
    background-color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.pagination .active {
    background-color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
    color: var(--text-main) !important;
}

/* 图标大小控制 */
.pagination svg {
    width: 18px;
    height: 18px;
    fill: currentColor; /* 自动继承文字颜色 */
}

/* --- 移动端专项优化 --- */
@media (max-width: 768px) {
    .pagination {
        gap: 5px; /* 手机端间距变小，更紧凑 */
    }
    .pagination a, .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* --- Main Content --- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0; margin-bottom: 20px; }

.grid-wrapper { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; margin-bottom: 40px; }
.item-card { background: var(--card-bg); border: 1px solid var(--border-line); border-radius: 4px; overflow: hidden; transition: 0.4s; cursor: pointer; }
.item-card:hover { transform: translateY(-5px); border-color: #444; }
.dual-cover { width: 100%; aspect-ratio: 16/9; display: flex; gap: 2px; background: #000; position: relative; }
.dual-cover img { width: 50%; height: 100%; object-fit: cover; }
.gif-badge { position: absolute; top: 10px; right: 10px; background: var(--primary-red); color: #fff; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 2px; z-index: 5; }

.card-body { padding: 15px; }
.card-body h3 { font-size: 14px; color: #fff; margin-bottom: 8px; line-height: 1.4; }
.card-meta { font-size: 11px; color: var(--data-muted); }

/* Ranking Section */
.rank-section { margin: 40px; padding-top: 40px; border-top: 1px solid var(--border-line); display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 50px; }
.rank-box-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; border-bottom: 2px solid var(--border-line); padding-bottom: 10px; }
.rank-box-header h3 { font-size: 16px; color: #fff; }
.rank-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.03); text-decoration: none; }
.rank-index { width: 24px; font-size: 14px; font-weight: 900; color: #333; margin-right: 15px; font-style: italic; }
.rank-item:nth-child(1) .rank-index { color: var(--primary-red); }
.rank-item:nth-child(2) .rank-index { color: var(--gold); }
.rank-item:nth-child(3) .rank-index { color: #bdc3c7; }
.rank-title-text { flex: 1; font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item:hover .rank-title-text { color: #fff; }
.rank-data { font-size: 11px; color: #444; margin-left: 15px; }

.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1500; display: none; }

@media (max-width: 768px) {
    aside { transform: translateX(-100%); }
    aside.active { transform: translateX(0); }
    main { margin-left: 0; }
    header { padding: 15px 20px; }
    .menu-btn { display: block; }
    .search-box { width: 100%; order: 3; }
    .notice-bar, .category-scroll, .main-container, .rank-section { padding-left: 15px; padding-right: 15px; margin-left: 0; margin-right: 0; }
    .grid-wrapper { grid-template-columns: 1fr; }
}

/* --- 友情链接专用网格 (修正边距对齐版) --- */
.friend-links-grid {
    padding: 20px 40px;
    display: grid;
    /* 依然是一行 10 个 */
    grid-template-columns: repeat(11, 1fr); 
    gap: 10px;
    /* 关键：让整个网格在页面中间，如果宽度不够撑满全屏，它会缩在中间 */
    justify-content: start; 
}

.friend-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    /* --- 修改这里：限制最大宽度 --- */
    max-width: 110px; 
    width: 100%;
    /* -------------------------- */
    background: var(--card-bg);
    border: 1px solid var(--border-line);
    border-radius: 2px;
    font-size: 12px;
    color: var(--text-muted);
    transition: 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.friend-tag:hover, .friend-tag.active {
    border-color: var(--primary-red);
    color: var(--primary-red);
    background: rgba(255, 71, 87, 0.05);
}

/* --- 移动端适配 (同步修正) --- */
@media (max-width: 768px) {
    .friend-links-grid {
        /* 手机端同步缩减为 15px，确保和整体页面一致 */
        padding: 15px; 
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .friend-tag {
        height: 36px;
        font-size: 11px;
    }
}


input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-transition-delay: 99999s;
    -webkit-transition: background-color 99999s ease-out;
    -webkit-text-fill-color: #fff !important; /* 文字强制为白色 */
}


.img-wrapper {
    position: relative;
    width: 100%;
    /* min-height: 450px; */
    background-color: #050505;
    margin-bottom: 20px;
    border: 1px solid #1a1a1a;
    overflow: hidden;
}

/* 只有当 JS 加上 .is-loading 时，才显示红色波动 */
.img-wrapper.is-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 71, 87, 0.2), 
        transparent
    );
    animation: shimmer-effect 1.5s infinite linear;
}

@keyframes shimmer-effect {
    100% { left: 100%; }
}

/* 图片显现动画 */
.lazy-load {
    width: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy-load.is-loaded {
    opacity: 1;
}






/* --- 懒加载 & 视口加载优化 --- */

/* --- 懒加载 & 波动效果终极补丁 --- */

.dual-cover {
    position: relative;
    width: 100%;
    /* 1. 解决一刷新全加载：强制容器在没图时也有高度 */
    aspect-ratio: 16 / 9; 
    background-color: #0c0c0c;
    overflow: hidden;
    display: flex;
    gap: 1px;
}

/* 2. 微红波动：增加 :not(.all-loaded) 限制 */
/* 只有当容器带有 is-loading 且里面的图片还没加载完时才显示 */
.dual-cover.is-loading:not(.all-loaded)::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 71, 87, 0.25), 
        transparent
    );
    animation: shimmer-red 1.5s infinite linear;
    z-index: 5;
}

@keyframes shimmer-red {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 3. 图片状态 */
.lazy-load {
    flex: 1;
    width: 50%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* 加载成功后显示 */
.lazy-load.is-loaded {
    opacity: 1;
}