/* 运动家商城 · 管理端样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #2c3e50; }
a { text-decoration: none; color: inherit; }
input, select, textarea { padding: 8px 10px; border: 1px solid #d8dee4; border-radius: 6px; font-size: 14px; width: 100%; background: #fff; }
input:focus, select:focus { outline: none; border-color: #2456a8; }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0d1f3c, #2456a8); }
.login-card { background: #fff; padding: 40px; border-radius: 12px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-logo { font-size: 28px; font-weight: 800; color: #2456a8; margin-bottom: 4px; }
.login-sub { color: #7f8c9b; font-size: 13px; margin-bottom: 24px; }
.login-card input { margin-bottom: 14px; height: 42px; }
.err-msg { color: #e74c3c; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 主布局 */
#main-view { display: flex; min-height: 100vh; }
#sidebar { width: 200px; background: #0d1f3c; color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px; font-size: 20px; font-weight: 800; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); }
#menu { flex: 1; padding: 10px 0; }
.menu-item { display: block; padding: 11px 20px; color: #c9d4e8; font-size: 14px; cursor: pointer; }
.menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.menu-item.active { background: #2456a8; color: #fff; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: #c9d4e8; }
.sidebar-foot .btn { margin-top: 8px; }

.content { flex: 1; padding: 20px; max-width: 100%; overflow-x: auto; }
.view-title { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.view-desc { color: #7f8c9b; font-size: 13px; margin-bottom: 12px; }

/* 卡片 */
.card { background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.card h3 { font-size: 15px; margin-bottom: 12px; color: #34495e; }
.half { flex: 1; }
.row { display: flex; gap: 16px; }
.grow { flex: 1; }

/* 表单 */
.form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.form-group { flex: 0 0 auto; }
.form-group.grow { flex: 1; }
.form-group label { display: block; font-size: 12px; color: #7f8c9b; margin-bottom: 4px; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 14px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; background: #e8ecf1; color: #34495e; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: #2456a8; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-success { background: #1e7d5c; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-block { display: block; width: 100%; margin-top: 10px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #f0f3f8; padding: 10px; text-align: left; font-weight: 600; color: #34495e; }
.table td { padding: 9px 10px; border-bottom: 1px solid #eef1f5; }
.table tr:hover td { background: #fafbfd; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.tag-green { background: #e8f8ef; color: #1e7d5c; }
.tag-red { background: #fdecea; color: #e74c3c; }
.tag-blue { background: #e8f0fd; color: #2456a8; }
.tag-orange { background: #fdf3e7; color: #e67e22; }
.tag-gray { background: #f0f0f0; color: #7f8c9b; }

/* 经营分析 */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dash-card { background: #f8fafc; border: 1px solid #eef1f5; border-radius: 8px; padding: 16px; text-align: center; }
.dash-label { font-size: 12px; color: #7f8c9b; margin-bottom: 6px; }
.dash-val { font-size: 20px; font-weight: 800; color: #2456a8; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar-item { flex: 1; text-align: center; }
.bar { background: #2456a8; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-label { font-size: 10px; color: #7f8c9b; margin-top: 4px; }

/* 收银 */
.pos-wrap { display: flex; gap: 16px; }
.pos-left { flex: 1 1 auto; }
.pos-right { flex: 0 0 340px; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pos-pitem { border: 1px solid #e8ecf1; border-radius: 8px; padding: 12px; cursor: pointer; transition: all 0.15s; }
.pos-pitem:hover { border-color: #2456a8; background: #f0f5fd; }
.pi-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pi-stock { font-size: 11px; color: #7f8c9b; }
.pi-price { font-size: 14px; font-weight: 800; color: #e67e22; margin-top: 4px; }
.pos-total { font-size: 18px; font-weight: 800; text-align: right; margin: 10px 0; color: #e67e22; }
.red-text { color: #e74c3c; font-weight: 700; }
.green-text { color: #1e7d5c; font-weight: 700; }
.mt10 { margin-top: 10px; }
.thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }

/* 订单 */
.order-card { border: 1px solid #eef1f5; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.oc-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.oc-no { font-weight: 700; }
.oc-body { padding: 6px 0; }
.oi-item { font-size: 13px; color: #34495e; padding: 2px 0; }
.oc-foot { border-top: 1px solid #eef1f5; padding-top: 8px; font-size: 12px; color: #7f8c9b; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal-lg { width: 720px; }
.modal-title { padding: 16px 20px; font-size: 16px; font-weight: 700; border-bottom: 1px solid #eef1f5; position: relative; }
.modal-x { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #999; font-size: 18px; padding: 4px 8px; border-radius: 4px; }
.modal-x:hover { color: #333; background: #f0f2f5; }
.modal-body { padding: 18px 20px; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 200; opacity: 0; transform: translateY(-10px); transition: all 0.2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #1e7d5c; }
.toast.error { background: #e74c3c; }
.toast.info { background: #2456a8; }
.empty { text-align: center; color: #7f8c9b; padding: 30px; font-size: 13px; }
.pd-item { padding: 6px 0; font-size: 13px; border-bottom: 1px dashed #eee; }

/* 响应式 */
@media (max-width: 900px) {
  #sidebar { width: 160px; }
  .row { flex-direction: column; }
  .pos-wrap { flex-direction: column; }
  .pos-right { flex: auto; }
}
@media (max-width: 768px) {
  /* 侧栏 → 顶部栏 + 抽屉菜单 */
  .mobile-topbar { display: flex !important; }
  .sidebar-mask { display: block !important; }
  #main-view { flex-direction: column; padding-top: 44px; }
  #sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 260px; height: 100vh; z-index: 70; transition: left .25s; flex-direction: column; }
  #sidebar.open { left: 0; }
  #menu { display: block; padding: 4px 0; overflow-y: auto; }
  .menu-item { padding: 13px 20px; }
  .menu-group { padding: 14px 20px 4px; }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .content { padding: 12px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  /* 触控与可读性 */
  body { font-size: 14px; }
  .btn { min-height: 36px; padding: 8px 14px; font-size: 14px; }
  .btn-sm { min-height: 32px; padding: 6px 12px; }
  .btn-xs { min-height: 32px; padding: 6px 10px; font-size: 12px; }
  .table td { padding: 10px 8px; }
  /* 表格关键列：手机隐藏次要列 */
  .col-md-hide { display: none; }
  /* 弹窗 → 底部全屏 Sheet */
  .modal-mask { align-items: flex-end; }
  .modal-box, .modal-lg, .modal { width: 100% !important; max-width: 100% !important; min-width: 0; max-height: 92vh; border-radius: 16px 16px 0 0; margin-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  /* Toast 移到底部，避让刘海/顶栏 */
  .toast { top: auto; bottom: 74px; right: 14px; left: 14px; }
  .form-row { flex-direction: column; }
  .form-actions { flex-wrap: wrap; }
}

/* ===== v2 新增样式 ===== */
.toolbar { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gray { color: #888; } .red { color: #e74c3c; font-weight: 600; } .green { color: #27ae60; font-weight: 600; }
.mb10 { margin-bottom: 10px; } .mt10 { margin-top: 10px; }
/* 模态弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-box { background: #fff; border-radius: 10px; padding: 18px 20px; min-width: 340px; max-width: 640px; width: 92%; max-height: 86vh; overflow: auto; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 12px; }
.modal-x { background: none; border: none; font-size: 16px; cursor: pointer; color: #888; }
/* 商品 SKU 行 */
.skus-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.skus-row input { flex: 1; padding: 6px; border: 1px solid #ddd; border-radius: 6px; }
.sk-stock { white-space: nowrap; color: #888; font-size: 12px; }
.prod-sku { display: inline-block; background: #f0f4ff; border: 1px solid #d6e0f5; border-radius: 4px; padding: 2px 6px; margin: 2px; font-size: 12px; }
/* 标签选择 */
.tag-chk { display: inline-block; background: #f5f5f5; border-radius: 16px; padding: 4px 10px; margin: 4px; cursor: pointer; }
.tag-pick, .roles-pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
/* 盘点板 */
.st-board { max-height: 300px; overflow: auto; }
.st-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #eee; }
.st-info { flex: 1; font-size: 13px; } .st-info small { color: #999; margin-left: 8px; }
.st-act { width: 90px; padding: 5px; border: 1px solid #ddd; border-radius: 6px; text-align: center; }
.st-diff { width: 90px; font-weight: 600; }
/* 订单卡片 */
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.order-time { margin-left: auto; color: #999; font-size: 12px; }
.order-items { margin: 6px 0; color: #555; font-size: 13px; }
.order-foot { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.tag { display: inline-block; background: #eef2ff; color: #3b5bdb; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.tag-pending_pay { background:#fff3cd;color:#856404; } .tag-refunded { background:#f8d7da;color:#842029; } .tag-paid { background:#d1e7dd;color:#0f5132; } .tag-cancelled { background:#e2e3e5;color:#41464b; }
/* POS 商品项 */
.pi-spec { font-size: 12px; color: #666; margin: 2px 0; }
.pi-code { color: #aaa; font-size: 11px; }
.btn-warn { background: #f39c12; color: #fff; border: none; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn-xs { padding: 2px 8px; font-size: 12px; }
/* 库存中心 */
.row-warn { background: #fdeaea !important; }
.row-warn td { color: #b02a37; font-weight: 600; }
.tfoot-row { background: #f0f4ff; font-weight: 700; border-top: 2px solid #c9d6ff; }

/* 进货入库页 */
.req { color: #e74c3c; }
.purchase-toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; align-items: flex-end; }
.purchase-toolbar .form-group { flex: 0 0 auto; }
.purchase-toolbar .form-group.cat { flex: 0 0 190px; }
.purchase-toolbar .form-group.grow { flex: 1; min-width: 220px; }
.pu-selected { display: none; background: #f7f9fc; border: 1px solid #e3e9f2; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #34495e; }
.pu-selected .pu-tag { display: inline-flex; align-items: center; margin-right: 18px; margin-bottom: 2px; }
.pu-selected b { color: #2c3e50; margin-right: 4px; }
.pu-selected .pu-badge { color: #2c6ef0; font-weight: 700; }
.pu-amount { background: #f0f4ff; border: 1px solid #c9d6ff; border-radius: 6px; padding: 9px 14px; font-size: 16px; font-weight: 700; color: #2c6ef0; min-width: 130px; text-align: center; }
.pu-amount .u { font-size: 11px; color: #7f8c9b; font-weight: 400; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-actions .btn { min-width: 112px; }

/* 分组表头：基础区/价格区/库存区 */
.th-base { background: #eef4ff; }
.th-price { background: #fff4e6; }
.th-stock { background: #e9fbe9; }
.table thead th { white-space: nowrap; }

/* Excel 导入向导 */
.imp-body { min-width: 480px; }
.imp-step h4 { margin: 0 0 8px; }
.imp-sheet { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #e3e6ea; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.imp-sheet.sel { border-color: #2d8cf0; background: #f0f7ff; }
.imp-sheet input { margin: 0; }
.imp-col { white-space: nowrap; }
.imp-map { width: 100%; }
.imp-warn { margin: 8px 0 0; font-size: 13px; }
.imp-result .ok { color: #27ae60; font-weight: 600; margin-right: 16px; }
.imp-result .bad { color: #e74c3c; font-weight: 600; }
.toolbar .btn { margin-right: 6px; }

/* ========== 手机适配 + 电脑布局优化 ========== */
/* 手机顶栏（默认隐藏，≤768 显示） */
.mobile-topbar { display: none; }
.mt-hamburger { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 4px 10px; min-height: 44px; }
.mt-brand { font-weight: 800; font-size: 16px; color: #fff; white-space: nowrap; }
.mt-page { font-size: 13px; color: #c9d4e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-flex { flex: 1; }
.mt-logout { background: rgba(255,255,255,0.16); color: #fff; border: none; }
.sidebar-mask { display: none; }
@media (min-width: 769px) { .sidebar-mask { display: none !important; } }

/* 菜单分组小标题 */
.menu-group { padding: 12px 20px 4px; font-size: 11px; color: #6b7a90; letter-spacing: 1px; }
.menu-group:first-child { padding-top: 8px; }

/* iOS 安全区 */
body { padding-bottom: env(safe-area-inset-bottom); }
.content { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }

/* 电脑端内容最大宽度居中（超宽屏可读） */
@media (min-width: 1200px) {
  .content { max-width: 1400px; margin: 0 auto; }
}

/* 表格斑马纹 + 表头吸顶 */
.table tbody tr:nth-child(even) td { background: #fafbfd; }
.table thead th { position: sticky; top: 0; z-index: 3; }
@media (max-width: 768px) { .table thead th { top: 44px; } }

/* 金额列右对齐 + 等宽数字 */
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 快捷入口（POS 顺手拉线 / 商品空态 Excel 导入）由各视图内联渲染 */

/* POS 手机底部合计条（购物车 → 底部固定抽屉，合计+提交在底部拇指热区） */
@media (max-width: 768px) {
  .pos-wrap { flex-direction: column; }
  .pos-left { padding-bottom: 58vh; }
  .pos-right { order: -1; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.10); border-radius: 14px 14px 0 0; max-height: 56vh; display: flex; padding: 10px 12px calc(env(safe-area-inset-bottom) + 8px); }
  .pos-right .card { display: flex; flex-direction: column; max-height: 100%; overflow: auto; width: 100%; margin: 0; }
  .pos-right .card h3 { position: sticky; top: 0; background: #fff; z-index: 3; }
  .pos-total { position: sticky; bottom: 0; background: #fff; z-index: 2; margin: 6px 0; }
  #pos-submit { position: sticky; bottom: 0; }
  .pos-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos-products .pos-pitem { min-width: 0; }
}

/* ==================== 员工管理 v3 · 右侧抽屉 ==================== */
.emp-drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; }
.emp-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 600px; max-width: 94vw; background: #fff; z-index: 201; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,0.12); animation: drawerIn .28s ease; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
.emp-drawer-head { padding: 16px 20px; font-size: 16px; font-weight: 800; border-bottom: 1px solid #eef1f5; display: flex; justify-content: space-between; align-items: center; background: #1E40AF; color: #fff; flex-shrink: 0; }
.emp-drawer-tabs { display: flex; border-bottom: 1px solid #eef1f5; background: #f8fafc; flex-wrap: wrap; flex-shrink: 0; }
.emp-tab { padding: 11px 16px; cursor: pointer; font-size: 13px; color: #555; border-bottom: 2px solid transparent; }
.emp-tab.active { color: #1E40AF; font-weight: 700; border-bottom-color: #1E40AF; }
.emp-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.emp-pane { display: none; } .emp-pane.active { display: block; }
.emp-stats { padding: 10px 14px; background: #f0f7ff; border-radius: 8px; margin-bottom: 10px; font-size: 13px; color: #1E40AF; }
.emp-status-big { display: flex; gap: 12px; margin: 14px 0; }
.emp-status-big .btn { flex: 1; padding: 12px; font-size: 15px; }
.emp-role-item { padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.emp-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.emp-badge-on { background: #e8f5e9; color: #2e7d32; }
.emp-badge-off { background: #fbe9e7; color: #c62828; }
.emp-badge-gray { background: #eee; color: #666; }
.emp-log-item { padding: 8px 0; border-bottom: 1px dashed #eef1f5; font-size: 13px; }
.emp-log-time { color: #999; font-size: 11px; margin-left: 8px; }
@media (max-width: 768px) {
  .emp-drawer { width: 100%; max-width: 100%; }
  .emp-drawer-head { padding-top: calc(14px + env(safe-area-inset-top)); }
}

/* ===== 会员管理 v1（CRM：琥珀橙主题 + KPI + RFM九宫格，批次A） ===== */
.member-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.mtab { padding: 8px 14px; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: #555; }
.mtab.active { background: #F59E0B; border-color: #F59E0B; color: #fff; font-weight: 600; }
.mtab:disabled { opacity: .5; cursor: not-allowed; }
.empty-tab { color: #999; text-align: center; padding: 40px; font-size: 14px; }
.member-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mem-search { flex: 1; min-width: 180px; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }
.member-toolbar select { padding: 7px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; background: #fff; }
.member-hint { font-size: 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.kpi { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 12px 10px; text-align: center; }
.kpi-num { font-size: 22px; font-weight: 700; color: #c2410c; }
.kpi-lab { font-size: 12px; color: #9a3412; margin-top: 4px; }
.m-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.m-avatar-txt { display: inline-flex; align-items: center; justify-content: center; background: #F59E0B; color: #fff; font-weight: 600; }
.m-name { vertical-align: middle; }
.lvl { padding: 2px 8px; border-radius: 20px; font-size: 12px; color: #fff; }
.lv-normal { background: #9ca3af; }
.lv-silver { background: #94a3b8; }
.lv-gold { background: #d97706; }
.lv-big { background: #dc2626; }
.tag-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; color: #fff; margin: 2px 2px 2px 0; }
.seg-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; color: #fff; }
/* RFM 九宫格 */
.rfm-wrap { display: grid; grid-template-columns: 90px repeat(3, 1fr); gap: 8px; margin: 14px 0 22px; }
.rfm-colfix { display: contents; }
.rfm-colhead { text-align: center; font-weight: 600; color: #92400e; font-size: 13px; padding: 6px; }
.rfm-rowhead { display: flex; align-items: center; justify-content: center; font-weight: 600; color: #92400e; font-size: 12px; padding: 6px; }
.rfm-cell { border: 2px solid #e2e8f0; border-radius: 10px; padding: 14px 8px; text-align: center; min-height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: default; background: #f8fafc; }
.rfm-cell.has { cursor: pointer; background: #fff; transition: transform .15s; }
.rfm-cell.has:hover { transform: scale(1.04); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.rfm-cnt { font-size: 22px; font-weight: 700; color: #374151; }
.rfm-lb { font-size: 12px; color: #6b7280; margin-top: 4px; }
/* 8类分层卡片 */
.seg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.seg-card { background: #fff; border: 1px solid #e5e7eb; border-left-width: 4px; border-radius: 10px; padding: 12px 14px; }
.seg-tt { font-weight: 600; color: #1f2937; font-size: 14px; }
.seg-n { font-weight: 400; color: #F59E0B; font-size: 12px; }
.seg-desc { color: #6b7280; font-size: 12px; margin: 4px 0; }
.seg-strat { color: #92400e; font-size: 12px; }
/* 详情modal */
.md-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.md-name { font-size: 17px; font-weight: 700; }
.md-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.md-kpis div { background: #fff7ed; border-radius: 8px; padding: 8px; text-align: center; }
.md-kpis b { display: block; font-size: 16px; color: #c2410c; }
.md-kpis span { font-size: 11px; color: #9a3412; }
.md-tags { margin: 8px 0; }
.md-rfm { margin-top: 10px; font-size: 12px; }
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .rfm-wrap { grid-template-columns: 56px repeat(3, 1fr); gap: 4px; }
  .rfm-cell { min-height: 58px; padding: 8px 2px; }
  .rfm-cnt { font-size: 17px; }
  .rfm-lb { font-size: 10px; }
  .member-toolbar .mem-search { min-width: 100%; }
}

/* ===== 会员管理 v1 · 批次C：数据分析 + 详情抽屉6Tab ===== */
.ana-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.ana-card h4 { margin-bottom: 10px; font-size: 14px; color: #374151; }
.pie-wrap { display: flex; align-items: center; gap: 16px; }
.pie { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; }
.pie-legend { font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.pie-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.hbar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; }
.hbar-lab { width: 64px; text-align: right; color: #555; overflow: hidden; white-space: nowrap; }
.hbar-track { flex: 1; background: #f3f4f6; border-radius: 6px; height: 16px; overflow: hidden; }
.hbar { height: 100%; background: #F59E0B; border-radius: 6px; color: #fff; font-size: 10px; line-height: 16px; text-align: right; padding-right: 4px; box-sizing: border-box; }
.cycle-num { font-size: 26px; font-weight: 700; color: #c2410c; }
.churn-num { font-size: 26px; font-weight: 700; color: #dc2626; }
.churn-track { height: 14px; background: #f3f4f6; border-radius: 8px; overflow: hidden; margin: 8px 0; }
.churn-fill { height: 100%; background: linear-gradient(90deg, #F59E0B, #dc2626); border-radius: 8px; }
.md-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.mdtab { padding: 6px 12px; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: #555; }
.mdtab.active { background: #F59E0B; border-color: #F59E0B; color: #fff; font-weight: 600; }
.md-info { font-size: 12px; color: #6b7280; margin: 10px 0; }
@media (max-width: 768px) { .ana-grid { grid-template-columns: 1fr; } }

/* DEEPLINK 深链定位高亮闪烁（订单/拉线 focus 定位） */
@keyframes row-flash-kf { 0%, 100% { background-color: transparent; } 50% { background-color: #fff7d6; } }
.card.row-flash { animation: row-flash-kf 0.5s ease-in-out 4; box-shadow: 0 0 0 2px #ffc107; }
@media (prefers-reduced-motion: reduce) { .card.row-flash { animation: none; box-shadow: 0 0 0 2px #ffc107; } }
