/* ==========================================================================
   销售进单BOM · 工作台样式
   风格沿用现有门户：紫色渐变 #667eea → #764ba2，白色卡片，圆角 12px
   ========================================================================== */

:root {
  --brand-1: #667eea;
  --brand-2: #764ba2;
  --brand-soft: #f3f0ff;
  --brand-ink: #4c1d95;
  --ink: #1f2937;
  --ink-2: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #eef0f4;
  --bg: #f5f7fa;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --radius: 12px;
  --shadow-sm: 0 4px 14px rgba(31, 41, 55, 0.05);
  --shadow-md: 0 8px 24px rgba(31, 41, 55, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, p {
  margin: 0;
}

a {
  color: var(--brand-2);
}

/* ---------- 顶部品牌区 ---------- */
.wb-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(31, 41, 55, 0.16);
}

.wb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  /* 原始 logo 为 377×93 的长方形，按高度等比缩放并完整显示，不能裁成正方形 */
  width: auto;
  height: 40px;
  max-width: 170px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  flex: none;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-text em {
  font-style: normal;
  font-size: 12.5px;
  opacity: 0.82;
}

.brand-sep {
  opacity: 0.55;
  font-size: 12px;
}

.wb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wb-header-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.wb-header-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.24);
}

.header-note {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- 主容器 ---------- */
.wb-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.wb-main.landing {
  padding-top: 26px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.34);
}

.btn-ghost {
  background: #fff;
  border-color: #d1d5db;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: #f3f4f6;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn:disabled,
.btn.is-busy {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* ---------- 落地页 Hero ---------- */
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: 26px 30px;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -110px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(118, 75, 162, 0.14), rgba(118, 75, 162, 0) 70%);
  pointer-events: none;
}

.hero-kicker {
  margin-bottom: 8px;
  color: #8b5cf6;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-copy h1 {
  margin-bottom: 10px;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-sub {
  max-width: 460px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #6d28d9;
  font-size: 12px;
  font-weight: 600;
}

.hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
}

/* ---------- 机型卡片 ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
}

.category-card[data-category="DUAL"]::before {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

.category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.category-title {
  margin-bottom: 4px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.category-desc {
  color: var(--muted);
  font-size: 13px;
}

.category-tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.category-card[data-category="DUAL"] .category-tag {
  background: #eff6ff;
  color: #1d4ed8;
}

.category-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.form-row .btn {
  flex: none;
}

.hint-line {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--muted-2);
}

.hint-line.is-error {
  color: var(--danger);
}

/* ---------- 上次选型 ---------- */
.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 18px;
  background: #fff;
  border: 1px dashed #c7d2fe;
  border-radius: var(--radius);
  color: #4b5563;
  font-size: 13.5px;
}

.resume-card strong {
  color: var(--brand-ink);
}

.resume-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
}

/* ---------- 选型单信息条 ---------- */
.record-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding: 12px 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.record-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-ink);
}

.model-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
  color: var(--muted);
}

.status-badge.is-draft {
  background: #fff7ed;
  color: var(--warn);
}

.status-badge.is-final {
  background: var(--ok-bg);
  color: #047857;
}

/* ---------- 12 步进度条（01 机型选择 … 12 保存导出） ---------- */
.progress-wrap {
  /* 吸顶：紧贴品牌区下沿，正文在它下方滚动 */
  position: sticky;
  top: var(--wb-header-h, 64px);
  z-index: 50;
  margin-bottom: 16px;
  padding: 10px 12px;
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.progress-list {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 1040px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-item {
  flex: 1 1 0;
  /* 12 个步骤（01-12）时仍留在一条线上，不再挤成横向滚动 */
  min-width: 80px;
}

.progress-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

a.progress-link:hover {
  background: #f7f5ff;
  color: var(--brand-ink);
}

.progress-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #eef0f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.progress-label {
  white-space: nowrap;
}

.progress-item.is-done .progress-index {
  border-color: #a7f3d0;
  background: var(--ok-bg);
  color: #047857;
}

.progress-item.is-done .progress-link {
  color: #047857;
}

.progress-item.is-current .progress-link {
  color: var(--brand-ink);
  font-weight: 700;
}

.progress-item.is-current .progress-index {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.progress-item.is-disabled .progress-link {
  cursor: default;
  opacity: 0.72;
}

.progress-item.is-disabled a.progress-link {
  pointer-events: none;
}

/* ---------- 卡片与分组 ---------- */
.panel {
  margin-bottom: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.06);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  margin-bottom: 3px;
  font-size: 19px;
  font-weight: 700;
}

.panel-head p {
  color: var(--muted);
  font-size: 13px;
}

.step-counter {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.summary-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.group-card {
  margin-top: 16px;
}

.group-card:first-child {
  margin-top: 0;
}

/* 参数分组的左右布局：增压端 / 膨胀端各占一半，介质与安装等整宽 */
.unit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: flex-start;
}

.unit-grid > .group-card {
  flex: 1 1 100%;
  margin-top: 0;
}

.unit-grid > .group-card.is-half {
  flex: 1 1 calc(50% - 10px);
  min-width: 300px;
}

/* 首页卡片里的整宽按钮 */
.btn-block {
  width: 100%;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 700;
}

.group-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(var(--brand-1), var(--brand-2));
  flex: none;
}

.group-sub {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- 字段 ---------- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.field {
  min-width: 0;
}

.field.is-wide {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.req {
  color: var(--danger);
  font-weight: 700;
}

.field-unit {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
}

.input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: #b6bcc7;
}

.input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

textarea.input {
  resize: vertical;
  min-height: 76px;
}

select.input {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

input[type="date"].input {
  min-height: 38px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}

.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-2);
}

.field-help {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
}

.field-error {
  display: none;
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
}

.field.has-error .field-error {
  display: block;
}

.field.has-error .input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ---------- 热机 / 冷机页签 ---------- */
.unit-section {
  margin-top: 18px;
}

.unit-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 10px;
  background: #f3f4f6;
}

.unit-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.unit-tab:hover {
  color: var(--brand-ink);
}

.unit-tab.is-active {
  background: #fff;
  color: var(--brand-ink);
  box-shadow: 0 2px 6px rgba(31, 41, 55, 0.1);
}

.unit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
}

.unit-tab.is-ok .unit-dot {
  background: #10b981;
}

.unit-tab.is-missing .unit-dot {
  background: #f59e0b;
}

/* ---------- 清单表格 ---------- */
.table-card {
  margin-top: 20px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.table-head .group-title {
  margin-bottom: 0;
}

.table-scroll {
  overflow: auto;
  max-height: 540px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.table-scroll.readonly {
  max-height: none;
}

.bom-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.bom-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fc;
  color: #4b5563;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.bom-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
}

.bom-table tbody tr:last-child td {
  border-bottom: none;
}

.bom-table tbody tr:nth-child(even) {
  background: #fafbfe;
}

.bom-table tbody tr:hover {
  background: #f7f5ff;
}

.bom-table tr.is-off td:not(.col-check):not(.col-action) {
  opacity: 0.58;
}

.cell-input {
  width: 100%;
  min-width: 64px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.cell-input:hover {
  border-color: var(--line);
  background: #fff;
}

.cell-input:focus {
  outline: none;
  border-color: var(--brand-1);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.14);
}

.cell-input.is-invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.qty-input {
  max-width: 88px;
}

.unit-input {
  max-width: 76px;
}

.col-check {
  width: 46px;
  text-align: center;
}

.col-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-2);
}

.col-qty {
  width: 96px;
}

.col-unit {
  width: 82px;
}

.col-action {
  width: 64px;
  text-align: right;
}

.row-del {
  padding: 4px 6px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--danger);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.row-del:hover {
  background: var(--danger-bg);
}

.empty-row td {
  padding: 22px 12px;
  color: var(--muted-2);
  text-align: center;
  font-size: 13px;
}

/* ---------- 步骤导航 ---------- */
.step-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.step-actions .spacer {
  flex: 1 1 auto;
}

/* ---------- 提示条 ---------- */
.alert {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
}

.alert-error {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-warn {
  background: var(--warn-bg);
  border-color: #fde68a;
  color: var(--warn);
}

.alert-ok {
  background: var(--ok-bg);
  border-color: #a7f3d0;
  color: #047857;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---------- 汇总页 ---------- */
.summary-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.tag-empty {
  background: #f3f4f6;
  color: var(--muted);
}

.tag-done {
  background: var(--ok-bg);
  color: #047857;
}

.empty-note {
  padding: 14px 0 4px;
  color: var(--muted-2);
  font-size: 13px;
}

.summary-group {
  margin-top: 16px;
}

.summary-group:first-of-type {
  margin-top: 0;
}

.summary-unit-title {
  margin: 10px 0 6px;
  color: var(--brand-ink);
  font-size: 13px;
  font-weight: 700;
}

/* 汇总页左右布局：参数录入的增压/膨胀端、双机组的热机/冷机 */
.summary-pair,
.summary-unit-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.summary-pair .summary-group,
.summary-unit-pair .summary-group {
  margin-top: 0;
}

.summary-unit-block {
  min-width: 0;
}

/* 仅打印时显示的元素（屏幕隐藏） */
.print-only {
  display: none;
}

@media (max-width: 900px) {
  .summary-pair,
  .summary-unit-pair {
    grid-template-columns: 1fr;
  }
}

.data-table {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f7;
  text-align: left;
  vertical-align: top;
}

.data-table tr:last-child th,
.data-table tr:last-child td {
  border-bottom: none;
}

.data-table th {
  width: 180px;
  background: #fbfbfe;
  color: var(--muted);
  font-weight: 500;
}

.data-table td {
  color: var(--ink-2);
  word-break: break-word;
}

/* 多行字段（备注、其他说明）原样保留换行，屏幕与 PDF 一致 */
.data-table td.is-multiline {
  white-space: pre-wrap;
}

.data-table tbody tr:nth-child(even) td {
  background: #fcfcfe;
}

.data-table.bom-table {
  border: none;
  border-radius: 0;
}

.data-table.bom-table th {
  width: auto;
  background: #f8f9fc;
  color: #4b5563;
  font-weight: 600;
}

/* 汇总清单列宽（覆盖 data-table 的默认 th 宽度） */
.data-table.bom-table th.col-check {
  width: 64px;
  text-align: center;
}

.data-table.bom-table th.col-qty {
  width: 90px;
}

.data-table.bom-table th.col-unit {
  width: 80px;
}

.unit-muted {
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 12px;
}

.final-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.final-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.final-note.is-ok {
  color: #047857;
  font-weight: 600;
}

.final-panel .panel-head {
  margin-bottom: 14px;
}

/* ---------- 加载 / 致命错误 ---------- */
.boot-loading {
  padding: 90px 20px;
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
}

.fatal-card {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
}

.fatal-card h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.fatal-msg {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.fatal-card .alert-actions {
  justify-content: center;
}

/* ---------- Toast ---------- */
#toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.18s ease-out;
}

.toast.is-error {
  background: #b91c1c;
}

.toast.is-success {
  background: #047857;
}

.toast.is-info {
  background: #1d4ed8;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 首页 BOM 清单 ---------- */
.bom-list-card {
  margin-top: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.bom-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bom-list-kicker {
  margin-bottom: 4px;
  color: #8b5cf6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.bom-list-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.bom-list-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.bom-list-sub.is-error {
  color: var(--danger);
}

.bom-list-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bom-list-body {
  max-height: 360px;
  margin-top: 14px;
  padding-top: 6px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.bom-list-table-wrap {
  overflow-x: auto;
}

.bom-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bom-list-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.bom-list-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.bom-list-table tr:last-child td {
  border-bottom: 0;
}

.bom-list-table tbody tr:hover td {
  background: #fafbff;
}

.bom-code {
  color: var(--ink-2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.bom-project {
  color: var(--ink);
  font-weight: 600;
}

.bom-customer {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.bom-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.bom-status.is-saved {
  background: var(--ok-bg);
  color: var(--ok);
}

.bom-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.bom-open-cell {
  text-align: right;
  white-space: nowrap;
}

/* 打开 / 删除并排，避免表格单元格直接变成 flex 容器 */
.bom-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.bom-list-empty {
  padding: 22px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.bom-list-empty.is-error {
  color: var(--danger);
}

@media (max-width: 700px) {
  .bom-list-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .bom-list-actions {
    width: 100%;
  }

  .bom-list-actions .btn {
    flex: 1;
  }

  /* 窄屏隐藏“机组”“更新时间”，保留编号、项目、状态和打开 */
  .bom-list-table th:nth-child(3),
  .bom-list-table td:nth-child(3),
  .bom-list-table th:nth-child(5),
  .bom-list-table td:nth-child(5) {
    display: none;
  }
}

/* ---------- 首页 3D 预览 ---------- */
.model3d-panel {
  margin-top: 20px;
  padding: 18px 20px 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.model3d-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.model3d-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.model3d-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.model3d-tabs {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg);
}

.model3d-tab {
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.model3d-tab:hover {
  color: var(--ink-2);
}

.model3d-tab.is-active {
  background: #fff;
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.09);
}

/* 舞台：深色模型也需要浅色底衬托，渐变沿用品牌紫蓝 */
.model3d-stage {
  position: relative;
  height: 420px;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(102, 126, 234, 0.16), rgba(102, 126, 234, 0) 60%),
    radial-gradient(circle at 78% 82%, rgba(118, 75, 162, 0.14), rgba(118, 75, 162, 0) 62%),
    linear-gradient(160deg, #fbfcff 0%, #f2f4fb 100%);
  cursor: grab;
}

.model3d-stage:active {
  cursor: grabbing;
}

.model3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 首帧快照：大模型解析期间先显示上次画面，避免长时间空白 */
.model3d-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.model3d-poster.is-visible {
  opacity: 1;
}

/* 左上角模型信息，加载失败/空状态时隐藏 */
.model3d-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

.model3d-badge.is-visible {
  opacity: 1;
  visibility: visible;
}

.model3d-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
}

.model3d-btn {
  padding: 6px 12px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.model3d-btn:hover:not(:disabled) {
  border-color: #c7d2fe;
  background: #fff;
  color: var(--brand-ink);
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.12);
}

.model3d-btn.is-danger:hover:not(:disabled) {
  border-color: #fecaca;
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.model3d-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 空状态 / 加载 / 错误：覆盖整个舞台，空状态不铺底色以免遮住渐变 */
.model3d-status {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  pointer-events: none;
  background: rgba(247, 248, 252, 0.55);
}

.model3d-status.is-visible {
  display: flex;
}

.model3d-status[data-state="empty"] {
  background: transparent;
}

.model3d-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  pointer-events: auto;
}

.model3d-status-title {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.model3d-status[data-state="error"] .model3d-status-title {
  color: var(--danger);
}

.model3d-status-detail {
  color: var(--muted);
  font-size: 12.5px;
}

.model3d-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: model3d-spin 0.8s linear infinite;
}

@keyframes model3d-spin {
  to {
    transform: rotate(360deg);
  }
}

.model3d-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.16), rgba(118, 75, 162, 0.16));
  color: var(--brand-ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.model3d-hint {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

@media (max-width: 700px) {
  .model3d-head {
    flex-direction: column;
  }

  .model3d-stage {
    height: 320px;
  }

  .model3d-toolbar {
    right: auto;
    left: 12px;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-art {
    order: -1;
  }

  .hero-art img {
    max-width: 440px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  /* 窄屏下增压端 / 膨胀端改为上下堆叠，避免输入框被压得过窄 */
  .unit-grid > .group-card.is-half {
    flex-basis: 100%;
    min-width: 0;
  }

  .field.is-wide {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .wb-main {
    padding: 16px 14px 44px;
  }

  .wb-header-inner {
    padding: 10px 14px;
  }

  .brand-text em,
  .brand-sep {
    display: none;
  }

  /* 窄屏等比缩小 logo，仍保持完整长方形 */
  .brand-logo {
    height: 32px;
    max-width: 132px;
  }

  .progress-wrap {
    overflow: visible;
  }

  .progress-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
  }

  .progress-item {
    min-width: 0;
  }

  .progress-label {
    white-space: normal;
  }

  .panel {
    padding: 16px 14px;
  }

  .record-bar {
    padding: 10px 14px;
  }

  .status-badge {
    margin-left: 0;
  }

  .summary-topbar {
    align-items: flex-start;
  }

  .form-row {
    flex-wrap: wrap;
  }

  .form-row .btn {
    width: 100%;
  }

  .data-table th {
    width: 120px;
  }
}

/* ---------- 打印（汇总页可打印 / 导出 PDF） ---------- */
@media print {
  @page {
    size: A4;
    margin: 12mm 10mm;
  }

  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wb-header,
  .progress-wrap,
  .summary-topbar,
  .record-bar,
  .step-actions,
  .final-panel,
  .no-print,
  #toast-host {
    display: none !important;
  }

  .print-only {
    display: flex !important;
  }

  .print-head {
    /* 标题用绝对定位相对整页居中：左右两侧宽度不等，flex 居中会偏 */
    position: relative;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4c1d95;
  }

  /* LOGO 再放大一倍（80px → 160px），并去掉“UniEco工作台”字样 */
  .print-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    flex: none;
  }

  .print-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: #1f2937;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .print-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #374151;
    font-size: 11px;
    text-align: right;
  }

  .summary-pair,
  .summary-unit-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .summary-index {
    display: none;
  }

  .panel {
    padding: 12px 14px;
  }

  .data-table th,
  .data-table td {
    padding: 4px 6px;
    font-size: 11px;
  }

  .wb-main {
    max-width: none;
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #ddd;
    box-shadow: none;
    margin-bottom: 10px;
  }

  .bom-table th {
    position: static;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }
}

/* ==========================================================================
 * 主机选型规则定义页
 * ========================================================================== */
.rules-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}

.rules-tab {
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.rules-tab:hover {
  color: var(--brand-ink);
}

.rules-tab.is-active {
  color: var(--brand-ink);
  border-bottom-color: var(--brand-1);
}

.rules-panel[hidden] {
  display: none !important;
}

.rules-panel {
  margin-top: 18px;
}

.rules-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.rules-hint {
  color: var(--muted);
  font-size: 12px;
}

.rules-form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.rules-form .group-title {
  margin-bottom: 12px;
}

.rules-subtitle {
  margin: 16px 0 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.rules-table th {
  white-space: nowrap;
  font-size: 12px;
}

.rules-table td {
  font-size: 13px;
  vertical-align: middle;
}

.rules-table .col-action {
  white-space: nowrap;
}

.rules-table .col-action .btn + .btn {
  margin-left: 6px;
}

/* 已删除（隐藏）的大类整行置灰，便于和正常大类区分 */
.rules-table tr.is-hidden td {
  opacity: .55;
}

.empty-cell {
  padding: 22px 12px !important;
  color: var(--muted);
  text-align: center;
}

.tag-ok,
.tag-off {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-ok {
  background: #d1fae5;
  color: #065f46;
}

.tag-off {
  background: #f1f5f9;
  color: #64748b;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* 自动匹配回填的字段加一个浅绿标记 */
.field.is-auto .field-label::after {
  content: "自动匹配";
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
}

.field.is-auto .input {
  border-color: #a7f3d0;
  background: #f0fdfa;
}

.match-box {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.match-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.match-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.match-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.match-item strong {
  color: var(--ink);
  font-size: 14px;
}

@media (max-width: 900px) {
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* 下拉选项编辑器：一行一个选项，等宽字体便于对齐“值|显示名” */
.option-textarea {
  width: 100%;
  min-height: 200px;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  resize: vertical;
}

/* 参数项编辑器：表格化增删改，列多时横向滚动 */
.field-editor {
  min-width: 1180px;
}

.field-editor td {
  padding: 6px 8px;
  vertical-align: middle;
}

.field-editor .input {
  min-width: 90px;
}

.field-editor .col-check {
  text-align: center;
}

.field-editor .col-action {
  white-space: nowrap;
}

.field-editor .col-action .btn + .btn {
  margin-left: 4px;
}

/* 清单默认项编辑器：表格化增删改 */
.item-editor {
  min-width: 900px;
}

.item-editor td {
  padding: 6px 8px;
  vertical-align: middle;
}

.item-editor .input {
  min-width: 80px;
}

.item-editor .col-check,
.item-editor .col-qty,
.item-editor .col-unit {
  text-align: center;
}

.item-editor .col-action {
  white-space: nowrap;
}

.item-editor .col-action .btn + .btn {
  margin-left: 4px;
}

/* 新增下拉字段尚未配置选项时的提示标签 */
.tag-warn {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
}

/* 主页面“继续上次选型”卡片中的项目名称 */
.resume-project {
  color: var(--ink);
  font-weight: 700;
}

/* ==========================================================================
 * 油系统 · 只读字段 / 自动汇总 / 3D 缓存角标
 * 说明：以下规则全部为追加，不改动上方任何既有规则。
 * ========================================================================== */

/* ---------- 1. 只读字段 ---------- */
/* 只读展示仍沿用 .input 的外观尺寸，用浅灰底表达“不可编辑”；
   不使用浏览器 disabled 的灰化效果，故显式 opacity: 1。 */
/* 用 .field 前缀提升一级特异性：自动匹配字段同时带 .field.is-auto（浅绿底），
   否则灰底会被“.field.is-auto .input”覆盖，无法表达只读。 */
.field .input.is-readonly {
  /* 用 background-color 而非 background 简写，避免清掉 select 的下拉箭头 */
  background-color: #f4f6fa;
  border-color: var(--line);
  color: var(--ink-2);
  cursor: default;
  opacity: 1;
}

/* 只读字段获得焦点时不再出现主色高亮，保持与未聚焦时一致的描边 */
.field .input.is-readonly:focus {
  border-color: var(--line);
  box-shadow: none;
}

/* 上方已有 .field.is-auto 的“自动匹配”角标与浅绿输入框（见 2117 行附近），
   此处只补充标签文字颜色，不重复定义伪元素，也不改输入框底色。 */
.field.is-auto .field-label {
  color: #047857;
}

/* ---------- 2. 自动匹配提示 ---------- */
/* 在 .field-help 基础上用主色细线略作强调，字号保持一致 */
.field-help.is-auto-hint {
  padding-left: 8px;
  border-left: 2px solid var(--brand-1);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

/* ---------- 3. 窄屏适配（≤1366px） ---------- */
@media (max-width: 1366px) {
  /* 信息条限宽并省略号截断，避免压到右下角工具栏
     （覆盖上方 .model3d-badge 的 max-width: calc(100% - 24px)） */
  .model3d-badge {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- 选型参考 · 项目库匹配（主机参数表上方） ---------- */
.ref-card {
  margin-top: 0;
  margin-bottom: 18px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcff;
}

.ref-card .group-title {
  margin-bottom: 10px;
}

/* 图例：绿=两项命中，橙=仅一项命中 */
.ref-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ref-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-radius: 50%;
}

.ref-dot.is-both {
  background: var(--ok);
}

.ref-dot.is-partial {
  background: var(--warn);
}

.ref-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.ref-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ref-threshold {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
}

.ref-threshold:focus {
  border-color: var(--brand-1);
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.ref-toolbar .spacer {
  flex: 1;
}

/* 当前比较口径：机组 + 进口绝压 + 额定流量 */
.ref-query {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
}

.ref-query .ref-unit {
  color: var(--brand-ink);
  font-weight: 700;
}

.ref-query .ref-count {
  margin-left: auto;
  color: var(--muted-2);
}

.ref-query .is-missing {
  color: var(--warn);
}

.ref-warning {
  margin-top: 8px;
  color: var(--warn);
  font-size: 12px;
}

.ref-empty {
  padding: 14px 2px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ref-empty.is-error {
  color: #b91c1c;
}

.ref-more {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

.ref-table-wrap {
  margin-top: 6px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ref-table th {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.ref-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  white-space: nowrap;
}

.ref-table tbody tr:last-child td {
  border-bottom: 0;
}

/* 双命中：项目名称 / 设备型号 / 主机型号统一绿色；单命中为橙色 */
.ref-row.is-both .ref-name,
.ref-row.is-both .ref-model,
.ref-row.is-both .ref-host {
  color: var(--ok);
  font-weight: 700;
}

.ref-row.is-partial .ref-name,
.ref-row.is-partial .ref-model,
.ref-row.is-partial .ref-host {
  color: var(--warn);
  font-weight: 700;
}

.ref-table td.is-hit {
  color: var(--ok);
  font-weight: 600;
}

.ref-table td.is-miss {
  color: var(--muted-2);
}

/* 主机型号下拉：可命中的选项按命中程度着色（部分浏览器对 option 上色支持有限，保留加粗兜底） */
option.ref-hit {
  color: var(--ok);
  font-weight: 700;
}

option.ref-hit-partial {
  color: var(--warn);
  font-weight: 700;
}

/* ==========================================================================
   合同评审模板（数据库页编辑 / 选型汇总只读展示，随 PDF 导出）
   ========================================================================== */
.contract-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.contract-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 编辑器：像 Excel 一样按内容自适应列宽，单元格为可换行的文本框 */
.contract-grid {
  table-layout: auto;
  width: 100%;
}

.contract-grid th {
  vertical-align: top;
}

.contract-col-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 表头即输入框：无边框看起来就是表头，聚焦时才出现编辑态 */
.contract-col-name {
  flex: 1;
  min-width: 84px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: inherit;
}

.contract-col-name:hover,
.contract-col-name:focus {
  border-color: var(--line);
  background: #fff;
  outline: none;
}

.contract-col-del {
  flex: none;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
}

.contract-col-del:hover {
  color: var(--danger);
}

/* 行号与操作列只服务编辑，打印表格里不出现 */
.contract-grid .row-gutter {
  width: 40px;
  text-align: center;
  color: var(--muted-2);
}

.contract-grid .row-actions {
  width: 150px;
  white-space: nowrap;
}

.contract-cell {
  width: 100%;
  min-width: 110px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: hidden;
  resize: vertical;
}

.contract-cell:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.16);
}

/* 汇总/PDF：无序号列，列宽按内容自适应，单元格保留换行 */
.contract-print {
  table-layout: auto;
  width: 100%;
}

.contract-print th,
.contract-print td {
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
}

.contract-review .ref-table-wrap {
  margin: 0;
  overflow-x: visible;
}

/* ==========================================================================
   合同评审表头区（7 行 4 列，纸质合同评审表同款）
   编辑器（数据库页）/ 录入页 / 汇总 PDF 三处共用同一表格风格，列宽随内容自适应
   ========================================================================== */
.contract-head-card {
  margin-bottom: 16px;
}

/* 参数录入 · 核算文件：上传/查看按钮行（贴在输入框下方） */
.calc-file-tools { display: flex; gap: 8px; margin-top: 6px; }
.calc-file-tools .btn-mini {
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
}
.calc-file-tools .btn-mini:hover { border-color: var(--brand-1); color: var(--brand-1); }
.calc-file-tools .btn-mini:disabled { opacity: .5; cursor: wait; }

.contract-head-grid {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 12px;
}

.contract-head-grid caption {
  caption-side: top;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 8px 0 10px;
}

.contract-head-grid th,
.contract-head-grid td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  font-size: 13px;
  vertical-align: middle;
}

/* 标签列（第 1 / 3 列）：灰底、不折行、宽度收缩到内容 */
.contract-head-grid .contract-head-label {
  background: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
  color: #334155;
}

.contract-head-grid .contract-head-value {
  word-break: break-word;
  min-width: 96px;
}

/* 表头值即输入框：无边框融入表格，聚焦才出现编辑态 */
.contract-head-grid .contract-hdr-input,
.contract-head-grid .contract-head-input {
  width: 100%;
  min-width: 90px;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  color: inherit;
}

.contract-head-grid .contract-hdr-input:focus,
.contract-head-grid .contract-head-input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--brand-1);
}

@media print {
  /* 合同评审是长表：允许跨页，但每页重复表头，避免读表时找不到列名 */
  .contract-review table thead {
    display: table-header-group;
  }

  .contract-review tr {
    break-inside: avoid;
  }
}

/* ==========================================================================
   汇总首页：项目信息下方的图片占位
   换正式照片时只改 core.js 里 summary-hero 的 src（或用 catalog.brand.hero 配置）
   ========================================================================== */
.summary-hero {
  margin: 14px 0 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  /* 右击上传：光标提示这里可换图 */
  cursor: context-menu;
}

.summary-hero:hover {
  border-color: var(--brand-1);
}

.summary-hero img {
  max-width: 100%;
  /* 图片区放大：高度从 240px 提到 420px，接近半屏，便于看清机组结构 */
  max-height: 420px;
  object-fit: contain;
}

@media print {
  /* 图片占位随首页一起打印，避免整页只剩一张小表 */
  .summary-hero {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 10px;
    padding: 6px;
    border-color: #cbd5e1;
  }

  .summary-hero img {
    /* PDF 首页图片同步放大：72mm → 105mm，配合去掉状态提示后的留白 */
    max-height: 105mm;
  }

  /* PDF 只留正文：隐去“已保存 / 已填写 / 必填步骤”这类状态提示与空白步骤 */
  #summary-alert,
  .summary-head-right .tag,
  .summary-step .panel-head p,
  .summary-step.is-empty,
  .summary-model .row-status {
    display: none !important;
  }

  /* 打印字号整体放大一号（正文 +1.5px、标题 +2px），屏幕样式不受影响 */
  .print-meta {
    font-size: 12px;
  }

  .print-title {
    font-size: 24px;
  }

  .panel-head h2 {
    font-size: 21px;
  }

  .group-title {
    font-size: 16px;
  }

  .summary-unit-title {
    font-size: 14px;
  }

  /* 表格正文单独放大到 15px（用户指定），其余字号保持上一版 */
  .data-table th,
  .data-table td {
    font-size: 15px;
  }

  .unit-muted {
    font-size: 13px;
  }
}

/* ==========================================================================
   PDF 分页导出：A4 分页容器 + 页尾（项目名称 / 机组序列号 / 第*页 共*页）
   ========================================================================== */
#print-paged {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 190mm;
  background: #fff;
}

/* 屏幕外按打印口径排版，保证这里量到的分页高度与实际打印一致 */
#print-paged .print-only { display: flex !important; }
#print-paged .no-print { display: none !important; }
#print-paged .summary-head-right .tag,
#print-paged .summary-model .row-status { display: none !important; }
#print-paged .panel {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-color: #ddd;
  box-shadow: none;
}
#print-paged .panel-head h2 { font-size: 21px; }
#print-paged .panel-head p { display: none !important; }
#print-paged .group-title { font-size: 16px; }
#print-paged .summary-unit-title { font-size: 14px; }
#print-paged .data-table th,
#print-paged .data-table td { padding: 4px 6px; font-size: 15px; }
#print-paged .unit-muted { font-size: 13px; }
#print-paged .summary-pair,
#print-paged .summary-unit-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#print-paged .summary-hero { margin-top: 10px; padding: 6px; border-color: #cbd5e1; }
#print-paged .summary-hero img { max-height: 105mm; }
#print-paged .print-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #374151;
  font-size: 12px;
  text-align: right;
}
#print-paged .print-title { font-size: 24px; }

/* 页眉在屏幕外也要按打印版式排版，否则测量时 LOGO/标题尺寸不同会导致分页偏差 */
#print-paged .print-head {
  position: relative;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4c1d95;
}
#print-paged .print-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  flex: none;
}
#print-paged .print-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.print-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 190mm;
  height: 272mm;
  overflow: hidden;
  background: #fff;
  break-after: page;
  page-break-after: always;
}

.print-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.print-page-body {
  flex: 1 1 auto;
  overflow: hidden;
}

.print-page-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #94a3b8;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.print-page-no {
  font-variant-numeric: tabular-nums;
}

@media print {
  /* 分页模式下隐藏原页面，只打印分页容器 */
  body.is-paged-print #app { display: none !important; }
  body.is-paged-print #print-paged {
    position: static;
    left: 0;
    width: auto;
    display: block !important;
  }
  body.is-paged-print .print-page {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   导出 PDF：表单外框加粗加深（面板卡片 + 表格外框 + 行分隔线）
   ========================================================================== */
#print-paged .panel {
  border: 1.5px solid #64748b;
}

#print-paged .data-table {
  border: 1px solid #94a3b8;
}

#print-paged .data-table th,
#print-paged .data-table td {
  border-bottom: 1px solid #cbd5e1;
}

/* 清单表在屏幕上靠横向滚动保持 760px 宽，打印时必须放开最小宽度，
   否则表格会撑出面板外框、最右一列被纸张边缘裁掉 */
#print-paged .bom-table {
  min-width: 0;
}

/* 合同评审列数由模板决定，表头宽度交给内容自适应，避免各列被均分成同样宽 */
#print-paged .contract-print th {
  width: auto;
  white-space: nowrap;
}

@media print {
  .panel {
    border: 1.5px solid #64748b;
  }

  .data-table {
    border: 1px solid #94a3b8;
  }

  .data-table th,
  .data-table td {
    border-bottom: 1px solid #cbd5e1;
  }

  /* 表格外框在圆角处不漏线 */
  .data-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
  }

  /* 与分页容器口径一致：清单表放开最小宽度、合同评审表头按内容自适应 */
  .bom-table {
    min-width: 0;
  }

  .contract-print th {
    width: auto;
    white-space: nowrap;
  }
}

/* ==========================================================================
 * 登录门禁：未登录 / 登录失效时盖住整页（与管理后台同域共用 token）
 * ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 55%, #e2e8f0 100%);
  padding: 24px;
}

.auth-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.auth-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  align-self: center;
}

.auth-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
}

.auth-reason {
  margin: 0;
  font-size: 12.5px;
  text-align: center;
  color: #64748b;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: #475569;
}

.auth-error {
  min-height: 17px;
  font-size: 12.5px;
  color: #dc2626;
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-tip {
  margin: 0;
  font-size: 11.5px;
  text-align: center;
  color: #94a3b8;
}

/* 顶栏当前登录人 */
.user-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 12.5px;
  color: #334155;
}

/* ==========================================================================
 * 温度单位 C/K 切换（热机/冷机选项卡同一行）
 * ========================================================================== */
.unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.temp-unit-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.temp-unit-btn {
  border: 0;
  background: transparent;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
}

.temp-unit-btn.is-active {
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
 * 其他（REMARK）：备注行表格，序号列固定窄宽
 * ========================================================================== */
.remark-table .remark-no {
  width: 56px;
  text-align: center;
  color: #64748b;
}

.remark-table td.remark-no {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
 * 数据库（规则）页：非管理员只读 + 汇总首页图片维护
 * ========================================================================== */
.rules-readonly [data-action]:not([data-action="go-back"]):not([data-action="match-test"]):not([data-action="reload-contract"]) {
  display: none !important;
}

.rules-readonly #contract-host textarea.contract-cell,
.rules-readonly #contract-host .contract-col-name,
.rules-readonly #contract-host .contract-hdr-input {
  pointer-events: none;
  background: #f8fafc;
  color: #475569;
}

.rules-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #64748b;
}

.hero-card {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fcfdff;
}

.hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-card-actions {
  display: flex;
  gap: 8px;
}

.hero-preview {
  display: block;
  max-width: 420px;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.hero-preview.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 120px;
  max-width: none;
  border-style: dashed;
  color: #94a3b8;
  font-size: 12.5px;
}

@media print {
  .auth-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   移动端适配（≤820px，仅 screen 生效）
   关键：A4 打印宽度约 794px 会命中 max-width 断点，因此必须加 screen 限定，
   保证 @media print / ensurePrintShells 打印链路与桌面端完全不受影响。
   高度一律用 px / vw / clamp，禁止 vh（本机 App 内 WebView 的 vh 恒为 0）。
   ========================================================================== */
@media screen and (max-width: 820px) {
  /* ---------- 页面级：防横向溢出、底部安全区兜底 ---------- */
  html {
    -webkit-text-size-adjust: 100%;
  }

  .wb-main {
    max-width: 100%;
    /* clip 不产生滚动容器，不会像 overflow hidden 那样破坏吸顶元素 */
    overflow-x: clip;
    padding: 16px 14px calc(30px + env(safe-area-inset-bottom, 0px));
  }

  .wb-header-inner {
    gap: 10px;
    padding: 10px 12px;
  }

  .wb-header-actions {
    gap: 6px;
  }

  /* ---------- 触控目标 ≥44px / 输入框 ≥16px（防 iOS 聚焦自动放大） ---------- */
  .input,
  .cell-input,
  textarea.input,
  .option-textarea,
  .field-editor .input,
  .contract-head-grid .contract-head-input,
  .contract-head-grid .contract-hdr-input {
    font-size: 16px;
  }

  .input,
  .cell-input {
    min-height: 44px;
  }

  /* 合同评审表头 7×4 的单元格输入框：默认 13.5px/25px，移动端补齐到 16px/44px */
  .contract-head-grid .contract-head-input,
  .contract-head-grid .contract-hdr-input {
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .btn-mini,
  .calc-file-tools .btn-mini {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .model3d-btn,
  .model3d-tab {
    min-width: 44px;
    min-height: 44px;
  }

  .progress-link {
    min-height: 56px;
  }

  /* 温度单位切换与顶部品牌链接：补齐到 44px 触控下限（此前实测 22px / 28px） */
  .temp-unit-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .brand {
    min-height: 44px;
  }

  /* ---------- 参数 key-value 表：收窄标签列，值列不再被压成一条缝 ---------- */
  .data-table th {
    width: 88px;
    padding: 8px;
    font-size: 12.5px;
  }

  .data-table td {
    padding: 8px;
    overflow-wrap: anywhere;
  }

  /* ---------- 宽表：独立容器横滚（不带动整页）+ 首列吸左 ---------- */
  .contract-review .ref-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contract-head-grid,
  .contract-review .ref-table {
    min-width: 560px;
  }

  .bom-table {
    min-width: 720px;
  }

  .table-scroll {
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  .contract-head-grid th:first-child,
  .contract-head-grid td:first-child,
  .contract-review .ref-table th:first-child,
  .contract-review .ref-table td:first-child,
  .bom-table th:first-child,
  .bom-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 var(--line-soft);
  }

  .contract-head-grid thead th:first-child,
  .contract-review .ref-table thead th:first-child,
  .bom-table thead th:first-child {
    z-index: 3;
    background: #f8f9fc;
  }

  .bom-table tbody tr:nth-child(even) td:first-child {
    background: #fafbfe;
  }

  /* 合同评审 4 列明细表：实际类是带表头的 .data-table（汇总页与合同页都放在 .ref-table-wrap 内），
     给足最小宽度后由外层容器横滚，首列吸左，避免 4 列挤成 78px */
  .ref-table-wrap > .data-table {
    min-width: 640px;
  }

  .ref-table-wrap > .data-table th:first-child,
  .ref-table-wrap > .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 var(--line-soft);
  }

  .ref-table-wrap > .data-table thead th:first-child {
    z-index: 3;
    background: #f8f9fc;
  }

  /* ---------- 3D 视口：px/vw 计算（禁用 vh），resize/横竖屏由已有 resize 监听重算 ---------- */
  .model3d-stage {
    height: clamp(240px, 62vw, 360px);
  }

  .model3d-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .model3d-toolbar {
    right: auto;
    left: 10px;
    bottom: 10px;
  }

  /* ---------- 顶栏：品牌单行 + 操作按钮独占一行（避免品牌文字被挤成竖排） ---------- */
  .wb-header-inner {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-logo {
    height: 28px;
    max-width: 104px;
  }

  .brand-text {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .brand-text strong {
    font-size: 15px;
    white-space: nowrap;
  }

  /* 副标题/分隔符在窄屏隐藏，避免 “工作台” 被压成竖排单字 */
  .brand-sep,
  .brand-text em {
    display: none;
  }

  /* 操作区整行独立；按钮保持原始宽度，超宽时行内横滚，不做挤压换行 */
  .wb-header-actions {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .wb-header-actions .btn {
    flex: 0 0 auto;
    padding: 8px 8px;
    font-size: 12px;
  }

  .wb-header-actions .header-note,
  .header-note {
    display: none;
  }

  /* 账号标签不参与换行（否则 “（管理员）” 会被压成两行） */
  .user-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 4px 6px;
    font-size: 11px;
  }

  /* ---------- 步骤导航：窄屏改单行横滚（原 3 列网格会竖着吃掉半屏，遮挡正文与标题） ---------- */
  .progress-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px;
  }

  .progress-list {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 2px;
  }

  .progress-item {
    flex: 0 0 auto;
    min-width: 68px;
  }

  .progress-link {
    padding: 4px 2px;
  }

  .progress-label {
    white-space: nowrap;
    font-size: 11px;
  }

  /* ---------- key-value 参数表：窄屏改为“标签/值”上下堆叠 ----------
     仅作用于没有表头的 .data-table（纯 key-value 表）；
     有 thead 的数据网格保持表格形态，继续在容器内横滚。
     浏览器不支持 :has() 时自动退回原表格布局，不产生副作用。 */
  @supports selector(:has(*)) {
    .data-table:not(:has(thead)),
    .contract-head-grid:not(:has(thead)) {
      display: block;
      width: 100%;
      min-width: 0;
    }

    .data-table:not(:has(thead)) tbody,
    .data-table:not(:has(thead)) tr,
    .contract-head-grid:not(:has(thead)) tbody,
    .contract-head-grid:not(:has(thead)) tr {
      display: block;
    }

    .data-table:not(:has(thead)) tr,
    .contract-head-grid:not(:has(thead)) tr {
      padding: 6px 10px;
      border-bottom: 1px solid var(--line-soft);
    }

    .data-table:not(:has(thead)) tr:last-child,
    .contract-head-grid:not(:has(thead)) tr:last-child {
      border-bottom: 0;
    }

    .data-table:not(:has(thead)) th,
    .data-table:not(:has(thead)) td,
    .contract-head-grid:not(:has(thead)) th,
    .contract-head-grid:not(:has(thead)) td {
      position: static;
      display: block;
      width: auto;
      padding: 0;
      border: 0;
      background: transparent;
      text-align: left;
    }

    .data-table:not(:has(thead)) th,
    .contract-head-grid:not(:has(thead)) th {
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
    }

    .data-table:not(:has(thead)) td,
    .contract-head-grid:not(:has(thead)) td {
      margin-bottom: 6px;
      font-size: 13.5px;
      overflow-wrap: anywhere;
    }

    .data-table:not(:has(thead)) td:last-child,
    .contract-head-grid:not(:has(thead)) td:last-child {
      margin-bottom: 0;
    }

    /* 堆叠后不再横滚：caption 占满容器宽并强制单行，避免被裁切或竖向折字 */
    .contract-head-grid:not(:has(thead)) caption {
      display: block;
      width: 100%;
      white-space: nowrap;
      text-align: center;
    }
  }
}

