/* ============================================================
   素拼月度汇报工作台 — 全局样式
   设计语言：深灰主色 + 金色强调 + 卡片式布局
   ============================================================ */

:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --primary: #1f2937;
  --primary-2: #374151;
  --accent: #b8860b;
  --accent-light: #f5e6c8;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --purple: #9333ea;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.18);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 全局隐藏工具类：弹窗 / Toast / 识别结果等初始态依赖此类 */
.hidden { display: none !important; }

/* Excel 引擎未就绪告警横幅（本地库缺失时才显示） */
.engine-banner {
  background: #fef2f2; border: 1px solid #fca5a5; border-left: 4px solid #dc2626;
  border-radius: 10px; padding: 14px 18px; margin-bottom: 16px;
}
.engine-banner .eb-title { font-size: 14px; font-weight: 700; color: #b91c1c; margin-bottom: 6px; }
.engine-banner .eb-text { font-size: 13px; color: #7f1d1d; line-height: 1.7; }
.engine-banner code { background: #fee2e2; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; }
.mini-btn:disabled:hover { transform: none; box-shadow: none; }

body {
  font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ════════════ 顶部导航 ════════════ */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg,#1f2937 0%,#374151 100%);
  color: #fff;
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo { font-weight: 800; font-size: 18px; letter-spacing: 1px; color: var(--accent); }
.nav-title { font-size: 15px; font-weight: 500; opacity: 0.9; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.08); border-radius: 8px; padding: 4px; }
.nav-tab {
  border: none; background: transparent; color: rgba(255,255,255,0.7);
  padding: 7px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.nav-tab:hover { color: #fff; }
.nav-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.month-select {
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; max-width: 140px;
}
.month-select option { color: #111827; }
.nav-btn {
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.22); }

/* ════════════ 视图容器 ════════════ */
.view { display: none; min-height: calc(100vh - 60px); }
.view.active { display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }

/* ════════════ 通用区块 ════════════ */
.section {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 2px solid var(--border);
}
.section-title .num {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.section-title h2 { font-size: 18px; font-weight: 700; color: var(--primary); }
.section-title .tag { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg); padding: 4px 12px; border-radius: 20px; }

/* ════════════ 上传拖拽区 ════════════ */
.drop-zone {
  border: 2px dashed var(--accent); border-radius: var(--radius); padding: 40px 24px;
  text-align: center; cursor: pointer; background: linear-gradient(135deg, #fffdf7 0%, #fef9ec 100%);
  transition: all 0.25s;
}
.drop-zone:hover, .drop-zone.dragover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-2px); }
.drop-icon { font-size: 44px; margin-bottom: 10px; }
.drop-text { font-size: 15px; color: var(--text); font-weight: 500; }
.drop-text .link { color: var(--accent); text-decoration: underline; font-weight: 600; }
.drop-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* 识别结果卡片 */
.match-result { margin-top: 20px; }
.match-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
  background: #fff; box-shadow: var(--shadow);
}
.match-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.match-file-name { font-weight: 700; font-size: 15px; color: var(--primary); }
.match-conf {
  margin-left: auto; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.conf-high { background: #dcfce7; color: #15803d; }
.conf-mid { background: #fef3c7; color: #b45309; }
.conf-low { background: #fee2e2; color: #b91c1c; }
.match-module-sel {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.match-module-sel label { font-size: 13px; color: var(--muted); }
.match-module-sel select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.match-preview-table { margin-top: 12px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.match-actions { display: flex; gap: 10px; margin-top: 14px; }
.mini-btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.mini-btn.primary { background: var(--accent); color: #fff; }
.mini-btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* ════════════ 模块状态 ════════════ */
.module-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.status-card {
  background: var(--bg); border-radius: 10px; padding: 16px 18px; border: 1px solid var(--border);
}
.status-card .sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.status-card .sc-num { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.status-card .sc-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.status-card .sc-state { font-size: 12px; font-weight: 600; margin-left: auto; padding: 2px 9px; border-radius: 20px; }
.state-done { background: #dcfce7; color: #15803d; }
.state-partial { background: #fef3c7; color: #b45309; }
.state-empty { background: #f3f4f6; color: #6b7280; }
.status-card .sc-detail { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ════════════ 文件列表 ════════════ */
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg);
}
.file-row .fr-icon { font-size: 22px; }
.file-row .fr-info { flex: 1; min-width: 0; }
.file-row .fr-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.file-row .fr-meta { font-size: 12px; color: var(--muted); }
.file-row .fr-module { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--accent-light); color: #92400e; font-weight: 600; }
.file-row .fr-del { color: var(--red); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; }
.file-row .fr-del:hover { background: #fee2e2; }
.empty-state { text-align: center; color: var(--muted); font-size: 14px; padding: 24px; }

/* ════════════ 数据操作 ════════════ */
.data-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.action-btn {
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); transition: all 0.2s;
}
.action-btn:hover { border-color: var(--muted); }
.action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-btn.primary:hover { opacity: 0.9; }
.action-btn.danger { color: var(--red); border-color: #fca5a5; }
.action-btn.danger:hover { background: #fee2e2; }

/* ════════════ 使用说明 ════════════ */
.guide-section { background: linear-gradient(135deg, #fffdf7 0%, #fef9ec 100%); }
.guide-content ol { padding-left: 22px; color: var(--text); }
.guide-content li { margin-bottom: 10px; font-size: 14px; }
.guide-content li b { color: var(--primary); }

/* ════════════ 汇报页：页头 ════════════ */
.report-header {
  background: linear-gradient(135deg,#1f2937 0%,#374151 100%); color: #fff; padding: 36px 40px;
  border-radius: 14px; margin-bottom: 28px; position: relative; overflow: hidden;
}
.report-header::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(184,134,11,0.15) 0%, transparent 70%); }
.report-header h1 { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.report-header .meta { margin-top: 10px; font-size: 14px; color: rgba(255,255,255,0.7); display: flex; gap: 24px; flex-wrap: wrap; }
.report-header .meta span { display: inline-flex; align-items: center; gap: 6px; }

/* KPI 条 */
.kpi-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; position: relative; box-shadow: var(--shadow); }
.kpi .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); border-radius: 12px 0 0 12px; }
.kpi .label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.kpi .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 汇报模块分区 */
.report-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px 30px; margin-bottom: 24px; box-shadow: var(--shadow); }
.report-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--border); }
.report-section-title .num { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.report-section-title h2 { font-size: 19px; font-weight: 700; color: var(--primary); }
.report-section-title .tag { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg); padding: 4px 12px; border-radius: 20px; }

/* 通用卡片网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-card { background: var(--bg); border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-card .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ══════ 指标强调网格（stat-card 内的关键数据区） ══════ */
.metric-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.metric .m-label { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.metric .m-value { font-size: 15px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.metric .m-value.m-hot   { color: var(--green); }
.metric .m-value.m-mid   { color: var(--blue); }
.metric .m-value.m-slow  { color: var(--red); }
.metric .m-value.m-st-good { color: var(--green); }
.metric .m-value.m-st-mid  { color: var(--amber); }
.metric .m-value.m-st-low  { color: var(--red); }
.badge-num {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 14px; font-size: 12px; font-weight: 700;
}
.badge-num b { font-size: 14px; }
.bn-hot  { background: #dcfce7; color: #15803d; }
.bn-mid  { background: #dbeafe; color: #1e40af; }
.bn-slow { background: #fee2e2; color: #b91c1c; }
.metric-full { grid-column: 1 / -1; }

/* ══════ 产品图墙（汇总区：所有产品图 + 点击看详情） ══════ */
.prod-wall {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px; margin-top: 14px;
}
.prod-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 8px;
}
.prod-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.prod-card .pc-img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px;
  background: #f3f4f6; border: 1px solid var(--border);
}
.prod-card .pc-ph {
  width: 100%; aspect-ratio: 1/1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg,#f3f4f6,#f3f4f6 8px,#eceef1 8px,#eceef1 16px);
  color: var(--muted); font-size: 12px; border: 1px dashed #d1d5db;
}
.prod-card .pc-code { font-size: 14px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.prod-card:hover .pc-code { color: var(--accent); }
.prod-card .pc-name { font-size: 12px; color: var(--muted); }
.prod-card .pc-metrics { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.prod-card .pc-metrics span { color: var(--muted); }
.prod-card .pc-metrics b { color: var(--primary); font-variant-numeric: tabular-nums; }
.prod-card .pc-metrics b.st-good { color: var(--green); }
.prod-card .pc-metrics b.st-mid  { color: var(--amber); }
.prod-card .pc-metrics b.st-low  { color: var(--red); }

/* ══════ 系列分区（四大系列） ══════ */
.series-block { margin-top: 22px; }
.series-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 10px; background: var(--bg); border-left: 4px solid var(--accent); margin-bottom: 12px;
}
.series-head .sh-name { font-size: 15px; font-weight: 800; color: var(--primary); }
.series-head .sh-stats { margin-left: auto; display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.series-head .sh-stats b { color: var(--primary); font-size: 14px; }
.series-head .sh-stats b.st-good { color: var(--green); }
.series-head .sh-stats b.st-mid  { color: var(--amber); }
.series-head .sh-stats b.st-low  { color: var(--red); }
.series-empty { font-size: 13px; color: var(--muted); padding: 10px 4px; }
.section-subtitle { font-size: 15px; font-weight: 700; color: var(--primary); margin: 22px 0 4px; }
.section-subtitle .sub-tag { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; }

/* 提示框 */
.highlight { background: linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%); border: 1px solid #f5d68a; border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
.highlight .title { font-weight: 600; color: #92400e; margin-bottom: 6px; }
.highlight .text { font-size: 14px; color: #78350f; }
.highlight-red { background: linear-gradient(135deg,#fef2f2 0%,#fee2e2 100%); border-color: #fca5a5; }
.highlight-red .title { color: #b91c1c; }
.highlight-red .text { color: #7f1d1d; }

/* 占位 */
.placeholder { background: repeating-linear-gradient(45deg,#f9fafb,#f9fafb 10px,#f3f4f6 10px,#f3f4f6 20px); border: 2px dashed #d1d5db; border-radius: 10px; padding: 28px 24px; text-align: center; color: var(--muted); }
.placeholder .icon { font-size: 28px; margin-bottom: 8px; }
.placeholder .text { font-size: 14px; }

/* 条形图 */
.chart-box { background: var(--bg); border-radius: 10px; padding: 16px; margin-top: 16px; border: 1px solid var(--border); }
.chart-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .bar-label { width: 50px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.bar-wrap { background: #e5e7eb; border-radius: 6px; height: 12px; overflow: hidden; flex: 1; min-width: 80px; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
.bar-row .bar-val { width: 56px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* TOP5：固定四列 grid，杜绝款号被金色条形覆盖 */
.top5-row {
  display: grid; grid-template-columns: 38px 112px minmax(0,1fr) 44px;
  align-items: center; gap: 10px; margin-bottom: 10px;
}
.top5-thumb, .top5-thumb-ph {
  width: 38px; height: 38px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); background: #f3f4f6; cursor: pointer;
}
.top5-thumb:hover { transform: scale(1.1); box-shadow: var(--shadow); }
.top5-thumb-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--muted);
  background: repeating-linear-gradient(45deg,#f3f4f6,#f3f4f6 6px,#eceef1 6px,#eceef1 12px);
  border: 1px dashed #d1d5db;
}
.top5-row .top5-code {
  font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; min-width: 0;
}
.top5-row .top5-code:hover { color: var(--accent); }
.top5-row .bar-wrap { height: 10px; min-width: 0; width: 100%; }
.top5-row .top5-val { text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #fafafa; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tbody tr:hover { background: #faf9f6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 8px; }

/* ══════ 门店销售模块 ══════ */
.store-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.store-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.store-card .sc-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.store-card .sc-value { font-size: 21px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.store-card .sc-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.store-card .sc-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.store-table table { min-width: 980px; }
.store-table .store-name { font-weight: 600; color: var(--primary); white-space: nowrap; }
.store-table .cell-strong { font-weight: 800; color: var(--primary); }
.store-table tfoot th { background: #fffbeb; color: var(--primary); font-size: 12px; }
.store-legend { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.7; }

/* 通用状态色：达成率 / 同比 / 环比 / 售罄率共用 */
.st-good { color: var(--green) !important; }
.st-mid  { color: var(--amber) !important; }
.st-low  { color: var(--red) !important; }

/* 专利部位分类卡 */
.patent-card { border-top: 3px solid var(--accent); }

/* 徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-hot { background: #fef3c7; color: #b45309; }
.badge-mid { background: #dbeafe; color: #1e40af; }
.badge-slow { background: #fee2e2; color: #b91c1c; }
.badge-orig { background: var(--accent-light); color: #92400e; }
.badge-supply { background: #f3f4f6; color: #4b5563; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef3c7; color: #b45309; }

/* 产品款号 + 图片单元格（表格内使用，防溢出） */
.prod-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.prod-thumb {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); cursor: pointer; background: #f3f4f6;
  transition: transform 0.2s, box-shadow 0.2s;
}
.prod-thumb:hover { transform: scale(1.12); box-shadow: var(--shadow-lg); }
.prod-code {
  font-weight: 600; color: var(--primary); cursor: pointer; font-variant-numeric: tabular-nums;
  border-bottom: 1px dashed transparent; transition: all 0.2s;
}
.prod-code:hover { color: var(--accent); border-bottom-color: var(--accent); }
.prod-placeholder {
  width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; background: repeating-linear-gradient(45deg,#f3f4f6,#f3f4f6 6px,#eceef1 6px,#eceef1 12px);
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); cursor: pointer; border: 1px dashed #d1d5db;
}
.prod-placeholder:hover { border-color: var(--accent); }

/* 流程图 */
.flow { display: flex; align-items: stretch; gap: 0; margin: 20px 0; }
.flow-step { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; position: relative; }
.flow-step + .flow-step { margin-left: -1px; }
.flow-step .step-num { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.flow-step .step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.flow-step .step-desc { font-size: 12px; color: var(--muted); }
.flow-arrow { display: flex; align-items: center; justify-content: center; width: 32px; color: var(--accent); font-size: 20px; font-weight: bold; }

/* 页脚 */
.report-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ════════════ 弹窗 / 灯箱 ════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.78); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff; border-radius: 14px; max-width: 92vw; max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: popIn 0.25s ease;
}
@keyframes popIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.image-modal-box { width: auto; max-width: 92vw; }
.trace-modal-box { width: 560px; max-width: 92vw; }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); flex: 1; }
.modal-close { border: none; background: var(--bg); width: 32px; height: 32px; border-radius: 8px; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-close:hover { background: #fee2e2; color: var(--red); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-image { max-width: 80vw; max-height: 70vh; object-fit: contain; border-radius: 8px; display: block; margin: 0 auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* 溯源详情 */
.trace-section { margin-bottom: 18px; }
.trace-section h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; font-weight: 600; }
.trace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trace-item { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.trace-item .ti-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.trace-item .ti-value { font-size: 14px; font-weight: 600; color: var(--primary); }
.trace-source { background: var(--accent-light); border: 1px solid #f5d68a; border-radius: 10px; padding: 14px 16px; }
.trace-source .ts-row { display: flex; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.trace-source .ts-row .ts-k { color: var(--muted); width: 80px; flex-shrink: 0; }
.trace-source .ts-row .ts-v { color: var(--primary); font-weight: 600; }
.trace-btn { display: inline-block; margin-top: 10px; padding: 8px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.trace-btn:hover { opacity: 0.9; }

/* ════════════ Toast ════════════ */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; z-index: 2000; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ════════════ 响应式 / 手机端适配 ════════════ */
@media (max-width: 900px) {
  .kpi-strip { grid-template-columns: repeat(2,1fr); }
  .grid-4, .grid-3 { grid-template-columns: repeat(2,1fr); }
  .store-cards { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  /* 顶部导航：两行堆叠，标签与月份/导出按钮不拥挤 */
  .topnav { padding: 10px 12px; height: auto; flex-wrap: wrap; gap: 8px; }
  .nav-left { gap: 8px; }
  .nav-logo { font-size: 16px; }
  .nav-title { font-size: 13px; }
  .nav-right { width: 100%; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .nav-tabs { flex: 1 1 100%; }
  .nav-tab { flex: 1; padding: 8px 6px; font-size: 13px; }
  .month-select { max-width: 130px; flex: 1; }
  .nav-btn { padding: 7px 10px; font-size: 12px; }
  .container { padding: 16px 12px 60px; }
  .section { padding: 16px 14px; margin-bottom: 16px; }
  .section-title { flex-wrap: wrap; gap: 8px; }
  .section-title h2 { font-size: 16px; }
  .section-title .tag { margin-left: 0; }
  .drop-zone { padding: 28px 16px; }
  .drop-icon { font-size: 34px; }
  .drop-text { font-size: 14px; }
  .match-card { padding: 14px; }
  .match-card-head { flex-wrap: wrap; gap: 6px; }
  .data-actions { gap: 8px; }
  .action-btn { flex: 1 1 45%; padding: 10px 8px; font-size: 13px; }

  /* 汇报页头与 KPI */
  .report-header { padding: 20px 18px; border-radius: 12px; margin-bottom: 18px; }
  .report-header h1 { font-size: 20px; }
  .report-header .meta { gap: 8px 16px; font-size: 12px; margin-top: 8px; }
  .kpi-strip { gap: 10px; margin-bottom: 18px; }
  .kpi { padding: 14px; }
  .kpi .label { font-size: 11px; }
  .kpi .value { font-size: 21px; }
  .kpi .sub { font-size: 11px; }

  /* 模块与卡片 */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
  .report-section { padding: 16px 14px; margin-bottom: 16px; border-radius: 12px; }
  .report-section-title { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .report-section-title h2 { font-size: 16px; }
  .report-section-title .tag { margin-left: 0; font-size: 11px; }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 19px; }
  .metric-grid { gap: 6px 10px; }
  .metric .m-label { font-size: 11px; }
  .metric .m-value { font-size: 13px; }
  .badge-num { padding: 2px 8px; font-size: 11px; }
  .chart-box { padding: 12px; }
  .bar-row { gap: 8px; }
  .bar-row .bar-label { width: 42px; font-size: 12px; }
  .bar-row .bar-val { width: 46px; font-size: 12px; }

  /* TOP5：缩小图片与款号列，条形仍保留独立列不遮挡 */
  .top5-row { grid-template-columns: 32px 92px minmax(0,1fr) 34px; gap: 6px; }
  .top5-thumb, .top5-thumb-ph { width: 32px; height: 32px; }
  .top5-row .top5-code { font-size: 11px; }
  .top5-row .top5-val { font-size: 11px; }

  /* 产品图墙：两列，款号允许折行 */
  .prod-wall { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .prod-card { padding: 9px; gap: 6px; }
  .prod-card .pc-code { font-size: 12px; word-break: break-all; }
  .prod-card .pc-name { font-size: 11px; }
  .prod-card .pc-metrics { font-size: 11px; gap: 2px 8px; }

  /* 系列分区 */
  .series-head { flex-wrap: wrap; padding: 10px; }
  .series-head .sh-name { font-size: 14px; }
  .series-head .sh-stats { margin-left: 0; width: 100%; gap: 10px; font-size: 11px; }

  /* 门店模块 */
  .store-cards { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .store-card { padding: 12px; }
  .store-card .sc-value { font-size: 17px; }
  .table-scroll { font-size: 12px; }
  .store-table table { min-width: 900px; }
  th, td { padding: 8px; white-space: nowrap; }

  /* 弹窗与提示 */
  .modal-overlay { padding: 10px; }
  .modal-box { max-width: 96vw; max-height: 90vh; }
  .modal-image { max-width: 88vw; max-height: 64vh; }
  .trace-grid { grid-template-columns: 1fr; }
  .trace-source .ts-row { flex-direction: column; gap: 2px; }
  .trace-source .ts-row .ts-k { width: auto; }
  .toast { left: 12px; right: 12px; bottom: 16px; transform: none; animation: none; font-size: 13px; text-align: center; }
}
@media (max-width: 380px) {
  .kpi .value { font-size: 18px; }
  .prod-wall { gap: 8px; }
  .top5-row { grid-template-columns: 28px 82px minmax(0,1fr) 30px; gap: 4px; }
  .top5-thumb, .top5-thumb-ph { width: 28px; height: 28px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
