/* ============================================================================
   发财券会员管理系统 · 设计系统 v2（商业级后台）
   原则：中性底色 + 单一强调色 + 语义色只用于数据；1px 描边而非重阴影；
        小圆角、紧凑排版、等宽数字、无装饰性渐变与 emoji。
   自动适配深色模式。
   ============================================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

:root {
  color-scheme: light dark;

  /* 中性 */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f6;
  --line: #e5e7ec;
  --line-2: #eef0f4;
  --text: #12151a;
  --text-2: #4a5262;
  --muted: #8b93a3;
  --muted-2: #a6adba;

  /* 强调色（品牌深红，仅用于交互） */
  --accent: #b3261e;
  --accent-hover: #94201a;
  --accent-soft: #fdeceb;
  --accent-line: #f3cfcb;

  /* 语义色（仅用于数据与状态） */
  --pos: #0f7b52;  --pos-soft: #e9f5f0;
  --neg: #b3261e;  --neg-soft: #fdeceb;
  --warn: #96601a; --warn-soft: #fdf4e6;
  --gold: #8a6100; --gold-soft: #fdf7e6;
  --info: #1f5fa8; --info-soft: #ecf2fb;

  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --bar: var(--surface);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #161a1f;
    --surface-2: #1b2026;
    --surface-3: #22272e;
    --line: #272d35;
    --line-2: #20252c;
    --text: #e9ecf1;
    --text-2: #b3bbc6;
    --muted: #828b98;
    --muted-2: #6d7683;
    --accent: #e05a51;
    --accent-hover: #ef6b62;
    --accent-soft: rgba(224, 90, 81, .14);
    --accent-line: rgba(224, 90, 81, .3);
    --pos: #35c48c;  --pos-soft: rgba(53, 196, 140, .14);
    --neg: #e05a51;  --neg-soft: rgba(224, 90, 81, .14);
    --warn: #d9a441; --warn-soft: rgba(217, 164, 65, .14);
    --gold: #d9b054; --gold-soft: rgba(217, 176, 84, .14);
    --info: #6aa5e8; --info-soft: rgba(106, 165, 232, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 14px 36px rgba(0, 0, 0, .55);
    --bar: var(--surface);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: padding-box; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.mono { font-variant-numeric: tabular-nums; }
.text-ok { color: var(--pos); }
.text-danger { color: var(--neg); }
.text-warn { color: var(--warn); }
.text-muted { color: var(--muted); }
.text-strong { font-weight: 600; }

.ic { flex: none; display: inline-block; vertical-align: -2px; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 12px;
}
.card.tight { padding: 12px 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title {
  font-size: 14px; font-weight: 600; letter-spacing: -.1px; margin: 0 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.card-title .more { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.section-title {
  margin: 18px 16px 8px; font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .4px;
}
.group-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 4px 0 10px; }

/* ============================ KPI ============================ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 15px;
}
.kpi .top { display: flex; align-items: center; gap: 8px; }
.kpi .ico {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2);
}
.kpi .ico svg { width: 15px; height: 15px; }
.kpi .ico.accent { background: var(--accent-soft); color: var(--accent); }
.kpi .ico.green { background: var(--pos-soft); color: var(--pos); }
.kpi .ico.red { background: var(--neg-soft); color: var(--neg); }
.kpi .ico.gold { background: var(--gold-soft); color: var(--gold); }
.kpi .ico.blue { background: var(--info-soft); color: var(--info); }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v {
  font-size: 25px; font-weight: 650; letter-spacing: -.6px; margin-top: 10px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; gap: 10px; margin-top: 7px; min-height: 17px; }
.kpi .delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.kpi .delta.up { color: var(--pos); }
.kpi .delta.down { color: var(--neg); }
.kpi .delta svg { width: 13px; height: 13px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .spark { height: 28px; margin-top: 6px; }

/* ============================ 图表 ============================ */
.chart-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 12px;
}
.chart-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chart-card .head h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; }
.chart-card .head .sub { font-size: 12px; color: var(--muted); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.chart-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.chart-tip {
  position: fixed; z-index: 400; pointer-events: none; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  box-shadow: var(--shadow-2); white-space: nowrap; opacity: 0; transition: opacity .1s ease;
  transform: translate(-50%, -112%);
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-weight: 600; }
.chart-tip .row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.chart-tip .row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-tip .row em { font-style: normal; color: var(--muted); margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }

/* 进度条 / 排行 / 环形 */
.bar-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width .35s ease; }
.hbar { display: flex; flex-direction: column; gap: 14px; }
.hbar-row { display: grid; grid-template-columns: minmax(104px, 1.15fr) 3fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hbar-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .who small { display: block; color: var(--muted); font-size: 11.5px; }
.hbar-row .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.hbar-row .num small { color: var(--muted); font-weight: 400; margin-left: 4px; }
@media (max-width: 640px) {
  .hbar-row { grid-template-columns: 1fr auto; grid-template-areas: "who num" "bar bar"; row-gap: 7px; column-gap: 10px; }
  .hbar-row .who { grid-area: who; }
  .hbar-row .bar-track { grid-area: bar; }
  .hbar-row .num { grid-area: num; }
}
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring-wrap .ring-text .big { font-size: 20px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.ring-wrap .ring-text .small { font-size: 12px; color: var(--muted); }

/* ============================ 统计格子 ============================ */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 13px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 19px; font-weight: 650; margin-top: 4px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .v.green { color: var(--pos); }
.stat .v.red { color: var(--neg); }
.stat .v.brand, .stat .v.blue { color: var(--accent); }

/* ============================ 列表 ============================ */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px; overflow: hidden; }
.list .item { border-bottom: 1px solid var(--line-2); }
.list .item:last-child { border-bottom: none; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.item .desc { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amt { font-size: 14.5px; font-weight: 650; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .amt.plus { color: var(--pos); }
.item .amt.minus { color: var(--neg); }
.item .amt .qty { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }

.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex: none; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2);
}
.avatar.plus { background: var(--pos-soft); color: var(--pos); }
.avatar.minus { background: var(--neg-soft); color: var(--neg); }
.avatar.gold { background: var(--gold-soft); color: var(--gold); }
.avatar.accent { background: var(--accent-soft); color: var(--accent); }

/* ============================ 徽标 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 18px;
  padding: 0 7px; border-radius: 5px; font-weight: 550; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge.green { background: var(--pos-soft); color: var(--pos); }
.badge.red { background: var(--neg-soft); color: var(--neg); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.orange { background: var(--warn-soft); color: var(--warn); }
.badge.purple { background: var(--info-soft); color: var(--info); }
.badge.gray { background: var(--surface-3); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ============================ 表单 ============================ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:hover { border-color: #d8dbe2; }
@media (prefers-color-scheme: dark) { .input:hover { border-color: #333a44; } }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
select.input {
  appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238b93a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
textarea.input { height: auto; min-height: 68px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550;
  font-family: inherit; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--surface-3); }
.btn:active { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: var(--surface); }
.btn.danger { background: var(--surface); color: var(--neg); border-color: var(--accent-line); }
.btn.danger:hover { background: var(--neg-soft); }
.btn.green { background: var(--surface); color: var(--pos); border-color: var(--line); }
.btn.green:hover { background: var(--pos-soft); }
.btn.block { display: flex; width: 100%; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.icon-only { width: 34px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn.primary:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }
.btn-link { background: none; border: none; padding: 0 2px; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* ============================ 分段控件 ============================ */
.seg {
  display: inline-flex; padding: 2px; border-radius: var(--radius-sm); gap: 2px;
  background: var(--surface-3); border: 1px solid var(--line-2);
}
.seg > button {
  border: none; background: none; font-family: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--text-2); padding: 0 12px; height: 26px; border-radius: 6px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.seg > button:hover { color: var(--text); }
.seg > button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.seg.full { display: flex; }
.seg.full > button { flex: 1; }

/* 页签（下划线式） */
.tabs { display: flex; gap: 20px; overflow-x: auto; padding: 0 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab {
  flex: none; position: relative; padding: 11px 0; font-size: 13px; cursor: pointer; color: var(--muted);
  background: none; border: none; font-family: inherit; font-weight: 500; white-space: nowrap;
}
.tabs .tab.on { color: var(--text); font-weight: 600; }
.tabs .tab.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

/* ============================ 分页 ============================ */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-size: 12.5px; color: var(--muted); }
.pager button {
  height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12.5px; color: var(--text);
  font-family: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line);
}
.pager button:hover:not(:disabled) { background: var(--surface-3); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 状态 ============================ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; color: var(--muted); font-size: 12.5px; padding: 40px 16px;
}
.empty .big { color: var(--muted-2); display: block; }
.empty .big svg { width: 26px; height: 26px; }
.loading { text-align: center; color: var(--muted); padding: 22px; font-size: 12.5px; }
.loading::after {
  content: ""; display: block; width: 16px; height: 16px; margin: 10px auto 0; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============================ 键值 / 说明 ============================ */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { font-weight: 550; text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.tier-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.75; }
.hint b { color: var(--text-2); font-weight: 600; }
.confirm-text { margin: 0; font-size: 13.5px; line-height: 1.7; }

/* ============================ 轻提示 ============================ */
#toast-box { position: fixed; left: 0; right: 0; top: 16px; z-index: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; max-width: 84vw;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--text-2);
  box-shadow: var(--shadow-2); animation: toastIn .18s ease;
}
.toast.ok { border-left-color: var(--pos); }
.toast.err { border-left-color: var(--neg); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ============================ 登录页（PC / H5 共用结构） ============================ */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-box {
  width: 384px; max-width: 100%; padding: 26px 26px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2);
}
.login-box .logo-lg {
  width: 38px; height: 38px; border-radius: 9px; color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px; background: var(--accent);
}
.login-box h1 { font-size: 19px; margin: 0 0 6px; letter-spacing: -.3px; }
.login-box .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.login-role {
  display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 5px; padding: 2px 8px; margin-bottom: 12px;
}
.login-box .btn[type=submit] { height: 38px; margin-top: 4px; }
.login-foot { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.8; }

/* ============================ 分享入口（二维码） ============================ */
.share-card { display: flex; flex-direction: column; gap: 14px; }
.share-card-head { display: flex; align-items: center; gap: 10px; }
.share-card-head .ico-box {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.share-card-head b { font-size: 14.5px; }
.share-card-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.share-card-head .badge { margin-left: auto; }
.share-body { display: flex; gap: 18px; align-items: flex-start; }
/* 二维码必须保持纯白底 + 静默区，深色模式下也不改 */
.qr-wrap {
  padding: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); line-height: 0; flex: none;
}
.qr-wrap img, .qr-wrap svg { display: block; width: 168px; height: 168px; }
.share-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.share-url { font-size: 12.5px; }
.share-steps { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 2; }
.share-steps li::marker { color: var(--muted); }
.share-note { display: flex; gap: 8px; align-items: flex-start; }
.share-note svg { flex: none; margin-top: 2px; color: var(--warn); }
@media (max-width: 720px) {
  .share-body { flex-direction: column; align-items: stretch; }
  .qr-wrap { align-self: center; }
  .qr-wrap img, .qr-wrap svg { width: 220px; height: 220px; }
}

/* 打印：只留内容与二维码，导航/按钮/输入框全部去掉，二维码放大到好扫的尺寸 */
@media print {
  .sidebar, .tabbar, .topbar, .main-top, .btns, .btn, .btn-row, .pager, .no-print { display: none !important; }
  body, .page, .content, .main { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .layout { display: block !important; }
  .grid { display: block !important; }
  .card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #cccccc; margin-bottom: 14px; }
  .qr-wrap { border: 1px solid #cccccc; }
  .qr-wrap img, .qr-wrap svg { width: 300px !important; height: 300px !important; }
}

/* ============================ 弹层 ============================ */
.modal-mask { position: fixed; inset: 0; z-index: 400; background: rgba(16, 20, 28, .38); animation: maskIn .15s ease; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  display: flex; flex-direction: column; max-height: 88vh; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.1px; }
.modal-close {
  border: none; cursor: pointer; width: 26px; height: 26px; border-radius: 7px; background: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
