/* ==========================================================================
   烘焙店成本核算工作台 · ERP 样式系统（本地化，零外部依赖）
   设计基调：Apple 式简洁——大圆角、柔和阴影、浅色侧栏、留白呼吸感
   ========================================================================== */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-alt: #f9f9fb;
  --border: #e8e8ec;
  --border-strong: #d9d9e0;
  --text: #1d1d1f;
  --text-2: #4b4b50;
  --text-muted: #86868b;

  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-soft: #fff3ea;

  --sidebar: #f5f5f7;
  --sidebar-2: #e9e9ee;
  --sidebar-text: #3a3a3e;
  --sidebar-dim: #86868b;

  --ok-bg: #e8f6ec; --ok-fg: #1d7a3e;
  --warn-bg: #fdf3dd; --warn-fg: #8a6100;
  --danger-bg: #fdeaea; --danger-fg: #b42318;
  --info-bg: #e9f1fe; --info-fg: #1a56a0;

  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, .22), 0 4px 16px rgba(0, 0, 0, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Roboto,
          Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.1px; }
p { margin: 0; }
ul, ol { margin: 0; }
button { font-family: inherit; font-size: inherit; }

/* ------------------------------- 布局骨架 ------------------------------- */
body.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 216px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.brand {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.1px;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: .5px;
}

.nav { padding: 6px 10px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  margin-bottom: 2px;
  padding: 0 12px;
  color: var(--sidebar-text);
  font-size: 13px;
  border-radius: 9px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sidebar-2); color: var(--text); text-decoration: none; }
.nav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(194, 65, 12, .35);
}
.nav .ico { width: 16px; text-align: center; font-size: 13px; opacity: .92; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.sidebar-foot b { display: block; color: var(--text); font-size: 12.5px; }
.sidebar-foot small { font-size: 11px; color: var(--text-muted); }
.sidebar-foot form { margin-top: 6px; }
.sidebar-foot button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: 11.5px;
}
.sidebar-foot button:hover { color: var(--danger-fg); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: 216px;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 54px;
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { color: var(--border-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 20px 22px 32px; max-width: 1440px; }

@media (max-width: 900px) {
  .sidebar { width: 58px; }
  .brand span, .brand small, .nav .label, .sidebar-foot { display: none; }
  .main { margin-left: 58px; }
  .nav a { justify-content: center; padding: 0; }
}

/* ------------------------------- 卡片 ------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-hd h2, .card-hd h3 { font-size: 14px; font-weight: 600; }
.card-hd .sub { font-size: 12px; color: var(--text-muted); }
.card-bd { padding: 16px 18px; }
.card-bd.tight { padding: 0; }

/* ------------------------------- 工具栏 ------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.toolbar h2 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.toolbar .spacer { margin-left: auto; }
.toolbar .chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 11px;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------------------------- 页内切换 tab ---------------------------- */
.seg-tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.seg-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg-tab:hover { color: var(--text); }
.seg-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.seg-tab .chip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.seg-tab.active .chip { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }

/* 搜索胶囊（页面列表通用） */
input.search {
  background: #f0f0f3;
  border: 1px solid transparent;
  border-radius: 999px;
  height: 30px;
  padding: 0 16px;
  transition: background .15s, border-color .15s, box-shadow .15s, width .2s;
}
input.search::placeholder { color: var(--text-muted); }
input.search:hover { background: #ebebee; }
input.search:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .13);
}
/* 工具栏内的下拉也做胶囊化 */
.toolbar select {
  background: #f0f0f3;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  height: 30px;
  transition: background .15s, box-shadow .15s;
}
.toolbar select:hover { background: #ebebee; }
.toolbar select:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .13);
}

/* 表格行内“幽灵”输入框：静默无边框，悬停/聚焦浮现 */
.table td input.cell-ghost {
  background: transparent;
  border-color: transparent;
  border-radius: 7px;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.table td input.cell-ghost:hover { background: #fff; border-color: var(--border); }
.table td input.cell-ghost:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .13);
}
.table td input.cell-ghost:disabled { background: transparent; border-color: transparent; }

/* 产品图片裁剪（产品弹框内的 1:1 覆盖层） */
.pd-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 20, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pd-crop-overlay[hidden] { display: none; }
.pd-crop-panel {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-lg, 0 24px 64px rgba(0, 0, 0, .25));
  max-width: 92vw;
}
.pd-crop-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
#pd-crop-zoom { width: 100%; margin-top: 12px; }
.pd-crop-ft { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

#pd-crop-box {
  position: relative;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: repeating-conic-gradient(#ececf1 0 25%, #fafafc 0 50%) 0 0 / 20px 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#pd-crop-box:active { cursor: grabbing; }
#pd-crop-img { position: absolute; max-width: none; }

/* 卡片底部的“新增/添加”条 */
.card-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 12px 18px;
  background: var(--surface-alt);
  border-top: 1px dashed var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-bd .card-sub { margin: 14px -18px -16px; }

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s,
              transform .06s, box-shadow .15s;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(194, 65, 12, .3);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-dark { background: #2c2c2e; border-color: #2c2c2e; color: #fff; }
.btn-dark:hover { background: #1c1c1e; }
.btn-danger { color: var(--danger-fg); border-color: #f2c5c0; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--primary); font-size: 12.5px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger-fg); }
.btn-link.muted { color: var(--text-muted); }

/* ------------------------------- 表单 ------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.field > span, .field > label { color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }

input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="file"], select, textarea {
  height: 30px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 7px 10px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .13);
}
input:disabled, select:disabled, textarea:disabled {
  background: #f2f2f4; color: var(--text-muted); cursor: not-allowed;
}
input[type="checkbox"] { height: 15px; width: 15px; accent-color: var(--primary); }
input.w-sm { width: 84px; }
input.w-md { width: 140px; }
input.w-lg { width: 200px; }
.num { text-align: right; font-family: var(--mono); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ------------------------------- 表格 ------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .2px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f3;
  vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f7f7f9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table .strong { font-weight: 600; }
.table .sub { color: var(--text-muted); font-size: 11.5px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* 配方编辑器 BOM：行内级联（分类 → 条目 → 数量 → 单价/小计 → 操作） */
.re-bom td { padding-top: 7px; padding-bottom: 7px; }
.re-bom td select { width: 100%; min-width: 0; }
.re-bom td select:disabled { color: var(--text-muted); }
.re-bom .re-unit-price { font-size: 12.5px; font-weight: 600; }
.re-bom .re-line-cost { font-size: 11px; margin-top: 2px; }
.re-bom .re-u { min-width: 22px; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }
.text-ok { color: var(--ok-fg); }
.text-warn { color: var(--warn-fg); }
.text-danger { color: var(--danger-fg); }
.text-right { text-align: right; }
.strong { font-weight: 600; }

/* ------------------------------- 徽章 ------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11.5px;
  line-height: 17px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #c9e9d3; }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: #f2e2b0; }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: #f5cac5; }
.badge-info { background: var(--info-bg); color: var(--info-fg); border-color: #c9daf6; }
.badge-muted { background: #f0f0f3; color: var(--text-2); border-color: #e3e3e8; }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: #f6d9c2; }

/* ------------------------------- KPI ------------------------------- */
.kpi {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.kpi .label { font-size: 11.5px; color: var(--text-muted); letter-spacing: .2px; }
.kpi .value { font-size: 23px; font-weight: 700; line-height: 1.3; margin-top: 3px; letter-spacing: -.3px; }
.kpi .value small { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.kpi .foot { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.progress { height: 6px; background: #ececf0; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: var(--ok-fg); border-radius: 999px; }
.progress.danger > i { background: #b42318; }

/* ------------------------------- 空态 / 加载 ------------------------------- */
.empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.empty h3 { font-size: 14px; color: var(--text); margin-bottom: 6px; }
.loading { padding: 32px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.loading::after { content: "…"; }

/* ------------------------------- 列表（成本拆解左栏） ------------------------------- */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

.pick-list { list-style: none; padding: 6px; margin: 0; max-height: calc(100vh - 220px); overflow: auto; }
.pick-list li { border-bottom: 0; }
.pick-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  transition: background .12s;
}
.pick-list button:hover { background: var(--surface-alt); }
.pick-list button.active { background: var(--primary-soft); box-shadow: inset 0 0 0 1px #f0cfae; }
.pick-list .row1 { display: flex; align-items: center; gap: 6px; }
.pick-list .row1 b { font-weight: 600; }
.pick-list .row2 { color: var(--text-muted); font-size: 11.5px; margin-top: 1px; }

/* ------------------------------- 明细键值 ------------------------------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 14px; font-size: 12.5px; max-width: 640px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-family: var(--mono); }
.kv .total { border-top: 1px solid var(--border); padding-top: 7px; font-weight: 700; }

/* ------------------------------- 弹窗 ------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(20, 20, 24, .38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal-panel {
  position: relative;
  width: min(980px, 96vw);
  max-height: 92vh;
  margin-top: 3vh;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-panel.wide { width: min(1160px, 97vw); }
.modal-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.modal-hd h3 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.modal-hd .x {
  margin-left: auto;
  background: var(--surface-alt);
  border: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.modal-hd .x:hover { background: #e9e9ee; color: var(--text); }
.modal-body { padding: 16px 20px 20px; overflow: auto; }
.modal-body.flush { padding: 0; display: flex; overflow: hidden; }
.modal-ft {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

/* ------------------------------- Toast ------------------------------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 380px;
  padding: 11px 16px;
  font-size: 12.5px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  color: #fff;
  background: #2c2c2e;
}
.toast[hidden] { display: none; }
.toast.ok { background: #1d7a3e; }
.toast.error { background: #b42318; }

/* ------------------------------- 登录页 ------------------------------- */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f5f5f7 0%, #fbeee4 55%, #f3d9c4 100%);
}
.login-box {
  width: 360px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(120, 72, 30, .16), 0 2px 8px rgba(0, 0, 0, .05);
  padding: 30px 28px 24px;
}
.login-box .logo { text-align: center; margin-bottom: 4px; font-size: 30px; }
.login-box h1 { text-align: center; font-size: 16px; margin-bottom: 2px; }
.login-box .sub { text-align: center; font-size: 11.5px; color: var(--text-muted); margin-bottom: 20px; letter-spacing: .4px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box .field span { font-size: 12px; }
.login-box input { height: 34px; border-radius: 10px; }
.login-box .btn { height: 36px; font-size: 13px; border-radius: 10px; }
.login-err {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid #f5cac5;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  margin-bottom: 12px;
}
.login-foot { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 16px; }

/* ------------------------------- 编辑器 ------------------------------- */
.re-items td { padding: 5px 6px; }
.re-items select { width: 100%; }

/* 表格内联下拉（配方列表直接选品类/款式） */
.table select.table-select {
  height: 28px;
  font-size: 12px;
  padding: 0 4px;
  max-width: 130px;
  border-radius: 7px;
}
.re-preview { font-size: 12.5px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.section-title:first-child { margin-top: 0; }

/* --------------------------- 编辑器弹窗：左右布局 --------------------------- */
/* 左侧实时预览 · 右侧数据维护；底部操作条固定，各自滚动 */
.editor-root { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.editor-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  overflow: hidden;
}
.editor-aside {
  overflow: auto;
  padding: 16px;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
}
.editor-aside .aside-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 10px;
}
.editor-aside .aside-title .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok-fg);
  box-shadow: 0 0 0 3px rgba(29, 122, 62, .15);
}
.editor-aside .aside-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; }
.editor-main { overflow: auto; padding: 16px 20px 20px; }
.editor-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
@media (max-width: 1020px) {
  .editor-split { grid-template-columns: 1fr; overflow: auto; display: block; }
  .editor-aside { border-right: 0; border-bottom: 1px solid var(--border); }
  .editor-main, .editor-aside { overflow: visible; }
}

/* 预览面板（左侧） */
.pv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}
.pv-hero { text-align: center; padding: 6px 0 14px; }
.pv-hero .label { font-size: 11.5px; color: var(--text-muted); letter-spacing: .3px; }
.pv-hero .num {
  font-family: var(--mono);
  font-size: 27px; font-weight: 700; line-height: 1.25;
  letter-spacing: -.5px; margin-top: 3px;
}
.pv-hero .num small { font-size: 12.5px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.pv-hero .pv-badges { margin-top: 8px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pv-rows { max-width: none; grid-template-columns: auto minmax(0, 1fr); margin-top: 4px; }
.pv-rows dt { font-size: 11.5px; }
.pv-rows dd { font-size: 12px; }
.pv-health {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-2);
}

/* ------------------------------- 引导与说明 ------------------------------- */
.steps { list-style: none; padding: 0; margin: 12px auto 0; max-width: 520px; text-align: left; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 12.5px; color: var(--text-2); }
.steps b {
  flex: 0 0 20px; height: 20px; line-height: 20px; text-align: center;
  background: var(--primary); color: #fff; border-radius: 50%;
  font-size: 11.5px; font-weight: 600;
}
.advice { list-style: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--text-2); }
.advice li { padding: 4px 0 4px 14px; position: relative; }
.advice li::before {
  content: ""; position: absolute; left: 3px; top: 11px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.doc-list { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.err-list { margin: 6px 0 0; padding-left: 18px; font-size: 11.5px; color: var(--danger-fg); }

.hr { height: 1px; background: var(--border); margin: 16px 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; }
.mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.right { text-align: right; }

/* ------------------------------- 产品展示 ------------------------------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 16px;
}
.prod-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.prod-card:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.prod-card.is-off { opacity: .6; }
.prod-thumb {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #faf3ea, #efe3d2);
  display: flex; align-items: center; justify-content: center;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-ph { font-size: 44px; opacity: .45; }
.prod-tag { position: absolute; top: 10px; left: 10px; }
.prod-bd { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.prod-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.prod-title b { font-size: 13.5px; }
.prod-nums { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.prod-ops { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; }

.pd-image {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #faf3ea, #efe3d2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pd-image img { width: 100%; height: 100%; object-fit: cover; }
.pd-summary {
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px 14px; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); font-size: 12.5px;
  box-shadow: var(--shadow);
}
.pd-summary .row { display: flex; justify-content: space-between; align-items: baseline; }
.pd-summary .row b { font-family: var(--mono); font-size: 13px; }
.pd-summary .row.big b { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.pd-summary .divider { height: 1px; background: var(--border); margin: 2px 0; }
