/* ============================================================
   国瓷臻选 · 管理端样式
   设计基调：深邃青花蓝 + 鎏金点缀 + 玻璃拟态
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* v2 象牙白主题：象牙白底 + 天空蓝 + 海青蓝 */
  --bg-0: #faf3ec;
  --bg-1: #fdf8f2;
  --bg-2: #fffcf7;
  --bg-3: #eaf4fb;
  --bg-4: #bfe0f2;

  --gold-1: #279aae;
  --gold-2: #2b8fcb;
  --gold-3: #1c4e8a;
  --gold-dim: rgba(39, 154, 174, 0.10);

  --text-1: #1c4e8a;
  --text-2: #3e8fbf;
  --text-3: #4fa8d8;

  --green: #2f8a6e;
  --red: #b4453c;
  --blue: #2b8fcb;
  --orange: #b4782a;
  --purple: #6c7bb5;

  --line: #e9e1d5;
  --line-soft: #f0e9de;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 20px rgba(28, 78, 138, 0.08);
  --glow-gold: 0 0 0 3px rgba(39, 154, 174, 0.12);
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}

/* 全局背景：青花蓝渐变 + 微光晕 */
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(79, 142, 247, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(201, 169, 110, 0.06), transparent 60%),
    var(--bg-0);
}

a { color: var(--gold-2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   布局骨架：左侧导航 + 右侧内容
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}

/* 品牌区 */
.brand {
  padding: 26px 22px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--bg-1); font-weight: 700;
  box-shadow: var(--glow-gold);
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: 2px; color: var(--gold-2); }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 1px; margin-top: 3px; }

/* 导航菜单 */
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group-title {
  font-size: 11px; color: var(--text-3);
  padding: 14px 12px 8px; letter-spacing: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: 0.85; }
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  color: var(--gold-2);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
  box-shadow: var(--glow-gold);
}

/* 侧栏底部管理员信息 */
.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
}
.admin-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-2); font-size: 14px;
}
.admin-meta { flex: 1; min-width: 0; }
.admin-name { font-size: 13px; color: var(--text-1); }
.admin-role { font-size: 11px; color: var(--text-3); }
.logout-btn {
  background: none; border: none; color: var(--text-3);
  font-size: 16px; padding: 6px; border-radius: 6px; transition: all 0.2s;
}
.logout-btn:hover { color: var(--red); background: rgba(240, 101, 90, 0.1); }

/* ---------- 主内容区 ---------- */
.main {
  flex: 1;
  margin-left: 232px;
  padding: 26px 30px 60px;
  min-width: 0;
}

/* 页头 */
.page-head { margin-bottom: 24px; }
.page-title {
  font-size: 22px; font-weight: 600; letter-spacing: 1px;
  display: flex; align-items: center; gap: 12px;
}
.page-title::before {
  content: '';
  width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
  box-shadow: var(--glow-gold);
}
.page-desc { color: var(--text-3); font-size: 12.5px; margin-top: 6px; letter-spacing: 0.5px; }

/* ============================================================
   卡片 / 面板
   ============================================================ */
.card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-title {
  font-size: 15px; font-weight: 600; color: var(--gold-2);
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* 数据统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}
.stat-card:hover { border-color: var(--line); transform: translateY(-2px); }
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 90px; height: 90px;
  background: radial-gradient(circle at top right, var(--gold-dim), transparent 70%);
}
.stat-label { font-size: 12px; color: var(--text-3); letter-spacing: 1px; }
.stat-value {
  font-size: 26px; font-weight: 700; margin-top: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}
.stat-value.gold { color: var(--gold-2); }
.stat-foot { font-size: 11px; color: var(--text-3); margin-top: 8px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 鎏金主按钮 */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(201, 169, 110, 0.3);
}
.btn-gold:hover:not(:disabled) { box-shadow: var(--glow-gold); transform: translateY(-1px); }

/* 幽灵按钮（描边） */
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold-1); color: var(--gold-2); }

/* 危险按钮 */
.btn-danger {
  background: rgba(240, 101, 90, 0.12);
  border-color: rgba(240, 101, 90, 0.35);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: rgba(240, 101, 90, 0.22); }

/* 成功按钮 */
.btn-success {
  background: rgba(61, 220, 151, 0.12);
  border-color: rgba(61, 220, 151, 0.35);
  color: var(--green);
}
.btn-success:hover:not(:disabled) { background: rgba(61, 220, 151, 0.22); }

/* 小按钮（表格内操作） */
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-link {
  background: none; border: none; padding: 4px 8px;
  color: var(--blue); font-size: 12.5px;
}
.btn-link:hover { color: var(--gold-2); text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.btn-link.success { color: var(--green); }

/* ============================================================
   表单
   ============================================================ */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.form-item { flex: 1; min-width: 180px; }
.form-item label {
  display: block;
  font-size: 12px; color: var(--text-2);
  margin-bottom: 7px; letter-spacing: 0.5px;
}
.form-item label .req { color: var(--red); margin-right: 3px; }
.form-tip { font-size: 11px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 9px 13px;
  font-size: 13.5px;
  transition: all 0.2s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239aa8c2' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.select option { background: var(--bg-2); color: var(--text-1); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

/* 数字输入小框（规则配置里用） */
.input-num { width: 90px; text-align: center; padding: 7px 8px; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(201, 169, 110, 0.04);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-1);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--bg-3); }
.table .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.table .cell-gold { color: var(--gold-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .cell-num { font-variant-numeric: tabular-nums; }

/* 表格内缩略图 */
.thumb {
  width: 46px; height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 34px; opacity: 0.4; margin-bottom: 10px; }

/* ============================================================
   徽标
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-green { background: rgba(61, 220, 151, 0.13); color: var(--green); border: 1px solid rgba(61, 220, 151, 0.3); }
.badge-red { background: rgba(240, 101, 90, 0.13); color: var(--red); border: 1px solid rgba(240, 101, 90, 0.3); }
.badge-orange { background: rgba(245, 166, 35, 0.13); color: var(--orange); border: 1px solid rgba(245, 166, 35, 0.3); }
.badge-blue { background: rgba(79, 142, 247, 0.13); color: var(--blue); border: 1px solid rgba(79, 142, 247, 0.3); }
.badge-gold { background: var(--gold-dim); color: var(--gold-2); border: 1px solid var(--line); }
.badge-gray { background: rgba(154, 168, 194, 0.1); color: var(--text-2); border: 1px solid var(--line-soft); }
.badge-purple { background: rgba(160, 126, 247, 0.13); color: var(--purple); border: 1px solid rgba(160, 126, 247, 0.3); }

/* ============================================================
   工具条（搜索 + 操作按钮）
   ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.search-box { position: relative; width: 260px; }
.search-box .input { padding-left: 36px; }
.search-box::before {
  content: '⌕';
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3); font-size: 16px;
}

/* ============================================================
   分页
   ============================================================ */
.pager {
  display: flex; align-items: center; gap: 6px;
  justify-content: flex-end;
  margin-top: 16px;
}
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--gold-1); color: var(--gold-2); }
.page-btn.active {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #ffffff; font-weight: 600;
  border-color: transparent;
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pager-total { color: var(--text-3); font-size: 12px; margin-left: 8px; }

/* ============================================================
   Toast 提示
   ============================================================ */
.gc-toast {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 22px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  font-size: 13.5px;
  max-width: 80vw;
}
.gc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gc-toast-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.gc-toast-success .gc-toast-icon { background: rgba(61, 220, 151, 0.2); color: var(--green); }
.gc-toast-error .gc-toast-icon { background: rgba(240, 101, 90, 0.2); color: var(--red); }
.gc-toast-info .gc-toast-icon { background: rgba(79, 142, 247, 0.2); color: var(--blue); }

/* ============================================================
   弹窗
   ============================================================ */
.gc-modal-mask {
  position: fixed; inset: 0;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s;
  padding: 20px;
}
.gc-modal-mask.show { opacity: 1; }
.gc-modal {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow), var(--glow-gold);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s;
}
.gc-modal-mask.show .gc-modal { transform: translateY(0) scale(1); }
.gc-modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: var(--gold-2);
  letter-spacing: 1px;
}
.gc-modal-close {
  background: none; border: none;
  color: var(--text-3); font-size: 15px;
  padding: 4px 8px; border-radius: 6px;
  transition: all 0.2s;
}
.gc-modal-close:hover { color: var(--red); background: rgba(240, 101, 90, 0.1); }
.gc-modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.gc-modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================================
   规则配置页专用样式
   ============================================================ */
.rule-section { margin-bottom: 8px; }
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* 可增删行的编辑表格（档位/分享/代理规则用） */
.edit-table { width: 100%; border-collapse: collapse; }
.edit-table th {
  text-align: left; padding: 10px 10px;
  color: var(--text-3); font-size: 12px; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.edit-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.edit-table .input { padding: 7px 10px; font-size: 13px; }
.edit-table .input-rate { width: 74px; text-align: center; }

/* 轮次比例输入组 */
.rate-inputs { display: flex; gap: 6px; flex-wrap: wrap; }
.rate-inputs .input { width: 64px; text-align: center; padding: 7px 4px; }

/* 删除行按钮 */
.row-del {
  background: none; border: none;
  color: var(--text-3); font-size: 15px;
  width: 28px; height: 28px; border-radius: 6px;
  transition: all 0.2s;
}
.row-del:hover { color: var(--red); background: rgba(240, 101, 90, 0.12); }

/* 添加行按钮 */
.row-add {
  margin-top: 12px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-2);
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.2s;
}
.row-add:hover { border-color: var(--gold-1); color: var(--gold-2); background: var(--gold-dim); }

/* 比例可视化条（银豆/铜豆） */
.ratio-bar {
  display: flex; height: 34px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--line);
  margin-top: 10px;
}
.ratio-silver {
  background: linear-gradient(135deg, #b8c4d8, #8a99b5);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #1a2332; font-weight: 600;
  transition: width 0.3s;
}
.ratio-copper {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #ffffff; font-weight: 600;
  transition: width 0.3s;
}

/* ============================================================
   登录页
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
/* 背景装饰：青花瓷纹样光晕 */
.login-wrap::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.07), transparent 65%);
  top: -200px; right: -150px;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 142, 247, 0.08), transparent 65%);
  bottom: -150px; left: -100px;
}
.login-box {
  width: 400px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 44px 40px;
  box-shadow: var(--shadow), var(--glow-gold);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 34px;
}
.login-logo .mark {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--bg-1); font-weight: 700;
  box-shadow: var(--glow-gold);
}
.login-logo h1 { font-size: 21px; letter-spacing: 4px; color: var(--gold-2); font-weight: 600; }
.login-logo p { font-size: 11.5px; color: var(--text-3); letter-spacing: 2.5px; margin-top: 8px; }
.login-box .form-item { margin-bottom: 18px; }
.login-submit { width: 100%; padding: 12px; font-size: 14.5px; margin-top: 6px; }
.login-foot {
  text-align: center; margin-top: 24px;
  font-size: 11px; color: var(--text-3); letter-spacing: 1px;
}

/* ============================================================
   结算页 / 其他
   ============================================================ */
.settle-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 26px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.settle-hero .icon-wrap {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: var(--glow-gold);
  flex-shrink: 0;
}
.settle-hero h3 { font-size: 17px; color: var(--gold-2); letter-spacing: 1px; }
.settle-hero p { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.7; }

/* 结算汇总四宫格 */
.settle-result {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.settle-result .item {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.settle-result .num { font-size: 22px; font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.settle-result .lbl { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* 凭证预览图 */
.voucher-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
}

/* 加载态 */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-3);
}
.loading::after {
  content: '';
  display: block;
  width: 32px; height: 32px;
  margin: 14px auto 0;
  border: 3px solid var(--line-soft);
  border-top-color: var(--gold-1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 淡入动画 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.35s ease both; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand-name, .sidebar .brand-sub, .sidebar .nav-item span:not(.nav-icon),
  .sidebar .nav-group-title, .sidebar .admin-meta { display: none; }
  .main { margin-left: 64px; padding: 18px 14px 50px; }
  .settle-result { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   全局紧凑化（2026-10-16）：一屏看全，无需滑屏
   压缩页头/卡片/表格/分页垂直空间，20条/页表格一屏展示
   ============================================================ */
.main { padding: 14px 24px 20px; }
.page-head { margin-bottom: 10px; }
.page-title { font-size: 18px; }
.page-title::before { height: 18px; }
.page-desc { font-size: 11.5px; margin-top: 3px; }
.card { padding: 14px 16px; margin-bottom: 12px; }
.card-title { font-size: 14px; margin-bottom: 10px; }
.stat-grid { gap: 10px; margin-bottom: 12px; }
.stat-card { padding: 12px 14px; }
.stat-value { font-size: 22px; margin-top: 4px; }
.stat-foot { margin-top: 4px; font-size: 10.5px; }
.toolbar { margin-bottom: 10px; gap: 8px; }
.table th { padding: 7px 10px; font-size: 11.5px; }
.table td { padding: 6px 10px; font-size: 12.5px; }
.table .cell-sub { margin-top: 1px; font-size: 11px; }
.thumb { width: 30px; height: 30px; border-radius: 6px; }
.pager { margin-top: 10px; }
.page-btn { min-width: 28px; height: 28px; font-size: 12px; }
.btn { padding: 7px 14px; font-size: 12.5px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.badge { padding: 2px 8px; }
.form-item { margin-bottom: 10px; }
.empty { padding: 30px 16px; }
.input { padding: 7px 10px; }

/* ============================================================
   表格区限高（2026-10-16）：页面不整体滑屏
   表格超高时表格区内部滚动，表头吸顶，分页/工具栏始终可见
   ============================================================ */
.table-wrap { max-height: calc(100vh - 340px); overflow-y: auto; }
.table th { position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.table td { padding: 4.5px 10px; }

/* ============================================================
   页面填满（2026-10-16）：卡片自适应撑满剩余高度
   数据少时卡片延伸至屏幕底部，视觉规整无裸空；内容多时表格内部滚动
   ============================================================ */
.main { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.page-head { flex-shrink: 0; }
#page-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#page-body > .card:last-child,
#page-body .rule-section,
#page-body .pool-sec,
#page-body .stab-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#page-body .card .table-wrap,
#daily-result .table-wrap { flex: 1; min-height: 0; }
#daily-result { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ============================================================
   即时通讯（管理端 · 客服会话）
   ============================================================ */
.ima-card {
  display: flex; height: calc(100vh - 168px); min-height: 460px;
  padding: 0; overflow: hidden;
}
.ima-side {
  width: 320px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
}
.ima-tabs {
  display: flex; gap: 6px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.ima-tab {
  padding: 5px 11px; border-radius: 14px; font-size: 12px;
  color: var(--text-3); cursor: pointer; border: 1px solid transparent;
}
.ima-tab.active {
  color: var(--gold-2); background: var(--gold-dim); border-color: var(--line);
}
.ima-list { flex: 1; overflow-y: auto; }
.ima-item {
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.ima-item:hover { background: rgba(46, 81, 152, 0.18); }
.ima-item.active { background: var(--gold-dim); border-left: 2px solid var(--gold-1); }
.ima-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ima-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ima-time { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.ima-item-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 4px; }
.ima-preview { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ima-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px;
  line-height: 18px; text-align: center; flex-shrink: 0;
}
.ima-tagline { font-size: 10.5px; color: var(--text-3); margin-top: 5px; opacity: 0.85; }

.ima-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ima-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px;
}
.ima-pane-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.ima-pane-name { font-size: 14.5px; font-weight: 600; }
.ima-pane-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.ima-badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 10px;
  color: var(--green); background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.3);
}
.ima-badge.gray {
  color: var(--text-3); background: rgba(154, 168, 194, 0.1);
  border-color: var(--line-soft);
}
.ima-msgs {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  background: rgba(12, 26, 51, 0.35);
}
.ima-row { display: flex; flex-direction: column; margin-bottom: 13px; }
.ima-row.mine { align-items: flex-end; }
.ima-row.other { align-items: flex-start; }
.ima-text-bubble {
  max-width: 70%; padding: 9px 12px; border-radius: 12px;
  background: var(--bg-3); color: var(--text-1); font-size: 13.5px;
  line-height: 1.6; word-break: break-word; white-space: pre-wrap;
}
.ima-row.mine .ima-text-bubble {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1a1409; border-bottom-right-radius: 4px;
}
.ima-row.other .ima-text-bubble { border-bottom-left-radius: 4px; }
.ima-msg-time { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.ima-img { max-width: 320px; max-height: 240px; border-radius: 10px; display: block; }
.ima-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 36px 0; }

.ima-order-card {
  min-width: 230px; max-width: 330px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
.ima-order-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--gold-2);
  padding-bottom: 7px; border-bottom: 1px solid var(--line-soft);
}
.ima-order-line { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.ima-order-foot {
  display: flex; justify-content: space-between; margin-top: 9px;
  font-size: 11.5px; color: var(--text-3);
}

.ima-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.ima-text {
  flex: 1; height: 36px; border-radius: 18px; padding: 0 13px;
  background: var(--bg-0); border: 1px solid var(--line-soft);
  color: var(--text-1); font-size: 13px; outline: none; min-width: 0;
}
.ima-text:focus { border-color: var(--gold-3); }
.ima-send {
  height: 36px; padding: 0 18px; border-radius: 18px; border: none;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1a1409; font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.ima-readonly {
  padding: 13px 18px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3); text-align: center;
  background: rgba(154, 168, 194, 0.05);
}
/* ============ 客服会话 · 双栏版式 ============ */
.ima-card { height: calc(100vh - 132px); min-height: 520px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.ima-side { width: clamp(220px, 26%, 300px); background: var(--bg-1); }
.ima-side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line-soft); }
.ima-side-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 9px; }
.ima-side-title i { font-style: normal; font-size: 11px; font-weight: 400; color: var(--text-3); }
.ima-search { width: 100%; height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12px; outline: none;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); }
.ima-search:focus { border-color: var(--bg-4); }
.ima-tabs { gap: 4px; padding: 10px 14px 12px; border-bottom: 1px solid var(--line-soft); }
.ima-tab { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; font-size: 12px;
  background: var(--bg-3); color: var(--text-2); border: 1px solid transparent; }
.ima-tab:hover { color: var(--text-1); }
.ima-tab.active { background: var(--bg-2); color: var(--gold-3); border-color: var(--bg-4); font-weight: 600; }
.ima-list { padding: 6px 0; }
.ima-item { display: flex; gap: 10px; padding: 10px 12px; margin: 2px 8px; border-radius: 10px; border-bottom: none; }
.ima-item:hover { background: var(--bg-3); }
.ima-item.active { background: var(--bg-3); border-left: 0; box-shadow: inset 2px 0 0 var(--gold-2); }
.ima-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--gold-3); background: var(--bg-4); border: 1px solid #cfe6f5; }
.ima-avatar.lg { width: 34px; height: 34px; }
.ima-body { flex: 1; min-width: 0; }
.ima-name { font-size: 12.5px; color: var(--text-1); }
.ima-preview { font-size: 11.5px; }
.ima-tagline { margin-top: 5px; }
.ima-chip { display: inline-flex; align-items: center; height: 17px; padding: 0 7px; border-radius: 9px; font-size: 10px;
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--bg-4); }
.ima-chip.gray { background: var(--bg-1); color: var(--text-3); border-color: var(--line); }
.ima-pane-head { padding: 12px 18px; gap: 10px; justify-content: flex-start; background: var(--bg-2); }
.ima-pane-meta { flex: 1; min-width: 0; }
.ima-pane-name { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ima-pane-state { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.ima-msgs { background: var(--bg-1); padding: 18px; }
.ima-text-bubble { background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); box-shadow: 0 1px 2px rgba(28, 78, 138, .04); }
.ima-row.mine .ima-text-bubble { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: #fff; border-color: transparent; }
.ima-ph-ico { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--gold-3); background: var(--bg-3); border: 1px solid var(--bg-4); margin-bottom: 8px; }
.ima-placeholder { gap: 3px; }
.ima-input { background: var(--bg-2); padding: 12px 16px; }
.ima-text { background: var(--bg-1); border-color: var(--line); }
.ima-send { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: #fff; font-weight: 600; }
.ima-readonly { background: var(--bg-1); }

/* 关键：覆盖 #page-body > .card:last-child 的纵向排列，保证「左列表 / 右沟通」 */
#page-body > .card.ima-card { flex: none !important; flex-direction: row; width: 100%; max-width: none !important; height: auto; min-height: 0; overflow: hidden; }
.ima-side, .ima-main, .ima-msgs { min-height: 0; }

@media (max-width: 960px) {
  .ima-side { width: 200px; }
}
/* ============================================================
   IM P1（管理端）：新消息类型只读展示
   ============================================================ */
.ima-row .ima-bubble-wrap { max-width: 74%; }
.ima-recalled {
  display: inline-block; padding: 6px 12px; border-radius: 10px; font-size: 12px;
  color: var(--text-3); background: rgba(46, 81, 152, 0.16); border: 1px dashed var(--line-soft);
}
.ima-voice {
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--line-soft); color: var(--text-1); font-size: 12.5px;
}
.ima-video { max-width: 320px; max-height: 230px; border-radius: 9px; display: block; background: #000; }
.ima-file {
  display: inline-block; padding: 8px 12px; border-radius: 9px; max-width: 320px;
  background: var(--bg-3); border: 1px solid var(--line-soft); color: var(--text-1);
  font-size: 12.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ima-card {
  padding: 9px 12px; border-radius: 9px; max-width: 320px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px;
}
.ima-card b { color: var(--gold-1); margin-left: 6px; }
.ima-card-tag { font-size: 10.5px; color: var(--gold-2); }
/* ==IM_P1_END== */

/* ===== v2 ivory theme overlay ===== */
html, body { background: var(--bg-0) !important; color: var(--text-1) !important; }
body { background-image: none !important; }
::selection { background: var(--bg-4); color: var(--text-1); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dbe7ee; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }
::-webkit-scrollbar-track { background: transparent; }
/* ===== end v2 ===== */

/* v2 contrast fix */
.btn-gold{color:#fff!important;box-shadow:0 4px 14px rgba(39,154,174,.22)!important;}

/* ============================================================
   v3 版式（2026-11-20）：顶栏 + 分组手风琴导航 + 五段式内容区
   对齐设计稿：面包屑 → 页标题 → 页内 Tab → KPI → 筛选 → 列表/详情
   ============================================================ */
.layout { display: block; height: 100vh; overflow: hidden; }
.layout-body { display: flex; height: calc(100vh - 52px); overflow: hidden; }

/* 顶栏 */
.topbar {
  height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 60;
}
.tb-brand { display: flex; align-items: center; gap: 10px; }
.tb-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gold-1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.tb-name { font-size: 15px; font-weight: 600; color: var(--text-1); letter-spacing: 1px; }
.tb-sub { font-size: 12.5px; color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--line); }
.tb-right { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-2); }
.tb-status { display: inline-flex; align-items: center; gap: 6px; }
.tb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
.tb-user { color: var(--text-3); }
.topbar .logout-btn { font-size: 14px; padding: 4px 6px; }

/* 左侧分组导航 */
.sidebar {
  position: static; width: 200px; height: 100%;
  background: var(--bg-0);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: none; }
.nav { padding: 10px 8px; flex: 1; }
.nav-group { margin-bottom: 2px; }
.nav-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.nav-group-head:hover { background: var(--bg-3); color: var(--text-1); }
.ng-name { flex: 1; }
.ng-count { font-size: 11px; color: var(--text-3); }
.ng-chev { display: none; }
.nav-group.open > .nav-group-head {
  background: var(--bg-3); color: var(--gold-3); font-weight: 600;
  border: 1px solid var(--bg-4);
}
.nav-group.open > .nav-group-head .ng-count { color: var(--gold-2); }
.nav-sub { display: none; padding: 4px 0 6px 8px; }
.nav-group.open > .nav-sub { display: block; }
.nav-sub .nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--text-2);
}
.nav-sub .nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-sub .nav-item.active {
  background: var(--bg-2); color: var(--gold-3); font-weight: 600;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(28, 78, 138, 0.06);
}
.nav-sub .nav-item.active::before { display: none; }
.nav-sub .nav-icon { display: none; }
.nav-badge {
  margin-left: auto; background: #d23c3c; color: #fff;
  font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 8px;
}
.sidebar-foot { padding: 10px 12px; border-top: 1px solid var(--line); }
.sf-link { font-size: 12px; color: var(--text-3); }
.sf-link:hover { color: var(--gold-2); }

/* 内容区 */
.main {
  margin-left: 0; height: 100%;
  padding: 14px 20px 24px;
  overflow-y: auto; overflow-x: hidden;
  display: block;
}

/* 面包屑 */
.crumb-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
  margin-bottom: 8px;
}
.crumb-note { color: var(--text-3); }
.crumb { color: var(--text-2); }

/* 页标题 */
.page-head { margin-bottom: 10px; }
.page-title { font-size: 20px; font-weight: 600; letter-spacing: 0.5px; }
.page-title::before { display: none; }
.page-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* 页内 Tab */
.page-tabs {
  display: flex; align-items: center; gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.pt {
  position: relative; padding: 7px 0 10px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.pt.active { color: var(--gold-3); font-weight: 600; }
.pt.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--gold-1); border-radius: 2px;
}

/* KPI 四格 */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 12px;
}
.kpi {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px;
}
.kpi-l { font-size: 12px; color: var(--text-3); }
.kpi-v {
  font-size: 22px; font-weight: 700; color: var(--text-1);
  margin-top: 6px; font-variant-numeric: tabular-nums;
}
.kpi-v small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.kpi-v.warn { color: var(--orange); }
.kpi-v.blue { color: var(--gold-2); }

/* 筛选条 */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.filter-bar .input, .filter-bar .select { width: auto; min-width: 140px; height: 34px; }
.filter-bar .search-box { width: 240px; }
.filter-bar .search-box .input { width: 100%; }
.filter-bar .spacer { flex: 1; }

/* 列表 + 右侧详情 */
.split { display: flex; gap: 12px; align-items: flex-start; }
.split-main {
  flex: 1; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 0 8px;
}
.split-main .table-wrap { max-height: calc(100vh - 330px); }
.split-main .toolbar { padding: 10px 14px 0; }
.split-side { width: 292px; flex-shrink: 0; }
.detail-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
.dc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 600; color: var(--text-1);
}
.dc-head small { font-size: 11px; color: var(--text-3); font-weight: 400; }
.dc-title { font-size: 13px; color: var(--text-2); margin-top: 12px; }
.dc-big { font-size: 22px; font-weight: 700; color: var(--text-1); margin-top: 6px; }
.dc-bar { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.dc-bar i { display: block; height: 100%; background: var(--gold-1); border-radius: 3px; }
.dc-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-2); padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.dc-row:last-child { border-bottom: none; }
.dc-row b { font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }
.dc-empty { color: var(--text-3); font-size: 12px; padding: 14px 0; text-align: center; }
.dc-tip {
  margin-top: 10px; padding: 9px 10px; border-radius: 8px;
  background: var(--bg-3); font-size: 11.5px; color: var(--text-2); line-height: 1.6;
}

/* 平铺卡片（对齐设计稿：细边框、无重阴影） */
.card { background: var(--bg-2); border: 1px solid var(--line); box-shadow: none; }
.stat-card { background: var(--bg-2); border: 1px solid var(--line); box-shadow: none; }
.stat-card::after { display: none; }
.stat-card:hover { transform: none; border-color: var(--bg-4); }
.stat-label { letter-spacing: 0; }
.stat-value { font-size: 22px; }
.pager { padding: 0 12px; }

/* 列表选中行 */
.table tbody tr.row-active { background: var(--bg-3); }
.table tbody tr.row-active td { border-bottom-color: var(--bg-4); }
.split-main .table { width: 100%; }

@media (max-width: 860px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .split { flex-direction: column; }
  .split-side { width: 100%; }
}

/* ============ 规则配置 · 宫格入口 ============ */
.rule-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rule-tiles[hidden] { display: none; }
.rule-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 118px; padding: 14px 14px 12px; text-align: left; cursor: pointer;
  font-family: inherit; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .12s, background .12s;
}
.rule-tile:hover { border-color: var(--bg-4); background: var(--bg-1); }
.rule-tile:focus-visible { outline: none; border-color: var(--gold-2); }
.rule-tile-ico {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--bg-4); color: var(--gold-3); font-size: 14px;
}
.rule-tile-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.rule-tile-sum { font-size: 11px; line-height: 17px; color: var(--text-2); }
.rule-tile-go { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--text-3); }
.rule-tile-dot { position: absolute; top: 12px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.rule-view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rule-view-head b { font-size: 14px; color: var(--text-1); }

@media (max-width: 960px) {
  .rule-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 商品归属选择 + 详情长图（v20261121） */
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  flex: 1; min-width: 200px; cursor: pointer;
  padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-1);
  font-size: 13px; font-weight: 600; color: var(--text-1);
  transition: border-color .15s, background .15s;
}
.radio-pill small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--text-3); }
.radio-pill.on { border-color: var(--gold-2); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--gold-2); }

/* 付款凭证查看器 */
.img-viewer { position: fixed; inset: 0; z-index: 9999; background: rgba(6, 12, 20, .96); display: flex; flex-direction: column; touch-action: none; }
.iv-top { height: 54px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; color: #fff; }
.iv-count { font-size: 13px; opacity: .85; letter-spacing: .5px; }
.iv-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.iv-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.iv-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.iv-prev { left: 10px; }
.iv-next { right: 10px; }
.iv-bar { height: 68px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding-bottom: env(safe-area-inset-bottom); }
.iv-bar button { min-width: 44px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; font-size: 14px; cursor: pointer; }
.iv-pct { min-width: 52px; text-align: center; color: #fff; font-size: 12.5px; opacity: .85; }
