:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
}

.nav-brand .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: 0.3s;
}

/* 主要内容 */
main {
    margin-top: 60px;
}

section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

/* Hero区域 */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    max-width: 100%;
    padding: 4rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content .subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.hero-content .description {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}

.hero-visual {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

#heroChart {
    width: 100%;
    height: 400px;
}

/* 核心概念 */
.concepts {
    background: var(--bg-color);
}

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

.concept-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.concept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.concept-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color), #667eea);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.concept-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.concept-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.learn-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

/* 理论课程 */
.theory {
    background: white;
}

.course-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.course-list {
    display: grid;
    gap: 1rem;
}

.course-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
}

.course-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.course-item .lesson-num {
    background: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.course-item .lesson-info {
    flex: 1;
    margin-left: 1rem;
}

.course-item .lesson-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.course-item .lesson-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.course-item .lesson-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-basic { background: #d4edda; color: #155724; }
.tag-intermediate { background: #fff3cd; color: #856404; }
.tag-advanced { background: #f8d7da; color: #721c24; }

/* 分析工具 */
.tools {
    background: var(--bg-color);
}

.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.tool-panel {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.tool-panel.full-width {
    grid-column: 1 / -1;
}

.tool-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.demo-chart {
    background: #f8f9fa;
    border-radius: 8px;
    height: 300px;
    margin-bottom: 1rem;
    position: relative;
}

.demo-chart canvas {
    width: 100%;
    height: 100%;
}

.tool-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-controls button {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-controls button:hover {
    background: #2980b9;
}

/* 背驰分析器 */
.beichi-analyzer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.input-section h4,
.result-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.data-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group textarea {
    width: 100%;
    height: 100px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    resize: vertical;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

#analyzeBeichi {
    width: 100%;
    padding: 1rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#analyzeBeichi:hover {
    background: #229954;
}

.result-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.result-content {
    min-height: 200px;
}

.result-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
}

.result-item.beichi-yes {
    border-left-color: var(--success-color);
}

.result-item.beichi-no {
    border-left-color: var(--secondary-color);
}

/* 实战图解 */
.examples {
    background: white;
}

.example-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.example-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: var(--bg-color);
    border-radius: 16px;
    padding: 2rem;
}

.example-item.reverse {
    direction: rtl;
}

.example-item.reverse > * {
    direction: ltr;
}

.example-chart {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.example-chart canvas {
    width: 100%;
    height: 300px;
}

.example-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.example-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

/* 页脚 */
footer {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

.footer-content p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 2rem;
        text-align: center;
    }

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

    .hero-buttons {
        justify-content: center;
    }

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

    .tools-container {
        grid-template-columns: 1fr;
    }

    .beichi-analyzer {
        grid-template-columns: 1fr;
    }

    .example-item,
    .example-item.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }

    section {
        padding: 2rem 1rem;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.concept-card,
.tool-panel,
.course-item {
    animation: fadeIn 0.5s ease-out;
}
