/* 基础样式 - 日间模式 */
:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #34495e;
    --title-color: #2c3e50;
    --category-color: #e74c3c;
    --border-color: #3498db;
    --shadow-color: rgba(0,0,0,0.1);
    --switch-bg: #e0e0e0;
    --switch-btn: #ffffff;
    --hot-hero-border: #ff7f50;
    --hot-hero-hover: #faf0e6;

    /* ✅ 修复：补充缺失的头部/尾部变量 */
    --header-logo-bg-gradient: linear-gradient(45deg, #f0f7ff, #e8f4ff);
    --header-logo-border: #3498db;
    --footer-bg: #ffffff;
    --footer-border: #e0e0e0;
    --footer-text: #666666;
}

/* 夜间模式变量 */
.dark-mode {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e9e9f0;
    --title-color: #ffffff;
    --category-color: #ff6b6b;
    --border-color: #4cc9f0;
    --shadow-color: rgba(0,0,0,0.3);
    --switch-bg: #4cc9f0;
    --switch-btn: #16213e;
    --hot-hero-border: #ff9a76;
    --hot-hero-hover: #2a2a40;

    /* ✅ 修复：补充夜间模式头部/尾部变量 */
    --header-logo-bg-gradient: linear-gradient(45deg, #1f2f44, #16213e);
    --header-logo-border: #4cc9f0;
    --footer-bg: #16213e;
    --footer-border: #2a2a40;
    --footer-text: #b0b0c0;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: "Microsoft Yahei", sans-serif;
    color: var(--text-color);
    transition: all 0.3s ease;
    scroll-behavior: smooth;
    min-height: 100vh;
    /* ✅ 优化：适配固定头部，避免内容被遮挡 */
    padding-top: 60px;
}

.main-container {
    max-width: 1200px;
    margin: 4.375rem auto;
    padding: 0 20px;
    width: 100%;
    /* ✅ 修复：删除冗余 !important */
}

.hero-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.theme-switch-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-right: 5px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--switch-btn);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.switch-label {
    margin-right: 10px;
    line-height: 30px;
    color: var(--text-color);
}

/* 二级筛选样式 */
.hero-select-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    padding: 0 15px;
    width: 100%;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-select {
    max-width: 200px;
    width: 100%;
    min-width: 150px;
}

/* 热门英雄展示样式 */
.hot-heroes-title {
    color: var(--category-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-heroes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    justify-items: center;
    padding: 10px 0;
 
}

.hot-hero-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    max-width: 120px;
    text-decoration: none;
    color: inherit;
	
}

.hot-hero-item:hover {
    background-color: var(--hot-hero-hover);
}

.hot-hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hot-hero-border);
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.hot-hero-item:hover .hot-hero-avatar {
    transform: scale(1.05);
}

.hot-hero-name {
    color: var(--text-color);
    font-size: 0.7rem;
    text-align: center;
    /* white-space: nowrap; */
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}




/* 表尾巴样式结束 */

/* 响应式适配 */
@media (max-width: 768px) {
    .hero-select {
        min-width: 120px;
    }
    .hot-heroes-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
		
    }
    .hot-hero-avatar {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.2rem;
    }
    .hero-card {
        padding: 15px;
    }
    .theme-switch {
        width: 50px;
        height: 26px;
    }
    .slider:before {
        height: 18px;
        width: 18px;
    }
    input:checked + .slider:before {
        transform: translateX(24px);
    }
    .hero-select-container {
        flex-direction: column;
        align-items: center;
    }
    .hero-select {
        max-width: 100%;
        width: 80%;
    }
    .hot-heroes-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .hot-hero-avatar {
        width: 40px;
        height: 40px;
    }
    .hot-hero-name {
        font-size: 0.5rem;
    }
    /* ✅ 修复：移动端footer字体优化，保证可读性 */
    .footer{
       font-size: 0.35rem;
    }

}

  /* ========== 优化新增样式 ========== */
        .section-toggle {
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            user-select: none;
        }
        .section-content.collapsed {
            display: none;
        }
        .hero-search-container {
            position: relative;
        }
        .search-clear-btn {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            opacity: 0.5;
            font-size: 16px;
        }
        .search-clear-btn:hover {
            opacity: 1;
        }
        .empty-tip {
            padding: 24px;
            text-align: center;
            opacity: 0.5;
            font-size: 14px;
        }