/* ==========================================================================
   林泽丰博客 · 前台样式（浅色文档风）
   零构建、零依赖，只依赖 CSS 变量与原生 JS
   ========================================================================== */

:root {
    --ink: #111827;
    --ink-2: #374151;
    --ink-3: #4b5563;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --line: #e5e7eb;
    --line-soft: #f1f2f4;
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --bg-code: #f6f7f9;
    --brand: #2563eb;
    --brand-ink: #1d4ed8;
    --brand-soft: #eff6ff;
    --ok: #059669;
    --ok-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow: 0 4px 16px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --header-h: 62px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* 内容不足一屏时把页脚压到底部 */
main { flex: 1 0 auto; }

img { max-width: 100%; border-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
::selection { background: #dbeafe; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--narrow { max-width: 860px; }

/* ---------- 顶部导航 ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 650;
    font-size: 15.5px;
    letter-spacing: .2px;
    white-space: nowrap;
    flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }

.brand__mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    flex: 0 0 auto;
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}

.site-nav a {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    font-size: 14.5px;
    transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.site-nav a.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 550; }

.header-tools { display: flex; align-items: center; gap: 10px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
}
.search input {
    width: 190px;
    height: 36px;
    padding: 0 36px 0 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-soft);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, background .15s, width .2s;
    font-family: inherit;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { background: #fff; border-color: #bfdbfe; width: 230px; }
.search__icon {
    position: absolute;
    left: 12px;
    color: var(--muted-2);
    display: inline-flex;
    pointer-events: none;
}
.search__submit {
    position: absolute;
    right: 4px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.search__submit:hover { background: var(--line-soft); color: var(--ink); }

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
}

.mobile-panel { display: none; }

/* ---------- 按钮 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--ink-2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s, transform .06s;
}
.btn:hover { color: var(--ink); background: #eef0f3; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn--lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 通用块 ---------- */

.page-head { padding: 44px 0 8px; }
.page-head h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.3; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--muted); }

.label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted-2);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-3);
    font-size: 13.5px;
    transition: all .15s;
}
.chip:hover { border-color: #c7d2fe; color: var(--brand); background: var(--brand-soft); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.panel__body { padding: 18px; }
.panel__body--flush { padding: 8px 0; }

.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.empty__mark {
    display: block;
    margin: 0 auto 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--muted-2);
    font-size: 18px;
    line-height: 40px;
}

/* ---------- 首页 ---------- */

.hero { padding: 56px 0 36px; border-bottom: 1px solid var(--line-soft); }
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 12.5px;
    font-weight: 550;
}
.hero h1 {
    margin: 0 0 14px;
    font-size: 40px;
    line-height: 1.22;
    letter-spacing: -1px;
    font-weight: 700;
}
.hero p { margin: 0; max-width: 620px; color: var(--ink-3); font-size: 16.5px; }
.hero__actions { display: flex; gap: 12px; margin-top: 26px; }

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 40px;
    padding: 36px 0 64px;
    align-items: start;
}

.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.section-bar h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.section-bar__meta { color: var(--muted); font-size: 13px; }

.post-list { display: flex; flex-direction: column; }

.post {
    display: block;
    padding: 22px 0;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
}
.post:first-child { padding-top: 4px; }
.post:hover .post__title { color: var(--brand); }

.post__top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post__cat {
    font-size: 12px;
    font-weight: 550;
    color: var(--brand-ink);
    background: var(--brand-soft);
    padding: 2px 9px;
    border-radius: 999px;
}
.post__title {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 600;
    letter-spacing: -.2px;
    transition: color .15s;
}
.post__excerpt {
    margin: 0 0 12px;
    color: var(--ink-3);
    font-size: 14.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12.5px;
}
.post__meta span { display: inline-flex; align-items: center; gap: 5px; }
.post__admin { display: flex; gap: 8px; margin-top: 12px; }

.side-card + .side-card { margin-top: 22px; }
.side-card__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: .2px;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 10px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px; }
.side-list li:last-child { border-bottom: 0; }
.side-list a { color: var(--ink-2); display: block; }
.side-list a:hover { color: var(--brand); }
.side-list__meta { display: block; margin-top: 4px; color: var(--muted-2); font-size: 12px; }
.side-list__quote {
    color: var(--ink-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--line);
    margin-top: 22px;
}
.stat-strip div { background: #fff; padding: 14px 16px; }
.stat-strip strong { display: block; font-size: 20px; line-height: 1.2; letter-spacing: -.4px; }
.stat-strip span { color: var(--muted); font-size: 12.5px; }

/* ---------- 分页 ---------- */

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; padding: 0; list-style: none; }
.pager li { display: inline-flex; }
.pager a,
.pager span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-3);
    font-size: 13.5px;
}
.pager a:hover { border-color: #c7d2fe; color: var(--brand); background: var(--brand-soft); }
.pager .active span,
.pager .active a { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .disabled span { color: var(--muted-2); }

/* ---------- 文章详情 ---------- */

.reading { padding: 36px 0 64px; }

.article-head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.article-head h1 {
    margin: 10px 0 14px;
    font-size: 32px;
    line-height: 1.35;
    letter-spacing: -.6px;
    font-weight: 700;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }

.docs-content { min-width: 0; }

.prose { color: var(--ink-2); font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--ink);
    line-height: 1.4;
    margin: 34px 0 14px;
    letter-spacing: -.3px;
}
.prose h1 { font-size: 26px; }
.prose h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose blockquote {
    margin: 22px 0;
    padding: 14px 20px;
    border-left: 3px solid var(--brand);
    background: var(--bg-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ink-3);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
    font-family: var(--mono);
    font-size: .88em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--bg-code);
    border: 1px solid var(--line-soft);
    color: #b91c1c;
}
.prose pre {
    margin: 22px 0;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: #0f172a;
    color: #e2e8f0;
    overflow: auto;
    font-size: 13.5px;
    line-height: 1.7;
}
.prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.prose img { border-radius: var(--radius); margin: 8px 0; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose a { border-bottom: 1px solid #bfdbfe; }

.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 40px 0 0;
}
.article-nav a {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink-2);
    background: #fff;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.article-nav a:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); }
.article-nav .is-next { text-align: right; }
.article-nav small { display: block; color: var(--muted-2); font-size: 12px; margin-bottom: 4px; }
.article-nav strong { font-weight: 550; font-size: 14.5px; }

.comment-form textarea,
.comment-form input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.comment-form textarea:focus,
.comment-form input[type="text"]:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.comment-form textarea { min-height: 96px; resize: vertical; }
.comment-form__row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
.comment-form__code { width: 150px; }
.comment-form__code img {
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: block;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.comment-item:last-child { border-bottom: 0; }
.comment-item__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.comment-item__name { font-weight: 550; font-size: 14px; }
.comment-item__time { color: var(--muted-2); font-size: 12px; }
.comment-item__body { margin: 0; color: var(--ink-3); font-size: 14.5px; }

/* ---------- 文档 / 框架 ---------- */

.docs-banner {
    padding: 52px 0 40px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.docs-banner h1 { margin: 12px 0 12px; font-size: 38px; letter-spacing: -1px; line-height: 1.2; }
.docs-banner p { margin: 0; max-width: 640px; color: var(--ink-3); font-size: 16.5px; }
.docs-banner__actions { display: flex; gap: 12px; margin-top: 24px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    padding: 44px 0 24px;
}
.feature {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.feature:hover { border-color: #dbeafe; box-shadow: var(--shadow); transform: translateY(-2px); }
.feature__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.feature h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.2px; }
.feature p { margin: 0; color: var(--ink-3); font-size: 14px; }

.docs-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 44px;
    padding: 32px 0 64px;
    align-items: start;
}

/* 左侧目录：白卡片 + 目录头 + 内滚动 + 当前项竖条 */
.docs-side {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 40px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(23, 22, 20, .03);
    overflow: hidden;
}
.docs-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line-soft);
}
.docs-side__label { font-size: 12.5px; font-weight: 650; letter-spacing: .02em; color: var(--ink-2); }
.docs-side__count { font-size: 11.5px; color: var(--muted-2); }
.docs-side__toggle {
    display: none;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: var(--ink-3);
    cursor: pointer;
}
.docs-side__nav { flex: 1 1 auto; overflow-y: auto; padding: 10px 10px 14px; overscroll-behavior: contain; }
.docs-side__nav::-webkit-scrollbar { width: 6px; }
.docs-side__nav::-webkit-scrollbar-track { background: transparent; }
.docs-side__nav::-webkit-scrollbar-thumb { background: #e2ded7; border-radius: 3px; }
.docs-side__nav::-webkit-scrollbar-thumb:hover { background: #d2cdc4; }

.docs-side__group { padding-top: 12px; }
.docs-side__group:first-child { padding-top: 0; }
.docs-side__group + .docs-side__group { border-top: 1px solid var(--line-soft); margin-top: 8px; }
.docs-side__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 6px;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .04em;
    color: var(--muted);
    text-transform: none;
}
.docs-side__title::before {
    content: "";
    width: 3px;
    height: 10px;
    border-radius: 2px;
    background: #c9d8f6;
}
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li a {
    position: relative;
    display: block;
    padding: 7px 10px 7px 15px;
    border-radius: 7px;
    color: var(--ink-3);
    font-size: 13.5px;
    line-height: 1.5;
    transition: background .15s ease, color .15s ease;
}
.docs-side li a:hover { background: var(--bg-soft); color: var(--ink); }
.docs-side li a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.docs-side li a.is-active::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--brand);
}
.docs-side__foot {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--line-soft);
    background: #fcfbf9;
}
.docs-side__foot a {
    flex: 1;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}
.docs-side__foot a:hover { background: #fff; border-color: var(--line); color: var(--ink); }

.docs-content__crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.docs-content__crumb a { color: var(--muted); }
.docs-content h1 { font-size: 30px; margin: 0 0 18px; letter-spacing: -.5px; }

/* 文档页头：眉标 + 标题，替代此前「正文直接开篇」的观感 */
.docs-head { margin: 6px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.docs-head__kicker {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.docs-head__title { margin: 0; font-size: 32px; line-height: 1.25; letter-spacing: -.6px; }

.docs-foot {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 44px;
    padding-top: 22px;
    border-top: 1px solid var(--line-soft);
}

/* ---------- 工具箱 ---------- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding: 28px 0 64px;
}
.tool-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: inherit;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.tool-card:hover { border-color: #dbeafe; box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.tool-card__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}
.tool-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-card h3 { margin: 0 0 4px; font-size: 15px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- 下载 ---------- */

.dl-list { display: flex; flex-direction: column; gap: 14px; padding: 24px 0 48px; }
.dl-item {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.dl-item:hover { border-color: #dbeafe; box-shadow: var(--shadow-sm); }
.dl-item__thumb {
    width: 132px;
    height: 82px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    object-fit: cover;
    display: block;
}
.dl-item__title { margin: 0 0 6px; font-size: 16px; }
.dl-item__title a { color: var(--ink); }
.dl-item__title a:hover { color: var(--brand); }
.dl-item__desc { margin: 0 0 8px; color: var(--ink-3); font-size: 13.5px; }
.dl-item__meta { display: flex; gap: 14px; color: var(--muted-2); font-size: 12.5px; }

.price {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    color: var(--danger);
    font-weight: 650;
    font-size: 18px;
}
.price small { font-size: 12px; font-weight: 500; }
.price--free { color: var(--ok); font-size: 14px; }

/* ---------- 表单 / 认证 ---------- */

.auth-wrap {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background:
        radial-gradient(1000px 400px at 50% -10%, #eff6ff 0%, rgba(255, 255, 255, 0) 70%),
        var(--bg-soft);
}
.auth-card {
    width: 100%;
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.auth-aside {
    padding: 42px 36px;
    background: linear-gradient(150deg, #1e3a8a, #2563eb 60%, #7c3aed);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-aside h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.35; letter-spacing: -.4px; }
.auth-aside p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px; }
.auth-aside ul { margin: 26px 0 0; padding: 0; list-style: none; }
.auth-aside li { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.auth-aside li::before { content: "✓"; color: #a7f3d0; font-weight: 700; }
.auth-main { padding: 42px 40px; }
.auth-main h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.3px; }
.auth-main .sub { margin: 0 0 24px; color: var(--muted); font-size: 13.5px; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field input,
.field select,
.field textarea {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.field__hint { margin: 6px 0 0; color: var(--muted-2); font-size: 12.5px; }

.captcha-row { display: flex; gap: 12px; align-items: center; }
/* 输入框可收缩，验证码图片不收缩：否则手机上图片会被挤成一条线，看起来像"没有验证码" */
.captcha-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.captcha-row img {
    flex: 0 0 auto;
    width: auto;
    max-width: 160px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
    object-fit: fill;
}
.auth-foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); }
.auth-terms { margin-top: 16px; color: var(--muted-2); font-size: 12px; line-height: 1.65; }

/* ---------- 个人中心 ---------- */

.center-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 32px 0 64px; align-items: start; }
.center-aside { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.center-aside__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 20px;
    font-weight: 650;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.center-aside h2 { margin: 0 0 4px; font-size: 16px; }
.center-aside .email { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; word-break: break-all; }
.center-menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.center-menu a { display: block; padding: 9px 10px; border-radius: 7px; color: var(--ink-3); font-size: 14px; }
.center-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.center-menu a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 550; }

.wallet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #0f172a, #1e3a8a);
    color: #fff;
    margin-bottom: 22px;
}
.wallet__label { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.wallet__value { font-size: 30px; font-weight: 700; letter-spacing: -.6px; line-height: 1.2; }
.wallet__value small { font-size: 13px; font-weight: 500; margin-left: 4px; color: rgba(255, 255, 255, .75); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--bg-soft); }
.data-table tr:last-child td { border-bottom: 0; }

/* ---------- 通用状态 / 提示 ---------- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid;
    margin-bottom: 18px;
}
.alert--info { background: var(--brand-soft); border-color: #bfdbfe; color: var(--brand-ink); }
.alert--warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.alert--danger { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }

.toast-host {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 13.5px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .2);
    animation: toast-in .18s ease-out;
}
.toast--ok { background: #065f46; }
.toast--err { background: #991b1b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */

.site-foot {
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    padding: 34px 0 40px;
    color: var(--muted);
    font-size: 13px;
}
.site-foot__inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.site-foot__links { display: flex; flex-wrap: wrap; gap: 16px; }
.site-foot__links a { color: var(--ink-3); }
.site-foot__links a:hover { color: var(--brand); }
.site-foot__legal { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; color: var(--muted-2); font-size: 12.5px; }
.site-foot__legal img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- 工具类 ---------- */

.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hide { display: none !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .docs-side {
        position: static;
        max-height: none;
    }
    .docs-side__toggle { display: inline-flex; align-items: center; }
    .docs-side__nav, .docs-side__foot { display: none; }
    .docs-side.is-open .docs-side__nav { display: block; max-height: 340px; }
    .docs-side.is-open .docs-side__foot { display: flex; }
    .center-layout { grid-template-columns: minmax(0, 1fr); }
    .auth-card { grid-template-columns: 1fr; max-width: 480px; }
    .auth-aside { display: none; }
}

@media (max-width: 760px) {
    .container { padding: 0 16px; }
    .site-header { height: auto; }
    .site-header__inner { height: var(--header-h); gap: 12px; }
    .site-nav, .header-tools { display: none; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
    .mobile-panel {
        display: none;
        padding: 12px 0 18px;
        border-top: 1px solid var(--line);
        background: #fff;
    }
    .mobile-panel.is-open { display: block; }
    .mobile-panel a {
        display: block;
        padding: 10px 4px;
        color: var(--ink-2);
        font-size: 15px;
        border-bottom: 1px solid var(--line-soft);
    }
    .mobile-panel .search { margin-top: 12px; }
    .mobile-panel .search input { width: 100%; }
    .mobile-panel .search input:focus { width: 100%; }
    .hero { padding: 36px 0 26px; }
    .hero h1 { font-size: 30px; letter-spacing: -.6px; }
    .hero p { font-size: 15px; }
    .post__title { font-size: 17px; }
    .article-head h1 { font-size: 24px; }
    .prose { font-size: 15.5px; }
    .article-nav { grid-template-columns: 1fr; }
    .dl-item { grid-template-columns: 88px minmax(0, 1fr); }
    .dl-item__thumb { width: 88px; height: 62px; }
    .dl-item > .dl-item__price { grid-column: 2; }
    .docs-banner { padding: 34px 0 26px; }
    .docs-banner h1 { font-size: 28px; }
    .stat-strip { grid-template-columns: 1fr; }
    .brand { gap: 8px; font-size: 15px; }
    .auth-main { padding: 28px 22px; }
}

/* 框架分页器输出 <ul class="pagination">，这里复用 .pager 的视觉 */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; padding: 0; list-style: none; }
.pagination li { display: inline-flex; }
.pagination li > a,
.pagination li > span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-3);
    font-size: 13.5px;
}
.pagination li > a:hover { border-color: #c7d2fe; color: var(--brand); background: var(--brand-soft); }
.pagination li.active > span,
.pagination li.active > a { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination li.disabled > span { color: var(--muted-2); background: var(--bg-soft); }

/* ---------- 量化数据服务（/quant） ---------- */

.hero--quant { padding-bottom: 36px; }
.hero--quant h1 { letter-spacing: -1px; }

.quant-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin: 0 0 8px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.quant-stat { background: #fff; padding: 20px 22px; }
.quant-stat strong {
    display: block;
    font-size: 27px;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.quant-stat span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

.quant-section { margin: 56px 0; }

.quant-grid { display: grid; gap: 16px; }
.quant-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quant-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.quant-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.quant-card h3 { margin: 0 0 8px; font-size: 15.5px; letter-spacing: -.2px; }
.quant-card p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink-3); }
.quant-card code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--bg-code);
    font-size: 12.5px;
}
.quant-card__icon {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
}
.quant-card__icon svg { width: 17px; height: 17px; }

/* 架构示意 */
.arch {
    display: grid;
    grid-template-columns: 1fr 96px 1fr;
    align-items: center;
    gap: 0;
    margin-bottom: 14px;
}
.arch__box {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.arch__box h4 { margin: 6px 0 12px; font-size: 16px; }
.arch__box ul { margin: 0; padding-left: 18px; }
.arch__box li { font-size: 13.5px; line-height: 1.9; color: var(--ink-3); }
.arch__tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: .04em;
}
.arch__link { text-align: center; color: var(--muted); }
.arch__link span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
}
.arch__link small { display: block; font-size: 11px; margin-top: 2px; }
.arch__link::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0 auto 8px;
    width: 100%;
    background: linear-gradient(90deg, var(--line) 0%, var(--brand) 50%, var(--line) 100%);
}

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.metric-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.metric-table th,
.metric-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.metric-table thead th { background: var(--bg-soft); color: var(--muted); font-weight: 600; font-size: 12.5px; }
.metric-table tbody tr:last-child td { border-bottom: 0; }
.metric-table td:first-child { white-space: nowrap; color: var(--ink); font-weight: 500; }
.metric-table code { padding: 1px 5px; border-radius: 5px; background: var(--bg-code); font-size: 12.5px; }

/* 接口分布条 */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 168px 1fr 44px; align-items: center; gap: 12px; }
.bar__name { font-size: 13px; color: var(--ink-3); }
.bar__track { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, var(--brand)); }
.bar__num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* 三步上手 */
.quant-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.quant-step {
    position: relative;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.quant-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 10px;
}
.quant-step h3 { margin: 0 0 12px; font-size: 15px; }
.quant-step pre {
    margin: 0;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.75;
    overflow-x: auto;
}
.quant-step pre code { color: inherit; background: none; padding: 0; }
.quant-step .muted { margin: 10px 0 0; }

/* 问答 */
.qa { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.qa details { border-bottom: 1px solid var(--line-soft); }
.qa details:last-child { border-bottom: 0; }
.qa summary {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--muted-2); font-weight: 400; font-size: 16px; }
.qa details[open] summary::after { content: "−"; }
.qa details p { margin: 0; padding: 0 20px 18px; font-size: 13.5px; line-height: 1.8; color: var(--ink-3); }

/* 合规说明 */
.quant-notice {
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--muted-2);
    border-radius: var(--radius);
    background: #fbfaf8;
}
.quant-notice h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: -.1px; color: var(--ink-2); }
.quant-notice p { margin: 0; font-size: 12.8px; line-height: 1.9; color: var(--muted); }

/* 尾部行动区 */
.quant-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 64px 0 24px;
    padding: 32px 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand-soft), #fff 62%);
}
.quant-cta h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.4px; }
.quant-cta p { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.quant-cta__actions { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 980px) {
    .quant-stats { grid-template-columns: repeat(2, 1fr); }
    .quant-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .arch { grid-template-columns: 1fr; gap: 12px; }
    .arch__link::before { display: none; }
    .quant-steps { grid-template-columns: 1fr; }
    .quant-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
    .quant-grid--3 { grid-template-columns: 1fr; }
    .quant-grid--2 { grid-template-columns: 1fr; }
    .bar { grid-template-columns: 110px 1fr 38px; }
    .quant-stat strong { font-size: 22px; }
}

/* ---------- 量化页 · 意向表单 ---------- */

.lead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
    gap: 36px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 60%);
    align-items: start;
}

.lead__kicker {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
}

.lead h2 { margin: 12px 0 10px; font-size: 24px; letter-spacing: -.4px; }
.lead__intro p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.85; }

.lead__points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }
.lead__points li { position: relative; padding-left: 20px; font-size: 14px; color: var(--ink-3); }
.lead__points li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    opacity: .45;
}

.lead__form {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.lead__field { display: grid; gap: 6px; }
.lead__field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lead__optional { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--muted-2); }

.lead__input,
.lead__select,
.lead__textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-size: 14.5px;
    font-family: inherit;
    line-height: 1.5;
}

.lead__textarea { resize: vertical; min-height: 96px; }

.lead__input:focus,
.lead__select:focus,
.lead__textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.lead__inline { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.lead__captcha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.lead__captcha img {
    display: block;
    width: auto;
    max-width: 152px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    object-fit: fill;
}
.lead__submit { width: 100%; }
.lead__hint { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted-2); }
.lead__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.lead__done { padding: 30px 10px; text-align: center; }
.lead__done-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--ok-soft, #ecfdf5);
    color: var(--ok, #059669);
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lead__done h3 { margin: 0 0 8px; font-size: 18px; }
.lead__done p { margin: 0; font-size: 14px; color: var(--ink-3); line-height: 1.8; }

@media (max-width: 980px) {
    .lead { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
}

@media (max-width: 720px) {
    .lead { padding: 18px; border-radius: 14px; }
    .lead h2 { font-size: 20px; }
    .lead__inline { grid-template-columns: 84px minmax(0, 1fr); }
    .lead__form { padding: 16px; }
}
