/* ==================================================================
   幻光回廊 · 知识库（Website 前端 UI 原型）
   ------------------------------------------------------------------
   页面由 assets/js/app.js 渲染，数据来自 Website/public/api.php。
   视觉变量与编辑器共用同一套品牌规范。
   ================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
    --bg: #FBFAFF;
    --bg-soft: #F5F2FD;
    --surface: #FFFFFF;
    --surface-2: #F8F6FE;
    --ink: #1D1833;
    --ink-2: #4C4566;
    --ink-3: #7C7595;
    --ink-4: #A9A3BD;

    --line: rgba(29, 24, 51, .08);
    --line-2: rgba(29, 24, 51, .14);

    --brand: #7C3AED;
    --brand-2: #A78BFA;
    --brand-deep: #5B21B6;
    --brand-soft: rgba(124, 58, 237, .10);
    --blue: #818CF8;
    --sakura: #FFC8DD;
    --ice: #8EDCE8;

    --ok: #2F9E6B;
    --warn: #B7791F;
    --danger: #C2453F;

    --shadow-sm: 0 2px 10px rgba(45, 30, 90, .05);
    --shadow-md: 0 16px 40px -20px rgba(45, 30, 90, .28);
    --shadow-lg: 0 32px 80px -32px rgba(45, 30, 90, .35);

    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 26px;
    --r-pill: 999px;

    --nav-h: 72px;
    --container: 1200px;

    --ff: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
          system-ui, -apple-system, "Segoe UI", sans-serif;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="dark"] {
    --bg: #0D0A18;
    --bg-soft: #141026;
    --surface: #171228;
    --surface-2: #1C1731;
    --ink: #F2EFFA;
    --ink-2: #C3BBD8;
    --ink-3: #8E86A8;
    --ink-4: #665F80;

    --line: rgba(255, 255, 255, .09);
    --line-2: rgba(255, 255, 255, .17);

    --brand: #A78BFA;
    --brand-2: #8B6BF2;
    --brand-deep: #C4B5FD;
    --brand-soft: rgba(167, 139, 250, .14);
    --blue: #A5AEFF;
    --sakura: #FFB3CB;
    --ice: #9BE6F2;

    --ok: #6EE7B7;
    --warn: #F3C969;
    --danger: #FF8B85;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .30);
    --shadow-md: 0 16px 44px -18px rgba(0, 0, 0, .70);
    --shadow-lg: 0 32px 90px -30px rgba(0, 0, 0, .80);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--ff);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(42% 32% at 82% 0%, rgba(167, 139, 250, .16), transparent 72%),
        radial-gradient(34% 28% at 6% 8%, rgba(142, 220, 232, .12), transparent 72%);
}

html[data-theme="dark"] body::before {
    background:
        radial-gradient(42% 32% at 82% 0%, rgba(124, 58, 237, .22), transparent 72%),
        radial-gradient(34% 28% at 6% 8%, rgba(116, 207, 224, .08), transparent 72%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { padding-left: 1.25em; }

::selection { background: var(--brand-soft); color: var(--brand-deep); }

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

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

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

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- 3. 通用元件 ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.section { padding: 56px 0; }
.section.is-tight { padding: 36px 0; }

.section-head { margin-bottom: 28px; }
.section-title {
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.3;
    letter-spacing: -.01em;
}
.section-desc {
    margin-top: 8px;
    color: var(--ink-3);
    font-size: 15px;
}

.grad {
    background: linear-gradient(100deg, var(--brand) 0%, var(--blue) 58%, var(--ice) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .18s var(--ease), background .18s var(--ease),
                border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(124, 58, 237, .7);
}
.btn-primary:hover { background: var(--brand-deep); }
html[data-theme="dark"] .btn-primary { color: #160F28; }

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15.5px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-brand {
    background: var(--brand-soft);
    border-color: transparent;
    color: var(--brand);
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 600;
}

.empty-note {
    padding: 28px;
    border: 1px dashed var(--line-2);
    border-radius: var(--r-md);
    color: var(--ink-3);
    text-align: center;
    font-size: 14px;
}

/* ---------- 4. 导航 ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(251, 250, 255, .88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
html[data-theme="dark"] .site-nav { background: rgba(13, 10, 24, .86); }

.nav-inner {
    width: min(var(--container), calc(100% - 48px));
    height: var(--nav-h);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}
.brand-logo {
    display: block;
    height: 42px;
    width: auto;
}
.brand-kb {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--brand) 0%, var(--blue) 100%);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(124, 58, 237, .8);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 15.5px; font-weight: 800; letter-spacing: .01em; }
.brand-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
}
.brand-sub::before {
    content: "";
    width: 14px;
    height: 1px;
    background: var(--line-2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-link:hover { color: var(--brand); background: var(--brand-soft); }
.nav-link.is-active { color: var(--brand); background: var(--brand-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.search-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-3);
    font-size: 13px;
    transition: border-color .18s var(--ease), color .18s var(--ease);
}
.search-trigger:hover { border-color: var(--brand-2); color: var(--brand); }
.kbd {
    padding: 2px 6px;
    border: 1px solid var(--line-2);
    border-radius: 5px;
    background: var(--bg-soft);
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-2);
    transition: background .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--brand); }

.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }

.nav-mobile {
    display: none;
    padding: 8px 24px 18px;
    border-top: 1px solid var(--line);
    background: var(--bg);
}
.nav-mobile.is-open { display: flex; flex-direction: column; gap: 4px; }
.nav-mobile a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
}
.nav-mobile a:hover { background: var(--brand-soft); color: var(--brand); }

/* ---------- 5. 首页 Hero ---------- */
.hero {
    position: relative;
    padding: 80px 0 58px;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    width: 1px;
    height: 420px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, .22), transparent);
    pointer-events: none;
}
.hero-halo {
    position: absolute;
    top: -180px;
    left: 50%;
    width: 720px;
    height: 540px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, .18), transparent 66%);
    filter: blur(10px);
    pointer-events: none;
    animation: halo-breathe 9s ease-in-out infinite;
}
@keyframes halo-breathe {
    0%, 100% { opacity: .65; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.hero-inner {
    position: relative;
    max-width: 860px;
    margin-inline: auto;
    text-align: center;
}
.hero-title {
    font-size: clamp(36px, 5.4vw, 58px);
    line-height: 1.16;
    letter-spacing: -.03em;
    font-weight: 800;
}
.hero-sub {
    max-width: 640px;
    margin: 20px auto 0;
    color: var(--ink-3);
    font-size: 17px;
    line-height: 1.85;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
    margin: 32px auto 0;
    padding: 7px 7px 7px 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.hero-search:focus-within {
    border-color: var(--brand-2);
    box-shadow: 0 18px 50px -22px rgba(124, 58, 237, .45);
}
.hero-search .icon { color: var(--ink-4); }
.hero-search input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
}
.hero-search input::placeholder { color: var(--ink-4); }
.hero-search .btn { height: 40px; }

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}
.quick-tag {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color .18s var(--ease), color .18s var(--ease);
}
.quick-tag:hover { border-color: var(--brand-2); color: var(--brand); }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 36px;
}
.stat {
    padding: 0 30px;
    border-left: 1px solid var(--line);
    text-align: left;
}
.stat:first-child { border-left: 0; }
.stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.stat-value small { margin-left: 3px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.stat-label { margin-top: 2px; color: var(--ink-4); font-size: 12px; font-weight: 600; }

/* ---------- 6. 分类卡 ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .22s var(--ease), border-color .22s var(--ease),
                box-shadow .22s var(--ease);
}
.category-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-2);
    box-shadow: var(--shadow-md);
}
.category-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: var(--brand-soft);
    color: var(--brand);
}
.category-icon svg { width: 22px; height: 22px; }
.category-name { font-size: 17px; font-weight: 750; }
.category-desc { flex: 1; color: var(--ink-3); font-size: 13.5px; line-height: 1.7; }
.category-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
}
.category-foot .icon { color: var(--brand); transition: transform .2s var(--ease); }
.category-card:hover .category-foot .icon { transform: translateX(4px); }

/* ---------- 7. 最近更新 ---------- */
.recent-list {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border-top: 1px solid var(--line);
    transition: background .18s var(--ease);
}
.recent-item:first-child { border-top: 0; }
.recent-item:hover { background: var(--bg-soft); }
.recent-main { flex: 1; min-width: 0; }
.recent-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15.5px;
    font-weight: 700;
}
.recent-title .icon { color: var(--ink-4); }
.recent-desc {
    display: block;
    margin-top: 3px;
    color: var(--ink-3);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
}

/* ---------- 8. CTA ---------- */
.cta-band {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 40px 44px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background:
        radial-gradient(60% 130% at 100% 0%, rgba(167, 139, 250, .20), transparent 70%),
        var(--surface);
    overflow: hidden;
}
.cta-copy h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; }
.cta-copy p { margin-top: 8px; color: var(--ink-3); font-size: 14.5px; }
.cta-actions { display: flex; gap: 10px; flex: none; }

/* ---------- 9. 页头（内页） ---------- */
.page-hero {
    padding: 48px 0 28px;
    border-bottom: 1px solid var(--line);
}
.page-title {
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.2;
    letter-spacing: -.02em;
}
.page-desc { margin-top: 10px; color: var(--ink-3); font-size: 15.5px; }

/* ---------- 10. 文档列表页 ---------- */
.docs-layout {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 40px;
    padding: 36px 0 64px;
}
.docs-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    align-self: start;
}
.side-title {
    margin: 0 0 12px 12px;
    color: var(--ink-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.category-nav { display: flex; flex-direction: column; gap: 3px; }
.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.category-link .icon { color: var(--ink-4); }
.category-link .count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: var(--r-pill);
    background: var(--bg-soft);
    color: var(--ink-4);
    font-size: 11px;
    font-weight: 700;
}
.category-link:hover { background: var(--bg-soft); color: var(--brand); }
.category-link.is-active { background: var(--brand-soft); color: var(--brand); }
.category-link.is-active .icon { color: var(--brand); }
.category-link.is-active .count { background: var(--surface); color: var(--brand); }

.docs-main { min-width: 0; }
.docs-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}
.filter-input {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-4);
}
.filter-input:focus-within { border-color: var(--brand-2); }
.filter-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
}
.docs-toolbar select {
    height: 42px;
    padding: 0 34px 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C7595' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.docs-group { margin-bottom: 34px; }
.docs-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.docs-group-head h2 { font-size: 17px; font-weight: 750; }
.docs-group-head .badge { margin-left: 2px; }

.doc-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: transform .18s var(--ease), border-color .18s var(--ease),
                box-shadow .18s var(--ease);
}
.doc-row + .doc-row { margin-top: 10px; }
.doc-row:hover {
    transform: translateY(-1px);
    border-color: var(--brand-2);
    box-shadow: var(--shadow-sm);
}
.doc-row-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--bg-soft);
    color: var(--ink-3);
    flex: none;
}
.doc-row:hover .doc-row-icon { background: var(--brand-soft); color: var(--brand); }
.doc-row-body { flex: 1; min-width: 0; }
.doc-row-title { display: block; font-size: 15.5px; font-weight: 700; }
.doc-row-desc {
    display: block;
    margin-top: 3px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.65;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
    color: var(--ink-4);
    font-size: 12px;
    font-weight: 600;
}
.doc-row-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

/* ---------- 11. 文档详情页 ---------- */
.doc-wrap { padding: 32px 0 72px; }
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 26px;
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
}
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { opacity: .55; }

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 236px;
    gap: 56px;
    align-items: start;
}
.doc-article { min-width: 0; max-width: 800px; }

.doc-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.doc-title {
    font-size: clamp(30px, 4.2vw, 42px);
    line-height: 1.22;
    letter-spacing: -.025em;
}
.doc-summary {
    margin-top: 14px;
    color: var(--ink-3);
    font-size: 16px;
    line-height: 1.8;
}
.doc-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
}
.doc-meta .meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
}
.copy-btn:hover { border-color: var(--brand-2); color: var(--brand); }

/* 文章正文 */
.article-body {
    padding-top: 30px;
    color: var(--ink-2);
    font-size: 16.5px;
    line-height: 1.95;
}
.article-body > * + * { margin-top: 18px; }
.article-body .lead {
    color: var(--ink);
    font-size: 18.5px;
    line-height: 1.85;
}
.article-body h2 {
    margin-top: 46px;
    padding-top: 6px;
    color: var(--ink);
    font-size: 26px;
    line-height: 1.35;
    letter-spacing: -.01em;
    scroll-margin-top: calc(var(--nav-h) + 24px);
}
.article-body h3 {
    margin-top: 32px;
    color: var(--ink);
    font-size: 19.5px;
    line-height: 1.4;
    scroll-margin-top: calc(var(--nav-h) + 24px);
}
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body a {
    color: var(--brand);
    border-bottom: 1px solid rgba(124, 58, 237, .28);
    transition: border-color .18s var(--ease);
}
.article-body a:hover { border-color: var(--brand); }
.article-body ul, .article-body ol { padding-left: 1.45em; }
.article-body li + li { margin-top: 7px; }
.article-body li::marker { color: var(--brand-2); }

.callout {
    padding: 16px 18px;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--brand-soft);
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.8;
}
.callout strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 13.5px; }
.callout.tip { border-color: var(--ok); background: rgba(47, 158, 107, .10); }
.callout.warn { border-color: var(--warn); background: rgba(183, 121, 31, .10); }

.steps {
    counter-reset: step;
    padding: 0;
    list-style: none;
}
.steps li {
    position: relative;
    padding-left: 46px;
    counter-increment: step;
}
.steps li + li { margin-top: 18px; }
.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: 1px;
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}
.steps li strong { display: block; color: var(--ink); font-size: 15.5px; }

.article-figure { margin: 26px 0; }
.img-box {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 220px;
    border: 1px dashed var(--line-2);
    border-radius: var(--r-md);
    background:
        linear-gradient(135deg, rgba(167, 139, 250, .10), transparent 55%),
        var(--surface-2);
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
}
.img-box svg { width: 30px; height: 30px; opacity: .6; }
.article-figure figcaption {
    margin-top: 8px;
    color: var(--ink-4);
    font-size: 12.5px;
    text-align: center;
}

.article-table,
.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.65;
}
.article-table th, .article-table td,
.article-body th, .article-body td {
    padding: 11px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.article-table th,
.article-body th {
    background: var(--bg-soft);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
}
.article-table td,
.article-body td { color: var(--ink-2); }

.article-body pre {
    overflow-x: auto;
    padding: 18px;
    border-radius: var(--r-sm);
    background: #16121F;
    color: #E7E2F5;
    font-size: 13px;
    line-height: 1.7;
}
.article-body pre code { font-family: "Cascadia Code", "Fira Code", Consolas, monospace; }
.article-body :not(pre) > code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--bg-soft);
    color: var(--brand-deep);
    font-size: .88em;
}

.quote {
    position: relative;
    margin: 28px 0;
    padding: 20px 24px 20px 52px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.85;
}
.quote::before {
    content: "“";
    position: absolute;
    top: 6px;
    left: 18px;
    color: var(--brand-2);
    font-family: Georgia, serif;
    font-size: 44px;
    line-height: 1;
}

.task-list { padding: 0; list-style: none; }
.task-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 15px;
}
.task-list input {
    width: 16px;
    height: 16px;
    margin-top: 5px;
    accent-color: var(--brand);
}

.article-body details {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    overflow: hidden;
}
.article-body details + details { margin-top: 8px; }
.article-body summary {
    padding: 13px 16px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}
.article-body summary::-webkit-details-marker { display: none; }
.article-body summary::after {
    content: "+";
    float: right;
    color: var(--brand);
    font-size: 18px;
    font-weight: 400;
}
.article-body details[open] summary::after { content: "−"; }
.article-body details p {
    padding: 0 16px 14px;
    color: var(--ink-3);
    font-size: 14px;
}

/* 右侧目录 */
.toc {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
    align-self: start;
    padding-left: 18px;
    border-left: 1px solid var(--line);
}
.toc-title {
    margin-bottom: 10px;
    color: var(--ink-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.toc-list { display: flex; flex-direction: column; gap: 2px; list-style: none; padding: 0; }
.toc-link {
    display: block;
    padding: 5px 0 5px 10px;
    border-left: 2px solid transparent;
    color: var(--ink-3);
    font-size: 12.5px;
    line-height: 1.5;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.toc-link:hover { color: var(--brand); }
.toc-link.is-active { border-color: var(--brand); color: var(--brand); font-weight: 650; }
.toc-link.depth-3 { padding-left: 22px; font-size: 12px; }

/* 反馈与翻页 */
.doc-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 46px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}
.doc-feedback p { color: var(--ink-3); font-size: 14px; }
.feedback-actions { display: flex; gap: 8px; }
.feedback-actions .btn { height: 34px; padding: 0 14px; font-size: 13px; }

.doc-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}
.pager-card {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.pager-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.pager-card.is-next { text-align: right; }
.pager-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--ink-4);
    font-size: 11.5px;
    font-weight: 700;
}
.pager-card.is-next .pager-label { justify-content: flex-end; }
.pager-title { margin-top: 4px; color: var(--ink); font-size: 14px; font-weight: 700; }

/* ---------- 12. 搜索页 ---------- */
.search-hero { padding: 46px 0 26px; }
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 760px;
    margin-top: 22px;
    padding: 7px 7px 7px 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.search-box:focus-within { border-color: var(--brand-2); }
.search-box input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
}
.search-box .btn { height: 40px; }

.search-summary {
    margin: 28px 0 16px;
    color: var(--ink-3);
    font-size: 13.5px;
}
.search-summary strong { color: var(--ink); }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.result-item {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.result-item:hover { border-color: var(--brand-2); box-shadow: var(--shadow-sm); }
.result-path {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-4);
    font-size: 11.5px;
    font-weight: 600;
}
.result-title { display: block; margin-top: 4px; font-size: 16px; font-weight: 750; }
.result-desc {
    display: block;
    margin-top: 4px;
    color: var(--ink-3);
    font-size: 13.5px;
    line-height: 1.7;
}
.result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: var(--ink-4);
    font-size: 12px;
    font-weight: 600;
}
mark {
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(255, 200, 221, .55);
    color: inherit;
}
html[data-theme="dark"] mark { background: rgba(255, 179, 203, .22); }

.search-empty {
    padding: 54px 24px;
    border: 1px dashed var(--line-2);
    border-radius: var(--r-lg);
    text-align: center;
}
.search-empty .icon { margin: 0 auto 12px; color: var(--ink-4); width: 34px; height: 34px; }
.search-empty h3 { font-size: 18px; }
.search-empty p { margin-top: 6px; color: var(--ink-3); font-size: 14px; }
.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* ---------- 13. 404 ---------- */
.error-page {
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--nav-h) - 260px);
    padding: 70px 0;
    text-align: center;
}
.error-code {
    font-size: clamp(96px, 18vw, 170px);
    font-weight: 900;
    line-height: .9;
    letter-spacing: -.06em;
    background: linear-gradient(150deg, var(--brand) 10%, var(--blue) 55%, var(--ice) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-title { margin-top: 18px; font-size: clamp(24px, 3vw, 32px); }
.error-desc {
    max-width: 520px;
    margin: 10px auto 0;
    color: var(--ink-3);
    font-size: 15px;
    line-height: 1.8;
}
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- 14. 搜索浮层 ---------- */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: none;
    padding: 14vh 24px 24px;
    background: rgba(18, 12, 34, .42);
    backdrop-filter: blur(4px);
}
.search-overlay.is-open { display: block; }
.search-panel {
    width: min(620px, 100%);
    margin-inline: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.search-panel-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-4);
}
.search-panel-input input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--ink);
}
.search-panel-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-panel-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
}
.search-panel-list a:hover { background: var(--bg-soft); }
.search-panel-list .icon { color: var(--ink-4); }
.search-panel-empty { padding: 26px; text-align: center; color: var(--ink-4); font-size: 13px; }

/* ---------- 15. 页脚 ---------- */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
    padding: 44px 0 34px;
}
.footer-brand { max-width: 340px; }
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
}
.footer-logo img {
    display: block;
    height: 52px;
    width: auto;
}
.footer-logo .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
.footer-tagline { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.footer-note { margin-top: 4px; color: var(--ink-4); font-size: 12.5px; }
.footer-cols { display: flex; gap: 70px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
    margin-bottom: 2px;
    color: var(--ink-4);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.footer-col a { color: var(--ink-3); font-size: 13px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
    padding: 16px 0 22px;
    border-top: 1px solid var(--line);
    color: var(--ink-4);
    font-size: 12px;
}

/* ---------- 15.1 轻提示 ---------- */
.kb-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    z-index: 220;
    max-width: min(420px, calc(100% - 40px));
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.kb-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 15.2 公示文件元件 ---------- */
.public-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background:
        linear-gradient(135deg, var(--brand-soft), transparent 65%),
        var(--surface);
}
.public-notice-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
    flex: none;
}
.public-notice strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}
.public-notice p {
    margin-top: 3px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.75;
}

.doc-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.doc-status.is-active { background: rgba(47, 158, 107, .12); color: var(--ok); }
.doc-status.is-revised { background: rgba(183, 121, 31, .12); color: var(--warn); }
.doc-status.is-repealed { background: rgba(194, 69, 63, .10); color: var(--danger); }

.doc-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--line);
    overflow: hidden;
}
.doc-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 15px;
    background: var(--surface);
}
.doc-info-item > span {
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
}
.doc-info-item > strong {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 650;
}
.doc-info-value {
    display: flex;
    align-items: center;
    min-height: 22px;
}

.doc-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.doc-actions .copy-btn { margin-left: 0; }

.doc-revisions { margin-top: 46px; }
.doc-revisions h2,
.related-docs h2 {
    margin-bottom: 12px;
    font-size: 21px;
    line-height: 1.35;
}
.doc-revisions .article-table { margin-top: 0; }

.related-docs { margin-top: 34px; }
.related-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.related-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.related-item:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.related-title { font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.related-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-4);
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .doc-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .related-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .doc-info-grid { grid-template-columns: minmax(0, 1fr); }
    .public-notice { padding: 16px; }
}

/* ---------- 16. 响应式 ---------- */
@media (max-width: 1080px) {
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-layout { grid-template-columns: minmax(0, 1fr); }
    .toc { display: none; }
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-toggle { display: grid; }
    .search-trigger span, .search-trigger .kbd { display: none; }
    .search-trigger { width: 38px; justify-content: center; padding: 0; }
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .docs-sidebar { position: static; }
    .category-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 6px;
    }
    .category-link { flex: none; padding: 8px 12px; }
    .category-link .icon { display: none; }
    .category-link .count { margin-left: 4px; }
    .side-title { display: none; }
    .cta-band { flex-direction: column; align-items: flex-start; padding: 32px; }
    .footer-inner { flex-direction: column; gap: 30px; }
}

@media (max-width: 720px) {
    .container, .nav-inner, .footer-inner, .footer-bottom {
        width: calc(100% - 36px);
    }
    .hero { padding: 56px 0 40px; }
    .hero-stats { flex-wrap: wrap; gap: 14px 0; }
    .stat { padding: 0 20px; }
    .category-grid { grid-template-columns: minmax(0, 1fr); }
    .recent-item { align-items: flex-start; }
    .recent-meta { display: none; }
    .doc-row { padding: 16px; }
    .doc-row-icon { display: none; }
    .doc-feedback { flex-direction: column; align-items: flex-start; }
    .doc-pager { grid-template-columns: minmax(0, 1fr); }
    .pager-card.is-next { text-align: left; }
    .pager-card.is-next .pager-label { justify-content: flex-start; }
    .footer-cols { gap: 36px; }
    .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (max-width: 560px) {
    .brand-sub { display: none; }
    .brand-logo { height: 32px; }
    .brand-kb { display: none; }
    .hero-search { flex-wrap: wrap; padding: 10px; border-radius: var(--r-md); }
    .hero-search input { width: 100%; flex: 1 0 100%; padding: 0 8px; }
    .hero-search .btn { width: 100%; }
    .hero-title { font-size: 34px; }
    .article-body { font-size: 16px; }
    .article-body h2 { font-size: 23px; }
    .cta-actions { width: 100%; flex-direction: column; }
    .cta-actions .btn { width: 100%; }
    .docs-toolbar { flex-wrap: wrap; }
    .docs-toolbar select { width: 100%; }
}

/* ---------- 17. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- 18. 打印 ---------- */
@media print {
    body { background: #fff; color: #000; }
    body::before,
    .site-nav,
    .site-footer,
    .breadcrumb,
    .toc,
    .doc-actions,
    .doc-feedback,
    .doc-pager,
    .skip-link,
    .search-overlay,
    .kb-toast { display: none !important; }

    .doc-wrap { padding: 0; }
    .doc-layout { display: block; }
    .doc-article { max-width: none; }
    .article-body { font-size: 12pt; line-height: 1.7; }
    .article-body a { color: #000; text-decoration: underline; }
    .doc-info-grid { break-inside: avoid; }
    .doc-revisions,
    .related-docs { break-inside: avoid; }
}

/* 反馈按钮状态 */
.feedback-actions .btn:disabled {
    opacity: .55;
    cursor: default;
}
.feedback-actions .btn.is-done {
    border-color: var(--brand-2);
    color: var(--brand);
}
