/* ============================================================
   Rux 项目主页 — 设计系统(浅色)
   风格基准:light-mode-paper-technical(纸白底、高对比、克制的强调色)
   约束:双色系(主强调橙 / 次强调蓝)、等宽字体承载一切数字、8px 间距倍数
   例外:终端窗与代码块保持深色(浅色页配深色代码块的标准做法)
   ============================================================ */

:root {
    --bg: #f6f7f9;
    --bg-elev: #ffffff;
    --panel: #ffffff;
    --panel-2: #f1f3f6;
    --border: #e4e8ee;
    --border-strong: #ccd3dd;
    --text: #1b2330;
    --text-2: #4a5568;
    --text-3: #8791a0;
    --accent: #e8590c;
    --accent-2: #d9480f;
    --cyan: #1971c2;
    --green: #0b8a5f;
    --yellow: #b7791f;
    --red: #d64545;
    --radius: 14px;
    --radius-sm: 9px;
    --nav-h: 60px;
    --container: 1180px;
    --font: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, 'Noto Sans Mono CJK SC', monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }

body {
    font-family: var(--font);
    line-height: 1.78;
    color: var(--text);
    background:
        radial-gradient(1100px 480px at 80% -8%, rgba(25, 113, 194, 0.055), transparent 60%),
        radial-gradient(900px 420px at 6% -6%, rgba(232, 89, 12, 0.05), transparent 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(232, 89, 12, 0.22); }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.32; font-weight: 700; letter-spacing: 0.01em; }

p { color: var(--text-2); }
strong { color: var(--text); }

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: #eef1f5;
    border: 1px solid #e0e5ec;
    border-radius: 5px;
    padding: 1px 6px;
    color: #b04a12;
    white-space: nowrap;
}

pre {
    position: relative;
    background: #0d1420;
    border: 1px solid #232c3d;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    overflow-x: auto;
    margin: 18px 0;
    font-size: 0.875rem;
    line-height: 1.65;
    box-shadow: 0 6px 20px rgba(23, 29, 41, 0.10);
}
pre code {
    background: none; border: none; padding: 0; color: #c8d3e8;
    white-space: pre; font-size: 1em;
}
pre .c { color: #5f6b80; }        /* 注释 */
pre .p { color: #7cc4f8; }        /* 提示符/命令 */
pre .k { color: #ff9d66; }        /* 关键字 */
pre .s { color: #8ce2ae; }        /* 字符串/输出 */

.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: #1a2333; color: #8791a0;
    border: 1px solid #2c374b; border-radius: 6px;
    font-size: 12px; padding: 3px 10px; cursor: pointer;
    font-family: var(--font); opacity: 0; transition: opacity 0.15s;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: #e6eaf2; border-color: #44506a; }

/* ---------- 导航 ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--container); margin: 0 auto; height: 100%;
    padding: 0 24px; display: flex; align-items: center; gap: 28px;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: 0.02em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo .crab {
    display: inline-flex; width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    align-items: center; justify-content: center; font-size: 15px;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
    color: var(--text-2); font-size: 14px; padding: 6px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: rgba(27, 35, 48, 0.06); text-decoration: none; }
.nav-links a.nav-cta {
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 600; margin-left: 8px;
    box-shadow: 0 3px 12px rgba(232, 89, 12, 0.28);
}
.nav-links a.nav-cta:hover { filter: brightness(1.06); }

/* ---------- 布局 ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
main { padding-top: var(--nav-h); }
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }

.sec-head { margin-bottom: 40px; max-width: 780px; }
.sec-head .kicker {
    font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.14em;
    color: var(--accent); text-transform: uppercase; display: block; margin-bottom: 10px;
}
.sec-head h2 { font-size: 30px; margin-bottom: 12px; }
.sec-head p { font-size: 16px; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 {
    font-size: 52px; letter-spacing: 0.01em; margin: 18px 0 20px;
}
.hero h1 .grad {
    background: linear-gradient(100deg, #d9480f 5%, #e8590c 45%, #1971c2 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 18px; max-width: 560px; color: var(--text-2); }
.hero .lede b { color: var(--text); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 10px; font-size: 15px; font-weight: 600;
    border: 1px solid var(--border-strong); color: var(--text);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none; color: #fff; box-shadow: 0 6px 20px rgba(232, 89, 12, 0.30);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(232, 89, 12, 0.40); }
.btn-ghost { background: #fff; }
.btn-ghost:hover { background: var(--panel-2); }

/* 终端窗口(保持深色) */
.terminal {
    background: #0d1420; border: 1px solid #232c3d;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 24px 60px rgba(23, 29, 41, 0.22);
    font-family: var(--mono); font-size: 12.8px; line-height: 1.7;
}
.terminal-bar {
    display: flex; gap: 7px; padding: 11px 14px;
    background: #111a2b; border-bottom: 1px solid #232c3d;
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: auto; color: #5f6b80; font-size: 11.5px; }
.terminal-body { padding: 16px 18px; color: #aab6cc; }
.terminal-body .ln { white-space: pre; }
.terminal-body .ok { color: #3ddc97; }
.terminal-body .warn { color: #fbbf24; }
.terminal-body .hi { color: #4fc3f7; }
.terminal-body .acc { color: #ff7a33; }
.terminal-body .dim { color: #566074; }

/* ---------- 数字条 ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.stat {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 18px; text-align: center;
    box-shadow: 0 2px 10px rgba(23, 29, 41, 0.05);
}
.stat .v {
    font-family: var(--mono); font-size: 27px; font-weight: 700; color: var(--text);
    letter-spacing: -0.01em;
}
.stat .v em { font-style: normal; color: var(--accent); }
.stat .l { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card-grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(23, 29, 41, 0.05);
}
.card:hover {
    border-color: rgba(232, 89, 12, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(23, 29, 41, 0.10);
}
.card h3 { font-size: 17.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.card h3 .ico {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(232, 89, 12, 0.10); font-size: 17px;
}
.card p { font-size: 14.5px; }
.card .more { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--cyan); }
.card .nums {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
    font-family: var(--mono); font-size: 12.5px; color: var(--text-3);
}
.card .nums b { color: var(--cyan); font-weight: 600; }

/* ---------- 截图画廊 ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shot {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color 0.15s, transform 0.15s;
    box-shadow: 0 2px 10px rgba(23, 29, 41, 0.05);
}
.shot:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.shot img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; cursor: zoom-in; background: #0d1420; }
.shot .cap { padding: 14px 16px; }
.shot .cap .t { font-size: 14.5px; font-weight: 600; color: var(--text); }
.shot .cap .d { font-size: 12.5px; color: var(--text-3); margin-top: 3px; font-family: var(--mono); }

/* 图片灯箱 */
#lightbox {
    display: none; position: fixed; inset: 0; z-index: 300;
    background: rgba(13, 18, 28, 0.92); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; cursor: zoom-out; padding: 4vh 4vw;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; border: 1px solid rgba(255,255,255,0.18); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 2px 10px rgba(23, 29, 41, 0.05); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
    font-size: 12.5px; color: var(--text-3); font-weight: 600;
    letter-spacing: 0.06em; background: var(--panel-2); white-space: nowrap;
    position: sticky; top: 0;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(25, 113, 194, 0.035); }
td .mono, .mono { font-family: var(--mono); font-size: 0.92em; }
td.num { font-family: var(--mono); white-space: nowrap; }

/* ---------- 徽章 / 状态点 ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; padding: 3px 11px; border-radius: 999px;
    border: 1px solid var(--border-strong); color: var(--text-2);
    background: #fff; font-family: var(--mono);
}
.chip.ok { color: var(--green); border-color: rgba(11, 138, 95, 0.35); background: rgba(11, 138, 95, 0.07); }
.chip.acc { color: var(--accent-2); border-color: rgba(232, 89, 12, 0.4); background: rgba(232, 89, 12, 0.07); }
.chip.cyan { color: var(--cyan); border-color: rgba(25, 113, 194, 0.35); background: rgba(25, 113, 194, 0.07); }
.chip.bad { color: var(--red); border-color: rgba(214, 69, 69, 0.35); background: rgba(214, 69, 69, 0.07); }
.chip.warn { color: var(--yellow); border-color: rgba(183, 121, 31, 0.4); background: rgba(183, 121, 31, 0.08); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--green); box-shadow: 0 0 6px rgba(11, 138, 95, 0.5); }
.dot.o { background: var(--accent); box-shadow: 0 0 6px rgba(232, 89, 12, 0.5); }

/* ---------- 折叠块(LTP 全量用例分组) ---------- */
details.family {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--panel); margin: 10px 0; overflow: hidden;
}
details.family summary {
    cursor: pointer; padding: 11px 16px; font-size: 14px; font-weight: 600;
    color: var(--text); background: var(--panel-2); list-style: none;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
details.family summary::-webkit-details-marker { display: none; }
details.family summary::before { content: '▸'; color: var(--text-3); transition: transform 0.15s; }
details.family[open] summary::before { transform: rotate(90deg); }
details.family summary .cnt { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-weight: 400; }
details.family .bd { max-height: 420px; overflow-y: auto; }
details.family table { font-size: 13px; }
details.family th, details.family td { padding: 7px 14px; }

#ltpFilter {
    width: 100%; max-width: 460px; padding: 10px 16px; margin: 14px 0 18px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 14px; font-family: var(--font); background: #fff; color: var(--text);
}
#ltpFilter:focus { outline: 2px solid rgba(25, 113, 194, 0.35); border-color: var(--cyan); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(var(--accent), rgba(25, 113, 194, 0.4));
}
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: ''; position: absolute; left: -28px; top: 7px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 2.5px solid var(--accent);
}
.tl-item .when { font-family: var(--mono); font-size: 12.5px; color: var(--accent-2); letter-spacing: 0.05em; }
.tl-item h4 { font-size: 16px; margin: 4px 0 6px; }
.tl-item p { font-size: 14px; }

/* ---------- 提示框 ---------- */
.callout {
    border: 1px solid var(--border); border-left: 3px solid var(--cyan);
    background: rgba(25, 113, 194, 0.05); border-radius: var(--radius-sm);
    padding: 16px 20px; margin: 20px 0; font-size: 14.5px; color: var(--text-2);
}
.callout.warn { border-left-color: var(--yellow); background: rgba(183, 121, 31, 0.06); }
.callout b { color: var(--text); }

/* ---------- 文档页布局(带侧栏) ---------- */
.doc { display: grid; grid-template-columns: 232px 1fr; gap: 48px; padding: 48px 0 80px; }
.doc-side { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; }
.doc-side .grp { font-size: 12px; color: var(--text-3); letter-spacing: 0.12em; margin: 20px 0 8px; font-family: var(--mono); }
.doc-side > .gwrap:first-child .grp { margin-top: 0; }
.doc-side a { display: block; color: var(--text-2); font-size: 13.8px; padding: 5px 10px; border-radius: 7px; border-left: 2px solid transparent; }
.doc-side a:hover { color: var(--text); background: rgba(27, 35, 48, 0.05); text-decoration: none; }
.doc-side a.on { color: var(--accent-2); background: rgba(232, 89, 12, 0.08); }
.doc-side .gwrap { display: contents; }

.doc-main { min-width: 0; }
.doc-main > h1 { font-size: 34px; margin-bottom: 8px; }
.doc-main .sub { color: var(--text-3); font-size: 14.5px; margin-bottom: 36px; font-family: var(--mono); }
.doc-main h2 { font-size: 24px; margin: 52px 0 16px; padding-top: 20px; border-top: 1px solid var(--border); }
.doc-main h2:first-of-type { border-top: none; padding-top: 0; }
.doc-main h3 { font-size: 18px; margin: 32px 0 12px; }
.doc-main h3 .anchor, .doc-main h2 .anchor { color: var(--accent); font-family: var(--mono); font-size: 0.75em; margin-right: 8px; }
.doc-main p { margin: 12px 0; font-size: 15px; }
.doc-main ul, .doc-main ol { margin: 12px 0 12px 22px; color: var(--text-2); font-size: 15px; }
.doc-main li { margin: 7px 0; }
.doc-main li::marker { color: var(--accent); }
.doc-main blockquote {
    border-left: 3px solid var(--accent); padding: 4px 18px; margin: 16px 0;
    color: var(--text-3); font-size: 14.5px; background: rgba(232, 89, 12, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 锚点小节锚(用于 design.html 模块卡跳转) */
.mod-anchor { scroll-margin-top: calc(var(--nav-h) + 30px); }

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 48px 0 56px; background: #eef0f4; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.foot-grid h5 { font-size: 13.5px; color: var(--text); margin-bottom: 14px; letter-spacing: 0.04em; }
.foot-grid a { display: block; color: var(--text-3); font-size: 13.5px; padding: 3.5px 0; }
.foot-grid a:hover { color: var(--cyan); text-decoration: none; }
.foot-brand p { font-size: 13.5px; margin-top: 10px; max-width: 320px; }
.foot-meta {
    max-width: var(--container); margin: 40px auto 0; padding: 22px 24px 0;
    border-top: 1px solid var(--border); display: flex; justify-content: space-between;
    color: var(--text-3); font-size: 12.5px; font-family: var(--mono); flex-wrap: wrap; gap: 10px;
}

/* ---------- 回到顶部 ---------- */
#toTop {
    position: fixed; right: 26px; bottom: 26px; z-index: 90;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border-strong);
    background: #fff; color: var(--text-2); font-size: 17px; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 14px rgba(23, 29, 41, 0.12);
}
#toTop.on { opacity: 1; pointer-events: auto; }
#toTop:hover { color: var(--accent); transform: translateY(-2px); }

/* ---------- 趋势条(LTP 走势) ---------- */
.trend { display: flex; align-items: flex-end; gap: 7px; height: 190px; margin: 28px 0 8px; }
.trend .bar { flex: 1; background: linear-gradient(180deg, rgba(25, 113, 194, 0.78), rgba(25, 113, 194, 0.16)); border-radius: 5px 5px 2px 2px; position: relative; min-width: 0; }
.trend .bar.acc { background: linear-gradient(180deg, rgba(232, 89, 12, 0.88), rgba(232, 89, 12, 0.18)); }
.trend .bar .bv {
    position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
    font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.trend-x { display: flex; gap: 7px; margin-top: 8px; }
.trend-x span { flex: 1; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text-3); overflow: hidden; }

/* ---------- 仓库地址条 ---------- */
.repo-addr {
    display: inline-block; margin-top: 18px;
    font-family: var(--mono); font-size: 13px; color: var(--text-2);
    background: #fff; border: 1px solid var(--border-strong); border-radius: 9px;
    padding: 9px 16px; letter-spacing: 0;
}
.repo-addr:hover { text-decoration: none; color: var(--accent-2); border-color: rgba(232, 89, 12, 0.5); }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
    .hero { padding: 64px 0 48px; }
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero h1 { font-size: 40px; }
    .hero .lede { font-size: 16.5px; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    /* 文档页:侧栏收为吸顶横滚胶囊条 */
    .doc { grid-template-columns: 1fr; gap: 0; padding: 24px 0 64px; }
    .doc-side {
        position: sticky; top: var(--nav-h); z-index: 60;
        display: flex; flex-wrap: nowrap; overflow-x: auto; max-height: none;
        align-items: center; gap: 6px;
        margin: 0 -24px 18px; padding: 9px 20px;
        background: rgba(246, 247, 249, 0.95);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .doc-side::-webkit-scrollbar { display: none; }
    .doc-side .grp { width: auto; margin: 0 4px 0 12px; flex: none; align-self: center; }
    .doc-side > .gwrap:first-child .grp { margin-left: 0; }
    .doc-side a { display: inline-block; flex: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 13px; white-space: nowrap; }
    /* 分组折叠:组名可点,当前组展开,其余收起只留组名 */
    .doc-side .gwrap { display: contents; }
    .doc-side .gwrap.folded > a { display: none; }
    .doc-side .grp { cursor: pointer; user-select: none; -webkit-user-select: none; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--border); color: var(--text-2); }
    .doc-side .gwrap:not(.folded) .grp { border-style: solid; color: var(--accent-2); border-color: var(--accent-2); }
    .doc-main { min-width: 0; padding: 0 2px; }
}
@media (max-width: 640px) {
    :root { --nav-h: 52px; }
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    /* 导航:一行横滚 */
    .nav-inner { padding: 0 12px; gap: 12px; }
    .nav-logo { font-size: 16px; flex: none; }
    .nav-logo .crab { width: 24px; height: 24px; font-size: 13px; }
    .nav-links {
        flex-wrap: nowrap; overflow-x: auto; gap: 2px; margin-left: 0;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { padding: 6px 9px; font-size: 13px; white-space: nowrap; flex: none; }
    .hero h1 { font-size: 30px; margin: 12px 0 14px; }
    .hero .lede { font-size: 15.5px; }
    .hero-badges { gap: 7px; margin: 18px 0 24px; }
    .hero-actions { gap: 10px; }
    .hero-actions .btn { padding: 11px 18px; font-size: 14px; }
    .repo-addr { font-size: 11.5px; padding: 8px 12px; max-width: 100%; overflow-x: auto; white-space: nowrap; display: block; }
    .section { padding: 44px 0; }
    .sec-head { margin-bottom: 26px; }
    .sec-head h2 { font-size: 23px; }
    .sec-head p { font-size: 14.5px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat { padding: 16px 12px; }
    .stat .v { font-size: 21px; }
    .grid-2, .grid-3, .grid-4, .gallery { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .doc-main > h1 { font-size: 25px; }
    .doc-main .sub { font-size: 12.5px; margin-bottom: 24px; }
    .doc-main h2 { font-size: 20px; margin: 36px 0 12px; }
    .doc-main h3 { font-size: 16.5px; }
    .doc-main p, .doc-main ul, .doc-main ol { font-size: 14.5px; }
    pre { font-size: 12.5px; padding: 14px 12px; margin: 14px 0; }
    .tbl-wrap { border-radius: 10px; }
    th, td { padding: 9px 10px; font-size: 13px; }
    .terminal { font-size: 11px; overflow-x: auto; }
    .terminal-body { padding: 12px; }
    .trend { height: 150px; gap: 4px; }
    .trend .bar .bv { font-size: 9.5px; }
    .trend-x { gap: 4px; }
    .trend-x span { font-size: 9px; }
    .timeline { padding-left: 24px; }
    .tl-item::before { left: -22px; }
    .callout { padding: 13px 14px; font-size: 13.5px; }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .foot-meta { flex-direction: column; gap: 6px; }
    #toTop { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

/* ============================================================
   tech layer (v14) — 按 MengTo/skills 配方:
   build-awwwards-quality-sites(动效纪律)· animation-on-scroll(IO 模式)
   beam-glow-states(行进光束=状态强调)· technical-wireframe(蓝图网格)
   scroll-progress-timeline · number-details(等宽数字)
   ============================================================ */

@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* 蓝图网格背景(静态,零开销) */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(25, 113, 194, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 113, 194, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(25, 113, 194, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 113, 194, 0.08) 1px, transparent 1px);
    background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
    -webkit-mask-image: radial-gradient(ellipse 95% 72% at 50% 0%, #000 26%, transparent 80%);
    mask-image: radial-gradient(ellipse 95% 72% at 50% 0%, #000 26%, transparent 80%);
}

/* 顶部阅读进度条 */
#pbar {
    position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 300;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 0 2px 2px 0;
}

/* 导航底部发丝光线 */
.nav::after {
    content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(232, 89, 12, 0.45), rgba(25, 113, 194, 0.45), transparent 95%);
}

/* 行进光束边框(beam-glow-states):.live=展示面板常驻,.card:hover=状态强调 */
.card, .terminal { position: relative; }
.card::before, .terminal::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--beam),
        transparent 0 66%, rgba(232, 89, 12, 0.95) 79%, rgba(25, 113, 194, 0.95) 87%, transparent 95%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 1;
}
.terminal.live::before { opacity: 1; animation: beamspin 4s linear infinite; }
.card:hover::before, .card:active::before { opacity: 1; animation: beamspin 3s linear infinite; }
@keyframes beamspin { to { --beam: 360deg; } }

/* 终端:扫描线 + 光标闪烁 */
.terminal { overflow: hidden; }
.terminal::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 1;
    background: linear-gradient(180deg, transparent 0%, rgba(79, 195, 247, 0.055) 46%, rgba(255, 255, 255, 0.03) 54%, transparent 100%);
    background-size: 100% 240%;
    animation: scan 7s linear infinite;
}
@keyframes scan { from { background-position: 0 -130%; } to { background-position: 0 130%; } }
.terminal-body .acc { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* hero:渐变平移标题 + 呼吸状态点 */
.hero h1 .grad {
    background-size: 200% 100%;
    animation: gradpan 7s ease-in-out infinite;
}
@keyframes gradpan { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero .chip .dot.o { animation: pulsedom 2.2s ease-in-out infinite; }
@keyframes pulsedom {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 89, 12, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(232, 89, 12, 0); }
}

/* 小节标题刻度线 */
.sec-head .kicker::before {
    content: ''; display: inline-block; width: 24px; height: 2px;
    margin-right: 9px; vertical-align: 4px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
}

/* 主按钮扫光 */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 36%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg); transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 130%; }

/* 表格行强调线 */
tbody td:first-child { box-shadow: inset 2px 0 0 transparent; transition: box-shadow 0.15s, background 0.15s; }
tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

/* 折叠组悬停 */
details.family summary { transition: background 0.15s; }
details.family summary:hover { background: #e9edf3; }

/* 滚动显现(animation-on-scroll 模式:IO 一次性触发) */
.rv { opacity: 0; transform: translateY(14px); }
.rv.in {
    opacity: 1; transform: none;
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--d, 0s);
}

/* 触屏按下反馈 */
.card:active { transform: scale(0.995); }

/* 诚实的降级与性能守则 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .rv { opacity: 1 !important; transform: none !important; }
    .hero h1 .grad { background-position: 0% 50%; }
}
@media (max-width: 640px) {
    body::before { opacity: 0.75; }
    .terminal { font-size: 10.5px; }
    .rv { transform: translateY(10px); }
}

/* ---------- 语言切换 ---------- */
.lang-sw {
    display: inline-flex; align-items: center; flex: none;
    border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden;
    margin-left: 4px;
}
.lang-sw a {
    padding: 5px 10px; font-size: 12px; font-family: var(--mono);
    color: var(--text-2); border-radius: 0; line-height: 1.4;
}
.lang-sw a:hover { text-decoration: none; color: var(--text); background: rgba(27,35,48,0.05); }
.lang-sw a.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.lang-sw a + a { border-left: 1px solid var(--border-strong); }

/* ---------- 页脚访客统计 ---------- */
.foot-stats { font-family: var(--mono); color: var(--text-3); }
.giscus-wrap { margin: 24px 0 40px; }
.giscus-wrap .giscus, .giscus-wrap iframe { width: 100%; }
