/* platform/src/styles.css - 平台后台样式（蓝色系，区别于商家橙色） */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --color-primary: #3B82F6;
  --color-primary-light: #60A5FA;
  --color-primary-dark: #2563EB;
  --color-success: #07C160;
  --color-danger: #FA5151;
  --color-warning: #F59E0B;
  --color-text-1: #1F1F1F;
  --color-text-2: #646566;
  --color-text-3: #969799;
  --color-border: #EBEDF0;
  --color-bg: #F4F5F7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text-1);
  font-size: 15px;
  line-height: 1.6;
}

.loading { text-align: center; padding: 100px 0; color: var(--color-text-3); }

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

.sidebar {
  width: 220px;
  background: #0F172A;
  color: #FFFFFF;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 20px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-header .logo-icon { display: inline-block; width: 28px; height: 28px; background: var(--color-primary); border-radius: 6px; text-align: center; line-height: 28px; margin-right: 8px; }
.sidebar-menu { list-style: none; padding: 12px 0; }
.sidebar-menu .menu-group { padding: 8px 20px 4px; font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 15px;
}
.sidebar-menu a:hover { background: rgba(255, 255, 255, 0.05); }
.sidebar-menu a.active {
  background: var(--color-primary);
  color: #FFFFFF;
}
.sidebar-menu .icon { margin-right: 10px; font-size: 16px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #FFFFFF;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 12px; color: var(--color-text-2); }

.content { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== 通用组件 ===== */
.card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title-row .card-title { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }  /* v258: 员工码 stats 6 卡横排（复用欢聚卡 .stat-card 视觉，与 grid-7 形成系列） */
.grid-7 { grid-template-columns: repeat(7, 1fr); }

.stat-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.stat-card .label { font-size: 13px; color: var(--color-text-3); margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 600; color: var(--color-text-1); }
.stat-card .delta { font-size: 12px; color: var(--color-success); margin-top: 4px; }
.stat-card.highlight { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%); color: #FFFFFF; }
.stat-card.highlight .label,
.stat-card.highlight .value,
.stat-card.highlight .delta { color: #FFFFFF; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-ghost { background: #F4F5F7; color: var(--color-text-2); }
.btn-danger { background: var(--color-danger); color: #FFFFFF; }
.btn-danger-ghost { background: #FEF2F2; color: #DC2626; }
.btn-danger-ghost:hover { background: #FEE2E2; }
.btn-success { background: var(--color-success); color: #FFFFFF; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 11px 24px; font-size: 16px; font-weight: 600; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #FFFFFF; border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.table th { background: #F8FAFC; color: var(--color-text-2); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFAFA; }
.table .merchant-cell { display: flex; align-items: center; gap: 8px; }
.table .merchant-logo { width: 32px; height: 32px; border-radius: 6px; background: #E0E7FF; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  background: #F0F0F0;
  color: var(--color-text-2);
}
.tag.success { background: #E8F5E9; color: var(--color-success); }
.tag.warning { background: #FFF3E0; color: var(--color-warning); }
.tag.danger { background: #FFEBEE; color: var(--color-danger); }
.tag.primary { background: #DBEAFE; color: var(--color-primary); }
.tag.muted { background: #F5F5F5; color: var(--color-text-3); }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 14px; color: var(--color-text-2); margin-bottom: 8px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--color-primary);
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}
.filter-bar .form-item { margin: 0; min-width: 160px; }
.filter-bar .form-item label { font-size: 14px; }

/* 时间范围切换 */
.range-tabs { display: inline-flex; background: #FFFFFF; border-radius: 8px; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 16px; }
.range-tabs button { padding: 6px 16px; border: none; background: transparent; cursor: pointer; border-radius: 6px; font-size: 13px; color: var(--color-text-2); }
.range-tabs button.active { background: var(--color-primary); color: #FFFFFF; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
}
.login-box {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.login-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 8px; }
.login-subtitle { text-align: center; color: var(--color-text-3); margin-bottom: 32px; font-size: 13px; }
.login-box .btn-primary { width: 100%; padding: 12px; justify-content: center; }

/* 应用卡片 */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.app-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-card .app-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.app-card .app-name { font-size: 15px; font-weight: 600; }
.app-card .app-desc { font-size: 12px; color: var(--color-text-3); line-height: 1.5; }
.app-card .app-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* 导航卡片（财务模块入口） */
.nav-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
  text-align: center;
}
.nav-card:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}
.nav-card-icon { font-size: 32px; margin-bottom: 8px; }
.nav-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.nav-card-desc { font-size: 12px; color: var(--color-text-3); }

/* 移动端适配 */
@media (max-width: 1200px) {
  .grid-7 { grid-template-columns: repeat(4, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }  /* v258: 员工码 6 卡在 <1200px 也舒服（6→3 列×2 行） */
}
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-menu { display: flex; overflow-x: auto; padding: 8px; }
  .sidebar-menu a { white-space: nowrap; padding: 8px 16px; }
  .sidebar-menu .menu-group { display: none; }
  .grid-7, .grid-6, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* v1.2.39 商家子账号管理页字号优化
   解决：顶部说明 13px、商家/子账号副标题 11px、权限标签 10px 等小字读不清的问题 */
.sa-sub {
  color: #8C8C8C;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 3px;
}
.sa-perm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 200px;
}
.sa-perm {
  font-size: 12.5px !important;
  padding: 3px 9px !important;
  border-radius: 4px;
}
.sa-empty {
  text-align: center;
  color: #999;
  font-size: 15px;
  padding: 36px 0 !important;
}
.table-subaccount td { vertical-align: middle; }

/* v1.2.40 删除按钮加点间距（.btn 是 inline-flex，相邻无自动间距） */
.sa-delete-btn { margin-left: 4px; }
.sa-delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== v1.2.65 经营周报 ===== */
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.wr-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.wr-toolbar .range-tabs { margin-bottom: 0; }
.wr-toolbar-actions { display: flex; gap: 8px; }

.wr-bar-chart {
  display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 8px 0 0;
}
.wr-bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end;
}
.wr-bar-val { font-size: 11px; color: var(--color-text-3); margin-bottom: 4px; white-space: nowrap; }
.wr-bar {
  width: 70%; max-width: 48px; min-height: 4px;
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  border-radius: 4px 4px 0 0; transition: height 0.4s ease;
}
.wr-bar:hover { filter: brightness(1.08); }
.wr-bar-label { font-size: 12px; color: var(--color-text-2); margin-top: 6px; }

.wr-funnel { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.wr-funnel-item { display: flex; justify-content: flex-start; }
.wr-funnel-bar {
  min-height: 38px; min-width: 90px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: #fff; font-size: 14px; font-weight: 600; transition: width 0.4s ease;
}
.wr-funnel-bar span { white-space: nowrap; }

.wr-insights { background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%); }
.wr-insight-list { list-style: none; padding: 0; }
.wr-insight-list li {
  position: relative; padding: 8px 0 8px 24px; color: var(--color-text-1); line-height: 1.7; font-size: 14px;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.wr-insight-list li:last-child { border-bottom: none; }
.wr-insight-list li::before {
  content: '→'; position: absolute; left: 0; top: 8px; color: var(--color-primary); font-weight: 700;
}

.wr-report-text {
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 8px;
  padding: 16px; font-size: 13px; line-height: 1.8; color: var(--color-text-1);
  white-space: pre-wrap; word-break: break-all; font-family: inherit; max-height: 420px; overflow-y: auto;
}

/* v1.2.66 按商家周报 */
.wr-back { margin-bottom: 12px; }
.wr-cat-rank {
  display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12.5px;
  background: #FFF7E6; color: #D46B08; border: 1px solid #FFD591; white-space: nowrap;
}
.wr-bench-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed rgba(0,0,0,0.06); }
.wr-bench-row:last-child { border-bottom: none; }
.wr-bench-label { width: 70px; flex-shrink: 0; font-size: 13px; color: var(--color-text-2); }
.wr-bench-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.wr-bench-line { display: flex; align-items: center; gap: 8px; }
.wr-bench-tag { width: 76px; flex-shrink: 0; font-size: 11.5px; color: var(--color-text-3); text-align: right; }
.wr-bench-bar {
  min-height: 26px; min-width: 60px; border-radius: 5px; display: flex; align-items: center;
  justify-content: flex-start; padding: 0 10px; font-size: 12.5px; color: #fff;
  transition: width 0.4s ease; white-space: nowrap;
}
.wr-bench-bar.mine { background: var(--color-primary); }
.wr-bench-bar.avg { background: #C3C7CC; color: #fff; }

@media (max-width: 768px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .wr-bar-chart { height: 150px; }
  .wr-bar-val { font-size: 10px; }
  .wr-bench-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .wr-bench-tag { text-align: left; width: auto; }
}

/* ===== v1.2.75 欢聚卡开卡/核销记录全屏页（按截图 2/3 全实现）===== */

/* 橙色按钮族 —— 与截图 2/3 顶栏配色对齐 */
.btn-orange { background: #FF6B35; color: #FFFFFF; }
.btn-orange:hover { background: #E85A2B; }
.btn-orange-ghost {
  background: #FFFFFF; color: #FF6B35; border: 1px solid #FF6B35;
}
.btn-orange-ghost:hover { background: #FFF5F0; color: #E85A2B; border-color: #E85A2B; }

/* 欢聚卡操作列：按钮很多时强制换行，避免挤压 */
.cards-actions .cards-link-btn--break { display: inline-block; margin: 2px 0; }

/* 记录页容器 */
.crec-page { display: flex; flex-direction: column; gap: 12px; }
.crec-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0 8px; flex-wrap: wrap; gap: 12px;
}
.crec-breadcrumb { font-size: 14px; color: var(--color-text-2); }
.crec-breadcrumb a { color: var(--color-primary); text-decoration: none; }
.crec-breadcrumb a:hover { text-decoration: underline; }
.crec-bc-sep { color: var(--color-text-3); margin: 0 6px; }
.crec-bc-card { color: var(--color-text-1); font-weight: 500; }
.crec-bc-cur { color: var(--color-text-1); font-weight: 600; }

/* 筛选区 */
.crec-filter .form-item { min-width: 160px; }
.crec-time-range { min-width: 280px; }
.crec-dr { display: flex; align-items: center; gap: 6px; }
.crec-dr input { flex: 1; min-width: 110px; }
.crec-dr-sep { color: var(--color-text-3); font-size: 13px; }

/* 顶部操作区 */
.crec-list-head { flex-wrap: wrap; gap: 8px; }
.crec-top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crec-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--color-border);
  background: #FFFFFF; color: var(--color-text-2); cursor: pointer; font-size: 15px;
  transition: all 0.15s;
}
.crec-icon-btn:hover { background: #F4F5F7; color: var(--color-primary); border-color: var(--color-primary); }

/* 批量操作下拉 */
.crec-batch-wrap { position: relative; display: inline-block; }
.crec-batch-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.crec-batch-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 100;
  background: #FFFFFF; border: 1px solid var(--color-border); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); min-width: 130px; padding: 4px 0;
}
.crec-batch-menu button {
  display: block; width: 100%; padding: 8px 14px; text-align: left; background: none;
  border: none; font-size: 13px; color: var(--color-text-1); cursor: pointer;
}
.crec-batch-menu button:hover { background: #F4F5F7; color: var(--color-primary); }

/* 列设置面板 */
.crec-cols-panel {
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px;
}
.crec-cols-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.crec-cols-item input { width: auto; }
.crec-cols-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; padding-top: 6px; border-top: 1px dashed var(--color-border); }

/* 表格 */
.crec-table-wrap { overflow-x: auto; }
.crec-table { min-width: 100%; }
.crec-col-check { width: 36px; text-align: center; }
.crec-col-check input { width: auto; cursor: pointer; }
.crec-row-link {
  color: var(--color-primary); text-decoration: none; margin-right: 8px; font-size: 13px;
}
.crec-row-link:hover { text-decoration: underline; }
.crec-empty { text-align: center; color: var(--color-text-3); padding: 36px 0; }

@media (max-width: 768px) {
  .crec-filter .form-item { min-width: 100%; }
  .crec-time-range { min-width: 100%; }
}

/* ===== v1.2.76 Dashboard 代运营 Cockpit ===== */
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dash-report-link {
  font-size: 13px; color: var(--color-primary); text-decoration: none;
  padding: 6px 14px; border: 1px solid var(--color-primary); border-radius: 6px; white-space: nowrap;
}
.dash-report-link:hover { background: var(--color-primary); color: #fff; }

/* KPI 卡 */
.dash-kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.dash-kpi {
  background: #fff; border-radius: 8px; padding: 16px 14px; border: 1px solid #EAEAEA;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-kpi-primary { border-color: var(--color-primary); background: linear-gradient(135deg, #f9f0ff 0%, #fff 60%); }
.dash-kpi-label { font-size: 12px; color: #8c8c8c; }
.dash-kpi-value { font-size: 24px; font-weight: 700; color: #262626; line-height: 1.2; }
.dash-trend { font-size: 12px; font-weight: 500; }
.dash-trend-up { color: #52c41a; }
.dash-trend-down { color: #ff4d4f; }
.dash-trend-flat { color: #8c8c8c; }

/* 趋势图 */
.dash-chart-card { margin-bottom: 16px; }
.dash-chart { width: 100%; height: auto; max-height: 200px; display: block; }

/* 双列网格 */
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 商家排行表格 */
.dash-table { font-size: 13px; }
.dash-table th { font-size: 12px; color: #8c8c8c; font-weight: 500; }
.dash-rank { width: 28px; text-align: center; color: #8c8c8c; font-weight: 600; }
.dash-rank:first-child { font-size: 14px; color: var(--color-primary); }
.dash-merchant-link { color: var(--color-primary); text-decoration: none; }
.dash-merchant-link:hover { text-decoration: underline; }
.dash-delta-up { color: #52c41a; font-weight: 500; }
.dash-delta-down { color: #ff4d4f; font-weight: 500; }
.dash-rate { color: var(--color-primary); font-weight: 600; }

/* 待办预警 */
.dash-alerts { display: flex; flex-direction: column; gap: 10px; }
.dash-alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: 8px; border-left: 3px solid; background: #fafafa;
}
.dash-alert-warn { border-left-color: #fa8c16; background: #fff7e6; }
.dash-alert-info { border-left-color: #2f54eb; background: #f0f5ff; }
.dash-alert-danger { border-left-color: #f5222d; background: #fff1f0; }
.dash-alert-success { border-left-color: #52c41a; background: #f6ffed; }
.dash-alert-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.dash-alert-body { flex: 1; min-width: 0; }
.dash-alert-title { font-size: 14px; font-weight: 500; color: #262626; }
.dash-alert-desc { font-size: 12px; color: #8c8c8c; margin-top: 2px; }
.dash-alert-action {
  font-size: 13px; color: var(--color-primary); text-decoration: none; white-space: nowrap;
  padding: 4px 10px; border-radius: 4px; background: rgba(114,46,209,0.08);
}
.dash-alert-action:hover { background: rgba(114,46,209,0.18); }

/* 会员健康度 */
.dash-health { display: flex; flex-direction: column; gap: 14px; }
.dash-health-row { display: flex; flex-direction: column; gap: 4px; }
.dash-health-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dash-health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-health-name { font-weight: 500; min-width: 56px; }
.dash-health-count { color: #595959; font-weight: 600; }
.dash-health-pct { color: #8c8c8c; margin-left: auto; }
.dash-health-bar { height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.dash-health-desc { font-size: 11px; color: #bfbfbf; }

/* 快捷操作栏 */
.dash-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; background: #fff; border-radius: 8px; border: 1px solid #EAEAEA; }
.dash-qa-btn {
  flex: 1; min-width: 120px; text-align: center; padding: 14px 8px;
  border-radius: 8px; background: #fafafa; text-decoration: none; color: #595959;
  font-size: 14px; font-weight: 500; transition: all .2s; border: 1px solid transparent;
}
.dash-qa-btn:hover { background: #f9f0ff; color: var(--color-primary); border-color: var(--color-primary); }

@media (max-width: 1024px) {
  .dash-kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dash-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ══════════ v1.2.77 私域 SOP 引擎 ══════════ */
.sop-page { display: flex; flex-direction: column; gap: 16px; }
.sop-loading { padding: 40px; text-align: center; color: #999; }

/* 顶部统计条 */
.sop-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sop-stat { background: #fff; border: 1px solid #EAEAEA; border-radius: 8px; padding: 14px 16px; }
.sop-stat.highlight { background: #f9f0ff; border-color: #d3bdf5; }
.sop-stat-num { font-size: 22px; font-weight: 700; color: #262626; }
.sop-stat-num span { font-size: 13px; font-weight: 400; color: #999; margin-left: 2px; }
.sop-stat.highlight .sop-stat-num { color: var(--color-primary); }
.sop-stat-label { font-size: 12px; color: #8c8c8c; margin-top: 2px; }

/* tab 切换 */
.sop-tabs { display: flex; gap: 4px; border-bottom: 1px solid #EAEAEA; background: #fff; border-radius: 8px 8px 0 0; padding: 0 8px; }
.sop-tabs button {
  padding: 12px 18px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #595959; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.sop-tabs button.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
#sopTabBody { background: #fff; border: 1px solid #EAEAEA; border-top: none; border-radius: 0 0 8px 8px; padding: 16px; min-height: 320px; }

/* 筛选区 */
.sop-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.sop-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sop-chip {
  padding: 5px 12px; border-radius: 14px; border: 1px solid #EAEAEA; background: #fafafa;
  font-size: 12px; color: #595959; cursor: pointer; transition: all .15s;
}
.sop-chip.active { background: #f9f0ff; border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
.sop-select {
  padding: 6px 10px; border: 1px solid #EAEAEA; border-radius: 6px; font-size: 13px;
  background: #fff; color: #262626; cursor: pointer; margin-left: auto;
}

/* 模板卡片网格 */
.sop-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.sop-tpl {
  border: 1px solid #EAEAEA; border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; background: #fff; transition: all .2s;
}
.sop-tpl:hover { border-color: #d3bdf5; box-shadow: 0 2px 12px rgba(114,46,209,0.08); }
.sop-tpl.applied { border-left: 3px solid var(--color-primary); }
.sop-tpl.expanded { border-color: var(--color-primary); }

.sop-tpl-head { display: flex; align-items: center; gap: 8px; }
.sop-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.sop-tag-new_friend { background: #e6f7ff; color: #096dd9; }
.sop-tag-wake { background: #fff7e6; color: #d46b08; }
.sop-tag-repurchase { background: #f6ffed; color: #389e0d; }
.sop-tag-expire { background: #fff1f0; color: #cf1322; }
.sop-tag-new_card { background: #f9f0ff; color: #722ed1; }
.sop-tag-member_day { background: #fff0f6; color: #c41d7f; }
.sop-tag-idle { background: #e6fffb; color: #08979c; }
.sop-tag-cate { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #fafafa; color: #8c8c8c; border: 1px solid #f0f0f0; }
.sop-tpl-state { margin-left: auto; font-size: 11px; color: #bfbfbf; }
.sop-tpl-state.on { color: var(--color-primary); }

.sop-tpl-name { font-size: 15px; font-weight: 600; color: #262626; }
.sop-tpl-desc { font-size: 12px; color: #8c8c8c; line-height: 1.6; }
.sop-tpl-trigger { font-size: 12px; color: #595959; background: #fafafa; border-radius: 6px; padding: 6px 10px; }
.sop-tpl-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #8c8c8c; }
.sop-tpl-stats b { color: #262626; font-weight: 600; }
.sop-tpl-actions { display: flex; gap: 8px; margin-top: 2px; }

/* 客户旅程时间线（卡片内展开） */
.sop-journey { border-top: 1px dashed #EAEAEA; margin-top: 4px; padding-top: 12px; }
.sop-journey-title { font-size: 12px; font-weight: 600; color: #595959; margin-bottom: 10px; }
.sop-step { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.sop-step:last-child { padding-bottom: 0; }
.sop-step::before {
  content: ''; position: absolute; left: 11px; top: 24px; bottom: 0;
  width: 1px; background: #e8d5f5;
}
.sop-step:last-child::before { display: none; }
.sop-step-node {
  width: 22px; height: 22px; border-radius: 50%; background: #f9f0ff; border: 1px solid #d3bdf5;
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; z-index: 1;
}
.sop-step-body { display: flex; flex-direction: column; gap: 2px; }
.sop-step-title { font-size: 13px; color: #262626; }
.sop-step-meta { font-size: 11px; color: #bfbfbf; }

/* 自动化规则 */
.sop-rule-tip { font-size: 12px; color: #8c8c8c; background: #fafafa; border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; line-height: 1.7; }
.sop-rule { border: 1px solid #EAEAEA; border-radius: 10px; padding: 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.sop-rule.off { opacity: 0.62; background: #fafafa; }
.sop-rule-head { display: flex; align-items: center; gap: 12px; }
.sop-rule-title { font-size: 15px; font-weight: 600; color: #262626; display: flex; align-items: center; gap: 8px; }
.sop-rule-badge { font-size: 11px; font-weight: 400; padding: 2px 8px; border-radius: 10px; background: #f6ffed; color: #389e0d; }
.sop-rule-badge.paused { background: #fafafa; color: #8c8c8c; }
.sop-rule-meta-inline { margin-left: auto; font-size: 12px; color: #bfbfbf; }
.sop-rule-desc { font-size: 12px; color: #8c8c8c; }
.sop-rule-flow { font-size: 13px; color: #595959; background: #fafafa; border-radius: 6px; padding: 8px 12px; }
.sop-rule-flow b { color: var(--color-primary); }
.sop-rule-arrow { color: #bfbfbf; margin: 0 4px; }
.sop-rule-params { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sop-param { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #595959; }
.sop-param-input { width: 64px; padding: 5px 8px; border: 1px solid #EAEAEA; border-radius: 6px; font-size: 13px; }
.sop-param-sel { padding: 5px 8px; border: 1px solid #EAEAEA; border-radius: 6px; font-size: 13px; background: #fff; }
.sop-param-unit { color: #bfbfbf; font-size: 12px; }
.sop-rule-meta { font-size: 12px; color: #8c8c8c; border-top: 1px dashed #f0f0f0; padding-top: 8px; }
.sop-rule-meta b { color: #262626; }

/* 执行日志 */
.sop-log-total { font-size: 12px; color: #bfbfbf; }
.sop-table-wrap { overflow-x: auto; }
.sop-table th { white-space: nowrap; }
.sop-td-time { white-space: nowrap; color: #8c8c8c; font-size: 12px; }
.sop-ch-tag { font-size: 11px; padding: 1px 8px; border-radius: 4px; background: #f0f5ff; color: #2f54eb; }
.sop-rate-good { color: #389e0d; }
.sop-status { font-size: 12px; }
.sop-status.success { color: #389e0d; }
.sop-status.fail { color: #cf1322; }

/* 分页 */
.sop-pager { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.sop-page-btn {
  padding: 5px 12px; border: 1px solid #EAEAEA; border-radius: 6px; background: #fff;
  font-size: 12px; color: #595959; cursor: pointer; transition: all .15s;
}
.sop-page-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.sop-page-btn.cur { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.sop-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sop-page-ellipsis { color: #bfbfbf; padding: 0 2px; }
.sop-empty { text-align: center; color: #999; padding: 60px 0; }

@media (max-width: 1024px) {
  .sop-stats { grid-template-columns: repeat(3, 1fr); }
  .sop-tpl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sop-stats { grid-template-columns: repeat(2, 1fr); }
  .sop-select { margin-left: 0; }
}

/* ═══ 内容工厂 .cf-*（v1.2.78）═══ */
.cf-page { display: flex; flex-direction: column; gap: 16px; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cf-mat { background: #fff; border: 1px solid #EAEAEA; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.cf-mat:hover { border-color: #d3bdf5; box-shadow: 0 2px 12px rgba(114,46,209,0.08); }
.cf-mat.custom { border-left: 3px solid var(--color-primary); }
.cf-mat-thumb { height: 110px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; font-size: 34px; color: #fff; }
.cf-mat-thumb span { font-size: 11px; padding: 1px 10px; border-radius: 10px; background: rgba(255,255,255,0.22); backdrop-filter: blur(2px); }
.cf-thumb-new_dish { background: linear-gradient(135deg, #ff9a44, #fc6076); }
.cf-thumb-festival { background: linear-gradient(135deg, #f6d365, #fda085); }
.cf-thumb-promo { background: linear-gradient(135deg #f5af19, #f12711); background: linear-gradient(135deg, #f5af19, #f12711); }
.cf-thumb-daily { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.cf-thumb-vip { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.cf-mat-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cf-mat-tags { display: flex; align-items: center; gap: 6px; }
.cf-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.cf-tag-new_dish { background: #fff7e6; color: #d46b08; }
.cf-tag-festival { background: #fff1f0; color: #cf1322; }
.cf-tag-promo { background: #fff7e6; color: #ad4e00; }
.cf-tag-daily { background: #f6ffed; color: #389e0d; }
.cf-tag-vip { background: #f9f0ff; color: #722ed1; }
.cf-mat-custom { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #f9f0ff; color: var(--color-primary); border: 1px solid #d3bdf5; }
.cf-mat-title { font-size: 14px; font-weight: 600; color: #262626; }
.cf-mat-desc { font-size: 12px; color: #8c8c8c; line-height: 1.6; }
.cf-mat-meta { font-size: 12px; color: #bfbfbf; margin-top: auto; }
.cf-create { background: #fafafa; border: 1px dashed #d3bdf5; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.cf-create-title { font-size: 13px; font-weight: 600; color: #595959; }
.cf-create-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-input-wide { flex: 1; min-width: 220px; padding: 6px 10px; border: 1px solid #EAEAEA; border-radius: 6px; font-size: 13px; }
.cf-create-textarea { width: 100%; min-height: 56px; padding: 8px 10px; border: 1px solid #EAEAEA; border-radius: 6px; font-size: 13px; resize: vertical; font-family: inherit; }
.cf-create-actions { display: flex; gap: 8px; }
.cf-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.cf-tpl { background: #fff; border: 1px solid #EAEAEA; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.cf-tpl:hover { border-color: #d3bdf5; box-shadow: 0 2px 12px rgba(114,46,209,0.08); }
.cf-tpl.expanded { border-color: var(--color-primary); }
.cf-tpl-head { display: flex; align-items: center; gap: 8px; }
.cf-tpl-state { margin-left: auto; font-size: 11px; color: #bfbfbf; }
.cf-tpl-name { font-size: 15px; font-weight: 600; color: #262626; }
.cf-tpl-material { font-size: 12px; color: #595959; }
.cf-tpl-body { font-size: 12.5px; color: #262626; background: #fafafa; border-radius: 6px; padding: 10px 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; }
.cf-ph { background: #f9f0ff; color: var(--color-primary); border-radius: 4px; padding: 0 4px; font-weight: 600; font-size: 11.5px; }
.cf-tpl-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #8c8c8c; }
.cf-tpl-stats b { color: #262626; font-weight: 600; }
.cf-preview { border-top: 1px dashed #EAEAEA; margin-top: 4px; padding-top: 12px; }
.cf-preview-loading { font-size: 12px; color: #bfbfbf; padding: 8px 0; }
.cf-preview-title { font-size: 12px; font-weight: 600; color: #595959; margin-bottom: 10px; }
.cf-preview-item { margin-bottom: 10px; }
.cf-preview-item:last-of-type { margin-bottom: 0; }
.cf-preview-merchant { font-size: 12.5px; font-weight: 600; color: #262626; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.cf-preview-merchant span { font-size: 11px; font-weight: 400; color: #8c8c8c; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 4px; padding: 1px 6px; }
.cf-preview-text { font-size: 12.5px; color: #262626; background: #fffdf5; border: 1px solid #f5efa8; border-radius: 6px; padding: 8px 10px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; }
.cf-preview-foot { font-size: 11px; color: #bfbfbf; margin-top: 8px; }
.cf-publish { border-top: 1px dashed #EAEAEA; margin-top: 4px; padding-top: 12px; }
.cf-q-status { font-size: 12px; white-space: nowrap; }
.cf-q-status.pending { color: #d46b08; }
.cf-q-status.done { color: #389e0d; }
.cf-q-status.partial { color: #cf1322; }
.cf-q-status.cancelled { color: #8c8c8c; }
.cf-progress { width: 90px; height: 6px; border-radius: 3px; background: #f0f0f0; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.cf-progress span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #722ed1, #b37feb); transition: width .3s; }
.cf-progress-num { font-size: 11.5px; color: #8c8c8c; }
.cf-noop { color: #d9d9d9; }

@media (max-width: 1024px) {
  .cf-grid { grid-template-columns: 1fr; }
  .cf-tpl-grid { grid-template-columns: 1fr; }
}

/* ═══ 群运营 .gr-*（v1.2.79）═══ */
.gr-td-name { font-weight: 600; color: #262626; }
.gr-cat { font-size: 11px; color: #8c8c8c; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.gr-rate { width: 90px; height: 6px; border-radius: 3px; background: #f0f0f0; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.gr-rate-wide { width: 110px; }
.gr-rate span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #52c41a, #95de64); transition: width .3s; }
.gr-rate span.mid { background: linear-gradient(90deg, #faad14, #ffd666); }
.gr-rate span.low { background: linear-gradient(90deg, #ff4d4f, #ff7875); }
.gr-rate-num { font-size: 11.5px; color: #595959; }
.gr-level { font-size: 12px; font-weight: 500; white-space: nowrap; }
.gr-level.healthy { color: #389e0d; }
.gr-level.warn { color: #d46b08; }
.gr-level.silent { color: #cf1322; }
.gr-rank { font-size: 14px; font-weight: 600; color: #595959; }
.gr-delta-up { color: #cf1322; font-size: 12px; }
.gr-delta-down { color: #389e0d; font-size: 12px; }

/* ═══ 企微接入 .wm-*（v1.2.80）═══ */
.wm-page { display: flex; flex-direction: column; gap: 16px; }
.wm-status { padding: 16px 20px; }
.wm-status-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #262626; flex-wrap: wrap; }
.wm-dot { font-size: 12px; }
.wm-dot.on { color: #52c41a; }
.wm-dot.off { color: #bfbfbf; }
.wm-hint { font-size: 12px; font-weight: 400; color: #8c8c8c; }
.wm-cred-row { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.wm-cred { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #595959; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 6px; padding: 6px 12px; }
.wm-cred-name { font-weight: 600; color: #262626; }
.wm-steps { margin: 12px 0 0 0; padding-left: 20px; font-size: 13px; color: #595959; line-height: 2; }
.wm-steps code { background: #f9f0ff; color: var(--color-primary); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.wm-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.wm-toolbar-title { margin-left: auto; font-size: 13px; font-weight: 600; color: #8c8c8c; }
.wm-result { padding: 16px; }
.wm-alert { background: #fff1f0; border: 1px solid #ffa39e; color: #cf1322; border-radius: 6px; padding: 12px 14px; font-size: 13px; line-height: 1.8; }
.wm-alert code { background: rgba(207,19,34,0.08); border-radius: 4px; padding: 1px 6px; }
.wm-demo-banner { background: #fff7e6; border: 1px solid #ffd591; color: #ad4e00; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.wm-ok-banner { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.wm-guide { padding: 16px 20px; }
.wm-guide .wm-steps { margin-top: 8px; }

/* ===== P4: 价值看板 ===== */
.vd-page { padding: 0; }
.vd-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.vd-header-left h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.vd-subtitle { margin: 0; font-size: 13px; color: var(--color-text-3); }
.vd-merchant-select { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }
.vd-loading { text-align: center; padding: 60px 0; color: var(--color-text-3); font-size: 14px; }
.vd-error { text-align: center; padding: 40px 0; color: #cf1322; font-size: 14px; }
.vd-section { margin-bottom: 24px; }
.vd-section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-left: 4px; }
.vd-stat-grid { display: grid; gap: 12px; }
.vd-stat-4 { grid-template-columns: repeat(4, 1fr); }
.vd-stat-3 { grid-template-columns: repeat(3, 1fr); }
.vd-stat-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 10px; padding: 16px 18px; transition: box-shadow .2s; }
.vd-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.vd-stat-label { font-size: 12px; color: var(--color-text-3); margin-bottom: 8px; }
.vd-stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--color-text-1); }
.vd-stat-sub { font-size: 12px; color: var(--color-text-3); margin-top: 6px; }
.vd-stat-highlight { background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%); border-color: #FDE68A; }
.vd-stat-highlight .vd-stat-value { color: #D97706; }
.vd-progress { height: 6px; background: #f0f0f0; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.vd-progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease; min-width: 2px; }
.vd-retention-card { text-align: center; }
.vd-insights { background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%); border-radius: 10px; padding: 16px 18px; }
.vd-insight-item { padding: 8px 0; border-bottom: 1px dashed rgba(0,0,0,0.06); font-size: 13px; line-height: 1.7; color: var(--color-text-2); }
.vd-insight-item:last-child { border-bottom: none; }
.vd-insight-item::before { content: '→ '; color: var(--color-primary); font-weight: 700; }
@media (max-width: 900px) {
  .vd-stat-4 { grid-template-columns: repeat(2, 1fr); }
  .vd-stat-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== P7: 微信集成中心 ===== */
/* 顶部 3 个 KPI 卡片 */
.wx-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.wx-kpi-card { padding: 18px 20px; position: relative; overflow: hidden; }
.wx-kpi-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--color-primary); }
.wx-kpi-card.kpi-warn::before { background: #F59E0B; }
.wx-kpi-card.kpi-ok::before { background: #10B981; }
.wx-kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wx-kpi-title { font-size: 14px; font-weight: 600; color: var(--color-text-1); display: flex; align-items: center; gap: 6px; }
.wx-kpi-stat { font-size: 22px; font-weight: 700; color: var(--color-text-1); margin: 4px 0; }
.wx-kpi-stat .stat-sub { font-size: 13px; color: var(--color-text-3); font-weight: 400; margin-left: 4px; }
.wx-kpi-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 支付分账详情 6 项 2 列网格 */
.wx-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.wx-detail-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--color-border); }
.wx-detail-item .wx-check-label { flex: 1; color: var(--color-text-1); }
.wx-detail-item .wx-check-label .label-sub { color: var(--color-text-3); font-size: 12px; margin-left: 4px; }

/* 订阅消息模板 2×4 网格 */
.wx-tmpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wx-tmpl-cell { padding: 12px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-bg-2); transition: all 0.2s; }
.wx-tmpl-cell.configured { background: #F0FDF4; border-color: #BBF7D0; }
.wx-tmpl-name { font-size: 13px; font-weight: 500; color: var(--color-text-1); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.wx-tmpl-id { font-size: 11px; color: var(--color-text-3); font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 企微托管：左统计 + 右租户表 */
.wx-wecom-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.wx-wecom-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.wx-wecom-stat { padding: 12px; background: var(--color-bg-2); border-radius: 6px; text-align: center; }
.wx-wecom-stat .v { font-size: 20px; font-weight: 700; color: var(--color-text-1); }
.wx-wecom-stat .v.text-warn { color: #F59E0B; }
.wx-wecom-stat .v.text-ok { color: #10B981; }
.wx-wecom-stat .l { font-size: 12px; color: var(--color-text-3); margin-top: 2px; }

/* 通用 */
.wx-section { margin-bottom: 16px; }
.wx-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.wx-section-head h3 { font-size: 15px; font-weight: 600; color: var(--color-text-1); display: flex; align-items: center; gap: 8px; }
.wx-section-head .wx-section-actions { display: flex; gap: 8px; align-items: center; }
.wx-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.wx-check.wx-ok { background: #D1FAE5; color: #059669; }
.wx-check.wx-no { background: #FEE2E2; color: #DC2626; }
.wx-check.wx-info { background: #DBEAFE; color: #2563EB; }
.wx-int-page { padding: 0; }
.wx-tenant-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.badge-muted { background: #f0f0f0; color: #999; }
.badge-info { background: #DBEAFE; color: #2563EB; }

@media (max-width: 1100px) {
  .wx-kpi-grid { grid-template-columns: 1fr; }
  .wx-tmpl-grid { grid-template-columns: repeat(2, 1fr); }
  .wx-wecom-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wx-detail-grid { grid-template-columns: 1fr; }
  .wx-tmpl-grid { grid-template-columns: 1fr; }
}

/* P1-4 阶梯激励 */
.tc-page .page-head h2 { font-size: 20px; }
.tc-page .data-table th { white-space: nowrap; }
.tc-page .form-input { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; }
.tc-page .form-input:focus { border-color: #722ED1; outline: none; box-shadow: 0 0 0 2px rgba(114,46,209,0.1); }

.loading-text { color: var(--text-secondary, #999); font-size: 13px; }

/* ===== P9-1: 周报 AI 解读卡片 ===== */
.ai-insight-card { border: 1px solid #D8E3DC; border-radius: 10px; padding: 16px; background: linear-gradient(180deg, #F6FBF8 0%, #FFFFFF 60%); }
.ai-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ai-header-left { display: flex; align-items: center; gap: 8px; }
.ai-title { font-weight: 700; font-size: 15px; }
.ai-engine-badge { font-size: 11px; color: #0F6E56; background: #E3F2EC; border-radius: 10px; padding: 2px 8px; }
.ai-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ai-score-ring { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #0F6E56; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; }
.ai-score-num { font-size: 22px; font-weight: 800; line-height: 1; }
.ai-score-label { font-size: 11px; color: var(--color-text-3, #999); margin-top: 2px; }
.ai-headline { font-size: 14px; font-weight: 600; line-height: 1.6; }
.ai-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ai-section { border-radius: 8px; padding: 10px 12px; border: 1px solid #E5E7EB; background: #fff; }
.ai-sec-highlight { border-color: #A7E3C4; background: #F2FBF6; }
.ai-sec-risk { border-color: #F3C6C6; background: #FDF5F5; }
.ai-sec-action { border-color: #F0D9A8; background: #FFFCF2; }
.ai-sec-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: var(--color-text-2, #444); }
.ai-item { margin-bottom: 8px; }
.ai-item:last-child { margin-bottom: 0; }
.ai-item b { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 2px; flex-wrap: wrap; }
.ai-item span { display: block; font-size: 12px; color: var(--color-text-3, #777); line-height: 1.6; }
.ai-level, .ai-prio { font-style: normal; font-size: 10px; border-radius: 8px; padding: 1px 6px; font-weight: 600; }
.ai-risk-high { background: #FDE2E2; color: #A32D2D; }
.ai-risk-mid { background: #FDEBC8; color: #92600A; }
.ai-risk-low { background: #E8E8E8; color: #666; }
.ai-p0 { background: #A32D2D; color: #fff; }
.ai-p1 { background: #D97706; color: #fff; }
.ai-p2 { background: #E5E7EB; color: #555; }
.ai-sop { font-style: normal; font-size: 10px; color: #1D5BBF; background: #E5EEFC; border-radius: 8px; padding: 1px 6px; }

/* ===== P9-2: 朋友圈排期日历 ===== */
.ms-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.ms-form-merchants { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 8px 0; }
.ms-merchant-check { font-size: 13px; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ms-calendar { border: 1px solid #E5E7EB; border-radius: 10px; overflow-x: auto; background: #fff; }
.ms-cal-row { display: grid; grid-template-columns: 140px repeat(7, minmax(130px, 1fr)); border-bottom: 1px solid #EEF0F2; }
.ms-cal-row:last-child { border-bottom: none; }
.ms-cal-head { background: #F7F9FA; }
.ms-cal-merchant { padding: 10px 12px; font-size: 13px; font-weight: 600; display: flex; align-items: center; border-right: 1px solid #EEF0F2; }
.ms-cal-day-head { padding: 8px 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--color-text-2, #444); }
.ms-cal-date { display: block; font-size: 11px; font-weight: 400; color: var(--color-text-3, #999); }
.ms-cal-cell { padding: 8px; border-left: 1px solid #F3F4F6; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.ms-cell-empty { border-left: 1px solid #F3F4F6; background: #FAFBFC; }
.ms-cell-planned { background: #FFFCF2; }
.ms-cell-posted { background: #F2FBF6; }
.ms-cell-skipped { background: #F7F7F7; opacity: 0.75; }
.ms-cell-content { font-size: 12px; line-height: 1.5; color: var(--color-text-1, #333); flex: 1; }
.ms-cell-footer { margin-top: 6px; }
.ms-badge { font-style: normal; font-size: 10px; border-radius: 8px; padding: 1px 7px; font-weight: 600; }
.ms-posted { background: #DFF3E8; color: #0F6E56; }
.ms-planned { background: #FDEBC8; color: #92600A; }
.ms-skipped { background: #E8E8E8; color: #666; }
.ms-cell-actions { display: flex; gap: 4px; margin-top: 6px; }
.ms-act { border: 1px solid #E0E3E6; background: #fff; border-radius: 5px; width: 24px; height: 22px; font-size: 11px; cursor: pointer; line-height: 1; }
.ms-act:hover { border-color: #B8BEC4; }
.ms-act-post { color: #0F6E56; }
.ms-act-skip { color: #92600A; }
.ms-act-del { color: #A32D2D; }

/* ── v137：商家详情页门店列表缩略图（有图显图 / 无图首字母色块，对齐 C 端 bpp-store-thumb 视觉） ── */
.md-store-cell { display: flex; align-items: center; gap: 10px; }
.md-store-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #F5F5F5; }
.md-store-thumb-fallback { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #FF8A3D, #E63946); }

/* ═══ v190：商家推广弹窗（商家列表「📱 推广」→ mpm-* = merchant promo modal） ═══ */
.mpm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.mpm-box { background: #fff; border-radius: 14px; padding: 16px 18px 14px; width: 360px; max-width: calc(100vw - 32px); max-height: 92vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center; position: relative; } /* v214：弹窗瘦身 400→360，配合 QR 200px 视觉更精致紧凑 */
.mpm-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: #bbb; }
.mpm-close:hover { color: #666; }
.mpm-title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; line-height: 1.45; }
.mpm-emoji { display: inline-block; font-size: 17px; margin-right: 3px; vertical-align: -2px; }
.mpm-sub { font-size: 12px; color: #fa541c; font-weight: 500; margin-bottom: 14px; line-height: 1.5; }
.mpm-qr-wrap { margin: 0 auto 8px; border: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #FFF7F0 0%, #FFF1E0 100%); padding: 12px; min-width: 160px; min-height: 160px; max-width: 200px; max-height: 200px; box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.12), 0 4px 16px rgba(255, 106, 0, 0.08); } /* v211+v212+v214：max 兜底 + 品牌渐变背景 + 柔和阴影 + 240→200 进一步压缩 */
.mpm-qr-loading { color: #bbb; font-size: 13px; padding: 70px 40px; }
/* v271：QR dump 内嵌状态 badge —— 三色（pending 灰/offline 绿/online-only 黄），二维码下方一行小标签提示当前 QR 是否含完整 dump */
.mpm-dump-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 0 auto 10px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: 0.2px; transition: all .2s ease; }
.mpm-dump-badge .mpm-dump-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.mpm-dump-badge[data-mode="pending"] { background: #F3F4F6; color: #6B7280; }
.mpm-dump-badge[data-mode="pending"] .mpm-dump-dot { animation: mpmDumpPulse 1.2s ease-in-out infinite; }
.mpm-dump-badge[data-mode="offline"] { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.mpm-dump-badge[data-mode="online-only"] { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
/* v277：QR 基址指向本机（localhost）—— 手机扫码打不开的醒目警告（红底，比 online-only 黄更强一级） */
.mpm-dump-badge[data-mode="local-warn"] { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; text-align: left; white-space: normal; line-height: 1.5; }
@keyframes mpmDumpPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.mpm-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 6px; } /* v215：3 按钮等分（原 4 按钮 2 列）—— 主色「保存二维码图片」跨第 1 列视觉占满前 1/3 */
.mpm-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; background: #fff; color: #333; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .15s; }
.mpm-btn:hover:not(:disabled) { border-color: #FF6A00; color: #FF6A00; background: #FFF7F0; }
.mpm-btn:disabled { opacity: .5; cursor: not-allowed; }
.mpm-btn-primary { background: linear-gradient(135deg, #FF6A00 0%, #FF8C42 100%); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(255, 106, 0, 0.28); font-weight: 600; } /* v212：主按钮品牌色（下载最常用，视觉强引导） */
.mpm-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #FF5500 0%, #FF7A30 100%); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4); }
.mpm-btn-icon { font-size: 14px; }
.mpm-btn-soon { position: relative; }
.mpm-details { margin-top: 10px; text-align: left; }
.mpm-details summary { font-size: 11px; color: #1677ff; cursor: pointer; }
.mpm-link-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.mpm-link-label { font-size: 11px; color: #999; white-space: nowrap; line-height: 24px; }
.mpm-details textarea { flex: 1; height: 44px; padding: 5px 7px; font-family: monospace; font-size: 10px; border: 1px solid #f0f0f0; border-radius: 4px; background: #fafafa; word-break: break-all; resize: none; }
/* v223：线上站点地址配置（本地编辑时让 QR 指向部署站） */
.mpm-base-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mpm-base-col input { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 11px; border: 1px solid #e5e7eb; border-radius: 4px; background: #fff; }
.mpm-base-col input:focus { outline: none; border-color: #FF6A00; }
.mpm-base-hint { font-size: 10px; color: #bfbfbf; line-height: 1.5; }
.mpm-btn-base-save { width: 100%; margin-top: 2px; }

/* ═══ v190：商家推广落地页（#/store-promo，顾客扫码进入，sp-* = store promo） ═══ */
/* v257：原 `.sp-page` 默认 max-width:480px 是给移动 H5 落地页用的（store-promo），
   后台管理页（员工码）误用这套样式导致整个页面被压成居中 480px 重排版崩溃。
   拆成两个 modifier：--h5 落地页（保留 480px）+ --admin 后台管理页（铺满 1200px 内居中，移动端退化全宽） */
.sp-page.sp-page--h5 { min-height: 100vh; max-width: 480px; margin: 0 auto; background: #F7F8FA; padding-bottom: 32px; }
.sp-page.sp-page--admin { padding: 24px 28px 32px; max-width: 100%; }
@media (max-width: 768px) {
  .sp-page.sp-page--admin { max-width: 100%; padding: 12px 14px 24px; }
}
.sp-hero { background: linear-gradient(135deg, #FF8A3D 0%, #E63946 100%); padding: 44px 24px 36px; text-align: center; color: #fff; }
.sp-hero-logo { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 36px; border: 2px solid rgba(255,255,255,.5); }
.sp-hero-name { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.sp-hero-slogan { font-size: 13px; opacity: .9; }
.sp-section { padding: 16px 16px 0; }
.sp-section-title { font-size: 15px; font-weight: 700; color: #1F1F1F; margin-bottom: 10px; }
.sp-store-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.sp-store-name { font-size: 15px; font-weight: 600; color: #1F1F1F; margin-bottom: 6px; }
.sp-store-addr { font-size: 12px; color: #666; line-height: 1.6; }
.sp-store-phone { font-size: 12px; color: #FF6A00; margin-top: 4px; }
.sp-card-item { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sp-card-item-name { font-size: 14px; font-weight: 600; color: #1F1F1F; }
.sp-card-item-meta { font-size: 11px; color: #999; margin-top: 4px; }
.sp-card-item-price { font-size: 20px; font-weight: 700; color: #E63946; white-space: nowrap; }
.sp-price-cur { font-size: 12px; }
.sp-cta { margin: 22px 16px 0; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, #FFF3E8, #FFE8E0); text-align: center; }
.sp-cta-text { font-size: 14px; font-weight: 600; color: #E63946; }
.sp-footer { text-align: center; font-size: 11px; color: #bbb; margin-top: 24px; }
.sp-card { background: #fff; border-radius: 12px; padding: 24px; margin: 60px 16px 0; text-align: center; }
.sp-empty { font-size: 14px; color: #666; line-height: 1.8; }
.sp-empty span { font-size: 12px; color: #999; }
.md-store-thumb-letter { font-size: 16px; font-weight: 700; color: #fff; line-height: 1; }

/* v216：欢聚卡推广码按钮 —— 精致化重设计
   从「重橙渐变填充 + 14px 大字 + 大阴影」改成「浅橙渐变 + 深橙文字 + SVG 图标 + QR 角标 + 紧凑尺寸」，
   和同行「开卡记录/核销记录」按钮走同套橙色家族但层级更显眼，整体克制协调。 */
.cards-link-promo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 4px 4px 8px;
  margin: 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: #C2410C;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEAD0 100%);
  border: 1px solid #FFD8B0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(255, 138, 0, 0.08);
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1.4;
}
.cards-link-promo-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.85;
}
.cards-link-promo-label {
  position: relative;
  padding-right: 4px;
}
.cards-link-promo-label::after {
  content: 'QR';
  margin-left: 5px;
  padding: 1px 4px 0;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #FF6A00, #FF8C42);
  border-radius: 3px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  display: inline-block;
}
.cards-link-promo:hover {
  background: linear-gradient(135deg, #FFEDD5 0%, #FFD8A8 100%);
  border-color: #FFB877;
  color: #9A3412;
  box-shadow: 0 2px 6px rgba(255, 138, 0, 0.18);
}
.cards-link-promo:active {
  box-shadow: 0 1px 2px rgba(255, 138, 0, 0.12);
  background: linear-gradient(135deg, #FFEAD0 0%, #FFD8A8 100%);
}

/* v192 修订：欢聚卡列表行 —— 留白更宽，操作列更舒展 */
.cards-list tbody tr td.cards-actions,
.cards-list tbody tr td:last-child {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  white-space: nowrap;
}

