/* ============================================================
   国瓷臻选 · 管理端样式
   设计基调：深邃青花蓝 + 鎏金点缀 + 玻璃拟态
   ============================================================ */

/* ---------- 设计变量 ---------- */
: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;
}
/* 登录/注册页签 */
.login-wrap { overflow: auto; align-items: flex-start; padding: 40px 0; }
.login-box { margin: auto 0; }
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0 12px;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.auth-tab.active { color: var(--gold-2); border-bottom-color: var(--gold); font-weight: 600; }
.auth-tab:hover { color: var(--gold-2); }

/* ============================================================
   结算页 / 其他
   ============================================================ */
.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); }
}

/* ============================================================
   即时通讯（商家端 · 消息中心）
   ============================================================ */
.nav-badge {
  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; margin-left: auto; display: none;
}

.imm-card {
  display: flex; height: calc(100vh - 168px); min-height: 460px;
  padding: 0; overflow: hidden;
}
.imm-side {
  width: 286px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
}
.imm-side-head {
  padding: 15px 18px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--line-soft);
}
.imm-list { flex: 1; overflow-y: auto; }
.imm-item {
  display: flex; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.imm-item:hover { background: rgba(46, 81, 152, 0.18); }
.imm-item.active { background: var(--gold-dim); border-left: 2px solid var(--gold-1); }
.imm-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-3); color: var(--gold-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; overflow: hidden;
}
.imm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.imm-item-main { flex: 1; min-width: 0; }
.imm-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.imm-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imm-time { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.imm-item-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 4px; }
.imm-preview { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imm-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;
}

.imm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.imm-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px;
}
.imm-pane-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.imm-pane-name { font-size: 14.5px; font-weight: 600; }
.imm-pane-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.imm-msgs {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  background: rgba(12, 26, 51, 0.35);
}
.imm-row { display: flex; flex-direction: column; margin-bottom: 13px; }
.imm-row.mine { align-items: flex-end; }
.imm-row.other { align-items: flex-start; }
.imm-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;
}
.imm-row.mine .imm-text-bubble {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1a1409; border-bottom-right-radius: 4px;
}
.imm-row.other .imm-text-bubble { border-bottom-left-radius: 4px; }
.imm-msg-time { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.imm-img { max-width: 320px; max-height: 240px; border-radius: 10px; display: block; }
.imm-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 36px 0; }

.imm-order-card {
  min-width: 230px; max-width: 330px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
.imm-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);
}
.imm-order-line { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.imm-order-foot {
  display: flex; justify-content: space-between; margin-top: 9px;
  font-size: 11.5px; color: var(--text-3);
}

.imm-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.imm-tool {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-3); border: 1px solid var(--line-soft);
  color: var(--gold-2); font-size: 15px; cursor: pointer;
}
.imm-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;
}
.imm-text:focus { border-color: var(--gold-3); }
.imm-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;
}

/* IM P0：在线状态 / 送达与已读回执 */
.im-online-dot { display:inline-block; width:6px; height:6px; background:#19c37d; border-radius:50%; margin-left:6px; vertical-align:middle; }
.imm-pane-status { font-size:11px; color:#9aa0a6; margin-left:8px; }
.imm-pane-status.on { color:#19c37d; }
.im-ack { margin-left:6px; font-size:10px; color:#9aa0a6; }
.im-ack.read { color:#19c37d; }
.im-ack.fail { color:#e5484d; }
.imm-row.im-failed { cursor:pointer; }
.imm-row.im-failed .imm-text-bubble, .imm-row.im-failed .imm-img { opacity:.55; }
/* ==IM_P1_START== */
/* ============================================================
   IM P1（商家端）：语音 / 文件 / 短视频 / 商品卡 / 店铺卡 / 撤回
   ============================================================ */
.imm-more {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: var(--bg-3); color: var(--gold-2); font-size: 17px; cursor: pointer;
}
.imm-tag {
  display: inline-block; margin-left: 5px; padding: 0 5px; font-size: 9.5px;
  font-style: normal; line-height: 15px; border-radius: 4px;
  color: var(--text-3); background: rgba(46, 81, 152, 0.35); vertical-align: 1px;
}
.imm-tag.gold { color: var(--gold-2); background: rgba(201, 162, 74, 0.16); }
.imm-pane-status.rec { color: #e07070; font-weight: 600; }
.imm-tool.rec { background: rgba(210, 60, 60, 0.22); border-color: #d23c3c; color: #ff9c9c; }
.imm-row .imm-bubble-wrap { max-width: 72%; }
.imm-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);
}
.imm-voice {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px;
  border-radius: 12px; border: 1px solid var(--line-soft);
  background: var(--bg-3); color: var(--text-1); cursor: pointer;
}
.imm-row.mine .imm-voice {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1a1409; border-color: transparent; border-bottom-right-radius: 4px;
}
.imm-voice.playing { box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.55); }
.imm-voice-ic { font-size: 13px; }
.imm-voice-dur { font-size: 11.5px; opacity: 0.85; }
.imm-video { max-width: 330px; max-height: 250px; border-radius: 10px; display: block; background: #000; }
.imm-file {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1);
  text-decoration: none; max-width: 330px;
}
.imm-file-ic {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 74, 0.16); color: var(--gold-2); font-size: 15px;
}
.imm-file-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imm-file-main b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imm-file-main em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.imm-card {
  width: 300px; max-width: 42vw; border-radius: 12px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.imm-card-head { padding: 8px 11px 0; }
.imm-card-tag { font-size: 10.5px; color: var(--gold-2); }
.imm-card-body { display: flex; gap: 9px; padding: 8px 11px 10px; }
.imm-card-body img {
  width: 58px; height: 58px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-3);
}
.imm-card-body .ph {
  width: 58px; height: 58px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); color: var(--text-3);
}
.imm-card-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.imm-card-info b { font-size: 12.5px; line-height: 1.4; }
.imm-card-info em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--gold-1); }

.im-set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--text-1); cursor: pointer;
}
.im-set-row:last-child { border-bottom: none; }
.im-set-row:hover { color: var(--gold-2); }
.im-set-row i { font-style: normal; font-size: 12px; color: var(--text-3); }
.im-set-row i.on { color: var(--gold-2); }

.imm-pick-search { display: flex; gap: 8px; margin-bottom: 10px; }
.imm-pick-search input {
  flex: 1; height: 34px; border-radius: 8px; padding: 0 11px;
  background: var(--bg-0); border: 1px solid var(--line-soft); color: var(--text-1); outline: none;
}
.imm-pick-list { max-height: 360px; overflow-y: auto; }
.imm-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--line-soft); border-radius: 9px; margin-bottom: 8px; cursor: pointer;
}
.imm-pick-item:hover { border-color: var(--gold-3); }
.imm-pick-item img, .imm-pick-item .ph {
  width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-3); display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.imm-pick-info { flex: 1; min-width: 0; }
.imm-pick-info b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imm-pick-info em { font-style: normal; font-size: 11px; color: var(--text-3); }
.imm-pick-send { font-size: 11.5px; color: var(--gold-2); flex-shrink: 0; }
.imm-pick-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
/* ==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）：顶栏 + 一级导航 + 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; 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: 178px; height: 100%;
  background: var(--bg-0); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: none; }
.nav-head {
  padding: 14px 14px 8px; font-size: 13px; font-weight: 600; color: var(--text-1);
  display: flex; flex-direction: column; gap: 3px;
}
.nav-head small { font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.nav { padding: 4px 8px; flex: 1; }
.nav-group-title { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; margin-bottom: 2px; border-radius: 8px;
  font-size: 13px; color: var(--text-2);
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active {
  background: var(--bg-3); color: var(--gold-3); font-weight: 600;
  border: 1px solid var(--bg-4);
}
.nav-item.active::before { display: none; }
.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 14px; 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 { color: var(--text-2); }
.page-head { margin-bottom: 10px; }
.page-title { font-size: 20px; font-weight: 600; }
.page-title::before { display: none; }
.page-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* KPI 四格 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi-row.two { grid-template-columns: repeat(2, 1fr); }
.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); }

/* 两列卡片 */
.cols { display: flex; gap: 12px; align-items: flex-start; }
.cols-main { flex: 1; min-width: 0; }
.cols-side { width: 320px; flex-shrink: 0; }
.panel {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 600;
}
.panel-head small { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.panel-body { padding: 6px 14px 12px; }
.panel .table th { background: transparent; }
.panel .table-wrap { max-height: 320px; }

.sum-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; font-size: 12.5px; color: var(--text-2);
  border-bottom: 1px dashed var(--line-soft);
}
.sum-row:last-child { border-bottom: none; }
.sum-row b { color: var(--text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-row.total b { color: var(--gold-2); font-size: 15px; }
.sum-note {
  margin-top: 10px; padding: 10px 12px; 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); }

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

/* ============================================================
   商品归属 + 多图上传（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-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-cell {
  position: relative; width: 92px; height: 92px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-1);
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-cell-long { width: 76px; height: 120px; }
.img-cell-long img { object-fit: cover; }
.img-badge {
  position: absolute; left: 0; top: 0;
  padding: 2px 7px; border-radius: 0 0 8px 0;
  background: var(--gold-2); color: #14304a;
  font-size: 10px; font-weight: 700;
}
.img-ops {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 4px;
  padding: 3px; background: rgba(10, 24, 38, .62);
  opacity: 0; transition: opacity .15s;
}
.img-cell:hover .img-ops { opacity: 1; }
.img-ops button {
  width: 22px; height: 22px; border-radius: 6px;
  border: 0; background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
}
.img-ops button:disabled { opacity: .3; }
.img-ops button.del { background: rgba(240, 101, 90, .75); }
.img-add {
  width: 92px; height: 92px; border-radius: 10px;
  border: 1px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-3); font-size: 20px; cursor: pointer;
  background: var(--bg-1);
}
.img-add span { font-size: 10.5px; }

/* 付款凭证查看器 */
.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; }
