:root {
    --page-width: 1180px;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --surface-strong: var(--bg-secondary);
    --line-soft: var(--border-light);
    --page-shadow: var(--shadow-lg);
    --card-shadow: var(--shadow-md);
    --text-main: var(--text-primary);
    --text-secondary-local: rgba(255, 255, 255, 0.8);
    --hero-gradient: linear-gradient(135deg, rgba(22, 40, 63, 0.98) 0%, rgba(32, 56, 88, 0.96) 34%, rgba(54, 84, 124, 0.92) 68%, rgba(95, 123, 163, 0.86) 100%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.1), transparent 28%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.theory-page {
    min-height: 100vh;
}

.back-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 20;
    border: 1px solid var(--border-light);
    background: rgba(var(--bg-secondary-rgb), 0.72);
    color: var(--text-primary);
    backdrop-filter: blur(18px);
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    background: rgba(var(--bg-secondary-rgb), 0.86);
    border-color: var(--border-medium);
}

/* --- Hero 区已重构为 page-header（稳重标题区见 components.css 骨架层） --- */

.content {
    padding: 34px 0 72px;
}

.theory-content {
    margin-top: -34px;
    position: relative;
    z-index: 2;
}

.section {
    padding: 0 16px;
    margin-bottom: 28px;
}

.theory-section {
    margin-bottom: 34px;
}

.theory-section:nth-child(2n) .theory-section-card {
    background: var(--bg-secondary);
}

.theory-section-card {
    border-radius: 30px;
}

.theory-section-card-featured {
    box-shadow: var(--shadow-lg);
}

.theory-section-card-emphasis,
.theory-section-card-band {
    background: var(--bg-secondary);
}

.theory-section-card-terminal {
    background: var(--bg-secondary);
}

.theory-section-card-ending-shell {
    background: transparent;
    border: none;
    box-shadow: none;
}

.theory-section-card-references {
    background: var(--bg-secondary);
}

.theory-section-inner {
    position: relative;
}

.theory-section-inner-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.44fr);
    gap: 28px;
    align-items: start;
    padding-bottom: 20px;
}

.theory-section-inner-flow {
    padding-top: 4px;
}

.theory-section-inner-ending {
    width: min(1040px, calc(100vw - 48px));
}

.theory-section-header {
    margin-bottom: 0;
}

.theory-section-header-centered {
    text-align: center;
    justify-items: center;
    margin-bottom: 26px;
}

.section-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.section-header p {
    margin: 0;
    max-width: 860px;
    color: var(--text-secondary);
}

.theory-section-aside {
    display: flex;
    justify-content: flex-end;
}

.theory-section-aside-stacked {
    align-self: stretch;
}

.theory-aside-card {
    width: 100%;
    border-radius: 22px;
    padding: 18px 18px 20px;
    background: rgba(var(--bg-secondary-rgb), 0.86);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.theory-aside-card p {
    margin: 10px 0 0;
}

.theory-aside-label {
    color: var(--text-muted);
}

.theory-aside-card-strong {
    background: rgba(var(--bg-secondary-rgb), 0.88);
}

.theory-aside-card-soft {
    background: rgba(var(--bg-secondary-rgb), 0.88);
}

.grid-two,
.grid-three,
.grid-four,
.timeline,
.contrast-layout {
    display: grid;
    gap: 18px;
}

.grid-two,
.contrast-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three,
.timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.theory-grid-tight {
    gap: 16px;
}

.theory-grid-steps {
    gap: 16px;
}

.theory-grid-bridges {
    align-items: stretch;
}

.theory-grid-metrics,
.theory-grid-paths,
.theory-grid-principles {
    gap: 16px;
}

.soft-card,
.metric-card,
.principle-card,
.path-card,
.timeline-card,
.promise-card,
.quote-card,
.manifesto-card,
.contrast-card,
.structure-card,
.ending-card,
.bridge-card {
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    box-shadow: 0 10px 24px var(--shadow-sm);
}

.soft-card,
.metric-card,
.principle-card,
.path-card,
.timeline-card,
.promise-card,
.quote-card,
.manifesto-card,
.contrast-card,
.structure-card,
.bridge-card {
    padding: 24px;
}

.metric-card {
    background: var(--bg-secondary);
}

.theory-metric-card {
    min-height: 100%;
}

.theory-metric-card-deep {
    background: var(--bg-secondary);
}

.metric-label,
.timeline-step,
.principle-top span,
.quote-source {
    font-size: 0.86rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.metric-card h3,
.bridge-card h3,
.structure-card h3,
.principle-card h3,
.path-card h3,
.promise-card h3,
.contrast-card h3,
.timeline-card h3,
.manifesto-card h3,
.soft-card h3 {
    margin: 0 0 12px;
    font-size: 1.14rem;
    color: var(--text-primary);
}

.metric-card p,
.soft-card p,
.principle-card p,
.path-card p,
.timeline-card p,
.promise-card p,
.contrast-card p,
.structure-card p,
.bridge-card p,
.ending-card p,
.ending-card li,
.manifesto-card p,
.manifesto-card li {
    margin: 0;
    color: var(--text-secondary);
}

.quote-card {
    padding: 28px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
}

.theory-inline-quote {
    max-width: 880px;
}

.theory-block-quote {
    max-width: none;
}

.quote-card-spaced,
.section-spacer {
    margin-top: 18px;
}

.quote-card blockquote {
    margin: 0;
    font-size: clamp(1.08rem, 2vw, 1.34rem);
    line-height: 1.9;
}

.quote-card .quote-source {
    margin-top: 16px;
    color: var(--text-secondary);
}

.bridge-card {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.06) 100%);
}

.theory-bridge-card-wide,
.theory-bridge-emphasis {
    min-height: 100%;
}

.theory-bridge-emphasis {
    border-color: var(--accent);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.structure-card,
.principle-card {
    display: grid;
    gap: 14px;
}

.theory-step-card,
.theory-timeline-card,
.theory-principle-card,
.theory-path-card,
.theory-reference-card {
    height: 100%;
}

.structure-order,
.principle-index {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.structure-order {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-primary);
}

.principle-index {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
}

.structure-list,
.ending-list,
.compact-list,
.manifesto-card ul,
.contrast-card ul,
.references-list {
    margin: 0;
    padding-left: 18px;
}

.compact-list-spaced {
    margin-top: 16px;
}

.structure-list li,
.ending-list li,
.compact-list li,
.manifesto-card li,
.contrast-card li,
.references-list li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.principle-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.contrast-card.is-soft {
    background: var(--bg-secondary);
}

.contrast-card.is-warm {
    background: var(--bg-secondary);
}

.theory-contrast-tall {
    align-items: stretch;
}

.theory-contrast-card {
    height: 100%;
}

.manifesto-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.manifesto-card h3,
.manifesto-card p,
.manifesto-card li {
    color: var(--text-primary);
}

.theory-manifesto-card {
    margin-top: 22px;
}

.path-card {
    background: var(--bg-secondary);
}

.ending-card {
    padding: 34px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    display: grid;
    gap: 22px;
}

.theory-ending-card {
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
}

.ending-card h2,
.ending-card h3,
.ending-card p,
.ending-card li {
    color: var(--text-primary);
    margin: 0;
}

.ending-card .chip {
    background: var(--border-light);
    color: var(--text-primary);
}

.theory-ending-chips {
    margin-top: 0;
}

.ending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.references-grid .soft-card {
    height: 100%;
}

.theory-reference-card {
    border-radius: 24px;
}

.theory-footer {
    padding-top: 18px;
}

@media (max-width: 1024px) {
    .grid-three,
    .grid-four,
    .timeline,
    .grid-two,
    .contrast-layout,
    .theory-section-inner-split {
        grid-template-columns: 1fr;
    }

    .theory-section-aside {
        justify-content: stretch;
    }
}

@media (max-width: 768px) {
    .ending-card {
        padding: 20px;
    }

    .theory-section-inner-split,
    .theory-section-inner-flow {
        padding-top: 0;
        padding-bottom: 0;
    }

    .theory-content {
        margin-top: 0;
    }
}

@media (max-width: 560px) {
    .back-btn {
        top: 12px;
        left: 12px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .section {
        padding: 0 12px;
        margin-bottom: 18px;
    }

    .ending-actions {
        flex-direction: column;
    }

    .ending-primary,
    .ending-secondary {
        width: 100%;
    }
}
