/* =============================================================
   云下载控制台 · 设计系统（移动优先）

   ── 改造说明（改动前请先读）──────────────────────────────────
   本次把整套样式改成**移动优先**，并与小程序端对齐：

   1. 默认样式面向手机（单列、卡片化、底部 tabbar）；
      宽屏用 min-width 断点做增强，不是反过来「桌面样式打补丁」。
      之前的问题就出在这里：页面里写死了 `grid-template-columns: 1.6fr 1fr`
      这类内联样式，媒体查询覆盖不到内联，手机上就被挤成一条竖排窄条。
      现在所有多列布局都走 .grid-2/.grid-3/.grid-auto/.split 这类类名，
      窄屏统一塌成单列。**视图里不要再写内联的 grid-template-columns。**

   2. 主题：默认**跟随系统**（prefers-color-scheme）。
      手动切换写入 localStorage 的 data-theme 后覆盖系统。
      · 无 data-theme            → 跟随系统
      · data-theme="light"       → 强制浅色
      · data-theme="dark"        → 强制深色
      浅色即小程序观感（浅灰底 + 白卡片 + 紫主色）。
   ============================================================= */

/* =============================================================
   1. 主题变量
   ============================================================= */

/* ---------- 浅色（默认值 = 跟随系统的浅色，也是小程序观感） ---------- */
:root {
    color-scheme: light;

    --sidebar-w: 236px;
    --tabbar-h: 58px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --transition: .2s cubic-bezier(.4, 0, .2, 1);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

    --content-pad: 14px;

    --bg: #f4f6fa;
    --bg-soft: #eaeef5;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --surface-hover: #eef2f8;
    --card: #ffffff;
    --card-solid: #ffffff;
    --border: rgba(17, 24, 39, .09);
    --border-strong: rgba(17, 24, 39, .18);
    --text: #16181d;
    --text-soft: #4b5565;
    --text-dim: #8b93a3;
    --primary: #6d4aff;
    --primary-soft: rgba(109, 74, 255, .1);
    --primary-glow: rgba(109, 74, 255, .28);
    --accent: #0ea5b7;
    --accent-soft: rgba(14, 165, 183, .1);
    --success: #10a35a;
    --success-soft: rgba(16, 163, 90, .1);
    --warning: #c9790a;
    --warning-soft: rgba(201, 121, 10, .12);
    --danger: #e5484d;
    --danger-soft: rgba(229, 72, 77, .1);
    --info: #2b7fff;
    --info-soft: rgba(43, 127, 255, .1);
    /* 彩色描边：老内核浏览器不支持 color-mix()，按钮/告警的半透明边框
       必须由变量直接给出，否则整条声明被丢弃（踩过「白底白字」按钮） */
    --primary-border: rgba(109, 74, 255, .38);
    --success-border: rgba(16, 163, 90, .38);
    --warning-border: rgba(201, 121, 10, .40);
    --danger-border: rgba(229, 72, 77, .38);
    --info-border: rgba(43, 127, 255, .38);
    --shadow: 0 12px 34px -18px rgba(16, 24, 40, .35);
    --shadow-sm: 0 4px 14px -8px rgba(16, 24, 40, .28);
    --shadow-lg: 0 26px 60px -22px rgba(16, 24, 40, .42);
    --glow: radial-gradient(900px 500px at 12% -10%, rgba(109, 74, 255, .1), transparent 60%),
            radial-gradient(700px 420px at 100% 0%, rgba(14, 165, 183, .08), transparent 55%);
    --up: #10a35a;
    --down: #6d4aff;
    --mask: rgba(16, 24, 40, .42);
    --topbar-bg: rgba(255, 255, 255, .86);
}

/* ---------- 深色（手动指定） ---------- */
html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #080a10;
    --bg-soft: #0d1017;
    --surface: #12161f;
    --surface-2: #171c27;
    --surface-hover: #1d2331;
    --card: rgba(20, 25, 36, .78);
    --card-solid: #141924;
    --border: rgba(255, 255, 255, .075);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #e9edf6;
    --text-soft: #a8b1c4;
    --text-dim: #6f7a90;
    --primary: #7c5cff;
    --primary-soft: rgba(124, 92, 255, .16);
    --primary-glow: rgba(124, 92, 255, .45);
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, .14);
    --success: #2ed573;
    --success-soft: rgba(46, 213, 115, .14);
    --warning: #ffb020;
    --warning-soft: rgba(255, 176, 32, .14);
    --danger: #ff5c72;
    --danger-soft: rgba(255, 92, 114, .14);
    --info: #4aa8ff;
    --info-soft: rgba(74, 168, 255, .14);
    --primary-border: rgba(124, 92, 255, .42);
    --success-border: rgba(46, 213, 115, .42);
    --warning-border: rgba(255, 176, 32, .42);
    --danger-border: rgba(255, 92, 114, .42);
    --info-border: rgba(74, 168, 255, .42);
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, .75);
    --shadow-sm: 0 4px 18px -8px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .82);
    --glow: radial-gradient(900px 500px at 12% -10%, rgba(124, 92, 255, .18), transparent 60%),
            radial-gradient(700px 420px at 100% 0%, rgba(34, 211, 238, .12), transparent 55%);
    --up: #2ed573;
    --down: #7c5cff;
    --mask: rgba(3, 6, 12, .68);
    --topbar-bg: rgba(8, 10, 16, .82);
}

/* ---------- 深色（跟随系统） ---------- */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        color-scheme: dark;

        --bg: #080a10;
        --bg-soft: #0d1017;
        --surface: #12161f;
        --surface-2: #171c27;
        --surface-hover: #1d2331;
        --card: rgba(20, 25, 36, .78);
        --card-solid: #141924;
        --border: rgba(255, 255, 255, .075);
        --border-strong: rgba(255, 255, 255, .14);
        --text: #e9edf6;
        --text-soft: #a8b1c4;
        --text-dim: #6f7a90;
        --primary: #7c5cff;
        --primary-soft: rgba(124, 92, 255, .16);
        --primary-glow: rgba(124, 92, 255, .45);
        --accent: #22d3ee;
        --accent-soft: rgba(34, 211, 238, .14);
        --success: #2ed573;
        --success-soft: rgba(46, 213, 115, .14);
        --warning: #ffb020;
        --warning-soft: rgba(255, 176, 32, .14);
        --danger: #ff5c72;
        --danger-soft: rgba(255, 92, 114, .14);
        --info: #4aa8ff;
        --info-soft: rgba(74, 168, 255, .14);
        --primary-border: rgba(124, 92, 255, .42);
        --success-border: rgba(46, 213, 115, .42);
        --warning-border: rgba(255, 176, 32, .42);
        --danger-border: rgba(255, 92, 114, .42);
        --info-border: rgba(74, 168, 255, .42);
        --shadow: 0 10px 40px -12px rgba(0, 0, 0, .75);
        --shadow-sm: 0 4px 18px -8px rgba(0, 0, 0, .7);
        --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .82);
        --glow: radial-gradient(900px 500px at 12% -10%, rgba(124, 92, 255, .18), transparent 60%),
                radial-gradient(700px 420px at 100% 0%, rgba(34, 211, 238, .12), transparent 55%);
        --up: #2ed573;
        --down: #7c5cff;
        --mask: rgba(3, 6, 12, .68);
        --topbar-bg: rgba(8, 10, 16, .82);
    }
}

/* =============================================================
   2. 基础
   ============================================================= */
* { box-sizing: border-box; }

/* 图标全局兜底：icon() 输出的 svg 不带 width/height 属性，
   没有这条时，任何「容器没有专属 svg 规则」的图标都会按默认
   替换元素尺寸（约 300x150）渲染成巨图 —— 上下文的专属规则
   （.btn svg / .q-icon svg 等）特异性更高，不受影响。 */
svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* 手机上避免横向滚动：任何超宽内容都应该自己滚（.table-wrap 等） */
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--glow);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); }
a.link:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* 点击区域统一：手机上没有 hover，用 :active 给反馈 */
@media (hover: none) {
    .btn:active, .nav-item:active, .dropdown-item:active,
    .page-link:active, .op-chip:active, .quick-item:active { opacity: .72; }
}

/* =============================================================
   3. 应用外壳
   ── 手机：主区全宽 + 底部 tabbar + 侧栏变抽屉
   ── 宽屏：侧栏固定在左
   ============================================================= */
.app-shell { position: relative; z-index: 1; min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--transition);
    overscroll-behavior: contain;
}
.sidebar.open { transform: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.brand-mark {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 8px 22px -8px var(--primary-glow);
    flex: 0 0 38px;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-text { min-width: 0; }
.brand-text strong {
    display: block;
    font-size: 15px;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text span { display: block; font-size: 11.5px; color: var(--text-dim); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; -webkit-overflow-scrolling: touch; }

.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-dim);
    padding: 14px 12px 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: all var(--transition);
    position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--danger);
    color: #fff;
    font-weight: 700;
}

/* 顶栏邮件图标 + 右上角未读角标（红圈白字） */
.msg-bell { position: relative; }
.msg-bell .nav-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    margin-left: 0;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 10px;
    box-sizing: content-box;
}

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-dim);
    flex: 0 0 auto;
}

.main-area { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.mobile-mask {
    display: none;
    position: fixed; inset: 0;
    background: var(--mask);
    z-index: 55;
    backdrop-filter: blur(2px);
}
.mobile-mask.open { display: block; animation: fade .16s ease; }

/* ---------- 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 var(--content-pad);
    min-height: 54px;
    padding-top: env(safe-area-inset-top, 0);
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: box-shadow var(--transition);
}
.topbar-spacer { flex: 1; }

.page-title {
    font-size: 16.5px;
    font-weight: 650;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-title small { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 400; }

.icon-btn {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-soft);
    cursor: pointer;
    transition: all var(--transition);
    flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 6px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    flex: 0 0 auto;
}
.user-chip:hover { border-color: var(--border-strong); }
/* 手机上只留头像，名字/身份收进下拉，避免顶栏被撑爆 */
.user-chip > div:not(.avatar) { display: none; }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex: 0 0 32px;
}
.user-chip-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip-role { font-size: 11px; color: var(--text-dim); }

/* ---------- 下拉菜单 ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    right: 0; top: calc(100% + 10px);
    min-width: 200px;
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 100;
}
.dropdown.open .dropdown-menu { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-soft);
    width: 100%;
    border: 0; background: transparent; cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 6px; }

/* ---------- 内容区 ---------- */
.content {
    flex: 1;
    padding: var(--content-pad);
    /* 给底部 tabbar 留位，否则最后一个卡片会被压在导航后面 */
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px);
    min-width: 0;
}
/* 没有底部 tabbar 的页面（认证 / 收银台）不需要留白 */
.content.no-tabbar { padding-bottom: 22px; }

/* ---------- 底部 tabbar（用户端 / 管理端共用） ---------- */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 58;
    backdrop-filter: blur(14px);
}
.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
    min-width: 0;
}
.tabbar-item svg { width: 21px; height: 21px; }
.tabbar-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tabbar-item.active { color: var(--primary); font-weight: 600; }
.tabbar-item.active::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
}

/* =============================================================
   4. 卡片与页面结构（对齐小程序）
   ============================================================= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card + .card { margin-top: 12px; }

.card-head {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-head + .card-body,
.card-head + .table-wrap { border-top: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* 页面头部（小程序 page-head）：大标题 + 副标题 */
.page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.page-head .ph-title { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.page-head .ph-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.page-head .page-title-text { font-size: 19px; font-weight: 700; letter-spacing: -.2px; margin: 0; }

/* ── 站内信中心 ─────────────────────────────────────── */
.msg-list { display: flex; flex-direction: column; gap: 10px; }

.msg-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.msg-card:hover { background: var(--surface-hover); }

.msg-card .msg-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: transparent;
}
.msg-card.unread .msg-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.msg-main { flex: 1; min-width: 0; }
.msg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.msg-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.msg-card.unread .msg-title { font-weight: 700; }
.msg-time { flex: 0 0 auto; white-space: nowrap; }
.msg-content {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 54px 20px;
    color: var(--text-dim);
    text-align: center;
}
.empty-box svg { width: 40px; height: 40px; opacity: .5; }
.empty-box p { font-size: 14px; margin: 0; color: var(--text-soft); }

/* ── 小程序同款组件（手机端布局完全对齐小程序）─────────────
   「我的」页的用户卡 / 资产九宫格、入口列表行，以及 .card.tight
   等小程序 app.wxss 里的同名类，这里按 web 尺度（px）对齐一份，
   免得同一个设计语言在两端长得不一样。 */
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--surface-2), var(--card));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.user-card .u-name { font-size: 18px; font-weight: 700; color: var(--text); }
.user-card .u-account { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; font-family: var(--mono); }
.user-card .u-tags { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

.grow-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* 用量卡里的「额度 + 到期」一行 */
.usage-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* 资产格（余额 / 订单 / 服务器） */
.asset-row { display: flex; gap: 10px; margin-bottom: 15px; }
.asset-item {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 6px;
    text-align: center;
    color: inherit;
    text-decoration: none;
}
.asset-item:hover { background: var(--surface-hover); }
.asset-item .a-num { font-size: 17px; font-weight: 700; color: var(--primary); font-family: var(--mono); }
.asset-item .a-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* 列表行（小程序 .row）：标签 + 说明 + 右侧箭头 */
.row { display: flex; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .label { font-size: 14px; color: var(--text); }
.row .sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.row .arrow { color: var(--text-dim); font-size: 13px; margin-left: 6px; flex: 0 0 auto; }

/* 卡片紧凑模式 / 点得动的幽灵按钮（小程序 .card.tight、.op-chip.ghost） */
.card.tight { padding: 8px 16px; }
.op-chip.ghost { background: transparent; border-color: var(--border); color: var(--text-soft); }

/* 后台发信：收件人名单（可滚动 + 本地筛选） */
.msg-user-list {
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}
.msg-user-list .checkbox { padding: 7px 10px; border-radius: 8px; }
.msg-user-list .checkbox:hover { background: var(--surface-hover); }
.msg-user-list .checkbox > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.version-tip { margin-top: 20px; text-align: center; font-size: 11px; color: var(--text-dim); }

/* 分区标题 */
.section-title {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-soft);
    margin: 18px 2px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .spacer { flex: 1; }

/* 套餐用量卡（小程序 usage-card 范式） */
.usage-card {
    background: linear-gradient(135deg, var(--primary-soft), var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow-sm);
}
.usage-head { display: flex; align-items: flex-start; gap: 10px; }
.usage-head .u-title { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.usage-head .u-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.usage-bar { margin-top: 12px; }
.usage-num { font-size: 12px; color: var(--text-dim); margin-top: 7px; display: flex; justify-content: space-between; gap: 10px; }

/* 结算 / 说明卡里的项目符号列表（小程序 pay-steps 之外的轻量版） */
.bullet-list { list-style: none; padding: 0; margin: 0; }
.bullet-list li {
    display: flex; gap: 9px;
    font-size: 13.5px; color: var(--text-soft);
    padding: 5px 0; line-height: 1.5;
}
.bullet-list li svg { width: 15px; height: 15px; color: var(--success); flex: 0 0 15px; margin-top: 3px; }

/* =============================================================
   5. 网格（全部响应式，窄屏单列）
   ============================================================= */
.grid { display: grid; gap: 12px; }
.grid-2, .grid-3, .grid-4, .grid-auto, .form-grid { grid-template-columns: minmax(0, 1fr); }

/* 主内容 + 侧栏的分栏：窄屏上下堆叠，宽屏左右并排 */
.split { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }

/* 统计网格（小程序 stat-grid 范式）
   默认用 auto-fit：手机上自然落成 3 列，宽屏有多少项就铺满多少列，
   不用为「6 项 / 4 项 / 5 项」各写一遍断点。
   .cols-2 是「手机 2 列」的显式声明（管理端 4 个指标用），宽屏补到 4 列。 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 1px;
    background: var(--border);
}
.stat-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.full { grid-template-columns: minmax(0, 1fr); }
.stat-item { background: var(--card-solid); padding: 12px 10px; text-align: center; }
.stat-item .k { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.stat-item .v {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.3px;
    word-break: break-all;
}
.stat-item .v.down { color: var(--down); }
.stat-item .v.up { color: var(--up); }

/* 快捷入口（小程序 quick-grid 范式） */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.quick-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    text-align: center;
}
.quick-item:hover { border-color: var(--primary); }
.quick-item .q-icon {
    width: 34px; height: 34px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
}
.quick-item .q-icon svg { width: 18px; height: 18px; }
.quick-item .q-text { font-size: 12px; color: var(--text-soft); font-weight: 500; }

/* =============================================================
   6. 统计卡（旧式大卡，保留兼容）
   ============================================================= */
.stat {
    position: relative;
    padding: 15px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    right: -34px; top: -34px;
    width: 104px; height: 104px;
    border-radius: 50%;
    background: var(--primary-soft);
    opacity: .55;
}
.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
    position: relative; z-index: 1;
}
.stat-label svg { width: 14px; height: 14px; }
.stat-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.4px;
    font-variant-numeric: tabular-nums;
    position: relative; z-index: 1;
    word-break: break-all;
}
.stat-value small { font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin-left: 4px; }
.stat-foot { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; position: relative; z-index: 1; }
.stat.accent::after { background: var(--accent-soft); }
.stat.success::after { background: var(--success-soft); }
.stat.warning::after { background: var(--warning-soft); }
.stat.danger::after { background: var(--danger-soft); }

/* =============================================================
   7. 按钮
   ============================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.2;
    /* 手机上按钮最小高度 42px，手指点得中 */
    min-height: 42px;
}
.btn svg { width: 16px; height: 16px; }
/* hover 显式恢复深色文字：否则 .btn:hover 会盖掉彩色按钮的底色，出现「浅底白字」 */
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }

/* 注意：按钮底色禁止用 color-mix() —— 老内核浏览器会把整条声明丢掉，
   按钮退化成「近白底 + 白字」（文字色 #fff 仍然有效），只有 hover 恢复紫字，
   看起来就是「看不见保存按钮」。渐变用现成变量拼接，不用 color-mix。 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px -10px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
    box-shadow: 0 8px 20px -12px var(--primary-glow);
}

.btn-success { background: var(--success); border-color: transparent; color: #fff; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-success:hover {
    background: var(--success-soft);
    border-color: var(--success-border);
    color: var(--success);
}
.btn-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger-border);
    color: var(--danger);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; min-height: 34px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: 13px; min-height: 48px; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
/* 手机上并排两个按钮时各占一半，更好点 */
.btn-row.split-2 > .btn { flex: 1 1 44%; }

/* 操作小胶囊（小程序 op-chip 范式） */
.op-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.op-chip svg { width: 14px; height: 14px; }
.op-chip:hover { border-color: var(--border-strong); color: var(--text); }
.op-chip.primary { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.op-chip.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.op-chip.success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.op-chip.sm { padding: 4px 10px; font-size: 11.5px; }

/* =============================================================
   8. 表单
   ============================================================= */
.form-row { margin-bottom: 15px; }
.form-grid { display: grid; gap: 15px; }

label.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 7px;
}
label.field-label .req { color: var(--danger); margin-left: 2px; }
.field-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.55; }

.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 15px; /* 手机上小于 16px 会被 iOS 放大，15px + 下面 meta 处理 */
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
    min-height: 44px;
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--surface);
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input-group { display: flex; gap: 9px; flex-wrap: wrap; }
.input-group .input { flex: 1; min-width: 140px; }
/* 计划任务地址块：完整 URL 必须一屏可见，所以可换行 + 可全选，
   不用 input（readonly 输入框不换行，长链接必被截断） */
.cron-box {
    flex: 1;
    min-width: 140px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2, var(--bg));
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
    word-break: break-all;
    white-space: normal;
    user-select: all;
    align-self: center;
}
.input-affix {
    display: flex; align-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    overflow: hidden;
}
.input-affix .input { border: 0; background: transparent; border-radius: 0; }
.input-affix .affix {
    padding: 0 12px;
    color: var(--text-dim);
    font-size: 13px;
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                      linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-soft); padding: 3px 0; }
.checkbox input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--primary); cursor: pointer; flex: 0 0 19px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 46px; height: 27px;
    border-radius: 30px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
    flex: 0 0 46px;
}
.switch .track::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 21px; height: 21px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all var(--transition);
}
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }

/* 开关行：左文字右开关（小程序 switch-row） */
.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-main { flex: 1; min-width: 0; }
.switch-row .sr-title { font-size: 14px; font-weight: 550; }
.switch-row .sr-desc { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }

/* ── 支付设置：zfaka 风格表格（后台「支付与收费」）────────────────
   一行一个通道：ID / 支付渠道 / 别名 / APPID / 是否激活 / 操作；
   「编辑」跳转到该通道专属的整页配置页。 */
.pay-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
}
.pay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 640px;
}
.pay-table th,
.pay-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.pay-table th {
    font-weight: 600;
    color: var(--text-dim);
    background: var(--surface-2);
    font-size: 12.5px;
}
.pay-table tbody tr:last-child td { border-bottom: none; }
.pay-table tbody tr:hover td { background: var(--surface-hover); }
.pay-table .pt-id { width: 52px; color: var(--text-dim); }
.pay-table .pt-name { font-weight: 600; color: var(--text); white-space: normal; }
.pay-table .pt-alias { color: var(--text-dim); font-size: 12.5px; }
.pay-table .pt-appid { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.pay-table .pt-op { width: 84px; text-align: center; }
/* 图一里的橙黄色「编辑」按钮 */
.pay-table .btn-edit {
    background: #f5a623;
    border-color: #f5a623;
    color: #fff;
}
.pay-table .btn-edit:hover { background: #e09612; border-color: #e09612; color: #fff; }

/* 支付通道配置整页（zfaka 版式：页签面包屑 + 注意事项 + 表单卡） */
.pcp-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    font-size: 14px;
}
.pcp-tabs a,
.pcp-tabs .active {
    padding: 7px 14px;
    border-radius: 9px;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
}
.pcp-tabs a:hover {
    color: var(--text);
    background: var(--surface-2);
}
.pcp-tabs .active {
    color: var(--text);
    font-weight: 600;
    background: var(--surface-2);
}
.pcp-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 12.5px;
    color: var(--text-dim);
}
.pcp-notify { word-break: break-all; }
.pcp-form { display: block; }
/* 「是否激活」radio（图二：激活 / 取消） */
.pcp-radios { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.pcp-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.pcp-radio input { accent-color: var(--primary, #7c5cff); margin: 0; }
/* 支付块用到的间距工具类 */
.mb-10 { margin-bottom: 10px; }
.mt-6  { margin-top: 6px; }
/* 窄屏：表格横向滚动，页签换行 */
@media (max-width: 560px) {
    .pcp-tabs { flex-wrap: wrap; }
}

/* 支付方式卡片（后台「支付与收费」）
   ── 默认只显示「开没开 + 支持哪些渠道」，参数收在折叠面板里：
      二十多个输入框平铺时改一个值要在半屏里找，还容易点错行。
      窄屏自动换行（flex-wrap），不写死两列。 */
.pay-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--surface);
}
.pay-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 13px 15px;
}
.pay-card-head .pch-main { flex: 1; min-width: 0; }
.pay-card-head .pch-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.pay-card-head .pch-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}
.pay-card-head .pch-desc {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 6px;
    line-height: 1.6;
}
.pay-card-head .pch-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.pay-config {
    padding: 4px 15px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* =============================================================
   9. 表格
   ── 手机：横向可滚（.table-wrap），关键列保留；
      也可以在 <table class="table stacked"> 上切成卡片式行
   ============================================================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 100%; }
table.table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-dim);
    font-weight: 650;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-2);
}
table.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    vertical-align: middle;
}
table.table tbody tr { transition: background var(--transition); }
table.table tbody tr:hover { background: var(--surface-hover); }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table td.strong { color: var(--text); font-weight: 600; }
table.table td.right, table.table th.right { text-align: right; }
table.table td.center, table.table th.center { text-align: center; }
table.table td.nowrap, table.table th.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* 手机上的卡片式表格：每行变一张小卡，表头文字变成字段前缀 */
@media (max-width: 767px) {
    table.table.stacked { min-width: 0; }
    table.table.stacked thead { display: none; }
    table.table.stacked tbody tr {
        display: block;
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
    }
    table.table.stacked tbody tr:last-child { border-bottom: 0; }
    table.table.stacked td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0;
        border: 0;
        text-align: right;
    }
    table.table.stacked td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-dim);
        font-size: 12px;
        text-align: left;
        font-weight: 500;
    }
    table.table.stacked td[data-label=""] { justify-content: flex-start; text-align: left; }
    table.table.stacked td[data-label=""]::before { display: none; }
    table.table.stacked td:first-child { font-size: 15px; font-weight: 650; color: var(--text); }
}

/* =============================================================
   10. 徽章 / 小标签
   ============================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface-hover);
    color: var(--text-soft);
    white-space: nowrap;
    line-height: 1.6;
}
.badge svg { width: 11px; height: 11px; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--surface-hover); color: var(--text-dim); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--text-dim); }
.dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-soft);
    line-height: 1.75;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip svg { width: 11px; height: 11px; flex: 0 0 11px; opacity: .8; }
.chip.warn { color: var(--warning); border-color: var(--warning-border); }

/* 键值对行（小程序 kv 范式）：手机上左标签右值 */
.kv-list { display: flex; flex-direction: column; }
.kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.kv:last-child { border-bottom: 0; }
.kv > .k { color: var(--text-dim); font-size: 13px; flex: 0 0 auto; }
.kv > .v { font-weight: 600; text-align: right; min-width: 0; word-break: break-all; }

/* =============================================================
   11. 进度条
   ============================================================= */
.progress { height: 7px; border-radius: 20px; background: var(--surface-hover); overflow: hidden; position: relative; }
.progress > i {
    display: block;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .4s ease;
}
.progress.thin { height: 5px; }
.progress.success > i { background: linear-gradient(90deg, var(--success), #7ee2a8); }

/* =============================================================
   12. 提示条 / Toast
   ============================================================= */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    border: 1px solid transparent;
    margin-bottom: 14px;
    line-height: 1.6;
    align-items: flex-start;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; }
/* .alert 自己声明了 display:flex，会盖掉 hidden 的 UA 样式，这里显式补回来 */
.alert[hidden] { display: none; }
.alert.result-list { display: flex; flex-direction: column; gap: 5px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }

/* 会员到期「超额锁定」提示条（用户端控制台 / 服务器页）
   复用 .alert.alert-warning 的配色，这里只补标题与链接的排版，避免新增一套配色变量。 */
.expiry-lock strong { font-weight: 700; }
.expiry-lock .link { color: inherit; text-decoration: underline; }

.toast-wrap {
    position: fixed;
    left: 12px; right: 12px; top: 12px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 9px;
    pointer-events: none;
}
.toast {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    animation: slideDown .24s cubic-bezier(.4, 0, .2, 1);
    pointer-events: auto;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--info); }
.toast-close { margin-left: auto; cursor: pointer; color: var(--text-dim); background: none; border: 0; padding: 0; font-size: 18px; line-height: 1; }

/* =============================================================
   13. 空状态
   ============================================================= */
.empty { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-icon {
    width: 60px; height: 60px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: grid; place-items: center;
    background: var(--surface-hover);
    color: var(--text-dim);
}
.empty-icon svg { width: 27px; height: 27px; }
.empty h4 { margin: 0 0 6px; color: var(--text); font-size: 15.5px; }
.empty p { margin: 0 0 16px; font-size: 13px; }
/* 小程序式极简空态：图标 + 两行文字 + 胶囊按钮 */
.empty.simple .icon { font-size: 34px; color: var(--text-dim); margin-bottom: 10px; }
.empty.simple .text { font-size: 13.5px; }

/* =============================================================
   14. 分页
   ============================================================= */
.pagination {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination .info { font-size: 12.5px; color: var(--text-dim); width: 100%; margin-bottom: 4px; }
.page-link {
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13.5px;
    color: var(--text-soft);
    transition: all var(--transition);
}
.page-link:hover { background: var(--surface-hover); color: var(--text); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* =============================================================
   15. 工具栏 / 搜索
   ============================================================= */
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 100%; min-width: 0; }
.search > svg {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-dim);
    pointer-events: none;
    z-index: 1;
}
.search .input { padding-left: 38px; }
.toolbar .spacer { flex: 1; }

/* 分段筛选（小程序 filter-tabs 范式）：手机上横向可滚 */
.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-bottom: 14px;
    scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs > * {
    flex: 0 0 auto;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13.5px;
    font-weight: 550;
    white-space: nowrap;
    transition: all var(--transition);
}
.filter-tabs > *.active,
.filter-tabs > *.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =============================================================
   16. 加载指示
   ============================================================= */
.spinner {
    display: inline-block;
    width: 12px; height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { text-align: center; padding: 30px; color: var(--text-dim); font-size: 13.5px; }

/* =============================================================
   17. 弹窗 / 抽屉 / 底部面板
   ── 手机：模态框贴底弹出（sheet），符合移动端习惯
   ── 宽屏：居中卡片
   ============================================================= */
.modal-mask {
    position: fixed;
    inset: 0;
    background: var(--mask);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    /* 手机端：底部给 tabbar 留出高度，弹层整体抬到导航栏上方。
       实测（CDP 390x844）：不留位时 modal 底部贴视口底，「确认支付」按钮
       与 tabbar 重叠 58px，部分内核上 tabbar 反压弹层把按钮盖死。
       桌面端（tabbar 隐藏）由下方 1024px 断点改回居中 + padding 24px。 */
    padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
.modal-mask.open { display: flex; animation: fade .18s ease; }
.modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(90vh - var(--tabbar-h));
    /* 弹层三段式：head 固定 / body 滚动 / foot 固定。
       不再依赖 position:sticky（老内核上 sticky 在嵌套滚动容器里不可靠），
       滚动收敛到 .modal-body 自己身上。 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    animation: sheetUp .24s cubic-bezier(.4, 0, .2, 1);
}
@keyframes sheetUp { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 780px; }
.modal-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    flex: 0 0 auto;
    background: var(--card-solid);
}
/* 有的弹层把表单包住 body+foot（如 billing 的确认购买，form 是 .modal
   直接子级），form 本身也要成为纵向 flex，滚动才能落进 .modal-body。
   只选直接子级：modal-body 内部还有各自的普通表单，不能误伤。 */
.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-head .close {
    margin-left: auto;
    background: none; border: 0; cursor: pointer;
    color: var(--text-dim);
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid; place-items: center;
}
.modal-head .close:hover { background: var(--surface-hover); color: var(--text); }
.modal-head .close svg { width: 17px; height: 17px; }
.modal-body {
    padding: 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-foot {
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
    flex: 0 0 auto;
    background: var(--card-solid);
}
.modal-foot .btn { flex: 1; }

/* 右侧抽屉（任务详情） */
.drawer-mask {
    position: fixed; inset: 0; background: var(--mask);
    z-index: 940; display: none; backdrop-filter: blur(2px);
}
.drawer-mask.open { display: block; animation: fade .18s ease; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%);
    background: var(--card-solid);
    z-index: 950; display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition);
}
.drawer.open { transform: none; }
.drawer-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 16px; border-bottom: 1px solid var(--border);
}
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-title { font-size: 15px; font-weight: 650; color: var(--text); word-break: break-all; line-height: 1.45; }
.drawer-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; word-break: break-all; }
.drawer-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 1px; background: var(--border); border-bottom: 1px solid var(--border);
}
.drawer-stats > div { background: var(--card-solid); padding: 10px 12px; }
.drawer-stats .k { font-size: 10.5px; color: var(--text-dim); margin-bottom: 3px; }
.drawer-stats .v {
    font-size: 13px; font-weight: 650; font-family: var(--mono);
    color: var(--text); font-variant-numeric: tabular-nums;
}
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.drawer-actions .btn { font-size: 12.5px; padding: 7px 12px; min-height: 34px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; -webkit-overflow-scrolling: touch; }

/* 详情页签 */
.tabs {
    display: flex; gap: 2px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
    border: 0; background: none; padding: 12px 12px; font-size: 13.5px;
    cursor: pointer; color: var(--text-dim); font-family: inherit;
    border-bottom: 2px solid transparent; transition: all var(--transition);
    white-space: nowrap; flex: 0 0 auto;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 属性表（窄屏自动变两行：标签一行、值一行） */
.prop-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prop-table td { padding: 9px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.prop-table td:first-child { color: var(--text-dim); width: 96px; white-space: nowrap; }
.prop-table td:last-child {
    color: var(--text); word-break: break-all;
    font-family: var(--mono); font-variant-numeric: tabular-nums;
    text-align: right;
}
.prop-table tr:last-child td { border-bottom: 0; }

/* 文件 / Tracker 行 */
.file-row, .tracker-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.file-row:last-child, .tracker-row:last-child { border-bottom: 0; }
.file-row .nm { flex: 1; min-width: 0; }
.file-row .nm > div:first-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.file-row .nm .sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.file-row .col { width: 92px; text-align: right; font-family: var(--mono); color: var(--text-soft); }
.tracker-row { flex-direction: column; align-items: stretch; gap: 4px; }
.tracker-row .u { word-break: break-all; color: var(--text-soft); font-family: var(--mono); font-size: 11.5px; }
.tracker-row .meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }
.tracker-row .meta .ok { color: var(--success); }

/* 滑块 + 数字框联动 */
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); min-width: 0; }
.range-row .num { width: 96px; flex: 0 0 96px; }
.unit, .range-row .unit { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

/* =============================================================
   18. 客户端小图标
   ============================================================= */
.client-logo {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: -.3px;
    color: #fff;
    flex: 0 0 40px;
    text-transform: uppercase;
}
.client-logo.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 10.5px; flex: 0 0 32px; }
.client-qb { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.client-tr { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.client-a2 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.client-dl { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.client-ut { background: linear-gradient(135deg, #22c55e, #15803d); }
.client-rt { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.client-sy { background: linear-gradient(135deg, #64748b, #334155); }
.client-sv { background: linear-gradient(135deg, var(--primary), var(--accent)); }

/* =============================================================
   19. 服务器卡（小程序 server-card 范式）
   ============================================================= */
.server-card { padding: 14px; }
.server-card + .server-card { margin-top: 12px; }
.server-card .sc-head { display: flex; align-items: flex-start; gap: 11px; }
.server-card .sc-name { font-size: 15.5px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .sc-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .server-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 12px;
}
.server-card .s-item { background: var(--surface-2); padding: 9px 6px; text-align: center; }
.server-card .s-item .k { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.server-card .s-item .v {
    font-size: 13.5px; font-weight: 650;
    font-family: var(--mono); font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.server-card .s-item .v.down { color: var(--down); }
.server-card .s-item .v.up { color: var(--up); }
.server-card .server-error {
    margin-top: 10px; font-size: 12px; color: var(--danger);
    background: var(--danger-soft); padding: 8px 10px; border-radius: 9px;
    word-break: break-all;
}

/* 通用列表行（设置项、用户行…） */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-hover); }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: 14.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-side { flex: 0 0 auto; text-align: right; }

/* =============================================================
   20. 套餐卡
   ============================================================= */
.plan-card {
    position: relative;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    overflow: hidden;
}
.plan-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-card.current { border-color: var(--success); }
.plan-ribbon {
    position: absolute;
    top: 12px; right: -30px;
    transform: rotate(38deg);
    background: var(--primary);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 34px;
    letter-spacing: .06em;
}
.plan-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.plan-price { margin: 12px 0 4px; display: flex; align-items: baseline; gap: 5px; }
.plan-price .num { font-size: 30px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.plan-price .unit { font-size: 13px; color: var(--text-dim); }
.plan-limit { display: flex; gap: 7px; margin: 12px 0; flex-wrap: wrap; }
.plan-features { list-style: none; padding: 0; margin: 6px 0 16px; flex: 1; }
.plan-features li {
    display: flex; gap: 9px;
    font-size: 13.5px;
    color: var(--text-soft);
    padding: 5px 0;
    line-height: 1.5;
}
.plan-features li svg { width: 15px; height: 15px; color: var(--success); flex: 0 0 15px; margin-top: 3px; }
.cycle-switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    gap: 3px;
    max-width: 100%;
}
.cycle-switch button {
    padding: 8px 14px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 13px;
    font-family: inherit;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex: 1;
}
.cycle-switch button.active { background: var(--primary); color: #fff; }
.cycle-switch button .save { font-size: 10px; opacity: .85; display: block; }

/* =============================================================
   21. 任务列表
   ============================================================= */
.global-bar {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    padding: 10px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px;
}
.global-bar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; }
.global-bar .label { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 4px; }
.global-bar .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

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

/* 手机：任务卡纵向排布（勾选 + 主信息 + 操作一行，速度另起一行） */
.t-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    grid-template-areas:
        "check main ops"
        "speed speed speed";
    gap: 9px 10px;
    align-items: start;
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.t-row:last-child { border-bottom: 0; }
.t-row:hover { background: var(--surface-hover); }
.t-row.is-selected { background: var(--primary-soft); }
.t-row .t-check { grid-area: check; }
.t-row .t-main { grid-area: main; min-width: 0; }
.t-row .t-speed { grid-area: speed; }
.t-row .t-ops { grid-area: ops; }

.t-check { display: flex; align-items: center; justify-content: center; }
.t-check input { width: 19px; height: 19px; accent-color: var(--primary); cursor: pointer; }

.t-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.t-name {
    font-size: 14.5px; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%; cursor: pointer;
}
.t-name:hover { color: var(--primary); text-decoration: underline; }
.t-chips { display: inline-flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.t-chips .chip { font-size: 10.5px; padding: 1px 7px; }
.t-chips .chip.priv {
    color: var(--warning);
    border-color: var(--warning-border);
    background: var(--warning-soft);
}

.t-bar { display: flex; align-items: center; gap: 9px; margin: 6px 0; }
.t-bar .mini-bar { flex: 1; min-width: 50px; }
.t-bar .t-pct {
    font-family: var(--mono); font-size: 12.5px; color: var(--text-soft);
    min-width: 46px; text-align: right; font-variant-numeric: tabular-nums;
}
.mini-bar { height: 6px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; }
.mini-bar > i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--down), var(--accent));
    transition: width var(--transition);
}
.mini-bar > i.done { background: linear-gradient(90deg, var(--success), var(--accent)); }
.mini-bar > i.bad { background: var(--danger); }

/* 字段网格：手机 2 列，宽屏自适应更多列 */
.t-stats { display: grid; gap: 3px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.t-kv { display: flex; align-items: baseline; gap: 5px; font-size: 11.5px; min-width: 0; }
.t-kv i { font-style: normal; color: var(--text-dim); flex: 0 0 auto; }
.t-kv b {
    font-weight: 600; color: var(--text-soft); font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-kv b.warn { color: var(--warning); }
.t-kv b.err { color: var(--danger); }
.t-kv b.ok { color: var(--success); }
.t-list.compact .t-kv.extra { display: none; }

.t-speed {
    text-align: left; font-family: var(--mono); font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    display: flex; gap: 14px; flex-wrap: wrap;
}
.t-speed .down { color: var(--down); }
.t-speed .up { color: var(--up); }
.t-speed .idle { color: var(--text-dim); }

.t-ops { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* 宽屏：一行放下全部字段，速度靠右竖排 */
@media (min-width: 1024px) {
    .t-row {
        grid-template-columns: 26px minmax(0, 1fr) 150px 84px;
        grid-template-areas: "check main speed ops";
        align-items: center;
        gap: 14px;
        padding: 12px 18px;
    }
    .t-row .t-speed {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
    }
}

/* ---------- 浮动行操作菜单 ---------- */
.row-menu {
    position: fixed; z-index: 900; min-width: 200px;
    background: var(--card-solid); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px;
    box-shadow: var(--shadow-lg);
    display: none; max-height: 78vh; overflow-y: auto;
}
.row-menu.open { display: block; animation: fade .13s ease; }
.row-menu .mi {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 11px 11px; border: 0; background: none; cursor: pointer;
    border-radius: var(--radius-sm); color: var(--text-soft);
    font-size: 13.5px; text-align: left; font-family: inherit;
}
.row-menu .mi:hover { background: var(--surface-hover); color: var(--text); }
.row-menu .mi svg { width: 15px; height: 15px; flex: 0 0 15px; }
.row-menu .mi.danger { color: var(--danger); }
.row-menu .mi.danger:hover { background: var(--danger-soft); }
.row-menu .mi:disabled { opacity: .38; cursor: not-allowed; }
.row-menu .dv { height: 1px; background: var(--border); margin: 5px 4px; }

/* =============================================================
   22. 认证页 / 收银台
   ============================================================= */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px var(--content-pad);
    position: relative;
    z-index: 1;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow: var(--shadow);
}
.auth-logo {
    width: 56px; height: 56px;
    border-radius: 18px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 14px 30px -12px var(--primary-glow);
}
.auth-logo svg { width: 27px; height: 27px; }
.auth-title { text-align: center; font-size: 21px; font-weight: 700; margin: 0 0 6px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--text-dim); margin: 0 0 24px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 20px; }

.pay-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px var(--content-pad);
    position: relative; z-index: 1;
}
.pay-card {
    width: 100%;
    max-width: 720px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.pay-head { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.pay-amount { font-size: 30px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.qr-box {
    width: 200px; height: 200px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5);
}
.qr-box canvas, .qr-box img { display: block; width: 100%; height: 100%; }

/* 支付通道选择器：数量不固定，flex-wrap 自动折行 */
.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-methods form { display: contents; }
.pay-method {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text-soft);
    font: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    flex: 1 1 auto;
    justify-content: center;
}
.pay-method:hover { border-color: var(--primary); color: var(--primary); }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pay-method-input {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.pay-method:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.pay-method-name { line-height: 1; }
.pay-method-tag {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 10.5px;
    font-weight: 700;
}
.pay-steps { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-soft); }
.pay-steps .step { display: flex; gap: 10px; align-items: flex-start; }
.pay-steps .step b {
    width: 20px; height: 20px; flex: 0 0 20px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}

/* =============================================================
   23. 工具类
   ============================================================= */
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; }
.row > * { min-width: 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; } .mb-18 { margin-bottom: 18px; } .mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--text-dim); }
.text-soft { color: var(--text-soft); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 16px; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.scroll-y { overflow-y: auto; }

/* 手机：部分工具类在窄屏下自动堆叠 */
@media (max-width: 767px) {
    .flex.stack-sm { flex-direction: column; align-items: stretch; }
    .text-right-sm { text-align: left; }
}

/* 小号下拉 / 多列复选框 */
.select-sm { padding: 8px 10px; font-size: 13px; min-height: 38px; }
.check-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 16px; margin-top: 4px; }

/* 带单位后缀的输入框 */
.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix .input { padding-right: 58px; }
.input-suffix > span { position: absolute; right: 12px; font-size: 12px; color: var(--text-dim); pointer-events: none; }

/* 手机端输入框字号 ≥16px，避免 iOS 聚焦时自动放大页面 */
@media (max-width: 767px) {
    .input, .select, .textarea { font-size: 16px; }
}

/* =============================================================
   24. 宽屏增强（移动优先：这里才是「桌面」补丁）
   ============================================================= */
@media (min-width: 640px) {
    :root { --content-pad: 18px; }
    .grid-2, .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid.cols-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .check-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .t-stats { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .search { flex: 0 1 320px; }
    .toast-wrap { left: auto; right: 18px; top: 18px; max-width: 380px; }
    .toast { animation: slideIn .26s cubic-bezier(.4, 0, .2, 1); }
    .pagination .info { width: auto; margin-bottom: 0; margin-right: auto; }
    .stat-item .v { font-size: 17px; }
    .user-chip { padding: 4px 12px 4px 4px; }
    .user-chip > div:not(.avatar) { display: block; }
    .server-card { padding: 16px; }
}

@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

@media (min-width: 1024px) {
    :root { --content-pad: 24px; }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .split { grid-template-columns: 1.55fr 1fr; gap: 18px; }
    .split.side-first { grid-template-columns: 1fr 1.55fr; }
    .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .card-head { padding: 15px 20px; }
    .card-body { padding: 20px; }
    .modal-mask { align-items: center; padding: 24px; }
    .modal { border-radius: var(--radius-lg); max-height: 86vh; animation: pop .2s cubic-bezier(.4, 0, .2, 1); }
    .modal-foot { padding: 16px 20px; }
    .modal-foot .btn { flex: 0 0 auto; }
    .page-head { margin-bottom: 18px; }
    .page-head .ph-title { font-size: 22px; }
}

/* 宽屏：侧栏常驻，去掉底部 tabbar 与抽屉遮罩 */
@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .main-area { margin-left: var(--sidebar-w); }
    .sidebar-toggle { display: none; }
    .mobile-mask { display: none !important; }
    .tabbar { display: none; }
    .content { padding-bottom: 30px; }
}

/* 中屏（平板）：侧栏仍收起，底部 tabbar 保留 */
@media (min-width: 768px) and (max-width: 1023px) {
    .content { padding-bottom: calc(var(--tabbar-h) + 22px); }
}
