/* ========================================
   ACADEMIC BLOG THEME
   Clean, minimalist, content-focused
   ======================================== */

:root {
    /* Light mode (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #868e96;
    --border-color: #dee2e6;
    --accent-color: #228be6;
    --success-color: #2f9e44;
    --warning-color: #f08c00;
    --danger-color: #fa5252;
    --code-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --text-primary: #c9d1d9;
        --text-secondary: #8b949e;
        --text-muted: #6e7681;
        --border-color: #30363d;
        --accent-color: #58a6ff;
        --code-bg: #161b22;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 17px; /* 增大基础字体 */
}

/* Layout with wider container */
.container {
    max-width: 1100px; /* 更宽的页面 */
    margin: 0 auto;
    padding: 0 40px; /* 增加侧边距 */
}

/* Header */
header {
    border-bottom: 1px solid var(--border-color);
    padding: 30px 0;
    margin-bottom: 50px;
}

.header-title h1 {
    font-size: 32px; /* 更大的标题 */
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.header-title .subtitle {
    font-size: 18px; /* 更大的副标题 */
    color: var(--text-muted);
}

.author-line {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* Main content */
main {
    padding: 30px 0;
}

section {
    margin-bottom: 70px;
}

h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    font-size: 21px;
    font-weight: 600;
    margin: 28px 0 16px;
    color: var(--text-primary);
}

h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 10px;
}

p {
    margin-bottom: 18px;
    color: var(--text-secondary);
    font-size: 17px;
}

/* Lead paragraph */
.lead {
    font-size: 19px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
}

/* Abstract box */
.abstract {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-color);
    padding: 24px;
    margin-bottom: 40px;
    border-radius: 4px;
}

.abstract p {
    margin-bottom: 0;
}

/* Finding cards */
.finding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 28px 0;
}

.finding-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    background: var(--bg-primary);
}

.finding-card.math { border-left: 4px solid var(--success-color); }
.finding-card.science { border-left: 4px solid var(--warning-color); }
.finding-card.coding { border-left: 4px solid var(--danger-color); }

.finding-card h4 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
}

.metric-big {
    font-size: 42px;
    font-weight: 700;
    margin: 16px 0;
}

.metric-big.math { color: var(--success-color); }
.metric-big.science { color: var(--warning-color); }
.metric-big.coding { color: var(--danger-color); }

.confidence-interval {
    font-size: 15px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Feature table */
.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.feature-table th,
.feature-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.feature-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.feature-table code {
    background: var(--code-bg);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* Method cards */
.method-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    background: var(--bg-primary);
}

.method-card h4 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 18px;
}

.method-result {
    display: inline-block;
    background: var(--code-bg);
    padding: 6px 14px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 15px;
    margin: 10px 0;
}

.method-result.poor { color: var(--danger-color); }
.method-result.weak { color: var(--warning-color); }
.method-result.neutral { color: var(--text-muted); }

/* Code blocks */
pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 18px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
}

code {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

pre code {
    background: none;
    padding: 0;
}

/* Example boxes */
.example-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.example-box .example-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.example-box .example-content {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.comparison-table th,
.comparison-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table .domain-header {
    background: var(--bg-secondary);
    font-weight: 600;
}

.comparison-table .value-good { color: var(--success-color); font-weight: 600; }
.comparison-table .value-bad { color: var(--danger-color); font-weight: 600; }
.comparison-table .value-mid { color: var(--warning-color); font-weight: 600; }

/* Narrative timeline */
.narrative-timeline {
    border-left: 3px solid var(--border-color);
    padding-left: 24px;
    margin: 28px 0;
}

.narrative-item {
    position: relative;
    margin-bottom: 32px;
}

.narrative-item::before {
    content: "";
    position: absolute;
    left: -29px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
}

.narrative-item h4 {
    margin-bottom: 12px;
    font-size: 19px;
}

.narrative-item.failure::before { background: var(--danger-color); }
.narrative-item.success::before { background: var(--success-color); }

/* Chart containers */
.chart-container {
    margin: 28px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    background: var(--bg-primary);
}

.chart-container canvas {
    max-height: 350px;
}

.chart-caption {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

/* Key insight box */
.insight-box {
    background: linear-gradient(135deg, rgba(34, 139, 230, 0.05) 0%, rgba(34, 139, 230, 0.1) 100%);
    border: 1px solid rgba(34, 139, 230, 0.2);
    border-radius: 8px;
    padding: 24px;
    margin: 28px 0;
}

.insight-box h4 {
    color: var(--accent-color);
    margin-bottom: 14px;
    font-size: 19px;
}

/* Technical details box */
.technical-box {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    font-size: 15px;
}

.technical-box h5 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* FAQ section */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 18px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 17px;
}

.faq-answer {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Heavy Branch Examples */
.heavy-branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.heavy-branch-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background: var(--bg-secondary);
}

.heavy-branch-card.branch-heavy { border-top: 3px solid #e74c3c; }
.heavy-branch-card.loop-heavy { border-top: 3px solid #9b59b6; }
.heavy-branch-card.call-heavy { border-top: 3px solid #3498db; }

.heavy-branch-card h5 {
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--text-primary);
}

.heavy-branch-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.branch-heavy .heavy-branch-badge { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.loop-heavy .heavy-branch-badge { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.call-heavy .heavy-branch-badge { background: rgba(52, 152, 219, 0.15); color: #3498db; }

.heavy-branch-metric {
    font-size: 13px;
    font-family: monospace;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.heavy-branch-snippet {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--code-bg);
    padding: 12px;
    border-radius: 4px;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Motivation comparison */
.motivation-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 28px 0;
}

.motivation-card {
    padding: 24px;
    border-radius: 8px;
}

.motivation-card.linear {
    background: linear-gradient(135deg, rgba(47, 158, 68, 0.08) 0%, rgba(47, 158, 68, 0.03) 100%);
    border: 1px solid rgba(47, 158, 68, 0.2);
}

.motivation-card.branching {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08) 0%, rgba(231, 76, 60, 0.03) 100%);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.motivation-card h4 {
    margin-bottom: 14px;
    font-size: 18px;
}

.linear h4 { color: var(--success-color); }
.branching h4 { color: var(--danger-color); }

/* Annotation section */
.annotation-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.annotation-methods {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.annotation-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

.annotation-glm { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.annotation-python { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.annotation-human { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

footer p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }

/* ========================================
   TERMINAL-STYLE COC COMPARISON CARDS
   ======================================== */

.comparison-intro {
    text-align: center;
    margin-bottom: 24px;
}

.terminal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
    align-items: stretch;
}

.terminal-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
}

.terminal-math .terminal-header {
    background: #1e1e2e;
    color: #a6e3a1;
    border-bottom: 2px solid #2f9e44;
}

.terminal-coding .terminal-header {
    background: #1e1e2e;
    color: #f38ba8;
    border-bottom: 2px solid #fa5252;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot-green { background: #a6e3a1; }
.terminal-dot-yellow { background: #f9e2af; }
.terminal-dot-red { background: #f38ba8; }

.terminal-title {
    margin-left: 8px;
    font-family: monospace;
    font-size: 12px;
    opacity: 0.8;
}

.terminal-body {
    background: #11111b;
    color: #cdd6f4;
    padding: 18px;
    font-family: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    min-height: 240px;
}

.t-comment { color: #6c7086; }
.t-dim { color: #9399b2; }
.t-var { color: #89b4fa; }
.t-ok { color: #a6e3a1; font-weight: 600; }
.t-err { color: #f38ba8; font-weight: 600; }
.t-warn {
    color: #fab387;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(250, 179, 135, 0.3);
}

/* Light mode terminal adjustments */
@media (prefers-color-scheme: light) {
    .terminal-body {
        background: #1e1e2e;
    }
}

/* ========================================
   REFERENCES
   ======================================== */

.reference-list {
    list-style: decimal;
    padding-left: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.reference-list li {
    margin-bottom: 6px;
    padding-left: 4px;
}

.reference-list em {
    font-style: italic;
}

.reference-list a {
    font-size: 13px;
}

/* ========================================
   INLINE CHECK DIAGRAMS
   ======================================== */

/* Container for each check diagram */
.check-diagram {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 12px 0 20px;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

.check-diagram .diagram-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 600;
}

/* Horizontal pipeline: flex row of boxes + arrows */
.mini-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    margin: 8px 0;
}

.mini-box {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    border: 1.5px solid;
}

.mini-box.wide {
    min-width: 100px;
    padding: 6px 18px;
}

.mini-box.narrow {
    min-width: 56px;
}

.mini-box.accent {
    background: rgba(34, 139, 230, 0.10);
    border-color: rgba(34, 139, 230, 0.35);
    color: var(--accent-color);
}

.mini-box.success {
    background: rgba(47, 158, 68, 0.10);
    border-color: rgba(47, 158, 68, 0.35);
    color: var(--success-color);
}

.mini-box.danger {
    background: rgba(250, 82, 82, 0.10);
    border-color: rgba(250, 82, 82, 0.35);
    color: var(--danger-color);
}

.mini-box.warning {
    background: rgba(240, 140, 0, 0.10);
    border-color: rgba(240, 140, 0, 0.35);
    color: var(--warning-color);
}

.mini-box.muted {
    background: rgba(134, 142, 150, 0.10);
    border-color: rgba(134, 142, 150, 0.30);
    color: var(--text-muted);
}

.mini-box.ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.mini-arrow {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0 8px;
    flex-shrink: 0;
    line-height: 1;
}

.mini-arrow.down {
    display: block;
    text-align: center;
    margin: 4px auto;
    font-size: 14px;
}

/* SSL-specific vertical flow */
.ssl-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ssl-flow .ssl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
}

.ssl-flow .ssl-losses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 4px 0;
}

.ssl-flow .loss-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(155, 89, 182, 0.12);
    color: #9b59b6;
    font-weight: 600;
    white-space: nowrap;
}

.ssl-flow .finetune-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

.ssl-flow .finetune-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: monospace;
}

.ssl-flow .finetune-item .result-down {
    color: var(--danger-color);
    font-weight: 700;
}

.ssl-flow .finetune-item .result-up {
    color: var(--warning-color);
    font-weight: 700;
}

/* Architecture comparison (Check 3) */
.arch-compare {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.arch-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 13px;
    white-space: nowrap;
}

.arch-row .arch-label {
    min-width: 52px;
    font-weight: 600;
    color: var(--text-secondary);
}

.arch-row .arch-node {
    padding: 4px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-primary);
}

.arch-row .arch-node.hidden {
    border-color: rgba(250, 82, 82, 0.35);
    background: rgba(250, 82, 82, 0.06);
    color: var(--danger-color);
}

.arch-row .arch-result {
    margin-left: 8px;
    font-weight: 700;
    color: var(--danger-color);
}

/* De-knotting text example (Check 4) */
.knot-demo {
    margin: 8px 0;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.7;
}

.knot-demo .knot-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.knot-demo .knot-label {
    min-width: 68px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    padding-top: 2px;
    flex-shrink: 0;
}

.knot-demo .knot-text {
    color: var(--text-secondary);
    position: relative;
}

.knot-highlight {
    background: rgba(250, 82, 82, 0.15);
    color: var(--danger-color);
    border-bottom: 2px solid var(--danger-color);
    padding: 0 2px;
    border-radius: 2px;
}

.knot-demo .knot-brace {
    color: var(--danger-color);
    font-size: 12px;
    margin-left: 76px;
    opacity: 0.7;
}

.knot-demo .knot-scissors {
    color: var(--danger-color);
    font-size: 11px;
    margin-left: 76px;
    letter-spacing: 2px;
}

.knot-demo .knot-after {
    color: var(--success-color);
    opacity: 0.85;
}

/* Cross-validation pipeline (Check 5) */
.cv-pipeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 8px 0;
}

.cv-pipeline .cv-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-pipeline .cv-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   RESULT GAUGE BARS (Figure 2 replacement)
   ======================================== */

.gauge-container {
    margin: 28px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 28px;
    background: var(--bg-primary);
}

.gauge-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.gauge-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.gauge-label {
    min-width: 120px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 14px;
    flex-shrink: 0;
}

.gauge-track {
    flex: 1;
    height: 22px;
    background: rgba(134, 142, 150, 0.08);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
    position: relative;
}

.gauge-fill.red {
    background: linear-gradient(90deg, rgba(250, 82, 82, 0.25), rgba(250, 82, 82, 0.50));
    border-right: 2px solid var(--danger-color);
}

.gauge-value {
    min-width: 52px;
    font-size: 13px;
    font-family: monospace;
    font-weight: 700;
    text-align: left;
    padding-left: 10px;
    flex-shrink: 0;
}

.gauge-value.danger { color: var(--danger-color); }

.gauge-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding-left: 134px;
    padding-right: 56px;
}

.gauge-axis span {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.gauge-threshold {
    position: absolute;
    left: 60%;  /* 0.6 threshold out of 1.0 */
    top: -2px;
    bottom: -2px;
    width: 1.5px;
    background: var(--danger-color);
    opacity: 0.5;
}

.gauge-threshold-label {
    position: absolute;
    right: -4px;
    top: -16px;
    font-size: 10px;
    color: var(--danger-color);
    font-weight: 600;
    white-space: nowrap;
}

.gauge-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    justify-content: center;
}

.gauge-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.gauge-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.gauge-legend-swatch.math { background: var(--success-color); }
.gauge-legend-swatch.coding { background: var(--danger-color); }
.gauge-legend-swatch.chance {
    background: repeating-linear-gradient(
        45deg,
        var(--border-color),
        var(--border-color) 2px,
        transparent 2px,
        transparent 4px
    );
}

/* Gauge bars for math vs coding */
.gauge-fill.green {
    background: linear-gradient(90deg, rgba(47, 158, 68, 0.20), rgba(47, 158, 68, 0.45));
    border-right: 2px solid var(--success-color);
}

.gauge-value.success { color: var(--success-color); }

/* Domain signal bars */
.domain-spectrum { display: flex; gap: 20px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.domain-col { text-align: center; flex: 1; min-width: 140px; }
.domain-col .mini-box { margin-bottom: 8px; }
.signal-bar { height: 10px; border-radius: 5px; margin: 8px auto; max-width: 180px; }
.signal-bar.math { background: var(--success-color); width: 95%; }
.signal-bar.science { background: var(--warning-color); width: 55%; }
.signal-bar.coding { background: var(--danger-color); width: 15%; }
.domain-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Info channel ladder */
.info-ladder { max-width: 500px; margin: 12px auto; }
.ladder-rung {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: -1px;
    font-size: 14px;
    background: var(--bg-secondary);
    display: flex; justify-content: space-between;
}
.ladder-rung.tested {
    border-left: 3px solid var(--accent-color);
    background: rgba(34,139,230,0.06);
}
.ladder-rung.strong {
    border-left: 3px solid var(--success-color);
    font-weight: 600;
}
.ladder-tag { font-size: 11px; color: var(--text-muted); }

/* Flow mismatch diagram */
.flow-compare { display: flex; gap: 24px; margin: 12px 0; flex-wrap: wrap; }
.flow-track { flex: 1; min-width: 250px; }
.flow-track-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.flow-nodes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.flow-node {
    padding: 4px 10px; border-radius: 4px; font-size: 12px;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
}
.flow-node.branch {
    border-color: rgba(250,82,82,0.4); background: rgba(250,82,82,0.08); color: var(--danger-color);
}
.flow-node.loop {
    border-color: rgba(240,140,0,0.4); background: rgba(240,140,0,0.08); color: var(--warning-color);
}
.flow-arrow { color: var(--text-muted); font-size: 14px; }
.flow-branch-arrow { color: var(--danger-color); font-size: 11px; }

/* SVD pipeline expand button */
.svd-expand-btn summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--accent-color);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
}
.svd-expand-btn summary:hover { opacity: 0.85; }
.svd-expand-btn summary:active { transform: scale(0.98); }
.svd-expand-btn[open] > summary::before { content: "✕ "; }

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0 20px;
    }

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

    .terminal-body {
        font-size: 12px;
        min-height: 180px;
    }

    .finding-grid,
    .heavy-branch-grid {
        grid-template-columns: 1fr;
    }

    .motivation-comparison {
        grid-template-columns: 1fr;
    }

    .feature-table,
    .comparison-table {
        font-size: 13px;
    }

    .header-title h1 {
        font-size: 24px;
    }

    /* Diagram responsive */
    .mini-pipeline {
        flex-wrap: wrap;
        gap: 4px;
    }

    .mini-arrow { margin: 0 4px; }

    .gauge-label { min-width: 90px; font-size: 12px; }
    .gauge-axis { padding-left: 104px; padding-right: 50px; }

    .arch-row { font-size: 11px; }
    .knot-demo { font-size: 11px; }
    .knot-demo .knot-label { min-width: 55px; font-size: 11px; }
    .knot-demo .knot-brace,
    .knot-demo .knot-scissors { margin-left: 63px; }

    .ssl-flow .ssl-losses { gap: 4px; }
    .ssl-flow .finetune-row { flex-direction: column; gap: 6px; }

    .flow-compare { flex-direction: column; gap: 16px; }
    .domain-spectrum { flex-direction: column; align-items: center; }
    .domain-col { min-width: 200px; }
}
