/* ============ 华为风格 · 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0D2B5C;
    --secondary: #2F6BFF;
    --accent: #F59E0B;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --text: #1A1A1A;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #E5E8EB;
    --success: #00A870;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 4px;
    --transition: all 0.25s ease;
    --max-width: 1400px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
    font-size: 15px;
    padding-bottom: 60px;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ============ 华为风格导航栏 ============ */
.navbar {
    background: var(--white);
    height: 64px;
    box-shadow: 0 1px 0 var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    letter-spacing: 1px;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    gap: 0;
    height: 64px;
}

.nav-menu a {
    color: var(--text);
    font-weight: 400;
    font-size: 15px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
}

.nav-menu a:hover { color: var(--secondary); }

.nav-menu a.active {
    color: var(--secondary);
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: var(--secondary);
}

/* ============ 按钮 ============ */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: white;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

.btn-paid {
    background: var(--accent);
    color: white;
}

.btn-paid:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-large { padding: 14px 36px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* ============ 华为风格 Hero ============ */
.hero {
    background: linear-gradient(135deg, #0D2B5C 0%, #1A4FA0 50%, #2F6BFF 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600'%3E%3Ctext x='50' y='500' font-size='120' fill='rgba(255,255,255,0.04)' font-family='serif'%3EF=ma%3C/text%3E%3Ctext x='700' y='150' font-size='90' fill='rgba(255,255,255,0.04)' font-family='serif'%3EE=mc%3C/text%3E%3Ctext x='300' y='200' font-size='70' fill='rgba(255,255,255,0.03)' font-family='serif'%3E%E2%84%8F%3C/text%3E%3C/svg%3E") no-repeat;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: 44px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.hero h1 .highlight {
    color: var(--accent);
}

.hero p {
    font-size: 18px;
    opacity: 0.85;
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .btn-primary {
    background: var(--accent);
    color: var(--primary);
    font-weight: 600;
}

.hero-cta .btn-primary:hover {
    background: white;
}

.hero-cta .btn-outline {
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.hero-cta .btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
}

/* ============ 通用 Section ============ */
section { padding: 80px 0; }

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 15px;
}

.section-line {
    width: 48px;
    height: 3px;
    background: var(--secondary);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* ============ 数据条 ============ */
.stats-bar {
    background: var(--bg);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item .stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
}

.stat-item .stat-label {
    color: var(--text-light);
    font-size: 15px;
    margin-top: 8px;
}

/* ============ 教学理念卡片 ============ */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.philosophy-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 40px 32px;
    text-align: center;
    transition: var(--transition);
}

.philosophy-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.philosophy-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.philosophy-card h3 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
}

.philosophy-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 14px;
}

/* ============ 课程卡片 ============ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.course-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 32px;
    transition: var(--transition);
    position: relative;
}

.course-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.course-card-featured {
    border: 2px solid var(--accent);
}

.course-tag {
    display: inline-block;
    background: var(--bg);
    color: var(--text-light);
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
    border-radius: 2px;
}

.course-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

.course-card h3 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.course-card > p {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 14px;
    min-height: 42px;
}

.course-features {
    margin-bottom: 20px;
}

.course-features li {
    padding: 4px 0;
    font-size: 14px;
    color: var(--text);
}

.course-features li::before {
    content: '✓ ';
    color: var(--secondary);
    font-weight: 700;
}

.course-price {
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-old {
    color: var(--text-lighter);
    text-decoration: line-through;
    font-size: 15px;
}

.price-new {
    color: var(--secondary);
    font-size: 26px;
    font-weight: 700;
}

/* ============ 评价 ============ */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.testimonial-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 32px;
    transition: var(--transition);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-lg);
}

.testimonial-stars {
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 12px;
}

.testimonial-text {
    color: var(--text);
    line-height: 1.9;
    margin-bottom: 20px;
    font-size: 14px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.author-name { font-weight: 600; color: var(--text); font-size: 14px; }
.author-grade { font-size: 12px; color: var(--text-light); }

/* ============ 底部 CTA ============ */
.final-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 70px 0;
}

.final-cta h2 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 700;
}

.final-cta p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.85;
}

.final-cta .btn {
    background: var(--accent);
    color: var(--primary);
    font-weight: 700;
}

.final-cta .btn:hover {
    background: white;
}

/* ============ 页脚 ============ */
.footer {
    background: #1A1A1A;
    color: rgba(255,255,255,0.7);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 600;
}

.footer-col p, .footer-col a {
    color: rgba(255,255,255,0.6);
    line-height: 2;
    display: block;
    font-size: 14px;
}

.footer-col a:hover { color: var(--secondary); }
.footer-info { margin-top: 8px; }

.qr-placeholder {
    background: white;
    padding: 8px;
    border-radius: 4px;
    display: inline-block;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

/* ============ 浮动按钮 ============ */
.floating-btn {
    position: fixed;
    bottom: 80px;
    right: 30px;
    z-index: 999;
}

.floating-toggle {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.floating-toggle:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.floating-icon { font-size: 18px; }

.floating-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 260px;
    display: none;
    overflow: hidden;
}

.floating-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.floating-header {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floating-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

.floating-body { padding: 20px; }
.floating-body p { margin-bottom: 10px; font-size: 14px; }

/* ============ 知识库页面 ============ */
.kb-page { background: var(--bg); min-height: 100vh; }

.kb-hero {
    background: linear-gradient(135deg, #0D2B5C, #2F6BFF);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.kb-hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.kb-hero p {
    font-size: 16px;
    opacity: 0.85;
}

.kb-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
    padding: 40px 0;
}

.kb-sidebar {
    background: white;
    border: 1px solid var(--border);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.kb-search {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.kb-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.kb-search input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(47,107,255,0.1);
}

.kb-tree { padding: 8px 0; font-size: 14px; }

.kb-tree-stage {
    margin-bottom: 2px;
}

.kb-tree-stage-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.kb-tree-stage-btn:hover { background: var(--bg); color: var(--secondary); }

.kb-tree-stage-btn .arrow {
    transition: var(--transition);
    font-size: 10px;
    color: var(--text-lighter);
}

.kb-tree-stage.collapsed .arrow { transform: rotate(-90deg); }

.kb-tree-stage-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.kb-tree-stage.collapsed .kb-tree-stage-content { max-height: 0; }

.kb-tree-book {
    margin-bottom: 2px;
}

.kb-tree-book-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 8px 16px 8px 32px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    font-size: 13px;
}

.kb-tree-book-btn:hover { background: var(--bg); }
.kb-tree-book-btn .arrow { font-size: 9px; color: var(--text-lighter); transition: var(--transition); }
.kb-tree-book.collapsed .arrow { transform: rotate(-90deg); }

.kb-tree-book-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.kb-tree-book.collapsed .kb-tree-book-content { max-height: 0; }

.kb-tree-chapter {
    padding: 6px 16px 6px 52px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.kb-tree-chapter:hover {
    background: var(--bg);
    color: var(--secondary);
}

.kb-tree-chapter.active {
    background: var(--secondary);
    color: white;
}

.kb-tree-chapter .status {
    font-size: 11px;
    opacity: 0.5;
    display: none;
}

.kb-tree-chapter .status.mastered,
.kb-tree-chapter .status.learning {
    display: inline;
}

.kb-tree-chapter:hover .status {
    display: inline;
}

.kb-content {
    background: white;
    border: 1px solid var(--border);
    padding: 48px;
    min-height: 600px;
}

.kb-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-lighter);
}

.kb-empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }

.kb-breadcrumb {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 16px;
}

.kb-breadcrumb span { margin: 0 4px; }

.kb-article h1 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 700;
}

.kb-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.tag {
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

.tag-basic { background: #E8F5E9; color: #2E7D32; }
.tag-advanced { background: #FFF3E0; color: #E65100; }
.tag-expert { background: #FFEBEE; color: #C62828; }
.tag-stage { background: var(--bg); color: var(--text-light); }
.tag-progress {
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.tag-progress.mastered { background: #E8F5E9; color: #2E7D32; }
.tag-progress.learning { background: #FFF3E0; color: #E65100; }
.tag-progress.todo { background: var(--bg); color: var(--text-lighter); }

.kb-section { margin-bottom: 32px; }

.kb-section h2 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--secondary);
    font-weight: 600;
}

.kb-section p {
    color: var(--text);
    line-height: 2;
    margin-bottom: 10px;
}

.formula {
    background: linear-gradient(135deg, #F0F7FF, #E0F0FF);
    border-left: 3px solid var(--secondary);
    padding: 16px 24px;
    margin: 10px 0;
    text-align: center;
    border-radius: 0 var(--radius) var(--radius) 0;
    overflow-x: auto;
}

.formula .katex-display {
    margin: 0;
}

.formula .katex {
    font-size: 1.1em;
}

.example {
    background: var(--bg);
    padding: 20px;
    margin-bottom: 12px;
    border-radius: var(--radius);
}

.example-title { font-weight: 600; color: var(--secondary); margin-bottom: 8px; font-size: 14px; }
.example-content { margin-bottom: 10px; line-height: 1.8; font-size: 14px; }

.example-solution {
    color: var(--text-light);
    line-height: 1.9;
    padding: 12px;
    background: white;
    border-radius: var(--radius);
    margin-top: 8px;
    display: none;
    font-size: 14px;
}

.example-solution.show { display: block; }

.toggle-solution {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    margin-top: 8px;
}

.warning-box {
    background: #FFF8E1;
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    margin: 12px 0;
    color: #78350f;
    font-size: 14px;
}

.warning-box::before { content: '⚠️ 易错点：'; font-weight: 700; }

/* ============ 考点精析 & 示意图 ============ */
.exam-points {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exam-points li {
    padding: 10px 16px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #EFF6FF, #F5F7FA);
    border-left: 3px solid var(--secondary);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.exam-points li:nth-child(odd) {
    background: linear-gradient(90deg, #FFF7ED, #F5F7FA);
    border-left-color: var(--accent);
}

.diagram-container {
    text-align: center;
    padding: 24px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

/* ============ 资料页 ============ */
.materials-page { padding: 0; }

.materials-header {
    background: linear-gradient(135deg, #0D2B5C, #2F6BFF);
    color: white;
    padding: 50px 0;
    text-align: center;
}

.materials-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.materials-header p { opacity: 0.85; font-size: 15px; }

.materials-body { padding: 40px 0; }

.materials-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 18px;
    background: white;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
}

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

.upload-section {
    background: white;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 30px;
}

.upload-zone {
    border: 2px dashed var(--border);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--secondary);
    background: #F0F7FF;
}

.upload-icon { font-size: 48px; color: var(--text-lighter); margin-bottom: 10px; }
.upload-text { color: var(--text); margin-bottom: 6px; }
.upload-hint { color: var(--text-lighter); font-size: 13px; }

.upload-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
    display: none;
}

.upload-form.show { display: grid; }

.upload-form input, .upload-form select, .upload-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
}

.upload-form input:focus, .upload-form select:focus, .upload-form textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.upload-form textarea {
    grid-column: 1 / -1;
    min-height: 70px;
    resize: vertical;
}

.upload-form-buttons { grid-column: 1 / -1; display: flex; gap: 10px; }

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.material-card {
    background: white;
    border: 1px solid var(--border);
    padding: 20px;
    transition: var(--transition);
    position: relative;
}

.material-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.material-icon { font-size: 32px; margin-bottom: 10px; }
.material-title { font-size: 15px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.material-meta { color: var(--text-lighter); font-size: 12px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.material-meta span { background: var(--bg); padding: 2px 8px; }

.material-locked {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
}

/* ============ 学习资料库（新布局） ============ */

/* 侧边栏树 - 适配 materials.js 的 class 名 */
.kb-tree-stage-title {
    padding: 10px 16px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-size: 14px;
}

.kb-tree-stage-title:hover { background: var(--bg); color: var(--secondary); }
.kb-tree-stage-title.active { color: var(--secondary); }

.kb-tree-book-title {
    padding: 7px 16px 7px 32px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-size: 13px;
}

.kb-tree-book-title:hover { background: var(--bg); }
.kb-tree-book-title.active { color: var(--secondary); }

.kb-tree-arrow {
    font-size: 9px;
    color: var(--text-lighter);
    transition: var(--transition);
    display: inline-block;
    width: 10px;
}

.kb-tree-children {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.kb-tree-stage.collapsed .kb-tree-children,
.kb-tree-book.collapsed .kb-tree-children {
    max-height: 0 !important;
}

/* 上传区域 */
.mat-upload-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.mat-upload-zone {
    border: 2px dashed var(--border);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mat-upload-zone:hover, .mat-upload-zone.dragover {
    border-color: var(--secondary);
    background: #F0F7FF;
}

.mat-upload-icon { font-size: 36px; margin-bottom: 4px; }
.mat-upload-text { color: var(--text); font-weight: 600; font-size: 15px; }
.mat-upload-hint { color: var(--text-lighter); font-size: 13px; }

.mat-upload-form {
    display: none;
    margin-top: 16px;
}

.mat-upload-form.show { display: block; }

.mat-upload-form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.mat-upload-form input,
.mat-upload-form select,
.mat-upload-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.mat-upload-form input:focus,
.mat-upload-form select:focus,
.mat-upload-form textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.mat-upload-form textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

.mat-upload-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

/* 资料列表 */
.mat-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
}

.mat-list-header h3 {
    font-size: 18px;
    color: var(--text);
    font-weight: 600;
}

.mat-count {
    color: var(--text-lighter);
    font-size: 14px;
}

.mat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.mat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    display: flex;
    gap: 14px;
}

.mat-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.mat-card-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 8px;
}

.mat-card-body { flex: 1; min-width: 0; }

.mat-card-title {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.mat-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--text-lighter);
    margin-bottom: 6px;
}

.mat-card-meta span {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.mat-tag {
    font-weight: 600;
    color: white !important;
}

.mat-tag-讲义 { background: #3B82F6 !important; }
.mat-tag-习题 { background: #10B981 !important; }
.mat-tag-实验 { background: #8B5CF6 !important; }
.mat-tag-视频 { background: #EF4444 !important; }
.mat-tag-其他, .mat-tag-other { background: #6B7280 !important; }

.mat-card-desc {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.mat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mat-dl-count {
    color: var(--text-lighter);
    font-size: 13px;
}

.mat-dl-btn {
    padding: 6px 16px !important;
    font-size: 13px !important;
}

.mat-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-lighter);
}

.mat-empty-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.3; }
.mat-empty h3 { font-size: 18px; color: var(--text-light); margin-bottom: 6px; }
.mat-empty p { font-size: 14px; }

/* ============ 课程页 ============ */
.courses-page { padding: 0; }

.courses-header {
    background: linear-gradient(135deg, #0D2B5C, #2F6BFF);
    color: white;
    padding: 50px 0;
    text-align: center;
}

.courses-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.courses-header p { opacity: 0.85; font-size: 15px; }

.courses-body { padding: 40px 0; }

.courses-page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.course-detail-card {
    background: white;
    border: 1px solid var(--border);
    padding: 32px;
    transition: var(--transition);
}

.course-detail-card:hover { box-shadow: var(--shadow-lg); }
.course-detail-card.featured { border: 2px solid var(--accent); }

.course-detail-card h3 {
    color: var(--text);
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
}

.course-detail-card > p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 14px;
}

.course-outline {
    background: var(--bg);
    padding: 16px;
    margin-bottom: 16px;
}

.course-outline h4 { color: var(--text); margin-bottom: 8px; font-size: 15px; }
.course-outline ol { padding-left: 18px; color: var(--text); font-size: 13px; }
.course-outline ol li { padding: 3px 0; line-height: 1.6; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: white;
    border-radius: 8px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal h3 { color: var(--text); font-size: 22px; margin-bottom: 20px; text-align: center; font-weight: 600; }

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.modal-buttons { display: flex; gap: 12px; margin-top: 20px; }
.modal-buttons .btn { flex: 1; }
.modal-buttons .btn-outline { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

.success-message { text-align: center; padding: 20px; color: var(--success); font-weight: 600; }

/* ============ 个人主页 ============ */
.about-page { padding: 0; }

.about-hero {
    background: linear-gradient(135deg, #0D2B5C, #2F6BFF);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.about-hero h1 { font-size: 40px; font-weight: 700; margin-bottom: 12px; }
.about-hero p { font-size: 17px; opacity: 0.85; }

.about-section {
    background: white;
    border: 1px solid var(--border);
    padding: 40px;
    margin-bottom: 24px;
}

.about-section h2 {
    color: var(--text);
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.about-intro {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.about-photo { text-align: center; }

.about-photo-frame {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 72px;
    box-shadow: var(--shadow-lg);
}

.about-text p { margin-bottom: 14px; line-height: 1.9; color: var(--text); font-size: 15px; }

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

.credential-card {
    background: var(--bg);
    padding: 20px;
    text-align: center;
}

.credential-card .icon { font-size: 36px; margin-bottom: 8px; }
.credential-card h4 { color: var(--text); margin-bottom: 4px; font-size: 15px; }
.credential-card p { color: var(--text-light); font-size: 13px; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--secondary);
}

.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px; top: 4px;
    width: 12px; height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--secondary);
}

.timeline-year { color: var(--accent); font-weight: 700; font-size: 14px; }
.timeline-title { color: var(--text); font-size: 17px; font-weight: 600; margin: 4px 0; }
.timeline-desc { color: var(--text-light); line-height: 1.7; font-size: 14px; }

.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.case-card {
    background: var(--bg);
    padding: 20px;
    text-align: center;
}

.case-score { font-size: 32px; color: var(--secondary); font-weight: 700; margin-bottom: 4px; }
.case-arrow { color: var(--accent); font-size: 18px; margin: 2px 0; }
.case-info { color: var(--text-light); font-size: 13px; }

.photo-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.photo-wall-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

/* ============ 入场动画 ============ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============ 页面过渡动画 ============ */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-fade {
    animation: pageFadeIn 0.4s ease-out;
}

/* ============ 团队主页（团队老师一栏介绍） ============ */
.team-member {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: start;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.team-member:last-child { border-bottom: none; padding-bottom: 0; }
.team-member:first-child { padding-top: 8px; }

.team-photo { text-align: center; }

.team-photo-frame {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.team-photo-caption {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
}

.team-text h3 {
    font-size: 20px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 10px;
}

.team-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.team-tag {
    background: var(--bg);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #DDE6F5;
}

.team-text p {
    color: var(--text-light);
    line-height: 1.85;
    font-size: 14px;
    margin-bottom: 10px;
}

.team-text p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
    .team-member { grid-template-columns: 1fr; gap: 16px; }
    .team-photo { display: flex; align-items: center; gap: 16px; text-align: left; }
    .team-photo-frame { margin: 0; }
    .team-photo-caption { margin-top: 0; }
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .nav-container { padding: 0 24px; }
    .hero h1 { font-size: 36px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .philosophy-grid, .courses-grid, .testimonials-grid { grid-template-columns: 1fr; }
    .kb-layout { grid-template-columns: 1fr; }
    .kb-sidebar { position: static; max-height: 400px; }
    .courses-page-grid { grid-template-columns: 1fr; }
    .about-intro { grid-template-columns: 1fr; }
    .case-grid { grid-template-columns: 1fr; }
    .team-member { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .menu-toggle { display: flex; }
    .nav-menu {
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        height: auto;
        box-shadow: var(--shadow-lg);
        display: none;
    }
    .nav-menu.active { display: flex; }
    .nav-menu a { padding: 14px 24px; height: auto; }
    .hero { padding: 60px 0; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .section-title { font-size: 24px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .stat-item .stat-number { font-size: 32px; }
    .upload-form { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .photo-wall { grid-template-columns: 1fr 1fr; }
    .floating-text { display: none; }
    .floating-btn { bottom: 20px; right: 20px; }
    .kb-content { padding: 24px; }
    .container, .nav-container { padding: 0 16px; }
}
