/* 主题变量 */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #0d6efd;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
}

[data-bs-theme="dark"] {
    --bg-primary: #212529;
    --bg-secondary: #343a40;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --accent-color: #3d8bfd;
    --card-bg: #2c3035;
    --border-color: #495057;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--bg-secondary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

.navbar-brand img {
    height: 50px;
    border-radius: 8px;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
}

/* 主题切换按钮 */
.theme-toggle {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
}

/* 英雄区域 - 图片轮播背景 */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1a1a1a;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 80px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-banner {
    max-width: 400px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(3px 3px 10px rgba(0, 0, 0, .8));
}

.hero-title {
    font-size: 5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, .8);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: #f0f0f0;
    margin-bottom: 40px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, .7);
}

/* 新闻区域 */
.news-section {
    padding: 80px 0;
    background-color: var(--bg-secondary);
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-primary);
}

.news-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.news-carousel {
    position: relative;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 20px 0;
    flex: 1;
}

.news-carousel::-webkit-scrollbar {
    display: none;
}

.news-container {
    display: flex;
    gap: 30px;
    min-width: max-content;
}

/* 新闻卡片样式 */
.news-card {
    width: 300px;
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent-color), var(--bg-primary));
}

.news-content {
    padding: 20px;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.news-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.news-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 导航按钮样式 */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.carousel-nav:hover {
    background-color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav.prev {
    left: -70px;
}

.carousel-nav.next {
    right: -70px;
}

.carousel-nav i {
    font-size: 1.5rem;
}

/* 关卡列表 */
.levels-section {
    padding: 80px 0;
    background-color: var(--bg-primary);
    position: relative;
}

.level-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.level-carousel {
    position: relative;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 20px 0;
    flex: 1;
}

.level-carousel::-webkit-scrollbar {
    display: none;
}

.level-container {
    display: flex;
    gap: 30px;
    min-width: max-content;
}

.level-card {
    width: 300px;
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.level-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.level-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent-color), var(--bg-primary));
}

.level-info {
    padding: 20px;
}

.level-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.level-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.level-song {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 右下角悬浮按钮 */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.floating-btn:active {
    transform: translateY(0);
}

.floating-btn #currentLang {
    font-size: 0.8rem;
    font-weight: bold;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* 页脚 */
.footer {
    background-color: var(--bg-secondary);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h5 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    line-height: 2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* 移动端隐藏导航按钮 */
    .carousel-nav {
        display: none;
    }

    .news-carousel-wrapper,
    .level-carousel-wrapper {
        padding: 0;
    }
}

/* 模态框样式 */
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.btn-close {
    filter: var(--bs-btn-close-white-filter);
}

/* 关卡详情模态框样式 */
.level-detail {
    padding: 20px;
}

.level-detail-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.level-detail-content {
    padding: 10px;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    min-width: 120px;
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-row span {
    color: var(--text-primary);
    flex: 1;
}

/* 关卡详情链接按钮样式 */
.detail-links {
    margin-top: 20px;
    padding-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-bilibili {
    background-color: #fb7299;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-bilibili:hover {
    background-color: #ff8eb3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
}

.btn-bilibili:active {
    transform: translateY(0);
}

.btn-netease {
    background-color: #ec4e3e;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-netease:hover {
    background-color: #ff6b5a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 78, 62, 0.4);
}

.btn-netease:active {
    transform: translateY(0);
}

/* 新闻详情链接按钮样式 */
.news-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.news-links .btn {
    transition: all 0.3s ease;
}

.news-links .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
}

.difficulty-1 {
    background-color: #28a745;
    /* 简单 - 绿色 */
}

.difficulty-2 {
    background-color: #17a2b8;
    /* 中等 - 蓝色 */
}

.difficulty-3 {
    background-color: #ffc107;
    /* 困难 - 黄色 */
    color: #333;
}

.difficulty-4 {
    background-color: #fd7e14;
    /* 专家 - 橙色 */
}

.difficulty-5 {
    background-color: #dc3545;
    /* 地狱 - 红色 */
}

.detail-description {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-primary);
    border-radius: 10px;
}

.detail-description strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-description p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* 音乐播放器控件 */
#musicToggle.playing {
    animation: music-pulse 2s infinite;
}

@keyframes music-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

#musicIcon.rotating {
    animation: music-rotate 3s linear infinite;
}

@keyframes music-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 音乐控制面板 */
.music-control-panel {
    position: fixed;
    bottom: 80px;
    right: 30px;
    background-color: var(--bg-secondary);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    animation: panel-fade-in 0.3s ease;
}

.music-control-panel.show {
    display: block;
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.volume-slider-container {
    width: 150px;
    margin-bottom: 10px;
}

.volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.music-controls {
    display: flex;
    justify-content: center;
}

.music-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.music-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.music-control-btn:active {
    transform: scale(0.95);
}