* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
}

/* 主容器 */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    background-color: #34495e;
    border-bottom: 2px solid #3498db;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: #3498db;
    text-align: center;
}

/* 树形导航 */
.tree-nav {
    padding: 1rem 0;
}

.tree-root {
    list-style: none;
}

.tree-item {
    margin: 0.2rem 0;
}

.tree-label {
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    background-color: #34495e;
    border-radius: 4px;
    margin: 0.3rem 0.5rem;
    transition: background-color 0.3s;
}

.tree-label:hover {
    background-color: #455d75;
}

.tree-toggle {
    margin-right: 0.5rem;
    transition: transform 0.3s;
    display: inline-block;
    width: 12px;
    text-align: center;
}

.tree-label.expanded .tree-toggle {
    transform: rotate(90deg);
}

.tree-title {
    font-weight: 600;
    font-size: 1rem;
}

.tree-children {
    list-style: none;
    padding-left: 1rem;
    display: none;
    background-color: #2c3e50;
}

.tree-children.expanded {
    display: block;
}

.tree-link {
    display: block;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 4px;
    margin: 0.1rem 0.5rem;
}

.tree-link:hover {
    background-color: #34495e;
    color: #3498db;
}

.tree-link.active {
    background-color: #3498db;
    color: white;
}

/* 右侧主内容区域 */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background-color: #f4f7f6;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

/* 章节标题 */
.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* 核心板块卡片 */
.core-sections {
    margin-bottom: 2rem;
}

.core-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.core-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    border-top: 4px solid;
}

.core-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.micro-card {
    border-color: #3498db;
}

.macro-card {
    border-color: #e74c3c;
}

.meso-card {
    border-color: #27ae60;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.core-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.card-desc {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.card-topics {
    list-style: none;
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.card-topics li {
    padding: 0.5rem 0;
    color: #555;
    font-size: 0.9rem;
    border-bottom: 1px dashed #ddd;
}

.card-topics li:last-child {
    border-bottom: none;
}

.card-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 快速入口 */
.quick-section {
    margin-bottom: 2rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.quick-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.quick-icon {
    font-size: 2.5rem;
}

.quick-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}

/* 学习路径时间线 */
.path-section {
    margin-bottom: 2rem;
}

.path-timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem 0;
}

.path-timeline::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 3px;
}

.path-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    flex-shrink: 0;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.step-content {
    flex: 1;
    margin-left: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.step-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.step-content p {
    color: #555;
    font-size: 0.95rem;
}

/* 课程页面样式 */
.course-page {
    max-width: 1200px;
    margin: 0 auto;
}

.course-header {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-left: 5px solid;
}

.course-header.micro { border-color: #3498db; }
.course-header.macro { border-color: #e74c3c; }
.course-header.meso { border-color: #27ae60; }

.course-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.course-header p {
    color: #555;
    font-size: 1.1rem;
}

/* 内容模块 */
.content-module {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.content-module h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.content-module h3 {
    color: #34495e;
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

/* 流程图样式 */
.flowchart {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.flowchart-node {
    display: inline-block;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    margin: 0.5rem;
    text-align: center;
    min-width: 150px;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.flowchart-node.decision {
    background: #fff3cd;
    border-color: #ffc107;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.flowchart-node.start {
    background: #d4edda;
    border-color: #28a745;
    border-radius: 25px;
}

.flowchart-node.end {
    background: #f8d7da;
    border-color: #dc3545;
    border-radius: 25px;
}

.flowchart-arrow {
    display: block;
    text-align: center;
    color: #3498db;
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.flowchart-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

/* 时序图样式 */
.sequence-chart {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.sequence-timeline {
    display: flex;
    position: relative;
    min-width: 600px;
}

.sequence-point {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 0.5rem;
}

.sequence-point::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 15px;
    height: 15px;
    background: #3498db;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.sequence-line {
    position: absolute;
    top: 27px;
    left: 0;
    right: 0;
    height: 3px;
    background: #3498db;
    z-index: 0;
}

.sequence-label {
    margin-top: 40px;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sequence-title {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0.3rem;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table.highlight-first td:first-child {
    font-weight: 600;
    color: #3498db;
}

/* 交互式图表容器 */
.interactive-chart {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 0.6rem 1.2rem;
    background: #ecf0f1;
    border: 2px solid #3498db;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    color: #2c3e50;
}

.chart-btn:hover,
.chart-btn.active {
    background: #3498db;
    color: white;
}

.chart-display {
    min-height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

/* 简易坐标图 */
.coordinate-chart {
    width: 100%;
    height: 300px;
    position: relative;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.chart-axis {
    position: absolute;
    background: #333;
}

.chart-axis-x {
    bottom: 40px;
    left: 40px;
    right: 20px;
    height: 2px;
}

.chart-axis-y {
    bottom: 40px;
    left: 40px;
    width: 2px;
    top: 20px;
}

.chart-label {
    position: absolute;
    font-size: 0.8rem;
    color: #555;
}

.chart-line {
    position: absolute;
    height: 3px;
    background: #e74c3c;
    transform-origin: left bottom;
}

/* 对比卡片 */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.comparison-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid;
}

.comparison-card.pro {
    border-color: #27ae60;
}

.comparison-card.con {
    border-color: #e74c3c;
}

.comparison-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.comparison-card ul {
    list-style: none;
}

.comparison-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
}

.comparison-card.pro li::before {
    content: '✓';
    color: #27ae60;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.comparison-card.con li::before {
    content: '✗';
    color: #e74c3c;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 知识点卡片 */
.knowledge-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.knowledge-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.knowledge-card p {
    opacity: 0.95;
    line-height: 1.8;
}

/* 公式展示 */
.formula-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-family: 'Courier New', monospace;
    text-align: center;
    font-size: 1.2rem;
    color: #2c3e50;
}

/* 计算器样式 */
.calculator-page {
    max-width: 900px;
    margin: 0 auto;
}

.calculator-option {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.calc-btn {
    background-color: #ecf0f1;
    border: 2px solid #3498db;
    color: #2c3e50;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.calc-btn:hover,
.calc-btn.active {
    background-color: #3498db;
    color: white;
}

.calculator-panel {
    display: none;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.calculator-panel.active {
    display: block;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: bold;
    font-size: 1rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.calculate-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    width: 100%;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background-color: #229954;
}

.result {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #d5f4e6;
    border-radius: 5px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
    line-height: 1.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 300px;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .core-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .path-timeline::before {
        left: 25px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .calculator-option {
        flex-direction: column;
    }

    .calc-btn {
        width: 100%;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .course-header h1 {
        font-size: 1.8rem;
    }

    .flowchart-node {
        min-width: 100px;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* 打印样式 */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .hero,
    .card-btn,
    .chart-controls {
        display: none;
    }
}
