/* ========== 乐理基础专题页面样式 ========== */
/* 版本: 1.0.0 | 栏目: 音乐 > 乐理基础 | 作者: 芦笛 */

/* ===== 页面头部 ===== */
.theory-header {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3D4F4E, #4A5E5D, #5B6B6A, #2D3A39);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    overflow: hidden;
}

.theory-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.theory-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 100px;
    background: var(--color-cream);
    clip-path: ellipse(70% 100% at 50% 100%);
}

/* ===== 概览区 ===== */
.theory-overview {
    padding: var(--space-2xl) var(--space-md);
    background: white;
}

.theory-intro-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    max-width: 1200px;
    margin: var(--space-xl) auto 0;
    align-items: start;
}

.theory-intro-text h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: var(--space-md);
    letter-spacing: 2px;
    position: relative;
    padding-bottom: var(--space-sm);
}

.theory-intro-text h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    border-radius: 2px;
}

.theory-intro-text p {
    font-size: 0.95rem;
    color: var(--color-warm-gray);
    line-height: 2;
    margin-bottom: var(--space-md);
    font-weight: 300;
    text-align: justify;
}

.theory-intro-text strong {
    color: var(--color-dark);
    font-weight: 500;
}

.theory-intro-visual {
    position: sticky;
    top: 100px;
}

.theory-intro-visual canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #F0EBE3, #E8E0D5);
}

/* ===== 章节通用样式 ===== */
.theory-chapter {
    padding: var(--space-2xl) var(--space-md);
    background: white;
}

.theory-chapter.chapter-alt {
    background: linear-gradient(180deg, var(--color-cream) 0%, white 30%, white 70%, var(--color-cream) 100%);
}

.theory-chapter-container {
    max-width: 900px;
    margin: 0 auto;
}

.chapter-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(30, 30, 36, 0.06);
}

.chapter-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-music-light, #7A9B9A), var(--color-music-primary, #5B7B7A));
    color: white;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-md);
}

.chapter-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: var(--space-sm);
    letter-spacing: 2px;
    line-height: 1.4;
}

.chapter-subtitle {
    font-size: 1rem;
    color: var(--color-warm-gray);
    font-weight: 300;
    letter-spacing: 1px;
}

/* ===== 正文文本块 ===== */
.theory-body {
    max-width: 800px;
    margin: 0 auto;
}

.theory-text-block {
    margin-bottom: var(--space-xl);
}

.theory-text-block h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: var(--space-md);
    letter-spacing: 1.5px;
    position: relative;
    padding-left: 16px;
}

.theory-text-block h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: linear-gradient(180deg, var(--color-accent), var(--color-music-light, #7A9B9A));
    border-radius: 2px;
}

.theory-text-block p {
    font-size: 0.95rem;
    color: var(--color-warm-gray);
    line-height: 2.1;
    margin-bottom: var(--space-md);
    font-weight: 300;
    text-align: justify;
    text-indent: 2em;
}

.theory-text-block p:first-of-type {
    text-indent: 0;
}

.theory-text-block p strong {
    color: var(--color-dark);
    font-weight: 500;
}

/* 列表样式 */
.theory-text-block ul {
    margin: var(--space-md) 0 var(--space-md) var(--space-lg);
    list-style: none;
}

.theory-text-block ul li {
    font-size: 0.95rem;
    color: var(--color-warm-gray);
    line-height: 2;
    margin-bottom: var(--space-xs);
    font-weight: 300;
    position: relative;
    padding-left: 1.2em;
}

.theory-text-block ul li::before {
    content: '◦';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-size: 0.8rem;
    line-height: 2;
}

/* ===== 图例 ===== */
.theory-figure {
    margin: var(--space-xl) auto;
    text-align: center;
    max-width: 720px;
}

.theory-figure canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #FAF8F5, #F0EBE3);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(30, 30, 36, 0.04);
}

.figure-caption {
    font-size: 0.8rem;
    color: var(--color-warm-gray);
    margin-top: var(--space-sm);
    font-weight: 300;
    font-style: italic;
    opacity: 0.8;
}

/* ===== 总结区 ===== */
.theory-conclusion {
    padding: var(--space-2xl) var(--space-md);
    background: linear-gradient(180deg, white 0%, var(--color-cream) 100%);
}

.theory-conclusion-container {
    max-width: 900px;
    margin: 0 auto;
}

.theory-conclusion .theory-text-block p {
    font-size: 1rem;
    line-height: 2.2;
}

/* ===== 引用块增强 ===== */
.overview-quote {
    border-left: 3px solid var(--color-accent);
    padding-left: var(--space-md);
    margin: var(--space-lg) 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--color-dark);
    font-style: italic;
    line-height: 1.9;
    background: linear-gradient(90deg, rgba(196, 167, 125, 0.06), transparent);
    padding: var(--space-md) var(--space-md) var(--space-md) var(--space-lg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.overview-quote cite {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--color-warm-gray);
    font-style: normal;
    font-family: var(--font-body);
}

/* ===== CTA 复用 ===== */
.music-cta {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4A5E5D, #3D4F4E, #5B6B6A);
    overflow: hidden;
}

.cta-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-sm);
    letter-spacing: 3px;
}

.cta-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: var(--space-lg);
    font-weight: 300;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== 面包屑容器 ===== */
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.breadcrumb-wrap {
    background: var(--color-cream);
    border-bottom: 1px solid rgba(30, 30, 36, 0.04);
}

/* ===== 响应式 ===== */
@media (max-width: 968px) {
    .theory-intro-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .theory-intro-visual {
        position: relative;
        top: 0;
        order: -1;
    }

    .theory-text-block p {
        text-indent: 1.5em;
    }
}

@media (max-width: 640px) {
    .theory-chapter {
        padding: var(--space-xl) var(--space-sm);
    }

    .chapter-num {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .theory-text-block h3 {
        font-size: 1.1rem;
    }

    .theory-text-block p {
        font-size: 0.9rem;
        line-height: 1.95;
        text-indent: 1.2em;
    }

    .theory-figure canvas {
        min-height: 200px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 200px;
    }
}

/* ===== 页面头部内容定位 ===== */
.page-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    max-width: 800px;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: white;
    margin-bottom: var(--space-md);
    letter-spacing: 8px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.page-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.9;
    font-weight: 300;
}

.page-header-deco {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.page-header-deco:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.page-header-deco:nth-child(2) {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
}

.page-header-deco:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.header-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    pointer-events: none;
}
