:root {
    --paper: #f2efe6;
    --paper-2: #fbf8f0;
    --paper-3: #e9e4d7;
    --ink: #11243a;
    --ink-soft: #506073;
    --line: rgba(17, 36, 58, .16);
    --line-strong: rgba(17, 36, 58, .36);
    --blue: #1646e8;
    --blue-deep: #0b2a91;
    --orange: #f05a2a;
    --orange-soft: #ffe2d6;
    --teal: #0b746b;
    --violet: #6b4bd6;
    --gold: #9a6700;
    --sheet: #0b1929;
    --sheet-2: #10253a;
    --sheet-line: rgba(200, 222, 244, .16);
    --mint: #8ef0c4;
    --sky: #7dd3fc;
    --code-text: #dbe7f4;
    --code-muted: #6d849b;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
    --shadow: 5px 5px 0 rgba(17, 36, 58, .1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(17, 36, 58, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 36, 58, .035) 1px, transparent 1px),
        linear-gradient(rgba(22, 70, 232, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 70, 232, .028) 1px, transparent 1px);
    background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { color: #fff; background: var(--orange); }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.wrap {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    z-index: 200;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: #fff;
    background: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
    transform: translateY(-160%);
    transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 站点头部 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(242, 239, 230, .9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-console {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 8px 12px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: linear-gradient(105deg, #0b1929 0%, #0d2138 100%);
    color: var(--code-text);
    box-shadow: 4px 4px 0 rgba(22, 70, 232, .16);
}

.header-console::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(125, 211, 252, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, .07) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}

.header-console::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    left: -30%;
    width: 28%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(142, 240, 196, .12), transparent);
    transform: skewX(-18deg);
    animation: console-scan 5.5s ease-in-out infinite;
    pointer-events: none;
}

.console-ring {
    position: relative;
    z-index: 2;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(125, 211, 252, .5);
    border-radius: 50%;
}

.console-ring::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(142, 240, 196, .7);
    border-radius: 50%;
    animation: console-pulse 2.4s ease-in-out infinite;
}

.console-ring i {
    position: absolute;
    top: 1px;
    left: 9px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 7px rgba(240, 90, 42, .8);
}

.console-body {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
}

.console-kicker {
    display: block;
    margin-bottom: 3px;
    color: #7f97ae;
    font-family: var(--mono);
    font-size: 6.5px;
    line-height: 1.2;
    letter-spacing: .14em;
    white-space: nowrap;
}

.console-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.35;
    white-space: nowrap;
}

.console-prompt {
    flex: 0 0 auto;
    color: var(--orange);
}

.console-text {
    min-width: 0;
    overflow: hidden;
    color: #dbe7f4;
    text-overflow: ellipsis;
    transition: opacity .18s ease, transform .18s ease;
}

.console-text.is-switching {
    opacity: 0;
    transform: translateY(3px);
}

.console-caret {
    flex: 0 0 5px;
    width: 5px;
    height: 11px;
    background: var(--mint);
    animation: console-blink 1s steps(2, start) infinite;
}

.console-signal {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    padding-left: 2px;
}

.console-signal i {
    width: 2px;
    height: 42%;
    background: linear-gradient(180deg, var(--mint), rgba(125, 211, 252, .5));
    animation: console-signal 1.25s ease-in-out infinite;
}

.console-signal i:nth-child(2) { height: 72%; animation-delay: .14s; }
.console-signal i:nth-child(3) { height: 100%; animation-delay: .28s; }
.console-signal i:nth-child(4) { height: 58%; animation-delay: .42s; }
.console-signal i:nth-child(5) { height: 84%; animation-delay: .56s; }

.console-meta {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding-left: 10px;
    border-left: 1px solid rgba(200, 222, 244, .16);
    color: #6e879e;
    font-family: var(--mono);
    font-size: 6px;
    line-height: 1.5;
    letter-spacing: .1em;
    text-align: right;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-mark {
    position: relative;
    width: 44px;
    height: 44px;
    overflow: visible;
    background: transparent;
    color: #3a3f46;
}

.brand-mark svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: .12em;
}

.brand-text small {
    margin-top: 5px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .14em;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
}

.top-nav a {
    position: relative;
    padding: 6px 0;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--ink-soft);
}

.top-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: width .2s ease;
}

.top-nav a:hover { color: var(--ink); }
.top-nav a:hover::after { width: 100%; }

.header-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .06em;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    flex: 0 0 auto;
}

.header-action:hover {
    color: var(--paper-2);
    background: var(--ink);
    transform: translateY(-1px);
}

.header-action svg { width: 15px; height: 15px; }

/* ---------- 首屏 ---------- */
.hero {
    position: relative;
    padding: 78px 0 92px;
}

.hero::after {
    content: "";
    position: absolute;
    top: 110px;
    right: 24px;
    bottom: 110px;
    width: 1px;
    background: var(--line);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    gap: 58px;
    align-items: center;
}

.kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.kicker::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--orange);
    flex: 0 0 auto;
}

.hero h1 {
    margin: 22px 0 24px;
    font-family: var(--sans);
    font-size: clamp(50px, 6.1vw, 82px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.055em;
}

.marker {
    position: relative;
    color: var(--blue);
    white-space: nowrap;
    background-image: linear-gradient(180deg, transparent 69%, rgba(240, 90, 42, .34) 69%, rgba(240, 90, 42, .34) 93%, transparent 93%);
}

.hero-lead {
    max-width: 600px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 15.5px;
    line-height: 1.9;
    text-wrap: pretty;
}

.hero-lead code {
    padding: 1px 5px;
    border: 1px solid var(--line);
    background: rgba(251, 248, 240, .8);
    color: var(--ink);
    font-family: var(--mono);
    font-size: .9em;
}

.ai-note {
    display: inline-block;
    margin-top: 11px;
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.7;
}

.ai-note::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 7px;
    background: var(--orange);
    vertical-align: 2px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 19px;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.3;
    box-shadow: 3px 3px 0 var(--ink);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}

.btn-primary {
    border-color: var(--blue-deep);
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover { background: var(--blue-deep); }

.btn .arrow {
    font-size: 15px;
    line-height: 1;
}

.btn svg { width: 15px; height: 15px; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 560px;
    margin-top: 40px;
    border-top: 1px solid var(--line);
}

.stat {
    padding: 17px 18px 0 0;
    border-right: 1px solid var(--line);
}

.stat:not(:first-child) { padding-left: 18px; }
.stat:last-child { border-right: 0; }

.stat strong {
    display: block;
    font-family: var(--mono);
    font-size: 30px;
    line-height: 1;
    letter-spacing: -.04em;
}

.stat span {
    display: block;
    margin-top: 8px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: .08em;
}

/* 首屏制图面板 */
.hero-art {
    position: relative;
    width: 100%;
    max-width: 520px;
    justify-self: end;
    padding: 24px 18px 30px 20px;
}

.hero-art::before {
    content: "";
    position: absolute;
    inset: 0 8px 8px 0;
    border: 1px solid var(--line-strong);
    pointer-events: none;
}

.art-label {
    position: absolute;
    top: 0;
    left: 20px;
    z-index: 3;
    padding: 0 7px;
    background: var(--paper);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .12em;
}

.art-cross {
    position: absolute;
    top: 4px;
    right: 0;
    width: 16px;
    height: 16px;
    opacity: .6;
}

.art-cross::before,
.art-cross::after {
    content: "";
    position: absolute;
    background: var(--ink);
}

.art-cross::before { left: 7px; top: 0; width: 1px; height: 16px; }
.art-cross::after { top: 7px; left: 0; width: 16px; height: 1px; }

.sheet {
    position: relative;
    z-index: 2;
    background: var(--sheet);
    border: 1.5px solid #07111c;
    color: var(--code-text);
    box-shadow: 14px 14px 0 rgba(22, 70, 232, .16), 1px 1px 0 rgba(17, 36, 58, .5);
    transform: rotate(-1.4deg);
}

.sheet-head,
.sheet-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #8da3ba;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .14em;
}

.sheet-head { border-bottom: 1px solid var(--sheet-line); }
.sheet-foot { border-top: 1px solid var(--sheet-line); }

.sheet-head .sheet-file {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #c9daeb;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 9px rgba(142, 240, 196, .65);
}

.sheet-body {
    position: relative;
    min-height: 330px;
    padding: 20px 16px;
    overflow: hidden;
}

.sheet-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(156, 196, 235, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(156, 196, 235, .055) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.sheet-draft {
    position: absolute;
    right: -24px;
    bottom: -18px;
    width: 82%;
    height: auto;
    color: #76a5d6;
    opacity: .16;
    pointer-events: none;
}

.sheet-code {
    position: relative;
    z-index: 1;
    margin: 0;
    overflow: hidden;
    color: var(--code-text);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.8;
    tab-size: 2;
}

.sheet-code .code-line {
    display: flex;
    min-width: max-content;
}

.sheet-code .ln {
    width: 23px;
    flex: 0 0 23px;
    color: #50677e;
    text-align: right;
    padding-right: 10px;
    user-select: none;
}

.sheet-code .lc { white-space: pre; }

.art-stamp {
    position: absolute;
    z-index: 4;
    right: -8px;
    bottom: 0;
    padding: 10px 13px 9px;
    background: var(--orange);
    border: 1.5px solid var(--ink);
    color: #fff;
    box-shadow: 4px 4px 0 var(--ink);
    font-family: var(--mono);
    font-size: 26px;
    font-weight: 700;
    line-height: .9;
    letter-spacing: -.05em;
    transform: rotate(3deg);
}

.art-stamp span {
    display: block;
    margin-top: 5px;
    font-size: 7px;
    font-weight: 400;
    letter-spacing: .14em;
}

.art-note {
    position: absolute;
    z-index: 5;
    left: -18px;
    bottom: 46px;
    max-width: 178px;
    padding: 9px 11px;
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 8px;
    line-height: 1.7;
    transform: rotate(-2.5deg);
    box-shadow: 3px 3px 0 rgba(17, 36, 58, .08);
}

/* ---------- 语法配色 ---------- */
.tok-comment { color: #738ca4; font-style: italic; }
.tok-string { color: #a8e6a3; }
.tok-number { color: #ffb86b; }
.tok-paren { color: #6e879f; }
.tok-builtin { color: var(--sky); }
.tok-keyword { color: #f0a6ff; font-weight: 600; }
.tok-fn { color: #ffd479; }
.tok-constant { color: #ff9070; }
.tok-symbol { color: #dbe7f4; }

/* ---------- 函数库 ---------- */
.library {
    position: relative;
    padding: 24px 0 25px;
    border-top: 1.5px solid var(--ink);
    background: rgba(251, 248, 240, .46);
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 2.3fr) minmax(260px, 360px);
    gap: 32px;
    align-items: center;
    margin-bottom: 18px;
}

.section-stamp {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--orange);
    background:
        linear-gradient(90deg, rgba(22, 70, 232, .055), rgba(22, 70, 232, 0) 64%),
        var(--paper-2);
}

.section-stamp::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 4px;
    height: 4px;
    background: var(--orange);
}

.section-stamp-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.section-stamp-mark {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: var(--ink);
}

.section-stamp-mark svg {
    display: block;
    width: 100%;
    height: 100%;
}

.section-stamp-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.section-stamp-copy strong {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: .1em;
}

.section-stamp-copy small {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7.5px;
    line-height: 1.2;
    letter-spacing: .08em;
}

.section-stamp-note {
    flex: 1 1 auto;
    margin: 0;
    padding-right: 14px;
    border-right: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 11.4px;
    line-height: 1.6;
}

.section-head h2 {
    margin: 10px 0 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.04em;
}

.section-head h2 .dot { color: var(--orange); }

.section-head > p {
    margin: 0 0 4px;
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.85;
}

.toolbar {
    position: relative;
    padding: 17px;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    box-shadow: 5px 5px 0 rgba(17, 36, 58, .09);
}

.toolbar-top {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.search {
    display: flex;
    flex: 1 1 380px;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    background: #fffdf8;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 70, 232, .1);
}

.search svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--ink-soft);
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
}

.search input::placeholder { color: #84909d; }

.search kbd,
.result-hint kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    background: var(--paper);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1;
}

.search-hint {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    flex: 0 0 auto;
}

.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .02em;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.filter-chip b {
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 11px;
}

.filter-chip .chip-en {
    font-size: 9.5px;
    opacity: .75;
    letter-spacing: .06em;
}

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

.filter-chip.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-2);
}

.filter-chip.is-active b,
.filter-chip.is-active .chip-en { color: var(--paper-2); }

.result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .05em;
}

.result-bar strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

.result-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fn-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.fn-card {
    --tone: var(--blue);
    --tone-soft: rgba(22, 70, 232, .07);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 20px 0;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: card-in .45s both;
    animation-delay: calc(var(--i, 0) * 28ms);
    transition: transform .2s ease, box-shadow .2s ease;
}

.fn-card:hover {
    transform: translateY(-3px);
    box-shadow: 7px 8px 0 rgba(17, 36, 58, .12);
}

.fn-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tone);
}

.fn-card[data-cat="text"] { --tone: var(--blue); --tone-soft: rgba(22, 70, 232, .07); }
.fn-card[data-cat="list"] { --tone: var(--orange); --tone-soft: rgba(240, 90, 42, .08); }
.fn-card[data-cat="entity"] { --tone: var(--teal); --tone-soft: rgba(11, 116, 107, .08); }
.fn-card[data-cat="geom"] { --tone: var(--violet); --tone-soft: rgba(107, 75, 214, .08); }
.fn-card[data-cat="system"] { --tone: var(--gold); --tone-soft: rgba(154, 103, 0, .09); }
.fn-card[data-cat="dim"] { --tone: #c2410c; --tone-soft: rgba(194, 65, 12, .08); }
.fn-card[data-cat="layer"] { --tone: #15803d; --tone-soft: rgba(21, 128, 61, .08); }
.fn-card[data-cat="block"] { --tone: #a21caf; --tone-soft: rgba(162, 28, 175, .08); }
.fn-card[data-cat="table"] { --tone: #92400e; --tone-soft: rgba(146, 64, 14, .08); }
.fn-card[data-cat="excel"] { --tone: #217346; --tone-soft: rgba(33, 115, 70, .08); }
.fn-card[data-cat="db"] { --tone: #4338ca; --tone-soft: rgba(67, 56, 202, .08); }

.fn-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
}

.fn-index {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 14.4px;
    letter-spacing: .08em;
}

.fn-updated {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 12.8px;
    letter-spacing: .04em;
    white-space: nowrap;
}

.fn-cat {
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid currentColor;
    color: var(--tone);
    font-family: var(--mono);
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: .06em;
    white-space: nowrap;
}

.copy-btn {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.copy-btn svg { width: 13px; height: 13px; }

.copy-btn:hover,
.copy-btn.is-copied {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-2);
}

.copy-btn.is-copied {
    background: var(--teal);
    border-color: var(--teal);
}

.fn-name {
    margin: 0 0 5px;
    font-family: var(--mono);
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.fn-title {
    margin: 0 0 12px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
}

.fn-desc {
    display: -webkit-box;
    height: 5.34em;
    min-height: 5.34em;
    max-height: 5.34em;
    margin: 0 0 16px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.78;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.sig {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 11px;
    border-left: 3px solid var(--tone);
    background: var(--tone-soft);
    overflow-x: auto;
}

.sig-label {
    flex: 0 0 auto;
    padding-top: 1px;
    color: var(--tone);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .08em;
}

.sig code {
    color: var(--ink);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.55;
    white-space: nowrap;
}

.fn-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
    gap: 12px;
    margin: 14px 0 0;
    padding: 13px 0 15px;
    border-top: 1px dashed var(--line);
}

.fn-meta div { min-width: 0; }

.fn-meta dt {
    margin-bottom: 4px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.fn-meta dd {
    margin: 0;
    color: var(--ink);
    font-size: 10.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.fn-meta dd .dep {
    display: inline-block;
    margin: 0 4px 3px 0;
    padding: 1px 4px;
    background: var(--tone-soft);
    color: var(--tone);
    font-family: var(--mono);
    font-size: 9px;
}

.fn-open {
    display: flex;
    width: calc(100% + 40px);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: auto -20px 0;
    padding: 12px 20px;
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(17, 36, 58, .018);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .05em;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.fn-open:hover {
    background: rgba(22, 70, 232, .055);
    color: var(--blue);
}

.fn-open .summary-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fn-open .summary-meta {
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: .08em;
}

.code-modal {
    position: fixed;
    inset: 0;
    width: min(900px, calc(100% - 32px));
    max-width: 900px;
    max-height: min(90vh, 900px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    overflow: visible;
}

.code-modal::backdrop {
    background: rgba(6, 17, 28, .76);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.code-modal[open] { display: block; }

.code-modal-card {
    display: flex;
    max-height: min(88vh, 880px);
    flex-direction: column;
    overflow: hidden;
    border: 1.5px solid var(--ink);
    background: var(--paper-2);
    box-shadow: 14px 14px 0 rgba(22, 70, 232, .24);
}

.code-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.code-modal-kicker {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .12em;
}

.code-modal-head h2 {
    margin: 5px 0 0;
    font-family: var(--mono);
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.code-modal-updated {
    display: inline-block;
    margin-top: 7px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9.6px;
    letter-spacing: .03em;
    line-height: 1.4;
    white-space: nowrap;
}

.code-modal-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}

.modal-copy-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.modal-copy.btn-primary {
    height: 32px;
    padding: 0 14px;
    border-color: #1f7edb;
    background: #2b8cee;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    box-shadow: 1px 1px 0 var(--ink);
}

.modal-copy.btn-primary:hover {
    border-color: #2b8cee;
    background: #3f9df2;
    box-shadow: 2px 2px 0 var(--ink);
}

.modal-copy-status {
    position: relative;
    min-height: 22px;
    margin-top: 6px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: var(--teal);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.3;
    letter-spacing: .02em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .16s ease, transform .16s ease, background .16s ease, border-color .16s ease;
}

.modal-copy-status.is-visible {
    border-color: rgba(11, 116, 107, .42);
    background: #edf9f5;
    box-shadow: 2px 2px 0 rgba(11, 116, 107, .1);
    opacity: 1;
    transform: translateY(0);
}

.modal-copy-status.is-visible::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 17px;
    width: 8px;
    height: 8px;
    border-top: 1px solid rgba(11, 116, 107, .42);
    border-left: 1px solid rgba(11, 116, 107, .42);
    background: #edf9f5;
    transform: rotate(45deg);
}

.modal-copy-status.is-error {
    border-color: rgba(240, 90, 42, .42);
    background: #fff4ef;
    color: var(--orange);
    box-shadow: 2px 2px 0 rgba(240, 90, 42, .08);
}

.modal-copy-status.is-error.is-visible::before {
    border-color: rgba(240, 90, 42, .42);
    background: #fff4ef;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-2);
}

.code-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px;
    overflow: auto;
    overscroll-behavior: contain;
}

.code-modal-body .code-shell {
    margin: 0;
    max-height: 100%;
}

.code-modal-body .code {
    max-height: calc(88vh - 190px);
    overflow: auto;
    overscroll-behavior: contain;
}

.code-modal-body .code::-webkit-scrollbar,
.code-modal-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-modal-body .code::-webkit-scrollbar-track,
.code-modal-body::-webkit-scrollbar-track {
    background: var(--sheet);
}

.code-modal-body .code::-webkit-scrollbar-thumb,
.code-modal-body::-webkit-scrollbar-thumb {
    border: 2px solid var(--sheet);
    background: #3b526a;
}

.code-modal-body .code::-webkit-scrollbar-thumb:hover,
.code-modal-body::-webkit-scrollbar-thumb:hover {
    background: #55708b;
}

body.modal-open { overflow: hidden; }

.fn-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    list-style: none;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .05em;
    color: var(--ink);
    user-select: none;
}

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

.summary-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.plus {
    position: relative;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
}

.plus::before,
.plus::after {
    content: "";
    position: absolute;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.plus::before { top: 5px; left: 0; width: 11px; height: 1px; }
.plus::after { top: 0; left: 5px; width: 1px; height: 11px; }

.fn-details[open] .plus::after {
    transform: rotate(90deg);
    opacity: 0;
}

.summary-meta {
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: .08em;
}

.fn-details[open] summary {
    border-bottom: 1px dashed var(--line);
}

.fn-body {
    padding: 14px 20px 18px;
}

.section-minihead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.section-minihead span:last-child {
    color: var(--tone);
}

.code-shell {
    overflow: hidden;
    border: 1px solid #243b53;
    background: var(--sheet);
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    background: #102438;
    color: #8da3ba;
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
}

.code-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c9daeb;
}

.code-file i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mint);
}

.code {
    max-height: 390px;
    margin: 0;
    padding: 10px 0;
    overflow: auto;
    background: var(--sheet);
    color: var(--code-text);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.75;
    tab-size: 2;
    white-space: normal;
    scrollbar-color: #3b526a var(--sheet);
    scrollbar-width: thin;
}

.code-line {
    display: flex;
    min-width: max-content;
}

.ln {
    position: sticky;
    left: 0;
    z-index: 1;
    flex: 0 0 34px;
    width: 34px;
    padding-right: 9px;
    border-right: 1px solid rgba(255, 255, 255, .07);
    margin-right: 10px;
    background: var(--sheet);
    color: #50677e;
    text-align: right;
    user-select: none;
}

.lc {
    padding-right: 14px;
    white-space: pre;
}

.usage-wrap { margin-top: 14px; }

.usage-code {
    margin: 0;
    padding: 10px 11px;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--orange);
    background: #fffdf7;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.75;
    tab-size: 2;
    white-space: pre;
}

.usage-code .tok-comment { color: #7b8793; }
.usage-code .tok-string { color: var(--teal); }
.usage-code .tok-number { color: #b54916; }
.usage-code .tok-paren { color: #7a8592; }
.usage-code .tok-builtin { color: var(--blue); }
.usage-code .tok-keyword { color: #8a31a3; }
.usage-code .tok-fn { color: #9b4b00; }
.usage-code .tok-constant { color: #b54916; }
.usage-code .tok-symbol { color: var(--ink); }

.tip {
    display: flex;
    gap: 9px;
    margin-top: 12px;
    padding: 9px 10px;
    border: 1px dashed rgba(240, 90, 42, .45);
    background: rgba(255, 226, 214, .45);
}

.tip-mark {
    display: grid;
    place-items: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border: 1px solid var(--orange);
    border-radius: 50%;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
}

.tip p {
    margin: 0;
    color: #69493b;
    font-size: 10px;
    line-height: 1.7;
}

.empty-state {
    padding: 64px 24px;
    border: 1.5px dashed var(--line-strong);
    background: rgba(251, 248, 240, .55);
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 22px;
    letter-spacing: -.03em;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--ink-soft);
    font-size: 13px;
}

.btn-small {
    padding: 9px 14px;
    font-size: 10px;
    box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- 组合示例 ---------- */
.compose {
    position: relative;
    padding: 96px 0;
    overflow: hidden;
    background: #10243a;
    color: #e9eff5;
}

.compose::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(167, 202, 235, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 202, 235, .06) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.compose::after {
    content: "";
    position: absolute;
    top: -220px;
    right: -180px;
    width: 620px;
    height: 620px;
    border: 1px solid rgba(125, 211, 252, .16);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(125, 211, 252, .025), 0 0 0 140px rgba(125, 211, 252, .02);
    pointer-events: none;
}

.compose-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 62px;
    align-items: center;
}

.compose .kicker { color: #91a7bd; }
.compose .kicker::before { background: var(--orange); }

.compose h2 {
    margin: 16px 0 18px;
    color: #f4f7fa;
    font-size: clamp(34px, 4.2vw, 54px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.compose h2 em {
    color: var(--mint);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -.02em;
}

.compose-copy > p {
    max-width: 480px;
    margin: 0;
    color: #a9bccd;
    font-size: 13.5px;
    line-height: 1.9;
}

.pipeline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 28px 0;
    padding: 0;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .16);
}

.pipeline li {
    display: flex;
    gap: 11px;
    padding: 14px;
    background: #10243a;
}

.step-no {
    padding-top: 2px;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .06em;
}

.pipeline strong {
    display: block;
    color: #edf4fb;
    font-size: 12.5px;
    font-weight: 600;
}

.pipeline small {
    display: block;
    margin-top: 3px;
    color: #7f97ae;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .05em;
}

.compose-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #829bb2;
    font-family: var(--mono);
    font-size: 9px;
    line-height: 1.6;
}

.compose-note::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--orange);
    flex: 0 0 24px;
}

.demo-panel {
    min-width: 0;
    border: 1.5px solid rgba(255, 255, 255, .27);
    background: #091522;
    box-shadow: 12px 12px 0 rgba(22, 70, 232, .32);
}

.demo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 42px;
    padding: 0 13px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: #0d1d2d;
}

.demo-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.demo-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6b8299;
}

.demo-dots i:nth-child(1) { background: #ff7a5c; }
.demo-dots i:nth-child(2) { background: #ffc45c; }
.demo-dots i:nth-child(3) { background: var(--mint); }

.demo-file {
    color: #a7bccf;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .1em;
}

.demo-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, .26);
    background: transparent;
    color: #c8d9e9;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.demo-copy:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.demo-copy svg { width: 11px; height: 11px; }

.demo-body {
    max-height: 430px;
    padding: 15px 15px 16px;
    overflow: auto;
    scrollbar-color: #36506a #091522;
    scrollbar-width: thin;
}

.demo-code {
    margin: 0;
    color: var(--code-text);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.8;
    tab-size: 2;
    white-space: pre;
}

.demo-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #8098af;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .05em;
}

.command-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 1px solid #35506b;
    background: #10253a;
    color: #eaf3fb;
    font-size: 10px;
    letter-spacing: .04em;
}

.command-pill::before { content: ">"; color: var(--mint); }

/* ---------- 调用约定 ---------- */
.conventions {
    padding: 96px 0 100px;
}

.conventions .section-head {
    margin-bottom: 34px;
}

.convention-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.conv-card {
    position: relative;
    padding: 22px 18px 18px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--ink);
    background: rgba(251, 248, 240, .62);
}

.conv-card:nth-child(2) { border-top-color: var(--orange); }
.conv-card:nth-child(3) { border-top-color: var(--teal); }
.conv-card:nth-child(4) { border-top-color: var(--violet); }

.conv-letter {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .1em;
}

.conv-card h3 {
    margin: 16px 0 8px;
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.conv-card p {
    min-height: 5.4em;
    margin: 0 0 16px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.8;
}

.conv-card code {
    display: block;
    padding-top: 11px;
    border-top: 1px dashed var(--line);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* ---------- 页脚 ---------- */
.site-footer {
    padding: 28px 0 14px;
    border-top: 4px solid var(--orange);
    background: #0b1929;
    color: #c1d0de;
}

.footer-service-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-service-list li {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.footer-service-list li > span {
    flex: 0 0 auto;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.8;
}

.footer-service-list p {
    margin: 0;
    color: #9fb3c6;
    font-size: 12px;
    line-height: 1.8;
}

.footer-grid {
    position: relative;
}

.footer-service-col,
.footer-grid > div:last-child {
    position: relative;
}

.footer-service-col::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -18px;
    width: 1px;
    height: 72px;
    background: rgba(255, 255, 255, .18);
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(230px, .8fr);
    gap: 36px;
}

.site-footer .brand-mark { color: #ffffff; }
.site-footer .brand-text strong { color: #f0f5fa; }
.site-footer .brand-text small { color: #7f97ae; }

.footer-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.footer-donate {
    flex: 0 0 auto;
    width: 88px;
    text-align: center;
}

.footer-donate-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.footer-donate-col .footer-donate {
    margin-top: 2px;
    text-align: left;
}

.footer-donate-row .footer-donate-reason {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: #9fb3c6;
    font-size: 12px;
    line-height: 1.8;
}

.footer-donate-row .footer-donate-reason strong {
    display: block;
    margin: 0 0 5px;
    color: #c6d5e2;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.footer-donate-row .footer-donate-reason span {
    display: block;
}

.footer-donate img {
    display: block;
    width: 88px;
    height: 88px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: #fff;
    object-fit: contain;
    box-shadow: 3px 3px 0 rgba(22, 70, 232, .18);
}

.footer-donate span {
    display: block;
    margin-top: 7px;
    color: #8ba1b7;
    font-family: var(--mono);
    font-size: 7px;
    line-height: 1.55;
    letter-spacing: .05em;
    white-space: nowrap;
}

.footer-desc {
    max-width: 370px;
    margin: 17px 0 0;
    color: #8ba1b7;
    font-size: 12px;
    line-height: 1.8;
}

.footer-donate-reason {
    max-width: 370px;
    margin: 10px 0 0;
    padding-left: 10px;
    border-left: 2px solid var(--orange);
    color: #7f97ae;
    font-size: 10px;
    line-height: 1.7;
}



.footer-donate-reason strong {
    margin-right: 5px;
    color: #c6d5e2;
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: .06em;
}

.footer-col-title {
    display: block;
    margin-bottom: 14px;
    color: #6e879e;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.footer-links a {
    display: block;
    width: fit-content;
    margin-bottom: 8px;
    color: #c6d5e2;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .03em;
    transition: color .16s ease;
}

.footer-links a:hover { color: var(--mint); }

.footer-note {
    margin: 0;
    color: #8ba1b7;
    font-size: 11px;
    line-height: 1.8;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: #6e879e;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .06em;
}

.footer-bottom a {
    color: #a9bfd2;
    text-decoration: none;
}

.footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.footer-police {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-police img {
    display: block;
}

.footer-bottom a:hover { color: var(--mint); }

/* ---------- 提示条 ---------- */
.toast {
    position: fixed;
    z-index: 150;
    left: 50%;
    bottom: 28px;
    max-width: calc(100% - 32px);
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: var(--ink);
    color: #fff;
    box-shadow: 4px 4px 0 var(--orange);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 动效 ---------- */
@keyframes console-scan {
    0%, 20% { left: -30%; }
    70%, 100% { left: 115%; }
}

@keyframes console-pulse {
    0%, 100% { opacity: .35; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes console-blink {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

@keyframes console-signal {
    0%, 100% { transform: scaleY(.45); transform-origin: bottom; }
    50% { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-in {
    from { opacity: 0; transform: translateY(24px) rotate(-3deg); }
    to { opacity: 1; transform: translateY(0) rotate(-1.4deg); }
}

.hero-copy > * {
    animation: hero-in .6s both;
}

.hero-copy > *:nth-child(2) { animation-delay: .06s; }
.hero-copy > *:nth-child(3) { animation-delay: .12s; }
.hero-copy > *:nth-child(4) { animation-delay: .18s; }
.hero-copy > *:nth-child(5) { animation-delay: .24s; }

.sheet {
    animation: sheet-in .65s .12s both;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .hero-grid { gap: 38px; }
    .hero h1 { font-size: clamp(48px, 6vw, 68px); }
    .fn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .convention-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .convention-grid .conv-card p { min-height: 0; }
    .compose-grid { gap: 44px; }
    .section-stamp { display: flex; }
    .section-head { grid-template-columns: 1fr; gap: 14px; }
    .section-head > p { max-width: 640px; }
}

@media (max-width: 900px) {
    .top-nav { display: none; }
    .header-inner { gap: 18px; }
    .header-action { margin-left: auto; }
    .console-meta { display: none; }
    .header-console { min-width: 0; max-width: none; }
    .hero { padding: 58px 0 74px; }
    .hero::after { display: none; }
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-art { max-width: 560px; justify-self: start; margin-left: 1px; }
    .hero-copy { max-width: 720px; }
    .section-head { grid-template-columns: 1fr; gap: 14px; }
    .section-head > p { max-width: 640px; }
    .compose-grid { grid-template-columns: 1fr; }
    .compose-copy { max-width: 650px; }
    .demo-panel { max-width: 680px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .wrap { width: calc(100% - 32px); }
    .header-inner { height: 66px; }
    .header-console {
        flex: 1;
        min-width: 0;
        max-width: none;
        gap: 7px;
        padding: 6px 8px;
        box-shadow: 2px 2px 0 rgba(22, 70, 232, .14);
    }
    .console-ring { flex-basis: 16px; width: 16px; height: 16px; }
    .console-ring::before { inset: 4px; }
    .console-ring i { left: 7px; }
    .console-kicker { font-size: 5.5px; letter-spacing: .08em; }
    .console-line { font-size: 8px; gap: 4px; }
    .console-caret { flex-basis: 4px; width: 4px; height: 9px; }
    .console-signal { display: none; }
    .header-action { padding: 9px; font-size: 0; gap: 0; }
    .header-action svg { width: 17px; height: 17px; }
    .brand-mark { width: 36px; height: 36px; }
    .brand-text strong { font-size: 12px; }
    .brand-text small { font-size: 7px; }
    .hero { padding: 46px 0 62px; }
    .kicker { font-size: 8px; letter-spacing: .12em; }
    .hero h1 { margin-top: 18px; font-size: clamp(40px, 12vw, 56px); letter-spacing: -.06em; }
    .marker { white-space: normal; }
    .hero-lead { font-size: 14px; line-height: 1.85; }
    .hero-actions { align-items: stretch; flex-direction: column; margin-top: 26px; }
    .btn { width: 100%; }
    .hero-stats { margin-top: 30px; }
    .stat { padding-right: 10px; }
    .stat:not(:first-child) { padding-left: 11px; }
    .stat strong { font-size: 25px; }
    .stat span { font-size: 8px; letter-spacing: .03em; }
    .hero-art { padding: 17px 10px 27px 0; }
    .art-note { display: none; }
    .art-stamp { right: 0; font-size: 22px; }
    .sheet-code { font-size: 9.4px; }
    .sheet-body { min-height: 280px; padding: 16px 12px; }
    .sheet-head, .sheet-foot { font-size: 7px; }
    .library { padding: 22px 0 24px; }
    .section-head h2 { font-size: 30px; }
    .section-stamp { display: none; }
    .toolbar { padding: 12px; }
    .search { flex-basis: 100%; }
    .search-hint { display: none; }
    .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .filter-chip { flex: 0 0 auto; }
    .result-bar { align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 20px; }
    .fn-grid { grid-template-columns: 1fr; gap: 18px; }
    .fn-desc { min-height: 0; }
    .fn-name { font-size: 16px; }
    .compose { padding: 68px 0; }
    .compose h2 { font-size: 37px; }
    .pipeline { grid-template-columns: 1fr; }
    .demo-body { max-height: 360px; }
    .demo-code { font-size: 9.5px; }
    .conventions { padding: 68px 0 72px; }
    .convention-grid { grid-template-columns: 1fr; }
    .conv-card p { min-height: 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid > div:first-child { grid-column: auto; }
    .footer-bottom { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- AE-vlisp 调整 ---------- */
.service-strip {
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(17, 36, 58, .28);
    background: #0d1d2f;
    color: #edf4fa;
}

.service-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(167, 202, 235, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 202, 235, .055) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.service-strip::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--orange);
}

.service-strip-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 30px;
    align-items: center;
    padding: 25px 0 27px;
}

.service-label {
    padding-right: 28px;
    border-right: 1px solid rgba(255, 255, 255, .14);
}

.service-label span,
.service-label small {
    display: block;
    color: #7f97ae;
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .14em;
}

.service-label strong {
    display: block;
    margin: 7px 0 6px;
    color: #f5f9fd;
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.05em;
}

.service-copy .kicker {
    color: #8fa6bb;
    font-size: 8px;
    letter-spacing: .14em;
}

.service-copy .kicker::before { background: var(--orange); }

.service-copy h2 {
    margin: 8px 0 6px;
    color: #f5f9fd;
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.045em;
}

.service-copy p {
    max-width: 680px;
    margin: 0;
    color: #a1b6c9;
    font-size: 12.5px;
    line-height: 1.8;
}

.service-site {
    padding-left: 28px;
    border-left: 1px solid rgba(255, 255, 255, .14);
    text-align: right;
}

.service-site span {
    display: block;
    margin-bottom: 7px;
    color: #7f97ae;
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
}

.service-site a {
    color: var(--mint);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .03em;
    text-decoration: none;
    border-bottom: 1px solid rgba(142, 240, 196, .35);
    transition: border-color .16s ease, color .16s ease;
}

.service-site a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.site-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(181, 45, 29, .35);
    border-left: 3px solid #b52d1d;
    background: rgba(181, 45, 29, .06);
    color: #7e2c22;
    font-size: 12px;
}

.workflow-panel {
    min-width: 0;
}

.flow-badge {
    display: inline-block;
    padding: 4px 7px;
    border: 1px solid rgba(142, 240, 196, .45);
    color: var(--mint);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
    white-space: nowrap;
}

.flow-steps {
    margin: 0;
    padding: 4px 18px;
    list-style: none;
}

.flow-steps li {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.flow-steps li:last-child { border-bottom: 0; }

.flow-no {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border: 1px solid rgba(240, 90, 42, .65);
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
}

.flow-steps strong {
    display: block;
    margin-bottom: 5px;
    color: #f1f6fb;
    font-size: 13px;
    font-weight: 600;
}

.flow-steps p {
    margin: 0;
    color: #93a9bf;
    font-size: 11px;
    line-height: 1.75;
}

.footer-note a {
    color: #d5e2ed;
    text-decoration: none;
    border-bottom: 1px solid rgba(213, 226, 237, .3);
    transition: color .16s ease, border-color .16s ease;
}

.footer-note a:hover {
    color: var(--mint);
    border-bottom-color: var(--mint);
}

@media (max-width: 680px) {
    .brand-text small { max-width: 140px; overflow: hidden; white-space: nowrap; }
    .flow-steps { padding-inline: 13px; }
    .flow-steps li { padding: 16px 0; }
    .flow-badge { display: none; }
}

/* 说明条响应式（放在基础样式之后，确保覆盖桌面布局） */
@media (max-width: 900px) {
    .service-strip-inner {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 22px 0 24px;
    }

    .service-label {
        display: flex;
        align-items: baseline;
        gap: 10px;
        padding: 0 0 11px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .service-label strong { margin: 0; font-size: 22px; }
    .service-label small { margin-left: auto; }

    .service-site {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 0 0;
        border: 0;
        text-align: left;
    }

    .service-site span { margin: 0; }
}

@media (max-width: 680px) {
    .service-strip-inner { gap: 14px; padding: 21px 0 23px; }
    .service-copy h2 { font-size: 25px; }
    .service-site { padding-top: 10px; }
}

@media (max-width: 900px) {
    .footer-service-col::before,
    .footer-grid > div:last-child::before {
        display: none;
    }
}

/* ---------- 02 / 使用说明 ---------- */
.usage {
    padding: 23px 0 27px;
    border-top: 1.5px solid var(--ink);
    background: rgba(251, 248, 240, .38);
}

.usage-head {
    grid-template-columns: 1fr;
    margin-bottom: 20px;
}

.usage-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usage-step {
    padding: 7.5px 15px 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    background: var(--paper-2);
}

.usage-step:nth-child(2) { border-top-color: var(--orange); }
.usage-step:nth-child(3) { border-top-color: var(--teal); }
.usage-step:nth-child(4) { border-top-color: var(--violet); }

.usage-step-no {
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: .1em;
}

.usage-step h3 {
    margin: 8px 0 6px;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.usage-step p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.75;
}

.usage-step code,
.usage-callout code {
    padding: 1px 4px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--mono);
    font-size: .9em;
}

.usage-terminal {
    overflow: hidden;
    border: 1px solid #243b53;
    background: var(--sheet);
    box-shadow: 7px 7px 0 rgba(22, 70, 232, .13);
}

.usage-terminal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: #102438;
    color: #8da3ba;
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: .1em;
}

.usage-snippet {
    margin: 0;
    padding: 14px 13px 16px;
    overflow: auto;
    color: var(--code-text);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.8;
    tab-size: 2;
    white-space: pre;
    scrollbar-color: #3b526a var(--sheet);
    scrollbar-width: thin;
}

.u-comment { color: #738ca4; font-style: italic; }
.u-fn { color: #ffd479; }
.u-num { color: #ffb86b; }

.usage-terminal-note {
    padding: 9px 12px;
    border-top: 1px solid rgba(255, 255, 255, .09);
    color: #8ba1b7;
    font-size: 9px;
    line-height: 1.65;
}

.usage-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 12px;
    border-left: 3px solid var(--orange);
    background: rgba(255, 226, 214, .45);
}

.usage-callout > span {
    display: grid;
    place-items: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border: 1px solid var(--orange);
    border-radius: 50%;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
}

.usage-callout p {
    margin: 0;
    color: #69493b;
    font-size: 10.5px;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .usage-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .usage { padding: 17px 0 21px; }
    .usage-steps { grid-template-columns: 1fr; }
    .usage-step p { font-size: 12px; }
    .section-head h2 { font-size: 18px; }
    .footer-brand-row { gap: 12px; }
    .footer-donate { width: 76px; }
    .footer-donate img { width: 76px; height: 76px; padding: 3px; }
    .footer-donate span { margin-top: 5px; font-size: 6.5px; }
}

@media (max-width: 680px) {
    .code-modal {
        width: calc(100% - 16px);
        max-height: 94vh;
    }

    .code-modal-card { max-height: 93vh; }

    .code-modal-head {
        gap: 10px;
        padding: 11px 12px;
    }

    .code-modal-head h2 { font-size: 16px; }

    .code-modal-actions .btn {
        width: auto;
        padding: 8px 10px;
        font-size: 9px;
    }

    .code-modal-body { padding: 8px; }
    .code-modal-body .code { max-height: calc(94vh - 150px); }
    .fn-open { font-size: 8px; }
}


