/* ============================================================
   嗨团AI排品 - 全站样式
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff4ff;
  --danger: #dc2626;
  --warn: #d97706;
  --success: #16a34a;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --bg: #f0f2f5;
  --sidebar: #0e1626;
  --sidebar-w: 216px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13px; color: var(--text); outline: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  margin: 14px 12px 22px;
  background: #16223a;
  border-radius: 10px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e2445c;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand .name { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.brand .sub { color: #64748b; font-size: 11px; margin-top: 2px; }
.menu { padding: 0 12px; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.menu a svg { width: 17px; height: 17px; flex-shrink: 0; }
.menu a:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.menu a.active { background: var(--primary); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .crumb-current { background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: 5px; font-weight: 500; }
.content { padding: 20px 24px 40px; flex: 1; min-width: 0; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 7px 15px;
  font-size: 13px;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #c7cdd6; background: #f9fafb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:disabled { background: #93b4f5; border-color: #93b4f5; cursor: not-allowed; }
.btn.ghost-primary { background: var(--primary-light); border-color: transparent; color: var(--primary); }
.btn.ghost-primary:hover { background: #dfe9ff; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { padding: 10px 22px; font-size: 14px; }
.btn.danger-text { color: var(--danger); }
.input, .select {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 11px;
  background: #fff;
  min-width: 0;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  line-height: 16px;
  white-space: nowrap;
}
.tag.gray  { background: #f3f4f6; color: #6b7280; }
.tag.blue  { background: #eff4ff; color: #2563eb; }
.tag.green { background: #ecfdf3; color: #16a34a; }
.tag.red   { background: #fef2f2; color: #dc2626; }
.tag.orange{ background: #fff7ed; color: #d97706; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 38px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #d1d5db;
  border-radius: 20px;
  transition: .2s;
  cursor: pointer;
}
.switch .slider:before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 进度条 */
.bar { width: 120px; height: 5px; background: #e8ecf2; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.bar.orange i { background: #f59e0b; }
.bar.blue i { background: var(--primary); }
.bar.green i { background: var(--success); }
.bar.red i { background: var(--danger); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 60px 20px 40px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 640px;
  max-width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .modal-head {
  padding: 18px 22px 10px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.modal .modal-title { font-size: 16px; font-weight: 600; }
.modal .modal-close { background: none; border: none; font-size: 18px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 2px 4px; }
.modal .modal-close:hover { color: var(--text); }
.modal .modal-body { padding: 6px 22px 20px; }
.modal .modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #f1f5f9; }

/* Toast */
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: #111827; color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all .2s;
  max-width: 70vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #b91c1c; }

/* ---------- 商品池 ---------- */
.page-title { font-size: 20px; font-weight: 700; }
.page-desc { color: var(--text-2); font-size: 12px; margin: 6px 0 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stat-card .label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-card .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.stat-card .num { font-size: 26px; font-weight: 700; margin-top: 8px; }
.stat-card .num small { font-size: 13px; font-weight: 400; color: var(--text-2); margin-left: 3px; }
.stat-card .sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.formula-bar {
  background: var(--primary-light);
  border-radius: 8px;
  color: #3b5bb5;
  font-size: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.filter-bar { background: #fff; border-radius: 10px; padding: 14px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: 0 1px 2px rgba(16,24,40,.04); margin-bottom: 14px; }
.filter-bar .input { width: 200px; }
.filter-bar .select { width: 130px; }
.filter-bar .right { margin-left: auto; color: var(--text-3); font-size: 12px; }

.table-wrap { background: #fff; border-radius: 10px; overflow: auto; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1080px; }
table.grid th {
  text-align: left;
  color: var(--text-2);
  font-weight: 500;
  font-size: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #fafbfc;
}
table.grid td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; white-space: nowrap; }
table.grid tr:hover td { background: #f8faff; }
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--primary); }
.cell-product .name { font-weight: 600; cursor: pointer; color: var(--text); }
.cell-product .name:hover { color: var(--primary); }
.cell-product .meta { color: var(--text-3); font-size: 11px; margin-top: 4px; display: flex; gap: 8px; }
.rate-cell .val { margin-bottom: 4px; font-size: 12px; }
.rate-cell .val b { font-size: 13px; }
.score-cell { display: flex; align-items: center; gap: 8px; }
.score-cell .bar { width: 90px; }
.ops-cell { display: flex; gap: 8px; align-items: center; }
.ops-cell .btn { padding: 4px 12px; font-size: 12px; }
.month-cell { color: var(--text-2); font-size: 12px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 0 4px; }
.pagination button {
  min-width: 30px; height: 30px;
  border: 1px solid var(--border); background: #fff;
  border-radius: 6px; font-size: 13px; color: var(--text-2);
}
.pagination button.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .info { color: var(--text-3); font-size: 12px; margin: 0 8px; }

/* 弹窗内详情 */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { background: #f8fafc; border-radius: 8px; padding: 10px 14px; }
.kv .k { color: var(--text-2); font-size: 12px; }
.kv .v { font-weight: 700; font-size: 15px; margin-top: 4px; }
.section-title { font-size: 13px; font-weight: 600; margin: 18px 0 10px; }
.cate-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 12px; }
.cate-row .name { width: 64px; color: var(--text-2); flex-shrink: 0; }
.cate-row .bar { flex: 1; width: auto; }
.cate-row .n { width: 36px; text-align: right; color: var(--text-2); }

/* 加入排期弹窗 */
.month-tabs { display: flex; gap: 10px; margin: 10px 0 12px; }
.month-tab {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: #fff;
}
.month-tab .t { font-weight: 600; font-size: 14px; }
.month-tab .s { color: var(--text-3); font-size: 11px; margin-top: 3px; }
.month-tab.cur { border-color: var(--primary); background: var(--primary-light); }
.month-tab.cur .s { color: var(--primary); }
.alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.date-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.date-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 8px 2px;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  transition: all .12s;
}
.date-cell .d { font-weight: 600; font-size: 13px; }
.date-cell .s { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.date-cell:hover { border-color: var(--primary); }
.date-cell.full { color: var(--text-3); background: #fafafa; cursor: not-allowed; }
.date-cell.full .d { color: var(--text-3); }
.date-cell.bad { color: #cbd5e1; background: #fafafa; cursor: not-allowed; }
.date-cell.risky { border-color: #f59e0b; color: #d97706; background: #fffbeb; }
.date-cell.picked { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 1px var(--primary); }
.modal-tip { color: var(--text-2); font-size: 12px; margin-top: 12px; }
.modal-tip b.warn { color: var(--warn); }

/* ---------- 工作台 ---------- */
.wb-layout { display: flex; gap: 16px; align-items: flex-start; }
.wb-side { width: 296px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 70px; }
.wb-side .panel { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.panel-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.panel-title .no { color: var(--primary); }
.cons-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 13px; }
.cons-row label { display: flex; align-items: center; gap: 7px; color: var(--text); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.stepper button { border: none; background: #f8fafc; width: 24px; height: 26px; font-size: 13px; color: var(--text-2); }
.stepper button:hover { background: #eef2f7; color: var(--primary); }
.stepper .val { padding: 0 8px; font-size: 12px; min-width: 44px; text-align: center; }
.instr-select { width: 100%; margin-bottom: 8px; }
.instr-meta { color: var(--text-3); font-size: 11px; margin: 4px 0 6px; }
.instr-meta b { color: var(--primary); }
.instr-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 108px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}
.instr-parse { font-size: 11px; color: var(--text-2); margin: 8px 0; }
.instr-parse b { color: var(--primary); }
.instr-parse b.mismatch { color: var(--warn); }
.instr-btns { display: flex; gap: 8px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  background: #fff;
  transition: all .12s;
  user-select: none;
}
.chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 500; }
.save-btn { width: 100%; padding: 11px; font-size: 14px; }
.save-status { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 8px; }

.wb-main { flex: 1; min-width: 0; }
.wb-head { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.wb-head-row { display: flex; align-items: flex-start; gap: 16px; }
.wb-month-num { font-size: 46px; font-weight: 800; color: var(--primary); line-height: 1; }
.wb-month-info .t { font-size: 16px; font-weight: 700; }
.wb-month-info .m { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.wb-head-ops { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.wb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.wb-stat { background: #f8fafc; border-radius: 8px; padding: 12px 16px; }
.wb-stat .k { color: var(--text-2); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.wb-stat .v { font-size: 21px; font-weight: 700; margin-top: 6px; }
.wb-stat .s { color: var(--text-3); font-size: 11px; margin-top: 4px; }
.wb-stat .s b { color: var(--success); font-weight: 600; }
.wb-stat .s b.bad { color: var(--warn); }
.wb-filter { display: flex; gap: 10px; margin: 14px 0; align-items: center; }
.wb-filter .right { margin-left: auto; font-size: 12px; color: var(--text-3); }

.cal-board { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px; }
.cal-head div { text-align: center; font-size: 12px; color: var(--text-2); padding: 4px 0; }
.cal-head div.weekend { color: #f59e0b; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 150px;
  padding: 8px;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .12s, border-color .12s;
  position: relative;
  overflow: hidden;
}
.cal-cell:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.1); }
.cal-cell.blank { border: none; cursor: default; background: transparent; }
.cal-cell .cal-top { display: flex; align-items: center; gap: 6px; }
.cal-cell .daynum { font-size: 14px; font-weight: 700; }
.cal-cell.today .daynum { color: #fff; background: var(--primary); border-radius: 5px; padding: 0 5px; }
.cal-cell .gmv-line { font-size: 11px; color: var(--text-2); margin: 5px 0 2px; }
.cal-cell .gmv-bar { height: 3px; background: #e8ecf2; border-radius: 2px; margin-bottom: 6px; overflow: hidden; }
.cal-cell .gmv-bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.cal-item {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.cal-item .n { overflow: hidden; text-overflow: ellipsis; }
.cal-item .p { color: var(--text-2); flex-shrink: 0; }
.cal-item.dim { opacity: .25; }
.cal-badge {
  position: absolute; top: 6px; right: 6px;
  background: #6366f1; color: #fff;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 5px;
}
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 4px 2px; font-size: 11px; color: var(--text-2); }
.cal-legend .li { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .li i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* 生成中遮罩 */
.gen-mask {
  position: fixed; inset: 0;
  background: rgba(240,242,245,.92);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
}
.gen-mask.show { display: flex; }
.gen-box { width: 560px; }
.gen-box .t { font-size: 17px; font-weight: 700; }
.gen-box .goal { color: var(--text-2); font-size: 12px; margin: 6px 0 18px; }
.gen-step {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  border-radius: 8px;
  padding: 13px 16px;
  margin-bottom: 10px;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.gen-step .l { display: flex; align-items: center; gap: 9px; }
.gen-step .ico { width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; }
.gen-step.done .ico { background: var(--primary); }
.gen-step.doing .ico { background: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.15); animation: pulse 1.2s infinite; }
.gen-step .note { color: var(--text-3); font-size: 12px; }
.gen-step.done .l, .gen-step.doing .l { color: var(--text); font-weight: 500; }
.gen-step .l { color: var(--text-3); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(37,99,235,.12); } 50% { box-shadow: 0 0 0 6px rgba(37,99,235,.2); } }
.gen-progress { height: 3px; background: #dbe3ee; border-radius: 2px; margin-top: 16px; overflow: hidden; }
.gen-progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .3s; }

/* 日详情抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.2); z-index: 95; display: none; }
.drawer-mask.show { display: block; }
.drawer {
  position: fixed; top: 0; right: -460px;
  width: 460px; max-width: 96vw;
  height: 100vh;
  background: #fff;
  z-index: 96;
  box-shadow: -8px 0 30px rgba(15,23,42,.12);
  transition: right .22s ease;
  display: flex;
  flex-direction: column;
}
.drawer.show { right: 0; }
.drawer-head { padding: 16px 20px 0; }
.drawer-title { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.drawer-title .sub { color: var(--text-3); font-size: 12px; font-weight: 400; margin-left: 8px; }
.drawer-tabs { display: flex; gap: 22px; margin-top: 12px; border-bottom: 1px solid var(--border); }
.drawer-tabs div { padding: 9px 2px; font-size: 13px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.drawer-tabs div.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.drawer-body { padding: 14px 20px 30px; overflow: auto; flex: 1; }
.day-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.day-sum .kv .v { font-size: 17px; }
.day-item { border: 1px solid #eef1f6; border-radius: 9px; padding: 10px 12px; margin-bottom: 9px; }
.day-item .row1 { display: flex; align-items: center; gap: 8px; }
.day-item .idx { color: var(--primary); font-weight: 700; }
.day-item .nm { font-weight: 600; font-size: 13px; flex: 1; }
.day-item .gmv { font-weight: 700; }
.day-item .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--text-2); align-items: center; }
.day-item .ops { margin-top: 8px; display: flex; gap: 8px; }
.day-item .ops .btn { padding: 3px 10px; font-size: 11px; }
.md-body { font-size: 13px; line-height: 1.9; color: #374151; word-break: break-word; }
.md-body p { margin-bottom: 10px; }
.md-body strong { color: #111827; }
.soft-bar { margin-bottom: 12px; }
.soft-bar .row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.soft-bar .row b { color: var(--primary); }
.hard-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px dashed #eef1f6; font-size: 13px; align-items: flex-start; }
.hard-item .ok { color: var(--success); font-weight: 600; }
.hard-item .bad { color: var(--warn); font-weight: 600; }
.hard-item .desc { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.stock-note { background: #f8fafc; border-radius: 8px; padding: 10px 14px; color: var(--text-2); font-size: 12px; line-height: 1.8; margin-top: 14px; }
.stock-note b { color: var(--text); }

/* ---------- 规则库 ---------- */
.rule-layout { display: flex; gap: 16px; align-items: flex-start; }
.rule-side { width: 300px; flex-shrink: 0; }
.rule-item { background: #fff; border-radius: 10px; padding: 13px 16px; margin-bottom: 10px; cursor: pointer; border: 1.5px solid transparent; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.rule-item.on { border-color: var(--primary); }
.rule-item .t { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rule-item .m { color: var(--text-3); font-size: 11px; margin-top: 5px; }
.rule-main { flex: 1; min-width: 0; background: #fff; border-radius: 10px; padding: 20px 24px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.rule-instr-view { font-size: 13px; line-height: 1.8; color: #374151; background: #f8fafc; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.rule-meta { color: var(--text-3); font-size: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.rule-meta .tag-gray { font-size: 11px; }
.rule-cols { display: flex; gap: 40px; margin-top: 14px; flex-wrap: wrap; }
.rule-col { min-width: 300px; flex: 1; }
.rule-col .h { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.rule-col .h .hint { color: var(--text-3); font-weight: 400; font-size: 11px; margin-left: 8px; }
.cons-check { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.capacity-note { margin-top: 16px; background: #f0fdf4; border-radius: 8px; padding: 12px 16px; font-size: 12px; color: #166534; line-height: 1.8; }
.capacity-note.bad { background: #fffbeb; color: #92400e; }
.form-label { font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.form-input, .form-textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.form-textarea { min-height: 96px; line-height: 1.7; resize: vertical; }
.form-foot { margin-top: 20px; display: flex; gap: 10px; }
.form-foot .primary { flex: 1; }

/* ---------- 调整记录 ---------- */
.adj-sec { background: #fff; border-radius: 10px; padding: 18px 22px; box-shadow: 0 1px 2px rgba(16,24,40,.04); margin-bottom: 18px; }
.adj-sec .h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.adj-sec .h .t { font-size: 16px; font-weight: 700; }
.adj-sec .h .n { margin-left: auto; color: var(--text-3); font-size: 12px; }
.adj-sec .d { color: var(--text-2); font-size: 12px; margin-bottom: 14px; }
.closed-note { background: #f0fdf4; border-radius: 8px; padding: 12px 16px; color: #166534; font-size: 12px; line-height: 1.8; }
.closed-note b { font-weight: 600; }

/* 空状态 */
.empty-tip { text-align: center; color: var(--text-3); padding: 46px 0 54px; }
.empty-tip .t { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.empty-tip .s { font-size: 12px; line-height: 1.9; }

.footer-meta { color: var(--text-3); font-size: 11px; padding: 14px 4px 0; display: flex; justify-content: space-between; }

/* 响应式 */
@media (max-width: 1280px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .wb-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .wb-side { width: 260px; }
  .stat-cards { grid-template-columns: 1fr; }
}
