/* 时空秘境 - 高级功能样式 */

/* ============== 收藏按钮样式 ============== */
.article-bookmark {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.bookmark-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .bookmark-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.bookmark-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), #00a8d4);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
    border-color: var(--primary-color);
}

.bookmark-btn.bookmarked {
    background: linear-gradient(135deg, #ff6b9d, #c471ed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

.bookmark-btn.bookmarked:hover {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.5);
}

.bookmark-icon-filled {
    display: none;
}

.bookmark-btn.bookmarked .bookmark-icon {
    display: none;
}

.bookmark-btn.bookmarked .bookmark-icon-filled {
    display: block;
}

/* ============== 文章筛选样式 ============== */
.article-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.filter-group label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.filter-group select option {
    background: var(--dark-bg);
    color: var(--text-primary);
}

.filter-reset {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

/* ============== 功能按钮容器 ============== */
.article-function-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .article-function-buttons {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ============== 全屏阅读和打印按钮样式 ============== */
.fullscreen-btn, .print-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    padding: 0.9rem 1.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

[data-theme="light"] .fullscreen-btn,
[data-theme="light"] .print-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fullscreen-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.print-btn:hover {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

.fullscreen-reading {
    background: var(--dark-bg) !important;
}

.fullscreen-reading .navbar,
.fullscreen-reading .footer,
.fullscreen-reading .article-toc,
.fullscreen-reading .related-articles,
.fullscreen-reading .comments-section,
.fullscreen-reading .back-to-top-btn {
    display: none !important;
}

.fullscreen-reading .article-container {
    grid-template-columns: 1fr;
    max-width: 900px;
    padding: 2rem;
}

.fullscreen-reading .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.fullscreen-reading::before {
    content: '';
    position: fixed;
    top: 10px;
    right: 20px;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.fullscreen-reading::before {
    content: '按 ESC 退出全屏';
}

/* ============== 页面加载动画 ============== */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

#page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-container {
    text-align: center;
    color: var(--text-primary);
}

.loader-logo {
    margin-bottom: 2rem;
}

.logo-cube {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    transform-style: preserve-3d;
    animation: rotateCube 3s linear infinite;
}

.logo-cube .cube-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

.logo-cube .front { transform: translateZ(40px); }
.logo-cube .back { transform: translateZ(-40px) rotateY(180deg); }
.logo-cube .right { transform: rotateY(90deg) translateZ(40px); }
.logo-cube .left { transform: rotateY(-90deg) translateZ(40px); }
.logo-cube .top { transform: rotateX(90deg) translateZ(40px); }
.logo-cube .bottom { transform: rotateX(-90deg) translateZ(40px); }

.loader-text {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ============== 网站统计模态框 ============== */
.site-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.stats-content {
    background: var(--darker-bg);
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.stats-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stats-header button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.stats-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
}

/* ============== 音乐播放器 ============== */
.music-player {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.music-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.music-toggle {
    background: var(--gradient-accent);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.music-icon-pause {
    display: none;
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.music-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.music-visualizer {
    display: flex;
    gap: 2px;
    align-items: end;
    height: 20px;
}

.music-visualizer .bar {
    width: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.music-visualizer.active .bar {
    animation: musicBars 1.5s ease-in-out infinite;
}

.music-visualizer.active .bar:nth-child(1) { animation-delay: 0s; }
.music-visualizer.active .bar:nth-child(2) { animation-delay: 0.2s; }
.music-visualizer.active .bar:nth-child(3) { animation-delay: 0.4s; }
.music-visualizer.active .bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes musicBars {
    0%, 100% { height: 4px; opacity: 0.3; }
    50% { height: 16px; opacity: 1; }
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

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

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* ============== 响应式设计 ============== */
@media (max-width: 768px) {
    .article-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-group select {
        min-width: auto;
    }
    
    .music-player {
        bottom: 6rem;
        left: 1rem;
        right: 1rem;
        width: auto;
        border-radius: 15px;
        padding: 1rem;
    }
    
    .music-info {
        flex: 1;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .stats-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    /* 功能按钮响应式 */
    .article-function-buttons {
        padding: 1rem;
        margin: 1.5rem 0;
        gap: 0.8rem;
    }
    
    .fullscreen-btn, .print-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
        min-width: 120px;
    }
    
    .bookmark-btn {
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
    }
    
    .article-share {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .article-share > span {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .loader-text {
        font-size: 1.5rem;
    }
    
    .logo-cube {
        width: 60px;
        height: 60px;
    }
    
    .logo-cube .cube-face {
        width: 60px;
        height: 60px;
    }
    
    .music-player {
        padding: 0.8rem;
    }
    
    .music-title {
        font-size: 0.8rem;
    }
    
    .volume-slider {
        width: 50px;
    }
}

/* ============== 动画定义 ============== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}