/* ============================================
   物理学科专属样式 - 深蓝色科技主题
   ============================================ */

/* CSS 变量定义 */
:root {
    --primary-dark: #0a1628;
    --secondary-dark: #0d1f35;
    --accent-blue: #1a5fb4;
    --accent-cyan: #00d4ff;
    --accent-purple: #7b68ee;
    --text-primary: #e8f4f8;
    --text-secondary: #a0c4d9;
    --text-muted: #6b8fa8;
    --border-color: #1e3a5f;
    --card-bg: #0f2744;
    --hover-bg: #1a3a5c;
    --formula-bg: #0d1f35;
    --gradient-primary: linear-gradient(135deg, #0a1628 0%, #0d1f35 50%, #1a3a5c 100%);
    --gradient-accent: linear-gradient(135deg, #1a5fb4 0%, #00d4ff 100%);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   导航栏样式
   ============================================ */
.navbar {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 80%;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

/* ============================================
   英雄区样式
   ============================================ */
.hero-section {
    padding: 4rem 2rem;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(26, 95, 180, 0.15) 0%, transparent 70%);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.5rem;
    color: var(--accent-cyan);
    opacity: 0.8;
    letter-spacing: 2px;
}

/* ============================================
   学科介绍区样式
   ============================================ */
.intro-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.intro-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.intro-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.intro-text p {
    margin-bottom: 1rem;
}

/* ============================================
   知识模块卡片样式
   ============================================ */
.modules-section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.module-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.module-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow), var(--shadow-card);
}

.module-card:hover::before {
    transform: scaleX(1);
}

.module-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.module-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.module-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.module-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    background: rgba(26, 95, 180, 0.2);
    color: var(--accent-cyan);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* ============================================
   实验演示区样式
   ============================================ */
.lab-section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.lab-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.lab-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lab-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--accent-cyan);
    position: relative;
    z-index: 1;
}

.lab-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.lab-desc {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.lab-placeholder {
    background: var(--formula-bg);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.lab-placeholder-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.lab-placeholder-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   章节页面布局样式
   ============================================ */
.chapter-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: var(--secondary-dark);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: calc(100vh - 70px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav {
    list-style: none;
    padding: 0 1rem;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--hover-bg);
    color: var(--accent-cyan);
}

.sidebar-nav a.active {
    border-left: 3px solid var(--accent-cyan);
}

.sidebar-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-section-title {
    padding: 0 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

/* 内容区样式 */
.content-area {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: calc(100% - 280px);
}

.content-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.chapter-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chapter-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.content-body {
    max-width: 900px;
}

.content-section {
    margin-bottom: 3rem;
}

.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-number {
    background: var(--gradient-accent);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ============================================
   物理公式排版样式
   ============================================ */
.formula-block {
    background: var(--formula-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.formula-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-accent);
}

.formula {
    font-family: 'Times New Roman', 'Cambria Math', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.formula-description {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.formula-variables {
    margin-top: 1rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.formula-variables li {
    margin: 0.5rem 0;
    list-style: none;
}

.formula-variables .var {
    color: var(--accent-cyan);
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.inline-formula {
    font-family: 'Times New Roman', 'Cambria Math', serif;
    color: var(--accent-cyan);
    padding: 0 4px;
}

/* ============================================
   页脚样式
   ============================================ */
.footer {
    background: var(--primary-dark);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.beian {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.beian a {
    color: var(--text-muted);
    text-decoration: none;
}

.beian a:hover {
    color: var(--accent-cyan);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-area {
        margin-left: 0;
        max-width: 100%;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .content-area {
        padding: 2rem 1.5rem;
    }

    .chapter-title {
        font-size: 1.8rem;
    }

    .formula {
        font-size: 1.2rem;
    }
}

/* 菜单切换按钮（移动端） */
.menu-toggle {
    display: none;
}

/* ============================================
   特效样式
   ============================================ */
.glow-effect {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(0, 212, 255, 0.6);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
