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

:root {
    --primary-color: #b8942a;
    --primary-dark: #9a7b1f;
    --bg-dark: #e8edf5;
    --bg-card: #ffffff;
    --text-gold: #a07d1c;
    --text-light: #2d3748;
    --text-muted: #6b7280;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at top, #dce4f2 0%, transparent 50%),
        radial-gradient(ellipse at bottom, #d5dff0 0%, transparent 50%);
    min-height: 100vh;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

.home-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-banner {
    text-align: center;
    padding: 50px 20px 30px;
    position: relative;
}

.home-banner .logo-area {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,247,251,0.9));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(74, 111, 165, 0.12);
    border: 1px solid rgba(74, 111, 165, 0.1);
}

.home-banner .logo-text {
    font-size: 3rem;
    font-weight: 900;
    color: #3d5d8a;
    letter-spacing: 2px;
    line-height: 1.1;
}

.home-banner .logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    margin-top: 4px;
}

.home-slogan {
    background: linear-gradient(135deg, rgba(74,111,165,0.08), rgba(74,111,165,0.03));
    border-radius: 25px;
    padding: 12px 24px;
    margin: 0 auto 35px;
    max-width: 320px;
    text-align: center;
}

.home-slogan p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 4px;
    margin-bottom: 40px;
}

.nav-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #f5f7fb 100%);
    border: 1px solid rgba(74, 111, 165, 0.1);
    border-radius: 16px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4a6fa5, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(74, 111, 165, 0.15);
    border-color: rgba(74, 111, 165, 0.25);
}

.nav-card:hover::before {
    opacity: 0.5;
}

.nav-card:active {
    transform: translateY(-1px);
}

.nav-card .nav-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(74, 111, 165, 0.08);
}

.nav-card .nav-icon svg {
    width: 28px;
    height: 28px;
    color: #4a6fa5;
}

.nav-card .nav-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #3d5d8a;
    letter-spacing: 2px;
}

.nav-card.active .nav-icon {
    background: linear-gradient(135deg, #4a6fa5, #3d5d8a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.nav-card.active .nav-icon svg {
    color: #fff;
}

.nav-card.active .nav-title {
    color: #3d5d8a;
}

.nav-card.disabled {
    opacity: 0.55;
    cursor: default;
}

.nav-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(74, 111, 165, 0.1);
}

.nav-card.disabled:hover::before {
    opacity: 0;
}

.nav-card .coming-soon {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(74, 111, 165, 0.06);
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.home-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-top: auto;
}

/* ==================== 底部 Tab 导航 ==================== */

.home-container {
    padding-bottom: 70px; /* 为底部Tab留空间 */
}

.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(74, 111, 165, 0.15);
    box-shadow: 0 -4px 20px rgba(74, 111, 165, 0.08);
    z-index: 100;
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 0 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: inherit;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.bottom-tab .tab-icon {
    width: 22px;
    height: 22px;
    color: currentColor;
}

.bottom-tab.active {
    color: #3d5d8a;
    font-weight: 600;
}

/* ==================== 课程页样式 ==================== */

.courses-header {
    text-align: center;
    padding: 40px 20px 24px;
}

.courses-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3d5d8a;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.courses-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.teacher-card {
    background: linear-gradient(135deg, #ffffff, #f5f7fb);
    border: 1px solid rgba(74, 111, 165, 0.12);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(74, 111, 165, 0.08);
}

.teacher-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 14px;
    border: 3px solid rgba(74, 111, 165, 0.2);
    box-shadow: 0 4px 14px rgba(74, 111, 165, 0.15);
}

.teacher-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #3d5d8a;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 111, 165, 0.1);
}

.teacher-bio {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.75;
    white-space: pre-line;
    margin-bottom: 16px;
}

.course-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-gold);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.course-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: #e05c2a;
    margin-bottom: 16px;
}

.btn-reserve {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #4a6fa5, #3d5d8a);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.btn-reserve:active {
    transform: scale(0.98);
}

/* ── 轮播图 ── */
.carousel-section {
    margin: 0 16px 20px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    position: relative;
    width: 100%;
    padding-bottom: 45%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3d5d8a, #1a2f50);
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.carousel-alt-text {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    letter-spacing: 2px;
    padding: 20px;
    text-align: center;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ── 老师精简卡片 ── */
.teacher-compact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #ffffff, #f5f7fb);
    border: 1px solid rgba(74, 111, 165, 0.12);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.teacher-compact-card .teacher-avatar {
    width: 64px;
    height: 64px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.teacher-compact-card .teacher-avatar:hover {
    transform: scale(1.05);
}

.teacher-compact-card .teacher-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: #3d5d8a;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
    border: none;
}

.teacher-compact-card .btn-reserve {
    flex-shrink: 0;
    width: auto;
    padding: 9px 16px;
    font-size: 0.88rem;
    letter-spacing: 1px;
}

.teacher-placeholder {
    border: 1.5px dashed rgba(74, 111, 165, 0.3);
    background: rgba(245, 247, 251, 0.6);
    cursor: pointer;
}

.teacher-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(74, 111, 165, 0.08);
    border: 2px dashed rgba(74, 111, 165, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.btn-reserve-outline {
    flex-shrink: 0;
    padding: 9px 16px;
    background: transparent;
    color: #9ca3af;
    border: 1.5px solid rgba(74, 111, 165, 0.2);
    border-radius: 12px;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 1px;
}

/* ── 老师详情弹窗 ── */
.teacher-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.teacher-detail-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.teacher-detail-modal {
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 28px 24px 36px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(40px);
    transition: transform 0.3s;
}

.teacher-detail-overlay.open .teacher-detail-modal {
    transform: translateY(0);
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.detail-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 14px;
    border: 3px solid rgba(74, 111, 165, 0.2);
    box-shadow: 0 4px 14px rgba(74, 111, 165, 0.15);
}

.detail-name {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #3d5d8a;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(74, 111, 165, 0.1);
}

.detail-bio {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.8;
    white-space: pre-line;
    margin-bottom: 20px;
}

.detail-reserve-btn {
    width: 100%;
    padding: 13px;
}

@media (max-width: 400px) {
    .home-banner {
        padding: 35px 15px 20px;
    }

    .home-banner .logo-area {
        width: 110px;
        height: 110px;
    }

    .home-banner .logo-text {
        font-size: 2.4rem;
    }

    .nav-grid {
        gap: 10px;
    }

    .nav-card {
        padding: 22px 12px;
    }

    .nav-card .nav-title {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .nav-card .nav-icon {
        font-size: 1.6rem;
        width: 44px;
        height: 44px;
    }
}
