/* ==========================================================================
   小猫咪主机IDC · 设计系统 v2（玻璃拟态）
   ---------------------------------------------------------------------------
   规则：
     1. 背景三层（斜向渐变 + 四角色团 + 噪点）+ 两团柔光，玻璃才有东西可透
     2. 一层玻璃面板 + 面板内分隔线切行，不做「卡片里再套卡片」
     3. 圆角克制：面板 12 / 卡片 10 / 控件 8 / 胶囊 999
     4. 顶栏与侧栏在半透明磨砂上，靠透明度与模糊拉开层次，不靠重投影
   类名保持与既有模板兼容，零外部依赖。
   ========================================================================== */

:root {
    /* 品牌 */
    --brand:        #1e9fff;
    --brand-600:    #0d8bf2;
    --brand-700:    #0b62b8;
    --brand-deep:   #0b62b8;
    --brand-soft:   rgba(30, 159, 255, .12);
    --brand-soft-2: #d7ebff;
    --brand-glow:   rgba(30, 159, 255, .35);
    --brand-ring:   rgba(30, 159, 255, .26);
    --brand-grad:   linear-gradient(135deg, #1e9fff 0%, #0d8bf2 100%);

    /* 中性 */
    --ink:    #16212e;
    --text:   #3b4a59;
    --muted:  #66727f;
    --faint:  #8a95a2;
    --line:   rgba(17, 33, 56, .10);
    --line-2: rgba(17, 33, 56, .15);
    --bg:     #dfeaf9;
    --surface: rgba(255, 255, 255, .60);

    /* 玻璃层：靠透明度和模糊拉层次 */
    --glass:        rgba(255, 255, 255, .60);
    --glass-strong: rgba(255, 255, 255, .80);
    --glass-thin:   rgba(255, 255, 255, .46);
    --glass-line:   rgba(255, 255, 255, .68);
    --glass-blur:   blur(20px) saturate(185%);

    /* 语义色 */
    --success: #0f9d78;  --success-soft: rgba(15, 157, 120, .13);
    --warning: #b8730a;  --warning-soft: rgba(224, 140, 0, .15);
    --danger:  #d3454b;  --danger-soft:  rgba(211, 69, 75, .13);
    --info:    #1e9fff;  --info-soft:    rgba(30, 159, 255, .12);

    /* 形状 */
    --radius:      12px;
    --radius-sm:   8px;
    --radius-xs:   6px;
    --radius-pill: 999px;

    /* 光影 */
    --shadow-xs: 0 1px 2px rgba(16, 32, 56, .04);
    --shadow:    0 1px 1px rgba(16, 32, 56, .04), 0 12px 30px -20px rgba(16, 32, 56, .45);
    --shadow-md: 0 2px 8px rgba(16, 32, 56, .06), 0 22px 48px -26px rgba(16, 32, 56, .42);
    --shadow-lg: 0 4px 12px rgba(16, 32, 56, .08), 0 30px 60px -28px rgba(16, 32, 56, .5);
    --ring:      0 0 0 3px rgba(30, 159, 255, .20);

    /* 骨架尺寸 */
    --header-h: 64px;
    --topbar-h: 60px;
    --side-w:   234px;
    --gap:      16px;
    --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system,
            BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    /* 内容不足一屏时把页脚压到底部 */
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; }

/* ---------- 背景：玻璃必须有东西可透 ---------- */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #dfeaf9;
}
.bg-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(58% 48% at 6% -2%,  rgba(14, 136, 255, .58), transparent 64%),
        radial-gradient(52% 46% at 100% 18%, rgba(88, 132, 255, .34), transparent 66%),
        radial-gradient(46% 42% at 42% 44%, rgba(30, 159, 255, .24), transparent 72%),
        radial-gradient(62% 52% at 56% 104%, rgba(0, 190, 168, .42), transparent 68%),
        linear-gradient(142deg, #cfe2fb 0%, #dfe6fc 48%, #d6f1ec 100%);
}
.bg-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .45;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(52px);
    pointer-events: none;
}
.bg-glow-1 { width: 420px; height: 420px; left: 22%; top: 16%; background: rgba(255, 255, 255, .55); }
.bg-glow-2 { width: 380px; height: 340px; right: 8%; top: 42%; background: rgba(30, 130, 255, .30); }

/* 为老模板的 body::before 光晕保留（若页面未引入背景层也有底色） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background: radial-gradient(760px 420px at 88% -12%, rgba(30, 159, 255, .10), transparent 68%);
}

main { position: relative; z-index: 1; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0 0 10px; }
a { color: var(--brand-700); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-600); }
img { max-width: 100%; }
::selection { background: var(--brand-soft-2); color: var(--brand-700); }

/* 细滚动条，避免在玻璃面上出现粗黑条 */
* { scrollbar-width: thin; scrollbar-color: rgba(17, 33, 56, .22) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(17, 33, 56, .20); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(17, 33, 56, .34); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 玻璃基础件 ---------- */
.glass,
.card,
.panel,
.stat,
.stat-card,
.product-card,
.toolbar,
.auth-card {
    background-color: var(--glass);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, 0) 44%),
        linear-gradient(118deg, rgba(150, 205, 255, .20), rgba(255, 255, 255, 0) 58%);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, .62);
    box-shadow:
        0 1px 1px rgba(16, 32, 56, .04),
        0 12px 30px -20px rgba(16, 32, 56, .45),
        inset 0 1px 0 rgba(255, 255, 255, .55);
}

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.page { padding-top: 28px; padding-bottom: 72px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 通用两栏（侧栏 + 正文），仍供少量页面使用 */
.split { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
/* 产品列表：auto-fit 让空轨道收起，只有 2 个产品时也不会左挤右空 */
.product-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row > .form-control { height: 38px; min-height: 38px; }
.row > .btn-sm { height: 38px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 42px; }
.section-head h2 { font-size: 30px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 15.5px; margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: .95em; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.nowrap { white-space: nowrap; }

.page-title { font-size: 21px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }

/* ---------- 顶栏（公共版面） ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border-bottom: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 1px 0 rgba(17, 33, 56, .06);
    transition: box-shadow .2s, background .2s;
}
.topbar.scrolled { box-shadow: 0 1px 0 rgba(17, 33, 56, .08), 0 8px 24px -18px rgba(16, 32, 56, .5); }
.topbar-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
    white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(140deg, #43b4ff, var(--brand) 55%, #0b8ae8);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px -6px rgba(30, 159, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links a {
    position: relative;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--brand-700); background: rgba(255, 255, 255, .72); }
.nav-links a.active { color: var(--brand-700); font-weight: 650; background: rgba(255, 255, 255, .78); }

.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-toggle {
    display: none;
    width: 38px; height: 38px;
    border: 1px solid var(--glass-line);
    background: var(--glass-thin);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    position: relative;
}
.nav-toggle span {
    position: absolute;
    left: 10px; right: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform .22s, opacity .18s;
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 18px; }
.nav-toggle span:nth-child(3) { top: 23px; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 公共版面移动抽屉 */
.nav-drawer {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 55;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-line);
    box-shadow: var(--shadow-md);
    padding: 8px 20px 16px;
    display: none;
    max-height: calc(100vh - var(--header-h) - 1px);
    overflow-y: auto;
}
body.nav-open .nav-drawer { display: block; animation: slideDown .22s ease; }
.nav-drawer a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 14.5px;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a.active { color: var(--brand-700); font-weight: 650; }

/* 退出登录改 POST 之后：表单要隐形，按钮要长得跟原来的链接/按钮一致 */
.inline-form { display: inline; margin: 0; }
.nav-drawer .inline-form { display: block; }
.nav-drawer .inline-form .linkbtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 4px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    text-align: left;
    cursor: pointer;
}
.nav-drawer .inline-form:last-child .linkbtn { border-bottom: none; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   应用壳（用户中心 / 后台）：磨砂顶栏 + 固定玻璃侧栏 + 抽屉
   ========================================================================== */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border-bottom: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 1px 0 rgba(17, 33, 56, .06);
}
.app-topbar .brand { font-size: 15.5px; font-weight: 650; }
/* 抽屉开合按钮：窄屏才出现（用双类名压过 .icon-btn 的 display:grid） */
.app-topbar .drawer-toggle { display: none; }
@media (max-width: 900px) { .app-topbar .drawer-toggle { display: grid; } }
.app-crumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;
}
.app-crumb i { color: var(--faint); font-style: normal; }
.app-crumb b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-crumb a { color: var(--muted); }
.app-crumb a:hover { color: var(--brand-700); }

.app-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.chip-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: var(--radius-sm);
    background: var(--glass-thin);
    border: 1px solid var(--glass-line);
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
}
.chip-balance b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.icon-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-line);
    background: var(--glass-thin);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .92); border-color: var(--glass-line); }
.icon-btn .dot-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(140deg, #7fc8ff, var(--brand));
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    flex: 0 0 32px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.avatar:hover { color: #fff; }

/* 侧栏 */
.app-side {
    position: fixed;
    top: calc(var(--topbar-h) + var(--gap));
    left: var(--gap);
    bottom: var(--gap);
    width: var(--side-w);
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: var(--radius);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.app-side .side-head { display: none; }
.app-side .side-foot {
    margin-top: auto;
    padding: 12px 10px 6px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--faint);
    line-height: 1.7;
}
/* 侧栏底部只放版权与署名，不再放节点状态（节点信息在 /status 页） */
.app-side .side-copy { display: block; color: var(--text); font-weight: 600; font-size: 12px; }
.app-side .side-credit a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 2px;
}
.app-side .side-credit a:hover { color: var(--brand); text-decoration-color: currentColor; }

.nav-group { padding: 4px 0; }
.nav-group + .nav-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.nav-title {
    padding: 2px 10px 6px;
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 650;
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 10px;
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s, box-shadow .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--faint); transition: color .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .74); color: var(--ink); }
.nav-item:hover svg { color: var(--text); }
.nav-item.active {
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--brand-ring);
}
.nav-item.active svg { color: var(--brand-deep); }
.nav-item .badge-num {
    margin-left: auto;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    display: inline-grid; place-items: center;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 650;
}

/* 抽屉遮罩 */
.scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 28, 44, .32);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
}

/* 主区 */
.app-main {
    margin-left: calc(var(--side-w) + var(--gap) * 2);
    padding: var(--gap) var(--gap) 40px 0;
    min-width: 0;
}
.page-wrap { max-width: 1180px; margin: 0 auto; }
.app-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.app-head h1 { margin: 0 0 3px; font-size: 21px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.app-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
/* 单个按钮保持原宽，两个以上自动收窄排一行，不会一上一下 */
.head-actions .btn { flex: 0 1 auto; min-width: 0; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--glass-strong);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .16s;
}
.btn:hover { background: #fff; border-color: var(--line-2); color: var(--ink); box-shadow: 0 4px 12px -8px rgba(16, 32, 56, .5); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    border-color: transparent;
    background: linear-gradient(150deg, #3aabff, var(--brand) 60%, #0f8ff0);
    color: #fff;
    box-shadow: 0 6px 16px -10px rgba(30, 159, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover {
    color: #fff;
    background: linear-gradient(150deg, #2ba4ff, var(--brand-600) 60%, #0b83e0);
    box-shadow: 0 10px 22px -10px rgba(30, 159, 255, .95);
}
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #c33a3f; border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .7); color: var(--text); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-light { background: #fff; color: var(--brand-700); border-color: #fff; font-weight: 650; }
.btn-light:hover { background: #f2f9ff; color: var(--brand-700); border-color: #f2f9ff; }
.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand-700); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-700); }
.btn-outline-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .24); color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { width: 36px; padding: 0; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.form-control {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .82);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.form-control::placeholder { color: #9aa6b4; }
.form-control:hover { border-color: rgba(17, 33, 56, .22); }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%2366727f' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---------- 卡片 / 面板（一层玻璃 + 内部分隔线） ---------- */
.card { border-radius: var(--radius); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .tip { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-body { padding: 16px; }
/* tight 里通常直接放表格，裁掉圆角外的部分，否则行底色会溢出到卡片圆角外 */
.card-body.tight { padding: 0; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }

.panel { border-radius: var(--radius); overflow: hidden; }
.panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.panel-head .tip { font-size: 12px; color: var(--muted); font-weight: 400; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

/* 品牌渐变 CTA 卡 */
.cta-card {
    position: relative;
    overflow: hidden;
    border: none;
    color: #fff;
    background: var(--brand-grad);
    box-shadow: 0 10px 40px -12px rgba(30, 159, 255, .45);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: var(--radius);
}
.cta-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-opacity='.3' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    background-position: right -20px bottom -30px;
    opacity: .28;
    pointer-events: none;
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2, .cta-card h3 { color: #fff; }
.cta-card p { color: rgba(255, 255, 255, .92); }

/* ---------- 表格：无外框、只用行分隔线 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--faint);
    background: transparent;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .58); }
.table td.cell-text { max-width: 420px; overflow-wrap: anywhere; }
.table td.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
    .table td.cell-text { max-width: 220px; }
    .table .hide-sm { display: none; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- 徽章 / 标签 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-xs);
    background: rgba(17, 33, 56, .06);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: #0b7d61; }
.badge-warning { background: var(--warning-soft); color: #a86400; }
.badge-danger  { background: var(--danger-soft);  color: #c33a3f; }
.badge-info    { background: var(--info-soft);    color: var(--brand-700); }
.badge-brand   { background: var(--brand-soft);   color: var(--brand-700); }
.badge-muted   { background: rgba(17, 33, 56, .06); color: var(--muted); }
.badge-dot::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ---------- 等级 / Pro 会员（0-6 级靠色相区分，柔底深字） ---------- */
.lv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.lv-badge.lv-0 { background: rgba(120, 133, 148, .14); color: #5a6673; border-color: rgba(120, 133, 148, .22); }
.lv-badge.lv-1 { background: rgba(176, 123, 79, .15);  color: #8a5d34; border-color: rgba(176, 123, 79, .26); }
.lv-badge.lv-2 { background: rgba(126, 146, 168, .16); color: #566a80; border-color: rgba(126, 146, 168, .28); }
.lv-badge.lv-3 { background: rgba(201, 162, 39, .18);  color: #8d6f00; border-color: rgba(201, 162, 39, .34); }
.lv-badge.lv-4 { background: rgba(63, 169, 160, .16);  color: #1f7d74; border-color: rgba(63, 169, 160, .30); }
.lv-badge.lv-5 { background: rgba(63, 127, 214, .15);  color: #22598f; border-color: rgba(63, 127, 214, .28); }
.lv-badge.lv-6 {
    background: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(236, 72, 153, .16));
    color: #6d28d9;
    border-color: rgba(139, 92, 246, .34);
}

.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #ffe08a 0%, #f5b301 100%);
    color: #6b4a00;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .04em;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
}

/* 经验进度条 */
.exp-wrap { display: flex; flex-direction: column; gap: 6px; }
.exp-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.exp-bar {
    height: 7px;
    border-radius: var(--radius-pill);
    background: rgba(17, 33, 56, .08);
    overflow: hidden;
}
.exp-bar > i {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--brand-grad);
    transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.exp-bar > i.max { background: linear-gradient(90deg, #8b5cf6, #ec4899); }

/* 等级概览卡（仪表盘 / 等级页顶部） */
.level-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.level-hero .lv-ring {
    width: 62px; height: 62px;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.02em;
    background: var(--brand-soft);
    color: var(--brand-700);
    border: 1px solid var(--brand-ring);
}
.level-hero .lv-body { flex: 1 1 220px; min-width: 200px; display: flex; flex-direction: column; gap: 9px; }
.level-hero .lv-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; }
.level-hero .lv-title b { font-size: 15px; font-weight: 700; color: var(--ink); }

/* 价格明细（原价 → 折扣 → 实付） */
.price-sheet { display: flex; flex-direction: column; gap: 8px; }
.price-sheet .row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text);
}
.price-sheet .row .k { color: var(--muted); }
.price-sheet .row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.price-sheet .row.cut .v { color: var(--success); }
.price-sheet .row.total {
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    font-size: 15px;
}
.price-sheet .row.total .v { font-weight: 750; color: var(--brand-700); font-size: 18px; }

/* 等级对照表里的折扣列 */
.table .rate-now { color: var(--brand-700); font-weight: 700; }
.table tr.is-you { background: var(--brand-soft); }

/* 状态点 */
.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-soft);
}
.status-dot.off { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.status-dot.dead { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* 用量条 */
.meter { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.meter .bar { flex: 1; height: 5px; border-radius: 999px; background: rgba(17, 33, 56, .10); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5cc0ff, var(--brand)); }
.meter span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 提示条 ---------- */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-line);
    background: rgba(255, 255, 255, .62);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 14px;
}
.alert:last-child { margin-bottom: 0; }
.alert-success { background: rgba(230, 247, 242, .82); color: #0b7d61; border-color: rgba(15, 157, 120, .22); }
.alert-error   { background: rgba(253, 236, 236, .86); color: #b9363b; border-color: rgba(211, 69, 75, .22); }
.alert-info    { background: rgba(234, 245, 255, .84); color: var(--brand-700); border-color: rgba(30, 159, 255, .22); }
.alert-warning { background: rgba(253, 243, 226, .86); color: #9a5c00; border-color: rgba(224, 140, 0, .24); }

/* ---------- 首页 Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 92px 0 100px;
    color: #fff;
    text-align: center;
    background: var(--brand-grad);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: .55;
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    inset: -40% 0 auto 0;
    height: 130%;
    background: radial-gradient(720px 400px at 50% -12%, rgba(255, 255, 255, .3), transparent 68%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero-copy { max-width: 780px; margin: 0 auto; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .34);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 24px;
}
.hero h1 { font-size: 46px; line-height: 1.22; margin: 0 0 20px; color: #fff; letter-spacing: -.01em; font-weight: 700; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #ffffff, #d3eeff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero > .container > p, .hero-copy p { font-size: 18px; line-height: 1.8; color: rgba(255, 255, 255, .92); margin: 0 auto 32px; max-width: 640px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }
.hero .btn { height: 50px; padding: 0 32px; font-size: 16px; font-weight: 600; border-radius: var(--radius-pill); }
.hero .btn-light { background: #fff; color: var(--brand) !important; border-color: #fff; font-weight: 700; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35); }
.hero .btn-light:hover { background: #fff; color: var(--brand-600) !important; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.hero .btn-outline { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .55); }
.hero .btn-outline:hover { background: #fff; color: var(--brand) !important; border-color: #fff; }

/* 首页 hero 特性 chips（替代原数字统计） */
.hero-chips {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 36px;
    flex-wrap: wrap;
}
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 500;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.hero-chip svg { width: 15px; height: 15px; opacity: .9; }

/* ---------- 特性 ---------- */
.feature {
    position: relative;
    text-align: center;
    background: rgba(255, 255, 255, .42);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--radius);
    padding: 34px 26px;
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    transition: transform .3s, box-shadow .3s, border-color .3s, background .3s;
}
.feature:hover {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(30, 159, 255, .3);
    transform: translateY(-6px);
    box-shadow: 0 18px 44px -24px rgba(16, 32, 56, .5);
}
.feature .ico { width: 56px; height: 56px; margin: 0 auto 18px; display: grid; place-items: center; color: var(--brand); background: none; border: none; border-radius: 0; font-size: 40px; line-height: 1; }
.feature .ico svg { width: 48px; height: 48px; display: block; }
.feature h3 { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--ink); }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.feature-grid { gap: 20px; }

/* ---------- 统计块（独立小玻璃面） ---------- */
.stat {
    position: relative;
    border-radius: var(--radius);
    padding: 15px 17px;
    transition: box-shadow .2s, transform .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(16, 32, 56, .06), 0 22px 48px -26px rgba(16, 32, 56, .5), inset 0 1px 0 rgba(255, 255, 255, .55); }
.stat .label, .stat .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.stat .value, .stat .v { font-size: 25px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.stat .value small, .stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .sub, .stat .hint { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* ---------- 产品卡 ---------- */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: var(--radius);
    padding: 26px 22px;
    transition: transform .3s, box-shadow .3s, border-color .3s;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(30, 159, 255, .45);
    box-shadow: 0 0 0 1px rgba(30, 159, 255, .3), 0 24px 50px -26px rgba(16, 32, 56, .5);
}
.product-card h3 { margin: 0; font-size: 16px; line-height: 1.4; }
.product-price { font-size: 28px; font-weight: 750; color: var(--brand-700); letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.product-price small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.product-desc {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.75;
    flex: 1;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc p { margin: 0 0 6px; }
.product-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 23px;
    padding: 0 8px;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, .56);
    border: 1px solid rgba(255, 255, 255, .7);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.product-flag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb020, #ff8a00);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    box-shadow: 0 6px 14px -8px rgba(255, 138, 0, .8);
    white-space: nowrap;
}
.spec-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.spec-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
}
.spec-list li:last-child { border-bottom: none; padding-bottom: 0; }
.spec-list li span:first-child { color: var(--muted); }

.product-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 404px)); justify-content: center; }

/* ---------- 分类 pill ---------- */
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill-tabs a {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .68);
    background: rgba(255, 255, 255, .52);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 550;
    transition: all .16s;
}
.pill-tabs a:hover { border-color: var(--brand-ring); color: var(--brand-700); background: rgba(255, 255, 255, .85); }
.pill-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -10px var(--brand-glow); }

/* ---------- 面包屑 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .sep { opacity: .5; }

/* ---------- 侧边菜单（旧版类名，保留兼容） ---------- */
.side-menu { padding: 10px; }
.side-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.side-menu a:hover { background: rgba(255, 255, 255, .74); color: var(--ink); }
.side-menu a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand-ring); }
.side-menu .icon { width: 17px; text-align: center; opacity: .9; font-size: 13px; }
.side-menu .badge { margin-left: auto; }

.side-menu-toggle, .admin-side-toggle { display: none; }

/* ---------- 列表（行分隔线，不套卡片） ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list li:last-child { border-bottom: none; }
.list .ico { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; }
.list .txt { min-width: 0; }
.list .txt b { display: block; font-weight: 550; color: var(--ink); font-size: 13px; }
.list .txt span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .time { margin-left: auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }

/* 快捷操作：按钮网格，不做嵌套盒 */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 16px 16px; }
.quick a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 11px 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .42);
    color: var(--text);
    text-decoration: none;
    font-size: 12.5px;
    transition: background .15s, border-color .15s, transform .15s;
}
.quick a:hover { background: rgba(255, 255, 255, .92); border-color: var(--brand-ring); transform: translateY(-1px); color: var(--text); }
.quick a svg { width: 18px; height: 18px; color: var(--brand); }

/* ---------- 页脚 ---------- */
.footer {
    position: relative;
    z-index: 1;
    margin-top: 64px;
    padding: 46px 0 24px;
    background: rgba(22, 33, 46, .93);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #98a4b3;
    font-size: 12.5px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.footer a { color: #c6cfda; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-bottom: 28px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: #fff; font-weight: 650; font-size: 14.5px; }
.footer h4 { color: #fff; font-size: 12.5px; margin: 0 0 12px; font-weight: 650; letter-spacing: .02em; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; font-size: 12px; color: #7f8b99; }
.footer-bottom a { color: inherit; text-decoration: underline; text-decoration-color: rgba(127, 139, 153, .45); text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--brand); text-decoration-color: currentColor; }
.footer .row { justify-content: space-between; }

/* 回到顶部 */
.to-top {
    position: fixed;
    right: 20px; bottom: 22px;
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid; place-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s;
    z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand-700); border-color: var(--brand-ring); }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 1px); display: grid; place-items: center; padding: 44px 20px 60px; }
.auth-card { width: 100%; max-width: 420px; border-radius: var(--radius); padding: 32px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.auth-wrap.split-auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; place-items: stretch; padding: 0; min-height: calc(100vh - var(--header-h) - 1px); }
.auth-aside {
    position: relative;
    overflow: hidden;
    padding: 52px 48px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--brand-grad);
}
.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    opacity: .5;
    pointer-events: none;
    mask-image: radial-gradient(120% 90% at 78% 8%, #000 0%, rgba(0, 0, 0, .5) 48%, transparent 82%);
    -webkit-mask-image: radial-gradient(120% 90% at 78% 8%, #000 0%, rgba(0, 0, 0, .5) 48%, transparent 82%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { color: #fff; font-size: 28px; line-height: 1.35; margin: 18px 0 14px; letter-spacing: -.02em; }
.auth-aside p { color: rgba(255, 255, 255, .88); font-size: 13.5px; line-height: 1.85; margin: 0 0 24px; max-width: 400px; }
.auth-aside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-aside li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .94); }
.auth-aside li::before { content: "✓"; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .36); display: grid; place-items: center; font-size: 10.5px; }
.auth-main { display: grid; place-items: center; padding: 44px 24px; }

@media (max-width: 900px) {
    .auth-wrap.split-auth { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { display: none; }
    .auth-main { padding: 28px 18px 44px; }
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------- 代码块 ---------- */
.code {
    background: rgba(13, 23, 38, .92);
    color: #d6e2f5;
    padding: 13px 15px;
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 36px; margin-bottom: 12px; opacity: .45; }
.empty .ico-empty { display: block; margin: 0 auto 14px; color: #b9c8da; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, .58);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 550;
}
.pager a:hover { border-color: var(--brand-ring); color: var(--brand-700); background: #fff; }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 加载指示 */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   后台：与用户中心同一套玻璃壳（.app-* 复用），此处只补后台专属配色
   ========================================================================== */
body.admin-mode .app-topbar .brand-mark {
    background: linear-gradient(140deg, #2b3d55, #16212e);
    box-shadow: 0 4px 12px -6px rgba(16, 32, 56, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
body.admin-mode .app-side { }
body.admin-mode .page-wrap { max-width: 1400px; }
.admin-chip {
    height: 20px;
    padding: 0 7px;
    border-radius: var(--radius-xs);
    background: var(--brand-soft);
    color: var(--brand-700);
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    letter-spacing: .04em;
    box-shadow: inset 0 0 0 1px var(--brand-ring);
}
.app-topbar .who { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }

/* 后台仪表盘卡片组件（沿用旧类名，换成玻璃底） */
.admin-shell { display: block; }
.admin-main { min-width: 0; }

/* ---------- 页头 / 工具栏 ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.page-head .page-title { margin: 0 0 3px; }
.page-head .page-sub { margin: 0; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    border-radius: var(--radius);
}
.toolbar .form-control { height: 34px; min-height: 34px; font-size: 12.5px; }
.toolbar .btn, .toolbar .btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar-label { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ---------- 仪表盘 ---------- */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 22px 24px;
    color: #fff;
    background: var(--brand-grad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 14px 40px -22px rgba(30, 159, 255, .8);
}
.dash-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-opacity='.28' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: .5;
    pointer-events: none;
}
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero h1 { color: #fff; font-size: 19px; margin: 0 0 5px; }
.dash-hero p { color: rgba(255, 255, 255, .88); font-size: 12.5px; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-row { }
.stat-card { position: relative; border-radius: var(--radius); padding: 15px 17px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.stat-card .k { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat-card .ico { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 13px; background: var(--brand-soft); color: var(--brand-700); }
.stat-card .ico.green { background: var(--success-soft); color: #0b7d61; }
.stat-card .ico.orange { background: var(--warning-soft); color: #a86400; }
.stat-card .ico.purple { background: rgba(90, 73, 201, .12); color: #5a49c9; }
.stat-card .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-card .v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-card .hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; }

.status-track { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(17, 33, 56, .08); }
.status-track span { display: block; height: 100%; }
.status-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.status-legend div { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.status-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* ---------- 后台登录 ---------- */
/* 登录页是独立文档，没有背景层，这里自己铺一层同色系的渐变，玻璃卡才有东西可透 */
.admin-login-body {
    background:
        radial-gradient(58% 48% at 4% -4%, rgba(14, 136, 255, .34), transparent 62%),
        radial-gradient(56% 50% at 100% 104%, rgba(0, 190, 168, .28), transparent 66%),
        linear-gradient(142deg, #cfe2fb 0%, #e4eafb 50%, #d9f1ec 100%);
    background-attachment: fixed;
}
/* 登录侧栏品牌行 */
.admin-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.admin-brand .mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 700; }
.admin-brand .chip { height: 20px; padding: 0 8px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; letter-spacing: .04em; }
.admin-login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.admin-login-aside { position: relative; overflow: hidden; padding: 52px 48px; color: #fff; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(150deg, #1b2b40, #0f1c2e); }
.admin-login-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    opacity: .6;
    pointer-events: none;
    mask-image: radial-gradient(120% 90% at 78% 8%, #000 0%, rgba(0, 0, 0, .5) 48%, transparent 82%);
    -webkit-mask-image: radial-gradient(120% 90% at 78% 8%, #000 0%, rgba(0, 0, 0, .5) 48%, transparent 82%);
}
.admin-login-aside > * { position: relative; z-index: 1; }
.admin-login-aside h2 { color: #fff; font-size: 28px; line-height: 1.35; margin: 20px 0 14px; letter-spacing: -.02em; }
.admin-login-aside p { color: rgba(255, 255, 255, .78); font-size: 13.5px; line-height: 1.85; margin: 0 0 24px; max-width: 400px; }
.admin-login-aside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.admin-login-aside li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .9); }
.admin-login-aside li::before { content: "✓"; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26); display: grid; place-items: center; font-size: 10.5px; }
.admin-login .auth-main { display: grid; place-items: center; padding: 36px 24px; }

@media (max-width: 900px) {
    .admin-login { grid-template-columns: minmax(0, 1fr); }
    .admin-login-aside { display: none; }
    .admin-login .auth-main { padding: 24px 18px; min-height: 100vh; }
}

/* ---------- 进场动画 ---------- */
@media (prefers-reduced-motion: no-preference) {
    .rise { animation: rise .5s cubic-bezier(.22, .7, .3, 1) both; }
    .rise:nth-child(2) { animation-delay: .05s; }
    .rise:nth-child(3) { animation-delay: .1s; }
    .rise:nth-child(4) { animation-delay: .15s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
    .app-main { padding-right: var(--gap); }
}
@media (max-width: 1080px) {
    .hero { padding: 78px 0 86px; }
    .hero h1 { font-size: 40px; }
    .split-main { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: minmax(0, 1fr); }
    .split > .side-menu { position: static; }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* 侧栏变抽屉 */
@media (max-width: 900px) {
    :root { --gap: 12px; }
    .app-topbar { padding: 0 14px; gap: 10px; }
    .app-crumb { display: none; }
    .chip-balance { display: none; }
    .app-side {
        top: 0; left: 0; bottom: 0;
        width: 268px;
        z-index: 60;
        border-radius: 0 var(--radius) var(--radius) 0;
        padding: 12px 12px 18px;
        transform: translateX(-102%);
        transition: transform .26s cubic-bezier(.3, .7, .3, 1);
        background-color: rgba(255, 255, 255, .86);
        background-image: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 40%);
        border-left: none;
        box-shadow: var(--shadow-md);
    }
    body.drawer { overflow: hidden; }
    body.drawer .app-side { transform: none; }
    body.drawer .scrim { opacity: 1; pointer-events: auto; }
    .app-side .side-head {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 2px 4px 12px;
        border-bottom: 1px solid var(--line);
        margin-bottom: 8px;
    }
    .app-side .side-head b { font-size: 13.5px; color: var(--ink); font-weight: 650; }
    .app-main { margin-left: 0; padding: 12px 12px 32px; }
    .page-wrap { max-width: none; }
    .app-head { margin-bottom: 14px; }
}

@media (max-width: 760px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    /* 后台顶栏窄屏只留必要项，避免挤成一条 */
    .app-topbar .visit-label { display: none; }
    .app-topbar .who span { display: none; }
    .nav-right { gap: 6px; min-width: 0; }
    .brand { font-size: 15px; min-width: 0; }
    .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-right .btn-ghost { display: none; }
    .nav-right .btn { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .brand-mark { width: 30px; height: 30px; font-size: 15px; }
    .hero { padding: 56px 0 64px; }
    .hero h1 { font-size: 28px; }
    .hero > .container > p, .hero-copy p { font-size: 14.5px; margin-bottom: 24px; }
    .hero-actions { gap: 10px; }
    .hero-chips { gap: 8px; margin-top: 26px; }
    .hero-chip { padding: 7px 13px; font-size: 12px; }
    .section { padding: 50px 0; }
    .section-head h2 { font-size: 21px; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .card-body { padding: 14px; }
    .card-head { padding: 12px 14px; flex-wrap: wrap; }
    .card-head > * { min-width: 0; }
    .panel-head { padding: 12px 14px; }
    .table { min-width: 560px; font-size: 12.5px; }
    .table-compact { min-width: 0; }
    .table-wide { min-width: 860px; }
    .table th { padding: 8px 12px; }
    .table td { padding: 10px 12px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-row .stat { padding: 13px 14px; }
    .stat-row .stat .label { font-size: 11.5px; margin-bottom: 3px; }
    .stat-row .stat .value { font-size: 20px; }
    .stat-row > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .page { padding-top: 20px; padding-bottom: 48px; }
    .page-title { font-size: 19px; }
    .auth-card { padding: 24px 18px; }
    .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .product-card { padding: 20px 18px; }
    .product-grid { grid-template-columns: minmax(0, 1fr); }
    .product-row { grid-template-columns: minmax(0, 1fr); }
    .hero .btn { height: 42px; padding: 0 16px; font-size: 13.5px; }
    .to-top { right: 12px; bottom: 14px; }
    .app-topbar { padding: 0 12px; gap: 8px; }
    .app-topbar .brand { min-width: 0; flex: 0 1 auto; }
    .app-topbar .brand span:last-child { display: block; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .app-head { display: block; }
    .app-head h1 { font-size: 19px; }
    .app-head p { margin-bottom: 12px; }
    .head-actions { margin: 0; }
    .quick { grid-template-columns: 1fr 1fr; }
    .dash-hero { padding: 18px; }
    .dash-hero h1 { font-size: 17px; }
    .toolbar { padding: 9px; }
    .toolbar .grow { min-width: 0; width: 100%; flex: 1 1 100%; }
    /* 备份下载等长按钮在窄屏独占一行 */
    .page-head .actions .btn { flex: 1; }
}

/* 触屏设备关掉悬停位移，避免点完「粘」在移动状态 */
@media (hover: none) {
    .product-card:hover, .feature:hover, .stat:hover, .stat-card:hover { transform: none; }
}

/* 系统开启「减少动态效果」时全部关掉 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- 弹窗公告 ---------- */
body.popup-open { overflow: hidden; }
.popup-mask {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(15, 30, 45, .45);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: popupFade .18s ease;
}
.popup-mask[hidden] { display: none; }
.popup-card {
    width: 100%; max-width: 520px; max-height: 82vh;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 16px;
    box-shadow: 0 24px 70px -18px rgba(10, 30, 50, .45);
    overflow: hidden;
    animation: popupPop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.popup-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.popup-head h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); flex: 1; min-width: 0; }
.popup-tag {
    flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--brand-600, #0b7bd4);
    background: rgba(30, 159, 255, .1); border-radius: var(--radius-pill); padding: 3px 10px;
}
.popup-x {
    flex-shrink: 0; width: 30px; height: 30px; border: none; cursor: pointer;
    background: rgba(120, 140, 160, .12); color: var(--muted);
    border-radius: 50%; font-size: 17px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.popup-x:hover { background: rgba(120, 140, 160, .22); color: var(--ink); }
.popup-body { padding: 16px 20px; overflow-y: auto; font-size: 13.5px; line-height: 1.85; color: var(--ink-2, #33475b); }
.popup-body p { margin: 0 0 .8em; }
.popup-body p:last-child { margin-bottom: 0; }
.popup-body ul { margin: 0 0 .8em; padding-left: 1.3em; }
.popup-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 12px 20px 16px; border-top: 1px solid var(--line);
}
@keyframes popupFade { from { opacity: 0; } }
@keyframes popupPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@media (max-width: 640px) {
    .popup-foot { flex-direction: column; align-items: stretch; }
    .popup-foot .row { justify-content: flex-end; }
}

/* 用户中心壳（登录后）里的产品订购页：page-wrap 已限宽，container 不再叠加内边距 */
.app-main .container { width: auto; max-width: none; padding: 0; }

/* 站内消息详情正文：msgbody 滤镜产出的结构化纯文本，保留换行与空行 */
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; font-size: 13.5px; color: var(--ink-2, #33475b); }

/* 首页 hero chips 在减少动态效果下也保持静止 */
@media (prefers-reduced-motion: reduce) {
    .popup-mask, .popup-card { animation: none; }
}

/* ==========================================================================
   PJAX 无刷新换页
   ---------------------------------------------------------------------------
   四块东西：
     1. .pjax-bar   —— 顶部 2px 进度线，点击瞬间就给反馈（否则用户会以为没点到）
     2. body.pjax-loading —— 加载期间内容区失焦，见下方「加载态」
     3. .petal-*    —— 花瓣转场：换页瞬间从上方撒下一把花瓣落到屏底淡出
     4. main.pjax-enter —— 内容就位后的极短淡入，只为盖住「内容突然换了」这一下
   刻意没给 .pjax-bar 写基础 transition：复位到 width:0 必须是瞬时的，
   过渡只挂在 .on / .done 上，这样连续换页时进度条不会「倒着退回去」。
   ========================================================================== */
.pjax-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, var(--brand) 0%, #7cc6ff 55%, var(--brand-600) 100%);
    box-shadow: 0 0 8px rgba(30, 159, 255, .55);
}
.pjax-bar.on {
    width: 76%;
    opacity: 1;
    transition: width 2.4s cubic-bezier(.1, .65, .25, 1), opacity .15s ease-out;
}
.pjax-bar.done {
    width: 100%;
    opacity: 0;
    transition: width .2s ease-out, opacity .3s ease-out .12s;
}

/* ---------- 加载态：内容失焦 ---------- */
/* 换页请求还挂着的时候把内容区糊掉，新内容到位再抿回来。
   模的是相机对焦：背景（顶栏/侧栏）不动，只有页面主体在远近之间来回。

   为什么只糊 #pjaxMain、不糊 body：
      元素一旦有 filter 就成了「包含块」，position:fixed 的后代会改成相对
      它定位。顶栏 / 侧栏 / 回到顶部 / 弹窗遮罩都是 fixed，糊 body 会让它们
      跟着页面滚走。main 里没有 fixed 后代，糊它是最安全的落点。

   为什么不用 opacity 变暗：
      main.pjax-enter 那条动画带 animation-fill-mode: both，结束后会一直把
      opacity 钉在 1，而动画声明的优先级高于普通声明 —— 写的 .7 会被它盖掉。
      所以「变暗」只能交给 filter 里的 brightness / saturate，别碰 opacity。

   为什么不禁用 pointer-events：
      加载中再点别的链接，JS 会 abort 前一个请求重新发起；真禁掉点击，
      页面反而像卡死了。宁可让它能点。 */
/* 静息态只挂过渡、不写 filter: blur(0)：非 none 的 filter 会常驻一个合成层，
   既白占显存又可能让文字发虚。none 与 blur() 之间浏览器能正常插值。 */
#pjaxMain {
    transition: filter .16s ease-out;
}
body.pjax-loading #pjaxMain {
    filter: blur(3px) saturate(.9) brightness(.985);
}

/* ---------- 花瓣转场 ---------- */
/* 整层是全屏遮罩，但 pointer-events: none —— 花瓣只是好看，
   绝不能挡住用户在动画期间点下一条链接 */
.petal-layer {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}
/* 一片花瓣 = 一个矩形 + 对角圆角。100% 0 100% 0 会把长方形切成
   两端尖、中间鼓的形状，就是花瓣/叶片的样子，不需要图片或 SVG */
.petal {
    position: absolute;
    top: -10%;
    left: 0;
    width: var(--w, 14px);
    height: calc(var(--w, 14px) * .74);
    border-radius: 100% 0 100% 0;
    opacity: 0;
    background: linear-gradient(135deg, #fff2f7 0%, #f9bcd1 46%, #ec93b4 100%);
    box-shadow: 0 1px 4px rgba(206, 92, 130, .22);
    will-change: transform, opacity;
    animation-name: petalFall;
    animation-timing-function: cubic-bezier(.34, .08, .56, .96);
    animation-fill-mode: both;
    animation-iteration-count: 1;
}
@keyframes petalFall {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--r0, 0deg)); }
    12%  { opacity: var(--o, .75); }
    78%  { opacity: var(--o, .75); }
    100% { opacity: 0; transform: translate3d(var(--dx, 0px), 108vh, 0) rotate(var(--r1, 200deg)); }
}

/* 换页后的主区淡入。main 里没有任何 position:fixed 的后代，
   所以给 main 加 transform 不会让浮层错位 */
main.pjax-enter { animation: pjaxEnter .22s ease-out both; }
@keyframes pjaxEnter {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
}

/* 焦点被 JS 移到主区（读屏/键盘用户），不该看到焦点框 */
main#pjaxMain:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
    .pjax-bar.on, .pjax-bar.done { transition: opacity .12s linear; width: 100%; }
    main.pjax-enter { animation: none; }
    /* JS 在减少动效时根本不撒花瓣，这里再兜一层，防止样式被单独复用 */
    .petal-layer { display: none; }
    /* 失焦渐变也不给：快速的对焦变化同样会引起不适。
       系统开了这个偏好的人，反馈就只剩顶部那条进度线（它一直都在）。 */
    #pjaxMain { transition: none; }
    body.pjax-loading #pjaxMain { filter: none; }
}
