/* ==========================================================================
   雅信物业预存营销系统 · 后台管理样式
   无构建、无 CDN，直接 <link> 引入。所有颜色走 CSS 变量，便于换肤。
   ========================================================================== */

:root {
  --bg:        #f3f5fa;
  --panel:     #ffffff;
  --panel-2:   #fafbfe;
  --line:      #e5e9f2;
  --line-2:    #eef1f7;
  --text:      #1f2937;
  --text-2:    #4b5563;
  --muted:     #8c95a6;
  --primary:   #3b6ef6;
  --primary-d: #2b57d0;
  --primary-l: #eaf0ff;
  --ok:        #12a150;
  --ok-l:      #e6f7ee;
  --warn:      #d97706;
  --warn-l:    #fef3e2;
  --danger:    #dc2626;
  --danger-l:  #fdeaea;
  --side:      #1b2130;
  --side-2:    #232b3d;
  --side-a:    #2f3a52;
  --radius:    10px;
  --radius-s:  6px;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --shadow-l:  0 8px 32px rgba(16,24,40,.16);
  --mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[v-cloak] { display: none !important; }

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #2b3a63 0%, #1b2130 60%, #141926 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--panel); border-radius: 16px;
  padding: 36px 32px 30px; box-shadow: var(--shadow-l);
}
.login-logo {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(135deg, #f97316, #ef4444); color: #fff;
  box-shadow: 0 6px 18px rgba(239,68,68,.32);
}
.login-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.login-sub   { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-tip   { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.7; }

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

.side {
  width: 220px; flex: none; background: var(--side); color: #c7cedd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand .mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: linear-gradient(135deg, #f97316, #ef4444); color: #fff;
}
.side-brand b { color: #fff; font-size: 13.5px; letter-spacing: 0; }
.side-brand small { display: block; color: #7d879c; font-size: 11px; font-weight: 400; }

.side-nav { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.side-group { padding: 14px 18px 6px; font-size: 11px; color: #6a7488; letter-spacing: 1px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; cursor: pointer;
  font-size: 13.5px; border-left: 3px solid transparent; transition: .15s;
}
.side-item:hover { background: var(--side-2); color: #fff; }
.side-item.active { background: var(--side-a); color: #fff; border-left-color: var(--primary); font-weight: 600; }
.side-item .ico { width: 16px; text-align: center; opacity: .9; }
.side-item .dot {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px;
}

/* ---------------------------------------------------------------- 主体 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px; flex: none; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .page-title small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .act-picker { display: flex; align-items: center; gap: 8px; }
.topbar .act-picker label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
/* 右上角账号菜单：修改密码 / 退出登录 */
.who {
  position: relative; display: flex; align-items: center;
  padding-left: 14px; border-left: 1px solid var(--line);
}
.who-btn {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 9px; cursor: pointer; user-select: none; transition: background .15s;
}
.who-btn:hover, .who-btn.open { background: var(--panel-2); }
.who .ava {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary-l); color: var(--primary-d);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
}
.who b { font-size: 13px; font-weight: 600; }
.who-btn .caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted); transition: transform .15s;
}
.who-btn.open .caret { transform: rotate(180deg); }

/* 透明遮罩：点任意处收起菜单（层叠顺序：遮罩 30 < 菜单 31） */
.who-mask { position: fixed; inset: 0; z-index: 30; }
.who-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 31;
  min-width: 158px; padding: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px -10px rgba(16,24,40,.28), 0 2px 6px rgba(16,24,40,.06);
}
.who-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; border-radius: 7px; background: none;
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.who-menu button:hover { background: var(--panel-2); }
.who-menu button.danger { color: var(--danger); }
.who-menu button.danger:hover { background: var(--danger-l); }

.content { padding: 20px; flex: 1; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-2); background: var(--panel-2);
}
.card-hd h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-hd .spacer { flex: 1; }
.card-bd { padding: 16px; }
.card-bd.tight { padding: 0; }

/* ---------------------------------------------------------------- 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 62px; height: 62px;
  border-radius: 50%; background: var(--primary-l); opacity: .55;
}
.stat .lbl { color: var(--muted); font-size: 12.5px; position: relative; z-index: 1; }
.stat .val { font-size: 26px; font-weight: 700; margin-top: 6px; position: relative; z-index: 1; letter-spacing: -.5px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }
.stat.ok::after    { background: var(--ok-l); }
.stat.warn::after  { background: var(--warn-l); }
.stat.danger::after{ background: var(--danger-l); }
.stat.ok .val    { color: var(--ok); }
.stat.warn .val  { color: var(--warn); }
.stat.danger .val{ color: var(--danger); }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl th {
  background: var(--panel-2); color: var(--text-2); font-weight: 600; font-size: 12.5px;
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl tbody tr:hover { background: #f8fafd; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.ctr, table.tbl th.ctr { text-align: center; }
table.tbl td.mono { font-family: var(--mono); font-size: 12.5px; }
table.tbl .sub { color: var(--muted); font-size: 12px; display: block; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty .big { font-size: 30px; opacity: .35; display: block; margin-bottom: 8px; }
.loading-line { padding: 34px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
  padding: 7px 14px; border-radius: var(--radius-s); font-size: 13px; cursor: pointer;
  transition: .15s; white-space: nowrap; font-family: inherit;
}
.btn:hover:not(:disabled) { border-color: #c8d2e6; background: #f7f9fd; color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f2c6c6; background: #fff; }
.btn.danger:hover:not(:disabled) { background: var(--danger-l); color: var(--danger); }
.btn.ok { color: var(--ok); border-color: #bfe6d0; background: #fff; }
.btn.ok:hover:not(:disabled) { background: var(--ok-l); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.xs { padding: 2px 7px; font-size: 11.5px; border-radius: 5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: #f0f3f9; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 2px 5px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-row { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* ---------------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.inp, select.inp, textarea.inp {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 11px; border-radius: var(--radius-s); font-size: 13.5px; font-family: inherit;
  transition: .15s; outline: none;
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,246,.12); }
.inp:disabled { background: #f5f7fb; color: var(--muted); }
select.inp { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%238c95a6' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea.inp { resize: vertical; min-height: 66px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.err-text { color: var(--danger); font-size: 12.5px; margin-top: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin-bottom: 0; }
.filters .inp { min-width: 140px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 780px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 38px; height: 21px; border-radius: 11px; background: #cfd7e6; position: relative; transition: .18s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { left: 19px; }

/* ---------------------------------------------------------------- 徽标 */
.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; line-height: 1.7;
}
.badge.gray   { background: #eef1f7; color: var(--text-2); }
.badge.blue   { background: var(--primary-l); color: var(--primary-d); }
.badge.green  { background: var(--ok-l); color: var(--ok); }
.badge.orange { background: var(--warn-l); color: var(--warn); }
.badge.red    { background: var(--danger-l); color: var(--danger); }
.badge.gray-o { background: #fff; border: 1px solid var(--line); color: var(--muted); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.chip.wait  { border-color: #f3d9a8; background: var(--warn-l); }
.chip.given { border-color: #bfe6d0; background: var(--ok-l); }
.chip.void  { border-color: #e6e9f0; background: #f2f4f8; }

.tips { display: flex; flex-direction: column; gap: 3px; }
.tip { font-size: 12px; color: var(--warn); display: flex; gap: 5px; align-items: flex-start; }
.tip::before { content: '!'; flex: none; width: 14px; height: 14px; line-height: 14px; text-align: center;
  background: var(--warn); color: #fff; border-radius: 50%; font-size: 10px; font-weight: 700; margin-top: 2px; }

/* ---------------------------------------------------------------- 进度 */
.pbar { height: 6px; border-radius: 4px; background: #e9edf5; overflow: hidden; min-width: 70px; }
.pbar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #5b8cf8, #3b6ef6); transition: width .4s; }
.pbar.green > i { background: linear-gradient(90deg, #34c17b, #12a150); }
.pbar.orange > i { background: linear-gradient(90deg, #f5b544, #d97706); }
.pbar.red > i { background: linear-gradient(90deg, #f07171, #dc2626); }
.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.progress-cell span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- 走势图（纯 CSS 柱） */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px 4px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b i { width: 100%; max-width: 34px; background: linear-gradient(180deg, #6f9bfa, #3b6ef6); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .4s; }
.bars .b.zero i { background: #e5e9f2; }
.bars .b em { font-size: 11px; color: var(--muted); font-style: normal; margin-top: 5px; white-space: nowrap; transform: scale(.9); }
.bars .b u { font-size: 11px; color: var(--text-2); text-decoration: none; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hbar .nm { width: 110px; flex: none; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1; height: 18px; background: #f0f3f9; border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, #7fa6fa, #3b6ef6); border-radius: 5px; min-width: 2px; }
.hbar .vl { width: 52px; flex: none; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ---------------------------------------------------------------- 九宫格预览 */
.gp-wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.gp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; width: 306px; flex: none; }
.gp-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid #f2d9bd;
  background: linear-gradient(180deg, #fffaf3, #fff3e3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px; text-align: center; overflow: hidden;
}
.gp-cell .n { font-size: 12px; color: #8a5a2b; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gp-cell .s { font-size: 10.5px; color: #b08a63; margin-top: 3px; }
.gp-cell.out { border-color: #f2d9bd; }
.gp-cell.out .n { color: #8a5a2b; }
.gp-cell.out .s { color: #b08a63; }
.gp-center { background: linear-gradient(135deg, #fb8c3c, #ef4444); border-color: #ef4444; color: #fff; }
.gp-center .n { color: #fff; font-size: 15px; letter-spacing: 1px; }
.gp-legend { flex: 1; min-width: 220px; font-size: 12.5px; color: var(--text-2); }
.gp-legend li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(20,26,38,.5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.dlg {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-l); width: 100%;
  max-width: 560px; overflow: hidden; animation: pop .16s ease-out;
}
.dlg.wide { max-width: 860px; }
.dlg.mini { max-width: 420px; }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-hd { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.dlg-hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.dlg-hd .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; background: none; border: none; }
.dlg-hd .x:hover { color: var(--text); }
.dlg-bd { padding: 18px; max-height: 66vh; overflow-y: auto; }
.dlg-ft { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--line-2); background: var(--panel-2); }
.dlg-ft { flex-wrap: wrap; }
.dlg-ft .spacer { flex: 1; }

/* ---------------------------------------------------------------- 外部房号源弹窗（S6） */
.dlg.xwide { max-width: 1080px; }

.ext-hd { display: flex; align-items: center; margin-bottom: 10px; }

.ext-stat { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.ext-stat .s {
  flex: 1 1 120px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 8px 11px;
}
.ext-stat .s.w2 { flex: 1 1 210px; }
.ext-stat .s b { display: block; font-size: 15px; line-height: 1.4; }
.ext-stat .s span { font-size: 11.5px; color: var(--muted); }
.ext-stat .s span.bad { color: var(--danger); font-weight: 600; }

.fsec {
  font-size: 12.5px; font-weight: 600; color: var(--primary-d);
  margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center;
}

.note {
  background: var(--primary-l); border: 1px solid #d6e2ff; color: var(--primary-d);
  border-radius: var(--radius-s); padding: 8px 11px; font-size: 12.5px; line-height: 1.7;
  margin: 8px 0;
}
.note.warn { background: var(--warn-l); border-color: #f6ddb8; color: var(--warn); }
.note.bad  { background: var(--danger-l); border-color: #f6c9c9; color: var(--danger); }

textarea.inp.ta { font-size: 12.5px; line-height: 1.65; }
textarea.inp.mono, input.inp.mono { font-family: var(--mono); }

.dlg-bd code {
  font-family: var(--mono); font-size: 12px; background: #eef1f7;
  padding: 1px 5px; border-radius: 4px; color: #334155;
}
.cell-bad { color: var(--danger); }

/* ---------------------------------------------------------------- 提示 */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  background: #232b3d; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 13.5px;
  box-shadow: var(--shadow-l); display: flex; align-items: center; gap: 8px; animation: pop .16s ease-out; max-width: 520px;
}
.toast.ok    { background: #0f8a45; }
.toast.err   { background: #c81e1e; }
.toast.warn  { background: #b45309; }
.toast.info  { background: #2b3a63; }

/* ---------------------------------------------------------------- 上传区 */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px 16px; text-align: center;
  background: var(--panel-2); cursor: pointer; transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-l); }
.drop .big { font-size: 28px; opacity: .5; display: block; margin-bottom: 6px; }
.drop b { display: block; font-size: 14px; margin-bottom: 4px; }
.drop small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- 分页 */
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .info { color: var(--muted); font-size: 12.5px; }
.pager .spacer { flex: 1; }
.pager .pg { display: flex; gap: 4px; align-items: center; }
.pager .pg button {
  min-width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 12.5px; color: var(--text-2); font-family: inherit;
}
.pager .pg button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager .pg button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pg button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- 其他 */
.row-2 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.flex1 { flex: 1; }
.sel-bar { padding: 4px 12px; font-size: 11.5px; color: var(--muted); }
input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
code.k { background: #f1f4fa; padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12px; color: var(--primary-d); }
.err-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.err-tbl th, .err-tbl td { padding: 6px 9px; border-bottom: 1px solid var(--line-2); text-align: left; }
.err-tbl th { background: var(--panel-2); color: var(--text-2); }
.scroll-y { max-height: 240px; overflow-y: auto; }

/* ---- 加载旋转 ---- */
@keyframes lt-spin { to { transform: rotate(360deg); } }
.spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid #d7dfee; border-top-color: var(--primary); border-radius: 50%;
  animation: lt-spin .7s linear infinite;
}
.lt-row { display: flex; align-items: center; gap: 8px; }
.ov-scroll { overflow-x: auto; }
.tbl.mini th, .tbl.mini td { padding: 5px 8px; font-size: 12.5px; }
.gp-cell.pick { outline: 2px solid var(--primary); outline-offset: -1px; }
.gp-cell .sortno { position: absolute; top: 2px; left: 5px; font-size: 9.5px; opacity: .45; }
.gp-cell { position: relative; }
.dim { opacity: .45; }
.ell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* ==========================================================================
   礼品类型：类型选择 / 金额档 / 券码图片包
   ========================================================================== */

/* ---- 类型三选一 ---- */
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-opt {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  background: #fff; cursor: pointer; transition: .15s;
}
.type-opt:hover { border-color: var(--primary); }
.type-opt.on { border-color: var(--primary); background: var(--primary-l); box-shadow: 0 0 0 1px var(--primary) inset; }
.type-opt .t { font-weight: 500; font-size: 13px; }
.type-opt .d { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.type-opt.lock { cursor: not-allowed; opacity: .55; }
.type-opt.lock:hover { border-color: var(--line); }

/* ---- 礼品图片预览 ---- */
.img-prev { display: flex; align-items: center; gap: 10px; }
.img-prev img {
  width: 58px; height: 58px; flex: none; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: #f2f4f8;
}
.img-prev .ph {
  width: 58px; height: 58px; flex: none; border-radius: 8px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px;
}

/* ---- 券码上传区 ---- */
.up-bar {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1px dashed #cfd7e6; border-radius: var(--radius);
  background: var(--panel-2); cursor: pointer; transition: .15s;
}
.up-bar:hover { border-color: var(--primary); background: var(--primary-l); }
.up-bar.over  { border-color: var(--ok); background: var(--ok-l); }
.up-bar.busy  { cursor: progress; opacity: .9; }
.up-bar .t1 { font-weight: 500; }
.up-bar .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.up-progress { height: 6px; border-radius: 3px; background: #e3e8f2; overflow: hidden; margin-top: 10px; }
.up-progress i { display: block; height: 100%; background: var(--ok); transition: width .2s; }

/* ---- 券码缩略图网格 ---- */
.code-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px; max-height: 44vh; overflow: auto; padding: 4px; margin-top: 10px;
}
.code-cell { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.code-cell img { display: block; width: 100%; height: 82px; object-fit: cover; background: #f2f4f8; }
.code-cell .lb {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; font-size: 12px; font-family: var(--mono);
}
.code-cell.used img { filter: grayscale(.9); opacity: .55; }
.code-cell .del {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0;
  border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
  line-height: 1; font-size: 13px; padding: 0;
}
.code-cell .del:hover { background: var(--danger); }
.tagp { font-size: 11px; padding: 1px 7px; border-radius: 20px; font-family: inherit; }
.tagp.free { background: var(--ok-l); color: var(--ok); }
.tagp.used { background: #eef1f7; color: var(--muted); }

/* ---- 金额档 ---- */
.tier-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.stat-line { font-size: 12.5px; color: var(--text-2); }
.stat-line b { color: var(--text); }

/* ==========================================================================
   台账里的券码缩略图 / 大图查看
   ========================================================================== */
.rec-thumb {
  display: block; width: 46px; height: 30px; margin-top: 5px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 5px; cursor: zoom-in; background: #f2f4f8;
}
.rec-code {
  display: block; max-width: 260px; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 10px; cursor: zoom-in; background: #f2f4f8;
}
.zoom-veil {
  position: fixed; inset: 0; z-index: 80; background: rgba(20, 12, 6, .86);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; cursor: zoom-out;
}
.zoom-veil img {
  max-width: 90vw; max-height: 74vh; border-radius: 12px;
  background: #fff; box-shadow: var(--shadow-l);
}
