/* About I-Ching Page — QMF UI Theme */

/* ── Variables ── */
:root {
    --ic-gold: #d4af37;
    --ic-gold-light: rgba(212,175,55,.15);
    --ic-purple: #8b5cf6;
    --ic-purple-light: rgba(139,92,246,.12);
    --ic-ink: #1a1a2e;
    --ic-text: #374151;
}

/* ── Header ── */
header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--qmf-border);
}
[data-theme="dark"] header { background: rgba(30,41,59,.95); }

.header-container {
    max-width: 900px; margin: 0 auto;
    padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.logo-container a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { height: 32px; }
.site-title { font-weight: 700; font-size: 16px; color: var(--qmf-text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-link {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px;
    color: var(--qmf-text-muted); text-decoration: none;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--qmf-surface); color: var(--ic-purple); }
#theme-btn {
    background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; color: var(--qmf-text-muted); font-size: 16px;
    transition: background .15s, color .15s;
}
#theme-btn:hover { background: var(--qmf-surface); color: var(--ic-purple); }

/* ── Layout ── */
.container { max-width: 860px; margin: 0 auto; padding: 32px 20px 80px; }

/* ── Page title ── */
.page-title { margin-bottom: 32px; }
.title-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 8px;
}
.title-header h1 { font-size: 26px; font-weight: 800; color: var(--ic-purple); margin: 0; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ic-purple); text-decoration: none; font-size: 14px;
    font-weight: 600; padding: 6px 14px; border: 1.5px solid var(--ic-purple);
    border-radius: 20px; transition: background .15s;
}
.back-link:hover { background: var(--ic-purple-light); }
.subtitle { color: var(--qmf-text-muted); font-size: 15px; margin-top: 4px; }

/* ── Article ── */
.article {}

/* ── Section ── */
.section { margin-bottom: 36px; }
.section-title {
    font-size: 18px; font-weight: 700; color: var(--ic-ink);
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 2px solid var(--ic-gold-light);
}
[data-theme="dark"] .section-title { color: #e2e8f0; }
.section-title i { color: var(--ic-gold); }
.section-content p { margin: 0 0 10px; line-height: 1.75; color: var(--ic-text); }
[data-theme="dark"] .section-content p { color: #cbd5e1; }

/* ── Highlight box ── */
.highlight-box {
    background: var(--ic-gold-light);
    border-left: 4px solid var(--ic-gold);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px; margin: 16px 0;
}
.highlight-box strong { color: var(--ic-ink); }
[data-theme="dark"] .highlight-box strong { color: #f1f5f9; }

/* ── Method cards ── */
.method-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px; margin-top: 14px;
}
.method-card {
    border: 1.5px solid var(--ic-gold-light);
    border-radius: 12px; padding: 16px;
    background: var(--qmf-surface);
}
.method-card h4 {
    margin: 0 0 6px; font-size: 15px; font-weight: 700;
    color: var(--ic-purple); display: flex; align-items: center; gap: 8px;
}
.method-card p { margin: 0; font-size: 13.5px; color: var(--qmf-text-muted); line-height: 1.6; }
.method-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px; margin-bottom: 8px;
    background: var(--ic-purple-light); color: var(--ic-purple);
}

/* ── School grid ── */
.school-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px; margin-top: 14px;
}
.school-card {
    border-radius: 12px; padding: 16px;
    border: 1.5px solid var(--qmf-border);
    background: var(--qmf-surface);
}
.school-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--qmf-text); }
.school-card ul { margin: 0; padding-left: 18px; }
.school-card li { font-size: 13px; color: var(--qmf-text-muted); margin-bottom: 4px; }

/* ── Hexagram structure table ── */
.hex-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.hex-table th, .hex-table td {
    padding: 9px 14px; border: 1px solid var(--qmf-border);
    text-align: left;
}
.hex-table th { background: var(--ic-gold-light); color: var(--ic-ink); font-weight: 700; }
[data-theme="dark"] .hex-table th { color: #f1f5f9; }
.hex-table tr:nth-child(even) td { background: var(--qmf-surface); }

/* ── Data flow (share link pipeline) ── */
.pipeline {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 14px;
}
.pipe-step {
    background: var(--ic-purple-light); color: var(--ic-purple);
    border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px;
}
.pipe-arrow { color: var(--ic-gold); font-size: 18px; font-weight: 700; }

/* ── Architecture diagram ── */
.arch-box {
    border: 1.5px solid var(--qmf-border);
    border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    background: var(--qmf-surface); margin-top: 14px;
}
.arch-row {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch;
}
.arch-node {
    flex: 1; min-width: 120px; border-radius: 8px; padding: 12px 14px;
    font-size: 13px; font-weight: 600; text-align: center;
}
.arch-node.client { background: var(--ic-gold-light); color: #856404; }
.arch-node.server { background: var(--ic-purple-light); color: var(--ic-purple); }
.arch-node.engine { background: rgba(16,185,129,.12); color: #065f46; }
[data-theme="dark"] .arch-node.engine { color: #6ee7b7; }
.arch-node span { display: block; font-size: 11px; font-weight: 400; opacity: .8; margin-top: 3px; }
.arch-arrow-down { text-align: center; color: var(--ic-gold); font-size: 18px; }

/* ── Method deep-dive cards (historical section) ── */
.method-deep {
    transition: box-shadow .2s, transform .15s;
}
.method-deep:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
[data-theme="dark"] .method-deep:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.method-deep h4 { display: flex; align-items: center; gap: 8px; }
.method-deep ul, .method-deep ol { color: var(--ic-text); }
[data-theme="dark"] .method-deep ul,
[data-theme="dark"] .method-deep ol { color: #cbd5e1; }
.method-deep code {
    background: rgba(139,92,246,.12);
    color: var(--ic-purple);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* ── Prob table ── */
.prob-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.prob-table th, .prob-table td { padding: 8px 12px; border: 1px solid var(--qmf-border); text-align: center; }
.prob-table th { background: var(--ic-purple-light); color: var(--ic-purple); font-weight: 700; }
.prob-table td:first-child { text-align: left; font-weight: 600; }

/* ── Footer ── */
.page-footer {
    margin-top: 48px; padding-top: 20px;
    border-top: 1px solid var(--qmf-border);
    color: var(--qmf-text-muted); font-size: 13px; text-align: center;
}
.page-footer a { color: var(--ic-purple); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
