/* ============================================================
   闪充卡站 — 全站样式（靛蓝渐变设计语言，浅色 / 暗色双主题）
   ============================================================ */
:root {
  --bg: #f3f5fb;
  --bg-soft: #edf0f9;
  --card: #ffffff;
  --elev: #ffffff;
  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;
  --border: #e4e9f2;
  --border-2: #eef1f7;
  --accent: #6366f1;
  --accent-2: #7c3aed;
  --accent-soft: #eef2ff;
  --accent-border: #d6ddff;
  --on-accent: #ffffff;
  --ink: #0f172a;
  --on-ink: #ffffff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #b7e8d4;
  --error: #e11d48;
  --error-soft: #fff1f2;
  --error-border: #f9c9d3;
  --warn: #d97706;
  --warn-soft: #fff8e6;
  --warn-border: #f5d9a0;
  --info: #0284c7;
  --info-soft: #eff8ff;
  --info-border: #bae0f7;
  --ring: rgba(99, 102, 241, .16);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 12px 32px -8px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .05);
  --radius: 20px;
  --radius-sm: 12px;
}
html.dark {
  --bg: #0a0d1a;
  --bg-soft: #161b30;
  --card: #111527;
  --elev: #171c31;
  --text: #e7eaf6;
  --text-2: #a3abc9;
  --text-3: #697091;
  --border: #232946;
  --border-2: #1c2138;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: rgba(129, 140, 248, .12);
  --accent-border: rgba(129, 140, 248, .35);
  --on-accent: #0b0e1c;
  --ink: #e9ebf8;
  --on-ink: #0b0e1c;
  --success: #34d399;
  --success-soft: rgba(16, 185, 129, .12);
  --success-border: rgba(16, 185, 129, .35);
  --error: #fb7185;
  --error-soft: rgba(225, 29, 72, .14);
  --error-border: rgba(225, 29, 72, .40);
  --warn: #fbbf24;
  --warn-soft: rgba(217, 119, 6, .13);
  --warn-border: rgba(217, 119, 6, .40);
  --info: #38bdf8;
  --info-soft: rgba(2, 132, 199, .13);
  --info-border: rgba(2, 132, 199, .40);
  --ring: rgba(129, 140, 248, .22);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md: 0 16px 40px -12px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 背景光斑装饰 */
.bg-deco {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(560px 320px at 12% -4%, rgba(99, 102, 241, .12), transparent 70%),
    radial-gradient(520px 300px at 88% 4%, rgba(14, 165, 233, .09), transparent 70%),
    radial-gradient(640px 380px at 50% 108%, rgba(139, 92, 246, .07), transparent 70%);
}
html.dark .bg-deco {
  background:
    radial-gradient(560px 320px at 12% -4%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(520px 300px at 88% 4%, rgba(14, 165, 233, .10), transparent 70%),
    radial-gradient(640px 380px at 50% 108%, rgba(139, 92, 246, .10), transparent 70%);
}

/* ---------------- 顶部导航 ---------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 4vw, 32px); height: 62px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .40);
}
.brand-logo svg { width: 19px; height: 19px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.nav-links { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.nav-link {
  appearance: none; border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--text-2); transition: all .15s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-link[disabled] { color: var(--text-3); cursor: not-allowed; opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------------- 公告 ---------------- */
.announce {
  display: none; align-items: center; gap: 9px;
  margin: 16px auto 0; max-width: 760px; padding: 11px 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent-2); border-radius: 14px; font-size: 14px;
}
.announce.show { display: flex; }
.announce svg { flex: none; }

/* ---------------- 布局 ---------------- */
main.wrap { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 24px 44px; }

/* ---------------- 页面 ---------------- */
.page { display: none; }
.page.show { display: block; }
.page-hero { margin: 4px 0 18px; }
.page-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 4px; }
.page-hero .sub { color: var(--text-2); margin: 0; font-size: 14.5px; }
.page-hero .product-pills { display: flex; gap: 10px; margin-top: 16px; }
.page-hero .pill {
  appearance: none; border: 1px solid var(--border); cursor: pointer; font-family: inherit;
  background: var(--card); color: var(--text-2); border-radius: 999px;
  padding: 7px 18px; font-size: 13.5px; font-weight: 600; transition: all .15s;
}
.page-hero .pill:hover { color: var(--text); border-color: var(--accent-border); }
.page-hero .pill.active {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* ---------------- 工作台双栏 ---------------- */
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.rail { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px; }
.rail-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); }
.rail-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.rail-order { font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.rail-tips { margin: 0; padding-left: 18px; font-size: 12.8px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.rail-tips li::marker { color: var(--accent); }
.rail-q-card { background: var(--bg-soft); border-radius: 12px; padding: 10px 12px; }

/* ---------------- 三步向导 ---------------- */
.wizard { display: flex; gap: 26px; padding: 24px 28px 30px; align-items: flex-start; }
.wiz-rail { flex: none; width: 184px; display: flex; flex-direction: column; }
.wstep { display: flex; align-items: center; gap: 13px; }
.wnode {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--text-3);
  font-weight: 700; font-size: 16.5px; border: 2px solid transparent; transition: all .25s;
}
html.dark .wnode { background: #1c2138; }
.wnode.current { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); }
.wnode.done { background: var(--success); color: #fff; }
.wnode.done svg { width: 19px; height: 19px; }
.wlbl { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.wlbl small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 500; line-height: 1.45; }
.wstep.current .wlbl { color: var(--accent); }
.wline { height: 30px; border-left: 2px dashed var(--border); margin-left: 23px; }
.wiz-body { flex: 1; min-width: 0; }

.query-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

@media (max-width: 1020px) {
  .workbench { grid-template-columns: 1fr; }
  .rail { position: static; }
}
@media (max-width: 760px) {
  .query-grid { grid-template-columns: 1fr; }
  .wizard { flex-direction: column; }
  .wiz-rail { width: 100%; flex-direction: row; align-items: center; gap: 6px; }
  .wline { width: auto; flex: 1; height: auto; border-left: none; border-top: 2px dashed var(--border); margin: 0; }
  .wlbl small { display: none; }
  .page-hero h1 { font-size: 22px; }
}

.view-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.view-chip {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.view-chip svg { width: 22px; height: 22px; }
.view-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.view-head .desc { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); }

/* 步进条（三段） */
.stepper { display: flex; gap: 8px; margin: 2px 0 22px; }
.stepper span { flex: 1; height: 5px; border-radius: 999px; background: var(--bg-soft); transition: background .3s; }
html.dark .stepper span { background: #1c2138; }
.stepper span.done { background: var(--grad); }
.stepper span.ok { background: var(--success); }
.stepper span.bad { background: var(--error); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13.5px; color: var(--text-2); font-weight: 600; margin-bottom: 7px; }
.input, .textarea {
  width: 100%; padding: 11px 14px; font-size: 15px; color: var(--text);
  background: #fbfcff; border: 1px solid #dfe5f1; border-radius: var(--radius-sm);
  outline: none; transition: border .15s, box-shadow .15s; font-family: inherit;
}
html.dark .input, html.dark .textarea { background: #0e1224; border-color: #262c4a; }
.input.mono { letter-spacing: .5px; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; letter-spacing: .3px; }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.helper { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.divider-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 14px 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.btn {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  width: 100%; padding: 13px 16px; font-size: 15px; font-weight: 700;
  border-radius: var(--radius-sm); transition: all .15s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .30); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(99, 102, 241, .40); }
.btn-primary:disabled { background: var(--bg-soft); color: var(--text-3); cursor: not-allowed; box-shadow: none; }
html.dark .btn-primary:disabled { background: #1c2138; color: #525c80; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover:not(:disabled) { opacity: .9; }
.btn-ink:disabled { background: var(--bg-soft); color: var(--text-3); }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13.5px; border-radius: 10px; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13.5px; padding: 0; font-family: inherit; font-weight: 600; }
.linklike:hover { text-decoration: underline; }
.center { text-align: center; }
.row-gap { display: flex; gap: 10px; }
.row-gap > * { flex: 1; }
.btn-row2 { display: flex; gap: 10px; margin: 2px 0 4px; }
.btn-row2 .btn { flex: 1; padding: 12px 14px; }

/* ---------------- 提示条 ---------------- */
.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; margin: 14px 0 0; border: 1px solid transparent; }
.alert-error { background: var(--error-soft); border-color: var(--error-border); color: var(--error); }
.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.alert-info { background: var(--info-soft); border-color: var(--info-border); color: var(--info); }
.alert:empty { display: none; }

/* ---------------- Session 自动识别行 ---------------- */
.detect-row {
  display: flex; align-items: center; gap: 13px;
  border-radius: 14px; padding: 14px 16px; margin-top: 10px;
  font-size: 14.5px; line-height: 1.5;
}
.detect-row .d-ic { flex: none; display: flex; }
.detect-row.ok { background: var(--success-soft); color: var(--success); }
.detect-row.err { background: var(--error-soft); color: var(--error); }
.detect-row.warn { background: var(--warn-soft); color: var(--warn); }
.detect-row b { font-weight: 700; }
.detect-row:empty { display: none; }

/* ---------------- 人机验证 ---------------- */
.turnstile {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 14px;
  background: #fafbff; padding: 0 14px; height: 62px; margin: 16px 0 0;
  cursor: pointer; user-select: none; transition: border .15s;
}
html.dark .turnstile { background: #0e1224; }
.turnstile:hover { border-color: var(--accent-border); }
.turnstile .ts-check {
  width: 23px; height: 23px; border-radius: 7px; border: 2px solid var(--text-3);
  flex: none; display: flex; align-items: center; justify-content: center; background: var(--card);
}
.turnstile .ts-label { flex: 1; font-size: 14px; color: var(--text-2); }
.turnstile .ts-brand { font-size: 10px; color: var(--text-3); text-align: right; line-height: 1.25; letter-spacing: 1px; font-weight: 600; }
.turnstile.passed { border-color: var(--success-border); background: var(--success-soft); cursor: default; }
.turnstile.passed .ts-check { border-color: var(--success); background: var(--success); color: #fff; }
.turnstile.passed .ts-label { color: var(--success); font-weight: 600; }
.ts-spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--accent-border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 结果面板 ---------------- */
.result { border-radius: 18px; padding: 22px; margin-top: 18px; border: 1px solid; }
.result .result-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.result h3 { margin: 0 0 6px; font-size: 17px; }
.result p { margin: 0 0 6px; font-size: 14px; line-height: 1.6; }
.result-success { background: var(--success-soft); border-color: var(--success-border); }
.result-success .result-icon { background: var(--success); color: #fff; }
.result-success h3 { color: var(--success); }
.result-error { background: var(--error-soft); border-color: var(--error-border); }
.result-error .result-icon { background: var(--error); color: #fff; }
.result-error h3 { color: var(--error); }
.result-manual { background: var(--warn-soft); border-color: var(--warn-border); }
.result-manual .result-icon { background: var(--warn); color: #fff; }
.result-manual h3 { color: var(--warn); }
.result .meta { color: var(--text-2); }
.result .order-no { font-weight: 700; color: var(--text); }
.result .actions { display: flex; gap: 10px; margin-top: 14px; }

/* 实时进度（事件流，管理后台也在用） */
.progress-box { margin-top: 6px; }
.progress-title { font-size: 14px; font-weight: 700; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.event-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.event-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border-2); font-size: 13.5px; align-items: baseline; }
.event-row:last-child { border-bottom: none; }
.event-time { color: var(--text-3); font-size: 12px; flex: none; font-family: ui-monospace, monospace; }
.event-msg { color: var(--text-2); }
.event-row.success .event-msg { color: var(--success); font-weight: 600; }
.event-row.error .event-msg { color: var(--error); font-weight: 600; }
.event-row.warn .event-msg { color: var(--warn); }

/* ---------------- 图形化步骤条 ---------------- */
.stepper-graphic { display: flex; align-items: flex-start; padding: 12px 6px 2px; }
.gstep { flex: none; display: flex; flex-direction: column; align-items: center; width: 78px; }
.gnode {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14.5px;
  background: var(--bg-soft); color: var(--text-3);
  border: 2px solid transparent; transition: all .25s;
}
html.dark .gnode { background: #1c2138; }
.gnode.done { background: var(--success); color: #fff; box-shadow: 0 3px 12px rgba(5, 150, 105, .30); }
.gnode.current { background: var(--grad); color: #fff; box-shadow: 0 3px 12px rgba(99, 102, 241, .35); }
.gnode.bad { background: var(--error); color: #fff; box-shadow: 0 3px 12px rgba(225, 29, 72, .30); }
.gnode.warn { background: var(--warn); color: #fff; box-shadow: 0 3px 12px rgba(217, 119, 6, .30); }
.glabel { margin-top: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.gstep.done .glabel { color: var(--success); font-weight: 600; }
.gstep.current .glabel { color: var(--accent); font-weight: 600; }
.gstep.bad .glabel { color: var(--error); font-weight: 600; }
.gstep.warn .glabel { color: var(--warn); font-weight: 600; }
.gline { flex: 1; height: 3px; border-radius: 2px; background: var(--border); margin-top: 18px; min-width: 14px; }
.gline.done { background: var(--success); }

/* ---------------- 订单信息表 ---------------- */
.detail-table { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 16px; background: var(--card); }
.d-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.d-row:last-child { border-bottom: none; }
.d-label { color: var(--text-3); flex: none; }
.d-value { font-weight: 700; text-align: right; word-break: break-all; }
.d-value.mono { font-family: ui-monospace, monospace; letter-spacing: .3px; }
.d-value.red { color: var(--error); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
.tbl th { text-align: left; padding: 10px 14px; color: var(--text-3); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border-2); color: var(--text-2); }
.tbl tr:hover td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
.tbl td.strong, .tbl td .strong { color: var(--text); font-weight: 600; }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip-gray { background: var(--bg-soft); color: var(--text-2); }
.chip-green { background: var(--success-soft); color: var(--success); }
.chip-red { background: var(--error-soft); color: var(--error); }
.chip-orange { background: var(--accent-soft); color: var(--accent); }
.chip-amber { background: var(--warn-soft); color: var(--warn); }

/* ---------------- 批量导入 ---------------- */
.file-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--accent-border); color: var(--accent);
  background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
  transition: all .15s;
}
.file-btn:hover { border-color: var(--accent); }

/* ---------------- 底栏 ---------------- */
.footer {
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px clamp(16px, 4vw, 32px); font-size: 13px; color: var(--text-3);
}
.footer .lock { display: inline-flex; align-items: center; gap: 6px; }
.foot-mid { font-size: 12.5px; }
#footer-name { font-weight: 700; color: var(--text-2); }

/* ---------------- 对话框 ---------------- */
dialog {
  border: none; border-radius: 20px; padding: 0;
  background: var(--card); color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
  width: min(440px, calc(100vw - 40px));
}
dialog::backdrop { background: rgba(10, 13, 26, .5); backdrop-filter: blur(3px); }
.dialog-head { padding: 20px 22px 0; font-size: 16px; font-weight: 700; }
.dialog-body { padding: 14px 22px 22px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.new-key-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 10px;
}
.new-key-box code { flex: 1; font-size: 15px; font-weight: 700; letter-spacing: .5px; color: var(--accent); }

/* ============================================================
   管理后台
   ============================================================ */
.manage-shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: 228px; flex: none; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 2px 8px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; cursor: pointer; border: none; background: none;
  font-size: 14px; color: var(--text-2); font-family: inherit; text-align: left; width: 100%;
  margin-bottom: 2px; transition: all .12s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .side-foot { margin-top: auto; padding: 10px 8px 0; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border-2); }

.manage-main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.manage-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.manage-top h1 { font-size: 20px; margin: 0; font-weight: 800; }
.manage-top .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card .num { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat-card .lbl { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.stat-card.accent .num { color: var(--accent); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15.5px; margin: 0; font-weight: 700; }
.panel-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-tools .input, .panel-tools select.input { width: auto; padding: 7px 10px; font-size: 13.5px; border-radius: 10px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.form-grid .field { margin-bottom: 0; }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-xs { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; width: auto; }
.btn-danger { background: var(--error-soft); color: var(--error); border: 1px solid var(--error-border); width: auto; }
.btn-ok { background: var(--success-soft); color: var(--success); border: 1px solid var(--success-border); width: auto; }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--text-3); }
.pager .btn-xs { background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border); }
.pager .btn-xs:disabled { opacity: .45; cursor: not-allowed; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); position: relative; }
.login-card { width: min(380px, calc(100vw - 40px)); background: var(--card); border-radius: 24px; box-shadow: var(--shadow-md); padding: 34px 30px; border: 1px solid var(--border); }
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card .login-tip { text-align: center; color: var(--text-3); font-size: 13px; margin: 0 0 22px; }

.empty { text-align: center; color: var(--text-3); padding: 34px 0; font-size: 13.5px; }
.key-list-box { max-height: 300px; overflow: auto; background: var(--bg-soft); border-radius: 12px; padding: 12px 14px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.9; color: var(--text-2); user-select: all; }

/* 响应式 */
@media (max-width: 860px) {
  .nav-links { gap: 2px; }
  .nav-link { padding: 8px 10px; font-size: 13.5px; }
  .sidebar { display: none; }
  .manage-shell { display: block; }
}
.manage-topbar-m { display: none; }
@media (max-width: 860px) {
  .manage-topbar-m {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
    background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  }
  .m-nav { display: flex; gap: 4px; overflow-x: auto; }
  .m-nav .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; }
}

/* —— 通用消息弹窗（替代原生 alert/confirm）—— */
#ck-msg-dialog .ck-msg-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.7; color: var(--text);
  max-height: 52vh; overflow-y: auto;
}
#ck-msg-dialog::before {
  content: ''; display: block; height: 4px;
  border-radius: 20px 20px 0 0; background: var(--info);
}
#ck-msg-dialog.k-success::before { background: var(--success); }
#ck-msg-dialog.k-error::before { background: var(--error); }
#ck-msg-dialog.k-warn::before { background: var(--warn); }
#ck-msg-dialog.k-success .dialog-head { color: var(--success); }
#ck-msg-dialog.k-error .dialog-head { color: var(--error); }
#ck-msg-dialog.k-warn .dialog-head { color: var(--warn); }
#ck-msg-dialog .dialog-actions .btn { width: auto; min-width: 96px; }
#ck-msg-dialog .dialog-head { display: flex; align-items: center; }
#ck-msg-dialog.ck-wide { width: min(640px, calc(100vw - 32px)); }
#ck-msg-dialog .dialog-actions { flex-wrap: wrap; justify-content: flex-end; }
#ck-msg-dialog .dialog-actions .btn { width: auto; min-width: 88px; }
#ck-msg-dialog .ck-msg-usage { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-2); }
#ck-msg-dialog .ck-msg-usage div { padding: 2px 0; font-size: 13px; color: var(--text-2); }

/* —— 弹窗统一加大加宽 —— */
dialog {
  width: min(680px, calc(100vw - 40px));
  border-radius: 22px;
}
#dlg-order, #dlg-generate { width: min(760px, calc(100vw - 40px)); }
.dialog-head { padding: 22px 26px 4px; font-size: 17px; }
.dialog-body { padding: 16px 26px 24px; }
.dialog-actions { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border-2); gap: 12px; }
.dialog-actions .btn { min-width: 104px; min-height: 38px; font-size: 14px; }
#ck-msg-dialog .dialog-head { padding: 20px 24px 2px; }
#ck-msg-dialog .dialog-body { padding: 12px 24px 20px; }
#ck-msg-dialog .ck-msg-text { font-size: 14.5px; line-height: 1.8; }
#ck-msg-dialog .ck-chip { min-width: 104px; min-height: 42px; font-size: 14px; }
#ck-msg-dialog .ck-chip.ck-sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* —— 需要安全验证的结果卡（琥珀色）—— */
.result-warn { background: var(--warn-soft); border-color: var(--warn-border); }
.result-warn .result-icon { background: var(--warn); color: #fff; }
.result-warn h3 { color: var(--warn); }

/* —— 卡池状态：本轮已充值（蓝）—— */
.chip-blue { background: var(--info-soft); color: var(--info); }





/* —— Cloudflare Turnstile 官方组件容器 —— */
.ts-cf-holder { min-height: 28px; display: flex; align-items: center; }
.ts-cf-holder:empty { display: none; }

/* —— Cloudflare 模式下：只显示官方组件，隐藏自定义验证 UI —— */
.turnstile.cf-mode {
  border: none; background: transparent; padding: 0; height: auto;
  min-height: 65px; cursor: default; align-items: center;
}
html.dark .turnstile.cf-mode { background: transparent; }
.turnstile.cf-mode:hover { border-color: transparent; }
.turnstile.cf-mode .ts-check,
.turnstile.cf-mode .ts-label,
.turnstile.cf-mode .ts-brand { display: none !important; }
.turnstile.cf-mode .ts-cf-holder { display: flex !important; }
