/* ---------- tokens ---------- */

:root,
[data-bs-theme="light"] {
    --wa-brand: #1860d8;
    --wa-brand-deep: #0f3f92;
    --wa-brand-soft: #eef3fd;
    --wa-brand-rgb: 24, 96, 216;

    --wa-surface: #fbfaf7;
    --wa-surface-2: #f4f3ee;
    --wa-surface-3: #ffffff;

    --wa-ink: #0b0c0e;
    --wa-body: #41464e;
    /* 文字四级色阶：ink 18.8:1 / body 9.1:1 / muted 6.3:1 / faint 5.0:1（底色 #fbfaf7）
       —— 均满足 WCAG AA 4.5:1，faint 不再是 2.65:1 的不可读灰 */
    --wa-muted: #575e67;
    --wa-faint: #666d76;

    --wa-line: rgba(11, 12, 14, .11);
    --wa-line-strong: rgba(11, 12, 14, .19);
    --wa-hover: rgba(24, 96, 216, .035);
    --wa-highlight: rgba(24, 96, 216, .13);

    /* 常暗区块 / 代码面板：取 Tailwind slate-900，不用纯黑或近黑 #0a0d14，
       深蓝灰与品牌蓝同色相，大块面积不发闷 */
    --wa-dark: #0f172a;
    --wa-dark-2: #0b1220;
    --wa-code: #0f172a;
    --wa-code-bar: #1e293b;

    /* semantic accents (terminal / status only, never for text blocks) */
    --wa-red: #ff5f57;
    --wa-amber: #febc2e;
    --wa-green: #28c840;
    --wa-green-soft: #22c55e;

    --wa-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --wa-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono",
        Consolas, "Courier New", monospace;

    --wa-ease: cubic-bezier(.2, .7, .2, 1);

    /* RGB channels consumed by Bootstrap's *-rgb variables */
    --wa-ink-rgb: 11, 12, 14;
    --wa-body-rgb: 65, 70, 78;
    --wa-muted-rgb: 87, 94, 103;

    /* typography / radius: theme-independent */
    --bs-font-sans-serif: var(--wa-sans);
    --bs-body-font-size: 16px;
    --bs-body-line-height: 1.7;
    --bs-border-radius: 7px;
    --bs-border-radius-lg: 10px;
}

/* 深色主题底色对齐 Tailwind slate 色阶（slate-900 / 800），
   弃用纯黑与近黑（#0d0f13 一类）：大面积发闷，且与品牌蓝 #5b9bff 缺少明度层次。
   色阶关系：页面 slate-900 < 交替区块 < 卡片 slate-800，代码面板比页面再深一档。 */
[data-bs-theme="dark"] {
    --wa-brand: #5b9bff;
    --wa-brand-deep: #9cc0ff;
    --wa-brand-soft: rgba(91, 155, 255, .14);
    --wa-brand-rgb: 91, 155, 255;

    --wa-surface: #0f172a;   /* slate-900：页面底 */
    --wa-surface-2: #162032; /* slate-900 → 800 之间：交替区块 */
    --wa-surface-3: #1e293b; /* slate-800：卡片 / 面板 */

    --wa-ink: #f1f5f9;   /* slate-100 */
    --wa-body: #cbd5e1;  /* slate-300 */
    --wa-muted: #94a3b8; /* slate-400 */
    /* 深色下 faint 提亮：slate-500 (#64748b) 在 slate-800 卡片上只有 4.0:1 */
    --wa-faint: #8b94a1;

    --wa-line: rgba(255, 255, 255, .12);
    --wa-line-strong: rgba(255, 255, 255, .2);
    --wa-hover: rgba(91, 155, 255, .1);
    --wa-highlight: rgba(91, 155, 255, .3);

    /* 常暗区块与页面分层：仍取带蓝调的 slate，压到近黑会重新变闷 */
    --wa-dark: #0b1220;
    --wa-dark-2: #0e1626;
    --wa-code: #0b1220;
    --wa-code-bar: #162032;

    --wa-ink-rgb: 241, 245, 249;
    --wa-body-rgb: 203, 213, 225;
    --wa-muted-rgb: 148, 163, 184;
}

/* ---------- base ---------- */

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
    /* 唯一桥接点：品牌变量 → Bootstrap 语义变量。
       组件（table / pagination / dropdown / navbar）继承这里，
       因此不再需要逐组件写颜色覆盖，亮暗切换只改 --wa-*。 */
    --bs-body-bg: var(--wa-surface);
    --bs-body-color: var(--wa-body);
    --bs-emphasis-color: var(--wa-ink);
    --bs-emphasis-color-rgb: var(--wa-ink-rgb);
    --bs-heading-color: var(--wa-ink);
    --bs-secondary-color: var(--wa-muted);
    --bs-secondary-color-rgb: var(--wa-muted-rgb);
    --bs-tertiary-color: var(--wa-faint);
    --bs-border-color: var(--wa-line);
    --bs-border-color-translucent: var(--wa-line);
    --bs-link-color: var(--wa-brand);
    --bs-link-hover-color: var(--wa-brand-deep);
    --bs-primary: var(--wa-brand);
    --bs-primary-rgb: var(--wa-brand-rgb);
    --bs-dark: var(--wa-ink);
    --bs-dark-rgb: var(--wa-ink-rgb);

    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: var(--wa-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--wa-ink);
    font-weight: 700;
    /* 中文标题不做拉丁式的负字距收紧，-0.03em 会让密集笔画糊在一起 */
    letter-spacing: -.01em;
    text-wrap: balance;
}

p { margin: 0; }
a { text-decoration: none; }

code, pre, kbd { font-family: var(--wa-mono); }

::selection { background: rgba(var(--wa-brand-rgb), .18); }

:focus-visible {
    outline: 2px solid var(--wa-brand);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- bootstrap: container / grid tuning ---------- */

.container {
    --bs-gutter-x: 3rem;
    max-width: 1296px;
    padding-inline: calc(var(--bs-gutter-x) * .5);
}

@media (max-width: 760px) {
    .container { --bs-gutter-x: 2rem; }
}

/* ---------- bootstrap: buttons ---------- */

.btn {
    --bs-btn-font-size: 14px;
    --bs-btn-font-weight: 600;
    --bs-btn-padding-y: .55rem;
    --bs-btn-padding-x: 1.05rem;
    --bs-btn-border-radius: 7px;
    --bs-btn-focus-box-shadow: 0 0 0 3px rgba(var(--wa-brand-rgb), .18);
    letter-spacing: -.005em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: background .2s var(--wa-ease), color .2s var(--wa-ease),
        border-color .2s var(--wa-ease), transform .2s var(--wa-ease);
}

.btn:active { transform: translateY(1px); }

.btn-lg {
    --bs-btn-font-size: 14.5px;
    --bs-btn-padding-y: .72rem;
    --bs-btn-padding-x: 1.4rem;
    --bs-btn-border-radius: 8px;
}

.btn-sm { --bs-btn-font-size: 12.5px; --bs-btn-padding-y: .3rem; }

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wa-brand);
    --bs-btn-border-color: var(--wa-brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wa-brand-deep);
    --bs-btn-hover-border-color: var(--wa-brand-deep);
    --bs-btn-active-bg: var(--wa-brand-deep);
    --bs-btn-active-border-color: var(--wa-brand-deep);
}

.btn-ink {
    --bs-btn-color: var(--wa-surface);
    --bs-btn-bg: var(--wa-ink);
    --bs-btn-border-color: var(--wa-ink);
    --bs-btn-hover-color: var(--wa-surface);
    --bs-btn-hover-bg: #23262c;
    --bs-btn-hover-border-color: #23262c;
    --bs-btn-active-bg: #2c3037;
    --bs-btn-active-border-color: #2c3037;
}

[data-bs-theme="dark"] .btn-ink {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wa-brand);
    --bs-btn-border-color: var(--wa-brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3d82e8;
    --bs-btn-hover-border-color: #3d82e8;
    --bs-btn-active-bg: #3d82e8;
    --bs-btn-active-border-color: #3d82e8;
}

.btn-outline-ink {
    --bs-btn-color: var(--wa-ink);
    --bs-btn-border-color: var(--wa-line-strong);
    --bs-btn-hover-color: var(--wa-ink);
    --bs-btn-hover-bg: var(--wa-surface-3);
    --bs-btn-hover-border-color: var(--wa-ink);
    --bs-btn-active-bg: var(--wa-surface-3);
    --bs-btn-active-border-color: var(--wa-ink);
}

.btn-outline-light-ink {
    --bs-btn-color: #e8eef6;
    --bs-btn-border-color: rgba(255, 255, 255, .24);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, .08);
    --bs-btn-hover-border-color: rgba(255, 255, 255, .4);
}

.btn .arr { font-family: var(--wa-mono); font-size: 13px; transition: transform .2s var(--wa-ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- bootstrap: navbar ---------- */

.wa-header {
    --bs-navbar-padding-y: 0;
    --bs-navbar-color: var(--wa-body);
    --bs-navbar-hover-color: var(--wa-ink);
    --bs-navbar-active-color: var(--wa-ink);
    --bs-navbar-disabled-color: var(--wa-faint);
    --bs-navbar-brand-color: var(--wa-ink);
    --bs-navbar-brand-hover-color: var(--wa-ink);
    position: sticky;
    top: 0;
    padding: 10px 0;
    z-index: 1030;
    background: color-mix(in srgb, var(--wa-surface) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--wa-ease), background .25s var(--wa-ease),
        box-shadow .25s var(--wa-ease);
}

.wa-header.is-scrolled {
    border-bottom-color: var(--wa-line);
    box-shadow: 0 8px 20px -18px rgba(11, 12, 14, .5);
}

.wa-header .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: 0;
    margin-right: 1.6rem;
    color: var(--wa-ink);
}

.brand-mark { width: auto; height: 27px; }
/* 深色下用白色版 logo：深蓝字压在近黑底上几乎不可见 */
.brand-mark-dark { display: none; }
[data-bs-theme="dark"] .brand-mark-light { display: none; }
[data-bs-theme="dark"] .brand-mark-dark { display: inline-block; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.02em; display: none;}

.brand-ver {
    font-family: var(--wa-mono);
    font-size: 11px;
    color: var(--wa-muted);
    border: 1px solid var(--wa-line);
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: .02em;
}

.wa-header .navbar-toggler {
    border: 1px solid var(--wa-line-strong);
    border-radius: 7px;
    padding: .35rem .5rem;
    color: var(--wa-ink);
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: none;
}

.wa-header .navbar-toggler:focus { box-shadow: var(--bs-btn-focus-box-shadow); }

.wa-header .navbar-collapse { align-items: center; }

.wa-header .navbar-nav {
    --bs-nav-link-padding-x: .68rem;
    --bs-nav-link-padding-y: .45rem;
    gap: 2px;
}

.wa-header .nav-link {
    position: relative;
    font-size: 13.5px;
    border-radius: 6px;
    transition: color .18s var(--wa-ease), background .18s var(--wa-ease);
}

.wa-header .nav-link:hover { background: var(--wa-hover); }

.wa-header .nav-link.is-active { color: var(--wa-ink); }

.wa-header .nav-link.is-active::after {
    content: "";
    position: absolute;
    left: .68rem;
    right: .68rem;
    bottom: 1px;
    height: 1.5px;
    background: var(--wa-brand);
}

.nav-soon {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--wa-faint);
    border: 1px solid var(--wa-line);
    border-radius: 3px;
    padding: 0 3px;
    margin-left: 5px;
    vertical-align: 1.5px;
}

.head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.head-link { font-size: 13.5px; color: var(--wa-body); padding: 0 .3rem; }
.head-link:hover { color: var(--wa-ink); }

.head-actions .btn { --bs-btn-padding-y: .42rem; --bs-btn-padding-x: .92rem; --bs-btn-font-size: 13px; }

/* 亮 / 暗切换：两个图标同时存在，由当前主题决定显示哪一个 */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--wa-line-strong);
    border-radius: 7px;
    background: transparent;
    color: var(--wa-body);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: color .18s var(--wa-ease), border-color .18s var(--wa-ease),
        background .18s var(--wa-ease);
}

.theme-toggle:hover { color: var(--wa-ink); border-color: var(--wa-ink); background: var(--wa-hover); }
.theme-toggle .bi-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .bi-sun { display: inline-block; }
[data-bs-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* dropdown */

.wa-header .dropdown-menu {
    --bs-dropdown-min-width: 178px;
    --bs-dropdown-padding-y: .35rem;
    --bs-dropdown-bg: var(--wa-surface-3);
    --bs-dropdown-border-radius: 8px;
    --bs-dropdown-link-hover-bg: var(--wa-hover);
    --bs-dropdown-font-size: 13.5px;
    --bs-dropdown-item-padding-y: .42rem;
    --bs-dropdown-item-padding-x: .65rem;
    margin-top: 10px;
    box-shadow: 0 20px 40px -26px rgba(11, 12, 14, .45);
}

.wa-header .dropdown-item { border-radius: 5px; white-space: nowrap; }
.wa-header .dropdown-item.is-sub { padding-left: 1.4rem; font-size: 13px; color: var(--wa-muted); }

.wa-header .dropdown-divider { border-color: var(--wa-line); margin: .3rem .4rem; }

.wa-header .nav-link.dropdown-toggle::after { display: none; }
.wa-header .dropdown-toggle .caret { font-size: 10px; opacity: .55; margin-left: 3px; }

.wa-header .nav-link .nav-icon {
    font-size: 14px;
    line-height: 1;
    margin-right: 5px;
    vertical-align: -1px;
    opacity: .85;
}

/* touch devices: keep a soft pressed state instead of a hard focus ring */
@media (hover: none) {
    .wa-header .nav-link:focus-visible {
        outline: none;
        background: var(--wa-hover);
    }
}

@media (max-width: 991.98px) {
    .wa-header .navbar-collapse {
        border-top: 1px solid var(--wa-line);
        margin-top: .6rem;
        padding: .5rem 0 .9rem;
    }

    .wa-header .navbar-nav { gap: 0; }
    .wa-header .nav-link { padding: .7rem .2rem; border-radius: 0; }
    .wa-header .nav-link.is-active::after { display: none; }
    .wa-header .nav-link.is-active { color: var(--wa-brand); }
    .wa-header .head-actions { margin: .9rem 0 0; }
    .wa-header .dropdown-menu {
        border: 0;
        box-shadow: none;
        background: transparent;
        padding-left: .5rem;
    }
    .wa-header .dropdown-item { padding: .55rem .4rem; }
}

/* ---------- bootstrap: tables ---------- */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--wa-body);
    --bs-table-hover-bg: var(--wa-hover);
    margin-bottom: 0;
    font-size: 14px;
}

.table > :not(caption) > * > * {
    padding: .9rem 1rem .9rem 0;
    border-bottom-width: 1px;
    background-color: transparent;
    box-shadow: none;
}

.table > thead th {
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-muted);
    border-bottom-color: var(--wa-line-strong);
    padding-top: 0;
    white-space: nowrap;
}

.table > tbody > tr:last-child > * { border-bottom: 0; }

.table > tbody > tr > td:first-child {
    color: var(--wa-ink);
    font-weight: 600;
}

.table code {
    font-size: 12.4px;
    background: var(--wa-line);
    border-radius: 3px;
    padding: .08em .34em;
    color: var(--wa-ink);
}

/* compare table highlight column */

.table-compare td:nth-child(3),
.table-compare th:nth-child(3) { padding-left: 1.25rem; }

.table-compare > thead > tr > th:nth-child(3) { color: var(--wa-brand); }

.table-compare td:nth-child(3) {
    background: rgba(var(--wa-brand-rgb), .045);
    box-shadow: inset 1px 0 0 rgba(var(--wa-brand-rgb), .16),
        inset -1px 0 0 rgba(var(--wa-brand-rgb), .16);
}

/* ---------- bootstrap: pagination ---------- */

.pagination {
    --bs-pagination-padding-x: .8rem;
    --bs-pagination-padding-y: .4rem;
    --bs-pagination-font-size: 12px;
    --bs-pagination-color: var(--wa-body);
    --bs-pagination-bg: var(--wa-surface-3);
    --bs-pagination-border-color: var(--wa-line-strong);
    --bs-pagination-border-radius: 6px;
    --bs-pagination-hover-color: var(--wa-ink);
    --bs-pagination-hover-bg: var(--wa-surface-3);
    --bs-pagination-hover-border-color: var(--wa-ink);
    --bs-pagination-active-bg: var(--wa-ink);
    --bs-pagination-active-border-color: var(--wa-ink);
    --bs-pagination-disabled-color: var(--wa-faint);
    --bs-pagination-disabled-bg: transparent;
    --bs-pagination-disabled-border-color: var(--wa-line);
    font-family: var(--wa-mono);
    gap: 6px;
    margin: 30px 0 0;
}

.pagination .page-link { min-width: 34px; text-align: center; }
.pagination .page-item.disabled .page-link { background: transparent; }

/* ---------- bootstrap: badges ---------- */

.badge {
    --bs-badge-font-size: 11px;
    --bs-badge-font-weight: 500;
    --bs-badge-padding-x: .42rem;
    --bs-badge-padding-y: .2rem;
    --bs-badge-border-radius: 4px;
    font-family: var(--wa-mono);
    letter-spacing: .02em;
}

.badge-tag {
    background: var(--wa-line);
    color: var(--wa-body);
    border: 1px solid var(--wa-line);
}

/* ---------- section rhythm ---------- */

.section {
    padding: clamp(64px, 7.5vw, 108px) 0;
    border-top: 1px solid var(--wa-line);
}

.section-tight { padding: clamp(48px, 5vw, 72px) 0; }
.section-tint { background: var(--wa-surface-2); }
.section-flush { border-top: 0; padding-top: clamp(36px, 4vw, 56px); }

.section-grid {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 56px;
}

.section-grid > *,
.hero-grid > *,
.split > *,
.start > *,
.ph-grid > *,
.content-grid > * { min-width: 0; }

.rail {
    position: sticky;
    top: 100px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rail::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--wa-brand);
    opacity: .75;
    margin-bottom: 2px;
}

.rail-no {
    font-family: var(--wa-mono);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .14em;
    color: var(--wa-brand);
}

.rail-label {
    font-size: 12.5px;
    letter-spacing: .1em;
    color: var(--wa-muted);
    text-transform: uppercase;
}

.h2 {
    font-size: clamp(1.85rem, 3.1vw, 2.6rem);
    line-height: 1.22;
    margin-bottom: 18px;
}

.lede {
    font-size: 16.5px;
    line-height: 1.78;
    color: var(--wa-body);
    max-width: 64ch;
}

.mono-note {
    font-family: var(--wa-mono);
    font-size: 12px;
    letter-spacing: .02em;
    color: var(--wa-muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--wa-mono);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--wa-brand);
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: .55;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wa-brand);
    transition: gap .2s var(--wa-ease);
}
.link-arrow:hover { gap: 12px; color: var(--wa-brand-deep); }
.link-arrow .arr { font-family: var(--wa-mono); }

/* ---------- hero ---------- */

.hero {
    position: relative;
    padding: clamp(56px, 7.6vw, 104px) 0 0;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(var(--wa-brand-rgb), .07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--wa-brand-rgb), .07) 1px, transparent 1px);
    background-size: 76px 76px;
    opacity: .6;
    -webkit-mask-image: radial-gradient(80% 68% at 72% 0%, #000 0%, transparent 72%);
    mask-image: radial-gradient(80% 68% at 72% 0%, #000 0%, transparent 72%);
    pointer-events: none;
}

.hero > .container { position: relative; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    gap: clamp(36px, 4vw, 64px);
    align-items: start;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--wa-line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--wa-surface-3) 60%, transparent);
    font-family: var(--wa-mono);
    font-size: 10.8px;
    letter-spacing: .05em;
    color: var(--wa-body);
    text-transform: uppercase;
}

.pill-brand {
    border-color: rgba(var(--wa-brand-rgb), .28);
    background: var(--wa-brand-soft);
    color: var(--wa-brand-deep);
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--wa-green-soft);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.hero h1 {
    font-size: clamp(2.35rem, 4.6vw, 4rem);
    line-height: 1.12;
    letter-spacing: -.02em;
    margin-bottom: 26px;
}

.hero h1 .underscore { position: relative; white-space: nowrap; }

.hero h1 .underscore::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: .07em;
    height: .085em;
    background: var(--wa-brand);
    opacity: .22;
}

/* 首屏只留一段导语：环境要求（PHP / MySQL / Redis）已在 07 节说明，不再重复 */
.hero-lead {
    font-size: clamp(16px, 1.5vw, 17.5px);
    line-height: 1.8;
    color: var(--wa-body);
    max-width: 58ch;
    margin-bottom: 12px;
}

.hero-lead strong {
    color: var(--wa-ink);
    font-weight: 600;
    padding: 0 .08em;
    box-shadow: inset 0 -.42em 0 var(--wa-highlight);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.inline-code {
    font-family: var(--wa-mono);
    font-size: .89em;
    background: var(--wa-line);
    border-radius: 4px;
    padding: .1em .38em;
    color: var(--wa-ink);
    white-space: nowrap;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* terminal */

.term-wrap { position: relative; margin-top: 6px; }

.term-wrap::before {
    content: "";
    position: absolute;
    inset: 24px -18px -22px 18px;
    background: radial-gradient(60% 70% at 70% 30%, rgba(var(--wa-brand-rgb), .16), transparent 70%);
    filter: blur(22px);
    pointer-events: none;
}

.term {
    position: relative;
    background: var(--wa-code);
    border: 1px solid var(--wa-code-bar);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 32px 64px -34px rgba(10, 18, 34, .55);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    background: var(--wa-code-bar);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.term-dot { width: 8px; height: 8px; border-radius: 50%; }

.term-dot:nth-child(1) { background: var(--wa-red); box-shadow: 0 0 8px rgba(255, 95, 87, .32); }
.term-dot:nth-child(2) { background: var(--wa-amber); box-shadow: 0 0 8px rgba(254, 188, 46, .28); }
.term-dot:nth-child(3) { background: var(--wa-green); box-shadow: 0 0 8px rgba(40, 200, 64, .28); }

.term-title {
    margin-left: 8px;
    font-family: var(--wa-mono);
    font-size: 11px;
    /* 面板底色提亮到 slate 后，副标题也要跟上，否则 11px 字掉到 4:1 以下 */
    color: #93a2b5;
    letter-spacing: .03em;
}

.term-copy {
    margin-left: auto;
    font-family: var(--wa-mono);
    font-size: 11px;
    color: #93a2b5;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    transition: color .18s var(--wa-ease), background .18s var(--wa-ease);
}
.term-copy:hover { color: #dbe6f5; background: rgba(255, 255, 255, .1); }

.term-body {
    margin: 0;
    padding: 18px 18px 20px;
    font-family: var(--wa-mono);
    font-size: 12px;
    line-height: 1.95;
    color: #c3cedd;
    overflow-x: auto;
    white-space: pre;
    tab-size: 2;
}

.term-body .t-cmd { color: #eaf2fd; }
.term-body .t-dim { color: #7d8b9e; }
.term-body .t-key { color: #a9bad0; }
.term-body .t-flag { color: #79b0ff; }
.term-body .t-ok { color: #74d6ac; }
.term-body .t-warn { color: #e5bf83; }
.term-body .t-num { color: #c3a0ff; }

.term-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    background: var(--wa-code-bar);
    font-family: var(--wa-mono);
    font-size: 11px;
    color: #8b9bad;
    letter-spacing: .02em;
}

.term-foot .dot-ok {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, .5);
}

/* hero demo: command / interface tabs */

.hero-demo { position: relative; }

.demo-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    margin-bottom: 12px;
    border: 1px solid var(--wa-line);
    border-radius: 9px;
    background: var(--wa-surface-2);
}

.demo-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-family: var(--wa-sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--wa-muted);
    cursor: pointer;
    transition: color .18s var(--wa-ease), background .18s var(--wa-ease),
        box-shadow .18s var(--wa-ease);
}

.demo-tab .bi {
    font-size: 13px;
    opacity: .75;
    transition: color .18s var(--wa-ease), opacity .18s var(--wa-ease);
}

.demo-tab:hover { color: var(--wa-ink); }
.demo-tab:hover .bi { opacity: 1; }

.demo-tab.is-active {
    background: var(--wa-surface-3);
    color: var(--wa-ink);
    box-shadow: 0 1px 2px rgba(11, 12, 14, .1), 0 0 0 1px var(--wa-line);
}

.demo-tab.is-active .bi { color: var(--wa-brand); opacity: 1; }

[data-bs-theme="dark"] .demo-tab.is-active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px var(--wa-line-strong);
}

.demo-panel { display: none; }
.demo-panel.is-active { display: block; }

/* 真实截图优先，加载失败时回退到 HTML 界面示意 */
.demo-shot { position: relative; }
.demo-shot .ui-frame { display: none; }
.demo-shot.is-fallback .ui-frame { display: block; }

.demo-note {
    margin-top: 10px;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .02em;
    color: var(--wa-faint);
}

/* product UI mock */

.ui-frame {
    background: var(--wa-surface-3);
    border: 1px solid var(--wa-line-strong);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 28px 56px -36px rgba(10, 18, 34, .42);
}

/* 真实截图可直接替换 .ui-frame：<img class="ui-shot" src="…" alt="…"> */
.ui-shot {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--wa-line-strong);
    border-radius: 12px;
    box-shadow: 0 28px 56px -36px rgba(10, 18, 34, .42);
}

.ui-top {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid var(--wa-line);
    background: var(--wa-surface-2);
    font-family: var(--wa-mono);
    font-size: 11px;
    color: var(--wa-muted);
}

.ui-brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--wa-sans);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--wa-ink);
}

.ui-logo { width: 10px; height: 10px; border-radius: 3px; background: var(--wa-brand); }
.ui-crumb { display: inline-flex; gap: 5px; }
.ui-crumb b { color: var(--wa-faint); font-weight: 400; }
.ui-search { margin-left: auto; width: 84px; height: 16px; border-radius: 4px; background: var(--wa-line); }
.ui-avatar { width: 16px; height: 16px; border-radius: 50%; background: var(--wa-brand); opacity: .45; }

.ui-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); }

.ui-side {
    padding: 10px 8px;
    border-right: 1px solid var(--wa-line);
    background: var(--wa-surface-2);
}

.ui-side-item {
    display: flex;
    align-items: center;
    height: 27px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 10.5px;
    color: var(--wa-muted);
}

.ui-side-item.is-on { background: var(--wa-brand-soft); color: var(--wa-brand-deep); font-weight: 600; }
.ui-side-item.is-sub { padding-left: 18px; font-size: 9.5px; color: var(--wa-brand-deep); }

.ui-main { min-width: 0; padding: 15px 16px; }

.ui-head { display: flex; align-items: center; margin-bottom: 11px; }
.ui-title { font-size: 13px; font-weight: 700; color: var(--wa-ink); }

.ui-btn {
    display: inline-flex;
    align-items: center;
    height: 22px;
    margin-left: auto;
    padding: 0 10px;
    border-radius: 4px;
    background: var(--wa-brand);
    color: #fff;
    font-size: 9.5px;
    font-weight: 600;
}

.ui-filters { display: flex; gap: 8px; margin-bottom: 10px; }

.ui-filter-input {
    display: flex;
    align-items: center;
    flex: 1;
    height: 27px;
    padding: 0 9px;
    border: 1px solid var(--wa-line);
    border-radius: 4px;
    font-size: 10px;
    color: var(--wa-faint);
}

.ui-filter-select {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 27px;
    border: 1px solid var(--wa-line);
    border-radius: 4px;
    font-size: 10px;
    color: var(--wa-muted);
}

.ui-table { border-top: 1px solid var(--wa-line-strong); }

.ui-row {
    display: grid;
    grid-template-columns: 1.7fr .7fr .6fr .5fr;
    gap: 8px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--wa-line);
    font-size: 10.8px;
    color: var(--wa-body);
}

.ui-row > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.ui-row.is-head {
    font-family: var(--wa-mono);
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wa-muted);
}

.ui-pill {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 8.5px;
    font-style: normal;
}

.ui-pill.is-on { background: rgba(34, 197, 94, .13); color: #1f7a4c; }
.ui-pill.is-off { background: var(--wa-line); color: var(--wa-muted); }

[data-bs-theme="dark"] .ui-pill.is-on { background: rgba(34, 197, 94, .16); color: #7fd0a8; }

.ui-op { color: var(--wa-brand); }

.ui-pager { display: flex; gap: 4px; margin-top: 10px; }
.ui-pager span { width: 14px; height: 14px; border-radius: 3px; background: var(--wa-line); }
.ui-pager span.is-on { background: var(--wa-ink); }

@media (max-width: 760px) {
    .ui-body { grid-template-columns: 78px minmax(0, 1fr); }
    .ui-crumb { display: none; }
    .ui-row { grid-template-columns: 1.5fr .6fr .55fr; }
    .ui-row > span:last-child { display: none; }
    .ui-main { padding: 10px; }
    .ui-side-item {
        font-size: 9.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ui-side-item.is-sub { padding-left: 14px; font-size: 9px; }
}

/* ---------- stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--wa-line-strong);
    border-bottom: 1px solid var(--wa-line-strong);
    margin-top: clamp(48px, 6vw, 76px);
}

.stat { padding: 24px 24px 26px; border-left: 1px solid var(--wa-line); }
.stat:first-child { border-left: 0; padding-left: 0; }

.stat-num {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -.045em;
    color: var(--wa-ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-num .unit { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--wa-muted); }

.stat-num { position: relative; padding-bottom: 14px; }

.stat-num::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 22px;
    height: 2px;
    background: var(--wa-line-strong);
}

.stat:first-child .stat-num { color: var(--wa-brand); }
.stat:first-child .stat-num::after {
    width: 34px;
    background: var(--wa-brand);
}

.stat-label { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--wa-muted); }
.stat-label b { color: var(--wa-body); font-weight: 600; }

/* 四个数字本身就是入口：整格可点，短条在 hover / 键盘聚焦时延伸并转成品牌色 */
a.stat { display: block; color: inherit; }
a.stat .stat-num::after { transition: width .25s var(--wa-ease), background-color .25s var(--wa-ease); }
a.stat:hover .stat-num::after,
a.stat:focus-visible .stat-num::after { width: 100%; background: var(--wa-brand); }

/* ---------- principles ---------- */

.principles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--wa-line-strong);
    margin-top: 38px;
}

.principle {
    padding: 26px 28px 30px 0;
    border-right: 1px solid var(--wa-line);
    border-bottom: 1px solid var(--wa-line);
}
.principle:last-child { border-right: 0; }
.principle:not(:first-child) { padding-left: 28px; }

.principle-no { font-family: var(--wa-mono); font-size: 11px; letter-spacing: .12em; color: var(--wa-faint); }

.principle h3 { font-size: 17px; margin: 12px 0 8px; letter-spacing: -.015em; }

.principle p { font-size: 14px; line-height: 1.72; color: var(--wa-body); }

.principle .mark {
    display: inline-block;
    margin-top: 14px;
    padding: 3px 8px;
    font-family: var(--wa-mono);
    font-size: 11px;
    color: var(--wa-body);
    background: var(--wa-line);
    border-left: 2px solid rgba(var(--wa-brand-rgb), .55);
}

/* ---------- split ---------- */

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 4vw, 56px);
    align-items: start;
}

.split-wide-right { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }

/* ---------- plain code block ---------- */

.plain-code {
    position: relative;
    margin: 20px 0 8px;
    padding: 16px 18px;
    background: var(--wa-code);
    border: 1px solid var(--wa-code-bar);
    border-radius: 9px;
    overflow-x: auto;
}

.plain-code code,
.fb-body .plain-code code {
    display: block;
    padding: 0;
    background: none;
    border-radius: 0;
    color: #c3cedd;
    font-size: 12px;
    line-height: 1.95;
    white-space: pre;
}

/* ---------- note ---------- */

.note {
    position: relative;
    margin-top: 28px;
    padding: 36px 22px 18px;
    border-left: 2px solid var(--wa-brand);
    background: rgba(var(--wa-brand-rgb), .05);
    font-size: 14px;
    line-height: 1.72;
    color: var(--wa-body);
}

.note::before {
    content: "NOTE";
    position: absolute;
    top: 13px;
    left: 22px;
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .18em;
    color: var(--wa-brand);
}

.note b { color: var(--wa-ink); }

/* ---------- 适用 / 不适用判断条（首页 06 节） ---------- */

.fit {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 30px;
    background: var(--wa-line);
    border: 1px solid var(--wa-line-strong);
}

.fit-col { background: var(--wa-surface); padding: 22px 24px 24px; }

.fit-col h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-muted);
}

.fit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wa-faint); flex: 0 0 auto; }
.fit-col.is-yes .fit-dot { background: var(--wa-brand); }
.fit-col.is-yes h3 { color: var(--wa-brand-deep); }

.fit-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.fit-col li {
    position: relative;
    padding-left: 17px;
    font-size: 14px;
    line-height: 1.68;
    color: var(--wa-body);
}

.fit-col li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wa-line-strong);
}

.fit-col.is-yes li::before { background: rgba(var(--wa-brand-rgb), .45); }

/* ---------- dark blocks (always dark) ---------- */

.arch,
.cta {
    color-scheme: dark;
    background: var(--wa-dark);
    color: #b9c4d3;
}

.arch { position: relative; padding: clamp(64px, 7vw, 100px) 0; overflow: hidden; }

[data-bs-theme="dark"] .arch { border-top: 1px solid rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .term { border-color: #334155; }
[data-bs-theme="dark"] .footer { border-top-color: rgba(255, 255, 255, .1); }

.arch::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 88px 88px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 80%);
    mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 80%);
    pointer-events: none;
}

.arch > .container { position: relative; }

.arch .rail-no { color: #5f9bff; }
.arch .rail-label { color: #7b8a9d; }
.arch .h2 { color: #f4f7fb; }
.arch .lede { color: #96a3b4; }

.arch-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 44px;
}

.arch-head .mono-note { color: #7e8c9f; }

.layers { border-top: 1px solid rgba(255, 255, 255, .1); }

.layer {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    align-items: start;
}

.layer-name {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #6d7b8e;
    padding-top: 8px;
}

.layer-name span {
    display: block;
    margin-top: 4px;
    font-family: var(--wa-sans);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    color: #8d99aa;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 5px;
    background: rgba(255, 255, 255, .028);
    font-family: var(--wa-mono);
    font-size: 11.5px;
    color: #cfd9e6;
    letter-spacing: .01em;
    transition: border-color .2s var(--wa-ease), color .2s var(--wa-ease);
}

.chip:hover { border-color: rgba(120, 170, 255, .45); color: #eaf1fb; }

.chip-brand {
    border-color: rgba(90, 145, 245, .42);
    background: rgba(24, 96, 216, .16);
    color: #b7cffd;
}

.chip-ghost { border-style: dashed; color: #8c99ab; }

.arch-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 28px;
    font-family: var(--wa-mono);
    font-size: 11.5px;
    color: #808ea1;
}

.arch-foot b { color: #b9c8db; font-weight: 500; }

/* ---------- features ---------- */

.features {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    border-top: 1px solid var(--wa-line-strong);
}

.feature {
    display: grid;
    grid-template-columns: 52px minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 26px;
    padding: 24px 10px 24px 0;
    border-bottom: 1px solid var(--wa-line);
    /* 只过渡背景：改 padding 会让整行文字在 hover 时左右跳动 */
    transition: background .2s var(--wa-ease);
}

.feature:hover { background: var(--wa-hover); }

.feature-no {
    font-family: var(--wa-mono);
    font-size: 11.5px;
    color: var(--wa-brand);
    padding-top: 5px;
    letter-spacing: .06em;
}

.feature h3 { font-size: 17px; letter-spacing: -.014em; line-height: 1.45; }

.feature-body p { font-size: 14px; line-height: 1.72; color: var(--wa-body); }

.feature-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tag {
    font-family: var(--wa-mono);
    font-size: 10.8px;
    letter-spacing: .02em;
    color: var(--wa-brand-deep);
    background: var(--wa-brand-soft);
    border: 1px solid rgba(var(--wa-brand-rgb), .18);
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* ---------- package matrix ---------- */

.pkg-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--wa-line);
    border: 1px solid var(--wa-line);
    margin-top: 34px;
}

.pkg-group { background: var(--wa-surface); padding: 22px 24px 24px; }

.pkg-group h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--wa-muted);
}

.pkg-group h3 span {
    font-family: var(--wa-mono);
    font-size: 11px;
    color: var(--wa-brand-deep);
    letter-spacing: .02em;
    background: var(--wa-brand-soft);
    border: 1px solid rgba(var(--wa-brand-rgb), .18);
    border-radius: 3px;
    padding: 1px 5px;
}

.pkg-group .mono-note b { white-space: nowrap; }

.pkg-list { display: flex; flex-wrap: wrap; gap: 6px; }

.pkg {
    font-family: var(--wa-mono);
    font-size: 11.8px;
    color: var(--wa-body);
    background: var(--wa-surface-3);
    border: 1px solid var(--wa-line-strong);
    border-radius: 4px;
    padding: 4px 8px;
    transition: color .16s var(--wa-ease), border-color .16s var(--wa-ease);
}

.pkg:hover { color: var(--wa-brand-deep); border-color: rgba(var(--wa-brand-rgb), .45); }

/* ---------- start / code tabs ---------- */

.start {
    display: grid;
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: clamp(32px, 4vw, 56px);
    align-items: start;
}

.steps { margin-top: 8px; }

.step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--wa-line);
}

.step:first-child { border-top: 1px solid var(--wa-line); }

.step-no {
    font-family: var(--wa-mono);
    font-size: 11px;
    color: var(--wa-brand);
    padding-top: 4px;
    letter-spacing: .06em;
}

.step h3 { font-size: 14.5px; margin-bottom: 5px; letter-spacing: -.01em; }
.step p { font-size: 13.5px; line-height: 1.66; color: var(--wa-muted); }

.step code {
    font-size: 12px;
    background: var(--wa-line);
    border-radius: 3px;
    padding: .08em .32em;
    color: var(--wa-ink);
}

.code-tabs {
    background: var(--wa-code);
    border: 1px solid var(--wa-code-bar);
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 24px 48px -34px rgba(10, 18, 34, .5);
}

.tabs-bar {
    display: flex;
    align-items: stretch;
    background: var(--wa-code-bar);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    overflow-x: auto;
}

.tab {
    padding: 11px 15px;
    background: none;
    border: 0;
    border-bottom: 1.5px solid transparent;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: #93a2b5;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s var(--wa-ease), border-color .18s var(--wa-ease);
}

.tab:hover { color: #c3cedd; }
.tab.is-active { color: #eaf2fd; border-bottom-color: #4d8cf5; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.code-tabs .term-body {
    font-size: 11.8px;
    min-height: 190px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---------- ecosystem entries ---------- */

.entries {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--wa-line-strong);
    margin-top: 34px;
    background: var(--wa-line);
    gap: 1px;
}

.entry {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 26px 24px 24px;
    background: var(--wa-surface);
    min-height: 196px;
    transition: background .22s var(--wa-ease);
}

.entry:hover { background: var(--wa-surface-3); }

.entry-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.entry-no { font-family: var(--wa-mono); font-size: 11px; letter-spacing: .12em; color: var(--wa-faint); }

.entry-go {
    font-size: 14px;
    color: var(--wa-faint);
    transition: transform .22s var(--wa-ease), color .22s var(--wa-ease);
}

.entry:hover .entry-go { color: var(--wa-brand); transform: translate(2px, -2px); }

.entry h3 { font-size: 18px; letter-spacing: -.018em; }
.entry p { font-size: 13.5px; line-height: 1.7; color: var(--wa-muted); }

.entry-foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.soon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .05em;
    color: #8a6a20;
    background: #fbf3dd;
    border: 1px solid #eee0ba;
    border-radius: 3px;
    padding: 2px 6px;
}

[data-bs-theme="dark"] .soon {
    color: #e0bd72;
    background: rgba(201, 154, 46, .12);
    border-color: rgba(201, 154, 46, .3);
}

.soon i { width: 4px; height: 4px; border-radius: 50%; background: #c99a2e; display: block; }

.entry-foot .live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .05em;
    color: #1f6b4c;
    background: #e8f6ee;
    border: 1px solid #c6e6d5;
    border-radius: 3px;
    padding: 2px 6px;
}

[data-bs-theme="dark"] .entry-foot .live {
    color: #7fd0a8;
    background: rgba(38, 162, 105, .12);
    border-color: rgba(38, 162, 105, .3);
}

.entry-foot .live i { width: 4px; height: 4px; border-radius: 50%; background: #2a9d6a; display: block; }

/* ---------- cta ---------- */

.cta { position: relative; padding: clamp(64px, 7vw, 96px) 0; overflow: hidden; }

.cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(42% 58% at 18% 0%, rgba(24, 96, 216, .16), transparent 72%),
        radial-gradient(38% 56% at 84% 92%, rgba(24, 96, 216, .08), transparent 72%);
    pointer-events: none;
}

.cta > .container { position: relative; }

.cta h2 {
    color: #f5f8fc;
    font-size: clamp(1.9rem, 3.6vw, 2.9rem);
    line-height: 1.18;
    margin-bottom: 14px;
}

.cta p { color: #96a3b4; font-size: 15.5px; max-width: 60ch; }

.cta-cmd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

.cmd-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 7px;
    font-family: var(--wa-mono);
    font-size: 12.5px;
    color: #d7e2f0;
    max-width: 100%;
    overflow-x: auto;
}

.cmd-box .prompt { color: #5f9bff; }

.cmd-box button {
    background: none;
    border: 0;
    padding: 0 0 0 12px;
    border-left: 1px solid rgba(255, 255, 255, .14);
    font-family: var(--wa-mono);
    font-size: 11px;
    color: #7d8b9e;
    cursor: pointer;
    white-space: nowrap;
}

.cmd-box button:hover { color: #dbe6f5; }

.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- footer ---------- */

.footer {
    background: var(--wa-dark-2);
    color: #8b96a5;
    padding: 60px 0 26px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.footer-mark {
    font-size: clamp(2.6rem, 9.4vw, 7.4rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: .96;
    /* 水印感：极淡的偏蓝色，避免抢 CTA 的注意力 */
    color: rgba(122, 158, 224, .09);
    margin-bottom: 46px;
    white-space: nowrap;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.footer-brand img { width: auto; height: 24px; opacity: .92; }
.footer-brand span { color: #e6ecf4; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }

.footer-desc { font-size: 12.5px; line-height: 1.75; color: #8792a1; max-width: 34ch; }

.footer-col h4 {
    color: #aab5c3;
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.footer-col a { font-size: 13px; color: #8b96a5; transition: color .18s var(--wa-ease); }
.footer-col a:hover { color: #dbe4ef; }

.footer-col .soon-mini {
    font-family: var(--wa-mono);
    font-size: 11px;
    color: #7a8593;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 3px;
    padding: 0 3px;
    margin-left: 4px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: 12.5px;
    color: #8b96a5;
}

.footer-links .label {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7b8798;
}

.footer-links a:hover { color: #dbe4ef; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 22px;
    font-family: var(--wa-mono);
    font-size: 11px;
    color: #78838f;
}

.footer-bottom a:hover { color: #b9c5d3; }

/* ---------- inner page hero ---------- */

.page-hero {
    position: relative;
    padding: clamp(44px, 5.5vw, 76px) 0 clamp(36px, 4vw, 52px);
    border-bottom: 1px solid var(--wa-line);
    background: linear-gradient(to bottom, rgba(var(--wa-brand-rgb), .03), transparent 72%);
    overflow: hidden;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(58% 78% at 88% 4%, rgba(var(--wa-brand-rgb), .055), transparent 72%);
    pointer-events: none;
}

.page-hero > .container { position: relative; }

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--wa-muted);
    margin-bottom: 22px;
}

.crumb a:hover { color: var(--wa-brand); }

.page-hero h1 {
    font-size: clamp(2.05rem, 4.2vw, 3.35rem);
    line-height: 1.15;
    letter-spacing: -.018em;
    margin-bottom: 18px;
    /* ch 是按数字 0 的宽度算的，对中文约等于 10 个字就换行；
       改用 em（≈ 汉字宽度），让 H1 自然折行，模板里不再手写 <br> */
    max-width: 16em;
}

.page-hero .lede { max-width: 66ch; }

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 26px;
    font-family: var(--wa-mono);
    font-size: 11.5px;
    color: var(--wa-muted);
}

.page-meta span { display: inline-flex; align-items: center; gap: 7px; }
.page-meta i { width: 4px; height: 4px; background: var(--wa-brand); border-radius: 50%; display: block; }

/* ---------- feature detail blocks ---------- */

.feature-block {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 56px;
    padding: clamp(44px, 5vw, 64px) 0;
    border-top: 1px solid var(--wa-line);
}

.feature-block > * { min-width: 0; }

.fb-side { position: sticky; top: 100px; align-self: start; }

.fb-no { font-family: var(--wa-mono); font-size: 11px; letter-spacing: .14em; color: var(--wa-brand); margin-bottom: 8px; }

.fb-title { font-size: 15px; font-weight: 600; color: var(--wa-ink); letter-spacing: -.01em; line-height: 1.5; }

.fb-body h2 { font-size: clamp(1.5rem, 2.4vw, 1.95rem); line-height: 1.28; margin-bottom: 16px; }

.fb-body p {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--wa-body);
    margin-bottom: 14px;
    max-width: 80ch;
}

.fb-body p:last-child { margin-bottom: 0; }

.fb-body code {
    font-size: 12.8px;
    background: var(--wa-line);
    border-radius: 3px;
    padding: .08em .34em;
    color: var(--wa-ink);
}

.fb-body .table { margin: 22px 0 8px; }

.fb-note {
    position: relative;
    margin-top: 20px;
    padding: 14px 18px 14px 36px;
    border: 1px solid var(--wa-line);
    border-left: 2px solid var(--wa-brand);
    background: var(--wa-surface-3);
    font-size: 13px;
    line-height: 1.72;
    color: var(--wa-body);
}

.fb-note::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 22px;
    width: 6px;
    height: 6px;
    background: var(--wa-brand);
}

.fb-note b { color: var(--wa-ink); }

/* ---------- FAQ（原生 details，无需 JS） ---------- */

.faq-list {
    margin-top: 24px;
    border-top: 1px solid var(--wa-line-strong);
}

.faq { border-bottom: 1px solid var(--wa-line); }

.faq summary {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--wa-ink);
    cursor: pointer;
    list-style: none;
    transition: color .18s var(--wa-ease);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    margin-left: auto;
    font-family: var(--wa-mono);
    font-size: 14px;
    color: var(--wa-muted);
}

.faq[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--wa-brand-deep); }
.faq summary:focus-visible { outline-offset: -2px; }

.faq-body {
    padding: 0 0 18px;
    max-width: 78ch;
    font-size: 14px;
    line-height: 1.78;
    color: var(--wa-body);
}

.faq-body p { margin: 0; }
.faq-body p + p { margin-top: 10px; }

/* ---------- package table page ---------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 8px; }

.filter {
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--wa-line-strong);
    border-radius: 999px;
    background: transparent;
    font-family: var(--wa-mono);
    font-size: 11.5px;
    letter-spacing: .02em;
    color: var(--wa-body);
    cursor: pointer;
    transition: all .18s var(--wa-ease);
}

.filter:hover { border-color: var(--wa-ink); }

.filter.is-active {
    background: var(--wa-ink);
    border-color: var(--wa-ink);
    color: var(--wa-surface);
}

.filter .count { margin-left: 6px; opacity: .55; font-size: 11px; font-variant-numeric: tabular-nums; }

.pkg-table td:nth-child(1) { width: 248px; white-space: nowrap; }
.pkg-table td:nth-child(1) code {
    background: none;
    padding: 0;
    font-size: 12.6px;
    font-weight: 600;
    color: var(--wa-ink);
    letter-spacing: -.01em;
}
.pkg-table td:nth-child(2) { width: 96px; }
.pkg-table td:nth-child(4) { width: 170px; color: var(--wa-muted); font-size: 13px; }
.pkg-table tr.is-hidden { display: none; }

/* 分类标签：独立一列，整列左对齐；按 data-cat 着色 */
.pkg-cat {
    display: inline-block;
    font-family: var(--wa-mono);
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .04em;
    color: var(--cat-ink, var(--wa-muted));
    background: var(--cat-bg, transparent);
    border: 1px solid var(--cat-line, var(--wa-line));
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* 五类能力包各自的标记色（低饱和，亮暗各一套） */
tr[data-cat="core"] .pkg-cat { --cat-ink: #1a56c4; --cat-bg: rgba(24, 96, 216, .09); --cat-line: rgba(24, 96, 216, .22); }
tr[data-cat="auth"] .pkg-cat { --cat-ink: #6b46c1; --cat-bg: rgba(107, 70, 193, .09); --cat-line: rgba(107, 70, 193, .22); }
tr[data-cat="api"] .pkg-cat { --cat-ink: #0e7490; --cat-bg: rgba(14, 116, 144, .09); --cat-line: rgba(14, 116, 144, .22); }
tr[data-cat="ops"] .pkg-cat { --cat-ink: #9a5b0b; --cat-bg: rgba(154, 91, 11, .09); --cat-line: rgba(154, 91, 11, .22); }
tr[data-cat="ai"] .pkg-cat { --cat-ink: #a8256f; --cat-bg: rgba(168, 37, 111, .09); --cat-line: rgba(168, 37, 111, .22); }

[data-bs-theme="dark"] tr[data-cat="core"] .pkg-cat { --cat-ink: #8ab4ff; --cat-bg: rgba(91, 155, 255, .14); --cat-line: rgba(91, 155, 255, .32); }
[data-bs-theme="dark"] tr[data-cat="auth"] .pkg-cat { --cat-ink: #bda8ff; --cat-bg: rgba(150, 120, 255, .16); --cat-line: rgba(150, 120, 255, .34); }
[data-bs-theme="dark"] tr[data-cat="api"] .pkg-cat { --cat-ink: #6fd3e0; --cat-bg: rgba(14, 160, 190, .16); --cat-line: rgba(14, 160, 190, .34); }
[data-bs-theme="dark"] tr[data-cat="ops"] .pkg-cat { --cat-ink: #f0bb70; --cat-bg: rgba(200, 130, 30, .16); --cat-line: rgba(200, 130, 30, .34); }
[data-bs-theme="dark"] tr[data-cat="ai"] .pkg-cat { --cat-ink: #f79ac8; --cat-bg: rgba(210, 60, 140, .16); --cat-line: rgba(210, 60, 140, .34); }

.empty-filter { padding: 40px 0; font-family: var(--wa-mono); font-size: 12px; color: var(--wa-muted); }

/* ---------- placeholder pages ---------- */

.ph-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: clamp(32px, 4vw, 56px);
    align-items: start;
}

.ph-body p { font-size: 15px; line-height: 1.85; color: var(--wa-body); max-width: 70ch; margin-bottom: 16px; }

.ph-h2 { font-size: 19px; margin: 36px 0 14px; letter-spacing: -.015em; }

.ph-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--wa-line-strong); }

.ph-list li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--wa-line);
    font-size: 14px;
    line-height: 1.7;
}

.ph-list li .no { font-family: var(--wa-mono); font-size: 11px; color: var(--wa-brand); padding-top: 4px; }
.ph-list li b { color: var(--wa-ink); font-weight: 600; }

.ph-side .ph-card + .ph-card { margin-top: 16px; }

.ph-card {
    border: 1px solid var(--wa-line-strong);
    background: var(--wa-surface-3);
    padding: 22px 22px 24px;
}

.ph-card h3 {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-muted);
    margin-bottom: 14px;
}

.ph-card p { font-size: 13px; line-height: 1.7; color: var(--wa-muted); margin-bottom: 12px; }
.ph-card p:last-child { margin-bottom: 0; }
.ph-card .btn { width: 100%; margin-top: 6px; }

.ph-timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }

.ph-timeline li {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--wa-line);
    color: var(--wa-muted);
}

.ph-timeline li:last-child { border-bottom: 0; }

.ph-timeline .state {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: #8a6a20;
    background: #fbf3dd;
    border: 1px solid #eee0ba;
    border-radius: 3px;
    padding: 0 4px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

[data-bs-theme="dark"] .ph-timeline .state {
    color: #e0bd72;
    background: rgba(201, 154, 46, .12);
    border-color: rgba(201, 154, 46, .3);
}

.ph-timeline .state-done {
    color: #1f6b4c;
    background: #e8f6ee;
    border-color: #c6e6d5;
}

[data-bs-theme="dark"] .ph-timeline .state-done {
    color: #7fd0a8;
    background: rgba(38, 162, 105, .12);
    border-color: rgba(38, 162, 105, .3);
}

/* ---------- content pages ---------- */

.page-head {
    position: relative;
    padding: clamp(36px, 4.6vw, 58px) 0 clamp(26px, 3vw, 36px);
    border-bottom: 1px solid var(--wa-line);
    background: linear-gradient(to bottom, rgba(var(--wa-brand-rgb), .026), transparent 78%);
    overflow: hidden;
}

.page-head::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(56% 80% at 90% 0%, rgba(var(--wa-brand-rgb), .05), transparent 72%);
    pointer-events: none;
}

.page-head > .container { position: relative; }

.page-head h1 {
    font-size: clamp(1.8rem, 3.4vw, 2.65rem);
    line-height: 1.2;
    letter-spacing: -.018em;
    margin: 10px 0 12px;
    max-width: 22em;
}

.page-head .desc { font-size: 15.5px; line-height: 1.78; color: var(--wa-body); max-width: 68ch; }

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 296px;
    gap: clamp(30px, 4vw, 52px);
    padding: clamp(34px, 4.4vw, 52px) 0 clamp(52px, 6vw, 84px);
}

.content-grid-full { grid-template-columns: minmax(0, 1fr); }

.content-main { min-width: 0; }
.content-side { min-width: 0; display: flex; flex-direction: column; gap: 26px; }

/* 首页「最新更新」：复用文章列表，只在头部做两端对齐 */
.latest-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
}

.latest-head .h2 { margin-bottom: 0; }

.post-list { border-top: 1px solid var(--wa-line-strong); }

.post {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    padding: 22px 8px 22px 0;
    border-bottom: 1px solid var(--wa-line);
    transition: background .18s var(--wa-ease);
}

.post:hover { background: var(--wa-hover); }

.post-body { flex: 1 1 auto; min-width: 0; }

.post-title {
    display: block;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--wa-ink);
    letter-spacing: -.012em;
}

.post-title:hover { color: var(--wa-brand-deep); }

.post-desc { margin-top: 7px; font-size: 13.6px; line-height: 1.72; color: var(--wa-body); }

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-family: var(--wa-mono);
    font-size: 10.8px;
    letter-spacing: .02em;
    color: var(--wa-muted);
}

.post-thumb {
    flex: 0 0 auto;
    width: 148px;
    height: 96px;
    object-fit: cover;
    border: 1px solid var(--wa-line);
    border-radius: 6px;
    background: var(--wa-surface-2);
}

.empty {
    padding: 28px 22px;
    border: 1px dashed var(--wa-line-strong);
    background: color-mix(in srgb, var(--wa-surface-3) 55%, transparent);
    font-size: 14px;
    line-height: 1.7;
    color: var(--wa-muted);
}

.empty a { color: var(--wa-brand); }

.side-block { border-top: 2px solid var(--wa-ink); padding-top: 14px; }

.side-title {
    position: relative;
    padding-left: 10px;
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--wa-muted);
    margin-bottom: 10px;
}

.side-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .58em;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--wa-brand);
}

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 9px 0; border-bottom: 1px dashed var(--wa-line); }
.side-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.side-list a { display: block; font-size: 13.4px; line-height: 1.6; color: var(--wa-body); }
.side-list a:hover { color: var(--wa-brand); }

.side-note p { font-size: 13px; line-height: 1.72; color: var(--wa-muted); margin-bottom: 12px; }
.side-note .btn { width: 100%; }

.article-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--wa-body);
    padding-left: 14px;
    border-left: 2px solid var(--wa-line-strong);
    max-width: 66ch;
}

.article-cover {
    width: 100%;
    height: auto;
    border: 1px solid var(--wa-line);
    border-radius: 8px;
    margin-bottom: 26px;
    background: var(--wa-surface-2);
}

.prose { font-size: 15.5px; line-height: 1.9; color: var(--wa-body); word-break: break-word; }
.prose > * + * { margin-top: 1.05em; }

.prose h2 {
    font-size: 1.42rem;
    line-height: 1.36;
    letter-spacing: -.02em;
    margin-top: 1.9em;
    padding-left: 14px;
    border-left: 3px solid rgba(var(--wa-brand-rgb), .35);
    scroll-margin-top: 96px;
}

.prose h3 {
    font-size: 1.13rem;
    line-height: 1.45;
    letter-spacing: -.01em;
    margin-top: 1.5em;
    scroll-margin-top: 96px;
}

.prose h4 { font-size: 1rem; margin-top: 1.3em; }

.prose a { color: var(--wa-brand); border-bottom: 1px solid rgba(var(--wa-brand-rgb), .3); }
.prose a:hover { border-bottom-color: var(--wa-brand); }

.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--wa-faint); }

.prose blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 18px;
    border-left: 2px solid var(--wa-brand);
    color: var(--wa-muted);
    font-size: 14.8px;
}

.prose blockquote p { margin: 0; }

.prose img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--wa-line);
    border-radius: 6px;
    margin: 1.5em 0;
}

.prose hr { border: 0; border-top: 1px solid var(--wa-line); margin: 2.2em 0; }

.prose code {
    font-family: var(--wa-mono);
    font-size: .875em;
    background: var(--wa-line);
    border-radius: 4px;
    padding: .12em .38em;
    color: var(--wa-ink);
}

.prose pre {
    background: var(--wa-code);
    border: 1px solid var(--wa-code-bar);
    border-radius: 9px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: #c3cedd;
    font-size: 12.4px;
    line-height: 1.9;
}

.prose table { width: 100%; border-collapse: collapse; font-size: 13.6px; margin: 1.5em 0; }

.prose th {
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wa-muted);
    text-align: left;
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--wa-line-strong);
}

.prose td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--wa-line); vertical-align: top; }

.custom-fields { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--wa-line); }

.custom-field {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.72;
}

.custom-label {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wa-muted);
    padding-top: 4px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--wa-line);
}

.pn-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--wa-line);
}

.pn-item {
    padding: 14px 16px;
    border: 1px solid var(--wa-line);
    background: var(--wa-surface-3);
    transition: border-color .18s var(--wa-ease);
}

.pn-item:hover { border-color: var(--wa-line-strong); }
.pn-item.is-next { text-align: right; }

.pn-label {
    display: block;
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-faint);
    margin-bottom: 4px;
}

.pn-item a { font-size: 14px; font-weight: 600; color: var(--wa-ink); line-height: 1.5; }
.pn-item a:hover { color: var(--wa-brand); }
.pn-none { font-size: 13px; color: var(--wa-faint); }

.preview-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    padding: 11px 16px;
    margin: 20px auto 0;
    background: #fbf3dd;
    border: 1px solid #eee0ba;
    border-left: 2px solid #c99a2e;
    font-size: 13px;
    color: #7a5c14;
}

[data-bs-theme="dark"] .preview-bar {
    background: rgba(201, 154, 46, .1);
    border-color: rgba(201, 154, 46, .28);
    color: #e0bd72;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.tag-cloud .tag {
    font-family: var(--wa-sans);
    font-size: 13px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--wa-surface-3);
    border: 1px solid var(--wa-line-strong);
    color: var(--wa-body);
}

.tag-cloud .tag:hover { border-color: var(--wa-ink); color: var(--wa-ink); }

.tag-cloud .tag.is-active {
    background: var(--wa-ink);
    border-color: var(--wa-ink);
    color: var(--wa-surface);
}

.link-group { margin-bottom: 30px; }

.link-group h2 {
    font-family: var(--wa-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--wa-muted);
    margin-bottom: 14px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1px;
    background: var(--wa-line);
    border: 1px solid var(--wa-line);
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--wa-surface);
    min-height: 76px;
    transition: background .18s var(--wa-ease);
}

.link-card:hover { background: var(--wa-surface-3); }
.link-card img { max-width: 100%; height: 32px; object-fit: contain; }
.link-name { font-size: 14px; font-weight: 600; color: var(--wa-ink); }
.link-desc { font-size: 12.5px; line-height: 1.6; color: var(--wa-muted); }

.search-form { display: flex; gap: 8px; margin-top: 20px; max-width: 620px; }

.search-form .form-control {
    height: 42px;
    background: var(--wa-surface-3);
    border-color: var(--wa-line-strong);
    color: var(--wa-ink);
    font-size: 14px;
}

.search-form .form-control:focus {
    border-color: var(--wa-brand);
    box-shadow: 0 0 0 3px rgba(var(--wa-brand-rgb), .12);
}

.search-form .btn { height: 42px; }

.hotwords { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }

.hotwords-label {
    font-family: var(--wa-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-faint);
    margin-right: 4px;
}

.result-count { margin-bottom: 14px; font-family: var(--wa-mono); font-size: 12px; color: var(--wa-muted); }
.result-count strong { color: var(--wa-ink); font-weight: 600; }

.toc { position: sticky; top: 96px; }
.toc-nav { border-left: 1px solid var(--wa-line-strong); padding-left: 14px; list-style: none; margin: 0; }

.toc-nav a { display: block; padding: 4px 0; font-size: 12.8px; line-height: 1.55; color: var(--wa-muted); border: 0; }
.toc-nav a:hover { color: var(--wa-ink); }
.toc-nav a.is-sub { padding-left: 12px; font-size: 12.2px; }
.toc-nav a.is-active { color: var(--wa-brand); font-weight: 600; }

/* ---------- reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .7s var(--wa-ease), transform .7s var(--wa-ease);
}

.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    .section-grid { grid-template-columns: 1fr; gap: 22px; }
    .rail { position: static; flex-direction: row; align-items: baseline; gap: 12px; }
    .rail-label { text-transform: none; letter-spacing: .04em; }
    .feature { grid-template-columns: 44px minmax(0, 1fr); gap: 10px 26px; }
    .feature-body { grid-column: 2; }
    .feature h3 { grid-column: 2; }
    .page-hero h1 { max-width: 20em; }
    .feature-block { grid-template-columns: 1fr; gap: 18px; }
    .fb-side { position: static; display: flex; align-items: baseline; gap: 12px; }
    .fb-no { margin-bottom: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
    .content-grid { grid-template-columns: 1fr; }
    .content-side { flex-direction: row; flex-wrap: wrap; gap: 22px; }
    .content-side > * { flex: 1 1 260px; }
    .toc { display: none; }
}

@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .term-wrap { margin-top: 14px; }
    .split, .split-wide-right, .start { grid-template-columns: 1fr; }
    .entries { grid-template-columns: 1fr; }
    .ph-grid { grid-template-columns: 1fr; }
    .pkg-groups { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(3) { border-left: 0; padding-left: 0; }
    .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid var(--wa-line); }
    .principles { grid-template-columns: 1fr; }
    .principle { border-right: 0; padding: 22px 0 26px; }
    .principle:not(:first-child) { padding-left: 0; }
    .layer { grid-template-columns: 1fr; gap: 10px; }
    .layer-name { padding-top: 0; display: flex; align-items: baseline; gap: 10px; }
    .layer-name span { margin-top: 0; }
}

@media (max-width: 760px) {
    .brand-ver { display: none; }
    .h2 { font-size: 1.72rem; line-height: 1.3; }
    .page-hero h1,
    .page-head h1 { max-width: none; }
    .hero h1 { font-size: clamp(2rem, 8.4vw, 2.6rem); letter-spacing: -.014em; }
    .table { font-size: 12.9px; }
    .table > :not(caption) > * > * { padding: 12px 8px 12px 0; }
    .table > thead th { font-size: 11px; letter-spacing: .08em; white-space: normal; }
    .table > tbody > tr > td:first-child { white-space: normal; }
    .table code { word-break: break-word; }
    .fb-body .table td:first-child { width: 92px; min-width: 92px; }

    /* 对比表：三列在窄屏挤不下，改成「维度 + 两组带标签的答案」堆叠 */
    .table-compare thead { display: none; }
    .table-compare, .table-compare tbody { display: block; }

    .table-compare tr {
        display: block;
        padding: 14px 0 16px;
        border-bottom: 1px solid var(--wa-line);
    }

    .table-compare tr:last-child { border-bottom: 0; }

    .table-compare td { display: block; padding: 0; border: 0; background: none; }

    .table-compare td:first-child {
        margin-bottom: 8px;
        font-family: var(--wa-mono);
        font-size: 11px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--wa-muted);
    }

    .table-compare td:nth-child(2)::before,
    .table-compare td:nth-child(3)::before {
        display: block;
        margin-bottom: 3px;
        font-family: var(--wa-mono);
        font-size: 11px;
        letter-spacing: .08em;
        color: var(--wa-faint);
    }

    .table-compare td:nth-child(2)::before { content: "常见做法"; }
    .table-compare td:nth-child(3)::before { content: "WiseAdmin"; color: var(--wa-brand); }

    .table-compare td:nth-child(3) {
        margin-top: 10px;
        padding: 10px 12px;
        background: rgba(var(--wa-brand-rgb), .05);
        border-left: 2px solid rgba(var(--wa-brand-rgb), .35);
        box-shadow: none;
    }

    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: -1rem;
        padding: 0 1rem 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter { flex: 0 0 auto; }
    .pkg-table { min-width: 0; }
    .pkg-table thead { display: none; }
    .pkg-table, .pkg-table tbody { display: block; }
    .pkg-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        padding: 16px 0;
        border-bottom: 1px solid var(--wa-line);
    }
    .pkg-table tr:last-child { border-bottom: 0; }
    .pkg-table td { display: block; width: auto; padding: 0; border: 0; }
    .pkg-table td:nth-child(1),
    .pkg-table td:nth-child(2) { width: auto; flex: 0 0 auto; }
    .pkg-table td:nth-child(1) code { font-size: 13px; }
    .pkg-table td:nth-child(3) {
        width: auto;
        flex: 1 0 100%;
        margin-top: 4px;
        font-size: 13.4px;
        line-height: 1.68;
    }
    .pkg-table td:nth-child(4) {
        width: auto;
        flex: 1 0 100%;
        margin-top: 4px;
        font-size: 12px;
        color: var(--wa-muted);
    }
    .pkg-table td:nth-child(4)::before {
        content: "场景 / ";
        font-family: var(--wa-mono);
        font-size: 11px;
        letter-spacing: .06em;
        color: var(--wa-faint);
    }
    .post { gap: 14px; padding: 18px 0; }
    .post-thumb { width: 104px; height: 72px; }
    .fit { grid-template-columns: 1fr; }
    .pn-nav { grid-template-columns: 1fr; }
    .pn-item.is-next { text-align: left; }
    .custom-field { grid-template-columns: 1fr; gap: 2px; }
    .search-form { flex-direction: column; }
    .search-form .btn { width: 100%; }
    .content-side { flex-direction: column; }
    .prose { font-size: 15px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { font-size: 11px; }
    .stat { padding: 20px 16px; }
    .stat:first-child { padding-left: 0; }
    .stat:nth-child(3) { padding-left: 0; }
    .plain-code { padding: 14px 15px; }
    .plain-code code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.4px; }
}

@media (max-width: 520px) {
    .btn-lg { width: 100%; }
    .hero-actions { gap: 8px; }
    .term-body { font-size: 11.5px; }
    .footer-mark { font-size: 2.4rem; }
    .page-hero h1 { font-size: 1.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- utilities ---------- */

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }

/* 表格横向滚动容器：模板里所有 <table> 都由 .table-wrap 包裹。
   没有它时，nowrap 的包名 / 长命令会顶破容器，再被 body 的 overflow-x: hidden 静默裁掉。 */
.table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-wrap .table { margin-bottom: 0; }

/* 段落纵向节奏：base 里有 p { margin: 0 }，多段容器必须显式补间距，
   否则 .stack-* 内的文字会全部贴在一起。 */
.stack-md > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 18px; }

/* 横向滚动提示：滚到末尾时渐隐层/阴影消失（状态类由 site.js 维护） */
.term.is-scrollable::after,
.plain-code.is-scrollable::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, color-mix(in srgb, var(--wa-code) 0%, transparent), var(--wa-code) 72%);
    pointer-events: none;
    transition: opacity .2s var(--wa-ease);
}

.term.is-scrollable::after { border-radius: 0 11px 11px 0; }
.plain-code.is-scrollable::after { border-radius: 0 8px 8px 0; }

.term.is-scroll-end::after,
.plain-code.is-scroll-end::after { opacity: 0; }

.table-wrap.is-scrollable { box-shadow: inset -18px 0 14px -14px rgba(11, 12, 14, .2); }
.table-wrap.is-scroll-end { box-shadow: none; }
[data-bs-theme="dark"] .table-wrap.is-scrollable { box-shadow: inset -18px 0 14px -14px rgba(0, 0, 0, .55); }
