/* 蘑菇酒社 · 管理后台 —— Stripe / Shopify 明亮专业风
   净白灰底 + 纯白卡片 + 发丝边框 + 分层柔影 + 紫靓强调 + Inter 排版；靠执行精度显高级 */
:root {
  --bg: #f6f9fc;
  --bg-2: #fbfcfe;
  --card: #ffffff;
  --line: #e6ebf1;
  --line-2: #e3e8ee;
  --ink: #0a2540;
  --ink-2: #425466;
  --sub: #697386;
  --muted: #8792a2;
  --accent: #635bff;
  --accent-2: #5346e0;
  --accent-tint: rgba(99, 91, 255, 0.08);
  --accent-soft: #f0f1fe;
  --pos: #1ea672;
  --pos-tint: rgba(30, 166, 114, 0.10);
  --neg: #df1b41;
  --neg-tint: rgba(223, 27, 65, 0.09);
  --amber: #bb5e04;
  --amber-tint: rgba(187, 94, 4, 0.10);
  /* Stripe 级分层柔影：1px 描边环 + 柔影叠加 */
  --ring: 0 0 0 1px rgba(10, 37, 64, 0.05);
  --shadow-sm: 0 0 0 1px rgba(10, 37, 64, 0.04), 0 1px 1.5px rgba(10, 37, 64, 0.05), 0 2px 4px rgba(10, 37, 64, 0.03);
  --shadow: 0 0 0 1px rgba(10, 37, 64, 0.04), 0 2px 5px rgba(10, 37, 64, 0.07), 0 14px 30px rgba(10, 37, 64, 0.10);
  /* 卡片 hover 浮起阴影（更高更柔，带极淡紫边） */
  --shadow-lift: 0 0 0 1px rgba(99, 91, 255, 0.16), 0 2px 6px rgba(10, 37, 64, 0.06), 0 18px 38px rgba(10, 37, 64, 0.12);
  /* 主按钮立体阴影（紫光晕） */
  --shadow-accent: 0 1px 1px rgba(10, 37, 64, 0.10), 0 2px 5px rgba(99, 91, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --shadow-accent-hover: 0 2px 4px rgba(10, 37, 64, 0.12), 0 8px 18px rgba(99, 91, 255, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  /* 主按钮紫渐变 */
  --grad-accent: linear-gradient(180deg, #6f68ff 0%, var(--accent) 52%, #5a51f5 100%);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* 图表配色（紫靓主导，克制成熟） */
  --c1: #635bff; --c2: #0ea5e9; --c3: #1ea672; --c4: #f5a623; --c5: #e0567a; --c6: #8b5cf6; --c7: #aab3c2;
}

* { box-sizing: border-box; }
html, body { height: auto; min-height: 100%; }
body {
  margin: 0;
  color: var(--ink-2);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 82% 6%, rgba(99, 91, 255, 0.07), transparent 44%),
    radial-gradient(circle at 8% 94%, rgba(14, 165, 233, 0.05), transparent 42%),
    var(--bg);
}
.login-card {
  position: relative; width: 100%; max-width: 408px; padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow);
  overflow: hidden;
}
/* 卡顶极细紫色高光线 */
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, #8b8bff 70%, transparent);
  opacity: 0.85;
}
.login-brand { display: flex; justify-content: center; margin-bottom: 16px; }
.login-logo { width: 210px; max-width: 72%; height: auto; display: block; }
.login-eyebrow { text-align: center; letter-spacing: 0.6px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 13px; background: #fff; overflow: hidden; padding: 3px;
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.10), inset 0 0 0 1px var(--line);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-card h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); margin-top: 3px; }
.login-card .eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; }
.login-sub { margin: 8px 0 26px; color: var(--sub); font-size: 13px; line-height: 1.7; text-align: center; }
.field-group { margin-bottom: 15px; }
.field-group label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.field {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--ink); background: #fff;
  box-shadow: 0 1px 1px rgba(10, 37, 64, 0.04);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.field::placeholder { color: var(--muted); }
.field:hover { border-color: #cfd6e2; }
.field:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-tint), 0 1px 2px rgba(10, 37, 64, 0.05); }
.login-card .btn.full { margin-top: 6px; height: 44px; font-size: 14px; }
.login-hint { margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-err { margin-top: 12px; color: var(--neg); font-size: 13px; min-height: 18px; }

/* ---------------- 框架 ---------------- */
/* 文档自然滚动 + 固定侧栏 + 吸顶 topbar：原生滚动条永远能到底，结构上杜绝「内部容器高度链断裂 → 滚不到底 / 底部被遮挡」 */
.admin-layout { display: block; }
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 30;
  width: 244px; height: 100vh; display: flex; flex-direction: column;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--card) 120px);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; padding: 3px; }
.sidebar-brand .name { font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.sidebar-brand .role-tag {
  display: inline-block; font-size: 10.5px; color: var(--accent); letter-spacing: 0.3px; margin-top: 3px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: var(--accent-tint);
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  color: var(--ink-2); background: transparent; text-align: left; font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.1px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
/* 选中态左侧竖条高亮 */
.nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0; background: var(--accent);
  transition: transform 0.18s var(--ease);
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); transition: background 0.13s; }
.nav-item:hover .dot { background: var(--sub); }
.nav-item.active .dot { background: var(--accent); }
.nav-ic { width: 19px; height: 19px; flex: none; color: var(--sub); transition: color 0.15s var(--ease), transform 0.15s var(--ease); }
.nav-item:hover .nav-ic { color: var(--ink-2); }
.nav-item.active .nav-ic { color: var(--accent); }

/* 段控件（周/月/年 切换） */
.seg-group { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.seg { height: 26px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--sub); font-size: 12.5px; font-weight: 600; transition: color 0.13s var(--ease), background 0.13s var(--ease), box-shadow 0.13s var(--ease); }
.seg:hover { color: var(--ink); }
.seg.on { color: var(--accent); background: var(--card); box-shadow: 0 1px 2px rgba(10, 37, 64, 0.08), 0 0 0 1px rgba(99, 91, 255, 0.10); }
.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.logout-btn {
  width: 100%; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--ink-2); background: var(--card); font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 1px rgba(10, 37, 64, 0.04); transition: background 0.13s var(--ease), border-color 0.13s var(--ease), color 0.13s var(--ease);
}
.logout-btn:hover { background: var(--bg); border-color: #d5dbe5; color: var(--ink); }
.logout-btn:active { transform: translateY(1px); }

.main { margin-left: 244px; min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 19px 32px; border-bottom: 1px solid var(--line); background: var(--card);
}
.topbar .page-title { font-size: 21px; font-weight: 700; color: var(--ink); letter-spacing: -0.5px; }
.topbar .page-sub { margin-top: 3px; color: var(--sub); font-size: 12.5px; }
.topbar .who { display: flex; align-items: center; gap: 12px; }
.topbar .t-strong { color: var(--ink); font-weight: 600; }
.topbar .t-sub { color: var(--sub); font-size: 12px; margin-top: 2px; }
.avatar-chip {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  color: #fff; background: var(--grad-accent); font-weight: 700; letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(99, 91, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.content { padding: 28px 32px 40px; }

/* ---------------- 图片上传 dropzone ---------------- */
.uploader { position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; overflow: hidden; transition: border-color .15s var(--ease), background .15s var(--ease); }
.uploader:hover { border-color: var(--accent); background: var(--accent-tint); }
.uploader.drag { border-color: var(--accent); background: var(--accent-soft); }
.uploader.busy { pointer-events: none; }
.uploader > input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.up-hint { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 16px; text-align: center; }
.up-hint .up-ic { width: 26px; height: 26px; color: var(--muted); }
.up-hint span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.up-hint small { font-size: 11.5px; color: var(--muted); }
.up-prev { display: none; position: relative; }
.up-prev img { display: block; width: 100%; max-height: 190px; object-fit: cover; background: var(--bg-2); }
.up-rm { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(10, 37, 64, .60); color: #fff; font-size: 17px; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: background .13s var(--ease); }
.up-rm:hover { background: rgba(223, 27, 65, .92); }
.uploader[data-empty="0"] .up-hint { display: none; }
.uploader[data-empty="0"] .up-prev { display: block; }
.uploader.busy::after { content: "上传中…"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--accent); background: rgba(255, 255, 255, .72); }
/* 菜单列表缩略图 */
.m-cell { display: flex; align-items: center; gap: 11px; }
.m-thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.m-thumb.ph { background: var(--bg-2); }


/* ---------------- 通用 ---------------- */
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; }
.muted { color: var(--sub); }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }

.card {
  position: relative; padding: 22px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; line-height: 1.35; }
/* 卡标题区：eyebrow 小标 + 主标层次（纯展示 class，供 js 选用） */
.card-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-title .eyebrow { font-size: 10.5px; letter-spacing: 1px; }
.card-head .ttl-sub { margin-top: 2px; font-size: 12px; color: var(--sub); font-weight: 400; }

/* KPI / 统计卡 */
.stat, .kpi {
  position: relative; padding: 20px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
/* 顶部极细高光：从透明经淡紫到透明，给白卡一层质感 */
.stat::before, .kpi::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2.5px;
  background: linear-gradient(90deg, transparent, rgba(99, 91, 255, 0.35) 35%, rgba(99, 91, 255, 0.55) 60%, transparent);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.stat:hover, .kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat:hover::before, .kpi:hover::before { opacity: 1; }
.stat .label, .kpi .label {
  color: var(--sub); font-size: 12px; font-weight: 600; letter-spacing: 0.1px;
}
.stat .value, .kpi .value { margin-top: 9px; font-size: 29px; line-height: 1.05; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -1.1px; }
.stat .sub, .kpi .sub { margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 500; }
/* 趋势药丸（▲▼ + 百分比），语义 tint 底 */
.kpi .delta {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 11px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(10, 37, 64, 0.04);
}
.kpi .delta.up { color: var(--pos); background: var(--pos-tint); box-shadow: inset 0 0 0 1px rgba(30, 166, 114, 0.16); }
.kpi .delta.down { color: var(--neg); background: var(--neg-tint); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.14); }
.kpi .delta.flat { color: var(--sub); background: var(--bg); }

/* 图标徽章位（纯展示 class，供 js 在 stat/kpi 内插入 svg；不插入则无影响） */
.stat-ico, .kpi-ico {
  position: absolute; top: 18px; right: 18px;
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; color: var(--accent);
  background: rgba(99, 91, 255, 0.13); box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.22);
}
.stat-ico svg, .kpi-ico svg { width: 19px; height: 19px; }
/* 语义色徽章变体 */
.stat-ico.pos, .kpi-ico.pos { color: var(--pos); background: rgba(30, 166, 114, 0.15); box-shadow: inset 0 0 0 1px rgba(30, 166, 114, 0.26); }
.stat-ico.neg, .kpi-ico.neg { color: var(--neg); background: rgba(223, 27, 65, 0.13); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.24); }
.stat-ico.amber, .kpi-ico.amber { color: var(--amber); background: rgba(187, 94, 4, 0.15); box-shadow: inset 0 0 0 1px rgba(187, 94, 4, 0.26); }
/* 含徽章时给标题/数字留出右侧空间 */
.stat:has(.stat-ico) .label, .stat:has(.stat-ico) .value,
.kpi:has(.kpi-ico) .label, .kpi:has(.kpi-ico) .value { padding-right: 48px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 10px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.1px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(10, 37, 64, 0.06);
}
.pill.gold { color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.18); }
.pill.green { color: var(--pos); background: var(--pos-tint); box-shadow: inset 0 0 0 1px rgba(30, 166, 114, 0.20); }
.pill.red { color: var(--neg); background: var(--neg-tint); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.18); }
.pill.amber { color: var(--amber); background: var(--amber-tint); box-shadow: inset 0 0 0 1px rgba(187, 94, 4, 0.20); }
/* 状态徽章：前置语义圆点（纯展示 class，给状态类 pill 用：<span class="pill green dot">已出品</span>） */
.pill.dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  color: #fff; font-weight: 600; font-size: 13.5px; letter-spacing: 0.1px;
  background: var(--grad-accent);
  box-shadow: var(--shadow-accent);
  transition: box-shadow 0.15s var(--ease), transform 0.08s var(--ease), filter 0.15s var(--ease);
}
.btn:hover { filter: brightness(1.04); box-shadow: var(--shadow-accent-hover); }
.btn:active { transform: translateY(1px) scale(0.99); box-shadow: var(--shadow-accent); filter: brightness(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-accent), 0 0 0 3px var(--accent-tint); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: none; transform: none; }
/* 次按钮：描边 + hover 染色 */
.btn.ghost {
  color: var(--ink-2); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 1px rgba(10, 37, 64, 0.04);
  filter: none;
}
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.30), 0 1px 2px rgba(99, 91, 255, 0.10); }
.btn.ghost:active { background: var(--accent-tint); transform: translateY(1px) scale(0.99); }
.btn.ghost:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-tint); }
/* 危险按钮 */
.btn.danger { background: var(--neg); box-shadow: 0 1px 1px rgba(10, 37, 64, 0.08), 0 2px 5px rgba(223, 27, 65, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.btn.danger:hover { filter: brightness(1.05); box-shadow: 0 2px 4px rgba(10, 37, 64, 0.10), 0 8px 16px rgba(223, 27, 65, 0.32); }
/* 描边危险按钮：白底红字红描边（修复 ghost+danger 组合渲染成纯红块的问题） */
.btn.ghost.danger { color: var(--neg); background: var(--card); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.30), 0 1px 1px rgba(10, 37, 64, 0.04); filter: none; }
.btn.ghost.danger:hover { color: var(--neg); background: var(--neg-tint); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.45); filter: none; }
.btn.ghost.danger:active { transform: translateY(1px) scale(0.99); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn.full { width: 100%; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 9px 14px; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; vertical-align: middle; transition: background 0.12s var(--ease); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s var(--ease); }
.table tbody tr:hover td { background: var(--accent-soft); }
.table .num, .table td.num, .table th.num { font-variant-numeric: tabular-nums; text-align: right; }
.table td.num { color: var(--ink); font-weight: 600; }
/* 行内小操作按钮：紧凑间距 */
.table td .btn.sm { vertical-align: middle; }
.table td .btn.sm + .btn.sm { margin-left: 6px; }
/* 合计行 */
.table tfoot td, .table tr.sum td { font-weight: 700; color: var(--ink); background: var(--bg-2); border-top: 1.5px solid var(--line-2); border-bottom: 0; }
.table tfoot tr:hover td, .table tr.sum:hover td { background: var(--bg-2); }
.t-strong { color: var(--ink); font-weight: 600; }
.t-sub { color: var(--sub); font-size: 12px; margin-top: 3px; }

/* 表单 */
.form-row { display: grid; gap: 7px; margin-bottom: 15px; }
.form-row label { color: var(--ink); font-size: 12px; font-weight: 600; }
textarea.field { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.field {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23697386' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
select.field:hover { background-color: #fff; }

/* ---------------- SVG 图表 ---------------- */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-host { width: 100%; }
.echart { width: 100%; }
.bar-val { fill: var(--ink-2); font-size: 11px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }

/* 节区小标题（关键指标 / 趋势 / 明细 分组） */
.section-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--sub);
  margin: 26px 2px 13px;
}
.section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); flex: none; }
.section-title:first-child { margin-top: 4px; }
/* 图表卡（留白与表单卡不同） */
.chart-card { padding: 20px 22px 14px; }
.chart-card .card-head { margin-bottom: 6px; }
/* KPI 迷你折线槽 */
.kpi .spark { height: 38px; margin-top: 10px; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-base { stroke: var(--line-2); stroke-width: 1; }
.axis-y { fill: var(--sub); font-size: 11px; text-anchor: end; }
.axis-x { fill: var(--sub); font-size: 11px; text-anchor: middle; }
.legend-row { display: flex; gap: 18px; margin-bottom: 14px; }
.legend-row .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); font-size: 12px; }
.legend-row .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut-block { display: flex; align-items: center; gap: 26px; }
.donut-wrap2 { position: relative; width: 148px; flex: none; }
.donut-svg { width: 148px; height: 148px; display: block; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dc-top { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.dc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.legend2 { flex: 1; display: grid; gap: 11px; min-width: 0; }
.lg2 { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.lg2 .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg2-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg2-val { color: var(--sub); font-variant-numeric: tabular-nums; }

.hbar { margin-bottom: 15px; }
.hbar:last-child { margin-bottom: 0; }
.hbar-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.hbar-top .num { color: var(--sub); font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; overflow: hidden; }
.hbar-track > span { display: block; height: 100%; border-radius: 999px; }

/* 进度条（活动报名等） */
.bar-line { height: 6px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; overflow: hidden; }
.bar-line > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* 核销 / 杂项 */
.scan-input-row { display: flex; gap: 10px; }
.scan-input-row .field { flex: 1; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 46px 38px; text-align: center; color: var(--ink-2);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600;
  background:
    radial-gradient(circle at 50% 22%, rgba(99, 91, 255, 0.04), transparent 60%),
    var(--bg-2);
}
/* 图标外层柔和圆形 tint 容器 */
.empty .ico {
  box-sizing: content-box; display: block; width: 26px; height: 26px; padding: 13px; margin: 0 auto 14px;
  color: var(--accent); opacity: 1;
  background: var(--accent-tint); border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.10), 0 6px 16px rgba(99, 91, 255, 0.10);
}
.empty .hint { margin-top: 7px; font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.6; max-width: 320px; }
/* 表格单元内的空状态：收紧留白、去掉边框（避免双层框） */
.table td > .empty { padding: 30px 24px; border: 0; background: transparent; }

/* ---------------- 新模块组件 ---------------- */
/* 权限 chip（点击切换） */
.perm-row { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip {
  height: 26px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--muted);
  font-size: 12px; font-weight: 600;
  transition: color 0.13s var(--ease), background 0.13s var(--ease), border-color 0.13s var(--ease), box-shadow 0.13s var(--ease), transform 0.08s var(--ease);
}
.perm-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.perm-chip:active { transform: scale(0.96); }
.perm-chip.on { color: #fff; background: var(--grad-accent); border-color: transparent; box-shadow: 0 1px 3px rgba(99, 91, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2); }

/* 勾选行（新建店员授权模块） */
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer;
  padding: 6px 11px 6px 9px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card);
  font-weight: 500; transition: border-color 0.13s var(--ease), background 0.13s var(--ease), color 0.13s var(--ease);
}
.check:hover { border-color: rgba(99, 91, 255, 0.30); background: var(--accent-soft); }
.check:has(input:checked) { border-color: rgba(99, 91, 255, 0.40); background: var(--accent-soft); color: var(--accent); }
.check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------------- 列表工具条：筛选 / 搜索 / 分页 ---------------- */
/* 工具条：左侧筛选+搜索，右侧导出，列表上方 */
.list-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin: 4px 0 14px;
}
.list-toolbar .lt-left { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.list-toolbar .lt-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* 筛选 chip 组（全部 / 待出品 / …） */
.chip-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  height: 30px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--sub);
  font-size: 12.5px; font-weight: 600;
  transition: color 0.13s var(--ease), background 0.13s var(--ease), border-color 0.13s var(--ease), box-shadow 0.13s var(--ease), transform 0.08s var(--ease);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filter-chip:active { transform: scale(0.97); }
.filter-chip.on { color: #fff; background: var(--grad-accent); border-color: transparent; box-shadow: 0 1px 3px rgba(99, 91, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2); }

/* 搜索框（带放大镜图标 + 清除 + 搜索按钮） */
.search-bar { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.search-bar .search-ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--sub); pointer-events: none;
}
.search-bar .search-field {
  width: 240px; max-width: 100%; height: 34px; padding-left: 33px; padding-right: 28px;
}
.search-bar .search-clear {
  position: absolute; right: 78px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--line); color: var(--sub); font-size: 14px; line-height: 1;
  transition: background 0.13s var(--ease), color 0.13s var(--ease);
}
.search-bar .search-clear:hover { background: var(--neg-tint); color: var(--neg); }

/* 来源下拉（积分流水）紧凑高度对齐工具条 */
.led-source-sel { height: 34px; width: auto; min-width: 130px; padding-top: 0; padding-bottom: 0; }

/* 分页条 */
.pager {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.pager-info { color: var(--muted); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pager-btns { display: inline-flex; align-items: center; gap: 6px; }
.page-num {
  min-width: 32px; height: 32px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: color 0.13s var(--ease), background 0.13s var(--ease), border-color 0.13s var(--ease), box-shadow 0.13s var(--ease), transform 0.08s var(--ease);
}
.page-num:hover:not(:disabled):not(.on) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.page-num:active:not(:disabled) { transform: scale(0.96); }
.page-num.on { color: #fff; background: var(--grad-accent); border-color: transparent; box-shadow: 0 1px 3px rgba(99, 91, 255, 0.32); cursor: default; }
.page-num:disabled { opacity: 0.4; cursor: not-allowed; }

/* 可钻取统计卡（看板 → 模块） */
.stat-link { cursor: pointer; }
.stat-link:hover { border-color: rgba(99, 91, 255, 0.28); }
.stat-link .stat-go {
  position: absolute; right: 16px; bottom: 16px; width: 16px; height: 16px;
  color: var(--accent); opacity: 0; transform: translateX(-3px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.stat-link:hover .stat-go { opacity: 0.9; transform: translateX(0); }

/* 桌台卡片网格 */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.table-card {
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.table-card:hover { background: var(--card); border-color: rgba(99, 91, 255, 0.28); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tc-top .t-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.tc-top .t-strong { font-size: 15px; margin-top: 2px; }
.tc-meta { margin: 12px 0 14px; color: var(--sub); font-size: 12.5px; }
.tc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.ghost.danger { color: var(--neg); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.22), 0 1px 1px rgba(10, 37, 64, 0.04); }
.btn.ghost.danger:hover { background: var(--neg-tint); color: var(--neg); box-shadow: inset 0 0 0 1px rgba(223, 27, 65, 0.40); }

/* 经营分析 */
.an-section { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 14px; }
.an-section:first-child { margin-top: 4px; }
.an-section h2 { font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; position: relative; padding-left: 13px; }
.an-section h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 15px; border-radius: 999px; background: var(--grad-accent); }
.an-section .muted { font-size: 12.5px; }
.rfm-list { display: flex; flex-direction: column; gap: 14px; }
.rfm-seg { padding: 13px 14px; border-radius: var(--radius-sm, 10px); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.rfm-seg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.rfm-seg-head .t-strong { flex: 1; min-width: 0; }
.rfm-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.rfm-samples { display: flex; flex-direction: column; gap: 7px; }
.rfm-sample { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.rfm-sample .t-strong { font-weight: 500; color: var(--ink-2); }
.rfm-rfm { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  z-index: 50; opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 10px; color: #fff; background: var(--ink); font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.28); transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner::before { animation-duration: 1.6s; }
  .card, .stat, .kpi, .nav-item, .nav-item::before { transition: none; }
}
