/* ==========================================================================
   DataHub 经营后台 · TDesign 设计系统
   2026-08-25 全站统一腾讯标准:token 化底座 + 组件规范 + 细节美化
   ========================================================================== */

/* ---- Design Tokens ---- */
:root {
  /* 品牌色 */
  --brand: #2E6BFF;
  --brand-hover: #4D82FF;
  --brand-active: #1F55D9;
  --brand-focus: #E8EFFE;
  --brand-disabled: #C3D4FB;
  /* 功能色 */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --error: #E5484D;
  --error-light: #FEE7E8;
  /* 中性色 */
  --text-primary: rgba(0, 0, 0, 0.90);
  --text-secondary: rgba(0, 0, 0, 0.60);
  --text-placeholder: rgba(0, 0, 0, 0.40);
  --text-disabled: rgba(0, 0, 0, 0.26);
  --bg-page: #F5F7FB;
  --bg-container: #FFFFFF;
  --bg-component: #F0F3F8;
  --border-color: #E3E8EF;
  /* 深色侧栏 */
  --sidebar-bg: #17151F;
  --sidebar-active: #2A2440;
  --sidebar-text: rgba(255, 255, 255, 0.72);
  /* 字号阶梯(排版系统) */
  --font-display: 28px;   /* stat 卡大数 */
  --font-title: 20px;     /* 页题 */
  --font-section: 16px;   /* 区题 */
  --font-body: 13px;      /* 正文 */
  --font-label: 12px;     /* 标签/输入 */
  --font-caption: 11px;   /* 注释 */
  /* 间距系统 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 8px 30px rgba(0, 0, 0, 0.16);
}

/* ---- 基础 ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
}
/* ---- 顶部域导航栏(Pop 重设计:白底一体,域 tab 胶囊) ---- */
.topnav {
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 20px;
  background: #FFFFFF; color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 100;
}
.topnav-brand {
  font-size: 14px; font-weight: 800; letter-spacing: 0.5px;
  white-space: nowrap; padding-right: 16px;
  border-right: 1px solid var(--border-color); margin-right: 8px;
}
.topnav-tabs { display: flex; align-items: center; height: 100%; flex: 1; gap: 4px; }
.topnav-tab {
  display: flex; align-items: center; padding: 6px 16px;
  font-size: 13.5px; color: var(--text-secondary); cursor: pointer;
  border-radius: 999px; user-select: none; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.topnav-tab:hover { color: var(--text-primary); background: #EFF3FA; }
.topnav-tab.active { color: #fff; font-weight: 700; background: var(--brand); }
.layout { display: flex; min-height: calc(100vh - 52px); }
.user-area { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-area .user-name { color: var(--text-secondary); font-size: 13px; }
.user-area .logout-btn {
  font-size: 12px; color: var(--text-secondary); background: #fff;
  border: 1px solid var(--border-color); border-radius: 999px;
  padding: 5px 14px; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.user-area .logout-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- 侧边栏(Pop 重设计:白底一体,胶囊导航) ---- */
.sidebar {
  width: 190px; background: #FFFFFF; color: var(--text-primary);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  padding: 20px; font-size: 15px; font-weight: 800;
  white-space: nowrap; letter-spacing: 0.5px;
}
.nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-sec-title {
  padding: 12px 12px 4px; font-size: var(--font-caption);
  color: var(--text-placeholder);
  letter-spacing: 1.2px; user-select: none; white-space: nowrap;
}
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  padding: 10px 12px 4px; font-size: var(--font-caption);
  color: var(--text-placeholder);
  text-transform: uppercase; letter-spacing: 1.2px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.nav-group-title .fold-arrow { font-size: 10px; transition: transform 0.15s; }
.nav-group.folded .fold-arrow { transform: rotate(-90deg); }
.nav-group.folded .nav-item { display: none; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0; padding: 9px 14px; font-size: 13px;
  color: var(--text-secondary); cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #EFF3FA; color: var(--text-primary); }
.nav-item.active {
  background: var(--brand); color: #fff; font-weight: 700;
}
.nav-item.disabled { color: var(--text-disabled); cursor: not-allowed; }
.nav-item.disabled:hover { background: none; }
.nav-item .tag-pending { font-size: 10px; opacity: 0.75; }
.nav-collapse-btn {
  padding: 12px 16px; font-size: 12px; color: var(--text-placeholder);
  cursor: pointer; user-select: none; white-space: nowrap;
  border-top: 1px solid var(--border-color);
}
.nav-collapse-btn:hover { color: var(--brand); background: #EFF3FA; }

/* ---- 侧栏整体折叠(收成图标条,状态存 localStorage) ---- */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .brand { font-size: 0; padding: 20px 0; text-align: center; }
.sidebar.collapsed .brand::after { content: 'DH'; font-size: 14px; font-weight: 700; }
.sidebar.collapsed .nav-group-title {
  font-size: 0; padding: 8px 12px 2px; justify-content: flex-start;
  height: 9px; overflow: hidden;
}
.sidebar.collapsed .nav-sec-title { display: none; }
.sidebar.collapsed .nav-group-title .fold-arrow { display: none; }
.sidebar.collapsed .nav-group { margin-bottom: 2px; }
.sidebar.collapsed .nav-item { padding: 12px 0; justify-content: center; margin: 2px 8px; }
.sidebar.collapsed .nav-item.active { margin-left: 8px; }
.sidebar.collapsed .nav-item .nav-label, .sidebar.collapsed .nav-item .tag-pending { display: none; }
.sidebar.collapsed .nav-item svg { width: 18px; height: 18px; }
.sidebar.collapsed .nav-collapse-btn { padding: 12px 0; text-align: center; }
.sidebar.collapsed .nav-collapse-btn span { display: none; }

/* ---- 响应式(桌面为主,1024/768 两档) ---- */
@media (max-width: 1024px) {
  .sidebar { width: 60px; }
  .sidebar .brand { font-size: 0; padding: 20px 0; text-align: center; }
  .sidebar .brand::after { content: 'DH'; font-size: 14px; font-weight: 700; }
  .nav-group-title { font-size: 0; padding: 10px 0 4px; justify-content: center; }
  .nav-group-title .fold-arrow { display: none; }
  .nav-item { padding: 12px 0; justify-content: center; }
  .nav-item .nav-label, .nav-item .tag-pending { display: none; }
  .nav-item svg { width: 18px; height: 18px; }
}
@media (max-width: 768px) {
  .content { padding: var(--space-3); }
  .topbar { padding: var(--space-2) var(--space-3); }
  .topbar-meta { display: none; }
}

/* ---- 主区 ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--bg-container); border-bottom: 1px solid var(--border-color);
  padding: 12px 24px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-primary); }
.topbar-meta {
  font-size: 11px; color: var(--text-placeholder);
  padding-left: 12px; border-left: 1px solid var(--border-color);
  white-space: nowrap;
}
.content { padding: var(--space-5); flex: 1; }

/* 内容区入场(克制的 staggered reveal) */
.content > * { animation: rise-in 0.32s ease both; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- KPI 卡片 ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.card {
  background: var(--bg-container); border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card.quick-on { border: 1px solid var(--brand); background: var(--brand-focus); }
.card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; letter-spacing: 0.5px; }
.card .value {
  font-size: 28px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px; line-height: 1.2;
}
.card .sub { font-size: 12px; color: var(--text-placeholder); margin-top: 8px; }

/* ---- Bento 网格(总览,2026-08-28 二次形态升级) ---- */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); margin-bottom: var(--space-4); }
.bento-card {
  background: var(--bg-container); border-radius: 12px; padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-1); cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.bento-card:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); }
.bento-head { display: flex; align-items: center; gap: var(--space-3); }
.bento-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-c, var(--brand)); color: #fff;
}
.bento-icon svg { width: 20px; height: 20px; }
.bento-title { font-size: var(--font-section); font-weight: 700; color: var(--text-primary); }
.bento-desc { font-size: var(--font-caption); color: var(--text-secondary); margin-top: 1px; }
.bento-num { font-size: var(--font-display); font-weight: 700; letter-spacing: -1px; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--text-primary); }
.bento-num small { font-size: var(--font-label); font-weight: 500; color: var(--text-secondary); letter-spacing: 0; margin-left: 4px; }
.bento-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: var(--space-4); }
.bento-wide .bento-body { flex: 1; }
.bento-metrics { display: flex; gap: var(--space-5); }
.bento-metric { text-align: right; }
.bento-metric b { display: block; font-size: var(--font-section); font-variant-numeric: tabular-nums; }
.bento-metric span { font-size: var(--font-caption); color: var(--text-secondary); }

/* ---- 入口卡(总览导航台,旧版保留) ---- */
.entry-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-container); border-radius: var(--radius-md);
  padding: 16px 20px; box-shadow: var(--shadow-1); cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.entry-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.entry-card:hover .entry-arrow { transform: translateX(3px); }
.entry-badge {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--brand-focus); color: var(--brand);
  font-weight: 700; font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.entry-body { flex: 1; min-width: 0; }
.entry-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.entry-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.entry-arrow { color: var(--text-placeholder); font-size: 18px; transition: transform 0.15s; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { box-shadow: var(--shadow-2); border: 1px solid var(--brand-focus); }
.status-card { cursor: pointer; border-top: 3px solid transparent; }
.status-card.red { border-top-color: var(--error); }
.status-card.yellow { border-top-color: var(--warning); }
.status-card.green { border-top-color: var(--success); }
.status-card.dead { border-top-color: var(--text-secondary); }
.status-card.untracked { border-top-color: var(--text-placeholder); }

/* ---- 表格 ---- */
table {
  width: 100%; border-collapse: collapse; background: var(--bg-container);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-1);
}
th, td { padding: var(--space-3) var(--space-4); text-align: left; font-size: var(--font-body); border-bottom: 1px solid var(--bg-component); }
th { background: var(--bg-component); color: var(--text-secondary); font-weight: 600; font-size: 12px; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg-component); }
tbody tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; }
.num-right { text-align: right; }

/* ---- 表单基线(全站输入统一;模块 inline 仅覆盖宽度) ---- */
input, select, textarea {
  font-family: inherit; font-size: var(--font-label); color: var(--text-primary);
  background: var(--bg-container); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 4px 8px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-focus);
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-component); color: var(--text-disabled); }

/* ---- 标签 ---- */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 18px;
}
.tag.red { background: var(--error-light); color: var(--error); }
.tag.yellow { background: var(--warning-light); color: var(--warning); }
.tag.green { background: var(--success-light); color: var(--success); }
.tag.blue { background: rgba(59,130,246,.12); color: #2563eb; }   /* 角色档：总部运营 */
.tag.purple { background: rgba(139,92,246,.12); color: #7c3aed; } /* 角色档：财务 */
.tag.confirmed { background: var(--brand-focus); color: var(--brand); }
.tag.dead, .tag.unfiltered { background: var(--bg-component); color: var(--text-secondary); }
.tag.untracked, .tag.diff-del, .tag.diff-keep { background: var(--bg-component); }
.tag.untracked { color: var(--text-placeholder); }
.tag.diff-del { color: var(--text-placeholder); }
.tag.diff-keep { color: var(--text-secondary); }
.tag.on-sale, .tag.diff-add { background: var(--success-light); color: var(--success); }
.tag.off-sale { background: var(--warning-light); color: var(--warning); }
.tag.rejected { background: var(--error-light); color: var(--error); }

/* 变更类型标记 */
.ct-badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; margin-left: 4px; line-height: 18px;
}
.ct-badge.ct-新增 { background: var(--success-light); color: var(--success); }
.ct-badge.ct-改价 { background: var(--warning-light); color: var(--warning); }
.ct-badge.ct-下架 { background: var(--bg-component); color: var(--text-secondary); }
tr.ct-row-下架 td { color: var(--text-placeholder); }

/* ---- 控件(按钮/输入统一规范) ---- */
.controls { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
select, button, input {
  padding: 7px 12px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--bg-container);
  color: var(--text-primary); transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-focus);
}
button { cursor: pointer; }
button:hover { border-color: var(--brand-hover); color: var(--brand); }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }

.md-action-btn { padding: 3px 10px; font-size: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-container); }
.md-action-btn:hover { background: var(--bg-component); }
.md-action-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.md-action-btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.md-action-btn.danger { color: var(--error); border-color: var(--error-light); }
.md-action-btn.danger:hover { background: var(--error-light); border-color: var(--error); }
.md-action-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.md-action-btn.lg { padding: 8px 20px; font-size: 13px; border-radius: var(--radius-md); }
.md-link-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--bg-component); gap: 8px; }
.md-link-row .sub { color: var(--text-placeholder); font-size: 11px; }
.md-link-actions { display: flex; gap: 6px; }
.md-add-row { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.md-add-row input { flex: 1; padding: 4px 8px; font-size: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.md-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.md-section { background: var(--bg-component); border-radius: var(--radius-md); padding: 12px; }
.md-section h4 { margin: 0 0 8px 0; font-size: 13px; color: var(--text-primary); }

/* ---- 弹层 ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal {
  background: var(--bg-container); border-radius: var(--radius-md); width: 540px;
  max-width: 92vw; max-height: 72vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-3); animation: rise-in 0.2s ease both;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 14px; }
.modal-close { cursor: pointer; color: var(--text-placeholder); font-size: 16px; padding: 0 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-search { margin: 12px 16px 8px; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 13px; }
.modal-list { overflow-y: auto; flex: 1; padding: 0 8px 12px; }
.modal-item { padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--bg-component); }
.modal-item:hover { background: var(--brand-focus); }
.modal-item .sub { color: var(--text-placeholder); font-size: 11px; margin-left: 6px; }
.md-check { width: 16px; height: 16px; }
.md-batch-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--brand-focus); border-radius: var(--radius-md); margin-bottom: 12px; font-size: 13px; }
.md-pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px 0; font-size: 13px; color: var(--text-secondary); }

/* ---- 菜品档案 · 富媒体列表（2026-08-28：图+品名+分类+售价/成本/毛利六要素，替两级树） ---- */
.md-list-col { width: 520px; flex-shrink: 0; display: flex; flex-direction: column; min-width: 0; }
.md-list { overflow-y: auto; max-height: calc(100vh - 200px); padding: 6px 8px 4px; background: var(--bg-container); border: 1px solid var(--border-color); border-radius: var(--radius-lg); }
.md-list-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-container); border-bottom: 1px solid var(--border-color); font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.md-list-head .md-nums { margin-left: auto; }
.md-row-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.md-row-card + .md-row-card { margin-top: 2px; }
.md-row-card:hover { background: var(--bg-component); }
.md-row-card.row-sel { background: var(--brand-focus); border-color: var(--brand); }
.md-thumb { width: 72px; height: 54px; border-radius: var(--radius-md); background: var(--bg-component); object-fit: cover; flex-shrink: 0; display: block; }
.md-thumb-ph { width: 72px; height: 54px; border-radius: var(--radius-md); background: var(--bg-component); color: var(--text-placeholder); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }
.md-row-main { flex: 1; min-width: 0; }
.md-row-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.md-row-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-row-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.md-nums { display: flex; flex-shrink: 0; }
.md-num { width: 62px; text-align: right; font-size: 12px; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ---- 图表 ---- */
.chart { background: var(--bg-container); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.chart h3 { font-size: 14px; margin-bottom: 16px; color: var(--text-primary); font-weight: 600; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.bar-row .name { width: 160px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar { flex: 1; height: 20px; background: var(--bg-component); border-radius: var(--radius-sm); overflow: hidden; }
.bar-row .bar > div { height: 100%; background: var(--brand); border-radius: var(--radius-sm); transition: width 0.4s ease; }
.bar-row .val { width: 110px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.quadrant { width: 100%; height: 440px; }
.quadrant svg { width: 100%; height: 100%; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---- 状态 ---- */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; color: var(--text-placeholder); font-size: 13px;
}
.loading::before {
  content: ""; width: 18px; height: 18px; margin-right: 10px;
  border: 2px solid var(--brand-focus); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { text-align: center; padding: 40px; color: var(--error); }
.placeholder { text-align: center; padding: 80px 40px; color: var(--text-placeholder); }
.placeholder h2 { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }

.section { margin: 24px 0; }
.section h3 { font-size: 15px; margin: 0 0 12px; color: var(--text-primary); font-weight: 600; }
.hint {
  margin: 12px 0 0; padding: 10px 14px; background: var(--warning-light);
  color: var(--warning); font-size: 13px; border-radius: var(--radius-sm);
  display: flex; align-items: flex-start; gap: 8px;
}
.hint::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--warning); margin-top: 6px; flex-shrink: 0;
}
.expand-btn { color: var(--brand); cursor: pointer; font-size: 12px; white-space: nowrap; }
.expand-btn:hover { text-decoration: underline; }
tr.detail-row { background: var(--bg-component); }
.detail-cell { padding: 12px 16px; }
.detail-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.detail-table th { background: var(--bg-component); padding: 6px 10px; font-weight: 600; color: var(--text-secondary); text-align: left; }
.detail-table td { padding: 6px 10px; border-bottom: 1px solid var(--bg-component); }
.detail-table .sub { color: var(--text-placeholder); font-size: 11px; }

@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .brand { font-size: 0; padding: 18px 0; text-align: center; }
  .brand::after { content: "四"; font-size: 16px; }
  .nav-group-title { display: none; }
  .nav-item { padding: 12px 18px; font-size: 0; }
}

/* ---- 出品标准卡 ---- */
.pcard { background: var(--bg-container); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; margin: 4px 0; position: relative; }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--brand); }
.pcard-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.pcard-print { background: var(--brand); color: #fff; border: none; padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; white-space: nowrap; }
.pcard-print:hover { background: var(--brand-hover); }
.pcard-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pcard-kv-item { background: var(--bg-component); border-radius: var(--radius-md); padding: 10px 12px; }
.pcard-kv-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.pcard-kv-value { font-size: 18px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pcard-section { margin-bottom: 16px; }
.pcard-section h4 { font-size: 13px; color: var(--text-primary); margin-bottom: 8px; font-weight: 600; }
.pcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .pcard-grid { grid-template-columns: 1fr; } }
tr.pcard-sum td { font-weight: 700; background: var(--bg-component); color: var(--text-primary); }

/* ---- 打印 ---- */
@media print {
  body * { visibility: hidden; }
  .pcard, .pcard * { visibility: visible; }
  .pcard { position: absolute; left: 0; top: 0; width: 100%; border: none; padding: 0; }
  .pcard-print { display: none; }
  .sidebar, .topbar { display: none; }
}

/* ---- 版本管理 ---- */
.split { display: flex; gap: 16px; align-items: flex-start; }
.split .pane { background: var(--bg-container); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.vm-list { width: 340px; flex-shrink: 0; max-height: calc(100vh - 140px); overflow-y: auto; padding: 8px; }
.vm-tpl-head { padding: 10px 12px 6px; font-weight: 700; color: var(--text-primary); font-size: 13px; border-bottom: 1px solid var(--border-color); }
.vm-tpl-head:not(:first-child) { margin-top: 10px; }
.vm-major-head { padding: 6px 12px 2px; font-size: 12px; color: var(--text-secondary); }
.vm-detail { flex: 1; min-width: 0; padding: 20px; }
.vm-row { padding: 12px; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.vm-row:hover { background: var(--bg-component); }
.vm-row.row-sel { background: var(--brand-focus); border-color: var(--brand); }
.vm-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.vm-vid { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.vm-row-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vm-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.vm-summary { font-size: 12px; color: var(--text-secondary); text-align: right; max-width: 360px; }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin: 16px 0; }
.tab { padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text-secondary); border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-body { min-height: 200px; }
.diff-add { color: var(--success); }
.diff-del { color: var(--text-placeholder); }
.diff-keep { color: var(--text-secondary); }

/* ---- V7 主从布局 ---- */
.detail-layout { display: flex; gap: 16px; align-items: flex-start; }
.detail-list { flex: 1; min-width: 0; }
.detail-panel {
  width: 460px; flex-shrink: 0; position: sticky; top: 84px;
  max-height: calc(100vh - 104px); overflow-y: auto;
  background: var(--bg-container); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border-color); padding: 18px 20px;
}
.detail-panel.fluid { width: auto; flex: 1; min-width: 0; }
.detail-panel .dp-placeholder { text-align: center; color: var(--text-placeholder); padding: 60px 20px; }
.detail-panel .dp-placeholder-icon { font-size: 36px; opacity: 0.25; margin-bottom: 8px; }
.detail-panel h3.dp-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.detail-panel .dp-subtitle { font-size: 12px; color: var(--text-placeholder); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--bg-component); }
.info-row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 12px; gap: 12px; }
.info-label { color: var(--text-placeholder); flex-shrink: 0; }
.info-val { font-weight: 500; text-align: right; color: var(--text-primary); word-break: break-all; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.metric-cell { background: var(--bg-component); border-radius: var(--radius-md); padding: 10px 6px; text-align: center; }
.metric-cell .metric-val { font-size: 20px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.metric-cell .metric-label { font-size: 11px; color: var(--text-placeholder); margin-top: 2px; }
.panel-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--bg-component); }
.panel-section h4 { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
tr.diff-over td { background: var(--error-light); }
tr.diff-missing td { background: var(--warning-light); }
tr.diff-sel td { background: var(--brand-focus); }
tr.md-row.row-sel td { background: var(--brand-focus); }
@media (max-width: 900px) {
  .detail-layout { flex-direction: column; }
  .detail-panel { width: 100%; position: static; max-height: none; }
  .md-list-col { width: 100%; }
  .md-list { max-height: none; }
}

/* ---- 登录页 ---- */
.hidden { display: none !important; }
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-card {
  background: var(--bg-container); border-radius: var(--radius-lg);
  padding: 36px 32px; width: 340px; box-sizing: border-box;
  box-shadow: var(--shadow-3); animation: rise-in 0.35s ease both;
}
.login-brand { font-size: 20px; font-weight: 700; color: var(--text-primary); text-align: center; }
.login-sub { font-size: 13px; color: var(--text-placeholder); text-align: center; margin: 4px 0 24px; }
.login-form input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.login-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-focus); }
.login-form button { width: 100%; padding: 11px; font-size: 14px; font-weight: 600; color: #fff; background: var(--brand); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.15s; }
.login-form button:hover { background: var(--brand-hover); }
.login-error { color: var(--error); font-size: 12px; min-height: 16px; margin-top: 4px; text-align: center; }

/* 动效减弱兜底（无障碍规范）：前庭敏感用户不受动画干扰 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Pop 换肤附加(2026-08-29 副本实验):hover 微交互 ── */
.card { transition: transform .18s ease, box-shadow .18s ease; }
.card.clickable:hover, .card.quick-on:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(23, 21, 31, 0.08); }
.md-row-card { transition: transform .18s ease, box-shadow .18s ease; }
.md-row-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(23, 21, 31, 0.08); }
.md-thumb { border-radius: 12px; }

/* ── Pop 结构更新(2026-08-29 副本):胶囊工具条 ── */
.controls { gap: 10px; }
.controls select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border-color); border-radius: 999px;
  padding: 8px 30px 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-primary);
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%232E6BFF' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer; transition: border-color .15s ease;
}
.controls select:hover { border-color: var(--brand); }
.controls input[id="md-search"] {
  border: 1px solid var(--border-color); border-radius: 999px;
  padding: 8px 18px; font-size: 13px; background: #fff;
}
.controls .md-action-btn { border-radius: 999px; padding: 8px 18px; font-weight: 700; }

/* ── Pop 结构更新:stat 卡 bento 化 ── */
#md-cards.cards { display: grid; grid-template-columns: 1.9fr 1fr 1fr 1fr 1fr; gap: 12px; }
#md-cards .card { border-radius: var(--radius-lg); }
.pop-hero { background: #FFFFFF; border: 1px solid var(--border-color); }
.pop-hero .label { color: var(--text-secondary); font-weight: 700; }
.pop-hero .value { font-size: 46px; color: var(--error); letter-spacing: -1px; }
.pop-hero .value .pop-hero-unit { font-size: 16px; font-weight: 700; margin-left: 4px; }
.pop-hero .sub { color: var(--text-placeholder); }
#md-cards .card:not(.pop-hero) .value { color: var(--text-primary); }
.login-card { border-radius: 24px; box-shadow: 0 20px 50px rgba(23, 21, 31, 0.10); }
.login-form input { border-radius: 12px; }
.login-form button { border-radius: 12px; font-weight: 700; }
/* 换色浮窗 */
.theme-picker { position: fixed; right: 18px; bottom: 18px; z-index: 999; background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.theme-picker span { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.theme-dot { width: 22px; height: 22px; border-radius: 999px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-color); transition: transform .12s; }
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.on { box-shadow: 0 0 0 2px var(--text-primary); }

/* ── Pop 胶囊铺开(2026-08-30):筛选胶囊/状态胶囊/售价胶囊/tab 胶囊 ── */
/* 通用胶囊 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 16px;
  background: var(--bg-component); color: var(--text-secondary);
}
.pill .pill-x { cursor: pointer; font-weight: 700; opacity: 0.55; font-size: 13px; line-height: 1; }
.pill .pill-x:hover { opacity: 1; color: var(--error); }
.pill-plain { background: #fff; border: 1px solid var(--border-color); color: var(--text-primary); }
.pill-warn { background: var(--warning-light); color: var(--warning); }
/* 筛选条件胶囊条 */
#md-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
#md-filter-pills .pill { background: var(--brand-focus); color: var(--brand); }
#md-filter-pills .pill-x { color: var(--brand); }
#md-filter-pills:empty { display: none; }
#md-filter-pills .fp-label { font-size: 11px; color: var(--text-placeholder); font-weight: 600; }
/* 详情 tab 胶囊化 */
.tab-bar { gap: 6px; }
.tab-bar .tab {
  border-radius: 999px; padding: 5px 14px; border-bottom: none;
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
}
.tab-bar .tab:hover { background: #EFF3FA; color: var(--text-primary); }
.tab-bar .tab.active { background: var(--brand); color: #fff; }
/* 角色胶囊单选组 */
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-group .pill { cursor: pointer; background: #fff; border: 1px solid var(--border-color); color: var(--text-secondary); }
.pill-group .pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- 新店成长陪伴(2026-09-04) ---- */
.ns-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ns-card .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ns-card .l { font-size: 11px; color: var(--text-secondary); }
.ns-alert { font-size: 11px; color: var(--error); margin-top: 7px; line-height: 1.5; }
.ns-ok { font-size: 11px; color: var(--success); margin-top: 7px; }
.ns-tab, .ns-tab-on { padding: 6px 18px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--surface); color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.ns-tab-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-grid .k .kl { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.kpi-grid .k .kv { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
table.rtbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.rtbl th, .rtbl td { padding: 6px 9px; text-align: center; border-bottom: 1px solid var(--border-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtbl tbody th { text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 11.5px; }
.rtbl thead th { font-size: 12px; font-weight: 700; }
.rtbl td.best { background: var(--brand-focus); font-weight: 700; }
.rtbl td.warn { color: var(--error); font-weight: 700; }
.rtbl .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fnote { font-size: 11px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > .card { margin-bottom: 0; }
.opp { display: flex; gap: 8px; font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin-top: 7px; }
.opp .oi { font-weight: 700; flex-shrink: 0; }
@media (max-width: 880px) { .ns-cards { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; } }
