: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; }
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; }

/* ===== 统计 ===== */
.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; }

/* ===== 前台 ===== */
.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; }
    .side-body { display: none; }
    .sidebar.open .side-body { display: flex; padding-top: 12px; }
    .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; }
.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; }
.qrbox { min-height: 260px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 10px; background: #f7f8fa; }
.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; }

/* 卡密信息 */
.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; }
