/* iGV 智能调价总控台 · 样式
   设计基准 = 原型 wow.myfriends973.com/style.css（本地副本 wow.myfriends973.com_M7i2H）
   规则：变量、间距、圆角、表格、按钮、标签、图表、抽屉、面包屑全部照抄原型；
        仅补充原型没有、但控制台需要的组件（状态标签变体、toast、抽屉开合、趋势空态等）。 */

/* ============================================================ 1. 变量与基础 */
* { box-sizing: border-box; }

body {
  --bg: #f4f7fc;
  --panel: #fff;
  --text: #1d2b43;
  --muted: #78859b;
  --line: #e3e9f3;
  --primary: #3978f5;
  --soft: #edf3ff;
  /* 原型只用绿/橙两色，控制台补状态色 */
  --ok: #188c54;
  --danger: #d34949;
  --warn: #b26a00;
  --text-3: #78859b;
  --danger-bg: #fff1f1;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  margin: 0;
}
body.dark {
  --bg: #101827;
  --panel: #192437;
  --text: #e5eefc;
  --muted: #99abc7;
  --line: #334159;
  --primary: #7ba6ff;
  --soft: #243651;
  --ok: #6fdcab;
  --danger: #ff8b8b;
  --warn: #e8b464;
  --text-3: #99abc7;
  --danger-bg: #3a2530;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }

h1 { font-size: 25px; margin: 0 0 3px; }
h2 { font-size: 17px; margin: 0 0 16px; }
h3 { font-size: 15px; margin: 0; }
.sub, .muted { color: var(--muted); }
.spacer { flex: 1; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; }
.wrap { white-space: normal; overflow-wrap: anywhere; max-width: 340px; }

/* ============================================================ 2. 顶栏 */
.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 0 25px; min-height: 65px;
}
.top .brand {
  font-weight: 800; font-size: 18px; white-space: nowrap;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.top .brand i { font-style: normal; color: var(--primary); }

.menu { display: flex; align-items: center; gap: 5px; flex: 1; flex-wrap: wrap; }
.menu a, .drop > button {
  display: block; padding: 9px 12px; text-decoration: none;
  color: var(--muted); border: 0; background: transparent;
  border-radius: 8px; white-space: nowrap;
}
.menu a:hover, .menu a.active, .drop > button:hover,
.drop > button.active { background: var(--soft); color: var(--primary); }
.drop { position: relative; }
.dropitems {
  display: none; position: absolute; top: 100%; left: 0; min-width: 165px;
  background: var(--panel); box-shadow: 0 8px 30px #0002;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px;
}
.drop:hover .dropitems, .drop:focus-within .dropitems, .drop.open .dropitems { display: block; }
.dropitems a { display: block; padding: 9px 12px; border-radius: 7px; }
.dropitems a:hover { background: var(--soft); color: var(--primary); }

.theme { white-space: nowrap; }

/* 登录用户下拉（原型 .user-menu） */
.user-menu { position: relative; flex: 0 0 auto; }
.user-trigger {
  display: flex; align-items: center; gap: 9px;
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 5px 11px 5px 5px; font-weight: 650; white-space: nowrap;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800;
}
.user-chevron { font-size: 12px; color: var(--muted); }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 9px); right: 0; min-width: 176px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 12px 35px #07132624; z-index: 12;
}
.user-menu.open .user-dropdown, .user-menu:focus-within .user-dropdown { display: block; }
.user-title { font-size: 12px; color: var(--muted); padding: 7px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; text-align: left; text-decoration: none;
  color: var(--text); background: transparent; border: 0;
  padding: 10px 12px; border-radius: 7px;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--soft); color: var(--primary); }

/* ============================================================ 3. 容器 / 页面头 */
.container { max-width: 1520px; margin: 25px auto; padding: 0 25px; }

/* 面包屑条（原型 V9 .crumbbar）；兼容旧类名 .pagehead */
.crumbbar, .pagehead {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: -5px 0 15px; flex-wrap: wrap;
}
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs b, .crumb-current { color: var(--text); font-weight: 700; }
.crumbs .sep, .crumb-divider { color: var(--muted); opacity: .6; }
.crumb-actions, .pagehead .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb-actions .btn, .pagehead .actions .btn { padding: 8px 16px; white-space: nowrap; }

/* ============================================================ 4. 卡片 / 统计 */
.card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px;
  padding: 20px; margin-bottom: 18px; box-shadow: 0 4px 18px #0d305008;
}
.panel { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 0;
}
.panel-head h3 { font-size: 17px; }
.panel-body { padding: 18px 20px 20px; }
.panel-body.flush { padding: 0; }
/* 表格与卡片内边距对齐（原型：表格在 card 的 20px 内边距里） */
.panel-body.flush > .table-wrap, .panel-body.flush > .tablewrap { padding: 0 20px; }

.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 15px; }
.sectionhead h2, .sectionhead h3 { margin: 0; }
.sectionhead p { margin: 3px 0 0; font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats-six, #cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-six .card, #cards .card { margin: 0; padding: 16px 17px; min-width: 0; }
.metric strong, #cards .card .value {
  display: block; font-size: 27px; line-height: 1.25; margin: 8px 0 2px;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
#cards .card .label { font-size: 13px; color: var(--muted); white-space: nowrap; }
#cards .card .hint { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cards .card.ok .value { color: var(--ok); }
#cards .card.danger .value { color: var(--danger); }
#cards .card.brand .value { color: var(--primary); }
.stats-six .metric .muted { font-size: 12px; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card, .grid-2 > .panel { margin-bottom: 0; }

/* ============================================================ 5. 按钮 */
.btn {
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary); border-radius: 8px; padding: 9px 15px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.secondary, .btn.ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn.secondary:hover, .btn.ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn.danger { background: #fff1f1; color: #d34949; border-color: #ffd5d5; }
.btn.small, .btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.link { background: transparent; border-color: transparent; color: var(--primary); padding: 4px 6px; }
.btn.link:hover { background: var(--soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.push { margin-left: auto; }
.dark .btn.danger { background: #3a2530; color: #ff9d9d; border-color: #57303c; }

/* 分段按钮（原型 V11 button-radio） */
.button-radio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 36px; }
.button-radio-option { display: inline-flex; position: relative; cursor: pointer; flex: 0 0 auto; }
.button-radio-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.button-radio-option > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 75px; padding: 7px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s;
}
.button-radio-option:hover > span { border-color: var(--primary); color: var(--primary); }
.button-radio-option > input:checked + span {
  background: var(--soft); border-color: var(--primary); color: var(--primary);
  font-weight: 700; box-shadow: inset 0 0 0 1px var(--primary);
}

/* ============================================================ 6. 表单 */
input, select, textarea {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
input:disabled, select:disabled { background: var(--soft); color: var(--muted); }
.search { min-width: 230px; }

.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > span:first-child { font-size: 12px; color: var(--muted); }
.field.full { grid-column: 1 / -1; }
.field .req { color: var(--danger); margin-left: 3px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; }
.checkgroup { display: flex; flex-wrap: wrap; gap: 9px; }
.checkgroup label { background: var(--soft); border-radius: 7px; padding: 7px 10px; }
.hint { color: var(--muted); font-size: 12px; }
.code {
  background: var(--soft); border: 1px solid var(--line); border-radius: 9px;
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
/* 回弹预览：说明性文字，不当等宽代码块渲染 */
.code.hint-block { font-family: inherit; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* 筛选条（原型 V7 .filterbar） */
.filterbar {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px;
  margin-bottom: 17px; padding: 16px; background: var(--soft);
  border: 1px solid var(--line); border-radius: 11px;
}
.filterheading { font-weight: 700; color: var(--text); align-self: center; margin-right: 5px; white-space: nowrap; }
.filterbar label, .filterbar .f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 160px; }
.filterbar label > span { font-size: 12px; color: var(--muted); }
.filterbar select, .filterbar input { background: var(--panel); min-width: 160px; min-height: 38px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
.toolbar .input, .toolbar select.input { width: auto; }

/* ============================================================ 7. 表格 */
.tablewrap, .table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th { text-align: left; background: var(--soft); font-size: 12px; color: var(--muted); font-weight: 600; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, var(--panel)); }
td .btn { margin-right: 5px; }
td .btn:last-child { margin-right: 0; }
td.actions, .actions { white-space: nowrap; }
th.num, td.num { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.clickable { cursor: pointer; }
.pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px; flex-wrap: wrap;
}
.pagination select { width: 80px; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* 表内标签（原型 .tag + .chip + .rank + .price-new） */
.tag, .badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  background: #e8f7ee; color: #188c54; font-size: 12px;
}
.tag.off { background: #fff1eb; color: #d87532; }
.tag.ok, .badge.ok { background: #e8f7ee; color: #188c54; }
.tag.danger, .badge.danger { background: #fff1f1; color: #d34949; }
.tag.warn, .badge.warn { background: #fff6e6; color: #b26a00; }
.tag.info, .badge.info { background: #eef4ff; color: #3978f5; }
.tag.brand, .badge.brand { background: var(--soft); color: var(--primary); font-weight: 700; }
.badge:not([class*=" "]), .tag.neutral { background: var(--soft); color: var(--muted); }
.dark .tag, .dark .badge { background: #1d4939; color: #a5e9c8; }
.dark .tag.danger, .dark .badge.danger { background: #3a2530; color: #ff9d9d; }
.dark .tag.warn, .dark .badge.warn { background: #3d3323; color: #e8c07a; }
.dark .tag.info, .dark .badge.info, .dark .tag.brand, .dark .badge.brand { background: var(--soft); color: var(--primary); }
.dark .tag.off { background: #3a2c22; color: #e0a06a; }

.chip {
  display: inline-flex; background: var(--soft); color: var(--primary);
  font-weight: 700; padding: 3px 8px; border-radius: 6px; font-size: 12px;
}
.rank { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--soft); font-weight: 650; }
.rank-new { color: #147d56; background: #e7f8ed; }
.price-new { color: #168e6b; font-weight: 700; }
.dark .rank-new { background: #1d4939; color: #a5e9c8; }
.dark .price-new { color: #8de9bf; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--muted); }
.dot.on { background: #23b26d; box-shadow: 0 0 0 3px #23b26d26; }
.dot.off { background: #d0d6e2; }

/* 批量操作条（原型 V12 .product-batchbar / .batchbar） */
.batchbar, .product-batchbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
}
.batchbar #selectedCount, .product-batch-count { font-weight: 700; font-size: 13px; margin-right: 5px; }

/* ============================================================ 8. 页签 */
.tabs { display: flex; gap: 8px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.tab, .tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 11px 16px; border-bottom: 3px solid transparent; font: inherit;
}
.tab:hover { color: var(--primary); background: var(--soft); }
.tab.active, .tabs button.active { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.panel > .tabs { padding: 0 14px; margin: 6px 0 0; border-bottom: 1px solid var(--line); }
.section-tabs {
  flex-wrap: nowrap; overflow-x: auto; max-width: 100%;
  background: var(--panel); border-radius: 10px 10px 0 0;
  border-bottom: 1px solid var(--line); padding: 0 10px; margin-bottom: 18px;
}

/* ============================================================ 9. 图表（原型 V9 chart-card） */
.chart-card { padding: 21px 23px; }
.chart-head {
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 25px;
}
.chart-head h2 { font-size: 17px; margin: 0 0 8px; }
.chart-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.chart-summary strong { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
/* 统计粒度分段按钮（原型 .chart-switch） */
.chart-switch {
  display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line);
  background: var(--soft); border-radius: 9px; flex-shrink: 0;
}
.chart-switch button {
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  padding: 7px 13px; white-space: nowrap; font-size: 13px; transition: color .15s, background .15s;
}
.chart-switch button:hover { color: var(--primary); }
.chart-switch button.selected {
  background: var(--panel); color: var(--primary); font-weight: 700;
  box-shadow: 0 2px 8px #14223c13;
}
.chart-body { height: 265px; display: flex; gap: 9px; }
.chart-y-axis {
  width: 58px; display: flex; flex-direction: column; justify-content: space-between;
  align-items: flex-end; padding: 0 0 24px; color: var(--muted);
  font-size: 11px; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.chart-plot { flex: 1; position: relative; min-width: 0; }
.chart-guide-lines {
  position: absolute; inset: 0 0 24px; display: flex; flex-direction: column;
  justify-content: space-between; pointer-events: none;
}
.chart-guide-lines i { border-top: 1px dashed var(--line); height: 0; }
.chart-columns {
  position: relative; z-index: 1; height: 100%; display: grid;
  grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: clamp(4px, 1.1vw, 12px); align-items: stretch;
}
.chart-column { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chart-bar-space { width: 100%; min-height: 0; flex: 1; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.chart-bar {
  border-radius: 6px 6px 0 0; width: 100%; max-width: 52px; min-height: 3px;
  background: linear-gradient(180deg, #61a7ff, #3978f5); position: relative;
  transition: filter .18s;
}
.chart-bar:hover { filter: brightness(1.15); }
/* 该时间段没有成功改价：不放柱子，避免基线一排小蓝点 */
.chart-bar.is-zero { display: none; }
.dark .chart-bar { background: linear-gradient(180deg, #8ab8ff, #4b86f7); }
.chart-bar.is-split { background: none; display: flex; flex-direction: column; justify-content: flex-end; }
.chart-bar.is-split > i { display: block; width: 100%; }
.chart-bar.is-split > i.f { background: #f4a3a3; border-radius: 6px 6px 0 0; }
.chart-bar.is-split > i.ok { background: linear-gradient(180deg, #61a7ff, #3978f5); }
.dark .chart-bar.is-split > i.ok { background: linear-gradient(180deg, #8ab8ff, #4b86f7); }
.chart-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); background: #172438; color: #fff;
  border-radius: 7px; padding: 7px 11px; white-space: nowrap; font-size: 11px;
  z-index: 2; box-shadow: 0 7px 18px #0002;
}
.chart-tooltip b { display: block; font-size: 13px; }
.chart-tooltip .chart-tip-sub { margin-top: 2px; color: #c3d3ea; }
.chart-bar:hover .chart-tooltip { display: block; }
.chart-x-label { height: 16px; line-height: 16px; font-size: 10px; white-space: nowrap; color: var(--muted); }
.chart-empty { padding: 40px; text-align: center; color: var(--muted); }

/* 业务链路（原型 .processline） */
.processline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.processline span { background: var(--soft); padding: 8px 15px; border-radius: 8px; font-weight: 600; }
.processline b { color: var(--muted); }

/* ============================================================ 10. 抽屉 / 弹窗 */
#drawer-mask {
  position: fixed; inset: 0; z-index: 32; background: rgba(11, 25, 59, .54);
  display: none; justify-content: flex-end;
}
#drawer-mask.open { display: flex; animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#drawer {
  position: fixed; top: 0; right: 0; z-index: 33;
  height: 100vh; width: min(760px, 97vw); background: var(--panel);
  box-shadow: -15px 0 40px #0002; display: none; flex-direction: column;
  color: var(--text); animation: drawerIn .2s ease-out;
}
#drawer.open { display: flex; }
#drawer.drawer-task, #drawer.drawer-product { width: 60vw; max-width: 1280px; min-width: 770px; }
@keyframes drawerIn { from { transform: translateX(28px); } to { transform: translateX(0); } }

.drawer-head {
  padding: 20px 25px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
}
.drawer-head h3, .drawer-head h2 { font-size: 20px; margin: 3px 0 0; }
.eyebrow { font-size: 12px; color: var(--muted); }
.drawer-body { padding: 20px 25px; overflow: auto; flex: 1; }
.drawer-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 25px; border-top: 1px solid var(--line); background: var(--panel);
}
.drawer-foot .btn { margin: 0; }
.icon-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  width: 36px; height: 36px; border-radius: 9px; font-size: 17px; line-height: 1;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.drawer-section { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.drawer-section h3 { font-size: 15px; margin: 0 0 13px; display: flex; align-items: center; gap: 8px; }
.drawer-section > p, .drawer-section > .muted { font-size: 12px; margin: 0 0 14px; }
.subhead { font-size: 13px; font-weight: 700; margin: 20px 0 10px; }
.step-circle {
  background: var(--soft); color: var(--primary); border-radius: 50%;
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  font-weight: 800; font-size: 12px;
}
.section-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-line h3 { margin: 0; }
.dlrow {
  display: flex; gap: 20px; justify-content: space-between;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
}
.dlrow:last-child { border-bottom: 0; }
.dlrow > b { text-align: right; font-weight: 600; max-width: 66%; word-break: break-word; }

/* 控制台的键值列表（原型用 .dlrow，控制台老代码用 dl.kv） */
.kv { display: grid; grid-template-columns: minmax(88px, auto) 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 9px 2px; border-bottom: 1px dashed var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { font-weight: 600; overflow-wrap: anywhere; }

.mini-product {
  display: flex; align-items: center; gap: 12px;
  background: var(--soft); padding: 12px; border-radius: 9px; margin-bottom: 12px;
}
.pricecompare { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; }
.pricecompare > div {
  flex: 1; background: var(--soft); padding: 16px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 5px;
}
.pricecompare > div span { color: var(--muted); font-size: 12px; }
.pricecompare strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.pricecompare .arrow { font-size: 20px; color: var(--primary); }

/* 节点多选（原型 V10 node-options） */
.node-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 190px; overflow: auto; }
.node-option {
  display: flex; align-items: flex-start; gap: 7px; padding: 11px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; min-width: 0;
}
.node-option > input { margin: 4px 2px 0 0; }
.node-option span { display: grid; min-width: 0; }
.node-option b { font-size: 12px; overflow-wrap: anywhere; }
.node-option small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.select-empty {
  border: 1px dashed var(--line); background: var(--soft); border-radius: 8px;
  color: var(--muted); padding: 18px; text-align: center; font-size: 12px;
}
.task-workspace { display: grid; grid-template-columns: minmax(245px, .85fr) minmax(350px, 1.4fr); gap: 14px; align-items: start; }
.task-linkage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.task-selected-products { max-height: 270px; overflow: auto; display: grid; gap: 7px; }
#drawer.drawer-task .formgrid { gap: 10px; }
#drawer.drawer-task .drawer-foot { align-items: center; }
#drawer.drawer-task .drawer-section { padding: 15px; margin: 0; min-width: 0; }
#drawer.drawer-task .field { gap: 4px; font-size: 12px; }
#drawer.drawer-task .field input, #drawer.drawer-task .field select { width: 100%; padding: 7px 9px; }
.pickerrow { display: flex; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.pickerrow:last-child { border: 0; }
.pickedItem {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: var(--soft); border-radius: 8px; gap: 13px; margin-bottom: 7px;
}

.modal-mask {
  position: fixed; inset: 0; background: #0b193b99; z-index: 56;
  display: flex; justify-content: center; align-items: center; padding: 20px;
  animation: fadeIn .18s;
}
.modal {
  background: var(--panel); border-radius: 14px; width: min(460px, 100%);
  max-height: 90vh; overflow: auto; padding: 25px; color: var(--text);
  box-shadow: 0 25px 80px #0004;
}
.modal h3 { font-size: 18px; margin: 0 0 10px; }
.modal p { color: var(--muted); margin: 0 0 20px; line-height: 1.7; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================ 11. 登录页 */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: min(430px, 92vw); padding: 35px; margin: 0; }
.login h1 { font-size: 22px; display: flex; align-items: center; gap: 9px; }
.login h1 .mark { color: var(--primary); font-size: 19px; }
.login .sub { font-size: 13px; margin-top: 6px; }
.login .field { margin: 16px 0; }
.login .field label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.login input { width: 100%; }
.login .btn { width: 100%; justify-content: center; }
.login .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.login .foot .hint { flex: 1; min-width: 180px; text-align: right; }
.login .theme-btn { flex: 0 0 auto; }
.theme-btn {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; font-size: 12px;
}
.theme-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ============================================================ 12. 改价策略（照抄原型 fixedStrategiesPanel） */
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.strategy-card { margin: 0; display: grid; align-content: start; gap: 9px; padding: 25px; }
.strategy-card h2 { font-size: 19px; margin: 0; }
.strategy-card p { font-size: 13px; line-height: 1.85; margin: 2px 0 10px; color: var(--muted); }
.strategy-top { display: flex; justify-content: space-between; align-items: center; }
.strategy-icon {
  display: grid; place-items: center; background: var(--soft); color: var(--primary);
  font-size: 15px; font-weight: 800; width: 44px; height: 44px; border-radius: 12px;
}
.strategy-rule { padding: 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); display: grid; gap: 4px; }
.strategy-rule b { font-size: 12px; }
.strategy-rule span { font-size: 12px; color: var(--muted); }
.strategy-note {
  margin: 18px 0 0; padding: 12px 15px; border-radius: 9px;
  background: var(--soft); color: var(--muted); font-size: 12px;
}

/* ============================================================ 13. 已选商品行 / 抽屉页脚摘要（照抄原型） */
.selected-product-row {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  border-radius: 9px; padding: 7px; background: var(--bg); min-width: 0;
}
.selected-product-text { min-width: 0; flex: 1; display: grid; line-height: 1.4; }
.selected-product-row .btn { flex: 0 0 auto; white-space: nowrap; }
.selected-product-text b {
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.selected-product-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-footer-summary { margin-right: auto; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.task-footer-summary > span { font-size: 14px; font-weight: 800; color: var(--primary); }
.task-footer-summary small { font-size: 11px; color: var(--muted); }

/* 商品选择弹窗（原型 openProductPickerModal） */
.picker-modal { width: min(880px, 96vw); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 86vh; }
.picker-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.picker-head h3 { margin: 0; font-size: 17px; }
.picker-head .muted { margin-left: auto; font-size: 12px; }
.picker-body { padding: 0 22px; overflow: auto; flex: 1; }
.picker-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }
.picker-filters .input { min-width: 140px; }
.picker-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.picker-list .pickerrow { padding: 9px 12px; }
.picker-list .pickerrow:hover { background: var(--soft); }
.picker-list .pickerrow input { margin-right: 2px; }
.picker-foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 22px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.picker-foot .spacer { flex: 1; }

/* ============================================================ 14. 反馈 / 杂项 */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-left: 3px solid var(--primary); border-radius: 9px;
  padding: 11px 15px; box-shadow: 0 10px 28px #0d193324; font-size: 13px; max-width: 380px;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.loading { color: var(--muted); padding: 18px; text-align: center; }
.view-enter { animation: viewIn .18s ease-out; }
@keyframes viewIn { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================ 15. 响应式（照抄原型断点） */
@media (max-width: 1150px) {
  #drawer.drawer-task, #drawer.drawer-product { width: 76vw; min-width: 720px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1050px) {
  #drawer.drawer-task, #drawer.drawer-product { width: 90vw; min-width: 0; }
  .task-workspace { grid-template-columns: 1fr 1fr; }
  .strategy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 950px) {
  .top { flex-wrap: wrap; padding: 12px 14px; }
  .stats-six, #cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .formgrid, .row { grid-template-columns: 1fr; }
  .container { padding: 0 14px; margin: 16px auto; }
}
@media (max-width: 760px) {
  .filterbar label, .filterbar select, .filterbar input, .filterbar .f { width: 100%; }
  .filterbar .btn { width: 100%; justify-content: center; }
  .sectionhead { align-items: flex-start; }
}
@media (max-width: 720px) {
  .stats-six, #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #drawer.drawer-task, #drawer.drawer-product { width: 100vw; max-width: 100vw; min-width: 0; }
  .task-workspace { grid-template-columns: 1fr; }
  .node-options { grid-template-columns: 1fr; }
  .crumb-actions, .pagehead .actions { width: 100%; justify-content: flex-end; }
  .chart-card { padding: 14px; }
  .chart-switch button { padding: 6px 8px; }
  .chart-y-axis { width: 42px; font-size: 10px; }
  .chart-body { height: 220px; }
  .chart-columns { gap: 3px; }
  .chart-x-label { font-size: 8px; }
}
