:root {
    --brand: #07c160;
    --brand-strong: #06ad56;
    --brand-soft: #e9f8ef;
    --page: #f5f6f7;
    --surface: #ffffff;
    --sidebar: #17211c;
    --text: #1f2329;
    /* 次要文字：加深以保证浅色背景上的可读性（对比度 ≥ 5:1） */
    --muted: #5f6b7a;
    --line: #eaecf0;
    --line-strong: #dcdfe5;
    --danger: #fa5151;
    --warning: #fa9d3b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
/* 后台（手机端）：去掉双击放大。
   touch-action: manipulation 让浏览器不再把连续两次轻点当作放大手势，点击响应也更干脆；
   刻意不用 user-scalable=no，双指缩放仍然可用（不影响可读性/无障碍）。 */
body.admin, body.admin a, body.admin button, body.admin input, body.admin select,
body.admin textarea, body.admin label, body.admin summary,
body.no-double-tap, body.no-double-tap a, body.no-double-tap button, body.no-double-tap input,
body.no-double-tap select, body.no-double-tap textarea, body.no-double-tap label,
body.no-double-tap summary { touch-action: manipulation; }

body {
    margin: 0; color: var(--text); background: var(--page); line-height: 1.6;
    /* 注意：不要设置 -webkit-font-smoothing: antialiased。
       Windows 上该属性会禁用 ClearType 次像素渲染，中文小字会变虚发糊。 */
}
a { color: #07c160; text-decoration: none; }
a:hover { text-decoration: none; }
[hidden] { display: none !important; }
code { background: #eef1f4; padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; }

/* ===== 后台 shell ===== */
body.admin { background: var(--page); }
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 224px; padding: 24px 16px 18px; color: #fff; background: var(--sidebar); display: flex; flex-direction: column; }
.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); font-size: 22px; font-weight: 700; }
.brand-block strong, .brand-block span { display: block; }
.brand-block strong { font-size: 16px; line-height: 1.3; }
.brand-block span { margin-top: 2px; color: rgba(255,255,255,.62); font-size: 12px; }
.side-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.side-nav a { height: 42px; padding: 0 13px; border-radius: 7px; display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.75); transition: background .18s, color .18s; font-size: 14px; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav a.active { color: #fff; background: var(--brand); }
.side-nav-system { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side-nav-caption { display: block; padding: 0 13px 7px; color: rgba(255,255,255,.55); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-nav-system a { height: 42px; padding: 0 13px; border-radius: 7px; display: flex; align-items: center; color: rgba(255,255,255,.75); font-size: 14px; }
.side-nav-system a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav-system a.active { color: #fff; background: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.62); font-size: 12px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(7,193,96,.12); flex: 0 0 auto; }
.workspace { margin-left: 224px; min-height: 100vh; padding: 28px 32px 56px; }
.topbar { max-width: 1400px; margin: 0 auto 20px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.topbar h1 { margin: 0; font-size: 25px; line-height: 1.3; font-weight: 650; }
.view { max-width: 1400px; margin: 0 auto; }

/* ===== 提示 ===== */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #eef4ff; color: #1e3a8a; }

/* ===== 统计 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { min-height: 92px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.stat b { display: block; font-size: 25px; line-height: 1.1; }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* ===== 面板 ===== */
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.panel.center { text-align: center; }
.panel.narrow { max-width: 400px; margin: 40px auto; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-head { min-height: 42px; margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; color: #4e5969; }
.form-row.checkbox label { display: inline; font-weight: 400; }
input[type=text], input[type=password], input[type=number], textarea, select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
.inline { display: inline; margin-right: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* 多选项目：用复选框列表，避免原生 multiple 下拉挤压、需 Ctrl 点击 */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.check-list label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 400; font-size: 13px; color: var(--text); cursor: pointer; }
.check-list input[type=checkbox] { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); cursor: pointer; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.field-grid .form-row { margin-bottom: 0; }
.form-group { margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.form-group > .form-row:last-child { margin-bottom: 0; }
.form-group-title { margin: 0 0 10px; font-size: 13px; font-weight: 650; color: #4e5969; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: #4e5969; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { background: #f7f8fa; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-green { color: #05693a; border-color: #9ed8b9; background: #f0faf4; }

/* ===== 表格 ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: #f7f8fa; color: var(--muted); font-weight: 500; white-space: nowrap; }
.table tr:hover td { background: #fafbfc; }
.table-title { display: block; color: var(--text); font-size: 14px; }
.table-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 400; }
/* 操作列：桌面端不换行（移动端在媒体查询里改为可换行） */
.actions { white-space: nowrap; }
.mono-text { font-family: ui-monospace, Consolas, monospace; }
.money-cell { color: #d92b2b; font-weight: 650; white-space: nowrap; }
.empty { height: 100px; color: var(--muted); text-align: center !important; }

/* ===== 徽章 ===== */
/* 窄列下「正常」这类双字徽章会被逐字换行，禁止折行 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge-completed, .badge-paid { background: #dcfce7; color: #166534; }
.badge-pending, .badge-awaiting_payment, .badge-created { background: #fef3c7; color: #92400e; }
.badge-failed, .badge-expired { background: #fee2e2; color: #991b1b; }
.badge-cancelled, .badge-returned { background: #e5e7eb; color: #4b5563; }
.badge-processing { background: #dbeafe; color: #1d4ed8; }
.badge-redeeming { background: #fef3c7; color: #92400e; }
.badge-disabled { background: #e5e7eb; color: #4b5563; }
/* 卡密状态：未使用（可用）与已完成。缺了这两条会退化成没有颜色的纯文字 */
.badge-available { background: #dbeafe; color: #1d4ed8; }
.badge-redeemed { background: #dcfce7; color: #166534; }

/* 账号列表「会员到期」列：药丸统一宽度、文字居中，整列对齐不参差 */
.badge-expiry { min-width: 132px; text-align: center; }

/* ===== 兑换页：扫码登录的一键操作与手机端适配 ===== */
/* 电脑端扫码提示：只在电脑端显示，做成醒目的提示条 */
.qr-desktop-hint{margin:0 0 12px;padding:12px 14px;border-radius:10px;background:#eef6ff;color:#1d4ed8;font-size:14px;line-height:1.7;text-align:center}
.qr-desktop-hint b{color:#07c150;font-weight:700}
.qr-hint { margin: 0 0 6px; font-size: 12px; color: #98a2b3; text-align: center; }
/* 手机端扫码/一键登录提示：做成醒目的提示条 */
.qr-tip{margin:12px 0 4px;padding:12px 14px;border-radius:10px;background:#fff7e6;border:1px solid #fde68a;color:#92400e;font-size:13.5px;line-height:1.75;text-align:left}
.qr-tip b{color:#07c150;font-weight:700}
/* 一键登录没拉起时的重点提醒 */
.qr-tip.alert{background:#fef2f2;border-color:#fecaca;color:#991b1b;font-weight:600}
.qr-tip.alert b{color:#d92b2b}
#qr-actions { margin-top: 12px; display: grid; gap: 8px; }
#qr-actions .btn { min-height: 44px; font-size: 15px; }

@media (max-width: 430px) {
    /* 手机端：卡片贴顶、按钮加大、二维码放大到更好扫的尺寸 */
    .redeem-body { padding: 14px 10px calc(18px + env(safe-area-inset-bottom, 0px)); align-items: start; }
    .redeem-card { padding: 22px 16px 18px; border-radius: 12px; }
    .redeem-head h1 { font-size: 19px; }
    .redeem-card .qrbox { min-height: 0; padding: 12px; margin-bottom: 10px; }
    .redeem-card .qrbox img { width: min(64vw, 236px); height: min(64vw, 236px); }
    .redeem-card .btn-block { min-height: 46px; font-size: 15px; }
    .redeem-hero { padding: 32px 16px; }
    .redeem-hero h1 { font-size: 22px; }
}

/* ===== 前台 ===== */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.nav { display: flex; align-items: center; gap: 16px; }
.nav .user { color: var(--muted); }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.site-footer { margin-top: 40px; padding: 20px 0; color: #9aa1a9; font-size: 13px; text-align: center; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.card h3 { margin: 0 0 8px; }
.card .desc { color: var(--muted); font-size: 13px; min-height: 38px; }
.card .price { font-size: 20px; font-weight: 700; color: #d92b2b; }
.generated { background: #fffbe6; border: 1px solid #f0d999; padding: 12px; max-height: 320px; overflow: auto; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.redeem-hero { text-align: center; padding: 48px 20px; }
.redeem-hero h1 { font-size: 26px; margin: 0 0 8px; }
.redeem-hero .card-label { color: var(--brand); font-weight: 650; }

/* 侧边栏内容容器：桌面端把底部账号信息压到底部 */
.side-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* 汉堡按钮：仅移动端显示 */
.nav-toggle { display: none; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 0; border-radius: 8px;
    background: rgba(255,255,255,.1); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; }
.nav-toggle span { display: block; width: 17px; height: 2px; border-radius: 2px; background: #fff; }
.nav-toggle:hover { background: rgba(255,255,255,.18); }

/* ===== 移动端适配（后台 / 员工端）=====
   要点：侧边栏在窄屏改为「顶栏 + 可展开菜单」，否则首屏会被整列导航占满。 */
@media (max-width: 860px) {
    .sidebar { position: sticky; top: 0; width: auto; padding: 10px 14px; display: block; }
    .sidebar.open { max-height: 100vh; overflow-y: auto; }
    .brand-block { padding: 0; }
    /* 只隐藏品牌副标题；不能写成 .brand-block span，否则会连汉堡按钮的三条线一起隐藏 */
    .brand-block > div > span { display: none; }
    .brand-block strong { font-size: 15px; }
    .brand-mark { width: 32px; height: 32px; font-size: 18px; border-radius: 8px; }
    .nav-toggle { display: flex; }
    /* 展开/收起用高度+透明度过渡：原来 display 直接切换是硬弹出来，做不了动画 */
    .side-body { display: flex; flex: 0 0 auto; flex-direction: column; max-height: 0; opacity: 0;
        overflow: hidden; visibility: hidden;
        transition: max-height .3s ease, opacity .22s ease, visibility 0s linear .3s; }
    .sidebar.open .side-body { max-height: 72vh; opacity: 1; overflow-y: auto; padding-top: 12px; visibility: visible;
        transition: max-height .34s ease, opacity .24s ease .06s, visibility 0s; }
    .side-nav { flex: 0 0 auto; }
    .side-nav a, .side-nav-system a { height: 44px; font-size: 15px; }
    .side-nav-system { margin-top: 8px; }
    .sidebar-foot { margin-top: 10px; padding-top: 12px; }

    .workspace { margin-left: 0; padding: 14px 14px 44px; }
    .topbar { margin-bottom: 14px; }
    .eyebrow { font-size: 11px; }
    .topbar h1 { font-size: 20px; }

    .panel { padding: 14px; }
    .section-head { flex-wrap: wrap; gap: 10px; }
    .flash { font-size: 13px; }

    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .stat { min-height: 76px; padding: 13px 14px; }
    .stat b { font-size: 21px; }

    /* 表格：外层横向滚动，操作列按钮允许换行；给表格一个最小宽度，避免列被压到中文逐字竖排 */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    .table { font-size: 13px; min-width: 720px; }
    .table th, .table td { padding: 9px 11px; }
    .actions { white-space: normal !important; }
    .actions .btn, .actions form { margin: 2px 2px 2px 0; }
    /* 操作按钮在窄屏收小一档，尽量两三行放得下 */
    .actions .btn { padding: 5px 9px; font-size: 12px; }
    /* 订单号/上游单号这类长串允许断行，否则会把这一列撑到 200px 宽 */
    .mono-text { word-break: break-all; }
    /* 弹窗内的表格自己带横向滚动，不需要全局最小宽度 */
    .catalog-table .table { min-width: 460px; }

    .modal { padding: 10px; }
    .dialog header { padding: 12px 14px; }
    .catalog-title { flex-wrap: wrap; gap: 8px; }
    .catalog-fixed .inline-form { flex-wrap: wrap; }
    .dialog-actions { padding: 0 14px 14px; }
    .qrbox img { width: 200px; height: 200px; }

    .metric-row { grid-template-columns: 72px 1fr 40px; gap: 8px; font-size: 12px; }
}

/* ===== 弹窗 ===== */
/* 遮罩过重会把背景文字压糊（对比度骤降），改用轻遮罩 + 强化弹窗阴影保持层次 */
.modal { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgba(17, 24, 39, .28); display: grid; place-items: center; }
.dialog { width: min(420px, 100%); background: #fff; box-shadow: 0 18px 56px rgba(17, 24, 39, .26), 0 2px 8px rgba(17, 24, 39, .12); border-radius: 10px; overflow: hidden; }
.catalog-dialog { width: min(860px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.account-dialog { max-height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
@supports (height: 100dvh) {
    .account-dialog { max-height: calc(100dvh - 40px); }
}
.dialog header { min-height: 64px; padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.dialog header > div { display: flex; align-items: center; gap: 11px; }
.dialog-icon { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: #078743; background: var(--brand-soft); font-size: 20px; font-weight: 700; }
.dialog header strong { display: block; font-size: 15px; }
.dialog header div div span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.icon-button:hover { background: #f2f3f5; }
/* 添加账号：QQ音乐App / QQ / 微信 三个渠道 */
.qr-tabs { display: flex; gap: 6px; padding: 10px 14px 0; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.qr-tab { flex: 1; padding: 9px 4px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0;
    background: transparent; color: var(--muted); font-family: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.qr-tab:hover { color: var(--brand); }
.qr-tab.active { background: #fff; border-color: var(--line); color: var(--brand); font-weight: 600; }
.qrbox { min-height: 260px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 10px; background: #f7f8fa; }
.phone-panel { padding: 16px 18px 18px; background: #f7f8fa; }
.phone-panel[hidden] { display: none; }
.phone-field { display: flex; align-items: center; gap: 8px; height: 46px; margin-bottom: 10px;
    padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.phone-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
    color: var(--text); font-family: inherit; font-size: 15px; letter-spacing: .5px; }
.phone-field input::placeholder { color: #c2c8cf; font-size: 14px; letter-spacing: 0; }
.phone-prefix { flex: 0 0 auto; color: var(--muted); font-size: 14px; }
.phone-field .btn { flex: 0 0 auto; white-space: nowrap; }
.phone-submit { width: 100%; height: 42px; margin-top: 2px; }
.phone-panel .qr-status { margin: 10px 0 0; text-align: center; }
.phone-panel .qr-status.is-error { color: #b3261e; }
.phone-panel .qr-status.is-ok { color: #1f7a4d; }
.phone-panel .qr-status.is-warn { color: #9a6700; }
.qq-captcha-wrap { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qq-captcha-wrap[hidden] { display: none !important; }
.qq-captcha-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.qq-captcha-head strong { color: var(--text); font-size: 13px; }
.qq-captcha-refresh { padding: 0; border: 0; background: transparent; color: var(--muted); font-family: inherit;
    font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.qq-captcha-refresh:hover { color: var(--brand); }
.qq-captcha-stage { position: relative; width: 100%; max-width: 310px; aspect-ratio: 1 / 1; margin: 0 auto;
    overflow: hidden; border-radius: 8px; background: #0b1220; }
.qq-captcha-bg { display: block; width: 100%; height: 100%; object-fit: fill;
    user-select: none; -webkit-user-drag: none; pointer-events: none; }
.qq-captcha-piece { position: absolute; left: 0; top: 0; pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); will-change: left, top; }
.qq-captcha-track { position: relative; height: 42px; margin-top: 10px; border-radius: 21px; background: #eef1f4;
    box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; touch-action: none; user-select: none; }
.qq-captcha-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 42px; border-radius: 21px;
    background: linear-gradient(90deg, rgba(16, 163, 74, .16), rgba(16, 163, 74, .06)); pointer-events: none; }
.qq-captcha-handle { position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #04a850); color: #fff; display: flex; align-items: center;
    justify-content: center; font-size: 18px; font-weight: 700; cursor: grab; z-index: 2; touch-action: none; }
.qq-captcha-handle:active { cursor: grabbing; }
.qq-captcha-track-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 12px; pointer-events: none; transition: opacity .15s; }
.qq-captcha-wrap .qr-status { margin-top: 8px; text-align: center; }
.qrbox img { width: 240px; height: 240px; padding: 8px; background: #fff; object-fit: contain; }
.qrbox span { color: var(--muted); font-size: 13px; }
.dialog > p { margin: 0; padding: 14px 20px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.dialog-actions { padding: 0 20px 20px; }
.catalog-body { min-height: 0; overflow-y: auto; background: #f5f6f8; }
.catalog-title { min-height: 52px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-title strong { font-size: 14px; }
.catalog-table { max-height: calc(100vh - 260px); overflow: auto; }
.catalog-table .table { border: 0; }

/* ===== 前台兑换页（向导式） ===== */
.redeem-body { min-height: 100vh; background: #f2f4f6; display: grid; place-items: center; padding: 24px 16px; }
.redeem-page { width: 100%; max-width: 440px; }
.redeem-card { background: #fff; border-radius: 14px; padding: 28px 24px 24px; box-shadow: 0 8px 32px rgba(17, 24, 39, .08); }
.redeem-card.center { text-align: center; }
.redeem-head { text-align: center; margin-bottom: 20px; }
.redeem-brand { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 26px; font-weight: 700; }
.redeem-head h1 { margin: 0 0 6px; font-size: 20px; }
.redeem-head p { margin: 0; font-size: 13px; }

/* 步骤条 */
.steps { display: flex; align-items: flex-start; justify-content: space-between; margin: 4px 0 22px; }
.step-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.step-item::before { content: ''; position: absolute; top: 13px; left: 0; right: 50%; height: 2px; background: #e9edf2; }
.step-item::after { content: ''; position: absolute; top: 13px; left: 50%; right: 0; height: 2px; background: #e9edf2; }
.step-item:first-child::before, .step-item:last-child::after { display: none; }
.step-item.done::before, .step-item.done::after,
.step-item.active::before { background: var(--brand); }
.step-item .dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: #eef1f4; color: var(--muted); }
.step-item .lbl { font-size: 12px; color: var(--muted); }
.step-item.active .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(7, 193, 96, .14); }
.step-item.active .lbl { color: var(--brand); font-weight: 600; }
.step-item.done .dot { background: var(--brand-soft); color: #078743; }
.step-item.done .lbl { color: #078743; }

/* 阶段切换 */
.stage { display: none; }
.stage.active { display: block; animation: stage-in .22s ease-out; }
@keyframes stage-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stage-title { margin: 0 0 14px; text-align: center; font-size: 14px; color: #4e5969; }

/* 兑换页登录方式切换（扫码 / 手机号） */
.login-tabs { display: flex; gap: 6px; padding: 4px; margin: 0 0 16px; border-radius: 10px; background: #f2f4f6; }
.login-tab { flex: 1; padding: 9px 6px; border: none; border-radius: 8px; background: transparent;
    color: var(--muted); font-family: inherit; font-size: 14px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.login-tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 4px rgba(17, 24, 39, .08); }
.login-pane[hidden] { display: none; }
.form-msg { margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.form-msg.center { text-align: center; }
.form-msg.err { color: #b3261e; }
.form-msg.ok { color: #1f7a4d; }
.form-msg.warn { color: #9a6700; }

/* 卡密信息 */
.claim-info { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; margin-bottom: 18px; background: #fbfcfd; }
.claim-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.claim-row:last-child { border-bottom: 0; }
.claim-row > span { color: var(--muted); flex: 0 0 auto; }
.claim-row > strong { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }

.btn-block { display: block; width: 100%; padding: 12px 16px; font-size: 15px; border-radius: 8px; text-align: center; }

/* 二维码 */
.redeem-card .qrbox { min-height: 236px; padding: 18px; margin-bottom: 12px; border-radius: 10px; }
.redeem-card .qrbox img { width: 200px; height: 200px; }

/* 正在开通：旋转环 + 倒计时数字 */
.opening-ring { position: relative; width: 104px; height: 104px; margin: 10px auto 20px; }
.opening-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid #e9edf2; border-top-color: var(--brand); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-inner { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 650; color: var(--brand); font-variant-numeric: tabular-nums; }

/* 结果 */
.redeem-result { text-align: center; padding: 6px 0 4px; }
.redeem-result h2 { margin: 14px 0 8px; font-size: 19px; }
.redeem-result p { margin: 0 0 10px; font-size: 13px; }
.result-icon { width: 62px; height: 62px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; }
.result-icon.ok { background: var(--brand); box-shadow: 0 0 0 8px rgba(7, 193, 96, .12); }
.result-icon.fail { background: var(--danger); box-shadow: 0 0 0 8px rgba(250, 81, 81, .12); }
.redeem-result .btn-block { margin-top: 16px; }

/* 兑换页：当前登录账号条 */
.account-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fb; }
.acc-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); font-size: 17px; overflow: hidden; flex: 0 0 auto; }
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-meta { flex: 1; min-width: 0; }
.acc-meta strong { display: block; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta span { font-size: 12px; }
.account-bar .btn { flex: 0 0 auto; }

/* 结果页行内账号（头像 + 昵称） */
.acc-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; justify-content: flex-end; }
.acc-mini { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

/* ===== 员工端 ===== */
/* 自动接单开关：轨道 + 滑块，纯 CSS，无外部依赖 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; flex: 0 0 auto; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d6dae0; transition: background .18s; flex: 0 0 auto; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(17, 24, 39, .24); transition: transform .18s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(7, 193, 96, .2); }
.switch-text { font-size: 13px; color: #4e5969; white-space: nowrap; }
.switch input:checked ~ .switch-text { color: #078743; font-weight: 600; }

/* 轻提示 */
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 200; max-width: 88vw; padding: 11px 20px; border-radius: 8px; background: rgba(17, 24, 39, .88); color: #fff; font-size: 13px; box-shadow: 0 10px 28px rgba(17, 24, 39, .26); }

/* 指标进度条 */
.metric-bars { display: grid; gap: 12px; }
.metric-row { display: grid; grid-template-columns: 88px 1fr 48px; align-items: center; gap: 12px; font-size: 13px; }
.metric-label { color: var(--muted); }
.metric-track { height: 8px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.metric-track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .3s; }
.metric-track i.blue { background: #3b82f6; }
.metric-track i.amber { background: #f59e0b; }
.metric-track i.red { background: var(--danger); }
.metric-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

/* 收银台弹窗：固定商品下单工具条（与下方实时商品列表区分层次） */
.catalog-fixed { background: #fbfcfd; border-bottom: 1px solid var(--line); }
/* 注意：不要再给 .catalog-fixed .inline-form 设 flex-wrap: nowrap，
   那条规则写在这里会覆盖上面的移动端媒体查询（同权重、位置更靠后），导致窄屏按钮溢出弹窗。 */

/* 兑换页：等待商家开通（倒计时结束后切换到的状态） */
.opening-ring.waiting::before { animation-duration: 1.7s; }
.opening-ring.waiting .ring-inner { font-size: 20px; letter-spacing: 2px; color: var(--muted); }

/* 付款弹窗：自动检测付款状态 */
.pay-watch { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px 0; color: var(--muted); font-size: 13px; }
.pay-watch-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: watch-pulse 1.6s infinite; flex: 0 0 auto; }
.pay-watch.done { color: #078743; font-weight: 600; }
.pay-watch.done .pay-watch-dot { background: var(--brand); animation: none; }
.pay-watch.fail { color: #d92b2b; }
.pay-watch.fail .pay-watch-dot { background: var(--danger); animation: none; }
@keyframes watch-pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); }
    70% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* 会员到期时间：有效为绿、已过期为红 */
.text-danger { color: #d92b2b !important; }
.text-success { color: #078743 !important; }

/* 付款弹窗：短链不可用等提示 */
.pay-warn { margin: 0; padding: 10px 20px 0; color: #b45309; font-size: 12px; line-height: 1.6; text-align: center; }

/* ===== 生成卡密弹窗 ===== */
.gen-section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.gen-section:last-of-type { border-bottom: 0; }
.gen-section h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.gen-section .inline-form { gap: 10px; }
.gen-error { margin: 0 18px 16px; }
.gen-result-head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.gen-result-head strong { display: block; font-size: 14px; }
.gen-result-head .muted { display: block; margin-top: 4px; font-size: 12px; }
.gen-list { padding: 8px 0; }
.gen-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); }
.gen-row:last-child { border-bottom: 0; }
.gen-url { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #4e5969; word-break: break-all; }

/* ===== 统一确认弹窗（替代原生 confirm / prompt）===== */
.confirm-dialog { width: min(392px, 100%); }
.confirm-body { padding: 24px 22px 4px; text-align: center; }
.confirm-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
    font-size: 24px; font-weight: 700; color: #b45309; background: #fef3c7; }
.confirm-dialog.danger .confirm-icon { color: #991b1b; background: #fee2e2; }
.confirm-title { display: block; font-size: 16px; font-weight: 650; }
.confirm-message { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; word-break: break-word; }
.confirm-input { width: 100%; margin-top: 14px; padding: 9px 12px; border: 1px solid var(--line-strong);
    border-radius: 6px; font-size: 13px; font-family: inherit; }
.confirm-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7,193,96,.14); }
.confirm-actions { display: flex; gap: 10px; padding: 18px 22px 20px; }
.confirm-actions .btn { flex: 1; padding: 10px 16px; font-size: 14px; text-align: center; }

/* ===== 数据清理（全局配置页）：紧凑按钮 + 弹窗 ===== */
.maint-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.maint-badge { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .09); font-size: 11px; }
.btn-danger .maint-badge { background: rgba(255, 255, 255, .28); }

.maint-dialog { width: min(460px, 100%); }
.maint-dialog.danger .dialog-icon { color: #991b1b; background: #fee2e2; }
.maint-body { padding: 16px 20px 4px; }
.maint-body > p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.maint-count-line { padding: 8px 10px; border-radius: 6px; background: #fff7e6; color: #92400e; font-size: 12px; }
.maint-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.maint-input { width: 100%; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--line-strong);
    border-radius: 6px; font-size: 13px; font-family: inherit; }
.maint-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7, 193, 96, .14); }
.maint-field { margin-bottom: 2px; }
.maint-error { margin: 0 0 12px !important; color: #991b1b; font-size: 12px; }
.maint-actions { display: flex; gap: 10px; padding: 4px 20px 20px; }
.maint-actions .btn { flex: 1; padding: 10px 16px; font-size: 14px; text-align: center; }

/* ===== 后台登录页（样式参考 Tencent-Login-Forend：浅灰底 + 顶部提示条 + 白色卡片）===== */
.tl-page { position: fixed; inset: 0; display: flex; flex-direction: column; overflow-y: auto;
    background: #f4f5f6; -webkit-overflow-scrolling: touch; }

/* 顶部浮动提示条：空值提醒、登录失败等都走这里 */
.tl-tips { position: fixed; top: 10px; left: 50%; transform: translate(-50%, -14px); z-index: 20;
    display: flex; align-items: center; gap: 10px; width: min(90%, 396px); padding: 0 18px; height: 40px;
    border-radius: 5px; background: #525c5f; color: #fff; font-size: 14px;
    opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.tl-tips.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.tl-tips.tips-error { background: #b3261e; }
.tl-tips.tips-success { background: #1f7a4d; }
.tl-tips-icon { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .22);
    font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.tl-tips-text { flex: 1; min-width: 0; line-height: 1.35; overflow: hidden; }
@media (max-width: 430px) { .tl-tips-text { font-size: 13px; } }

.tl-inner { flex: 1 0 auto; width: 100%; padding: 0 16px; }

.tl-logo { display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: clamp(28px, 10vh, 96px) 0 0; }
.tl-logo-mark { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #04a850); color: #fff; font-size: 30px; line-height: 1; }
.tl-logo-text strong { display: block; font-size: 20px; letter-spacing: .5px; }
.tl-logo-text span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; letter-spacing: .5px; }

.tl-card { position: relative; width: min(100%, 396px); margin: 30px auto 0;
    background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(17, 24, 39, .06); overflow: hidden; }
.tl-line { position: relative; height: 56px; display: flex; align-items: center; }
/* 输入行之间的分隔线：两端各留 5%（与参考项目的 90% 居中渐变线一致） */
.tl-line + .tl-line::before { content: ''; position: absolute; top: 0; left: 5%; right: 5%; height: 1px; background: #eee; }
.tl-line input { flex: 1; min-width: 0; height: 40px; margin: 0 16px; padding: 0; border: none; outline: none;
    background: transparent; color: var(--text); font-size: 17px; font-family: inherit; letter-spacing: 1px; }
.tl-line input::placeholder { color: #c2c8cf; font-size: 16px; letter-spacing: 0; }
.tl-line input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--text); }
/* 有一键清空按钮；只在输入框有内容时出现（不写 JS 也能正确显示） */
.tl-clear { flex: 0 0 auto; display: none; width: 22px; height: 22px; margin-right: 14px; padding: 0;
    border: none; border-radius: 50%; background: #dfe3e8; color: #fff; font-size: 15px; line-height: 22px;
    text-align: center; cursor: pointer; }
.tl-line input:not(:placeholder-shown) ~ .tl-clear { display: block; }
.tl-clear:hover { background: #c9cfd6; }

/* 按钮在白色输入卡片之外（与参考项目一致：卡片只包输入行） */
.tl-submit { display: block; width: min(100%, 396px); height: 45px; margin: 26px auto 0; border: none;
    border-radius: 4px; background: var(--brand); color: #fff; font-size: 16px; font-family: inherit;
    letter-spacing: 2px; cursor: pointer; transition: background .15s ease; }
.tl-submit:hover { background: var(--brand-strong); }
.tl-submit:active { background: #059a4b; }

.tl-links { flex: 0 0 auto; padding: 24px 16px 40px; text-align: center; font-size: 14px; color: var(--muted); }
.tl-links a { color: var(--muted); }
.tl-links a:hover { color: var(--brand); }
.tl-divider { display: inline-block; width: 1px; height: 14px; margin: 0 18px; vertical-align: -2px; background: #e0e3e8; }
/* 软键盘弹出时（JS 加 .tl-keyboard）隐藏底部链接，避免被顶到输入框上方 */
body.tl-keyboard .tl-links { display: none; }

@media (max-width: 600px) {
    .tl-logo { padding-top: clamp(24px, 8vh, 72px); }
    .tl-logo-mark { width: 48px; height: 48px; font-size: 26px; }
    .tl-logo-text strong { font-size: 18px; }
    .tl-links { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}


/* 兑换页手机号登录：桌面与移动端通用（输入行复用后台样式） */
.redeem-card .phone-field { height: 48px; }
.redeem-card .phone-field input { font-size: 16px; }
.redeem-card .phone-submit { height: 46px; font-size: 16px; }
.redeem-card .qq-captcha-wrap { margin-top: 14px; }
.redeem-card .qq-captcha-stage { max-width: 100%; }
@media (max-width: 600px) {
    .login-tab { font-size: 13px; padding: 9px 4px; }
    .redeem-card .phone-field { height: 46px; }
}


/* 兑换页短信风控滑块弹窗 */
.redeem-captcha-dialog { width: min(380px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.redeem-captcha-dialog .qq-captcha-wrap { margin: 14px 16px 16px; padding: 0; border: 0; background: transparent; }
.redeem-captcha-dialog .qq-captcha-stage { max-width: 100%; }
.redeem-captcha-dialog .dialog-actions { padding: 0; margin-top: 12px; display: flex; justify-content: center; }
.redeem-captcha-dialog .qq-captcha-track { margin-top: 12px; }
.redeem-captcha-dialog .qr-status { margin-top: 8px; text-align: center; }
.redeem-captcha-dialog .qr-status.is-ok { color: #1f7a4d; }
.redeem-captcha-dialog .qr-status.is-error { color: #b3261e; }


/* 下单方式切换（数量下单 / 重复下单） */
.order-mode { display: inline-flex; padding: 2px; border-radius: 7px; background: #eef1f4; vertical-align: middle; }
.order-mode-btn { padding: 5px 10px; border: none; border-radius: 5px; background: transparent;
    color: var(--muted); font-family: inherit; font-size: 12px; white-space: nowrap; cursor: pointer;
    transition: background .15s ease, color .15s ease; }
.order-mode-btn:hover { color: var(--brand); }
.order-mode-btn.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.catalog-title .order-mode { margin-right: 4px; }


/* 付款弹窗：多单二维码翻页 */
.pay-pager { display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 10px 16px 0; }
.pay-pager[hidden] { display: none; }
.pay-pager-btn { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
    background: #fff; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.pay-pager-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pay-pager-btn:disabled { opacity: .35; cursor: not-allowed; }
.pay-pager-info { font-size: 13px; color: var(--muted); }
.pay-pager-info b { color: var(--text); font-size: 15px; }

/* ===== 缓存管理（全局配置页）===== */
.cache-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; font-size: 13px; }
.cache-status > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cache-status strong { font-weight: 600; }
.cache-status .mono-text { font-size: 12px; color: var(--muted); }

/* ===== 账号管理：会员图标 + 到期时间（上下两行，替代原来的胶囊）===== */
.vip-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.vip-icons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vip-icon { height: 26px; width: auto; max-width: 132px; object-fit: contain; display: block; }
.vip-expiry { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ===== 账号管理：昵称列的头像 ===== */
.acc-cell { display: flex; align-items: center; gap: 9px; }
.acc-avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #eef1f4; }
.acc-avatar-empty { display: grid; place-items: center; font-size: 15px; color: var(--muted); }

/* 兑换页：账号锁定提示 */
.lock-hint { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ===== 商品管理：重复商品检测 ===== */
.dup-alert { margin-top: 12px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fffbfb; }
.dup-alert-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dup-alert-head strong { color: #991b1b; font-size: 14px; }
.dup-alert-head .muted { font-size: 12px; }
.dup-list { display: grid; gap: 8px; margin: 10px 0 12px; }
.dup-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dup-item { padding: 3px 10px; border-radius: 6px; background: #fee2e2; color: #7f1d1d; font-size: 12px; }
.dup-item.keep { background: #dcfce7; color: #166534; }
.dup-item b { margin-left: 6px; font-weight: 600; }

/* ===== 商品管理：分类切换条 ===== */
.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.type-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s; }
.type-tab:hover { border-color: var(--brand); color: var(--brand); }
.type-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.type-count { padding: 0 6px; border-radius: 999px; background: #eef1f4; color: var(--muted); font-size: 11px; font-weight: 600; }
.type-tab.active .type-count { background: rgba(255, 255, 255, .3); color: #fff; }
.type-tabs + .table-wrap { margin-top: 14px; }

/* ===== 快捷下单 ===== */
.quick-plan .section-head h3 { display: flex; align-items: center; gap: 8px; }
.qo-dialog { width: min(660px, 94vw); }
.qo-dialog .field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.qo-dialog input[type="text"] { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.qo-items-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.qo-item-row { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; flex-wrap: wrap; }
.qo-item-row select { height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.qo-item-field { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.qo-item-field input { width: 58px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.qo-item-del { flex: 0 0 auto; width: 32px; padding: 0; }
.qo-login-plan { font-size: 12px; }
#qo-running .qrbox { min-height: 150px; }
#qo-result-body .table-wrap { max-height: 280px; overflow: auto; }
#qo-result-body .flash ul { padding-left: 18px; }

/* ===== 方案管理：弹窗编辑 + 商品分类 ===== */
.plan-dialog { width: min(760px, 96vw); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.plan-dialog form { display: flex; flex-direction: column; min-height: 0; }
.plan-dialog-body { padding: 14px 18px 0; overflow: auto; min-height: 0; }
.plan-dialog .dialog-actions { padding: 14px 18px 18px; }
.plan-dialog .form-row input[type="text"],
.plan-dialog .form-row input[type="number"],
.plan-dialog .form-row select { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.plan-cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.plan-product-list { max-height: 240px; overflow: auto; padding-right: 4px; align-content: start; }
.plan-product-list label[hidden] { display: none !important; }

/* ===== 快捷下单：下单结果内直接付款 ===== */
.qo-pay-dialog { width: min(480px, 96vw); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.qo-pay-body { padding: 14px 18px 0; overflow: auto; min-height: 0; }
.qo-pay-body .qrbox { margin-top: 6px; }
.qo-pay-body #qo-pay-qr { width: 220px; height: 220px; }
.qo-result-list { max-height: 180px; overflow: auto; }
.qo-pay-dialog .dialog-actions .btn { display: block; }

/* ===== 工作台统计 ===== */
.stat-success { color: #166534; }
.stat-warn { color: #92400e; }
.stat-danger { color: #991b1b; }

.dash-range { display: flex; gap: 6px; flex-shrink: 0; }

.dash-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 8px 2px 0; overflow-x: auto; }
.dash-bar { flex: 1 0 34px; min-width: 34px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.dash-bar-track { flex: 1; width: 100%; max-width: 42px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; overflow: hidden; background: #f2f3f5; }
.dash-bar-track i { display: block; width: 100%; }
.dash-bar-success { background: var(--brand); }
.dash-bar-pending { background: #fbbf24; }
.dash-bar-failed { background: #ef4444; }
.dash-bar-value { margin: 6px 0 0; font-size: 12px; line-height: 1; color: var(--text); }
.dash-bar-label { font-size: 11px; color: var(--muted); line-height: 1.5; white-space: nowrap; }
.dash-bar-week { font-size: 10px; color: var(--muted); line-height: 1.4; }

.dash-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.dash-columns > .panel { margin-bottom: 16px; }

.dash-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.dash-status-row .badge { min-width: 76px; text-align: center; }
.dash-status-bar { flex: 1; height: 8px; border-radius: 999px; background: #f2f3f5; overflow: hidden; }
.dash-status-bar i { display: block; height: 100%; background: var(--brand); }
.dash-status-row strong { min-width: 34px; text-align: right; }
.dash-status-row .muted { min-width: 44px; text-align: right; font-size: 12px; }

.dash-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.dash-metrics > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.dash-metrics b { display: block; font-size: 20px; line-height: 1.15; }
.dash-metrics span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.dash-links { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
    .dash-chart { height: 160px; gap: 5px; }
    .dash-bar { flex: 0 0 30px; min-width: 30px; }
    .dash-bar-track { max-width: 30px; }
    .dash-columns { grid-template-columns: 1fr; }
}

/* ===== 列表分页（账号 / 订单通用） ===== */
.list-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; }
.list-pager-btns { display: flex; align-items: center; gap: 8px; }
.list-pager-size { display: flex; align-items: center; gap: 6px; }

@media (max-width: 640px) {
    .list-pager { justify-content: center; }
    .list-pager-size { width: 100%; justify-content: center; }
}
