:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #10172a;
  --ink-2: #475569;
  --ink-3: #8792a8;
  --line: #e6eaf2;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef0ff;
  --success: #059669;
  --success-soft: #e7f8f1;
  --warn: #b45309;
  --warn-soft: #fdf3e4;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #4338ca; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-sm { font-size: 12.5px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ---------- 布局 ---------- */
.app-layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(120% 80% at 0% 0%, #1b2544 0%, #0d1425 55%, #0a0f1c 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 60;
  transition: transform .22s ease;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .32); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  margin-bottom: 16px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  letter-spacing: .5px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}

.brand-text { min-width: 0; }
.brand-text strong { display: block; color: #fff; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 11px; color: #64748b; letter-spacing: .08em; }

.nav-group { margin-bottom: 4px; }
.nav-group-title { font-size: 11px; color: #5b6b8c; letter-spacing: .12em; padding: 12px 10px 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  color: #aab6cc;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(148, 163, 184, .09); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .25);
}
.nav-item.active .icon { color: #a5b4fc; }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; background: rgba(148, 163, 184, .16); padding: 1px 7px; border-radius: 20px; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, .14); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: rgba(99, 102, 241, .2); color: #c7d2fe;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
}
.user-mini .name { color: #e2e8f0; font-size: 13px; line-height: 1.3; }
.user-mini .role { color: #64748b; font-size: 11px; }
.user-mini .logout { margin-left: auto; color: #8b9ab5; display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.user-mini .logout:hover { background: rgba(148, 163, 184, .14); color: #fff; }

.main { padding-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: rgba(244, 246, 251, .82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
}

.menu-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
}

.page-title { font-size: 15px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--brand); border-color: #c7d2fe; }

.content { padding: 22px 24px 40px; flex: 1; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; }
.page-desc { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230, 234, 242, .8); overflow: hidden; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { color: var(--ink-3); font-size: 12.5px; }
.card-body { padding: 20px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: 1.6fr 1fr; align-items: start; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid rgba(230, 234, 242, .9); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 76px; height: 76px; border-radius: 50%; background: var(--brand-soft); opacity: .7; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat-label { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.stat.green .stat-icon { background: var(--success-soft); color: var(--success); }
.stat.green::after { background: var(--success-soft); }
.stat.amber .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat.amber::after { background: var(--warn-soft); }
.stat.red .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat.red::after { background: var(--danger-soft); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-hint { display: none; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12px; color: var(--ink-3); background: #fbfcfe; border-bottom: 1px solid var(--line); }
.table-hint .icon { width: 14px; height: 14px; }
table.table { width: 100%; border-collapse: collapse; min-width: 600px; }
table.table.table-wide { min-width: 1000px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #fafbfe; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.table tbody tr:hover { background: #fbfcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td { font-size: 13px; line-height: 1.45; }
/* 操作列：始终横向一行显示（PC 与移动端一致），超出时随表格横向滚动而非纵向换行 */
.table .actions { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; justify-content: flex-start; }
.table .actions .btn { flex: 0 0 auto; white-space: nowrap; min-width: 0; }
.table td.cell-actions { white-space: nowrap; }
/* 操作列内按钮更紧凑，避免一行过长 */
.table td.cell-actions .btn { height: 28px; padding: 0 9px; font-size: 12px; }
.table td.cell-actions .btn .icon { width: 13px; height: 13px; }
.table .sub { display: block; color: var(--ink-3); font-size: 11px; line-height: 1.3; margin-top: 1px; }
.table .cell-app { white-space: nowrap; min-width: 96px; }
.table .app-name { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .remark-cell { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table th.check, .table td.check { width: 40px; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.st-unused { background: #eef2f7; color: #475569; }
.st-active { background: var(--success-soft); color: var(--success); }
.st-frozen { background: #eef2ff; color: #4338ca; }
.st-expired { background: var(--warn-soft); color: var(--warn); }
.st-disabled { background: var(--danger-soft); color: var(--danger); }
.badge-plain { background: #f1f5f9; color: var(--ink-2); }
.badge-soft { background: var(--brand-soft); color: var(--brand); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: #fff; color: var(--ink-2); border-color: var(--line);
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; color: var(--ink); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(79, 70, 229, .22); }
.btn-primary:hover { color: #fff; filter: brightness(1.03); border-color: transparent; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-soft:hover { background: #e4e7ff; color: var(--brand); }
.btn-xs { height: 26px; padding: 0 6px; font-size: 12px; border-radius: 8px; }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #fbdbdb; color: var(--danger); border-color: transparent; }
.btn-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .field .label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #dfe4ee; border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit;
  outline: 0; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.input[readonly] { background: #f4f6fb; color: var(--ink-2); border-color: #e6eaf2; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 220px; }
.help { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- 筛选栏 ---------- */
.filter-bar { padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; }
.filter-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filter-grid .field label { font-size: 11.5px; margin-bottom: 4px; color: var(--ink-3); }
.filter-actions { display: flex; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #f1f4fa; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 7px 14px; border-radius: 9px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 500; }

/* ---------- 提示 ---------- */
.alert-stack { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 11px; font-size: 13px; border: 1px solid; }
.flash.success { background: var(--success-soft); color: #047857; border-color: #b7e8d5; }
.flash.error { background: var(--danger-soft); color: #b91c1c; border-color: #f8cccc; }
.flash.info { background: var(--brand-soft); color: #4338ca; border-color: #d3d8ff; }
.flash .icon { width: 16px; height: 16px; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 8px; color: #c3cbdc; }
.empty p { margin: 4px 0 0; font-size: 13px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 20px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pager-info { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.page-btn { min-width: 32px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; background: #fff; }
.page-btn:hover { border-color: #c7d2fe; color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn.disabled { pointer-events: none; opacity: .45; }

/* ---------- 图表 ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; max-width: 42px; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #818cf8, #4f46e5); min-height: 3px; transition: height .3s; }
.bar-col.today .bar-fill { background: linear-gradient(180deg, #34d399, #059669); }
.bar-value { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.bar-label { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 登录 ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1100px 600px at 10% -10%, #e0e7ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ede9fe 0%, transparent 55%), #f6f7fb; }
.auth-shell { width: min(940px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(15, 23, 42, .12); }
.auth-aside { background: radial-gradient(120% 100% at 0% 0%, #312e81 0%, #1e1b4b 60%, #12102e 100%); color: #e0e7ff; padding: 42px 38px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(129, 140, 248, .35), transparent 65%); right: -80px; bottom: -90px; }
.auth-aside .auth-logo { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #818cf8, #c084fc); display: grid; place-items: center; font-weight: 700; color: #fff; }
.auth-aside h2 { font-size: 24px; line-height: 1.35; color: #fff; margin-top: 6px; }
.auth-aside p { color: #a5b4fc; font-size: 13px; line-height: 1.9; }
.auth-points { margin-top: auto; display: grid; gap: 10px; position: relative; z-index: 1; }
.auth-point { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: #c7d2fe; }
.auth-point .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.auth-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 21px; margin-bottom: 4px; }
.auth-form .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 24px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .btn { height: 44px; font-size: 14px; margin-top: 6px; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth-foot a { color: var(--brand); }
.auth-errors { margin-bottom: 14px; }

/* ---------- 公网页 ---------- */
.public-page { min-height: 100vh; padding: 28px 16px 48px; background: radial-gradient(900px 460px at 50% -10%, #e0e7ff 0%, transparent 60%), #f5f7fc; }
.public-top { max-width: 720px; margin: 0 auto 22px; display: flex; align-items: center; gap: 10px; }
.public-top .brand-logo { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
.public-top strong { font-size: 15px; }
.public-top nav { margin-left: auto; display: flex; gap: 8px; font-size: 13px; }
.public-card { max-width: 560px; margin: 0 auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .09); overflow: hidden; }
.public-card-head { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); }
.public-card-head h1 { font-size: 20px; }
.public-card-head p { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.public-card-body { padding: 24px 28px 30px; }
.public-card-body .field { margin-bottom: 16px; }
.result-box { border-radius: 14px; padding: 18px; background: #f8faff; border: 1px solid #e5e9f6; margin-bottom: 18px; }
.result-box.ok { background: var(--success-soft); border-color: #b7e8d5; }
.result-box.err { background: var(--danger-soft); border-color: #f8cccc; }
.result-box h3 { font-size: 15px; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv-4 { grid-template-columns: 104px 1fr 104px 1fr; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }
.batch-list { display: grid; gap: 8px; margin-bottom: 18px; }
.batch-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.batch-item.fail { background: #fdf7f7; border-color: #f8cccc; }
.batch-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-item-head .mono { font-size: 13px; word-break: break-all; }
.batch-item .kv-batch { grid-template-columns: 40px 1fr 44px 1fr; gap: 4px 8px; margin-top: 8px; font-size: 12px; }
.batch-item .kv-batch dd { word-break: break-word; }
.batch-item .fail-tip { margin-top: 6px; font-size: 12px; color: #b91c1c; }

/* ---------- 其他 ---------- */
.notice { display: flex; gap: 10px; padding: 13px 16px; border-radius: 12px; background: var(--brand-soft); color: #4338ca; font-size: 12.5px; line-height: 1.7; }
.notice .icon { flex: none; margin-top: 1px; }
.code { background: #f5f7fb; border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.split-list { display: grid; gap: 0; }
.setting-block { padding: 20px; border-bottom: 1px solid var(--line); }
.setting-block:last-child { border-bottom: 0; }
.setting-block h3 { font-size: 14px; margin-bottom: 4px; }
.setting-block .desc { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.batch-result { max-height: 460px; overflow: auto; }

.preview-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dropzone { border: 1.5px dashed #cfd7e8; border-radius: 12px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 12.5px; background: #fbfcff; }
.dropzone input[type=file] { margin-top: 8px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(8, 12, 24, .45); z-index: 55; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .stat-grid, .stat-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid, .filter-grid-4, .filter-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay { display: block; }
  body.nav-open { overflow: hidden; }
  .main { padding-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 14px; height: 58px; }
  .content { padding: 16px 14px 32px; }
  .page-head h1 { font-size: 19px; }
  .head-actions { width: 100%; margin-left: 0; }
  .stat-grid, .stat-grid-3, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 21px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-side { grid-template-columns: 1fr; }
  .filter-grid, .filter-grid-4, .filter-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-form { padding: 32px 24px; }
  .card-body, .setting-block { padding: 16px; }
  .toolbar { padding: 12px 14px; }
  .filter-bar { padding: 12px 14px; }
  .tabs { width: 100%; }
  .split-col + .split-col { margin-top: 16px; }
  .table .app-name { max-width: 150px; }
  .table .remark-cell { max-width: 140px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .table-hint { display: flex; }
}

@media (max-width: 560px) {
  .stat-grid, .stat-grid-3, .stat-grid-4 { grid-template-columns: 1fr 1fr; }
  .table-wide th:last-child,
  .filter-grid, .filter-grid-4, .filter-grid-5 { grid-template-columns: 1fr; gap: 8px; }
  .filter-bar { padding: 10px 12px; }
  .filter-grid .field label { font-size: 11px; margin-bottom: 3px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .input, .select, .textarea { font-size: 16px; padding: 9px 11px; }
  .btn { height: 40px; font-size: 13.5px; }
  .btn-sm { height: 34px; font-size: 13px; }
  .btn-xs { height: 26px; font-size: 12px; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .btn { flex: 1 1 auto; }
  .table .app-name { max-width: 120px; }
  .table .remark-cell { max-width: 110px; }
  .pager { padding: 12px 14px; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar-left, .toolbar-right { width: 100%; margin-left: 0; }
  .toolbar-right .btn { flex: 1; }
  .head-actions .btn { flex: 1; }
  .table th, .table td { padding: 8px 10px; }
  .public-card-head, .public-card-body { padding-left: 18px; padding-right: 18px; }
  .kv { grid-template-columns: 78px 1fr; }
  .kv-4 { grid-template-columns: 78px 1fr; }
  .chart-bars { gap: 5px; height: 140px; }
  .bar-label { font-size: 9.5px; }
}

/* 卡密点击复制 */
.copy-cell { border-bottom: 1px dashed rgba(0,0,0,.18); transition: color .15s, border-color .15s; }
.copy-cell:hover { color: var(--primary, #2563eb); border-bottom-color: var(--primary, #2563eb); }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  overflow: hidden;
  animation: modal-in .18s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 20px 6px;
  font-size: 16px;
  font-weight: 700;
  color: #1e2842;
  line-height: 1.4;
}

.modal-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.modal-icon svg { width: 16px; height: 16px; }

.modal-body {
  padding: 8px 20px 18px;
  font-size: 14px;
  line-height: 1.75;
  color: #47536b;
  max-height: 50vh;
  overflow-y: auto;
  word-break: break-word;
}

.modal-foot {
  padding: 0 20px 20px;
}

.modal-foot .btn { width: 100%; height: 42px; }

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.auth-aside .auth-logo img,
.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.logo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f3f5fa;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #94a0b8;
  overflow: hidden;
  flex: 0 0 auto;
}

.logo-upload-body { flex: 1 1 220px; min-width: 200px; }

.logo-upload-body input[type="file"] {
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: #64708a;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4b5875;
  margin-bottom: 10px;
}

.btn-delete {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-delete:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* ---------- 阶梯折扣编辑器 ---------- */
.tier-editor { display: grid; gap: 8px; }
.tier-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.tier-row .input { width: auto; flex: 1 1 0; min-width: 0; }
.tier-sep { color: var(--ink-3); flex: none; }
.tier-row .tier-del { flex: none; }
.bucket-list { display: grid; gap: 6px; }
.bucket-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; font-size: 12.5px; }
.bucket-item .bucket-discount { font-weight: 600; color: var(--brand); }
.bucket-item .bucket-bar { flex: 1; height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.bucket-item .bucket-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.bucket-item .bucket-amt { color: var(--ink-2); white-space: nowrap; }
