:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #697386;
  --line: #e6eaf2;
  --primary: #d97706;
  --primary-dark: #b45309;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
  --radius: 18px;
}

.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* 原料商供应链管理 */
.supplier-chain-view {
  display: grid;
  gap: 20px;
}

.supplier-chain-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.supplier-chain-hero h2 {
  margin: 4px 0 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.supplier-chain-hero span {
  color: var(--muted);
  font-size: 13px;
}

.supplier-chain-date {
  display: grid;
  gap: 4px;
  min-width: 150px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: right;
}

.supplier-chain-date strong {
  font-size: 14px;
}

.supplier-chain-date span {
  font-size: 12px;
  color: var(--muted);
}

.supplier-chain-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.supplier-chain-main,
.supplier-chain-side {
  display: grid;
  gap: 16px;
}

.supplier-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  padding: 18px;
}

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

.supplier-section-head.compact {
  margin-bottom: 10px;
}

.supplier-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.supplier-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.supplier-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.supplier-add-button {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.supplier-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.supplier-metric-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.supplier-metric-card > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.supplier-metric-card.blue > span {
  color: #2563eb;
  background: #eff6ff;
}

.supplier-metric-card.orange > span {
  color: var(--primary);
  background: #fff7ed;
}

.supplier-metric-card.cyan > span {
  color: #0891b2;
  background: #ecfeff;
}

.supplier-metric-card small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.supplier-metric-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

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

.supplier-mini-chart {
  min-height: 190px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.supplier-mini-chart h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.supplier-bar-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  align-items: end;
  gap: 6px;
  height: 132px;
}

.supplier-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  height: 100%;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.supplier-bar span {
  display: block;
  width: 100%;
  min-height: 8px;
  background: #4f46e5;
  border-radius: 8px 8px 3px 3px;
}

.supplier-bar-chart.amount .supplier-bar span {
  background: var(--primary);
}

.supplier-line-chart {
  position: relative;
  height: 132px;
  color: #4f46e5;
}

.supplier-line-chart.amount {
  color: var(--primary);
}

.supplier-line-chart svg {
  width: 100%;
  height: 104px;
  overflow: visible;
}

.supplier-line-chart circle {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 2;
}

.supplier-chart-labels {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.supplier-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.supplier-table {
  min-width: 1080px;
}

.supplier-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.supplier-table td:nth-child(7),
.supplier-table td:nth-child(8),
.supplier-table td:nth-child(9) {
  font-weight: 600;
}

.supplier-table-action {
  padding: 7px 10px;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
}

.supplier-table-action:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.supplier-empty-row {
  padding: 28px !important;
  color: var(--muted);
  text-align: center !important;
  font-weight: 500 !important;
}

.supplier-record-modal {
  width: min(720px, 96vw);
}

.supplier-record-grid input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.supplier-record-grid input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.supplier-record-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
}

.supplier-record-total span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.supplier-record-total strong {
  font-size: 18px;
  font-weight: 700;
}

.supplier-filter-panel {
  display: grid;
  gap: 12px;
}

.supplier-filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.supplier-filter-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.supplier-filter-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 10px;
  font-weight: 700;
}

.supplier-filter-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.supplier-filter-panel input,
.supplier-filter-panel select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.supplier-filter-panel input:focus,
.supplier-filter-panel select:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.supplier-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.supplier-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.supplier-formula-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-size: 12px;
}

.supplier-summary-table {
  overflow: auto;
}

.supplier-summary-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.supplier-summary-table th,
.supplier-summary-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.supplier-summary-table th:first-child,
.supplier-summary-table td:first-child {
  text-align: left;
}

.supplier-summary-table th {
  color: #fff;
  background: #4f46e5;
  font-weight: 700;
}

.supplier-summary-table .summary-total td {
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 700;
}

@media (max-width: 1280px) {
  .supplier-chain-layout {
    grid-template-columns: 1fr;
  }

  .supplier-metrics-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .supplier-chain-hero,
  .supplier-section-head {
    flex-direction: column;
  }

  .supplier-metrics-grid,
  .supplier-chart-grid {
    grid-template-columns: 1fr;
  }

  .supplier-chain-date {
    width: 100%;
    text-align: left;
  }
}

/* 登录页面 */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
  z-index: 100;
}

.login-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #ffffff;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.login-brand p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

/* 密码可见切换 */
.login-password-field {
  position: relative;
}

.login-password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.login-error {
  min-height: 20px;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.login-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}

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

.login-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.login-tab {
  padding-bottom: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.login-tab:hover {
  color: #d97706;
}

.login-tab.active {
  color: var(--primary);
}

.login-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.login-remember input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.login-forgot {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.login-forgot:hover {
  color: #d97706;
  text-decoration: underline;
}

/* 验证码登录 */
.login-sms-code {
  display: flex;
  gap: 10px;
}

.login-sms-code input {
  flex: 1;
}

.sms-send-btn {
  padding: 12px 16px;
  background: var(--panel-soft);
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.sms-send-btn:hover:not(:disabled) {
  background: #fff8f0;
  color: #d97706;
  border-color: #d97706;
}

.sms-send-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

/* 右上角扫码登录 */
.login-qrcode-corner {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  z-index: 10;
}

.qrcode-tip {
  margin-top: 12px;
  margin-right: 6px;
  padding: 4px 10px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.qrcode-icon {
  width: 48px;
  height: 48px;
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-bottom-left-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.qrcode-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: 180px;
  padding: 16px;
  background: var(--panel);
  border-radius: 0 0 0 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.qrcode-panel p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.qrcode-img {
  display: flex;
  justify-content: center;
}

.qrcode-img svg {
  width: 140px;
  height: 140px;
}

/* 鼠标划过右上角区域时显示 */
.login-qrcode-corner:hover .qrcode-tip {
  opacity: 1;
  transform: translateX(0);
}

.login-qrcode-corner:hover .qrcode-icon {
  background: var(--primary);
  color: #fff;
}

.login-qrcode-corner:hover .qrcode-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 忘记密码弹窗 */
.forgot-modal {
  max-width: 420px;
}

.forgot-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.forgot-modal .login-field label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

.forgot-modal .login-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
}

.forgot-modal .login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.content-row {
  flex: 1;
  display: flex;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.sidebar {
  flex-shrink: 0;
  width: 86px;
  height: 100%;
  padding: 24px 16px;
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
  transition: width 0.28s ease, padding 0.28s ease, box-shadow 0.28s ease;
}

.sidebar:hover,
.sidebar.open {
  width: 270px;
  padding-inline: 24px;
  box-shadow: 22px 0 48px rgba(15, 23, 42, 0.18);
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 222px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-weight: 800;
  overflow: hidden;
}

.brand strong,
.brand span {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.sidebar:hover .brand strong,
.sidebar:hover .brand span,
.sidebar.open .brand strong,
.sidebar.open .brand span {
  opacity: 1;
  transform: translateX(0);
}

.brand span {
  color: #9ca3af;
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-group {
  position: relative;
  display: block;
  min-width: 222px;
}

/* 商品管理 hover 展开子菜单（fixed定位避免被sidebar overflow:hidden裁剪） */
.nav-flyout {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  display: none;
}

.nav-flyout.show {
  display: block;
}

/* 透明桥接区：覆盖 flyout 与导航之间的间隙，防止鼠标穿越时触发 mouseleave */
.nav-flyout::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 8px;
  height: 100%;
  background: transparent;
}

.nav-flyout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-flyout-item:hover {
  background: #fff7ed;
  color: #d97706;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  text-decoration: none;
  min-width: 222px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  isolation: isolate;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px) saturate(1.18);
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
}

.nav-item:hover {
  transform: translateX(8px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.18);
}

.nav-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fef3c7;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  font-weight: 800;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, filter 0.18s ease, text-shadow 0.18s ease;
}

.nav-icon-image img {
  width: 21px;
  height: 21px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.12));
}

.nav-icon-miniapp {
  color: #111827;
}

.nav-item:hover .nav-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.06);
  filter: brightness(1.2);
}

.nav-item.active .nav-icon {
  color: #ffd84d;
  background: rgba(255, 255, 255, 0.08);
  text-shadow: 0 0 12px rgba(255, 216, 77, 0.55);
}

.nav-item:hover .nav-icon-image img,
.nav-item.active .nav-icon-image img {
  transform: scale(1.18);
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.22));
}

.nav-text {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.sidebar:hover .nav-text,
.sidebar.open .nav-text {
  opacity: 1;
  transform: translateX(0);
}

.nav-current-category {
  max-width: 0;
  overflow: hidden;
  margin-left: auto;
  padding: 0;
  color: #ffd84d;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 999px;
  opacity: 0;
  transform: translateX(-8px);
  white-space: nowrap;
  transition: max-width 0.24s ease, padding 0.24s ease, opacity 0.22s ease, transform 0.22s ease;
}

.sidebar:hover .nav-current-category,
.sidebar.open .nav-current-category {
  max-width: 88px;
  padding: 4px 8px;
  opacity: 1;
  transform: translateX(0);
}

.follow-subnav {
  flex-shrink: 0;
  width: 240px;
  height: 100%;
  padding: 24px 16px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.follow-subnav[hidden] {
  display: none;
}

.follow-subnav-header {
  margin-bottom: 18px;
}

.follow-subnav-header h2 {
  margin-bottom: 6px;
}

.follow-subnav-header span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.follow-subnav-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.follow-subnav-actions input {
  min-width: 0;
  height: 40px;
}

.follow-subnav-actions .primary-button {
  height: 40px;
  padding: 0 12px;
  box-shadow: none;
}

.settings-subnav-note {
  margin-bottom: 14px;
  padding: 10px 12px;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.settings-page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 2px 2px 0;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.settings-page-row:hover {
  background: #f1f5f9;
}

.settings-page-row.active {
  background: #fff7ed;
}

.settings-page-row .nav-subitem {
  flex: 1;
  text-align: left;
  background: transparent;
}

.settings-page-row.active .nav-subitem {
  color: var(--primary);
  font-weight: 600;
}

.module-delete {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.module-delete:hover {
  background: #fee2e2;
  color: #ef4444;
}

.nav-submenu {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.nav-subitem {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: 0.2s ease;
}

.nav-subitem:hover,
.nav-subitem.active {
  color: var(--primary);
  background: #fff7ed;
  font-weight: 700;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.category-row.category-parent {
  grid-template-columns: minmax(0, 1fr);
}

.category-row.category-parent .nav-subitem {
  font-weight: 700;
}

.category-row[draggable="true"] {
  cursor: grab;
}

.category-row[draggable="true"]:active {
  cursor: grabbing;
}

.category-row.dragging {
  opacity: 0.4;
}

.category-row.drag-over {
  background: rgba(35, 122, 87, 0.08);
  border-radius: 12px;
  box-shadow: 0 -2px 0 0 var(--primary) inset;
}

.category-row.category-child {
  position: relative;
}

.category-row.category-child::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: #e6eaf2;
}

.category-row .nav-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.category-row .nav-subitem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-row .nav-subitem small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* 分类折叠/展开箭头 */
.category-toggle {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid #94a3b8;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 6px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.category-toggle.expanded {
  transform: rotate(90deg);
}

.category-children.collapsed {
  display: none;
}

.category-row.active .nav-subitem {
  color: var(--primary);
  background: #fff7ed;
  font-weight: 700;
}

.category-delete {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  opacity: 0;
  transition: 0.2s ease;
}

.category-row:hover .category-delete {
  opacity: 1;
}

.category-delete:hover {
  color: #991b1b;
  background: #fee2e2;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 222px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.sidebar:hover .sidebar-card,
.sidebar.open .sidebar-card {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-card p,
.sidebar-card span {
  margin: 0;
  color: #cbd5e1;
}

.sidebar-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 34px;
}

.main {
  flex: 1;
  height: 100%;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 36px);
}

h2 {
  font-size: 20px;
}

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

.search {
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search:hover {
  border-color: #cbd5e1;
}

.search:focus-within {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search:focus-within .search-icon {
  stroke: #2563eb;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
}

.search input::placeholder {
  color: #94a3b8;
}

.search input::-webkit-search-cancel-button {
  appearance: none;
}

.icon-search {
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round'><circle cx='9' cy='9' r='6'/><line x1='13.5' y1='13.5' x2='17' y2='17'/></svg>")
    no-repeat 12px center;
  background-size: 16px 16px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-search::placeholder {
  color: #94a3b8;
}

.icon-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.icon-search::-webkit-search-cancel-button {
  appearance: none;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 12px;
  transition: 0.2s ease;
}

.primary-button {
  padding: 11px 16px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 12px 22px rgba(217, 119, 6, 0.24);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  padding: 11px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  border-color: #cbd5e1;
}

.icon-button {
  width: 40px;
  height: 40px;
  background: var(--panel-soft);
}

.mobile-menu {
  display: none;
}

.time-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.goods-time-filter {
  margin-bottom: 5px;
}

.period-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}

.period-meta strong {
  color: var(--text);
  font-weight: 700;
}

.period-meta time {
  color: var(--muted);
}

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

.time-option {
  height: 34px;
  min-width: 34px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: 0.2s ease;
}

.time-option:hover {
  color: var(--primary);
  border-color: #fbbf24;
}

.time-option.active {
  color: var(--primary);
  background: #fff7ed;
  border-color: var(--primary);
  font-weight: 700;
}

.calendar-option {
  padding: 0;
  color: var(--primary);
  font-weight: 800;
}

.calendar-picker {
  position: relative;
  display: inline-flex;
}

.calendar-popover {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 15;
  width: 286px;
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.calendar-popover.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.calendar-picker.is-open .calendar-option {
  color: var(--primary);
  background: #fff7ed;
  border-color: var(--primary);
}

.insight-calendar-picker .calendar-option {
  width: auto;
  min-width: 32px;
  padding: 0 8px;
  font-size: 13px;
}

.insight-calendar-picker .calendar-popover {
  right: 0;
  left: auto;
  margin-top: 4px;
}

.calendar-panel {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-header button {
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-header strong {
  font-size: 14px;
}

.calendar-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-range-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-range-fields input {
  height: 32px;
  padding: 0 8px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-days button {
  height: 30px;
  color: var(--text);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: 0.2s ease;
}

.calendar-days button:hover {
  color: var(--primary);
  background: #fff7ed;
  border-color: #fed7aa;
}

.calendar-days .muted-day {
  color: #cbd5e1;
}

.calendar-days .selected-day {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

.calendar-days .today-day {
  color: var(--primary);
  background: #ecfdf5;
  border-color: #34d399;
  font-weight: 700;
}

.calendar-days .today-day.selected-day {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.calendar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.calendar-actions button {
  height: 32px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-actions .calendar-confirm {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.date-range {
  display: flex;
  align-items: center;
  grid-auto-flow: column;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.date-range input {
  height: 32px;
  padding: 0;
  border: 0;
  color: var(--text);
}

.page-view[hidden] {
  display: none;
}

.follow-view {
  display: grid;
  gap: 20px;
}

.follow-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #fff7ed, #ffffff 58%);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.follow-hero span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.follow-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.follow-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.follow-stat-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.follow-stat-card span {
  color: var(--muted);
}

.follow-stat-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 30px;
}

.follow-stat-card p {
  margin: 0;
  color: var(--muted);
}

.follow-stat-card.warning-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.stats-panel {
  padding: 18px;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.stats-panel-header span {
  color: var(--muted);
  font-size: 13px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stat-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 800;
}

.stat-icon.warning-icon {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 30px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
}

.positive {
  color: var(--success) !important;
}

.warning {
  color: var(--warning) !important;
}

/* 快捷入口 */
.quick-actions {
  margin-bottom: 24px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quick-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.1);
  transform: translateY(-2px);
}
.quick-card span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.quick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
}

/* 数据可视化 */
.charts-panel {
  margin-bottom: 24px;
}
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.chart-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.chart-card.chart-wide {
  min-height: 380px;
}
.chart-body {
  flex: 1;
  min-height: 280px;
  width: 100%;
}

@media (max-width: 1200px) {
  .quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .insight-grid {
    grid-template-columns: 1fr;
  }
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.insight-card {
  min-height: 360px;
}

/* 首页业务动态列表 */
.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.dashboard-list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-soft);
  transition: background 0.2s ease;
  cursor: default;
}
.dashboard-list-item:hover {
  background: var(--panel-soft-hover, #eef1f6);
}
.dashboard-list-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.dashboard-list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-list-meta {
  font-size: 12px;
  color: var(--muted);
}
.dashboard-tag {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.dashboard-tag.tag-danger {
  background: #fef2f2;
  color: #dc2626;
}
.dashboard-tag.tag-warning {
  background: #fffbeb;
  color: #d97706;
}
.dashboard-tag.tag-success {
  background: #f0fdf4;
  color: #16a34a;
}
.dashboard-tag.tag-neutral {
  background: var(--panel-soft);
  color: var(--muted);
}

.mini-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mini-range-option {
  height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  transition: 0.2s ease;
}

.mini-range-option:hover {
  color: var(--primary);
}

.mini-range-option.active {
  color: var(--primary);
  background: #fff7ed;
  font-weight: 700;
}

.visitor-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.visitor-summary strong {
  color: var(--text);
  font-size: 34px;
}

.visitor-summary span,
.visitor-breakdown span,
.portrait-item span {
  color: var(--muted);
}

.visitor-breakdown {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.visitor-metric,
.portrait-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: 0.2s ease;
}

.visitor-metric {
  cursor: pointer;
}

.visitor-metric:hover {
  border-color: #fed7aa;
  background: #fffaf3;
}

.visitor-metric.active {
  background: #fff7ed;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.12);
}

.visitor-metric.active span,
.visitor-metric.active strong {
  color: var(--primary);
}

.top-metric {
  grid-column: span 2;
}

.bottom-metric {
  grid-column: span 3;
}

.visitor-breakdown strong,
.portrait-item strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 20px;
}

.visitor-breakdown p {
  margin: 0;
  color: var(--muted);
}

.visitor-chart {
  display: flex;
  flex-direction: column;
  height: 260px;
  margin-top: 18px;
  padding: 14px 18px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.visitor-line-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 4px;
  padding-left: 28px;
  color: var(--text);
  font-size: 12px;
}

.visitor-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.visitor-line-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 2px;
}

.visitor-line-svg {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.chart-grid-line {
  stroke: #e8edf5;
  stroke-width: 1;
}

.chart-y-label,
.chart-x-label {
  fill: var(--muted);
  font-size: 12px;
}

.visitor-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 7px rgba(217, 119, 6, 0.12));
}

.visitor-line.new {
  stroke-width: 2;
}

.visitor-line.old {
  stroke-width: 2.2;
}

.visitor-line-point {
  stroke: #fff;
  stroke-width: 2;
  opacity: 0;
  transition: 0.2s ease;
}

.visitor-chart:hover .visitor-line-point {
  opacity: 1;
}

.visitor-bar-label {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.portrait-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portrait-chart {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.portrait-donut-block {
  display: grid;
  align-content: start;
  gap: 12px;
}

.portrait-chart-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.portrait-donut-wrap {
  display: grid;
  place-items: center;
  min-height: 190px;
}

.portrait-donut {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
}

.portrait-donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  background: #fff;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #f1f5f9;
}

.portrait-donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.portrait-donut-center strong {
  color: var(--primary);
  font-size: 18px;
}

.portrait-donut-center span {
  color: var(--primary);
}

.portrait-donut-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.portrait-donut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portrait-donut-legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 2px;
}

.portrait-rank-block {
  display: grid;
  align-content: start;
  gap: 8px;
}

.portrait-region-block {
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.portrait-rank-head,
.portrait-rank-row {
  display: grid;
  grid-template-columns: 96px minmax(110px, 1fr) 52px 64px;
  align-items: center;
  gap: 10px;
}

.portrait-rank-head {
  color: var(--muted);
  font-size: 12px;
}

.portrait-rank-row {
  min-height: 25px;
}

.portrait-rank-name {
  color: var(--text);
  font-size: 12px;
}

.portrait-track {
  height: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border-radius: 999px;
}

.portrait-fill {
  height: 100%;
  border-radius: inherit;
}

.portrait-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.portrait-count {
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.portrait-detail {
  display: none;
}


.portrait-tags {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.portrait-tags span {
  padding: 6px 10px;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.goods-view {
  display: grid;
  gap: 20px;
}

.goods-tab-content {
  display: grid;
  gap: 20px;
}

.goods-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(135deg, #fff7ed, #ffffff 58%);
  border: 1px solid #fed7aa;
  border-radius: 18px;
  margin-bottom: 30px;
}

.goods-hero span {
  color: var(--muted);
}

.inventory-view {
  display: grid;
  gap: 16px;
}

.inventory-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(135deg, #eff6ff, #ffffff 62%);
  border-color: #bfdbfe;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.08);
}

.inventory-hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 180px;
  height: 180px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 50%;
}

.inventory-hero > * {
  position: relative;
  z-index: 1;
}

.orders-view {
  display: grid;
  gap: 16px;
}

.orders-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 10%, rgba(217, 119, 6, 0.14), transparent 34%),
    linear-gradient(135deg, #fff7ed, #ffffff 62%);
  border-color: #fed7aa;
  box-shadow: 0 18px 45px rgba(217, 119, 6, 0.08);
}

.order-link-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.order-link-metric {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.order-link-metric.warning-card {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #fff);
}

.order-link-metric span {
  color: var(--muted);
  font-size: 13px;
}

.order-link-metric strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.order-link-metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.order-link-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.order-link-panel {
  padding: 18px;
}

.order-link-panel .panel-header {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.order-link-panel .panel-header h2,
.order-link-side .panel-header h2 {
  margin: 0;
}

.order-link-panel .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.order-link-table {
  min-width: 920px;
}

.order-link-table td strong,
.order-link-table td span {
  display: block;
}

.order-link-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-link-side {
  position: sticky;
  top: 18px;
}

.order-link-note {
  margin-top: 16px;
  padding: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
}

.order-link-note strong {
  color: var(--text);
}

.order-link-note p {
  margin: 8px 0 0;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.6;
}

.settings-view {
  display: grid;
  gap: 16px;
}

.settings-hero {
  background: linear-gradient(135deg, #f8fafc, #ffffff 62%);
  border-color: var(--line);
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.settings-workspace.is-subaccount-mode {
  grid-template-columns: minmax(0, 1fr);
}

.settings-panel,
.settings-preview {
  padding: 18px;
}

.settings-preview[hidden] {
  display: none;
}

.settings-panel .panel-header,
.settings-preview .panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-panel .panel-header h2,
.settings-preview .panel-header h2 {
  margin: 0;
}

.settings-panel .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.settings-form-wide {
  grid-column: 1 / -1;
}

.subaccount-panel {
  display: grid;
  gap: 14px;
}

.subaccount-panel[hidden] {
  display: none;
}

.asset-category-sort-panel[hidden] {
  display: none;
}

.asset-category-sort-panel {
  display: grid;
  gap: 14px;
}

.asset-category-sort-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-category-sort-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.asset-category-sort-tabs button {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.asset-category-sort-tabs button:hover {
  background: #f1f5f9;
}

.asset-category-sort-tabs button.active {
  background: #fff7ed;
  color: #d97706;
  border-color: #fed7aa;
  font-weight: 600;
}

.asset-category-sort-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
}

.asset-sort-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.1s;
}

.asset-sort-item:hover {
  box-shadow: 0 2px 8px rgba(2, 8, 20, 0.06);
}

.asset-sort-item.dragging {
  opacity: 0.6;
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(2, 8, 20, 0.1);
  cursor: grabbing;
}

.asset-sort-handle {
  color: #cbd5e1;
  font-size: 14px;
  user-select: none;
  cursor: grab;
}

.asset-sort-name {
  flex: 1;
  font-size: 14px;
  color: #334155;
}

.asset-sort-parent {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  outline: none;
  min-width: 120px;
}

.asset-sort-parent:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

.asset-category-sort-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.subaccount-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subaccount-help a {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.subaccount-dashboard {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(0, 1.2fr));
  gap: 14px;
}

.subaccount-stat {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.subaccount-stat div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subaccount-stat span,
.subaccount-stat strong,
.subaccount-stat p {
  display: block;
}

.subaccount-stat span {
  color: var(--muted);
  font-size: 13px;
}

.subaccount-stat strong {
  margin-top: 12px;
  color: var(--text);
  font-size: 24px;
}

.subaccount-stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.subaccount-stat a {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.subaccount-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.subaccount-tabs button {
  padding: 0 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-weight: 700;
}

.subaccount-tabs button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.subaccount-manager {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.subaccount-dept {
  padding: 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.subaccount-tree {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.subaccount-tree button {
  padding: 9px 10px;
  color: #475569;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.subaccount-tree button.active,
.subaccount-tree button:hover {
  color: #2563eb;
  background: #eff6ff;
  font-weight: 700;
}

.subaccount-content {
  min-width: 0;
  padding: 18px;
}

.subaccount-filters,
.subaccount-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.subaccount-filters input {
  min-width: 260px;
}

.subaccount-table-wrap {
  overflow: auto;
}

.subaccount-table {
  min-width: 920px;
  width: 100%;
  border-collapse: collapse;
}

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

.subaccount-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.subaccount-table td strong,
.subaccount-table td span,
.subaccount-table td a {
  display: block;
}

.subaccount-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.subaccount-table td a {
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  text-decoration: none;
}

.subaccount-table .perm-cell span {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  vertical-align: middle;
}

.perm-denied {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}

.account-switcher {
  position: relative;
}

.account-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.account-indicator:hover {
  border-color: var(--primary);
  background: #fff7ed;
}

.account-indicator svg {
  color: var(--muted);
}

.account-avatar {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switch-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0;
}

.account-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: 0.2s ease;
}

.account-switch-item.active {
  border-color: var(--primary);
  background: #fff7ed;
}

.account-switch-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-switch-info strong {
  font-size: 14px;
}

.account-switch-info span {
  font-size: 12px;
  color: var(--muted);
}

.account-switch-info small {
  font-size: 11px;
  color: #92400e;
  background: #fff7ed;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 2px;
}

.perm-editor-modal {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

.perm-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.perm-role-section {
  margin-bottom: 16px;
  padding: 0;
}

.perm-role-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.perm-required {
  color: #ff4d4f;
  margin-right: 2px;
}

.perm-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.perm-role-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.perm-role-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.08);
}

.perm-role-item.active {
  color: var(--primary);
  background: #fff8e1;
  border-color: #f5a623;
}

.perm-role-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-radio-circle {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.perm-role-item:hover .perm-radio-circle {
  border-color: var(--primary);
}

.perm-role-item.active .perm-radio-circle {
  border-color: var(--primary);
  border-width: 4px;
}

.perm-super-admin {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
  margin-top: 4px;
}

.perm-super-admin input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-check-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.perm-super-admin:hover .perm-check-box {
  border-color: var(--primary);
}

.perm-super-admin input[type="checkbox"]:checked + .perm-check-box {
  background: var(--primary);
  border-color: var(--primary);
}

.perm-super-admin input[type="checkbox"]:checked + .perm-check-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.perm-super-text {
  display: inline;
}

.perm-super-text small {
  color: var(--muted);
  font-size: 12px;
}

.perm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.perm-tab {
  padding: 8px 16px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.perm-tab:hover {
  color: var(--primary);
  background: #fff7ed;
}

.perm-tab.active {
  color: var(--primary);
  background: #fff7ed;
  font-weight: 700;
}

.perm-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.perm-search-bar input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
}

.perm-search-bar input:focus {
  border-color: var(--primary);
}

.perm-search-bar button {
  height: 38px;
  padding: 0 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.perm-tree-wrap {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

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

.perm-tree-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
}

.perm-tree-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.perm-tree-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.perm-col-category {
  width: 140px;
  text-align: left;
  vertical-align: top;
  background: #fafbfc;
  border-right: 1px solid var(--line);
}

.perm-col-module {
  width: 160px;
  min-width: 160px;
  vertical-align: top;
}

.perm-col-action {
  min-width: 320px;
  vertical-align: top;
}

.perm-category-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.perm-category-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.perm-module-row {
}

.perm-module-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.perm-module-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.perm-module-row .perm-col-module {
  padding-left: 8px;
}

.perm-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 10px 2px 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
}

.perm-action-tag:hover {
  color: var(--primary);
}

.perm-action-tag.checked {
  color: var(--primary);
  background: none;
  border: none;
  font-weight: 600;
}

.perm-action-tag input[type="checkbox"] {
  accent-color: var(--primary);
}

.settings-preview {
  position: sticky;
  top: 18px;
}

.settings-preview-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.settings-preview-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-preview-card strong {
  color: var(--text);
  font-size: 24px;
}

.settings-preview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-preview-card small {
  padding: 10px 12px;
  color: #64748b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.settings-lock-note {
  margin-top: 14px;
  padding: 14px;
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
}

.settings-lock-note p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.inventory-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.inventory-hero-tags span {
  padding: 5px 10px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

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

.inventory-metric-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.inventory-metric-card .metric-icon {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.inventory-metric-card .metric-icon svg {
  width: 26px;
  height: 26px;
}

.inventory-metric-card.warning-card {
  border-color: var(--line);
  background: #fff;
}

.metric-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  font-weight: 800;
}

.metric-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-icon.warning {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.inventory-metric-card .metric-icon.positive,
.inventory-metric-card .metric-icon.warning,
.inventory-metric-card .metric-icon.danger {
  background: transparent;
  border: 0;
}

.inventory-metric-card .metric-icon.positive {
  color: var(--success);
}

.inventory-metric-card .metric-icon.warning {
  color: var(--warning);
}

.inventory-metric-card .metric-icon.danger {
  color: var(--danger);
}

.inventory-metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.inventory-metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
  line-height: 1;
}

.inventory-metric-card strong.positive {
  color: var(--success);
}

.inventory-metric-card strong.warning {
  color: var(--warning);
}

.inventory-metric-card strong.danger {
  color: var(--danger);
}

.inventory-metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.inventory-metric-card p.positive {
  color: var(--success);
}

.inventory-metric-card p.warning {
  color: var(--warning);
}

.inventory-metric-card p.danger {
  color: var(--danger);
}

.inventory-panel {
  padding: 18px;
}

.inventory-panel .panel-header {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inventory-panel .panel-header h2 {
  margin: 0;
}

.inventory-panel .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inventory-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.inventory-table-area {
  min-width: 0;
}

.inventory-operation-log {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.inventory-log-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.inventory-log-header strong {
  color: var(--text);
  font-size: 15px;
}

.inventory-log-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-log-header .table-action {
  flex: 0 0 auto;
}

.inventory-log-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.inventory-history-modal {
  max-width: 680px;
}

.inventory-history-modal .modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inventory-history-list {
  display: grid;
  gap: 10px;
  max-height: 60vh;
  overflow: auto;
}

.inventory-log-item {
  display: grid;
  gap: 6px;
  padding: 11px;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 12px;
}

.inventory-log-time {
  color: #64748b;
  font-size: 11px;
}

.inventory-log-item strong {
  color: var(--text);
  font-size: 13px;
}

.inventory-log-item p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.inventory-log-item span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.inventory-main-row {
  cursor: pointer;
}

.inventory-main-row.expanded {
  background: #f8fafc;
}

.inventory-main-row:hover {
  background: #f8fafc;
}

.inventory-sku-expand-row td {
  padding: 0 12px 14px;
  background: #f8fafc;
}

.inventory-list-sku-module {
  margin-top: -1px;
  box-shadow: inset 0 1px 0 rgba(226, 232, 240, 0.7);
}

.inventory-list-sku-module .inventory-sku-table {
  min-width: 620px;
}

/* 商品属性展示区 */
.inventory-attrs-section {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inventory-attrs-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.inventory-attrs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.inventory-attr-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
}

.inventory-attr-key {
  color: var(--muted);
  min-width: 50px;
}

.inventory-attr-value {
  color: var(--text);
  font-weight: 500;
}

.inventory-filters {
  align-items: center;
  flex-wrap: wrap;
}

.inventory-filters select,
.inventory-filters input {
  height: 36px;
  border-radius: 10px;
}

.inventory-stock-cell {
  display: grid;
  gap: 7px;
  min-width: 96px;
}

.inventory-stock-cell strong {
  font-size: 16px;
}

.inventory-shift-current {
  display: inline-grid;
  transform: translateX(50px);
}

.inventory-shift-safety {
  display: inline-block;
  transform: translateX(60px);
}

.inventory-shift-status {
  display: inline-flex;
  transform: translateX(30px);
}

.safety-stock-value {
  display: inline-block;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
  user-select: none;
  min-width: 40px;
}

.safety-stock-value:hover {
  color: #2563eb;
  border-bottom-color: #93c5fd;
}

.safety-stock-input {
  width: 80px;
  padding: 2px 6px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: #fff;
  border: 1px solid #2563eb;
  border-radius: 6px;
  outline: none;
}

.inventory-sku-module {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.inventory-sku-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 12px;
}

.inventory-sku-table th,
.inventory-sku-table td {
  padding: 8px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.inventory-sku-table th:last-child,
.inventory-sku-table td:last-child {
  border-right: 0;
}

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

.inventory-sku-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
}

.inventory-sku-table img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff7ed;
  border: 1px solid #e6eaf2;
  border-radius: 8px;
}

.inventory-sku-table .sku-no-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-sku-table td:nth-child(4) {
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.sku-stock-value,
.inventory-sku-table .safety-stock-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.sku-stock-value {
  color: #2563eb;
}

.inventory-sku-table .safety-stock-value {
  color: #b45309;
}

.inventory-sku-table .sku-col-index {
  width: 42px;
}

.inventory-sku-table .sku-col-image {
  width: 62px;
}

.inventory-sku-table .sku-col-size {
  width: 72px;
}

.inventory-sku-table .sku-col-name {
  width: 190px;
}

.inventory-sku-table .sku-col-stock {
  width: 72px;
}

.inventory-sku-table .sku-col-safety {
  width: 92px;
}

.inventory-stock-track {
  height: 7px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.inventory-stock-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.inventory-stock-track .positive {
  background: #16a34a;
}

.inventory-stock-track .warning {
  background: #f59e0b;
}

.inventory-stock-track .danger {
  background: #dc2626;
}

.inventory-panel .goods-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
}

.inventory-panel .goods-cell img {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 10px;
}

.inventory-panel .goods-cell strong {
  display: block;
  max-width: 142px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-panel .goods-cell span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.goods-panel {
  min-height: 420px;
}

.readonly-stock-field,
.readonly-date-field {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.goods-sku-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.goods-sku-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goods-sku-panel-header strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.goods-sku-panel-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.goods-custom-attrs-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.goods-custom-attrs-panel .goods-sku-panel-header {
  padding: 0 12px;
}

.goods-custom-attrs-list {
  padding: 0 12px;
}

.goods-custom-attr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: visible;
}

.goods-custom-attr-row input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.custom-attr-key-input {
  width: 100%;
}

.custom-attr-value-input {
  width: 60%;
}

.custom-attr-remove {
  flex-shrink: 0;
}

.goods-sku-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
}

.goods-sku-card {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  padding: 6px 8px;
}

.goods-sku-card .goods-sku-image-picker {
  flex-shrink: 0;
}

.goods-sku-name-input {
  flex: 0 1 auto;
  width: var(--sku-name-width, 120px);
  min-width: 120px;
  max-width: min(360px, 100%);
  height: 32px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.goods-sku-name-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1);
}

.goods-sku-card-delete {
  flex-shrink: 0;
  padding: 0;
  color: #ef4444;
  background: transparent;
  border: none;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.goods-sku-card-delete:hover {
  color: #b91c1c;
  text-decoration: underline;
}

.goods-sku-image-picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  color: #f97316;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.goods-sku-image-picker:hover {
  background: #fff7ed;
  border-color: #fb923c;
}

.goods-sku-image-picker img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}

.goods-sku-plus {
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.goods-sku-image-picker input {
  display: none;
}

.goods-sku-image-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

.goods-sku-image-picker:hover .goods-sku-image-delete {
  display: flex;
}

.goods-sku-image-delete:hover {
  background: #ef4444;
}

/* SKU面板按钮组 */
.goods-sku-panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* SKU排序弹窗 */
.sku-sort-modal {
  width: min(666px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.sku-sort-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sku-sort-tip {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: var(--muted, #94a3b8);
  line-height: 1.5;
}

.sku-sort-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.sku-sort-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sku-sort-item:hover {
  border-color: #fb923c;
  background: #fff7ed;
}

.sku-sort-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.sku-sort-item.drag-over {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.sku-sort-item .sku-sort-handle {
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.sku-sort-item:hover .sku-sort-handle {
  color: #f97316;
}

.sku-sort-item .sku-sort-index {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.sku-sort-item:hover .sku-sort-index {
  background: #fed7aa;
  color: #c2410c;
}

.sku-sort-item .sku-sort-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-sort-item .sku-sort-empty {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

.goods-filters input {
  min-width: 260px;
}

.goods-filters {
  align-items: center;
}

.goods-filters #goodsCategoryFilter {
  height: 36px;
  min-width: 108px;
  padding: 0 32px 0 12px;
  color: #0f172a;
  background-color: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 36px;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 15px,
    calc(100% - 12px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.goods-filters #goodsCategoryFilter:hover {
  border-color: #cbd5e1;
}

.goods-filters #goodsCategoryFilter:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.goods-table {
  min-width: 820px;
  table-layout: fixed;
}

.goods-table .goods-col-name {
  width: 220px;
  text-align: left;
}

.goods-table .goods-col-category {
  width: 92px;
}

.goods-table .goods-col-traffic {
  width: 138px;
}

.goods-table .goods-col-stock {
  width: 78px;
}

.goods-table .goods-col-updatedAt {
  width: 106px;
}

.goods-table .goods-col-action {
  width: 196px;
  text-align: center;
}

.goods-table th:not(.goods-col-name),
.goods-table td:not(.goods-col-name) {
  text-align: center;
}

.goods-table .goods-col-action {
  text-align: center;
}

/* 商品展示开关 */
.showcase-toggle-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  vertical-align: middle;
  margin-right: 6px;
}
.showcase-toggle-wrap input[type="checkbox"] {
  display: none;
}
.showcase-toggle-track {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: 10px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}
.showcase-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.showcase-toggle-wrap input:checked + .showcase-toggle-track {
  background: #f97316;
}
.showcase-toggle-wrap input:checked + .showcase-toggle-track .showcase-toggle-thumb {
  transform: translateX(14px);
}

.goods-table th,
.goods-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.goods-media-cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 210px;
  max-width: 220px;
}

.list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.list-pager-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.list-pager-actions button {
  min-width: 64px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.list-pager-actions button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.list-pager-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.goods-media-thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 14px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.goods-info-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.goods-info-stack strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
}

.goods-code-list {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.goods-traffic-block {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.goods-traffic-block span {
  white-space: nowrap;
}

.goods-export-button {
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(148, 163, 184, 0.15);
  color: #475569;
}
.status-pill.positive {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
.status-pill.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.status-pill.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}
/* 状态切换按钮 */
.status-toggle-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.15);
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}
.status-toggle-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
}
.status-toggle-btn.positive {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}
.status-toggle-btn.positive:hover {
  background: rgba(22, 163, 74, 0.2);
}

/* 导出弹窗 */
.doc-export-dialog {
  background: #fff;
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.doc-export-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.doc-export-dialog-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}
.doc-export-close {
  border: none;
  background: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.doc-export-close:hover {
  color: #ef4444;
}
.doc-export-dialog-body {
  padding: 20px;
}
.doc-export-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}
.doc-export-formats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-export-format-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.doc-export-format-item:hover {
  border-color: #fbbf24;
  background: #fffbeb;
}
.doc-export-format-item input[type="radio"] {
  accent-color: #d97706;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.doc-export-format-item:has(input:checked) {
  border-color: #d97706;
  background: #fffbeb;
}
.doc-export-format-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
}
.doc-export-format-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.doc-export-format-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
}
.doc-export-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
}

/* 导出复选框列 */
.doc-check-th {
  width: 36px;
  text-align: center;
  padding: 6px !important;
}
.doc-check-th input[type="checkbox"] {
  accent-color: #d97706;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.doc-check-cell {
  text-align: center;
  padding: 6px !important;
}
.doc-check-cell input[type="checkbox"] {
  accent-color: #d97706;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.goods-cell-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #64748b;
}
.goods-cell-meta .positive {
  color: #15803d;
}
.goods-cell-meta .warning {
  color: #b45309;
}
.row-actions {
  display: inline-flex;
  gap: 8px;
}
.link-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.link-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.empty-row {
  text-align: center;
  color: #94a3b8;
  padding: 24px 0;
}

.inventory-info-modal {
  max-width: 760px;
}

.inventory-adjust-modal {
  width: min(760px, 96vw) !important;
}
.inventory-adjust-confirm-modal {
  max-width: 360px;
}

.inventory-filter-modal {
  max-width: 680px;
}

.inventory-filter-modal .modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.inventory-product-picker {
  margin-top: 8px;
}

.inventory-filter-summary {
  margin-top: 14px;
  padding: 10px 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.inventory-export-preview {
  margin-top: 14px;
}

.inventory-export-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
}

.inventory-export-preview-header span {
  color: var(--muted);
  font-weight: 400;
}

.inventory-export-list {
  display: grid;
  gap: 8px;
  max-height: 288px;
  overflow: auto;
}

.inventory-export-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.inventory-export-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: #f8fafc;
}

.inventory-export-item strong,
.inventory-export-item span {
  display: block;
}

.inventory-export-item > div:nth-child(2) {
  min-width: 0;
}

.inventory-export-item > div:nth-child(2) strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-export-item > div:nth-child(2) span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-export-item-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.inventory-export-item-meta strong {
  color: var(--text);
  font-size: 18px;
}

.inventory-export-empty {
  padding: 18px;
  color: #94a3b8;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.inventory-adjust-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inventory-adjust-summary div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inventory-adjust-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-adjust-summary span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-adjust-stock {
  justify-items: end;
}

.inventory-adjust-stock strong {
  color: #2563eb;
  font-size: 22px;
  font-weight: 800;
}

/* 批量操作栏 */
.inv-adj-batch-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

.inv-adj-batch-bar select {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

/* 统计行 */
.inv-adj-stats {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* SKU 表格 */
.inv-adj-table-wrap {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inv-adj-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

/* 5列不等宽分配 */
.inv-adj-table col:nth-child(1) { width: 26%; }
.inv-adj-table col:nth-child(2) { width: 12%; }
.inv-adj-table col:nth-child(3) { width: 18%; }
.inv-adj-table col:nth-child(4) { width: 22%; }
.inv-adj-table col:nth-child(5) { width: 22%; }

.inv-adj-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.inv-adj-table th {
  padding: 10px 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.inv-adj-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  text-align: center;
}

/* 第1列（SKU名称）左对齐 */
.inv-adj-table td:first-child {
  text-align: left;
}

/* SKU名称列：图片+文字 */
.inv-adj-sku-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inv-adj-sku-name img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: #f1f5f9;
}

.inv-adj-sku-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 纯文本列（当前库存、改后库存）紧凑内边距 */
.inv-adj-table td:nth-child(2),
.inv-adj-table td:nth-child(6) {
  padding-left: 6px;
  padding-right: 6px;
}

.inv-adj-table tr:last-child td {
  border-bottom: none;
}

.inv-adj-table tr:hover td {
  background: #fafbfc;
}

/* 加减切换 - 无缝连接的按钮组 */
.inv-adj-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.inv-adj-toggle button {
  padding: 4px 14px;
  border: none;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.inv-adj-toggle button.active {
  background: #f97316;
  color: #fff;
}

.inv-adj-toggle button:not(:last-child) {
  border-right: 1px solid var(--line);
}

/* 输入框 - 自适应列宽，高度统一32px */
.inv-adj-qty-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.inv-adj-qty-input::-webkit-inner-spin-button,
.inv-adj-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.inv-adj-qty-input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.inv-adj-result {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  min-width: 50px;
  text-align: center;
}

.inv-adj-remark-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
  min-width: 80px;
}
.inv-adj-remark-input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.inv-adj-result.negative {
  color: #ef4444;
}

.inventory-adjust-form-grid {
  margin-top: 14px;
}

.inventory-adjust-confirm-content {
  display: grid;
  gap: 12px;
}

.inventory-confirm-warning {
  padding: 10px 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  font-size: 13px;
}

.inventory-confirm-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.inventory-confirm-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inventory-confirm-list dt {
  color: var(--muted);
  font-size: 12px;
}

.inventory-confirm-list dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* 入库确认弹窗 - SKU 明细 */
.confirm-sku-section {
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.confirm-sku-section-title {
  padding: 8px 12px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.confirm-sku-list {
  display: flex;
  flex-direction: column;
}
.confirm-sku-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.confirm-sku-row:last-child {
  border-bottom: none;
}
.confirm-sku-img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-sku-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.confirm-sku-noimg {
  font-size: 12px;
  color: var(--muted);
}
.confirm-sku-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.confirm-sku-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-sku-stock {
  font-size: 11px;
  color: var(--muted);
}
.confirm-sku-qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 56px;
}
.confirm-sku-qty-label {
  font-size: 10px;
  color: var(--muted);
}
.confirm-sku-qty strong {
  font-size: 14px;
  color: #d97706;
}
.confirm-sku-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 70px;
}
.confirm-sku-price span {
  font-size: 11px;
  color: var(--muted);
}
.confirm-sku-after {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 50px;
}
.confirm-sku-after span {
  font-size: 10px;
  color: var(--muted);
}
.confirm-sku-after strong {
  font-size: 14px;
  color: var(--text);
}
.confirm-sku-remark {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 60px;
}
.confirm-sku-remark span:first-child {
  font-size: 10px;
  color: var(--muted);
}
.confirm-sku-remark span:last-child {
  font-size: 11px;
  color: var(--text);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-sku-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
}
.confirm-sku-total span {
  font-size: 12px;
  color: #92400e;
}
.confirm-sku-total strong {
  font-size: 14px;
  color: #d97706;
}

.inventory-info-content {
  display: grid;
  gap: 18px;
}

.inventory-info-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  position: relative;
}

.inventory-info-summary img {
  flex: 0 0 116px;
  width: 116px;
  height: 116px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 14px;
}

.inventory-info-summary h3 {
  margin: 0;
  color: var(--text);
  font-size: 33px;
  line-height: 1.25;
}

.inventory-info-main {
  flex: 1;
  min-width: 0;
  display: grid;
  align-content: center;
  padding-top: 8px;
}

.inventory-info-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 0;
}

.inventory-info-stock {
  position: absolute;
  right: 38px;
  bottom: 14px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.inventory-info-stock .stock-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.5px;
  position: relative;
  transform: translate(-10px, -10px);
}

.inventory-info-stock .stock-value {
  color: var(--text);
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  transform: translateY(-5px);
}

.inventory-info-stock .stock-updated {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.inventory-info-stock.positive .stock-value {
  color: #15803d;
}

.inventory-info-stock.warning .stock-value {
  color: #b45309;
}

.inventory-info-stock.danger .stock-value {
  color: #b91c1c;
}

.inventory-info-codes {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.inventory-info-codes span {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.inventory-info-summary .status-pill {
  width: max-content;
  max-width: 72px;
  justify-content: center;
  padding-inline: 8px;
  white-space: nowrap;
}

.inventory-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inventory-info-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.inventory-info-grid span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-info-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.link-action:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.link-action:active {
  background: rgba(37, 99, 235, 0.16);
}

.download-icon {
  width: 16px;
  height: 18px;
  flex: 0 0 16px;
  fill: none;
  stroke: #94a3b8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.download-icon-arrow {
  stroke-width: 1.8;
}

.download-icon-line {
  stroke-width: 3.2;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.filters {
  display: flex;
  gap: 10px;
}

.compact-button {
  height: 42px;
  padding: 0 12px;
}

.settings-only[hidden] {
  display: none;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

select,
input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  width: 100%;
  padding: 12px;
  resize: vertical;
}

.goods-upload-area {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.goods-media-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.goods-media-section {
  display: grid;
  gap: 10px;
}

.goods-media-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.goods-media-images {
  flex-shrink: 0;
}

.goods-media-side {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex: 1;
  min-width: 0;
}

/* 图片上传列表：5张并排 */
.goods-image-upload-list {
  display: grid;
  grid-template-columns: repeat(5, 120px);
  gap: 10px;
  padding: 0;
}

/* 视频上传列表：两列 */
.goods-video-upload-list {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 10px;
}

/* 3D模型上传列表：两列 */
.goods-model-upload-list {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 10px;
}

/* 标题输入框：大输入框，单独占一列 */
.goods-title-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.goods-title-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  box-sizing: border-box;
}

.goods-title-field input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.goods-image-upload-card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  width: 120px;
  height: 120px;
  padding: 6px;
  background: #fff;
  border: 1px dashed #d7dce5;
  border-radius: 10px;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
}

.goods-image-upload-card input {
  display: none;
}

.goods-image-upload-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  z-index: 1;
}

.goods-image-upload-card .upload-icon {
  color: #f97316;
  font-size: 26px;
  line-height: 1;
  z-index: 2;
}

.goods-image-upload-card small {
  font-size: 12px;
  z-index: 2;
}

/* 有图片时底部操作栏 */
.goods-image-upload-card .goods-image-delete,
.goods-image-upload-card .goods-image-replace {
  position: absolute;
  z-index: 5;
  display: none;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  line-height: 1.4;
}

.goods-image-upload-card:hover .goods-image-delete,
.goods-image-upload-card:hover .goods-image-replace {
  display: inline-block;
}

.goods-image-upload-card .goods-image-delete {
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  border-radius: 50%;
  place-items: center;
  text-align: center;
}

.goods-image-upload-card:hover .goods-image-delete {
  display: flex;
}

.goods-image-upload-card .goods-image-delete:hover {
  background: #ef4444;
}

.goods-image-upload-card .goods-image-replace {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  white-space: nowrap;
}

.goods-image-upload-card .goods-image-replace:hover {
  background: #f97316;
}

.goods-video-upload-card .upload-icon {
  color: #2563eb;
}

.goods-model-upload-card .upload-icon {
  color: #7c3aed;
}

/* 3D 模型已上传卡片预览样式 */
.goods-model-upload-card .model-preview-icon {
  font-size: 28px;
  color: #7c3aed;
  line-height: 1;
}
.goods-model-upload-card .model-preview-name {
  font-size: 11px;
  color: #697386;
  word-break: break-all;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.goods-model-upload-card.has-model,
.goods-video-upload-card.has-video {
  position: relative;
}

.goods-image-add-card {
  font: inherit;
}

/* ========== 计算器独立模块 ========== */
.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 960px) {
  .calc-row {
    grid-template-columns: 1fr;
  }
}

.calc-module {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.calc-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.calc-module-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  margin: 0;
}

.calc-module-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-module-actions .cost-calc-search-wrap {
  position: relative;
  width: 180px;
}

.calc-module-actions .cost-calc-search-wrap input {
  height: 32px;
  font-size: 12px;
}

.cost-calc-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-top: 4px;
}

.cost-calc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.cost-calc-dropdown-item:last-child { border-bottom: none; }
.cost-calc-dropdown-item:hover { background: #fff7ed; }

.cost-calc-dropdown-item img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.cost-calc-dropdown-item .item-info { min-width: 0; flex: 1; }
.cost-calc-dropdown-item .item-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cost-calc-dropdown-item .item-info small {
  color: var(--muted);
  font-size: 11px;
}

/* 成本表格 */
.cost-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cost-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.cost-table th {
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.cost-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.cost-table tbody tr:hover {
  background: #fffbf5;
}

.cost-table td input {
  width: 100%;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
}

.cost-table td input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.1);
}

.cost-table td input[readonly] {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  border-color: transparent;
}

.cost-table .cost-calc-delete-row {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 15px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cost-table .cost-calc-delete-row:hover {
  color: #dc2626;
  background: #fee2e2;
}

.cost-total-label {
  font-weight: 700;
  color: #334155;
  text-align: right;
  padding-right: 8px !important;
}

.cost-table tfoot td {
  background: #f8fafc;
  font-weight: 600;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
}

.cost-grand-total {
  color: var(--primary) !important;
  font-size: 13px !important;
}

.cost-calc-empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 20px !important;
  font-size: 12px;
}

/* 锌合金计算器 */
.zinc-calc-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 720px) {
  .zinc-calc-row {
    grid-template-columns: 1fr;
  }
}

.zinc-calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  align-items: start;
}

.zinc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zinc-field span {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.zinc-field span small {
  color: #94a3b8;
  font-weight: 400;
  font-size: 11px;
  margin-left: 3px;
}

.zinc-field input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.zinc-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.1);
}

.zinc-calc-result {
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
}

.zinc-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.zinc-result-item span {
  color: #64748b;
}

.zinc-result-item strong {
  color: #334155;
  font-weight: 600;
  font-size: 13px;
}

.zinc-result-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 8px 0;
}

.zinc-result-item.highlight strong {
  color: var(--primary);
  font-size: 15px;
}

.zinc-result-item.total strong {
  font-size: 17px;
}

/* ========== 网站底部备案信息 ========== */
.site-footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: #94a3b8;
  background: #fff;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 2px 0;
}

.site-footer a {
  color: #94a3b8;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

/* ========== 素材选择弹窗 ========== */
.asset-picker-modal {
  width: min(860px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.asset-picker-modal .modal-header {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.asset-picker-modal .modal-header h2 {
  margin: 0;
}

/* Tab 切换 */
.asset-picker-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.asset-picker-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.asset-picker-tab:hover {
  color: #334155;
}

.asset-picker-tab.active {
  color: #d97706;
  font-weight: 600;
}

.asset-picker-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #d97706;
  border-radius: 1px;
}

.asset-picker-tab-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.asset-picker-tab-content.hidden {
  display: none;
}

/* Tab内容：素材库 */
.asset-picker-body {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.asset-picker-sidebar {
  width: 150px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.asset-picker-sidebar-header {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  padding: 4px 0 8px;
}

.asset-picker-category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 100%;
  flex: 1;
}

.asset-picker-cat-item {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-picker-cat-item:hover { background: #f1f5f9; }
.asset-picker-cat-item.active { background: #fff7ed; color: #d97706; font-weight: 600; }

.asset-picker-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.asset-picker-toolbar {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.asset-picker-toolbar select,
.asset-picker-toolbar input {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.asset-picker-toolbar select { min-width: 120px; }
.asset-picker-toolbar #assetPickerSort { min-width: 150px; }
.asset-picker-toolbar input { flex: 1; }

.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 100px);
  grid-auto-rows: 100px;
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
  flex: 1;
}

.asset-picker-item {
  width: 100px;
  height: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  position: relative;
}

.asset-picker-item:hover {
  box-shadow: 0 4px 12px rgba(2, 8, 20, 0.08);
  transform: translateY(-1px);
}

.asset-picker-item.selected {
  border-color: #f97316;
  background: #fff7ed;
}

.asset-picker-item.selected::after {
  content: "\2713";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: #f97316;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: grid;
  place-items: center;
  z-index: 2;
}

.asset-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-picker-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #64748b;
  font-size: 28px;
}

.asset-picker-thumb.video { background: #eff6ff; color: #2563eb; }
.asset-picker-thumb.model { background: #f5f3ff; color: #7c3aed; font-size: 18px; font-weight: 700; }

.asset-picker-name {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  display: block;
  padding: 5px 7px;
  color: #fff;
  background: rgba(15, 23, 42, 0.82);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.asset-picker-item:hover .asset-picker-name {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.3s, 0.3s, 0.3s;
}

.asset-picker-empty {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* 已选区域 */
.asset-picker-selected-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-picker-selected-label { font-size: 13px; font-weight: 600; color: #334155; }
.asset-picker-selected-label span { color: #d97706; }

.asset-picker-selected-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-height: 80px;
  overflow-y: auto;
}

.asset-picker-selected-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.asset-picker-selected-thumb img { width: 100%; height: 100%; object-fit: cover; }

.asset-picker-selected-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.asset-picker-selected-remove:hover { background: rgba(239, 68, 68, 0.8); }

/* Tab内容：本地上传 */
.asset-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}

.asset-upload-zone:hover,
.asset-upload-zone.dragover {
  border-color: #d97706;
  background: #fffbeb;
}

.asset-upload-icon {
  font-size: 36px;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.asset-upload-zone p {
  font-size: 14px;
  color: #334155;
  margin: 0 0 6px;
}

.asset-upload-zone span {
  font-size: 12px;
  color: #94a3b8;
}

.asset-upload-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.asset-upload-item {
  width: 80px;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.asset-upload-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.asset-upload-placeholder {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 20px;
}

.asset-upload-item-info {
  overflow: hidden;
}

.asset-upload-item-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 11px;
}

.asset-upload-item-info small {
  color: #94a3b8;
  font-size: 11px;
}

.asset-picker-modal .modal-actions {
  flex-shrink: 0;
  margin-top: 12px;
}

.file-upload-grid label {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px dashed #fdba74;
  border-radius: 16px;
}

.file-upload-grid input {
  height: auto;
  padding: 10px;
  background: #fff;
}

.file-upload-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.goods-module-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.goods-list-module-panel {
  margin: -4px 0 14px;
  padding: 12px;
  background: #fff;
}

.goods-module-modal {
  max-width: 640px;
}

.goods-module-modal .goods-module-panel {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.action-column-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  white-space: nowrap;
}

.action-title {
  display: inline-block;
}

.module-config-trigger {
  position: absolute;
  right: 0;
  height: auto;
  padding: 0;
  color: #2563eb;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transform: translateX(-10px);
}

.module-config-trigger:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.goods-module-panel[hidden] {
  display: none;
}

.goods-module-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goods-module-panel-header div {
  display: grid;
  gap: 4px;
}

.goods-module-panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.goods-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goods-module-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: grab;
}

.goods-module-item.dragging {
  opacity: 0.55;
}

.goods-module-item.drag-over {
  color: var(--primary);
  background: #fff7ed;
  border-color: #fdba74;
}

.media-summary {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  color: var(--primary);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1360px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--panel-soft);
}

.draggable-column.is-editable {
  cursor: grab;
  user-select: none;
}

.draggable-column.dragging {
  opacity: 0.55;
}

.draggable-column.drag-over {
  color: var(--primary);
  background: #fff7ed;
  outline: 1px dashed var(--primary);
  outline-offset: -4px;
}

.column-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.drag-handle {
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: -3px;
}

.column-edit,
.column-delete {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  opacity: 0;
  transition: 0.2s ease;
}

.draggable-column:hover .column-edit,
.draggable-column:hover .column-delete {
  opacity: 1;
}

.column-edit:hover {
  color: var(--primary);
  background: #fff7ed;
}

.column-delete:hover {
  color: #991b1b;
  background: #fee2e2;
}

.action-column {
  text-align: center;
}

tbody tr:hover {
  background: #f8fbff;
}

.order-row {
  cursor: pointer;
}

.order-row.selected-order {
  background: #f8fafc;
}

.order-row.selected-order td {
  background: #f8fafc;
  border-bottom-color: transparent;
}

.order-detail-row td {
  padding: 0 12px 16px;
  background: #f8fafc;
  border-bottom: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  white-space: normal;
}

.order-detail-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.order-detail-media {
  display: grid;
  gap: 10px;
}

.order-media-viewer {
  position: relative;
  width: 240px;
  height: 240px;
}

.order-media-viewer.has-multiple-media {
  cursor: pointer;
}

.order-main-image,
.order-main-video,
.order-main-model {
  width: 240px;
  height: 240px;
  object-fit: contain;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  background: #fff;
}

.order-main-model {
  display: grid;
  place-items: center;
  gap: 6px;
  align-content: center;
  padding: 14px;
  color: #6d28d9;
  background: #fff;
  text-align: center;
}

.order-main-model strong {
  font-size: 28px;
}

.order-main-model span {
  font-size: 12px;
  word-break: break-all;
}

.media-nav {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: rgba(15, 23, 42, 0.42);
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(226, 232, 240, 0.42);
  border-radius: 999px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.order-media-viewer:hover .media-nav {
  opacity: 0.36;
  pointer-events: auto;
}

.media-nav:hover {
  color: rgba(15, 23, 42, 0.78);
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.72;
}

.media-prev {
  left: 8px;
}

.media-next {
  right: 8px;
}

.order-detail-content {
  display: grid;
  gap: 14px;
}

.order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-detail-field,
.order-detail-note {
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.order-detail-field {
  position: relative;
  cursor: grab;
  user-select: none;
}

.order-detail-field.dragging {
  opacity: 0.55;
}

.order-detail-field.drag-over {
  border-color: var(--primary);
  background: #fff;
  outline: 1px dashed var(--primary);
  outline-offset: -4px;
}

.detail-drag-handle {
  position: absolute;
  top: 9px;
  right: 9px;
  color: #cbd5e1;
  font-size: 12px;
  font-style: normal;
  letter-spacing: -3px;
}

.order-detail-grid strong,
.order-detail-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.order-detail-note p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-thumb {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  background: #fff;
  border: 1px solid #fed7aa;
}

.product-name {
  display: block;
  font-weight: 700;
}

.product-desc {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.selling {
  color: #047857;
  background: #d1fae5;
}

.badge.draft {
  color: #475569;
  background: #e2e8f0;
}

.badge.offline {
  color: #991b1b;
  background: #fee2e2;
}

.badge.review {
  color: #92400e;
  background: #fef3c7;
}

.badge.processing {
  color: #9a3412;
  background: #ffedd5;
}

.table-action {
  color: var(--primary);
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 700;
}

.edit-action {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.edit-action:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  background: transparent;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 36px !important;
}

.timeline {
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  margin-bottom: 18px;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}

.quick-card {
  margin-top: 24px;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-soft);
}

.quick-card h3 {
  margin-bottom: 12px;
}

.quick-card button {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.category-modal {
  width: min(420px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 18px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label input,
label select {
  width: 100%;
  color: var(--text);
  font-weight: 400;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* 组合商品弹窗 */
.combo-goods-modal {
  width: min(960px, 96vw);
  height: min(680px, 88vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.combo-goods-modal .modal-header {
  padding: 18px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
  flex-shrink: 0;
}

.combo-goods-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.combo-goods-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 1100px) {
  .follow-subnav {
    width: 210px;
  }

  .follow-subnav-actions {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .insight-grid,
  .follow-stats,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-panel {
    grid-column: 1 / -1;
  }

  .side-panel {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .time-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-workspace {
    grid-template-columns: 1fr;
  }

  .inventory-operation-log {
    position: static;
  }

  .follow-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .search {
    flex: 1 1 320px;
  }
}

@media (max-width: 780px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    width: 270px;
    padding-inline: 24px;
    transform: translateX(-100%);
    transition: 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .follow-subnav {
    position: fixed;
    left: 270px;
    top: 0;
    z-index: 19;
    width: min(220px, calc(100vw - 270px));
    transform: translateX(-100vw);
    transition: 0.25s ease;
  }

  .sidebar.open ~ .follow-subnav:not([hidden]) {
    transform: translateX(0);
  }

  .brand strong,
  .brand span,
  .nav-text,
  .sidebar-card {
    opacity: 1;
    transform: none;
  }

  .mobile-menu {
    display: inline-grid;
    place-items: center;
  }

  .main {
    padding: 18px;
  }

  .stats-grid,
  .insight-grid,
  .follow-stats,
  .visitor-breakdown,
  .portrait-list,
  .file-upload-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .time-filter-actions,
  .period-meta,
  .date-range {
    align-items: stretch;
    flex-direction: column;
  }

  .portrait-chart {
    grid-template-columns: 1fr;
  }

  .portrait-region-block {
    grid-column: auto;
  }

  .portrait-rank-head,
  .portrait-rank-row {
    grid-template-columns: 82px minmax(100px, 1fr) 44px 0;
  }

  .order-detail-card,
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .order-media-viewer,
  .order-main-image,
  .order-main-video,
  .order-main-model {
    width: 100%;
  }

  .order-media-viewer,
  .order-main-image,
  .order-main-video,
  .order-main-model {
    height: 180px;
  }

  .panel-header,
  .mini-range,
  .filters {
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    min-width: 0;
  }
}

/* ========== 素材管理 ========== */
.assets-workspace {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 280px);
}

.assets-subcategories {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.assets-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assets-panel > .assets-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.assets-panel > .assets-content > .assets-grid {
  /* 自然高度，不撑满 */
}

.assets-subcat-header {
  margin-bottom: 10px;
}

.assets-subcat-header strong {
  font-size: 15px;
  font-weight: 700;
}

.assets-subcat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.assets-subcat-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.assets-subcat-actions input {
  width: 100px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.assets-folder-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.assets-folder-section > strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.assets-folder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.assets-folder-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.assets-folder-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.assets-folder-actions input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.assets-folder-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  min-height: 60px;
}

.assets-folder-node {
  display: flex;
  flex-direction: column;
}

.assets-folder-children {
  display: flex;
  flex-direction: column;
}

.assets-folder-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  transition: background 0.15s;
}

.assets-folder-row:hover {
  background: #f1f5f9;
}

.assets-folder-row.active {
  background: #fff7ed;
  color: #d97706;
  font-weight: 600;
}

.assets-folder-row .folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assets-folder-row .cat-delete {
  opacity: 0;
  font-size: 15px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  transition: opacity 0.15s, color 0.15s;
}

.assets-folder-row:hover .cat-delete {
  opacity: 1;
}

.assets-folder-row .cat-delete:hover {
  color: #ef4444;
}

.assets-content {
  margin-top: 0;
}

.assets-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.assets-toolbar input {
  max-width: 280px;
}

.assets-toolbar select {
  width: auto;
  min-width: 120px;
}

.assets-batch-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.assets-batch-actions.active {
  opacity: 1;
  pointer-events: auto;
}

.assets-batch-btn {
  font-size: 14px;
  border: none;
  background: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}

.assets-batch-btn:hover {
  text-decoration: underline;
}

.assets-batch-btn.danger {
  color: #dc2626;
}

.assets-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 100px);
  gap: 10px;
  align-items: start;
}

.assets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.assets-empty-icon {
  margin-bottom: 14px;
  font-size: 40px;
}

.assets-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
}

.assets-empty span {
  font-size: 13px;
}

/* 素材卡片 */
.asset-card {
  width: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  position: relative;
}

.asset-card:hover {
  box-shadow: 0 4px 12px rgba(2, 8, 20, 0.08);
  transform: translateY(-1px);
}

.asset-card-check {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  width: 16px;
  height: 16px;
  accent-color: #f97316;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.asset-card:hover .asset-card-check,
.asset-card.checked .asset-card-check {
  opacity: 1;
}

.asset-card.checked {
  border-color: #f97316;
  background: #fff7ed;
}

.asset-card-thumb {
  width: 100px;
  height: 100px;
  overflow: hidden;
  background: #f8fafc;
  display: grid;
  place-items: center;
}

.asset-card-thumb img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.asset-card-thumb.video-thumb {
  background: #eff6ff;
  color: #2563eb;
  font-size: 28px;
}

.asset-card-thumb.model-thumb {
  background: #f5f3ff;
  color: #7c3aed;
  font-size: 18px;
  font-weight: 700;
}

.asset-card-info {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.asset-card-name {
  flex: 1;
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-ops {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.asset-card:hover .asset-card-ops {
  opacity: 1;
}

.asset-card-delete,
.asset-card-move {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.asset-card-move:hover {
  color: #d97706;
  background: #fff7ed;
}

.asset-card-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* ========== 移动素材分类弹窗 - 分类树 ========== */
.move-tree-container {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  max-height: 300px;
  overflow-y: auto;
}

.move-tree-row-wrap {
  border-bottom: 1px solid #f8fafc;
}

.move-tree-row-wrap:last-child {
  border-bottom: none;
}

.move-tree-item {
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.move-tree-item:hover {
  background: #f8fafc;
}

.move-tree-item.selected {
  background: #fff7ed;
  color: #d97706;
  font-weight: 500;
}

.move-tree-item.selected .move-tree-count {
  color: #d97706;
}

.move-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.move-tree-arrow {
  font-size: 10px;
  color: #94a3b8;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.move-tree-arrow.hidden {
  visibility: hidden;
}

.move-tree-name {
  flex: 1;
  font-size: 14px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-tree-count {
  color: #94a3b8;
  font-size: 12px;
  flex-shrink: 0;
}

.move-tree-children {
  border-left: none;
  margin-left: 22px;
}

.move-tree-children .move-tree-name {
  font-size: 13px;
  color: #475569;
}

/* ========== 图片预览弹窗 ========== */
.asset-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  padding: 44px 0 10px;
}

.asset-preview-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 关闭按钮 */
.asset-preview-close {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 10001;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.asset-preview-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* 1. 主图区域（含左右箭头） */
.asset-preview-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 70px;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.asset-preview-main img {
  max-width: 70vw;
  max-height: 56vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: default;
}

/* 主图左右箭头 */
.asset-preview-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 48px;
  height: 80px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding-bottom: 4px;
}

.asset-preview-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.asset-preview-arrow.prev {
  left: 16px;
}

.asset-preview-arrow.next {
  right: 16px;
}

/* 2. 图片信息区（紧跟主图下方） */
.asset-preview-meta {
  text-align: center;
  padding: 10px 20px 6px;
  flex-shrink: 0;
}

.asset-preview-meta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}

.asset-preview-meta-name {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
}

.asset-preview-meta-size {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.asset-preview-meta-path {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* 4. 缩略图导航 */
.asset-preview-thumb-bar {
  padding: 6px 16px 10px;
  width: 100%;
  max-width: 900px;
  flex-shrink: 0;
}

.asset-preview-thumb-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  justify-content: center;
  scrollbar-width: none;
}

.asset-preview-thumb-list::-webkit-scrollbar {
  display: none;
}

.asset-preview-thumb-item {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
}

.asset-preview-thumb-item:hover {
  opacity: 0.85;
}

.asset-preview-thumb-item.active {
  border-color: #f97316;
  opacity: 1;
}

.asset-preview-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 素材层级导航 */
.assets-level1 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assets-level2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assets-level2-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.assets-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.assets-back-btn:hover {
  color: var(--primary);
}

.assets-level2-header strong {
  font-size: 15px;
  font-weight: 700;
}

.assets-level2-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assets-level2-list .nav-subitem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assets-level2-list .nav-subitem .cat-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #fff;
  font-size: 10px;
  background: #ef4444;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.assets-level2-list .nav-subitem:hover .cat-delete {
  display: inline-flex;
}

.assets-level2-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.assets-level2-actions input {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.primary-button.small {
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
}

/* ========== 产品展示页面 ========== */
/* 整体布局 - 三个独立模块 */
.showcase-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

/* 模块1：顶部Header条 */
.showcase-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.showcase-topbar-brand {
  flex-shrink: 0;
}
.showcase-topbar-brand strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.showcase-topbar-search {
  flex-shrink: 0;
}
.showcase-topbar-search input {
  width: 520px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.showcase-topbar-search input:focus {
  border-color: var(--primary);
}

/* 内容区：左侧分类 + 右侧产品网格 */
.showcase-body {
  display: flex !important;
  flex-direction: row;
  gap: 16px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  align-items: stretch;
}

/* 模块2：左侧分类栏 */
.showcase-sidebar {
  flex-shrink: 0;
  width: 180px;
  min-width: 180px;
  padding: 16px 12px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
  display: block !important;
  visibility: visible !important;
}
.showcase-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 8px 12px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
#showcaseCategoryList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#showcaseCategoryList .nav-subitem {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
#showcaseCategoryList .nav-subitem:hover {
  background: var(--panel);
  color: var(--text);
}
#showcaseCategoryList .nav-subitem.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* 模块3：产品网格 - 自适应铺满展示区，让同屏显示更多产品 */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  padding: 16px;
  flex: 1;
  align-content: start;
  overflow-y: auto;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.showcase-results {
  flex: 1;
  min-width: 0;
}

.showcase-pager {
  padding: 12px 16px 0;
}
@media (max-width: 1200px) {
  .showcase-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
}
@media (max-width: 900px) {
  .showcase-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 640px) {
  .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 10px; }
  .showcase-sidebar { width: 120px; }
}

/* 产品卡片 */
.showcase-card {
  position: relative;
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(23,32,51,0.06);
  border: 1px solid var(--line);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.showcase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23,32,51,0.1);
}
.showcase-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
}
.showcase-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.showcase-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
}
.showcase-stock-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.showcase-stock-badge.in-stock {
  background: rgba(22, 163, 74, 0.9);
  color: #fff;
}
.showcase-stock-badge.out-of-stock {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
}
.showcase-card-body {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.showcase-card:hover .showcase-card-body {
  opacity: 1;
  transform: translateY(0);
}
.showcase-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.showcase-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: rgba(23, 32, 51, 0.72);
  margin-bottom: 0;
}
.showcase-card-skus {
  display: none;
  flex-wrap: wrap;
  gap: 3px;
}
.showcase-sku-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg);
  font-size: 10px;
  color: var(--text);
}
.showcase-sku-chip img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
}
.showcase-sku-chip em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}
.showcase-sku-more {
  font-size: 10px;
  color: var(--muted);
  padding: 2px 4px;
}
.showcase-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
}
/* 产品详情 - 全屏页面（非弹窗） */
.showcase-detail-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.showcase-detail-header {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.showcase-detail-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.showcase-detail-back:hover {
  background: #fff7ed;
}
.showcase-detail-body {
  flex: 1;
  overflow-y: auto;
}
/* 左右分栏布局 */
.showcase-detail-layout {
  display: flex;
  gap: 20px;
  padding: 20px 24px 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.showcase-detail-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
}
.showcase-detail-right {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 主图行容器（缩略图 + 大图横排） */
.detail-media-top {
  display: flex;
  gap: 12px;
}
/* 竖排缩略图（1688风格） */
.detail-thumb-col {
  display: flex;
  flex-direction: column;
  width: 80px;
  flex-shrink: 0;
  height: 560px;
  position: relative;
}
.detail-thumb-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.detail-thumb-scroll::-webkit-scrollbar { width: 0; display: none; }
.detail-thumb-col img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}
/* 缩略图项：active 高亮边框 */
.detail-thumb-col .thumb-item {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}
.detail-thumb-col .thumb-item:hover,
.detail-thumb-col .thumb-item.active {
  border-color: var(--primary, #d97706);
}
.detail-thumb-col .thumb-item-3d {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
.detail-thumb-col .thumb-item-3d .thumb-3d-icon {
  font-size: 28px;
  color: var(--primary, #d97706);
  line-height: 1;
}
/* 缩略图列滚动按钮（叠加在缩略图底部，透明渐变背景） */
.detail-thumb-scroll-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(transparent, rgba(0,0,0,0.50));
  border: none;
  border-radius: 0 0 8px 8px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1;
}
.detail-thumb-scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.detail-thumb-scroll-btn:hover {
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
}
.detail-thumb-scroll-btn img {
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.detail-thumb-scroll-btn.up img {
  transform: rotate(180deg);
}
/* 大图展示区（正方形比例，和1688一样） */
.detail-main-img-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  width: 560px;
  height: 560px;
  overflow: hidden;
}
.detail-main-img-wrap img,
.detail-main-img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.detail-main-img-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}
.detail-main-img-wrap .no-img {
  color: var(--muted);
  font-size: 14px;
}
/* ====== 产品展示媒体切换器（主图区下方居中标签页） ====== */
.detail-media-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 12px auto 0;
  padding: 3px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(23,32,51,0.05);
}
.detail-media-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: transparent;
  color: #172033;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.detail-media-toggle-btn:hover {
  color: #172033;
  background: #e2e8f0;
  border-color: var(--line);
}
.detail-media-toggle-btn.active {
  background: #ffffff;
  color: #172033;
  border-color: #ffffff;
  box-shadow: 0 1px 3px rgba(23,32,51,0.08);
}
.detail-media-toggle-btn .toggle-icon {
  font-size: 12px;
  line-height: 1;
}
.detail-media-toggle-btn .toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,0.08);
  color: inherit;
}
.detail-media-toggle-btn.active .toggle-count {
  background: rgba(0,0,0,0.08);
}
/* 缩略图中的视频/3D标记 */
.detail-thumb-col .thumb-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.3;
}
/* SKU规格列表（1688风格上下结构） */
.detail-sku-list {
 display: flex;
 flex-direction: column;
}
.detail-sku-row {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 8px 4px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.detail-sku-row:last-child {
  border-bottom: none;
}
.detail-sku-row:hover,
.detail-sku-row.active {
  background: #fff7ed;
}
.detail-sku-row.active {
  border-left: 3px solid var(--primary, #d97706);
  padding-left: 1px;
}
.sku-row-left {
 display: flex;
 align-items: center;
 gap: 10px;
 flex: 1;
 min-width: 0;
}
.sku-row-left img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.sku-row-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sku-row-price {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}
.sku-row-stock {
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 右侧信息区 */
.detail-info-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  padding: 16px 18px 44px 18px;
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 10px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}
/* 价格+SKU 白色底座模块（像抽纸盒盖压在标题上方） */
.detail-price-sku-block {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  margin-top: -32px;
  position: relative;
  z-index: 2;
}
.detail-price-row {
  background: linear-gradient(135deg, #fff8f0, #fff);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  gap: 24px;
}
.detail-price-item label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-price-item span {
  font-size: 20px;
  font-weight: 700;
  color: #e65100;
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 10px;
}
.detail-meta-grid > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-meta-grid label {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.detail-meta-grid span {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.detail-skus h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px 0;
}
.detail-sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.detail-sku-table th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
.detail-sku-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.detail-sku-table img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}
@media (max-width: 768px) {
  .showcase-detail-layout { flex-direction: column; padding: 12px; }
  .showcase-detail-left { width: 100%; min-width: 0; }
  .detail-main-img-wrap { width: 100%; height: auto; aspect-ratio: 1/1; max-width: 100%; max-height: 360px; }
  .detail-thumb-col { height: auto; max-height: 360px; }
  .showcase-detail-right { padding: 16px; }
}
/* (旧详情页样式已清理) */

/* ========== 入库/出库登记独立页面（白色卡片风格） ========== */
.inventory-adjust-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #f8f9fc 0%, #eef1f6 100%);
}
.inventory-adjust-page.hidden {
  display: none;
}

/* 顶栏 */
.inv-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #f0f0f2;
  flex-shrink: 0;
}
.inv-page-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.3px;
}

/* 内容区 */
.inv-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* 底栏 */
.inv-page-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 32px;
  background: #fff;
  border-top: 1px solid #f0f0f2;
  flex-shrink: 0;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ====== 大白色底座卡片 ====== */
.inv-page-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 商品摘要 */
.inv-page-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f2;
}
.inv-page-summary > div:first-child {
 display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-page-summary strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.inv-page-summary > div:first-child > span {
  font-size: 12px;
  color: var(--muted);
}
.inv-page-summary .inventory-adjust-stock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.inv-page-summary .inventory-adjust-stock span {
  font-size: 12px;
  color: var(--muted);
}
.inv-page-summary .inventory-adjust-stock strong {
  font-size: 26px;
  font-weight: 800;
  color: #f97316;
}

/* 批量操作 */
.inv-page-batch {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-page-batch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.inv-page-batch select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.inv-page-input {
  width: 80px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.inv-page-input::-webkit-inner-spin-button,
.inv-page-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inv-page-input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

/* 统计行 */
.inv-page-stats {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}

/* SKU 卡片列表容器 */
.inv-page-sku-list {
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  overflow: hidden;
}

/* 列表表头 */
.inv-page-sku-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1fr 1.2fr;
  gap: 0;
  padding: 12px 20px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f2;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.inv-page-col-sku,
.inv-page-col-stock,
.inv-page-col-qty,
.inv-page-col-price,
.inv-page-col-result,
.inv-page-col-remark {
  display: flex;
  align-items: center;
}
.inv-page-col-qty,
.inv-page-col-price,
.inv-page-col-result,
.inv-page-col-remark {
  justify-content: center;
}

/* 单个 SKU 卡片行 */
.inv-page-sku-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1fr 1.2fr;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid #f5f5f7;
  align-items: center;
  transition: background 0.15s;
}
.inv-page-sku-card:last-child {
  border-bottom: none;
}
.inv-page-sku-card:hover {
  background: #fefefe;
}

/* SKU 名称列 */
.inv-page-sku-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.inv-page-sku-info img {
  width: 36px;
  height: 36px;
  min-width: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f7;
}
.inv-page-sku-info span {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 库存数值 */
.inv-page-stock-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* 数量/单价输入框 */
.inv-page-cell-input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e8e8ec;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
 box-sizing: border-box;
  -moz-appearance: textfield;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafbfc;
}
.inv-page-cell-input::-webkit-inner-spin-button,
.inv-page-cell-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inv-page-cell-input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
  background: #fff;
}

/* 备注输入框 */
.inv-page-remark-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e8e8ec;
  border-radius: 8px;
  font-size: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafbfc;
}
.inv-page-remark-input:focus {
  border-color: #f97316;
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
  background: #fff;
}

/* 改后库存 */
.inv-page-result {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-align: center;
}
.inv-page-result.negative {
  color: #ef4444;
}

/* 列对齐辅助 */
.inv-page-sku-card > .inv-page-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 单据管理页面 ========== */
.follow-subnav-section-title {
  margin: 16px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-page-view {
  padding: 16px;
  overflow-y: auto;
  height: 100%;
}

/* 文档列表视图 */
.doc-list-page-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.doc-list-stats-panel {
  background: transparent;
  border-radius: 10px;
  padding: 0;
  box-shadow: none;
}
.doc-list-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.doc-list-stats-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.doc-list-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.doc-stats-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.doc-stats-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-filter-input {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.doc-filter-input:focus {
  border-color: #f59e0b;
}
.doc-filter-search {
  width: 220px;
}
.doc-filter-sep {
  font-size: 13px;
  color: #94a3b8;
}
.doc-stats-cards {
  display: flex;
  gap: 12px;
}
.doc-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 18px;
  background: #f8fafc;
  border-radius: 8px;
  min-width: 120px;
}
.doc-stat-card-accent {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.doc-stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.doc-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.doc-stat-card-accent .doc-stat-value {
  color: #b45309;
}

/* 三模块可视化统计区 */
.doc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
}
.doc-stat-card-white {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s;
}
.doc-stat-card-white:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.doc-stat-card-white-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.doc-stat-card-white-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-stat-card-white-info {
  flex: 1;
}
.doc-stat-card-white-title {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 4px;
  display: block;
}
.doc-stat-card-white-value {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}
.doc-stat-value-amount {
  color: #b45309;
}
.doc-stat-value-profit {
  color: #10b981;
  font-size: 28px;
}
.doc-stat-chart {
  width: 100%;
  height: 120px;
  position: relative;
}
.doc-stat-svg {
  width: 100%;
  height: 100%;
}
.doc-chart-empty {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #94a3b8;
}
.doc-stat-module-count {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}
.doc-stat-module-amount {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.doc-stat-module-ranking {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
}
.doc-stat-module-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.doc-stat-module-icon {
  font-size: 18px;
}
.doc-stat-module-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.doc-stat-module-body {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.doc-stat-module-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.doc-stat-module-amount .doc-stat-module-value {
  color: #b45309;
}
.doc-stat-module-unit {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}
.doc-stat-module-bar {
  height: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px;
  overflow: hidden;
}
.doc-stat-module-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.doc-stat-module-bar-amount {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

/* 物品出量榜单 */
.doc-stat-ranking-list {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}
.doc-ranking-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-ranking-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-ranking-first .doc-ranking-num {
  background: #fbbf24;
  color: #fff;
}
.doc-ranking-second .doc-ranking-num {
  background: #cbd5e1;
  color: #fff;
}
.doc-ranking-third .doc-ranking-num {
  background: #d97706;
  color: #fff;
}
.doc-ranking-name {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  min-width: 60px;
  flex-shrink: 0;
}
.doc-ranking-bar-wrap {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.doc-ranking-bar {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #d97706);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.doc-ranking-first .doc-ranking-bar {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.doc-ranking-count {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.doc-ranking-empty {
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  padding: 20px 0;
}

.doc-list-history-panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.doc-list-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.doc-list-history-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}
.doc-list-count {
  font-size: 13px;
  color: #94a3b8;
  right: 0;
}
.doc-list-table-wrap {
  overflow-x: auto;
}
.doc-amount-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #b45309;
  text-align: center;
}
.doc-action-cell {
  white-space: nowrap;
}
.secondary-button.small {
  padding: 4px 10px;
  font-size: 12px;
}

/* 兼容旧样式 */
.doc-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.doc-list-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

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

/* 筛选+操作栏（历史记录区域） */
.doc-list-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
}
.doc-list-filter-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.doc-list-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
}

.doc-list-table th {
  padding: 12px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.doc-list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.doc-list-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.doc-list-table tbody tr:hover {
  background: var(--panel-soft);
}

.doc-list-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* 编辑工具栏 */
.doc-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.doc-edit-toolbar-divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  flex-shrink: 0;
}
.doc-edit-toolbar button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}
.doc-edit-toolbar .primary-button {
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}
.doc-edit-toolbar .edit-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

/* 编辑模式按钮栏（表格上方） */
.doc-edit-table-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.doc-edit-table-bar button {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px dashed #999;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.doc-edit-table-bar button:hover {
  border-color: #333;
  color: #333;
  border-style: solid;
}

/* 票据纸张 */
/* === 传统单据纸张 === */
.doc-paper {
  background: #fff;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 24px 20px;
  max-width: 800px;
  margin: 0 auto;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  color: #000;
  position: relative;
}

/* 可拖拽元素（编辑模式下才可拖拽） */
.doc-draggable {
  position: relative;
  user-select: none;
}
.doc-draggable.edit-mode {
  cursor: move;
}
.doc-draggable.dragging {
  z-index: 100;
  outline: 1px dashed #999;
  background: rgba(245,245,245,0.3);
}

/* 企业标题 */
.doc-paper-title {
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  outline: none;
}
.doc-paper-title:focus {
  background: #f5f5f5;
}

/* 联系信息区 - 三栏独立模块 */
.doc-contact-area {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 40px;
  padding-top: 6.4px;
  padding-bottom: 6px;
  font-size: 12px;
  color: #000;
  line-height: 1;
  min-height: 60px;
  overflow: hidden;
}

.doc-contact-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  background: #fff;
  z-index: 1;
}
.doc-contact-item > span:first-child {
  outline: none;
  align-self: center;
}
.doc-contact-item > span:first-child:focus {
  background: #f5f5f5;
}
.doc-contact-item.edit-mode {
  outline: 1px dashed #ccc;
  outline-offset: 2px;
  border-radius: 2px;
}

.contact-col {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}

.contact-label {
  font-weight: normal;
  align-self: center;
}

.contact-value {
  outline: none;
  text-align: left;
}
.contact-value:focus {
  background: #f5f5f5;
}

.contact-value-wechat {
  display: grid;
  grid-template-columns: auto auto;
  grid-auto-rows: auto;
  column-gap: 3px;
  row-gap: 2px;
}
.contact-value-wechat > div:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}
.contact-value-wechat > div:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}
.contact-value-wechat > div:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

/* 单据标题 */
.doc-paper-subtitle {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  margin: 8px 0 10px;
  letter-spacing: 0.1em;
}

/* 客户信息行 */
.doc-paper-customer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #000;
}

.doc-paper-customer label {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.doc-paper-customer input {
  border: none;
  border-bottom: 1px solid #000;
  background: transparent;
  font-size: 13px;
  color: #000;
  padding: 1px 3px;
  min-width: 80px;
  outline: none;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
}

.doc-paper-customer input:focus {
  border-bottom-color: #000;
  border-bottom-width: 2px;
}

.doc-paper-customer input[readonly] {
  color: #000;
  cursor: default;
  border-bottom: none;
}

/* 表格内嵌字段（客户信息） */
.doc-form-caption {
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0;
  border-bottom: none;
  font-size: 13px;
  color: #000;
  line-height: 1.6;
  overflow: visible;
  position: relative;
}
.doc-form-caption .doc-caption-item {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  position: relative;
}
.doc-form-caption .doc-field {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.doc-form-caption .doc-editable-text {
  border-bottom: none;
  background: transparent;
  font-size: 13px;
  color: #000;
  padding: 0 4px;
  min-width: 60px;
  min-height: 1em;
  outline: none;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  display: inline-block;
  line-height: 1.6;
}
.doc-form-caption .doc-editable-text:focus {
  background: #f5f5f5;
}
.doc-form-caption .doc-editable-text[contenteditable="false"] {
  color: #000;
  cursor: default;
}

/* 可编辑表格 */
.doc-form-table-wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}

.doc-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 700px;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
}

.doc-form-table th {
  padding: 6px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #000;
  background: #fff;
  border: 1px solid #000;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.doc-form-table th .th-text {
  outline: none;
  cursor: text;
}

.doc-form-table th .th-text:focus {
  color: #000;
}

.doc-form-table th .col-delete-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  display: none;
  place-items: center;
  line-height: 1;
}

.doc-form-table th:hover .col-delete-btn {
  display: grid;
}

.doc-form-table th .col-delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 表头列宽拖拽手柄 */
.doc-form-table th {
  position: relative;
}
.th-resize-handle {
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  width: 6px;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  border-right: 2px solid transparent;
}
.th-resize-handle:hover,
.th-resize-handle.dragging {
  border-right-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.doc-form-table td {
  padding: 0;
  border: 1px solid #000;
  text-align: center;
  color: #000;
}

.doc-form-table td[contenteditable="true"] {
  outline: none;
  min-width: 40px;
  padding: 5px 4px;
  cursor: text;
  color: #000;
}

.doc-form-table td[contenteditable="true"]:focus {
  background: #f5f5f5;
  box-shadow: inset 0 0 0 1px #333;
}

.doc-form-table td.selected-cell {
  background: #fef3c7 !important;
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
}

/* 物品名称列产品建议弹层 */
.doc-product-popup {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}
.doc-product-popup-item {
  padding: 6px 12px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s;
}
.doc-product-popup-item:hover {
  background: #fef3c7;
  color: #b45309;
}

.doc-form-table td.row-actions {
  width: 24px;
  padding: 2px;
  border: 1px solid #000;
  border-left: none;
}

.doc-form-table th:last-child {
  border-left: none;
  border-right: 1px solid #000;
}

.doc-form-table .row-delete-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  transition: all 0.2s;
}

.doc-form-table .row-delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 合计行 */
.doc-table-total-row td {
  background: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 4px;
  color: #000;
}

.doc-table-total-row td:first-child {
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.1em;
}

.doc-table-total-row td#docTotalQty,
.doc-table-total-row td#docTotalCell {
  font-size: 15px;
}

.doc-form-table-wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}

.doc-table-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  width: 76px;
}

.doc-table-toolbar button {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px dashed #999;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}

.doc-table-toolbar button:hover {
  border-color: #333;
  color: #333;
  border-style: solid;
}

/* 金额汇总区 */
.doc-paper-amount {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 0 6px;
  font-size: 13px;
  color: #000;
  overflow: visible;
  position: relative;
}

.doc-amount-block {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.doc-amount-label {
  color: #000;
  font-weight: 700;
}

.doc-amount-chinese {
  color: #000;
  font-weight: 700;
  width: 200px;
  text-align: left;
  outline: none;
}
.doc-amount-chinese:focus {
  background: #f5f5f5;
}

.doc-amount-small {
  font-size: 15px;
  font-weight: 700;
  color: #000;
}

/* 注释区 */
.doc-paper-notes {
  font-size: 11px;
  color: #000;
  line-height: 1.7;
  padding: 4px 0 12px;
  outline: none;
}
.doc-paper-notes:focus {
  background: #f5f5f5;
}

/* 签章区 */
.doc-paper-signature {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding-top: 20px;
  font-size: 13px;
  color: #000;
}

.doc-paper-signature span {
  flex: 1;
  outline: none;
  white-space: pre-wrap;
}
.doc-paper-signature span:focus {
  background: #f5f5f5;
}

/* 拖动辅助线 */
.doc-guide-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 50;
}
.doc-guide-line {
  position: absolute;
  display: none;
}
.doc-guide-v {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #f97316;
  opacity: 0.7;
}
.doc-guide-h {
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed #f97316;
  opacity: 0.7;
}

/* ========== 打印样式 ========== */
@media print {
  /* A4 纵向，10mm 页边距 → 可打印区域约 190mm × 277mm */
  @page { size: A4 portrait; margin: 10mm; }

  /* 重置 html/body 避免滚动截断 */
  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  /* 隐藏所有非文档元素 */
  .sidebar, .follow-subnav, .topbar, .doc-edit-toolbar, .doc-edit-table-bar, .doc-table-toolbar,
  .doc-form-table th .col-delete-btn, .doc-form-table .row-delete-btn,
  .doc-form-table td.row-actions, .doc-guide-lines,
  .login-page, .app-footer, .footer-icp, .site-footer { display: none !important; }

  /* 重置应用框架布局，让内容自然流式展开 */
  .app-shell { display: block !important; height: auto !important; overflow: visible !important; }
  .main { margin: 0 !important; padding: 0 !important; overflow: visible !important; height: auto !important; }
  .doc-page-view { padding: 0 !important; overflow: visible !important; height: auto !important; }
  .doc-page-content { overflow: visible !important; height: auto !important; }

  /* doc-paper：宽度设为 100% 适配 A4 可打印区域，保持原始内边距 */
  .doc-paper {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* 表格容器 */
  .doc-form-table-wrap {
    overflow: visible !important;
    margin-bottom: 4px !important;
  }

  /* 表格：强制固定布局，严格按 A4 宽度分配列宽，防止溢出 */
  .doc-form-table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 12px !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  .doc-form-table thead {
    display: table-header-group !important;
  }

  /* 所有单元格统一边框：1px 实线黑色 */
  .doc-form-table th,
  .doc-form-table td {
    border: 1px solid #000 !important;
    border-top: 1px solid #000 !important;
    border-bottom: 1px solid #000 !important;
    border-left: 1px solid #000 !important;
    border-right: 1px solid #000 !important;
    background: #fff !important;
  }
  .doc-form-table th:last-child {
    border-left: 1px solid #000 !important;
  }
  .doc-form-table th {
    padding: 5px 2px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-all !important;
  }
  .doc-form-table td {
    padding: 4px 2px !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-all !important;
    overflow: hidden !important;
  }
  .doc-form-table td[contenteditable="true"] {
    padding: 4px 2px !important;
    outline: none !important;
  }
  .doc-table-total-row td {
    font-size: 14px !important;
    padding: 8px 2px !important;
  }

  /* 清除编辑态视觉样式 */
  .doc-draggable { cursor: default !important; outline: none !important; }
  .doc-draggable.edit-mode { outline: none !important; }
  .doc-draggable.dragging { outline: none !important; background: none !important; }
  .doc-contact-item.edit-mode { outline: none !important; }

  /* 清除 focus 背景 */
  .doc-form-table td[contenteditable="true"]:focus,
  .doc-form-caption .doc-editable-text:focus,
  .doc-paper-title:focus,
  .doc-contact-item > span:first-child:focus,
  .contact-value:focus,
  .doc-amount-chinese:focus,
  .doc-paper-notes:focus,
  .doc-paper-signature span:focus { background: none !important; box-shadow: none !important; }

  /* 保持原始字号和间距（与编辑页面一致） */
  .doc-paper-title { font-size: 34px !important; margin-bottom: 6px !important; }
  .doc-contact-area { gap: 12px 40px !important; padding-top: 6px !important; padding-bottom: 6px !important; font-size: 12px !important; }
  .doc-form-caption { gap: 20px !important; line-height: 1.6 !important; font-size: 13px !important; }
  .doc-paper-amount { gap: 6px !important; padding: 8px 0 6px !important; font-size: 13px !important; }
  .doc-paper-notes { font-size: 11px !important; line-height: 1.6 !important; padding: 4px 0 12px !important; }
  .doc-paper-signature { gap: 40px !important; padding-top: 20px !important; font-size: 13px !important; }
  .doc-paper-signature span { white-space: pre-wrap !important; }

  /* 金额区 */
  .doc-amount-chinese { width: auto !important; }
  .doc-amount-small { font-size: 14px !important; }

  /* 隐藏其他视图 */
  .page-view[hidden] { display: none !important; }
  .doc-list-table tbody tr:hover { background: none !important; }
}

/* ========== 合同管理A4模板 ========== */
.contract-paper {
  width: 794px;
  min-height: 1123px;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 0;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  color: #000;
  position: relative;
  box-sizing: border-box;
  transform-origin: top center;
}
.contract-paper-inner {
  padding: 40px 36px;
  box-sizing: border-box;
}
.contract-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  outline: none;
}
.contract-title:focus {
  background: #f5f5f5;
}
.contract-no {
  text-align: right;
  font-size: 11px;
  color: #333;
  margin-bottom: 10px;
}
.contract-parties {
  margin-bottom: 6px;
  font-size: 12px;
}
.contract-party-line {
  font-size: 12px;
  line-height: 1.9;
}
.contract-fill-line {
  border-bottom: 1px solid #000;
  min-width: 220px;
  display: inline-block;
  padding: 0 2px;
  outline: none;
}
.contract-fill-line:focus {
  background: #f5f5f5;
}
.contract-preamble {
  font-size: 12px;
  line-height: 1.7;
  text-indent: 2em;
  margin-bottom: 8px;
}
.contract-order-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 6px 0 8px;
  gap: 20px;
}
.contract-fill-inline {
  border-bottom: 1px solid #000;
  min-width: 120px;
  display: inline-block;
  padding: 0 2px;
  outline: none;
}
.contract-fill-inline:focus {
  background: #f5f5f5;
}

/* 合同表格 —— 完全独立样式，不继承 doc-form-table */
.contract-table-wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}
.contract-form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  color: #000;
}
.contract-form-table th {
  padding: 5px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  color: #000;
  background: #fff;
  border: 1px solid #000;
  white-space: nowrap;
  position: relative;
}
.contract-form-table th .th-text {
  outline: none;
  cursor: text;
}
.contract-form-table th .th-text:focus {
  color: #000;
}
.contract-form-table td {
  padding: 4px 4px;
  border: 1px solid #000;
  text-align: center;
  color: #000;
}
.contract-form-table td[contenteditable="true"] {
  outline: none;
  min-width: 40px;
  cursor: text;
  color: #000;
}
.contract-form-table td[contenteditable="true"]:focus {
  background: #f5f5f5;
}
.contract-form-table .contract-total-row td {
  font-weight: 700;
  text-align: center;
}
.contract-form-table .contract-total-row td:first-child {
  text-align: center;
}

/* 交货地点 */
.contract-delivery {
  display: flex;
  align-items: baseline;
  font-size: 12px;
  margin: 10px 0 6px;
  gap: 4px;
}
.contract-delivery-label {
  font-weight: 700;
  white-space: nowrap;
}
.contract-delivery-line {
  border-bottom: 1px solid #000;
  flex: 1;
  min-height: 16px;
  padding: 0 2px;
  outline: none;
}
.contract-delivery-line:focus {
  background: #f5f5f5;
}

/* 合计金额行 */
.contract-amount-row {
  display: flex;
  align-items: baseline;
  font-size: 12px;
  margin: 8px 0 10px;
  gap: 4px;
}
.contract-amount-label {
  font-weight: 700;
  white-space: nowrap;
}
.contract-amount-chinese {
  border-bottom: 1px solid #000;
  min-width: 200px;
  display: inline-block;
  padding: 0 2px;
  outline: none;
}
.contract-amount-chinese:focus {
  background: #f5f5f5;
}
.contract-amount-sep {
  flex: 1;
}
.contract-amount-label2 {
  font-weight: 700;
}
.contract-amount-small {
  border-bottom: 1px solid #000;
  min-width: 80px;
  display: inline-block;
  padding: 0 2px;
  outline: none;
}
.contract-amount-small:focus,
.contract-amount-small > span:focus {
  background: #f5f5f5;
}

/* 合同条款 */
.contract-clauses {
  margin: 8px 0;
}
.contract-clause-item {
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 3px;
  padding: 1px 2px;
  outline: none;
}
.contract-clause-item:focus {
  background: #f5f5f5;
}

/* 签章区 */
.contract-signature {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 40px;
}
.contract-signature-block {
  flex: 1;
}
.contract-signature-party {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.contract-sig-field {
  font-size: 11px;
  line-height: 2.2;
}
.contract-sig-fill {
  border-bottom: 1px solid #000;
  min-width: 160px;
  display: inline-block;
  padding: 0 2px;
  outline: none;
}
.contract-sig-fill:focus {
  background: #f5f5f5;
}
.contract-sig-stamp {
  font-size: 11px;
  margin-top: 18px;
}

/* 打印样式 */
@media print {
  .contract-paper {
    box-shadow: none;
    width: 210mm;
    min-height: 297mm;
    margin: 0;
  }
  .contract-paper-inner {
    padding: 15mm 15mm;
  }
  .contract-title { font-size: 24px !important; }
  .contract-fill-line:focus,
  .contract-fill-inline:focus,
  .contract-amount-chinese:focus,
  .contract-amount-small:focus,
  .contract-clause-item:focus,
  .contract-delivery-line:focus,
  .contract-sig-fill:focus,
  .contract-title:focus,
  .contract-form-table td[contenteditable="true"]:focus { background: none !important; }
}

/* ========== 商品页面标签导航 ========== */
.goods-tabs-bar {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  overflow: visible;
}

.goods-tabs-scroll {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  gap: 0;
}
.goods-tabs-scroll::-webkit-scrollbar {
  height: 0;
}

.goods-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.goods-tab:hover {
  color: var(--text);
}

.goods-tab.active {
  color: var(--primary);
  font-weight: 500;
}

.goods-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.goods-tab-title {
  pointer-events: none;
}

.goods-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding: 0;
}

.goods-tab:hover .goods-tab-close,
.goods-tab.active .goods-tab-close {
  opacity: 1;
}

.goods-tab-close:hover {
  color: var(--danger);
}

.goods-tab-close.no-close {
  display: none;
}

/* 商品 iframe 容器 */
.goods-iframe-container {
  width: 100%;
  flex: 1;
  display: none;
}
.goods-iframe-container iframe {
  width: 100%;
  height: calc(100vh - 140px);
  border: none;
}
