/* 全局样式重置与基础配置（和主页面统一） */
* {margin: 0; padding: 0; box-sizing: border-box;}
:root {
    /* 数理化主题色 */
    --math-blue: #165DFF;
    --physics-green: #00B42A;
    --chem-orange: #FF7D00;
    --dark-bg: #0F172A;
    --light-bg: #1E293B;
    --text-white: #F8FAFC;
    --text-gray: #94A3B8;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* 页面背景（移除图片，仅保留渐变背景） */
body { 
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif; 
    min-height: 100vh;
    margin: 0;
    padding: 50px 20px;
    /* 移除背景图片，仅保留渐变叠加层作为背景 */
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    /* 背景适配属性保留（无图片时不影响） */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-white);
    position: relative;
    overflow-x: hidden;
}
/* 粒子背景效果（保留，提升视觉层次） */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(22, 93, 255, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(0, 180, 42, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 40% 40%, rgba(255, 125, 0, 0.1) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* 返回按钮样式 */
.back { 
    margin-bottom: 30px; 
}
.back a {
    color: var(--math-blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.back a:hover {
    color: var(--physics-green);
    text-shadow: 0 0 10px rgba(0, 180, 42, 0.3);
    transform: translateX(-3px);
}

/* 标题样式 */
h1 {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--math-blue), var(--physics-green), var(--chem-orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(22, 93, 255, 0.2);
}
h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: var(--text-white);
    position: relative;
    padding-bottom: 10px;
}
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--math-blue), var(--physics-green));
    border-radius: 3px;
}
h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--text-gray);
}

/* 科目选择按钮样式 */
.subject-nav {
    display: flex;
    gap: 15px;
    margin: 20px 0 30px;
    flex-wrap: wrap;
}
.subject-btn {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    color: var(--text-white);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
/* 不同科目按钮的主题色 */
.subject-btn[onclick*="math"] { border-left: 3px solid var(--math-blue); }
.subject-btn[onclick*="physics"] { border-left: 3px solid var(--physics-green); }
.subject-btn[onclick*="chemistry"] { border-left: 3px solid var(--chem-orange); }

.subject-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}
.subject-btn.active {
    background: linear-gradient(135deg, var(--math-blue) 0%, #0F4CD8 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(22, 93, 255, 0.3);
}

/* 文件列表样式 */
.file-item { 
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    border-left: 4px solid var(--math-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.file-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}
/* 不同科目文件项的左侧边框色 */
#math .file-item { border-left-color: var(--math-blue); }
#physics .file-item { border-left-color: var(--physics-green); }
#chemistry .file-item { border-left-color: var(--chem-orange); }

.preview-btn {
    background: rgba(22, 93, 255, 0.7);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 8px;
    margin-right: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.preview-btn:hover {
    background: var(--math-blue);
    box-shadow: 0 0 15px rgba(22, 93, 255, 0.3);
    transform: translateY(-2px);
}

.download-dropdown {
    position: relative;
    display: inline-block;
}
.download-main-btn {
    background: rgba(0, 180, 42, 0.7);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.download-main-btn:hover {
    background: var(--physics-green);
    box-shadow: 0 0 15px rgba(0, 180, 42, 0.3);
    transform: translateY(-2px);
}
.download-options {
    display: none;
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    min-width: 140px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 999;
    top: 100%;
    left: 0;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.download-options a {
    color: var(--text-white);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}
.download-options a:hover {
    background: var(--hover-bg);
    color: var(--math-blue);
    padding-left: 20px;
}
.download-options.active {
    display: block;
}
.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.file-info {
    display: flex;
    flex-direction: column;
}
.file-available {
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 6px;
}

/* 科目内容区域 */
.subject-content {
    display: none;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}
.subject-content.active {
    display: block;
}

/* 说明文本样式 */
p[style*="margin-top: 30px"] {
    margin-top: 40px !important;
    color: var(--text-gray) !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}
code {
    background: var(--dark-bg) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    color: var(--chem-orange) !important;
    font-size: 13px !important;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 响应式适配 */
@media (max-width: 768px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.5em; }
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .button-group {
        width: 100%;
        justify-content: flex-start;
    }
    .subject-nav {
        gap: 10px;
    }
    .subject-btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
}
