/* ═══════════════════════════════════════════
   HOME PAGE — assets/css/home.css
   Extracted from index.html inline <style>
   ───────────────────────────────────────────
   Design-token policy (2026-05-03 hardening):
   - 所有顏色與基礎變數的 source of truth 在 site.css :root 中。
   - 此處保留的 --color-* 變數，僅作為向首頁本地舊類名的「別名」，
     全部映射到 site.css 的全站變數，避免漂色。
   - 新增/修改顏色請改 site.css；本檔案只在頁面級語義（如 hero）繼續使用。
   ═══════════════════════════════════════════ */

/* ── Aliases · 與 site.css 全局 token 對齊 ── */
:root {
    --color-bg:           var(--bg, #050505);
    --color-cyan:         var(--cyan, #00F0FF);
    --color-gold:         var(--gold, #D4AF37);
    --color-red:          var(--brand-red, #C41E3A);
    --color-surface:      var(--bg-soft, rgba(255, 255, 255, 0.03));
    --color-text-muted:   var(--text-mute, #9ca3af);
    /* 為向後相容（其他組件可能直接引用）保留品牌紅色語義變數 */
    --brand-red:          #C41E3A;
}

/* ── Base ── */
html { height: 100%; }
body {
    background-color: var(--color-bg);
    color: white;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: scroll;
    margin: 0;
    height: 100%;
    /* 原為 `y mandatory` — 造成內容超過 100dvh 的 section
       （如學術方向 3 張卡）無法往下滾。改為 proximity：
       緩慢瀏覽仍會輕柔對齊，但不再強制阻擋往下滾動。 */
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}
.font-zen { font-family: 'Noto Serif SC', 'Source Han Serif CN', 'STSong', 'SimSun', serif; }
.font-cyber { font-family: 'Cinzel', 'Noto Serif SC', 'Source Han Serif CN', 'STFangsong', serif; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* ── Buttons ── */
.btn-cyber {
    background: transparent;
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
}
.btn-cyber:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    letter-spacing: 2px;
    color: white;
}
.btn-cyber:focus-visible {
    outline: 2px solid rgba(0, 240, 255, 0.45);
    outline-offset: 2px;
}
.btn-gold {
    border-color: var(--color-gold) !important;
    color: var(--color-gold) !important;
}
.btn-gold:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4) !important;
    color: white !important;
}

@media (max-width: 768px) {
    .demo-actions { flex-direction: column; }
    .demo-actions .btn-cyber { width: 100%; }
}

/* ── Loader ── */
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 1s ease;
}

/* ── Cosmos Background ── */
#cosmos-bg {
    position: fixed;
    inset: 0;
    z-index: -5;
    pointer-events: none;
    background:
        radial-gradient(120% 84% at 50% 15%, rgba(74, 112, 210, 0.4), transparent 52%),
        radial-gradient(92% 58% at 50% 46%, rgba(156, 96, 210, 0.32), transparent 64%),
        linear-gradient(to bottom, #040814 0%, #04050b 45%, #020206 100%);
}
#cosmos-stars-a,
#cosmos-stars-b {
    position: fixed;
    inset: -6%;
    pointer-events: none;
    transform-origin: center;
    z-index: -4;
    mix-blend-mode: screen;
}
#cosmos-stars-a {
    background-image:
        radial-gradient(circle, rgba(216, 232, 255, 0.45) 0.7px, transparent 1.35px),
        radial-gradient(circle, rgba(152, 192, 255, 0.26) 0.8px, transparent 1.6px);
    background-size: 220px 220px, 330px 330px;
    background-position: 0 0, 110px 140px;
    opacity: 0.36;
    animation: sky-drift-a 180s linear infinite;
}
#cosmos-stars-b {
    z-index: -3;
    background-image:
        radial-gradient(circle, rgba(216, 184, 255, 0.22) 0.75px, transparent 1.5px),
        radial-gradient(circle, rgba(180, 212, 255, 0.18) 0.65px, transparent 1.35px);
    background-size: 260px 260px, 380px 380px;
    background-position: 50px 90px, 170px 60px;
    opacity: 0.22;
    animation: sky-drift-b 260s linear infinite;
}
#starry-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 50% 28%, rgba(112, 146, 255, 0.14), transparent 44%),
        radial-gradient(circle at 50% 66%, rgba(176, 124, 245, 0.12), transparent 50%),
        linear-gradient(to bottom, rgba(3, 6, 18, 0.52), rgba(1, 1, 6, 0.87));
    pointer-events: none;
}
#earth-horizon {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 28vh;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(130% 85% at 50% 120%, rgba(0,0,0,0.9), rgba(0,0,0,0.74) 52%, transparent 72%),
        linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.26) 42%, transparent 80%);
}
#earth-horizon::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(140, 195, 255, 0.26), transparent);
    opacity: 0.7;
}
@keyframes sky-drift-a {
    from { transform: rotate(0deg) scale(1.08); }
    to { transform: rotate(360deg) scale(1.08); }
}
@keyframes sky-drift-b {
    from { transform: rotate(0deg) scale(1.12); }
    to { transform: rotate(-360deg) scale(1.12); }
}
/* 显式 GPU 层，避免每帧重绘整个背景 */
#cosmos-stars-a,
#cosmos-stars-b {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}
/* 用户系统偏好"减少动效"时关闭，省电、省 CPU、避免眩晕 */
@media (prefers-reduced-motion: reduce) {
    #cosmos-stars-a,
    #cosmos-stars-b {
        animation: none !important;
    }
}
/* 移动端关闭背景缓慢旋转，移动设备 GPU 拉这两个图层很吃电 */
@media (max-width: 768px) {
    #cosmos-stars-a,
    #cosmos-stars-b {
        animation: none !important;
        opacity: 0.18;
    }
}

/* ── Cards ── */
.card-glow:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
}
.card-base {
    background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border: 1px solid rgba(255,255,255,0.08);
}
.img-cover {
    width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
.card-icon { transition: transform 0.3s ease; }
.card-base:hover .card-icon { transform: scale(1.1); }

/* ── Spin Animations ── */
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
.animate-spin-slow { animation: spin-slow linear infinite; }
.animate-spin-reverse { animation: spin-reverse linear infinite; }

/* ── Master Profile ── */
.master-menu-item {
    font-size: 0.9rem; color: rgba(200,210,220,0.45); transition: all 0.3s;
    border-bottom: 1px solid transparent; padding-bottom: 4px;
    cursor: pointer; letter-spacing: 2px; text-decoration: none;
}
.master-menu-item:hover { color: var(--color-gold); border-bottom-color: var(--color-gold); }
.master-profile-section { padding-top: 0; padding-bottom: 0; }
.master-profile-layout { align-items: center; }
.master-portrait-shell {
    width: 17rem; height: 17rem;
    --portrait-x: 50%; --portrait-y: 38%;
    border-radius: 9999px;
    border: 1px solid rgba(117, 161, 255, 0.28);
    position: relative; overflow: hidden; padding: 0.35rem;
    background: radial-gradient(circle at 35% 25%, rgba(98, 82, 228, 0.26), rgba(3, 6, 12, 0.82));
    box-shadow: 0 0 60px rgba(68, 104, 255, 0.22), inset 0 0 40px rgba(0, 0, 0, 0.5);
}
@media (min-width: 768px) {
    .master-portrait-shell { width: 18.5rem; height: 18.5rem; }
}
.master-portrait-shell::before {
    content: "";
    position: absolute; inset: -12%;
    border-radius: 9999px;
    border: 1px dashed rgba(162, 122, 245, 0.3);
    animation: spin-slow 24s linear infinite;
}
.master-portrait-shell::after {
    content: "";
    position: absolute; inset: 8%;
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: inset 0 0 18px rgba(212, 175, 55, 0.12);
}
.master-portrait-image {
    width: 100%; height: 100%;
    border-radius: 9999px;
    object-fit: cover;
    object-position: var(--portrait-x) var(--portrait-y);
    position: relative; z-index: 2;
    transition: transform 0.7s ease;
}
.master-portrait-shell:hover .master-portrait-image { transform: scale(1.04); }
.heritage-claim {
    border-left: 2px solid rgba(212, 175, 55, 0.55);
    background: rgba(255, 255, 255, 0.02);
}
.case-shell {
    border: 1px solid rgba(130, 154, 255, 0.24);
    background: linear-gradient(160deg, rgba(9, 12, 20, 0.86), rgba(5, 7, 13, 0.74));
}
.case-card {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

/* ── Full-screen Sections ── */
.full-screen-section {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding-top: clamp(68px, 9vh, 88px);
    padding-bottom: clamp(20px, 3vh, 36px);
    box-sizing: border-box; overflow: visible;
}
.content-section {
    min-height: 100dvh;
    display: flex; flex-direction: column; justify-content: center;
    padding-top: clamp(64px, 8vh, 96px);
    padding-bottom: clamp(48px, 6vh, 80px);
    box-sizing: border-box; overflow: visible;
}
.full-screen-section,
.content-section {
    scroll-snap-align: start;
    /* 原為 `always` — 快速滾動時強制在每個 section 停下。
       改為 normal：讓快速滾動能自然穿越多個 section。 */
    scroll-snap-stop: normal;
}
.content-section > .container { width: 100%; }

/* ── Direction Tags ── */
.direction-tag {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
    color: #b6c0cc; letter-spacing: 0.12em;
}
.direction-tag:hover {
    border-color: rgba(0, 240, 255, 0.45);
    color: #d8f8ff; background: rgba(0, 240, 255, 0.08);
}
.hero-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text-muted);
}

/* ── Hero ── */
.hero-kicker {
    position: relative;
    border: 1px solid rgba(167, 186, 255, 0.2);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(38, 47, 88, 0.95), rgba(15, 19, 36, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(54, 68, 124, 0.7),
        0 10px 24px rgba(0, 0, 0, 0.34),
        0 4px 0 rgba(8, 10, 20, 0.9);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.hero-kicker::before {
    content: "";
    position: absolute; inset: 1px 1px auto 1px;
    height: 42%;
    border-radius: 3px 3px 8px 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    pointer-events: none;
}
.hero-kicker:hover {
    transform: translateY(-3px);
    border-color: rgba(103, 220, 255, 0.52);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(78, 110, 196, 0.88),
        0 16px 32px rgba(0, 0, 0, 0.46),
        0 6px 0 rgba(8, 10, 20, 0.96),
        0 0 22px rgba(88, 160, 255, 0.16);
}
.hero-shell { gap: clamp(1rem, 2vh, 1.75rem); }
.hero-copy { max-width: min(92vw, 58rem); }
.hero-intro {
    max-width: 64rem; line-height: 2;
    letter-spacing: 0.06em;
    color: rgba(220, 226, 240, 0.92);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-signal-stage {
    position: relative; z-index: 1;
    width: min(100%, 78rem);
    margin-top: clamp(14px, 2.5vh, 24px);
    padding: clamp(22px, 3.2vw, 38px) clamp(20px, 3.5vw, 40px) clamp(18px, 3vw, 30px);
    border: 1px solid rgba(0, 200, 255, 0.15);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(8, 12, 24, 0.92), rgba(4, 6, 14, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(0,200,255,0.06),
        0 20px 48px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
}
.hero-signal-stage::before {
    content: "";
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 160' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%2300c8ff' stop-opacity='0'/%3E%3Cstop offset='0.2' stop-color='%2300c8ff' stop-opacity='0.5'/%3E%3Cstop offset='0.75' stop-color='%2300d4aa' stop-opacity='0.4'/%3E%3Cstop offset='1' stop-color='%23c9a84c' stop-opacity='0.6'/%3E%3C/linearGradient%3E%3ClinearGradient id='g2' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2300c8ff' stop-opacity='0.08'/%3E%3Cstop offset='1' stop-color='%2300c8ff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 140 L60 132 L110 136 L160 125 L220 128 L280 118 L340 122 L400 108 L460 114 L510 100 L560 104 L610 92 L660 96 L710 80 L760 85 L810 70 L860 74 L910 58 L960 62 L1010 48 L1060 52 L1110 40 L1160 36 L1200 28 L1200 160 L0 160 Z' fill='url(%23g2)'/%3E%3Cpolyline points='0,140 60,132 110,136 160,125 220,128 280,118 340,122 400,108 460,114 510,100 560,104 610,92 660,96 710,80 760,85 810,70 860,74 910,58 960,62 1010,48 1060,52 1110,40 1160,36 1200,28' fill='none' stroke='url(%23g1)' stroke-width='1.5'/%3E%3Crect x='58' y='118' width='6' height='18' fill='%2300c8ff' fill-opacity='0.12' rx='1'/%3E%3Crect x='158' y='108' width='6' height='20' fill='%2300c8ff' fill-opacity='0.1' rx='1'/%3E%3Crect x='278' y='100' width='6' height='22' fill='%2300c8ff' fill-opacity='0.1' rx='1'/%3E%3Crect x='398' y='88' width='6' height='24' fill='%2300d4aa' fill-opacity='0.12' rx='1'/%3E%3Crect x='508' y='78' width='6' height='26' fill='%2300d4aa' fill-opacity='0.1' rx='1'/%3E%3Crect x='608' y='68' width='6' height='28' fill='%2300d4aa' fill-opacity='0.1' rx='1'/%3E%3Crect x='708' y='55' width='6' height='30' fill='%23c9a84c' fill-opacity='0.12' rx='1'/%3E%3Crect x='808' y='44' width='6' height='32' fill='%23c9a84c' fill-opacity='0.12' rx='1'/%3E%3Crect x='908' y='32' width='6' height='32' fill='%23c9a84c' fill-opacity='0.14' rx='1'/%3E%3Crect x='1008' y='22' width='6' height='32' fill='%23c9a84c' fill-opacity='0.16' rx='1'/%3E%3Crect x='1108' y='12' width='6' height='34' fill='%23c9a84c' fill-opacity='0.18' rx='1'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-position: bottom;
    opacity: 0.55;
    mix-blend-mode: screen;
    pointer-events: none;
}
.hero-signal-stage::after { content: none; }
.hero-shortcuts {
    position: relative; z-index: 1;
    margin-top: 0; margin-bottom: clamp(10px, 1.5vh, 18px);
}
.hero-logic {
    position: relative; z-index: 1;
    margin-top: 0; width: min(100%, 72rem);
}
.soft-panel {
    background: rgba(8, 10, 14, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(5px);
}
.hero-main {
    text-shadow: 0 0 40px rgba(120, 160, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.12; color: #ffffff;
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    letter-spacing: 0.11em;
}
.hero-main span:first-child { white-space: nowrap; }
.hero-main span:last-child {
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    display: block;
}
.section-title { letter-spacing: 0.05em; text-wrap: balance; }

/* sec-title-en: only visible in EN mode */
body:not(.lang-en) .sec-title-en { display: none; }

/* ── Logic Chain ── */
.logic-chain-wrap { position: relative; z-index: 1; }
.logic-chain-label {
    font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace;
    font-size: 0.55rem; letter-spacing: 0.38em;
    color: rgba(0, 200, 255, 0.4);
    text-transform: uppercase;
    margin-bottom: 14px; text-align: center;
}
.logic-chain-row { display: flex; align-items: stretch; gap: 0; width: 100%; }
.chain-node {
    flex: 1; position: relative;
    padding: 18px 14px 16px;
    background: linear-gradient(160deg, rgba(10, 16, 32, 0.92), rgba(5, 8, 18, 0.96));
    border: 1px solid rgba(0, 200, 255, 0.12);
    border-left: 2px solid rgba(0, 200, 255, 0.25);
    border-radius: 3px; text-align: center;
    transition: border-color 0.25s, background 0.25s, transform 0.2s;
    overflow: hidden;
}
.chain-node:hover {
    border-left-color: rgba(0, 200, 255, 0.7);
    border-color: rgba(0, 200, 255, 0.25);
    background: linear-gradient(160deg, rgba(14, 22, 48, 0.96), rgba(8, 12, 28, 0.98));
    transform: translateY(-2px);
}
.chain-node.chain-node-gold { border-left-color: rgba(212, 175, 55, 0.5); border-color: rgba(212, 175, 55, 0.2); }
.chain-node.chain-node-gold:hover { border-left-color: rgba(212, 175, 55, 0.9); border-color: rgba(212, 175, 55, 0.35); }
.chain-num {
    display: block;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.52rem; color: rgba(0, 200, 255, 0.35);
    letter-spacing: 0.22em; margin-bottom: 8px;
}
.chain-node-gold .chain-num { color: rgba(212, 175, 55, 0.4); }
.chain-name {
    display: block; font-size: 1rem; font-weight: 300;
    color: rgba(210, 228, 248, 0.9);
    letter-spacing: 0.12em; line-height: 1.3;
    font-family: 'Noto Serif SC', 'STSong', serif;
}
.chain-node-gold .chain-name { color: #e8c96a; font-weight: 400; }
.chain-arrow {
    flex: 0 0 auto; display: flex;
    align-items: center; justify-content: center;
    width: 32px; color: rgba(0, 200, 255, 0.5);
    font-size: 1rem; position: relative; letter-spacing: 0;
}
.chain-arrow::before {
    content: ''; position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,200,255,0.08), rgba(0,200,255,0.22), rgba(0,200,255,0.08));
    transform: translateY(-50%);
}
.chain-shortcuts-row {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chain-shortcut-link {
    display: flex; align-items: center; gap: 6px; padding: 0 24px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.72rem; letter-spacing: 0.14em;
    color: rgba(160, 185, 215, 0.6);
    text-decoration: none; transition: color 0.2s;
    position: relative;
}
.chain-shortcut-link:not(:first-child)::before {
    content: ''; position: absolute;
    left: 0; top: 15%; bottom: 15%;
    width: 1px; background: rgba(255,255,255,0.1);
}
.chain-shortcut-link:hover { color: rgba(0, 220, 255, 0.9); }
.chain-shortcut-link:last-child:hover { color: rgba(212, 175, 55, 0.9); }
.chain-shortcut-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: currentColor; opacity: 0.6; flex-shrink: 0;
}
@media (max-width: 768px) {
    .chain-arrow { display: none; }
    .logic-chain-row { flex-direction: column; gap: 6px; }
    .chain-shortcuts-row { flex-direction: column; gap: 8px; }
    .chain-shortcut-link::before { display: none; }
    .chain-shortcut-link { padding: 4px 0; }
}
.logic-strip { display:none; }
.logic-node, .logic-arrow { display:none; }

/* ── Demo Section ── */
.demo-shell {
    border: 1px solid rgba(125, 149, 255, 0.26);
    background: linear-gradient(160deg, rgba(10, 13, 20, 0.88), rgba(5, 8, 14, 0.72));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.demo-player-wrap {
    position: relative;
    border: 1px solid rgba(110, 200, 255, 0.24);
    background: #05070d; overflow: hidden;
}
.demo-player-wrap::before {
    content: ""; position: absolute; inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 30% 20%, rgba(122, 95, 255, 0.12), transparent 45%);
}
.demo-player { width: 100%; aspect-ratio: 16 / 9; display: block; background: #03050a; }
.demo-note {
    border-left: 2px solid rgba(67, 211, 255, 0.58);
    background: rgba(255, 255, 255, 0.02);
}
.demo-tag {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
}
.demo-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.demo-actions .btn-cyber { min-width: 152px; text-align: center; justify-content: center; }

/* ── Language Variants ── */
body.lang-cn .hero-main { font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.12; letter-spacing: 0.11em; }
body.lang-cn .hero-main span:first-child { white-space: nowrap; }
body.lang-cn .section-title { font-family: 'Noto Serif SC', serif; font-weight: 600; letter-spacing: 0.08em; }
body.lang-cn .hero-kicker { border-color: rgba(176, 124, 245, 0.28); color: #d7dcf6; }

body.lang-en .hero-main { font-size: clamp(1.85rem, 4.2vw, 3.6rem); letter-spacing: 0.02em; line-height: 1.18; }
body.lang-en .hero-main span:first-child { white-space: normal; text-wrap: balance; display: block; }
body.lang-en .hero-intro { font-family: 'Inter', sans-serif; font-size: 0.96rem; line-height: 1.85; letter-spacing: 0.01em; color: rgba(209, 213, 219, 0.9); max-width: 56rem; }
body.lang-en .section-title { font-family: 'Cinzel', serif; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: 0.06em; }
body.lang-en .hero-badge span:last-child { letter-spacing: 0.18em; font-size: 9px; }
body.lang-en #engine p,
body.lang-en #methodology p,
body.lang-en #cases p { font-family: 'Inter', sans-serif; font-size: 0.875rem; line-height: 1.75; letter-spacing: 0.01em; }
body.lang-en #master-profile h3 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); letter-spacing: 0.06em; }
body.lang-en .master-menu-item { font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 0.18em; }
body.lang-en .heritage-claim { font-family: 'Inter', sans-serif; font-size: 0.82rem; line-height: 1.8; }
body.lang-en .grid .text-xs.uppercase { font-size: 0.6rem; letter-spacing: 0.12em; line-height: 1.4; }
body.lang-en .nav-item a,
body.lang-en .glass-nav a { letter-spacing: 0.1em; }
body.lang-en .chain-name { font-size: 0.7rem; letter-spacing: 0.04em; }
body.lang-en .hero-main span:last-child { font-size: 1.1em; letter-spacing: 0.08em; }
body.lang-en .hero-copy { max-width: min(90vw, 680px); }
body.lang-en .btn-cyber { letter-spacing: 0.2em; }

/* ── Mobile Overrides ── */
@media (max-width: 768px) {
    html, body { scroll-snap-type: none; overflow-y: auto; height: auto; }
    .full-screen-section {
        height: auto; min-height: auto; max-height: none;
        padding-top: 96px; padding-bottom: 60px;
        scroll-snap-align: none; scroll-snap-stop: normal;
    }
    .content-section {
        height: auto; min-height: auto; max-height: none;
        display: block; padding-top: 80px; padding-bottom: 64px;
        overflow: visible; scroll-snap-align: none; scroll-snap-stop: normal;
    }
    .master-profile-layout { min-height: auto; }
    .master-profile-layout { flex-direction: column !important; gap: 2rem !important; }
    .hero-copy { max-width: 100%; }
    .hero-intro { max-width: 100%; line-height: 1.82; letter-spacing: 0.03em; }
    .hero-main { overflow-wrap: anywhere; text-wrap: balance; }
    .hero-main span:first-child,
    body.lang-cn .hero-main span:first-child { white-space: normal; }
    body.lang-cn .hero-main { letter-spacing: 0.05em; font-size: clamp(2rem, 12vw, 3.1rem); }
    body.lang-cn .hero-main span:last-child { font-size: clamp(2.2rem, 13vw, 3.4rem); }
    .hero-intro .block,
    .hero-intro span { display: inline; }
    .hero-signal-stage { margin-top: 20px; padding: 18px 12px 16px; width: 100%; }
    .logic-chain-label { letter-spacing: 0.18em; line-height: 1.4; }
    .chain-node { min-height: 42px; padding: 10px 12px; }
    .chain-name { overflow-wrap: anywhere; }
    .chain-shortcut-link { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
    .full-screen-section { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
    .hero-shell { gap: 0.85rem; }
    .hero-copy { margin-bottom: 0.75rem !important; }
    .hero-intro { font-size: 0.9rem; line-height: 1.72; }
    .hero-signal-stage { padding: 14px 10px; }
    .logic-chain-row { gap: 5px; }
    .chain-node { min-width: 0; }
    .chain-shortcuts-row { margin-top: 10px; }
    .master-portrait-shell { width: min(72vw, 15rem); height: min(72vw, 15rem); }
    .sec-eyebrow { letter-spacing: 0.22em; }
    .sec-eyebrow::before,
    .sec-eyebrow::after { width: 24px; }
    .sec-title { letter-spacing: 0.16em; }
}

#mobile-menu { transform: translateX(100%); transition: transform 0.3s ease-in-out; }
#mobile-menu.open { transform: translateX(0); }

#methodology .demo-shell { overflow: visible; }
#methodology .demo-player-wrap { overflow: hidden; }
#methodology .demo-player { width: 100%; aspect-ratio: 16/9; display: block; }
#engine .grid { align-items: stretch; }
footer { scroll-snap-align: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ═══ Block 2: Section Header System ═══ */
@keyframes astro-blink{0%,100%{opacity:1}50%{opacity:0.12}}

.sec-header { text-align: center; padding: 2.5rem 1rem 2rem; }
.sec-eyebrow {
    display: inline-flex; align-items: center; gap: 0.75rem;
    font-size: 0.52rem; letter-spacing: 0.42em;
    color: rgba(0,240,255,0.52); text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 1.1rem;
}
.sec-eyebrow::before {
    content: ''; display: block; width: 40px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,240,255,0.5));
}
.sec-eyebrow::after {
    content: ''; display: block; width: 40px; height: 1px;
    background: linear-gradient(90deg, rgba(0,240,255,0.5), transparent);
}
.sec-title {
    font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 300;
    color: #ffffff; letter-spacing: 0.28em; line-height: 1.15;
    margin-bottom: 0;
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    text-shadow: 0 0 60px rgba(0,240,255,0.15), 0 0 120px rgba(0,240,255,0.06), 0 4px 24px rgba(0,0,0,0.7);
}
.sec-title-en {
    font-family: 'Cinzel', 'Noto Serif SC', serif !important;
    font-size: clamp(0.52rem, 0.9vw, 0.65rem) !important;
    letter-spacing: 0.45em !important;
    color: rgba(0,240,255,0.38) !important;
    font-weight: 400 !important;
    margin-top: 0.7rem !important;
    display: block;
    text-transform: uppercase;
}
.sec-rule {
    width: 1px; height: 32px;
    background: linear-gradient(to bottom, rgba(0,240,255,0.6), transparent);
    margin: 0.8rem auto;
}
.sec-subtitle {
    color: rgba(185,195,215,0.82);
    font-size: clamp(0.82rem, 1.3vw, 0.92rem);
    line-height: 1.85; max-width: 600px; margin: 0 auto;
    font-family: 'Noto Serif SC', serif; letter-spacing: 0.04em;
}
.sec-eyebrow.gold { color: rgba(212,175,55,0.55); }
.sec-eyebrow.gold::before,
.sec-eyebrow.gold::after { background: rgba(212,175,55,0.3); }
.sec-rule.gold { background: linear-gradient(to bottom, rgba(212,175,55,0.5), transparent); }

section { position: relative; }
#methodology .demo-shell { overflow: visible; }
#cases { min-height: auto; }

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

#master-profile::after,
#engine::after,
#methodology::after {
    content: ''; display: block; position: absolute;
    bottom: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,240,255,0.08), transparent);
    pointer-events: none;
}

.engine-card, .research-card {
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.engine-card:hover, .research-card:hover { transform: translateY(-2px); }

@media(max-width:768px) {
    .content-section { min-height: auto; padding-top: 3rem; padding-bottom: 3rem; }
    #methodology { padding: 2.5rem 0 2rem; }
}

/* ═══ Block 3: Market Terminal ═══ */
@keyframes mi-spin { to { transform: rotate(360deg); } }

@media(max-width:960px){
    [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr !important; }
    .mi-main-grid { grid-template-columns: 1fr !important; }
    .mi-main-grid > div:first-child {
        min-height: 400px;
        border-right: none !important;
        border-bottom: 1px solid rgba(0,240,255,0.1);
    }
    .mi-main-grid > div:last-child { max-height: 360px; }
    #astro-zc { display: none !important; }
    #astro-main-wrap [style*="flex:0 0 320px"] { display: none !important; }
    #track-record [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2,1fr) !important;
    }
}

@media(max-width:640px){
    .mi-main-grid { height: auto !important; min-height: 0 !important; }
    .mi-main-grid > div:first-child { min-height: 320px; }
    .mi-main-grid > div:last-child { max-height: 300px; }
    .mi-tab { font-size: .5rem; letter-spacing: .01em; white-space: normal; line-height: 1.25; }
    .mi-row { grid-template-columns: minmax(0,1fr) 46px 54px; padding: .42rem .58rem; }
    .mi-row-name, .mi-row-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.mi-tab {
    padding: 0.55rem 0.2rem; background: none; border: none;
    border-right: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; font-size: 0.56rem;
    color: rgba(180,190,210,0.45);
    font-family: 'Noto Serif SC', 'STSong', serif;
    letter-spacing: 0.04em; transition: all 0.18s;
    position: relative; white-space: nowrap;
}
.mi-tab:last-child { border-right: none; }
.mi-tab::after {
    content: ''; position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #00f0ff, transparent);
    transform: scaleX(0); transition: transform 0.2s;
}
.mi-tab.active { color: #e2e8f0; background: rgba(0,240,255,0.04); }
.mi-tab.active::after { transform: scaleX(1); }
.mi-tab:hover { color: rgba(200,215,235,0.75); background: rgba(0,240,255,0.02); }

.mi-list-group {
    padding: 0.25rem 0.85rem 0.15rem; font-size: 0.48rem;
    letter-spacing: 0.2em; color: rgba(107,114,128,0.42);
    text-transform: uppercase;
    font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 0.15rem; background: rgba(0,0,0,0.25);
}
.mi-list-group:first-child { margin-top: 0; border-top: none; }

.mi-row {
    display: grid; grid-template-columns: 1fr 52px 60px;
    align-items: center; padding: 0.35rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s, border-left 0.15s;
    border-left: 2px solid transparent;
}
.mi-row:hover { background: rgba(0,240,255,0.04); border-left-color: rgba(0,240,255,0.25); }
.mi-row.active { background: rgba(0,240,255,0.07); border-left-color: rgba(0,240,255,0.7); padding-left: calc(0.85rem - 0px); }
.mi-row-info { display: flex; flex-direction: column; gap: 2px; }
.mi-row-name { font-size: 0.78rem; color: #c8d0dc; font-family: 'Noto Serif SC', 'STSong', serif; letter-spacing: 0.03em; }
.mi-row.active .mi-row-name { color: #e8eef6; font-weight: 500; }
.mi-row-code { font-size: 0.46rem; color: rgba(107,114,128,0.5); font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace; letter-spacing: 0.05em; }
.mi-row.active .mi-row-code { color: rgba(0,240,255,0.45); }
.mi-row-chg { font-size: 0.65rem; font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace; text-align: right; letter-spacing: 0.04em; }
.mi-row-chg.neutral { color: rgba(107,114,128,0.5); }
.mi-row-chg.up { color: #22c55e; }
.mi-row-chg.down { color: #ef4444; }
.mi-row-period { font-size: 0.54rem; color: rgba(0,240,255,0.4); font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace; text-align: right; letter-spacing: 0.04em; line-height: 1.3; }

/* ══════════════════════════════════════════════════════════
   Tailwind CDN replacement · 完整取代 index.html 實際用到的 utility
   效益：移除 150 KB tailwindcss.com CDN，首頁 FCP 降低 0.5~2 秒
══════════════════════════════════════════════════════════ */

/* Layout · Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.bottom-6 { bottom: 1.5rem; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.-translate-y-1\/2 { transform: translateY(-50%); }

/* Layout · Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flex */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-white { color: #fff; }
.text-black { color: #000; }
.text-transparent { color: transparent; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-mono { font-family: "JetBrains Mono", "Courier New", monospace; }
.font-serif { font-family: "Noto Serif SC", "STSong", serif; }

/* Sizing */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-1\/2 { width: 50%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-auto { height: auto; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.min-h-screen { min-height: 100vh; }

.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; margin-left: auto; margin-right: auto; }
.max-w-6xl { max-width: 72rem; margin-left: auto; margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Z-index */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Pointer */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.cursor-pointer { cursor: pointer; }

/* Border */
.border { border: 1px solid; }
.border-t { border-top: 1px solid; }
.border-b { border-bottom: 1px solid; }
.border-l { border-left: 1px solid; }
.border-r { border-right: 1px solid; }
.border-gray-800 { border-color: #1f2937; }
.border-gray-900 { border-color: #111827; }

/* Background */
.bg-black { background-color: #000; }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8); }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5); }

/* Rounded */
.rounded { border-radius: .25rem; }
.rounded-md { border-radius: .375rem; }
.rounded-lg { border-radius: .5rem; }
.rounded-xl { border-radius: .75rem; }
.rounded-full { border-radius: 9999px; }

/* Animations */
@keyframes tw-bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); }
  50%      { transform: translateY(0);    animation-timing-function: cubic-bezier(0, 0, .2, 1); }
}
.animate-bounce { animation: tw-bounce 1s infinite; }
@keyframes tw-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}
.animate-pulse { animation: tw-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes tw-spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}
.animate-spin { animation: tw-spin 1s linear infinite; }

/* Padding / Margin (common) */
.p-0 { padding: 0; }
.p-1 { padding: .25rem; }
.p-2 { padding: .5rem; }
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.m-0 { margin: 0; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

/* Responsive — only md (>=768px) */
@media (min-width: 768px) {
  .md\:w-1\/2 { width: 50%; }
  .md\:w-1\/3 { width: 33.333%; }
  .md\:flex { display: flex; }
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* body antialiased + selection color */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgb(6, 182, 212); color: #000; }

/* Tailwind JIT arbitrary value fallback:
   <div class="bg-[radial-gradient(...)]"> can't be replaced by a class.
   Instead, the radial-gradient hero background is kept as inline style. */
