/* ============================================================
   account/style.css — GitHub Pages 账户页样式
   视觉语言复刻主站 biotriage.html：
   白底、近黑正文、单一深蓝主色（#1a4d80）、金线点缀、
   发丝边框、无阴影、衬线标题 + 无衬线正文、
   小号大写字母分区标签 + 蓝色短下划线。
   账户页不依赖主站 CSS（Pages 上路径不同），取值在此复刻。
   ============================================================ */
:root {
    --primary: #1a4f8b;
    --primary-lt: #24619f;
    --primary-md: #143d6d;
    --accent: #1a4f8b;
    --gold: #b08d2f;
    --gold-lt: #8f7020;
    --white: #ffffff;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --ink: #1f2933;
    --ink-md: #475569;
    /* 三级灰都过 WCAG AA（正文 4.5:1）：7.58 / 5.98 / 4.83 */
    --ink-lt: #5b6472;
    --ink-xlt: #6b7280;
    --border: #e2e8f0;
    --border-lt: #f3f4f6;
    /* 警示色仅用于危险操作；文字用加深变体以过 AA */
    --danger: #e4572e;
    --danger-ink: #bf3d17;
    --ok: #2f6f4f;
    --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-en: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Georgia", "Times New Roman", "Songti SC", serif;
    --max-width: 1120px;
    --radius-sm: 4px;
    --radius: 6px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

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

h1, h2, h3 { line-height: 1.25; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease-out; }
a:hover { color: var(--primary-lt); text-decoration: none; }

/* ---------- 无障碍基础设施 ---------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    top: 0; left: 8px;
    transform: translateY(-120%);
    z-index: 300;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-en);
    font-size: 12px;
    color: var(--primary);
}
.skip-link:focus { transform: translateY(6px); }

/* 焦点环：#1a4d80 对白底 8.8:1，远高于 WCAG 1.4.11 要求的 3:1 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}
/* 主色/深色底上改用内描白环：白对蓝 8.8:1，蓝对蓝只有 1:1 */
.btn-primary:focus-visible,
.side-item.is-active:focus-visible,
.toast-close:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: -3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- 顶栏（复刻主站 .top-bar，不含语言切换） ---------- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-en);
    font-size: 12.5px;
    letter-spacing: 0.3px;
    color: var(--ink-lt);
}
.top-bar .tb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--ink);
    min-width: 0;
}
.top-bar .tb-brand .mini-logo {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--ink);
    white-space: nowrap;
}
.top-bar .tb-brand .mini-logo em { font-style: normal; color: var(--gold-lt); }
.top-bar .tb-tagline { font-weight: 400; color: var(--ink-xlt); min-width: 0; }
.top-bar .tb-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-xlt);
    flex-shrink: 0;
    white-space: nowrap;
}
.top-bar .tb-right .tb-aux { color: var(--ink-lt); }

/* 语言切换按钮：复刻主站 .lang-btn（同一枚胶囊按钮，取本页已有变量） */
.lang-btn {
    font-family: var(--font-en);
    font-size: 11.5px;
    line-height: 1.4;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink-md);
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 布局：侧栏 + 内容 ---------- */
.layout {
    display: flex;
    max-width: calc(var(--max-width) + 240px);
    margin: 0 auto;
    align-items: flex-start;
}
.sidebar {
    width: 220px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 76px;
    padding: 32px 20px 40px 24px;
    font-family: var(--font-en);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .side-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-xlt);
    padding: 0 12px 10px;
}
.side-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--ink-md);
    letter-spacing: 0.2px;
    transition: background 0.15s ease-out, color 0.15s ease-out;
}
.side-item:hover { background: var(--bg-alt); color: var(--ink); }
.side-item.is-active { background: var(--primary); color: #fff; font-weight: 600; }
.side-item.is-active:hover { background: var(--primary); color: #fff; }
.page { flex: 1; min-width: 0; padding: 0 24px 64px; }

/* ---------- 页头 ---------- */
.page-header { padding: 52px 0 10px; }
.page-header h1 {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.page-header h1 .h1-accent { color: var(--primary); font-weight: 400; margin-left: 14px; }
.page-header .tagline {
    margin: 0;
    max-width: 680px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--ink-md);
}
.page-header .meta {
    margin: 12px 0 0;
    font-family: var(--font-en);
    font-size: 12px;
    letter-spacing: 0.2px;
    color: var(--ink-xlt);
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 32px 0;
    box-shadow: none;
    padding-top: 20px;
}
/* 分区标签沿用主站 .section-label：小号大写字母 + 蓝色短下划线 */
.section-label {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 22px;
    padding-bottom: 10px;
    font-family: var(--font-en);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}
.section-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 34px;
    height: 2px;
    background: var(--primary);
}
.section-label .sl-zh:empty { display: none; }
.section-label .sl-zh {
    font-family: var(--font-zh);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: none;
    color: var(--ink-lt);
}
.section-label .count {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-zh);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.2px;
    text-transform: none;
    color: var(--ink-xlt);
}
.card-body { padding: 18px 22px 22px; }

/* ---------- 读取中 ---------- */
.loading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 10px;
    row-gap: 4px;
    padding: 56px 16px;
    color: var(--ink-lt);
    font-size: 14px;
    text-align: center;
}
.loading .spinner {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: acct-spin 0.8s linear infinite;
}
.loading #loadingText { display: inline-block; max-width: 26em; }
@keyframes acct-spin { to { transform: rotate(360deg); } }

/* ---------- 未登录引导 ---------- */
.guest-title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    color: var(--ink);
}
.guest-text {
    margin: 0 0 20px;
    max-width: 46em;
    font-size: 13.5px;
    line-height: 1.85;
    color: var(--ink-md);
}
.guest-note { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-xlt); }

.value-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.value-item {
    padding: 16px 18px;
    min-height: 108px;
    background: var(--bg-alt);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius-sm);
}
/* 顶部 28x2px 蓝色短横线：沿用 .section-label::after 的同款母题，替掉原左侧 3px 竖条 */
.value-item::before {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    margin: 0 0 12px;
    background: var(--primary);
}
.value-k {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}
.value-d { display: block; margin-top: 6px; font-size: 12px; line-height: 1.8; color: var(--ink-lt); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    max-width: 100%;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    font-family: var(--font-zh);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-md); color: #fff; }
.btn-ghost { background: var(--white); border-color: var(--border); color: var(--ink-md); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger-ghost { background: var(--white); border-color: #f0cdc3; color: var(--danger-ink); }
.btn-danger-ghost:hover:not(:disabled) { border-color: var(--danger); background: #fdf5f2; }

/* ---------- 键值信息 ---------- */
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { font-size: 12px; color: var(--ink-xlt); padding-top: 2px; letter-spacing: 0.2px; }
.kv dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.account-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 配额 ---------- */
.quota-summary {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--ink-md);
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
.quota-summary strong { font-family: var(--font-en); font-size: 22px; color: var(--ink); }
.quota-summary .qs-sep { color: var(--ink-xlt); }
.quota-track {
    max-width: 560px;
    height: 5px;
    background: var(--border-lt);
    border: 1px solid var(--border-lt);
    border-radius: 999px;
    overflow: hidden;
}
.quota-fill {
    width: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.15s ease-out;
}
.quota-fill.is-full { background: var(--gold-lt); }
.quota-meta { margin: 10px 0 0; font-size: 12px; color: var(--ink-xlt); overflow-wrap: anywhere; }

/* ---------- 列表 ---------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-lt);
}
.item:last-child { border-bottom: none; padding-bottom: 0; }
.item:first-child { padding-top: 0; }
.item-main { flex: 1 1 auto; min-width: 0; }
.item-title { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.item-meta { margin: 3px 0 0; font-size: 12px; color: var(--ink-xlt); overflow-wrap: anywhere; word-break: break-word; }
.item-note { margin: 6px 0 0; font-size: 12px; color: var(--danger-ink); }

.badge {
    display: inline-block;
    flex-shrink: 0;
    max-width: 100%;
    padding: 2px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-alt);
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-md);
    white-space: nowrap;
}

.item-remove {
    flex-shrink: 0;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink-lt);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s ease-out, border-color 0.15s ease-out;
}
.item-remove:hover:not(:disabled) { color: var(--danger); border-color: #e0c7c4; }
.item-remove:disabled { cursor: not-allowed; opacity: 0.55; }

/* ---------- 空态 ---------- */
.empty { margin: 0; padding: 6px 0; font-size: 13px; color: var(--ink-xlt); }
.empty-state {
    padding: 22px 20px;
    text-align: center;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}
.empty-state .empty-title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.empty-state .empty-text {
    margin: 0 auto 12px;
    max-width: 32em;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--ink-lt);
}
.empty-state .empty-link {
    display: inline-block;
    padding-bottom: 1px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease-out;
}
.empty-state .empty-link:hover { border-bottom-color: var(--primary); }

.inline-error { margin: 8px 0 0; font-size: 12.5px; color: var(--danger-ink); overflow-wrap: anywhere; }

/* ---------- 页脚 ---------- */
.footnote { margin: 30px 0 0; font-size: 12px; color: var(--ink-xlt); line-height: 1.8; }
.footnote .footnote-plain { margin: 0; }
.footnote .footnote-more { margin-top: 6px; }
.footnote summary {
    display: inline-block;
    cursor: pointer;
    font-size: 11.5px;
    color: var(--ink-lt);
    border-bottom: 1px dotted var(--border);
}
.footnote summary:hover { color: var(--primary); }
.footnote .footnote-more p { margin: 6px 0 0; max-width: 60em; font-size: 11.5px; line-height: 1.8; }

/* ---------- 管理员（仅 is_admin 时由 JS 挂载） ---------- */
.quota-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0 0 12px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.quota-item { padding: 14px 16px; background: var(--white); }
.quota-val {
    font-family: var(--font-en);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.quota-label { margin-top: 2px; font-size: 11.5px; color: var(--ink-xlt); }

.admin-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px;
}
.admin-refresh { flex-shrink: 0; }
.admin-search {
    width: 100%;
    max-width: 340px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}
.admin-search:hover { border-color: var(--ink-xlt); }
.admin-search:focus { border-color: var(--primary); }
.admin-filter-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-xlt); overflow-wrap: anywhere; }
.admin-user-list { margin-top: 4px; }
.admin-user { flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 0; }
.admin-user .item-meta { margin: 0; }
.admin-user.is-banned .item-title { color: var(--ink-lt); text-decoration: line-through; }
.admin-quota-input, .item-meta, .quota-meta, .kv dd { font-variant-numeric: tabular-nums; }
.admin-user-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; }
.admin-user-head .item-title { flex: 1 1 140px; min-width: 0; font-weight: 600; }
.admin-badge { flex-shrink: 0; }
.admin-badge-ok { color: var(--ok); border-color: #cfe3d8; background: #f2f7f4; }
.admin-badge-danger { color: var(--danger-ink); border-color: #f0cdc3; background: #fdf5f2; }
.admin-orcid { word-break: break-all; font-family: var(--font-en); }
.admin-quota { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.admin-quota-label { font-size: 12px; color: var(--ink-xlt); }
.admin-quota-input {
    width: 92px;
    min-width: 0;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}
.admin-quota-input:focus { border-color: var(--primary); }
.admin-quota-input:disabled { opacity: 0.55; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.admin-note { margin: 0; font-size: 12px; color: var(--ink-xlt); overflow-wrap: anywhere; }
.admin-note.is-ok { color: var(--ok); }
.admin-note.is-err { color: var(--danger-ink); }
.admin-more { margin-top: 14px; }

/* ---------- toast（右下角，2.5 秒自动消失，Esc 关闭） ---------- */
.toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 10px 12px;
    background: var(--ink);
    color: #fff;
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    font-size: 13px;
    line-height: 1.6;
    animation: toast-in 0.15s ease-out;
}
.toast.is-err { border-left-color: #e58c86; }
.toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast-close {
    flex-shrink: 0;
    padding: 0 2px;
    border: none;
    border-radius: 2px;
    background: none;
    color: #c9ced6;
    font-family: var(--font-en);
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}
.toast-close:hover { color: #fff; }
@keyframes toast-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .layout { flex-direction: column; max-width: none; }
    .sidebar {
        position: static;
        width: 100%;
        padding: 10px 16px;
        border-bottom: 1px solid var(--border);
    }
    .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .side-nav .side-label { display: none; }
    .side-item { padding: 6px 12px; font-size: 12px; }
    .page { width: 100%; padding: 0 16px 48px; }
    .page-header { padding: 32px 0 8px; }
    .page-header h1 { font-size: 32px; }
}

@media (max-width: 700px) {
    .top-bar { flex-direction: column; height: auto; gap: 2px; padding: 10px 16px; text-align: center; }
    .top-bar .tb-brand { flex-direction: column; gap: 2px; }
    /* 英文文案更长：顶栏右侧允许换行，避免窄屏横向溢出 */
    .top-bar .tb-right { justify-content: center; flex-wrap: wrap; white-space: normal; }
    .value-list { grid-template-columns: 1fr; }
    .value-item { min-height: 0; }
}

@media (max-width: 600px) {
    .page { padding: 0 12px 40px; }
    .page-header { padding: 24px 0 6px; }
    .page-header h1 { font-size: 27px; }
    .page-header h1 .h1-accent { margin-left: 8px; }
    .page-header .tagline { font-size: 14px; }
    .section-label { margin: 0 14px; }
    .card-body { padding: 14px 14px 16px; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dt { margin-top: 10px; }
    .item { flex-wrap: wrap; }
    .item-remove { order: 3; margin-left: auto; }
    .admin-search { max-width: none; flex-basis: 100%; }
    .quota-figures { grid-template-columns: 1fr; }
    .quota-item { padding: 10px 14px; }
    .toast-host { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
    .toast { max-width: calc(100vw - 20px); }
}

@media (max-width: 380px) {
    .side-item { padding: 6px 9px; font-size: 11.5px; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .page-header h1 { font-size: 24px; }
    .quota-summary strong { font-size: 19px; }
    .empty-state { padding: 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---- BYOK：自带 DeepSeek 密钥 ---- */
.byok-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.byok-input {
    flex: 1 1 220px; min-width: 0; font: inherit; font-size: 13px;
    padding: 7px 10px; border: 1px solid #d5d5d5; border-radius: 4px;
    background: #fff; color: #16181c;
}
.byok-input:focus-visible { outline: 2px solid #1a4d80; outline-offset: 1px; }
.byok-status { font-size: 13px; color: #4a5058; margin: 0; }
.byok-note { font-size: 12px; color: #8a9199; line-height: 1.7; margin: 4px 0 0; }

/* 顶栏：固定毛玻璃（不随主题变色；栏内文字固定深色以保证对比度） */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.45) !important;
    -webkit-backdrop-filter: blur(18px) saturate(200%);
    backdrop-filter: blur(18px) saturate(200%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}
.top-bar, .top-bar * { color: #16181c !important; }
.top-bar .mini-logo em, .top-bar a strong { color: #1a4d80 !important; }
.top-bar .lang-btn,
.top-bar .theme-btn,
.top-bar .nav-link,
.top-bar .tb-link {
    color: #16181c !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
    background: rgba(255, 255, 255, 0.35) !important;
}
.top-bar .lang-btn:hover,
.top-bar .theme-btn:hover,
.top-bar .nav-link:hover,
.top-bar .tb-link:hover {
    color: #1a4d80 !important;
    border-color: #1a4d80 !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .top-bar { background: rgba(255, 255, 255, 0.90) !important; }
}

/* ---- 深色主题：沿用本站暖调深色面 ---- */
:root[data-theme="dark"] {
    color-scheme: dark;
    --primary: #7fb2df;
    --primary-lt: #9cc6ea;
    --primary-md: #6aa2d2;
    --accent: #9cc6ea;
    --gold: #d8bc7a;
    --gold-lt: #e6cf98;
    --white: #191c21;
    --bg: #14161a;
    --bg-alt: #191c21;
    --ink: #e9e7e2;
    --ink-md: #b8b5ae;
    --ink-lt: #918e88;
    --ink-xlt: #6e6b66;
    --border: #2a2e35;
    --border-lt: #20242a;
    --danger: #ff8a6b;
    --danger-ink: #ffa58c;
    --ok: #7fc9a5;
}
.theme-btn {
    font-size: 13px; line-height: 1; color: var(--ink-xlt); background: transparent;
    border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; cursor: pointer;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}
.theme-btn:hover { color: var(--primary); border-color: var(--primary); }
html.theme-anim, html.theme-anim * {
    transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease) !important;
}

.brand-mark {
    width: 24px; height: 24px; border-radius: 6px;
    object-fit: cover; display: inline-block; vertical-align: -6px;
    margin-right: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.brand-mark { width: 24px; height: 24px; border-radius: 6px; object-fit: cover;
    display: inline-block; vertical-align: -6px; margin-right: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.18); }
