/* ============================================================
   顾凉私用中转 - 全面重构 v5
   风格: 新野兽派 (Neo-Brutalist)
   - 粗黑边框 (2-3px) + 硬投影 (实色偏移, 无模糊)
   - 直角 / 微圆角, 高对比黑白 + 荧光色块点缀
   - 超大黑体数字标题, 字重 800-900
   - hover: 卡片位移 + 投影增大的"按压"手感
   ============================================================ */

:root {
    /* 纸白底 */
    --bg:        #FDFDFB;
    --bg-alt:    #F4F2EC;
    --card:      #FFFFFF;

    /* 黑边框 */
    --line:      #111111;
    --line-2:    #111111;

    /* 文字 */
    --text:      #111111;
    --text-2:    #444444;
    --text-3:    #888888;

    /* 荧光点缀色 */
    --brand:     #D9F24F;   /* 荧光黄绿 (主点缀) */
    --brand-2:   #B8E62E;
    --brand-3:   #111111;   /* 强调反转为黑 */
    --brand-50:  #F4FBDC;
    --brand-100: #E9F6B8;

    /* 功能色 (高饱和直给) */
    --success:   #16C784;
    --warn:      #FFB800;
    --danger:    #FF4D4D;
    --purple:    #7C5CFF;
    --cyan:      #00C2D9;
    --pink:      #FF5CA8;
    --orange:    #FF7A00;

    /* 侧栏 - 亮黄或纯黑? → 纯黑底 + 荧光字 */
    --side-bg:   #111111;
    --side-bg-2: #222222;
    --side-text: #F5F5F0;
    --side-text-2: #999999;

    /* 硬投影 (实色, 零模糊) */
    --sh-1: 3px 3px 0 #111111;
    --sh-2: 4px 4px 0 #111111;
    --sh-3: 6px 6px 0 #111111;
    --sh-4: 10px 10px 0 #111111;
    --sh-hover: 8px 8px 0 #111111;
    --sh-glow: 4px 4px 0 var(--brand-2);

    /* 直角为主 */
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 8px;
    --r-xl: 10px;
    --r-2xl: 12px;
    --r-full: 999px;

    --gap-1: 4px; --gap-2: 8px; --gap-3: 12px; --gap-4: 16px;
    --gap-5: 20px; --gap-6: 24px; --gap-7: 32px; --gap-8: 40px;

    /* 动效曲线: 野兽派要干脆, 不要Q弹 — 快出缓停, 零过冲 */
    --spring: cubic-bezier(.2, .7, .3, 1);
    --soft: cubic-bezier(.25, .8, .35, 1);
    --bounce: cubic-bezier(.68, -0.55, .265, 1.55);

    --ff: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    --ff-mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ============ 旧变量兼容别名 ============
   JS 内联模板 (app.js 77处) / index.php 内联样式 (58处) 仍引用旧 --c-* 变量,
   这里统一映射到新野兽派体系, 避免逐处改模板 */
:root {
    --c-bg:        var(--bg);
    --c-bg-alt:    var(--bg-alt);
    --c-bg-3:      var(--bg-alt);
    --c-card:      var(--card);
    --c-line:      var(--line);
    --c-line-2:    var(--line);
    --c-text:      var(--text);
    --c-text-2:    var(--text-2);
    --c-text-3:    var(--text-3);
    --c-brand:     var(--brand-2);       /* 文字/图标强调用: 荧光黄在白底看不清, 用深一档 */
    --c-brand-2:   var(--brand);
    --c-brand-3:   var(--brand-2);
    --c-brand-50:  var(--brand-50);
    --c-success:   var(--success);
    --c-warn:      var(--warn);
    --c-danger:    var(--danger);
    --c-purple:    var(--purple);
    --c-cyan:      var(--cyan);
    --c-pink:      var(--pink);
    --c-orange:    var(--orange);
    --grad-brand:  linear-gradient(135deg, var(--brand), var(--brand-2));
    --grad-btn:    linear-gradient(180deg, var(--brand-2), var(--brand));
    --sh-glow-old: var(--sh-glow);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
html.js-ok .anim-on-load { opacity: 1; }

body {
    font-family: var(--ff);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    /* 细网格底纹 (野兽派图纸感) */
    background-image:
        linear-gradient(var(--bg-alt) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-alt) 1px, transparent 1px);
    background-size: 32px 32px;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
a { color: inherit; text-decoration: none; }

/* ============ 布局 ============ */
.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    gap: 0;
}

/* 主区容器 (透明底, 露出 body 网格底纹) */
.main {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============ 侧栏 (纯黑块) ============ */
.sidebar {
    background: var(--side-bg);
    color: var(--side-text);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 3px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; color: #fff; }
.brand-logo {
    width: 38px; height: 38px;
    background: var(--brand);
    border: 2px solid #F5F5F0;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-weight: 900; font-size: 16px; color: #111;
    box-shadow: 3px 3px 0 rgba(217,242,79,.35);
    overflow: hidden; flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand-text { font-size: 15px; font-weight: 900; letter-spacing: 0.5px; color: #fff; }
.brand-text small { display: block; font-size: 10px; color: var(--brand); font-weight: 700; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }

.nav-section { margin-bottom: 6px; }
.nav-title {
    padding: 14px 10px 5px;
    font-size: 10px;
    color: var(--side-text-2);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    color: var(--side-text);
    font-weight: 700;
    font-size: 13.5px;
    transition: all .15s var(--spring);
    cursor: pointer;
    position: relative;
}
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-item:hover { border-color: #F5F5F0; color: #fff; transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--brand); }
.nav-item.active {
    background: var(--brand);
    border-color: #F5F5F0;
    color: #111;
    box-shadow: 3px 3px 0 rgba(245,245,240,.3);
}
.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border: 1.5px solid #F5F5F0;
    border-radius: var(--r-sm);
    font-weight: 800;
}

.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    border: 2px solid #F5F5F0;
    border-radius: var(--r-sm);
    background: var(--side-bg-2);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all .15s var(--spring);
}
.user-card:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--brand); }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--r-sm);
    background: var(--brand);
    display: grid; place-items: center;
    color: #111; font-weight: 900;
    flex-shrink: 0;
    border: 1.5px solid #F5F5F0;
}
.user-name { font-size: 13px; color: #fff; font-weight: 800; }
.user-plan { font-size: 11px; color: var(--brand); font-weight: 600; }

.side-feedback { padding: 0 10px 6px; }
.side-fb-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 12px;
    border: 2px dashed #555;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--side-text-2);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s var(--spring);
}
.side-fb-btn:hover { border-color: var(--brand); border-style: solid; color: var(--brand); }

/* 赞助按钮: 荧光黄醒目块 + 跳动红心 */
.sponsor-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px 12px;
    background: var(--brand);
    border: 3px solid #111;
    border-radius: var(--r-sm);
    color: #111;
    font-size: 13.5px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(217,242,79,.35);
    margin-bottom: 8px;
    transition: all .15s var(--spring);
    font-family: inherit;
}
.sponsor-btn:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 rgba(217,242,79,.5); }
.sponsor-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #111; }
.sponsor-badge {
    font-size: 9.5px;
    background: #111;
    color: var(--brand);
    padding: 2px 7px;
    border-radius: var(--r-sm);
    letter-spacing: 1px;
    animation: sponsor-blink 1.6s ease-in-out infinite;
}
@keyframes sponsor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}
.sponsor-heart {
    font-size: 40px;
    color: var(--danger);
    animation: sponsor-beat 1.1s ease-in-out infinite;
    line-height: 1;
}
@keyframes sponsor-beat {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(.95); }
}
.sponsor-qr-wrap {
    display: inline-block;
    padding: 10px;
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: var(--sh-2);
    max-width: 260px;
}
.sponsor-qr-wrap img { display: block; width: 100%; max-width: 240px; height: auto; border-radius: 4px; }

/* 站点设置中的赞助二维码管理 */
.sponsor-settings {
    margin: 14px 0 16px;
    padding: 14px;
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-alt);
    box-shadow: var(--sh-1);
}
.sponsor-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.sponsor-settings-head strong { font-size: 14px; font-weight: 900; }
.sponsor-settings-hint { margin-top: 3px; color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.sponsor-settings-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sponsor-preview-box {
    width: 170px;
    min-height: 170px;
    padding: 10px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-1);
    flex-shrink: 0;
}
.sponsor-preview-box img { display: block; width: 100%; max-width: 148px; height: auto; max-height: 148px; object-fit: contain; }
#sponsorQrAlipayFallback, #sponsorQrWechatFallback { color: var(--text-3); font-size: 11px; font-weight: 800; text-align: center; }
.sponsor-settings-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 160px; }
.sponsor-settings-actions small { flex-basis: 100%; color: var(--text-3); font-size: 11px; line-height: 1.5; font-weight: 600; }
.sponsor-channel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.sponsor-channel {
    border: 2px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px;
    background: var(--card);
}
.sponsor-channel-title { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:10px; font-size:13px; }
.sponsor-channel-title b { font-size:14px; font-weight:900; }
.sponsor-channel-title span { font-size:10.5px; color:var(--text-3); font-weight:700; }
.sponsor-channel-body { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.sponsor-channel-body .sponsor-preview-box { width:150px; min-height:150px; }
.sponsor-channel-body .sponsor-preview-box img { max-width:128px; max-height:128px; }
.sponsor-channel-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
}
.sponsor-modal-channel > strong { display:block; margin-bottom:10px; font-size:15px; font-weight:900; }
.sponsor-modal-channel .sponsor-qr-wrap { display:block; width:100%; max-width:360px; margin:0 auto; padding:14px; }
.sponsor-modal-channel .sponsor-qr-wrap img { width:100%; max-width:330px; min-height:300px; object-fit:contain; border-radius:4px; }
#sponsorQrAlipayModalFallback, #sponsorQrWechatModalFallback { padding:100px 15px; color:var(--text-3); font-size:12px; font-weight:800; }
@media (max-width: 680px) {
    .sponsor-channel-grid, .sponsor-channel-modal-grid { grid-template-columns: 1fr; }
    .sponsor-preview-box { width: 150px; min-height:150px; }
    .sponsor-preview-box img { max-width:128px; max-height:128px; }
    .sponsor-modal-channel .sponsor-qr-wrap { max-width:300px; }
    .sponsor-modal-channel .sponsor-qr-wrap img { max-width:272px; min-height:230px; }
}
.side-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 2px solid #333;
    color: var(--side-text-2);
    font-size: 11px;
    text-align: center;
    font-weight: 600;
}

/* ============ 顶栏 (白块+黑边+硬投影) ============ */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
    margin: 20px 24px 0 24px;
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
    position: sticky; top: 20px;
    z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 18px; font-weight: 900; letter-spacing: .3px; }
.topbar-title small { display: block; font-size: 11px; color: var(--text-2); font-weight: 700; margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-search { position: relative; width: 260px; }
.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    background: var(--bg);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    outline: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all .15s var(--spring);
}
.topbar-search input:focus { box-shadow: var(--sh-glow); transform: translate(-2px, -2px); }
.topbar-search .ico {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text);
}

.icon-btn {
    width: 38px; height: 38px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    display: grid; place-items: center;
    color: var(--text);
    transition: all .15s var(--spring);
    position: relative;
    cursor: pointer;
    font-weight: 800;
}
.icon-btn:hover { background: var(--brand); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--line); }
.icon-btn:active { transform: translate(0, 0); box-shadow: none; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--card); }

.content {
    padding: 20px 24px 48px;
    width: 100%;
}

/* ============ 视图切换 ============ */
.view { display: none; }
.view.active { display: block; }
.view.anim-enter { animation: view-in .25s var(--spring); }
@keyframes view-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ============ 卡片基类 (黑边+硬投影) ============ */
.card, .float-card {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
    padding: 20px;
    transition: all .18s var(--spring);
    position: relative;
}
.card:hover, .float-card:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-3); }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .ico-wrap {
    width: 34px; height: 34px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #111;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-weight: 900;
}
.card-head .ico-wrap.purple { background: var(--purple); color: #fff; }
.card-head .ico-wrap.cyan   { background: var(--cyan); color: #111; }
.card-head .ico-wrap.green  { background: var(--success); color: #111; }
.card-head .ico-wrap.warn   { background: var(--warn); color: #111; }
.card-head .ico-wrap.pink   { background: var(--pink); color: #fff; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: .3px; }
.card-head .desc { color: var(--text-2); font-size: 12.5px; font-weight: 600; }

/* ============ 按钮 (块状+黑边+硬投影, 按压手感) ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 800;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--text);
    transition: all .12s var(--spring);
    cursor: pointer;
    box-shadow: var(--sh-1);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
    background: var(--brand);
    color: #111;
    box-shadow: var(--sh-1);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: none; }

.btn-ghost { background: transparent; box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); }

/* ============ 表单 (黑边输入框, focus 荧光投影) ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 800; letter-spacing: .3px; }
.field label .req { color: var(--danger); }
.field input, .field textarea, .field select {
    height: 42px;
    padding: 0 14px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    outline: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all .15s var(--spring);
}
.field textarea { height: auto; padding: 12px 14px; min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    box-shadow: var(--sh-glow);
    transform: translate(-2px, -2px);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ Chip (黑边小标签, 荧光填充) ============ */
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 800;
    background: var(--brand);
    color: #111;
}
.chip.green { background: var(--success); color: #fff; }
.chip.warn  { background: var(--warn); color: #111; }
.chip.gray  { background: var(--bg-alt); color: var(--text); }
.chip.red   { background: var(--danger); color: #fff; }

/* ============ Modal (硬投影大块) ============
   可见性优先: .modal 默认 opacity:1, 只在 backdrop 未 open 时用 visibility 藏住。
   避免 "opacity:0 起步 + transition" 在合成器节流下打开时停在透明态。 */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(17,17,17,.55);
    display: grid; place-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease; }
.modal {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--sh-4);
    transform: none;
    opacity: 1;
    transition: transform .25s var(--spring);
}
/* 打开瞬间做 "落位" 动画: 从偏移位回正 (内容由 backdrop 负责淡入) */
.modal-backdrop.open .modal { animation: modal-land .25s var(--spring); }
@keyframes modal-land {
    from { transform: translate(8px, -8px) scale(.98); }
    to   { transform: none; }
}
.modal-head { padding: 18px 22px; border-bottom: 3px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 900; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 3px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg-alt); }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    box-shadow: var(--sh-2);
    min-width: 240px;
    transform: translateX(120%);
    transition: transform .25s var(--spring);
    pointer-events: auto;
    font-size: 13px;
    font-weight: 700;
}
.toast.show { transform: none; }
.toast.success { border-left: 8px solid var(--success); }
.toast.error   { border-left: 8px solid var(--danger); }
.toast.info    { border-left: 8px solid var(--brand-2); }
.toast .ttl { font-weight: 900; margin-bottom: 2px; }

/* ============ 工具栏 ============ */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.list-toolbar .search { flex: 1; max-width: 400px; position: relative; }
.list-toolbar .search input {
    width: 100%; height: 40px;
    padding: 0 12px 0 36px;
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    outline: none;
    font-weight: 600;
    transition: all .15s var(--spring);
}
.list-toolbar .search input::placeholder { color: var(--text-3); }
.list-toolbar .search input:focus { box-shadow: var(--sh-glow); transform: translate(-2px, -2px); }
.list-toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text); }
.list-toolbar .grow { flex: 1; }

.seg-toggle {
    display: inline-flex;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--sh-1);
}
.seg-toggle button {
    padding: 7px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text);
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px;
    font-weight: 800;
    transition: background .12s, color .12s;
}
.seg-toggle button:hover { background: var(--bg-alt); }
.seg-toggle button.active { background: var(--brand); color: #111; }
.seg-toggle button + button { border-left: 2px solid var(--line); }

/* ============ 卡片行列表 ============ */
.card-row-list { display: flex; flex-direction: column; gap: 12px; }
.card-row {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    transition: all .15s var(--spring);
    position: relative;
}
.card-row:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-2); }
.card-row-cell { font-size: 13px; min-width: 0; }
.card-row-cell .label {
    display: none;
    font-size: 10px;
    color: var(--text-2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.card-row-cell .sub {
    font-size: 11.5px;
    color: var(--text-2);
    margin-top: 2px;
    word-break: break-all;
}
.card-row-cell .sub code {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 700;
}
.card-row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.card-row.cols-4 { grid-template-columns: 1.2fr 1fr .8fr auto; }
.card-row.cols-5 { grid-template-columns: 1.5fr 1fr .8fr 1fr auto; }
.card-row.cols-6 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto; }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; padding: 6px 0; flex-wrap: wrap; }
.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 2px solid var(--line);
    background: var(--card);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    box-shadow: var(--sh-1);
    transition: all .12s var(--spring);
}
.pagination button:hover:not(:disabled):not(.active) { background: var(--brand); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--line); }
.pagination button.active { background: #111; color: var(--brand); box-shadow: var(--sh-1); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .pg-info { margin: 0 10px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.pagination .pg-ellipsis { color: var(--text-3); padding: 0 6px; font-weight: 800; }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #111; border: 3px solid var(--bg); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-2); }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::selection { background: var(--brand); color: #111; }

/* ============ 概览 Bento Grid (野兽派: 大小色块拼贴) ============ */
.ov-glow { display: none; }   /* 野兽派不要柔光 */

.bento-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.bento-grid.ov-bento {
    grid-template-columns: 2fr 1fr 1fr;
}

.bento-card {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
    padding: 20px;
    transition: all .18s var(--spring);
    position: relative;
    overflow: hidden;
}
/* 第一个大卡: 荧光黄底 (野兽派色块) */
.bento-card.bento-lg {
    grid-column: span 2;
    background: var(--brand);
}
.bento-card:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-3); }

.bento-label {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: inline-block;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    padding: 2px 8px;
}
.bento-card.bento-lg .bento-label { background: #111; color: var(--brand); border-color: #111; }
.bento-value {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.bento-card.bento-lg .bento-value { color: #111; }
.bento-sub { font-size: 12px; color: var(--text-2); margin-top: 6px; font-weight: 700; }
.bento-card.bento-lg .bento-sub { color: #333; }

/* ============ 快捷栏 & 状态条 ============ */
.ov-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 2px 14px; }
.ov-bar-info { font-size: 13px; font-weight: 700; }
.ov-bar-info strong { font-weight: 900; background: var(--brand); border: 2px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; }
.ov-bar-info .sep { margin: 0 8px; color: var(--line); font-weight: 900; }
.ov-bar-actions { display: flex; gap: 10px; }

.ov-status {
    display: flex; align-items: center; gap: 8px;
    margin-top: 16px;
    padding: 10px 16px;
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: var(--sh-1);
}
.ov-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--line);
    flex-shrink: 0;
    animation: hard-blink 1.2s steps(2) infinite;
}
@keyframes hard-blink { 50% { opacity: .3; } }

/* ============ 余额卡片 ============ */
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bal-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
    border: 3px dashed var(--line);
    border-radius: var(--r-md);
    background: var(--bg-alt);
}

.bal-card {
    position: relative;
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px;
    transition: all .18s var(--spring);
    cursor: pointer;
    box-shadow: var(--sh-2);
}
.bal-card:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-3); }

/* ============ 醒目展示卡 (featured): 双倍宽 + 荧光高亮 + 旋转星标 ============ */
.bal-grid:has(.bal-featured) {
    /* 有醒目卡时网格改 2 列基准, featured 占满整行 (小卡自动跟随) */
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bal-card.bal-featured {
    grid-column: 1 / -1;
    background: var(--brand-50);
    border-color: var(--brand-2);
    border-width: 4px;
    box-shadow: 8px 8px 0 var(--brand-2), var(--sh-1);
    padding: 22px 24px;
    animation: featured-pulse 2.4s ease-in-out infinite;
}
@keyframes featured-pulse {
    0%, 100% { box-shadow: 8px 8px 0 var(--brand-2), var(--sh-1); }
    50%      { box-shadow: 8px 8px 0 var(--brand-3), var(--sh-2); }
}
.bal-card.bal-featured .bal-logo {
    width: 46px; height: 46px;
    border-width: 3px;
    font-size: 18px;
    animation: logo-spin-in 3.2s var(--spring) infinite;
}
@keyframes logo-spin-in {
    0%, 78% { transform: rotate(0deg) scale(1); }
    86%     { transform: rotate(360deg) scale(1.15); }
    100%    { transform: rotate(360deg) scale(1); }
}
.bal-card.bal-featured .bal-name { font-size: 17px; letter-spacing: .3px; }
.bal-card.bal-featured .bal-remain { font-size: 34px; }
.bal-card.bal-featured .bal-remain .inf { font-size: 46px; }
.bal-card.bal-featured .bal-progress { height: 16px; border-width: 3px; }
/* 旋转大星标 (右上角, 荧光闪烁) */
.bal-star {
    position: absolute;
    top: -16px; right: -14px;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    font-size: 26px;
    color: var(--brand-3);
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: 50%;
    box-shadow: 4px 4px 0 var(--line);
    z-index: 2;
    animation: star-spin 6s linear infinite;
    text-shadow: 0 0 1px currentColor;
}
@keyframes star-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
/* 手机端醒目卡: 单列时占满即可, 星标缩小 */
@media (max-width: 768px) {
    .bal-grid:has(.bal-featured) { grid-template-columns: 1fr; }
    .bal-card.bal-featured { grid-column: auto; }
    .bal-star { width: 36px; height: 36px; font-size: 20px; top: -12px; right: -8px; }
}

.bal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bal-logo {
    width: 38px; height: 38px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #111;
    display: grid; place-items: center;
    font-weight: 900; font-size: 15px;
    flex-shrink: 0;
}
.bal-name { font-weight: 900; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-sub { font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.bal-top .spacer { flex: 1; }
.bal-refresh {
    width: 30px; height: 30px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    color: var(--text);
    transition: all .12s var(--spring);
    background: var(--card);
}
.bal-refresh:hover { background: var(--brand); transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--line); }
.bal-refresh.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bal-remain {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-bottom: 10px;
}
.bal-remain small { font-size: 13px; font-weight: 800; color: var(--text-2); margin-left: 3px; }
.bal-remain .unknown { font-size: 18px; color: var(--text-3); font-weight: 800; }
.bal-remain .inf { font-size: 38px; font-weight: 300; line-height: 1; margin-right: 4px; }

.bal-progress {
    height: 14px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    overflow: hidden;
    margin-bottom: 10px;
}
.bal-progress > i {
    display: block; height: 100%;
    background: repeating-linear-gradient(45deg, var(--brand), var(--brand) 8px, var(--brand-2) 8px, var(--brand-2) 16px);
    width: 0;
    transition: width 1s var(--spring) .15s;
}
.bal-card.warn .bal-progress > i { background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 8px, #d99e00 8px, #d99e00 16px); }
.bal-card.low  .bal-progress > i { background: repeating-linear-gradient(45deg, var(--danger), var(--danger) 8px, #cc3333 8px, #cc3333 16px); }

.bal-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 8px; font-weight: 700; }
.bal-meta b { font-weight: 900; }
.bal-foot {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding-top: 8px;
    border-top: 2px dashed var(--line);
}
.bal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); border: 1.5px solid var(--line); flex-shrink: 0; }
.bal-card.error .bal-dot { background: var(--danger); }
.bal-card.warn  .bal-dot { background: var(--warn); }
.bal-card.self  .bal-dot { background: var(--cyan); }

/* ============ 公告横幅 (荧光色块) ============ */
.notice-bar {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    background: var(--brand);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
}
.notice-ico { font-size: 20px; flex-shrink: 0; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-size: 14px; font-weight: 900; margin-bottom: 3px; }
.notice-content { font-size: 13px; font-weight: 600; white-space: pre-wrap; line-height: 1.7; max-height: 80px; overflow: hidden; }
.notice-meta { font-size: 11px; font-weight: 700; margin-top: 5px; }
.notice-close { border: 2px solid var(--line); background: var(--card); color: var(--text); font-size: 16px; font-weight: 900; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: var(--r-sm); transition: all .12s var(--spring); }
.notice-close:hover { background: var(--danger); color: #fff; }

/* ============ 模型网格 ============ */
.model-grid { display: grid; gap: 12px; }
.model-grid.layout-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.model-grid.layout-list { grid-template-columns: 1fr; gap: 8px; }
.model-grid.layout-list .model-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; }
.model-grid.layout-list .model-item .name { font-size: 14px; }
.model-grid.layout-list .model-item .meta { display: none; }
.model-grid.layout-list .model-item .model-price { margin: 0; min-width: 200px; text-align: left; }

.model-group { margin-bottom: 24px; }
.model-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.model-group-head .mg-name { font-weight: 900; font-size: 14px; }

.model-item {
    padding: 14px 16px;
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    background: var(--card);
    display: flex; flex-direction: column;
    gap: 8px;
    transition: all .15s var(--spring);
    cursor: pointer;
    box-shadow: var(--sh-1);
    position: relative;
}
.model-item:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-2); background: var(--brand-50); }

.model-item .name { min-width: 0; display: flex; align-items: flex-start; gap: 10px; font-weight: 800; font-size: 13.5px; line-height: 1.3; }
.model-item .name .avatar {
    width: 26px; height: 26px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #111;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 900;
    flex-shrink: 0;
}
.model-item .name.model-name-copy { cursor: copy; border-radius: var(--r-sm); padding: 3px 6px; margin: -3px -6px; transition: background .12s; }
.model-item .name.model-name-copy:hover { background: var(--brand); }
.model-item .mn-txt { flex: 1 1 auto; min-width: 0; word-break: break-word; overflow-wrap: anywhere; line-height: 1.3; }
.model-item .meta { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.model-item .meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text); }

.model-item .model-price {
    font-size: 12px;
    font-weight: 800;
    background: var(--bg-alt);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    margin-top: auto;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    line-height: 1.4;
}
.model-item:hover .model-price { background: var(--brand); }
.model-item .model-price .price-req { color: var(--text); }
.model-item .model-price .price-none { color: var(--text-3); font-weight: 600; }
.model-item .model-price .price-free { color: var(--success); font-weight: 900; }
.model-item .model-price .price-edit {
    margin-left: auto;
    width: 22px; height: 22px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    background: var(--card);
    transition: all .12s var(--spring);
    flex-shrink: 0;
}
.model-item .model-price .price-edit:hover { background: var(--brand); }

.type-chip {
    display: inline-block;
    padding: 1px 8px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 10.5px;
    font-weight: 800;
    background: var(--card);
    white-space: nowrap;
}
.type-chip.image  { background: var(--warn); }
.type-chip.video  { background: var(--purple); color: #fff; }
.type-chip.tts    { background: var(--pink); color: #fff; }
.type-chip.asr    { background: var(--cyan); }
.type-chip.embed  { background: var(--success); color: #fff; }
.type-chip.rerank { background: var(--bg-alt); }

.model-del {
    position: absolute;
    top: 8px; right: 8px;
    width: 24px; height: 24px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--danger);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: grid; place-items: center;
    opacity: 0;
    transition: all .12s var(--spring);
}
.model-item:hover .model-del { opacity: 1; }
.model-del:hover { background: var(--danger); color: #fff; }

.src-pop {
    display: block;
    position: absolute;
    top: calc(100% - 6px);
    left: 8px;
    z-index: 60;
    min-width: 210px;
    max-width: 290px;
    padding: 8px 10px;
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transform-origin: top left;
    transition: opacity .12s ease, transform .15s var(--spring), visibility 0s linear .15s;
}
.src-pop.open {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(0);
    transition: opacity .12s ease, transform .15s var(--spring), visibility 0s linear 0s;
}
.model-item:has(.src-pop.open) { z-index: 999; }

.mn-rename {
    border: 2px solid var(--line);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    opacity: 0;
    transition: all .12s var(--spring);
    display: inline-flex; align-items: center;
}
.model-item:hover .mn-rename { opacity: 1; }
.mn-rename:hover { background: var(--brand); }
.name.editing { display: flex; align-items: center; gap: 6px; }
.alias-in {
    flex: 1; min-width: 0;
    height: 30px;
    padding: 0 8px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    font-weight: 700;
    font-size: 12.5px;
    outline: none;
}
.alias-actions { display: flex; gap: 2px; flex-shrink: 0; }
.alias-actions button {
    border: 2px solid var(--line);
    background: var(--card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    width: 24px; height: 24px;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    transition: all .12s var(--spring);
}
.alias-save:hover { background: var(--success); color: #fff; }
.alias-cancel:hover { background: var(--danger); color: #fff; }

.model-price { cursor: pointer; }
.model-price.editing {
    cursor: default;
    background: var(--card);
    padding: 10px 11px;
    box-shadow: var(--sh-glow);
}
.pe-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pe-fields label { font-size: 10px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; font-weight: 800; text-transform: uppercase; }
.pe-fields input {
    width: 100%; height: 28px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    outline: none;
    font-variant-numeric: tabular-nums;
}
.pe-fields input:focus { box-shadow: var(--sh-glow); }
.pe-actions { display: flex; gap: 5px; margin-top: 8px; justify-content: flex-end; }
.pe-save, .pe-cancel {
    width: 28px; height: 28px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-weight: 900;
    font-size: 14px;
    transition: all .12s var(--spring);
}
.pe-save { background: var(--brand); }
.pe-save:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--line); }
.pe-save:active { transform: none; box-shadow: none; }
.pe-save:disabled { background: var(--text-3); cursor: wait; }
.pe-cancel { background: var(--card); }
.pe-cancel:hover { background: var(--bg-alt); }

/* ============ 聊天 ============ */
.chat-shell { display: grid; grid-template-columns: 280px 1fr; gap: 16px; height: calc(100vh - 150px); }
.chat-side {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--sh-1);
}
.chat-side-head { padding: 14px; border-bottom: 3px solid var(--line); display: flex; align-items: center; gap: 8px; }
.chat-side-body { flex: 1; overflow-y: auto; padding: 8px; }
.chat-session {
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all .12s var(--spring);
    margin-bottom: 4px;
    display: flex; flex-direction: column; gap: 3px;
    position: relative;
}
.chat-session:hover { border-color: var(--line); }
.chat-session.active { background: var(--brand); border-color: var(--line); box-shadow: var(--sh-1); }
.chat-session .t { font-size: 13px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-session .s { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.chat-session-del {
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--danger);
    font-size: 14px; font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: grid; place-items: center;
    opacity: 0;
    transition: all .12s var(--spring);
}
.chat-session:hover .chat-session-del { opacity: 1; }
.chat-session-del:hover { background: var(--danger); color: #fff; }

.chat-main {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: var(--sh-1);
}
.chat-head { padding: 12px 18px; border-bottom: 3px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-head .select { height: 36px; padding: 0 10px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card); outline: none; font-size: 13px; font-weight: 700; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.me, .msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--brand); border-color: var(--line); }
.msg .av {
    width: 34px; height: 34px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 13px; font-weight: 900;
    background: var(--card);
}
.msg.user .av { background: var(--brand); color: #111; }
.msg .bubble {
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    line-height: 1.65;
    font-size: 13.5px;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: var(--sh-1);
}
.msg.thinking .bubble { display: inline-flex; gap: 4px; align-items: center; }
.dots { display: inline-flex; gap: 3px; }
.dots span { width: 7px; height: 7px; background: var(--text); border-radius: 0; animation: hard-blink 1s steps(2) infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
.chat-input-area { border-top: 3px solid var(--line); padding: 14px 18px; display: flex; gap: 10px; }
.chat-input {
    flex: 1;
    min-height: 42px; max-height: 180px;
    padding: 10px 14px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    outline: none;
    resize: none;
    font-weight: 600;
    transition: all .15s var(--spring);
}
.chat-input:focus { box-shadow: var(--sh-glow); }

.chat-back {
    display: none;
    align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============ 统计页 ============ */
.row { display: grid; gap: 16px; margin-bottom: 16px; }
.row.row-3 { grid-template-columns: repeat(3, 1fr); }
.stat { position: relative; }
.stat .num { font-size: 40px; font-weight: 900; letter-spacing: -1.5px; line-height: 1.05; display: flex; align-items: baseline; gap: 4px; }
.stat .num small { font-size: 14px; font-weight: 800; }
.stat .delta { color: var(--text-2); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 6px 0 14px; }
.stat .icon-bubble {
    position: absolute; top: 16px; right: 16px;
    width: 42px; height: 42px;
    border: 3px solid var(--line);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-weight: 900; font-size: 16px;
}
.stat.coins  .icon-bubble { background: var(--warn); }
.stat.flame  .icon-bubble { background: var(--orange); color: #fff; }
.stat.spark  .icon-bubble { background: var(--brand); }
.stat .progress { height: 12px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card); overflow: hidden; }
.stat .progress > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width 1s var(--spring) .2s; }

#chartTimeline { width: 100%; height: 220px; display: block; }

/* ============ 个人主页 ============ */
.pf-head { display: flex; align-items: center; gap: 16px; }
.pf-avatar {
    position: relative;
    width: 72px; height: 72px;
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 3px solid var(--line);
    box-shadow: var(--sh-1);
    transition: all .15s var(--spring);
}
.pf-avatar:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-2); }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-avatar-edit {
    position: absolute; inset: auto 0 0 0;
    padding: 3px 0 4px;
    background: #111;
    color: var(--brand);
    font-size: 10.5px;
    font-weight: 800;
    text-align: center;
    opacity: 0;
    transition: opacity .15s ease;
}
.pf-avatar:hover .pf-avatar-edit { opacity: 1; }
.pf-idinfo { min-width: 0; }
.pf-nick { font-size: 17px; font-weight: 900; margin-bottom: 3px; }
.pf-id { font-size: 12px; color: var(--text-2); margin-bottom: 2px; font-weight: 700; }
.pf-id code, .pf-uname code {
    font-family: var(--ff-mono);
    background: var(--bg-alt);
    border: 1.5px solid var(--line);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 700;
}
.pf-uname { font-size: 12px; color: var(--text-2); font-weight: 700; }
.pf-toggle {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 4px;
    padding: 10px 12px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-alt);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.pf-toggle input { accent-color: #111; cursor: pointer; margin-right: 4px; }
.pf-toggle small { font-size: 11px; color: var(--text-2); font-weight: 600; }

/* ============ 反馈模态 ============ */
.fb-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fb-type {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 12px 14px;
    border: 3px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    cursor: pointer;
    text-align: left;
    transition: all .12s var(--spring);
    font-weight: 800;
}
.fb-type b { font-size: 13.5px; }
.fb-type small { font-size: 11px; color: var(--text-2); font-weight: 600; line-height: 1.5; }
.fb-type:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-1); }
.fb-type.active { background: var(--brand); box-shadow: var(--sh-1); }

/* ============ 其他列表 ============ */
.hidden-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 2px solid var(--line); }
.hidden-row:last-child { border-bottom: none; }
.nt-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 2px dashed var(--line); }
.nt-row:last-child { border-bottom: none; }

/* ============ 用户管理网格卡片 (一格一格) ============ */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.user-card-grid {
    background: var(--card);
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all .18s var(--spring);
    position: relative;
}
.user-card-grid:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-3); }
.user-card-grid.is-banned { opacity: .6; border-style: dashed; }

/* 头部: 头像 + 名字 + 徽章 */
.uc-head { display: flex; align-items: center; gap: 12px; }
.uc-avatar {
    width: 44px; height: 44px;
    border: 3px solid var(--line);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    color: #fff; font-size: 20px; font-weight: 900;
    flex-shrink: 0;
    box-shadow: 3px 3px 0 var(--line);
}
.uc-namewrap { flex: 1; min-width: 0; }
.uc-name { font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sub { font-size: 12px; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-badges { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 2px; }

/* 状态行 */
.uc-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; color: var(--text-2); font-weight: 700;
    padding: 8px 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-alt);
    flex-wrap: wrap;
}
.uc-sep { color: var(--line); font-weight: 900; }

/* 用量区 */
.uc-usage {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}
.uc-usage-item { text-align: center; }
.uc-usage-num { font-size: 22px; font-weight: 900; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.uc-usage-label { font-size: 10.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.uc-usage-label em { font-style: normal; color: var(--brand-2); font-weight: 900; }

/* 限额编辑区 */
.uc-limits {
    border-top: 2px dashed var(--line);
    padding-top: 10px;
}
.uc-limits-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.uc-limits-title small { text-transform: none; letter-spacing: 0; color: var(--text-3); font-weight: 600; }
.limit-edit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.limit-field { display: flex; flex-direction: column; gap: 2px; }
.limit-field label { font-size: 10px; color: var(--text-3); font-weight: 700; }
.limit-edit .limit-in { width: 100%; height: 30px; }
.limit-edit .ak-limit { grid-column: 1 / -1; height: 30px; }

/* 操作按钮行 */
.uc-ops {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding-top: 10px; border-top: 2px solid var(--line);
}
.uc-ops .btn { height: 30px; font-size: 12px; padding: 0 10px; }
.uc-ops .fbmail { font-size: 11px; }

/* 模型明细展开: 占满整行 */
.usage-detail-row { background: var(--bg-alt); border: 2px solid var(--line); border-radius: var(--r-sm); }
.usage-detail-row td { background: var(--bg-alt); border-top: 3px solid var(--line); }

/* ============ 限额编辑 (兼容旧表格用) ============ */
.limit-in {
    width: 60px; height: 28px;
    padding: 0 6px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.limit-in:focus { box-shadow: var(--sh-glow); outline: none; }
.fbmail { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; user-select: none; }
.fbmail input { accent-color: #111; cursor: pointer; }
.fbmail input:disabled { cursor: not-allowed; opacity: .5; }

/* ============ 入场动效 (干脆利落, 不果冻) ============
   ⚠️ 内容可见性优先于动画: 行默认可见 (opacity:1), 动画只做反向 "淡入增强"。
   之前用 animation ... both + opacity:0 起步, 在合成器节流 (后台窗口/省电) 时
   动画暂停在第一帧且永不恢复 → 整页内容透明。反向动画被暂停时内容本来就是可见的。 */
@keyframes row-in {
    from { opacity: .25; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.card-row.v2-reveal {
    animation: row-in .3s var(--spring) backwards;
    /* backwards: 仅延迟期间应用第一帧; 动画因节流暂停/不播时, 元素保持默认可见 */
}

.bento-card.v2-reveal,
.float-card.v2-reveal,
.bal-card.v2-reveal {
    opacity: 1;                       /* 默认可见 (修复节流下永远透明) */
    transform: none;
    transition: opacity .4s var(--spring), transform .4s var(--spring);
}
/* JS 入场时的 "预备→显现" 用短暂类切换实现, 不再依赖初始 opacity:0 */
.bento-card.v2-reveal.pre,
.float-card.v2-reveal.pre,
.bal-card.v2-reveal.pre {
    opacity: 0;
    transform: translateY(14px);
}

.mi { width: 16px; height: 16px; display: block; }
.icon-btn .mi { transition: transform .3s var(--spring); }
.icon-btn:hover .mi { transform: scale(1.15); }
#modalKeyMgr .mi { width: 13px; height: 13px; }

/* ============ QQ 群浮窗 (荧光色块) ============ */
.qq-group-float {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1050;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px 10px 12px;
    background: var(--brand);
    color: #111;
    border: 3px solid var(--line);
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--sh-2);
    transition: all .15s var(--spring);
    cursor: pointer;
}
.qq-group-float:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-3); }
.qq-group-float:active { transform: translate(2px, 2px); box-shadow: none; }
.qq-group-text em {
    font-style: normal;
    font-family: var(--ff-mono);
    font-weight: 900;
    font-size: 12px;
    background: #111;
    color: var(--brand);
    padding: 1px 8px;
    border-radius: var(--r-sm);
    margin-left: 2px;
}
.qq-group-pulse { display: none; }

/* ============ 手机端 ============ */
@media (max-width: 768px) {
    html.sidebar-open { overflow: hidden; }
    html.sidebar-open body::after {
        content: ""; position: fixed; inset: 0; z-index: 49;
        background: rgba(17,17,17,.5);
        animation: fadeIn .2s ease;
    }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        width: 280px; max-width: 86vw;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .25s var(--spring);
        height: 100vh; height: 100dvh;
        padding: 16px 12px;
        border-right: 3px solid var(--line);
    }
    html.sidebar-open .sidebar { transform: translateX(0); }
    html.sidebar-open .nav-item span,
    html.sidebar-open .brand-text,
    html.sidebar-open .nav-title,
    html.sidebar-open .user-card,
    html.sidebar-open .side-footer { display: revert; }
    html.sidebar-open .side-feedback { display: block; }

    .app { grid-template-columns: 1fr !important; }
    .content { padding: 14px 12px 80px; }
    .topbar { margin: 12px 12px 0 12px; padding: 10px 12px; gap: 8px; }
    .topbar-title { font-size: 15px; }
    .topbar-title small { display: none; }
    .topbar-search { display: none; }

    .menu-toggle {
        display: inline-flex !important; align-items: center; justify-content: center;
        width: 38px; height: 38px;
        border: 2px solid var(--line); border-radius: var(--r-sm);
        background: var(--brand);
        color: var(--text); cursor: pointer; flex-shrink: 0;
        box-shadow: var(--sh-1);
        -webkit-tap-highlight-color: transparent;
    }
    .menu-toggle:active { transform: translate(2px, 2px); box-shadow: none; }
    .menu-toggle svg { width: 18px; height: 18px; }

    .bento-grid.ov-bento {
        grid-template-columns: 1fr;
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .bento-grid.ov-bento::-webkit-scrollbar { display: none; }
    .bento-card { min-width: 240px; }
    .bento-card.bento-lg { grid-column: auto; }
    .bento-value { font-size: 36px; }

    .ov-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .ov-bar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

    .bal-grid { grid-template-columns: 1fr; gap: 12px; }

    .list-toolbar {
        flex-wrap: nowrap; overflow-x: auto; gap: 8px;
        padding-bottom: 6px; margin-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .list-toolbar::-webkit-scrollbar { display: none; }
    .list-toolbar > * { flex-shrink: 0; }
    .list-toolbar .search { flex: 0 0 180px; max-width: 200px; }
    .list-toolbar h3 { display: none; }

    .model-grid.layout-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .model-item { padding: 10px 12px; }
    .model-item .name { font-size: 12.5px; }

    .card-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
    .card-row-cell .label { display: block; }
    .card-row-actions { justify-content: flex-start; margin-top: 4px; flex-wrap: wrap; }
    .card-row.cols-4, .card-row.cols-5, .card-row.cols-6 { grid-template-columns: 1fr; }

    .chat-shell { grid-template-columns: 1fr; height: calc(100vh - 130px); height: calc(100dvh - 130px); gap: 0; }
    .chat-side { display: none; }
    html.chat-open .chat-side {
        display: flex; position: fixed; left: 0; top: 0; bottom: 0;
        width: 280px; max-width: 86vw; z-index: 60;
        border-radius: 0; box-shadow: 8px 0 0 rgba(17,17,17,.2);
    }
    html.chat-open body::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(17,17,17,.5); }
    .chat-head { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }
    .chat-input-area { padding: 8px; gap: 6px; }
    .msg { max-width: 92%; }
    .chat-back { display: inline-flex !important; }

    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal { width: 100% !important; max-width: 100% !important; max-height: 92vh; max-height: 92dvh; border-radius: var(--r-md) var(--r-md) 0 0; }
    .modal-body { max-height: 70vh; max-height: 70dvh; overflow-y: auto; }

    .field-row { grid-template-columns: 1fr; }
    .field input, .field textarea, .field select { font-size: 16px; }
    .btn { min-height: 40px; }
}

@media (min-width: 769px) and (max-width: 960px) {
    .menu-toggle { display: none !important; }
}

@media (min-width: 1920px) {
    .content { padding: 24px 20px 48px; }
}
