:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #68758a;
  --line: #dbe4ef;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --good: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(28, 46, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 32rem), var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 42px 20px;
}

.brand-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 198px;
  height: 74px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.94));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.brand-logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: contrast(1.12) saturate(1.06);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.05em;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(390px, 470px) 1fr;
  gap: 22px;
  padding: 0 42px 42px;
}

.panel,
.stat-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 228, 239, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.controls-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title.compact {
  margin-top: 24px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.section-title span,
.stat-card span,
label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.custom-size {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}

.gap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfdff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.input-table-wrap {
  max-height: 310px;
}

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #516074;
  background: #f2f6fb;
  font-size: 12px;
}

td input {
  min-width: 70px;
  padding: 7px;
  border-radius: 9px;
}

.bulk-label {
  margin-top: 16px;
}

.add-container-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 14px;
}

.add-container-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.lock-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  margin-left: auto;
}

.lock-label input {
  width: auto;
  margin: 0;
}

.shortcut-hint {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  background: #f1f5fb;
  font-size: 12px;
  font-weight: 600;
}

textarea {
  resize: vertical;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  border: 0;
  border-radius: 13px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.secondary-btn {
  color: var(--brand-dark);
  background: #dbeafe;
}

.ghost-btn {
  color: var(--ink);
  background: #f3f7fb;
  border: 1px solid var(--line);
}

.danger-btn {
  color: var(--danger);
  background: #fee2e2;
  padding: 7px 9px;
}

.workspace {
  display: grid;
  gap: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.weight-card {
  position: relative;
}

.weight-card small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.weight-card .overweight {
  color: var(--danger) !important;
}

.weight-card small.warning {
  color: var(--danger);
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

/* 集装箱卡片重量和重心信息 */
.stats-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.weight-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  white-space: nowrap;
}

.weight-info.overweight {
  background: #fee2e2;
  border-color: #fca5a5;
}

.weight-text {
  font-weight: 700;
  color: #0f172a;
}

.weight-info.overweight .weight-text {
  color: var(--danger);
}

.center-text {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* 3D视图提示（替代2D俯视图/侧视图） */
.view3d-hint {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #3b82f6;
  border-radius: 10px;
  text-align: center;
}

.view3d-hint p {
  margin: 0;
  font-size: 13px;
  color: #1e40af;
  font-weight: 600;
}

.container-view {
  position: relative;
  overflow: auto;
  border: 2px solid #334155;
  border-radius: 12px;
  background-image: linear-gradient(#e5edf7 1px, transparent 1px), linear-gradient(90deg, #e5edf7 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #f8fafc;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
  max-width: 100%;
}

/* 视图容器滚动条样式 */
.container-view::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.container-view::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.container-view::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.container-view::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.side-view {
  background-image: linear-gradient(#e5edf7 1px, transparent 1px), linear-gradient(90deg, #e5edf7 1px, transparent 1px);
}

.box-rect {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.35);
  border-radius: 7px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  gap: 1px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.box-rect small {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.box-rect.selected {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  z-index: 10;
}

.box-rect.dragging {
  opacity: 0.82;
  cursor: grabbing;
  z-index: 20;
  box-shadow: 0 6px 24px rgba(37,99,235,0.28);
}

.box-rect.colliding {
  outline: 2px solid var(--danger);
  background: #fca5a5 !important;
}

.box-rect.conflict {
  animation: shake 0.4s ease;
  outline: 2px solid var(--danger);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
}

.snap-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #eef3f8;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
}

.top-view {
  cursor: default;
}

.top-view .box-rect {
  cursor: grab;
  user-select: none;
}

/* ─── 拖拽增强样式 ──────────────────────────────────────────────────────────── */
.drag-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.drag-tooltip.colliding-tooltip {
  background: rgba(239, 68, 68, 0.95);
}

.drag-preview {
  position: absolute;
  border: 2px dashed var(--brand);
  border-radius: 7px;
  pointer-events: none;
  z-index: 5;
  transition: none;
}

.drag-preview.colliding {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.align-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.align-line {
  position: absolute;
  background: var(--brand);
  pointer-events: none;
}

.align-line.v {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--brand), transparent);
}

.align-line.h {
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--brand), transparent);
}

.align-line.v[dash] {
  border-left: 2px dashed var(--brand);
  background: none;
}

.align-line.h[dash] {
  border-top: 2px dashed var(--brand);
  background: none;
}

.align-label {
  position: absolute;
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
}

.align-line.v .align-label {
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
}

.align-line.h .align-label {
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
}

.container-card {
  margin-bottom: 0;
}

.container-card.locked {
  opacity: 0.85;
  border-color: #cbd5e1;
}

.container-card.locked .container-view {
  filter: grayscale(0.15);
}

/* ─── 容积进度条 ────────────────────────────────────────────────────────────── */
.volume-bar {
  position: relative;
  height: 28px;
  background: #f1f5f9;
  border-radius: 8px;
  margin: 12px 0 16px;
  overflow: hidden;
}

.volume-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.volume-fill.high {
  background: linear-gradient(90deg, #059669, #10b981);
}

.volume-fill.low {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.volume-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* ─── 箱子悬停详情浮层 ───────────────────────────────────────────────────────── */
.box-rect {
  position: relative;
}

.box-rect::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  min-width: 140px;
  text-align: center;
}

.box-rect:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

.warning-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  color: #92400e;
  background: #fff7ed;
  font-size: 13px;
  font-weight: 700;
}

/* ─── 编号管理 ────────────────────────────────────────────────────────────── */
.id-manager {
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
}

.id-prefix-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.id-prefix-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.id-prefix-row input {
  padding: 8px 10px;
  border: 1px solid #e6e8ec;
  border-radius: 8px;
  font-size: 13px;
}

.id-actions {
  display: flex;
  gap: 10px;
}

.id-actions button {
  padding: 8px 16px;
  font-size: 13px;
}

.dup-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.dup-warning:not(.hidden) {
  display: block;
}

/* 重复编号标红 */
input.duplicate-id {
  border-color: var(--danger) !important;
  background: #fef2f2;
  color: var(--danger);
}

/* ─── 导出菜单 ──────────────────────────────────────────────────────────────── */
.export-menu {
  position: relative;
  display: inline-block;
}

.export-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.12);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}

.export-menu:hover .export-dropdown,
.export-dropdown.show {
  display: block;
}

.export-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}

.export-dropdown button:hover {
  background: #f1f5f9;
}

.export-dropdown button:not(:last-child) {
  border-bottom: 1px solid #f1f5f9;
}

/* ─── 方案切换面板 ──────────────────────────────────────────────────────────── */
.scheme-panel {
  margin: 0 0 20px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
}

.scheme-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.scheme-tab {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.scheme-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.scheme-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.scheme-desc {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}

.scheme-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.scheme-stat {
  flex: 1;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.scheme-stat b {
  color: var(--ink);
  font-weight: 700;
}

.current-scheme {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.current-scheme span {
  color: var(--brand);
  font-weight: 700;
}

.recommend-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  animation: pulse 2s infinite;
}

.recommend-badge.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.smart-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e6e8ec;
}

.smart-actions button {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
}

/* 批量操作面板 */
.batch-panel {
  display: none;
  grid-template-columns: auto 1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.batch-panel.has-selection {
  display: grid;
}

.batch-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 8px;
  border-right: 1px solid #e2e8f0;
}

.batch-info strong {
  color: var(--brand);
  font-size: 16px;
}

.batch-panel button {
  padding: 8px 12px;
  font-size: 12px;
}

/* FOB/CIF 费用计算面板 */
.fob-cif-panel {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border: 1px solid #fde047;
  border-radius: 14px;
}

.fob-cif-panel h3 {
  margin: 0 0 14px 0;
  font-size: 15px;
  color: #854d0e;
}

.fob-cif-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.fob-cif-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #854d0e;
}

.fob-cif-form input,
.fob-cif-form select {
  padding: 8px 10px;
  border: 1px solid #fde047;
  border-radius: 8px;
  font-size: 13px;
}

.fob-cif-form button {
  align-self: end;
  padding: 10px 16px;
  font-size: 13px;
}

.fob-cif-result {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #fde047;
  border-radius: 10px;
  font-size: 13px;
}

.fob-cif-result.hidden {
  display: none;
}

.fob-cif-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.fob-cif-table th,
.fob-cif-table td {
  padding: 10px;
  border-bottom: 1px solid #fde047;
  text-align: left;
}

.fob-cif-table th {
  background: #fefce8;
  color: #854d0e;
  font-weight: 700;
}

.fob-cif-total {
  margin-top: 16px;
  padding: 14px;
  background: #fefce8;
  border-radius: 10px;
  text-align: center;
}

.fob-cif-total strong {
  display: block;
  font-size: 24px;
  color: #854d0e;
}

/* 3D视图面板 */
.view3d-panel {
  margin-top: 20px;
}

.view3d-container {
  position: relative;
  height: 620px;
  min-height: 520px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 14px;
  overflow: hidden;
}

.view3d-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  text-align: center;
}

.view3d-placeholder p {
  font-size: 16px;
  margin-bottom: 8px;
}

.view3d-placeholder small {
  font-size: 12px;
  opacity: 0.7;
}

.view3d-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.view3d-controls select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
}

.view3d-controls button {
  padding: 8px 14px;
  font-size: 12px;
}

/* 面板副标题 */
.panel-subtitle {
  margin: -10px 0 12px 0;
  font-size: 12px;
  color: var(--muted);
}

/* 装载步骤面板 */
.loading-steps-panel {
  margin-top: 20px;
}

.loading-steps-container {
  max-height: 400px;
  overflow-y: auto;
}

.placeholder-text {
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

.loading-step {
  display: flex;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.loading-step:hover {
  background: #f8fafc;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.step-detail {
  font-size: 12px;
  color: var(--muted);
}

.step-position {
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

/* 步骤编辑控制 */
.steps-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.steps-controls button {
  padding: 6px 12px;
  font-size: 12px;
}

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

/* 可编辑的步骤 */
.loading-steps-container[data-editable="true"] .loading-step {
  cursor: move;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
}

.loading-steps-container[data-editable="true"] .loading-step:hover {
  background: #e0f2fe;
  border-color: #3b82f6;
}

.loading-steps-container[data-editable="true"] .loading-step.dragging {
  opacity: 0.5;
  background: #bfdbfe;
}

.step-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  color: #94a3b8;
  font-size: 16px;
  cursor: grab;
}

.loading-steps-container[data-editable="true"] .step-handle {
  display: flex;
}

.step-actions {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.step-actions button {
  padding: 4px 8px;
  font-size: 11px;
  min-width: 60px;
}

.loading-steps-container[data-editable="true"] .step-actions {
  display: flex;
}

/* 拖拽时的占位符 */
.step-placeholder {
  height: 80px;
  background: #e0f2fe;
  border: 2px dashed #3b82f6;
  border-radius: 8px;
  margin: 8px 0;
}

@media (max-width: 1180px) {
  .app-shell,
  .views-grid {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: static;
  }

  .view3d-container {
    height: 520px;
  }
}

@media (max-width: 760px) {
  .hero,
  .app-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero,
  .stats-grid,
  .form-grid,
  .custom-size,
  .button-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* ─── Product-flow refinement overrides ─────────────────────────────────── */
.hero {
  align-items: flex-end;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 260px;
}

.app-status {
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.workflow-step {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.workflow-step.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--brand-dark);
}

.panel,
.stat-card,
.scheme-panel,
.fob-cif-panel {
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(28, 46, 74, 0.08);
}

.panel {
  padding: 18px;
}

h1,
.stat-card strong {
  letter-spacing: 0;
}

.scheme-panel {
  margin-bottom: 0;
}

.fob-cif-panel {
  padding: 0;
  background: #fff;
  border: 1px solid #fde68a;
  overflow: hidden;
}

.fob-cif-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  color: #854d0e;
  font-size: 14px;
  font-weight: 800;
  background: #fffbeb;
}

.fob-cif-panel summary small {
  color: #a16207;
  font-size: 12px;
  font-weight: 600;
}

.fob-cif-form,
.fob-cif-result {
  margin: 14px 16px 16px;
}

.export-menu:hover .export-dropdown {
  display: none;
}

.export-dropdown.show {
  display: block;
}

.view3d-panel .section-title {
  align-items: flex-start;
}

.view3d-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.view3d-statusbar span:last-child {
  color: #93c5fd;
  text-align: right;
}

.view3d-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
  touch-action: none;
}

.view3d-container.is-dragging canvas {
  cursor: grabbing;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .fob-cif-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .batch-panel.has-selection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-info {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 0 8px;
  }
}

@media (max-width: 760px) {
  .hero {
    align-items: stretch;
  }

  .brand-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo-frame {
    width: min(220px, 100%);
    height: 72px;
  }

  .hero-actions {
    align-items: stretch;
    min-width: 0;
  }

  .app-status {
    max-width: none;
    text-align: left;
  }

  .workflow-steps,
  .gap-grid,
  .id-prefix-row,
  .fob-cif-form,
  .stats-grid,
  .scheme-tabs,
  .scheme-stats,
  .smart-actions,
  .view3d-controls,
  .view3d-statusbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .view3d-controls {
    width: 100%;
  }

  .view3d-container {
    height: 460px;
    min-height: 420px;
  }

  .view3d-statusbar span:last-child {
    text-align: left;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .add-container-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .batch-panel.has-selection {
    grid-template-columns: 1fr;
  }
}
