* {
    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);
}

.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;
}

/* 快速链接 */
.quick-links {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.quick-links h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: block;
    background-color: #3498db;
    color: white;
    padding: 1rem;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s;
    font-weight: 600;
}

.quick-link:hover {
    background-color: #2980b9;
}

/* 课程概览 */
.course-overview {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.course-overview h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.overview-item {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.overview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.overview-item h4 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.overview-item p {
    color: #555;
    margin-bottom: 1rem;
}

.course-count {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 课程页面样式 */
.course-page {
    max-width: 1000px;
    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);
}

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

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

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

.course-topics h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.topic-list {
    list-style: none;
}

.topic-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.topic-item h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.topic-item p {
    color: #555;
    line-height: 1.8;
}

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

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

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

.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;
}

.calculator-panel h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.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;
    }

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

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

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

    .calc-btn {
        width: 100%;
    }
}

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

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

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

    .quick-links,
    .course-overview {
        padding: 1.5rem;
    }
}
