/* 倍朵静态后台全局样式：定义操作台色板、布局、表格和弹窗视觉规则。 */

:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --surface: #fffefa;
  --surface-soft: #faf7ef;
  --surface-strong: #ffffff;
  --login-brand-surface: #eef3f1;
  --rail: #183900;
  --rail-2: #224f00;
  --ink: #172011;
  --ink-soft: #37442f;
  --muted: #66745d;
  --muted-strong: #4e5c47;
  --line: rgba(23, 32, 17, .12);
  --line-strong: rgba(23, 32, 17, .2);
  --brand: #376802;
  --gold: #a98545;
  --gold-soft: #f4ead3;
  --danger: #9f2c2c;
  --danger-soft: #f8e7e4;
  --success: #2e6a1f;
  --success-soft: #e8f2e2;
  --warning: #8a5a18;
  --warning-soft: #f8ecd8;
  --info: #245c74;
  --info-soft: #e2f0f4;
  --focus: rgba(55, 104, 2, .32);
  --shadow: 0 8px 20px rgba(23, 32, 17, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --apple-system-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --sans: var(--apple-system-font);
  --mono: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  scrollbar-gutter: stable;
}
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
}
button, input, textarea, select {
  font: inherit;
}
button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--motion-ease-standard),
    border-color var(--motion-fast) var(--motion-ease-standard),
    color var(--motion-fast) var(--motion-ease-standard),
    transform var(--motion-fast) var(--motion-ease-out);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button:disabled {
  cursor: default;
  opacity: .55;
  transform: none;
}
a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
}
a:hover { text-decoration: underline; }
input, textarea, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  transition:
    border-color var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}
textarea {
  min-height: 94px;
  resize: vertical;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}
.hidden { display: none !important; }
.shell { min-height: 100vh; }
.admin-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.admin-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.muted { color: var(--muted); }
.status-subtext {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
}
.sales-qr-thumb {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}
.sales-qr-panel {
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sales-qr-section > h3 {
  margin: 0 0 12px;
  color: var(--admin-text);
  font-size: 15px;
  font-weight: 900;
}
.sales-qr-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sales-qr-heading h2 {
  margin: 0;
}
.sales-qr-notice {
  border: 1px solid rgba(138, 90, 24, .2);
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 9px;
}
.sales-qr-preview,
.sales-qr-placeholder {
  width: 160px;
  height: 160px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.sales-qr-preview { object-fit: contain; }
.sales-qr-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.sales-qr-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 420px;
}
.sales-qr-meta strong {
  color: var(--admin-text);
  font-size: 14px;
  font-weight: 850;
}
.sales-qr-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.sales-qr-actions button {
  width: auto;
  min-width: 104px;
  white-space: nowrap;
}
.sales-qr-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sales-qr-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.revealed-contact {
  color: var(--rail);
  font-weight: 750;
}

.contact-display {
  width: 154px;
  min-height: 20px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.btn-primary {
  border-color: var(--rail);
  background: var(--rail);
  color: #fffefa;
  font-weight: 700;
}
.btn-primary:hover { background: var(--rail-2); }
.btn-secondary,
button.secondary {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  color: var(--rail);
  font-weight: 650;
}
.btn-secondary:hover,
button.secondary:hover {
  border-color: rgba(55, 104, 2, .42);
  background: #f7fbf3;
}
button.warn {
  border-color: var(--warning);
  background: var(--warning);
  color: #fff;
  font-weight: 700;
}
button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--surface-strong);
}
/* 登录页铺满视口时同步滚动槽底色，避免窄屏右侧露出后台底色。 */
body:has(.login-screen:not(.hidden)) {
  background: var(--surface-strong);
}
.login-card {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(480px, .96fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: none;
}
.login-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 46px 56px 40px;
  overflow: hidden;
  background-color: var(--login-brand-surface);
  background-image: url("../assets/admin-login-amber-leaf.jpg");
  background-repeat: no-repeat;
  background-position: center 58%;
  background-size: cover;
  color: var(--ink);
}
.login-brand::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: rgba(238, 244, 241, .2);
}
.login-brand > * {
  position: relative;
  z-index: 1;
}
.login-brand-logo {
  width: 206px;
  height: auto;
}
.login-brand-copy {
  margin-top: clamp(88px, 16vh, 154px);
}
.login-brand-copy .eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.login-brand h1 {
  max-width: 10em;
  margin: 12px 0 0;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 0;
}
.login-brand p {
  margin: 0;
  color: var(--muted-strong);
}
.login-brand .login-brand-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.boundary-note {
  margin-top: auto;
  border: 1px solid rgba(244, 226, 189, .28);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(244, 226, 189, .08);
  color: rgba(255, 254, 250, .86);
  font-size: 12px;
}
.login-form {
  align-self: stretch;
  justify-self: center;
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(480px, 100%);
  padding: 64px 52px;
  background: var(--surface-strong);
}
.login-form-logo {
  display: none;
  width: 190px;
  height: auto;
}
.login-form-intro {
  display: grid;
  justify-items: start;
  gap: 7px;
  margin-bottom: 10px;
}
.login-form-intro > img {
  width: 28px;
  height: 28px;
  margin-bottom: 5px;
}
.login-form h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}
.login-form-intro p {
  margin: 0;
  color: var(--muted);
}
.login-field {
  display: grid;
  gap: 7px;
}
.login-field > label {
  color: var(--ink-soft);
  font-size: 13px;
}
.login-input-shell {
  min-height: 50px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7ddd2;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: #ffffff;
  transition:
    border-color var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard),
    background var(--motion-fast) var(--motion-ease-standard);
}
.login-input-shell:focus-within {
  border-color: #9eaa98;
  box-shadow: none;
}
.login-input-shell > img {
  width: 20px;
  height: 20px;
  opacity: .74;
}
.login-form .login-input-shell input {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  box-shadow: none;
}
.login-form .login-input-shell input:focus {
  box-shadow: none;
}
.login-form .login-input-shell input:focus-visible {
  outline: none;
}
.login-form input::placeholder {
  color: #a0a89a;
}
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #ffffff inset;
  caret-color: var(--ink);
}
.login-password-toggle {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  padding: 0 6px;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
}
.login-password-toggle:hover {
  background: var(--surface-soft);
}
.login-field.has-error .login-input-shell {
  border-color: #b8615a;
  box-shadow: none;
}
.login-field-message,
.login-caps-lock {
  margin: 0;
  font-size: 12px;
  line-height: 18px;
}
.login-field-message {
  color: var(--danger);
}
.login-field-feedback {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.login-caps-lock {
  margin-left: auto;
  color: var(--warning);
  white-space: nowrap;
}
.login-form .btn-primary {
  min-height: 48px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  background: var(--rail);
  font-size: 14px;
  letter-spacing: 0;
}
.login-form .btn-primary:hover {
  background: var(--rail-2);
}
.login-message {
  min-height: 0;
}
.login-message:empty {
  display: none;
}
.login-message:not(:empty) {
  min-height: 42px;
  padding: 10px 12px;
  line-height: 20px;
}
.login-security-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.form-help {
  margin: 5px 0 0;
  color: var(--muted);
}
.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  width: 100%;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 2px 0 16px rgba(23, 32, 17, 0.02);
}
.side-brand {
  display: block;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.side-brand strong {
  display: block;
  font-size: 17px;
  color: var(--rail);
  letter-spacing: 0.02em;
}
.side-brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.nav-list {
  display: grid;
  gap: 6px;
}
.nav {
  width: 100%;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
  font-weight: 650;
  padding: 0 16px;
  min-height: 42px;
  transition:
    background var(--motion-fast) var(--motion-ease-standard),
    border-color var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard),
    color var(--motion-fast) var(--motion-ease-standard),
    transform var(--motion-fast) var(--motion-ease-out);
}
.nav:hover {
  background: var(--surface-soft);
  color: var(--rail);
  transform: translateX(4px);
}
.nav.active {
  background: rgba(55, 104, 2, 0.06);
  color: var(--brand);
  border-color: rgba(55, 104, 2, 0.12);
  box-shadow: 0 2px 8px rgba(55, 104, 2, 0.04);
  transform: translateX(4px);
}
.nav.danger {
  margin-top: auto;
  color: var(--danger);
}
.nav.danger:hover {
  background: var(--danger-soft);
}
.workspace {
  min-width: 0;
  width: 100%;
  padding: 28px;
}
.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.workspace-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
}
.section-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -10px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, .78);
  color: var(--muted-strong);
  font-weight: 700;
}
.section-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}
.section-tab.active {
  border-color: rgba(55, 104, 2, .22);
  background: rgba(55, 104, 2, .08);
  color: var(--brand);
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.system-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}
.toast {
  position: fixed;
  right: 32px;
  bottom: 28px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 650;
  box-shadow: var(--shadow);
}

.section-grid {
  display: grid;
  gap: 16px;
}
.two-pane {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: start;
}
.data-panel,
.detail-panel,
.empty-state,
.filter-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.data-panel,
.detail-panel {
  box-shadow: 0 1px 0 rgba(23, 32, 17, .03);
}
.data-panel,
.filter-bar,
.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.detail-panel {
  position: sticky;
  top: 22px;
  padding: 16px;
  min-width: 0;
  overflow-x: hidden;
}
.product-editor-panel {
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}
.panel-head h2,
.detail-panel h2 {
  margin: 0;
  font-size: 16px;
}
.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
}
.data-panel > .table-wrap > table {
  table-layout: fixed;
}
.data-panel > .table-wrap > table th,
.data-panel > .table-wrap > table td {
  overflow-wrap: anywhere;
}
table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
}
th {
  background: #f8f5ed;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}
td {
  color: var(--ink-soft);
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td {
  background: rgba(55, 104, 2, .035);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: #f4f1e8;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.status-badge.submitted,
.status-badge.reviewing,
.status-badge.pending,
.status-badge.retryable,
.status-badge.after_sales,
.status-badge.payment_pending,
.status-badge.pending_payment,
.status-badge.deduction_pending,
.status-badge.reserved {
  border-color: rgba(138, 90, 24, .28);
  background: var(--warning-soft);
  color: var(--warning);
}
.status-badge.approved,
.status-badge.accepted,
.status-badge.valid,
.status-badge.generated,
.status-badge.sold,
.status-badge.confirmed,
.status-badge.issued,
.status-badge.used,
.status-badge.offline_confirmed,
.status-badge.active,
.status-badge.all,
.status-badge.paid,
.status-badge.preparing,
.status-badge.fulfilled,
.status-badge.deducted {
  border-color: rgba(46, 106, 31, .26);
  background: var(--success-soft);
  color: var(--success);
}
.status-badge.rejected,
.status-badge.invalid,
.status-badge.unavailable,
.status-badge.blocked,
.status-badge.voided,
.status-badge.expired,
.status-badge.payment_failed,
.status-badge.attention,
.status-badge.cancelled,
.status-badge.closed,
.status-badge.failed {
  border-color: rgba(159, 44, 44, .24);
  background: var(--danger-soft);
  color: var(--danger);
}
.status-badge.draft,
.status-badge.disabled,
.status-badge.not_matched,
.status-badge.locked,
.status-badge.inactive,
.status-badge.released {
  border-color: rgba(36, 92, 116, .22);
  background: var(--info-soft);
  color: var(--info);
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.detail-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.detail-list {
  display: grid;
  gap: 9px;
}
.detail-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.detail-row span:first-child {
  color: var(--muted);
}

/* 资金风险只读详情块：承载风险、禁用原因和资金链路摘要，不作为资金操作表单。 */
.funds-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 16px;
  align-items: start;
}
.funds-risk-panel {
  /* 统一搜索移除后，风险待办需要占满资金风险页首行。 */
  grid-column: 1 / -1;
}
.funds-filter-bar {
  /* 筛选只缩小资金风险队列，不承载普通订单搜索或资金写操作。 */
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.funds-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.funds-filter-field input,
.funds-filter-field select {
  min-height: 36px;
}
.funds-filter-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.funds-risk-cell {
  display: grid;
  gap: 5px;
}
.funds-risk-cell strong {
  color: var(--ink);
  font-size: 13px;
}
.funds-table {
  min-width: 1040px;
}
.funds-table th:last-child,
.funds-table td:last-child {
  width: 190px;
}
.funds-action-note {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.funds-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: #f4f1e8;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.funds-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}
.funds-pill-danger {
  border-color: rgba(159, 44, 44, .24);
  background: var(--danger-soft);
  color: var(--danger);
}
.funds-pill-warning {
  border-color: rgba(138, 90, 24, .28);
  background: var(--warning-soft);
  color: var(--warning);
}
.funds-pill-info {
  border-color: rgba(36, 92, 116, .22);
  background: var(--info-soft);
  color: var(--info);
}
.funds-pill-ok {
  border-color: rgba(46, 106, 31, .26);
  background: var(--success-soft);
  color: var(--success);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.detail-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
@media (max-width: 1120px) {
  .funds-layout {
    grid-template-columns: 1fr;
  }
  .funds-risk-panel {
    grid-column: auto;
  }
  .funds-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
  .funds-filter-actions {
    justify-content: flex-start;
  }
}
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(50, 48, 44, .48);
  backdrop-filter: blur(8px);
}
.confirm-modal {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 20px 54px rgba(50, 48, 44, .22);
}
.confirm-modal-head {
  display: block;
}
.confirm-modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
}
.confirm-modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-modal-actions .btn-primary,
.confirm-modal-actions .btn-secondary {
  min-width: 96px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 13px;
  min-width: 0;
}
.form-grid > * { min-width: 0; }
.wide { grid-column: 1 / -1; }
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.stock-sku-field {
  display: grid;
  gap: 8px;
}
.stock-sku-list {
  display: grid;
  gap: 8px;
}
.stock-sku-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, .72);
  padding: 9px 10px;
}
.stock-sku-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.stock-sku-product,
.stock-sku-spec {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-sku-product {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.stock-sku-spec {
  color: var(--muted);
  font-size: 12px;
}
.stock-sku-count {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.stock-sku-status {
  border: 1px solid rgba(55, 104, 2, .18);
  border-radius: 999px;
  background: rgba(231, 242, 216, .86);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}
.stock-sku-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  padding: 11px 12px;
  font-size: 12px;
}
.field-note {
  grid-column: 1 / -1;
  border: 1px solid rgba(169, 133, 69, .28);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--gold-soft);
  color: #624817;
  font-size: 12px;
}

.contact-settings-panel {
  max-width: 920px;
}
.contact-settings-form {
  padding: 0 16px 16px;
}
.contact-settings-group {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.contact-settings-group h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
}
.contact-settings-group .form-grid {
  max-width: 720px;
}
.contact-settings-group input {
  width: 100%;
}
.contact-field-error {
  display: block;
  min-height: 18px;
  padding-top: 4px;
  color: var(--danger);
  font-size: 12px;
}
.contact-settings-actions {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
}
.contact-settings-save-state {
  color: var(--muted);
  font-size: 12px;
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
}
.filter-bar.compact-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: start;
}
.filter-bar.compact-filter-bar input,
.filter-bar.compact-filter-bar select {
  flex: 0 1 220px;
  max-width: 260px;
}
.filter-bar.compact-filter-bar button {
  flex: 0 0 auto;
}
.filter-bar > * {
  min-width: 0;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px 16px;
}
.summary-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
  transition:
    border-color var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard),
    transform var(--motion-fast) var(--motion-ease-out);
}
.summary-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 57, 0, 0.05);
}
.summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.summary-card strong {
  color: var(--rail);
  font-size: 24px;
  line-height: 1.15;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  padding: 14px 16px;
}
.config-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.config-switch {
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}
.config-switch-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.system-pill.danger {
  border-color: rgba(185, 28, 28, 0.22);
  background: #fff1f0;
  color: #b91c1c;
}
.system-pill.warn {
  border-color: rgba(180, 83, 9, 0.24);
  background: #fff7ed;
  color: #92400e;
}
.config-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--surface-soft);
}
.config-line strong,
.config-line span {
  display: block;
}
/* 状态胶囊位于 config-line 内时会被上面的 span 规则覆盖，这里恢复按钮式居中。 */
.config-line .system-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}
.config-switch-wrap {
  display: flex;
  justify-content: flex-end;
}
.config-switch {
  min-width: 94px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--line-strong);
  border-radius: 999px;
  padding: 4px 11px 4px 5px;
  background: var(--surface-strong);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}
.config-switch:hover {
  border-color: rgba(55, 104, 2, .34);
  background: #f7fbf3;
}
.config-switch.enabled {
  border-color: rgba(55, 104, 2, .34);
  background: var(--success-soft);
  color: var(--success);
}
.config-switch.disabled {
  border-color: var(--line);
  background: var(--surface-soft);
}
.config-switch-track {
  width: 42px;
  height: 24px;
  position: relative;
  flex: 0 0 42px;
  border-radius: 999px;
  background: #e4ddd2;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 17, .08);
  transition: background var(--motion-fast) var(--motion-ease-standard);
}
.config-switch.enabled .config-switch-track {
  background: rgba(55, 104, 2, .68);
}
.config-switch-thumb {
  width: 18px;
  height: 18px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: 0 2px 7px rgba(23, 32, 17, .18);
  transition: transform var(--motion-fast) var(--motion-ease-out);
}
.config-switch.enabled .config-switch-thumb {
  transform: translateX(18px);
}
.config-switch-text {
  min-width: 2em;
  text-align: center;
}
.detail-surface {
  padding: 0 16px 16px;
}
.detail-head {
  margin: 0 -16px;
}
.lookup-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  padding: 14px 16px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  gap: 7px;
  place-items: start;
  padding: 28px;
  color: var(--muted);
}
.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}
.product-form-stack {
  display: grid;
  gap: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.product-form-stack label,
.product-form-stack .detail-section,
.product-form-stack .table-wrap,
.product-form-stack .image-form-grid,
.product-form-stack .image-slot,
.product-form-stack .panel-head {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.product-form-stack input,
.product-form-stack textarea,
.product-form-stack select {
  display: block;
  width: 100%;
  max-width: 100%;
}
.product-editor-head {
  padding: 0 0 12px;
  border-bottom: 0;
}
.sku-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sku-editor-head h2 {
  margin: 0;
  font-size: 16px;
}
.image-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
.image-slot {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
  min-width: 0;
}
.image-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.image-preview-shell,
.gallery-grid {
  min-height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px;
}
.image-preview-empty {
  height: 100%;
  min-height: 98px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.image-preview-card {
  display: grid;
  gap: 8px;
}
.image-preview-card img,
.gallery-item img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
}
.image-ref {
  color: var(--muted);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.gallery-item {
  display: grid;
  gap: 8px;
}
.gallery-remove {
  width: 100%;
}
.product-sku-table table {
  min-width: 1080px;
}
.product-sku-table td input[name="tagLabel"] {
  max-width: 90px;
}
.product-sku-table td input[name="consumerPrice"],
.product-sku-table td input[name="displayInventory"] {
  max-width: 90px;
  text-align: left;
}
.product-sku-table td select {
  max-width: 110px;
}
.sku-main-cell {
  min-width: 230px;
  vertical-align: top;
}
.sku-packaging-field {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.sku-packaging-field textarea {
  min-height: 84px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.skeleton-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}
.skeleton-line {
  height: 14px;
  border-radius: 999px;
  margin: 12px 0;
  background: linear-gradient(90deg, #eee9df, #faf7ef, #eee9df);
  background-size: 180% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}
.skeleton-line.short { width: 42%; }
.skeleton-line.mid { width: 66%; }
.skeleton-line.long { width: 88%; }
@keyframes skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 960px) {
  .login-card { grid-template-columns: 1fr; }
  .login-brand {
    min-height: 320px;
    padding: 34px 42px;
    background-position: center 57%;
  }
  .login-brand-logo { width: 184px; }
  .login-brand-copy { margin-top: 56px; }
  .login-brand h1 { font-size: 34px; }
  .login-form {
    width: min(520px, 100%);
    padding: 56px 48px 64px;
  }
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }
  .sidebar {
    position: sticky;
    z-index: 2;
    height: auto;
    top: 0;
    display: block;
    min-width: 0;
    width: 100%;
    padding: 12px;
  }
  .side-brand { margin-bottom: 10px; }
  .nav-list {
    position: relative;
    display: flex;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-right: 24px;
  }
  .nav-list::after {
    content: "";
    position: sticky;
    right: 0;
    width: 28px;
    min-width: 28px;
    background: linear-gradient(90deg, rgba(255, 254, 250, 0), var(--surface));
    pointer-events: none;
  }
  .nav {
    width: auto;
    white-space: nowrap;
  }
  .nav:hover,
  .nav.active {
    transform: none;
  }
  .nav.danger { margin-top: 10px; }
  .workspace {
    min-width: 0;
    width: 100%;
    padding: 18px;
  }
  .workspace-head { flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .two-pane,
  .form-grid,
  .filter-bar,
  .summary-grid,
  .config-grid,
  .lookup-form,
  .image-form-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .config-line {
    grid-template-columns: 1fr;
  }
  .wide { grid-column: auto; }
  .detail-panel { position: static; }
  .product-editor-panel {
    max-height: none;
    overflow-y: visible;
  }
  .confirm-modal-actions {
    flex-direction: column-reverse;
  }
  .confirm-modal-actions .btn-primary,
  .confirm-modal-actions .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .login-brand {
    display: none;
  }
  .login-form {
    width: min(460px, 100%);
    min-height: 100vh;
    min-height: 100dvh;
    padding: 36px 24px;
  }
  .login-form h2 {
    font-size: 27px;
  }
}

/* 审计时间轴样式 */
.timeline-wrap {
  display: flex;
  flex-direction: column;
  padding: 20px 8px;
  position: relative;
}
.timeline-wrap::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 168px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  display: flex;
  margin-bottom: 20px;
  position: relative;
  transition: transform var(--motion-fast) var(--motion-ease-out);
}
.timeline-item:hover {
  transform: translateX(4px);
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-meta {
  width: 150px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 18px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 20px;
}
.timeline-marker {
  width: 38px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.timeline-dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--muted);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line);
  margin-top: 4px;
  transition:
    background var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard);
}
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success-soft); }
.timeline-dot.danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.timeline-dot.info { background: var(--info); box-shadow: 0 0 0 2px var(--info-soft); }

.timeline-content {
  flex-grow: 1;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(23, 32, 17, .02);
  transition:
    border-color var(--motion-fast) var(--motion-ease-standard),
    background var(--motion-fast) var(--motion-ease-standard),
    box-shadow var(--motion-fast) var(--motion-ease-standard);
}
.timeline-item:hover .timeline-content {
  border-color: var(--brand);
  background: var(--surface-strong);
  box-shadow: 0 4px 12px rgba(23, 32, 17, .04);
}
.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.action-badge {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.target-info {
  font-size: 11.5px;
}
.timeline-body {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

/* 倍朵温暖极简 / 植物系后台刷新 */
:root {
  --bg: #f3f1ea;
  --surface: #fffefa;
  --surface-soft: #f8f3ec;
  --surface-strong: #ffffff;
  --surface-high: #ece7e1;
  --rail: #183900;
  --rail-2: #224f00;
  --ink: #1d1b17;
  --ink-soft: #33402a;
  --muted: #55433d;
  --muted-strong: #463833;
  --line: #ece3d4;
  --line-strong: #ddd0bf;
  --brand: #376802;
  --amber: #d97757;
  --amber-strong: #99462a;
  --gold: #a98545;
  --gold-soft: #f8ecd8;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --success: #376802;
  --success-soft: #e5f3d7;
  --warning: #9a4a2e;
  --warning-soft: #fff0e8;
  --info: #006b5f;
  --info-soft: #dff6f1;
  --focus: rgba(217, 119, 87, .26);
  --shadow: 0 14px 36px rgba(80, 54, 28, .08);
  --shadow-soft: 0 4px 16px rgba(80, 54, 28, .06);
  --radius: 10px;
  --radius-sm: 7px;
  --apple-system-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --serif: var(--apple-system-font);
  --sans: var(--apple-system-font);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 254, 250, .8), rgba(243, 241, 234, 0) 220px),
    var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
}

button {
  min-height: 36px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

input,
textarea,
select {
  min-height: 36px;
  border-color: var(--line-strong);
  background: rgba(255, 254, 250, .84);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(85, 67, 61, .66);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--focus);
}

.eyebrow {
  color: var(--amber-strong);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.btn-primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(217, 119, 87, .18);
}

.btn-primary:hover {
  border-color: var(--amber-strong);
  background: var(--amber-strong);
}

.btn-secondary,
button.secondary {
  border-color: var(--line-strong);
  background: rgba(255, 254, 250, .9);
  color: var(--rail);
}

.btn-secondary:hover,
button.secondary:hover {
  border-color: var(--brand);
  background: #f5faef;
}

button.warn {
  border-color: rgba(153, 70, 42, .4);
  background: var(--warning-soft);
  color: var(--warning);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.login-brand h1 {
  font-family: var(--serif);
  letter-spacing: 0;
}

.login-form h2,
.workspace-head h1,
.panel-head h2,
.detail-panel h2,
.summary-card strong,
.config-grid h3 {
  font-family: var(--serif);
  letter-spacing: 0;
}

.admin-layout {
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 26px 16px 18px;
  background: rgba(255, 254, 250, .52);
  border-right-color: var(--line);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.side-brand {
  padding: 0 10px 22px;
  border-bottom-color: var(--line);
}

.side-brand strong {
  color: var(--rail);
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0;
}

.side-brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  gap: 8px;
}

.nav {
  position: relative;
  min-height: 44px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}

.nav:hover {
  background: var(--surface-high);
  color: var(--ink);
  transform: none;
}

.nav.active {
  border-color: transparent;
  background: var(--surface-high);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.nav.active::before {
  background: var(--amber);
}

.nav.danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.nav.danger:hover {
  background: var(--danger-soft);
}

.sidebar .nav.danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.sidebar .nav.danger:hover {
  background: var(--danger-soft);
}

.workspace {
  padding: 32px;
}

.workspace-head {
  align-items: flex-end;
  margin-bottom: 24px;
}

.workspace-head h1 {
  font-size: 32px;
  line-height: 1.2;
}

.system-pill {
  border-color: var(--line);
  background: rgba(255, 254, 250, .78);
  color: var(--muted-strong);
  font-weight: 700;
}

.toast {
  border-color: rgba(153, 70, 42, .28);
  background: var(--warning-soft);
  color: var(--warning);
  box-shadow: var(--shadow-soft);
}

.toast[data-tone="success"] {
  border-color: rgba(55, 104, 2, .28);
  background: var(--success-soft);
  color: var(--success);
}

.toast[data-tone="error"] {
  border-color: rgba(186, 26, 26, .28);
  background: var(--danger-soft);
  color: var(--danger);
}

.section-grid {
  gap: 18px;
}

.data-panel,
.detail-panel,
.empty-state,
.filter-bar,
.skeleton-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, .88);
}

.data-panel,
.detail-panel {
  box-shadow: var(--shadow-soft);
}

.detail-panel {
  top: 24px;
  overflow-x: auto;
}

.panel-head {
  padding: 18px 20px;
  border-bottom-color: var(--line);
}

.panel-head h2,
.detail-panel h2 {
  font-size: 18px;
}

.panel-head p {
  color: var(--muted);
  font-size: 13px;
}

table {
  min-width: 820px;
}

th,
td {
  border-bottom-color: var(--line);
  padding: 12px 16px;
}

th {
  background: #f9f5ee;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

td {
  color: var(--ink-soft);
}

tbody tr:hover td {
  background: rgba(236, 231, 225, .62);
}

.status-badge {
  min-height: 26px;
  gap: 6px;
  border-color: var(--line-strong);
  background: #f4f1e8;
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: 0;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status-badge.submitted,
.status-badge.reviewing,
.status-badge.pending,
.status-badge.retryable,
.status-badge.payment_pending,
.status-badge.pending_payment,
.status-badge.deduction_pending,
.status-badge.reserved {
  border-color: rgba(153, 70, 42, .34);
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.approved,
.status-badge.accepted,
.status-badge.valid,
.status-badge.generated,
.status-badge.sold,
.status-badge.confirmed,
.status-badge.issued,
.status-badge.used,
.status-badge.offline_confirmed,
.status-badge.active,
.status-badge.all,
.status-badge.enabled,
.status-badge.in_stock,
.status-badge.paid,
.status-badge.preparing,
.status-badge.fulfilled,
.status-badge.deducted {
  border-color: rgba(55, 104, 2, .28);
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.rejected,
.status-badge.invalid,
.status-badge.unavailable,
.status-badge.blocked,
.status-badge.voided,
.status-badge.expired,
.status-badge.low_stock,
.status-badge.sold_out,
.status-badge.payment_failed,
.status-badge.cancelled,
.status-badge.closed,
.status-badge.failed {
  border-color: rgba(186, 26, 26, .28);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.draft,
.status-badge.disabled,
.status-badge.not_matched,
.status-badge.locked,
.status-badge.inactive,
.status-badge.pending_pull,
.status-badge.released {
  border-color: rgba(0, 107, 95, .22);
  background: var(--info-soft);
  color: var(--info);
}

.filter-bar {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  padding: 10px;
  background: rgba(255, 254, 250, .82);
}

.summary-grid {
  gap: 14px;
  padding: 18px 20px;
}

.summary-card {
  min-height: 112px;
  border-color: var(--line);
  background: rgba(255, 254, 250, .92);
  box-shadow: 0 2px 10px rgba(80, 54, 28, .04);
}

.summary-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  color: var(--ink);
  font-size: 30px;
}

.config-line,
.image-slot,
.timeline-content {
  border-color: var(--line);
  background: var(--surface-soft);
}

.lookup-form {
  padding: 18px 20px;
}

.empty-state {
  padding: 32px;
}

.empty-state strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

.timeline-wrap::before {
  background: var(--line);
}

.timeline-item:hover {
  transform: none;
}

.timeline-dot {
  border-color: var(--surface);
}

.action-badge {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

@media (max-width: 960px) {
  .workspace {
    padding: 18px;
  }

  .workspace-head h1 {
    font-size: 26px;
  }

  .sidebar {
    background: rgba(255, 254, 250, .9);
  }

  .nav::before {
    display: none;
  }
}

/* Web 后台参考框架细化 */
.admin-layout {
  grid-template-columns: 276px minmax(0, 1fr);
}

.workspace {
  padding: 0 32px 32px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin: 0 -32px 42px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .76);
  backdrop-filter: blur(16px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.operator-card {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  color: var(--rail);
}

.operator-card strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
}

.side-brand {
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 14px;
}

.nav::before {
  left: -10px;
  width: 6px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
  color: #4a332a;
}

.nav.active .nav-icon,
.nav:hover .nav-icon {
  color: var(--rail);
}

.sidebar .nav.danger {
  margin-top: 0;
}

.nav-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.nav-sublist {
  display: grid;
  gap: 3px;
  margin: 0 0 8px 42px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.nav-group.is-collapsed .nav-sublist {
  display: none;
}

.nav-group > .nav > span {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-group-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex: 0 0 auto;
  transition: transform var(--motion-base) var(--motion-ease-out);
}

.nav-group:not(.is-collapsed) .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-sub {
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-sub:hover {
  background: var(--surface-high);
  color: var(--ink);
  transform: none;
}

.nav-sub.active {
  border-color: rgba(55, 104, 2, .16);
  background: rgba(55, 104, 2, .08);
  color: var(--brand);
  transform: none;
}

.workspace-head {
  align-items: center;
  margin-bottom: 24px;
}

.workspace-head > div:first-child {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.workspace-head h1 {
  font-size: 36px;
  line-height: 1.12;
}

.head-actions .btn-primary,
.head-actions .btn-secondary {
  min-width: 116px;
}

.inventory-workbench {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.product-list-panel {
  min-height: calc(100vh - 380px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.product-table-wrap {
  overflow-x: visible;
  min-height: 0;
}

.product-table {
  min-width: 0;
  table-layout: fixed;
}

.product-table th,
.product-table td {
  height: 76px;
  padding: 13px 18px;
}

.product-table th {
  font-size: 16px;
}

.product-table th:nth-child(1) { width: 44%; }
.product-table th:nth-child(2) { width: 180px; }
.product-table th:nth-child(3) { width: 26%; }
.product-table th:nth-child(4) { width: 132px; }

.product-cell {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.product-cell strong,
.product-cell span,
.product-cell em {
  display: block;
}

.product-cell strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell em {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-thumb {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--rail);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 800;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.table-footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-chip {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.page-chip.active {
  border-color: transparent;
  background: #fbe7de;
  color: var(--amber-strong);
}

.editor-open,
.detail-modal-open {
  overflow: hidden;
}

.editor-backdrop,
.detail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(29, 27, 23, .38);
  backdrop-filter: blur(8px);
}

.editor-modal,
.detail-modal {
  width: min(860px, calc(100vw - 48px));
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 254, 250, .98);
  box-shadow: 0 24px 54px rgba(29, 27, 23, .22);
}

.editor-modal.product-editor-panel {
  position: static;
  padding: 0;
}

.detail-modal {
  width: min(720px, calc(100vw - 48px));
}

.detail-modal-wide .detail-modal {
  width: min(920px, calc(100vw - 48px));
}

.detail-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 0 24px 24px;
}

.detail-modal-body .detail-head {
  margin: 0 -24px;
}

.editor-window-bar {
  z-index: 4;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 0 12px 0 20px;
  background: rgba(248, 243, 236, .98);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  backdrop-filter: none;
}

.editor-scroll-body {
  min-height: 0;
  overflow: auto;
  padding: 0 24px 24px;
}

.editor-window-close {
  width: 42px;
  min-width: 42px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border-color: transparent;
  border-radius: 9px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.editor-window-close-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.editor-window-close:hover {
  border-color: rgba(186, 26, 26, .24);
  background: var(--danger-soft);
  color: var(--danger);
  transform: none;
}

.product-editor-head {
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 -24px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .96);
  /* 粘性标题使用实体背景，避免滚动时逐帧重新计算背景模糊。 */
  backdrop-filter: none;
}

.product-form-stack {
  gap: 0;
}

.product-form-stack .detail-section {
  padding-top: 18px;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .product-table-wrap {
    overflow-x: auto;
  }

  .product-table {
    min-width: 920px;
  }
}

@media (max-width: 960px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .nav-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex: 0 0 auto;
  }

  .nav-sublist {
    display: flex;
    gap: 8px;
    margin: 0;
    padding-left: 0;
    border-left: 0;
  }

  .nav-sub {
    width: auto;
    min-height: 42px;
    white-space: nowrap;
    padding: 0 12px;
  }

  .filter-bar.compact-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .filter-bar.compact-filter-bar input,
  .filter-bar.compact-filter-bar select {
    max-width: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 24px;
    padding: 14px 18px;
    justify-content: stretch;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .workspace-head h1 {
    font-size: 28px;
  }

  .workspace-head {
    align-items: flex-start;
  }

  .editor-modal,
  .detail-modal {
    width: 100%;
    max-height: 100%;
    border-radius: 12px;
  }
}

/* 倍朵后台视觉对齐 */
:root {
  --bg: #f3f1ea;
  --surface: #fff8f6;
  --surface-soft: #fff1ed;
  --surface-strong: #ffffff;
  --surface-high: #f0dfda;
  --surface-glass: rgba(255, 254, 250, .86);
  --rail: #183900;
  --rail-2: #2a6500;
  --ink: #221a17;
  --ink-soft: #382e2b;
  --muted: #55433d;
  --muted-strong: #4b3934;
  --line: #ece3d4;
  --line-strong: #dbc1b9;
  --brand: #376802;
  --amber: #d97757;
  --amber-strong: #99462a;
  --success: #376802;
  --success-soft: #e5f3d7;
  --warning: #99462a;
  --warning-soft: #fff0e8;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --info: #006b5f;
  --info-soft: #dff6f1;
  --focus: rgba(217, 119, 87, .28);
  --shadow: 0 14px 36px rgba(80, 54, 28, .08);
  --shadow-soft: 0 5px 18px rgba(80, 54, 28, .07);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 248, 246, .86), rgba(243, 241, 234, 0) 260px),
    var(--bg);
}

button {
  letter-spacing: 0;
}

input,
textarea,
select {
  border-color: var(--line-strong);
  background: rgba(255, 248, 246, .88);
}

.admin-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 28px 16px 18px;
  background: linear-gradient(180deg, var(--rail), #235600);
  border-right: 0;
  color: #e8ffd8;
  box-shadow: 8px 0 28px rgba(24, 57, 0, .08);
  backdrop-filter: none;
}

.side-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  margin: 0 -2px 22px;
  padding: 0 0 24px;
  border-bottom-color: rgba(255, 254, 250, .16);
}

.side-brand::before {
  content: "倍";
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  grid-row: 1 / span 2;
  border-radius: 12px;
  background: #c1ec9f;
  color: var(--rail);
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 254, 250, .42);
}

.side-brand strong {
  color: #f7ffe7;
  font-size: 22px;
  line-height: 1.18;
}

.side-brand span {
  color: rgba(232, 255, 216, .72);
  font-size: 13px;
}

.nav-list {
  gap: 9px;
}

.nav {
  min-height: 48px;
  border-radius: 0 9px 9px 0;
  color: rgba(232, 255, 216, .82);
  padding: 0 14px;
}

.nav::before {
  left: -16px;
  top: 0;
  bottom: 0;
  width: 5px;
}

.nav-icon {
  color: currentColor;
}

.nav:hover {
  background: rgba(193, 236, 159, .12);
  color: #ffffff;
}

.nav.active {
  background: #c1ec9f;
  color: var(--rail);
}

.nav.active::before {
  background: var(--amber);
}

.nav.active .nav-icon,
.nav:hover .nav-icon {
  color: currentColor;
}

.nav-sublist {
  margin-left: 40px;
  border-left-color: rgba(232, 255, 216, .18);
}

.nav-sub {
  color: rgba(232, 255, 216, .68);
}

.nav-sub:hover {
  background: rgba(193, 236, 159, .1);
  color: #ffffff;
}

.nav-sub.active {
  border-color: rgba(193, 236, 159, .18);
  background: rgba(193, 236, 159, .18);
  color: #ffffff;
}

.sidebar .nav.danger {
  color: #ffdbd0;
}

.sidebar .nav.danger:hover {
  background: rgba(255, 218, 214, .12);
  color: #ffffff;
}

.workspace {
  padding: 0 32px 34px;
}

.topbar {
  min-height: 72px;
  justify-content: space-between;
  margin: 0 -32px 32px;
  padding: 0 32px;
  background: rgba(255, 254, 250, .84);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(80, 54, 28, .04);
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}

.topbar-actions {
  gap: 14px;
}

.topbar-exit {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}

.topbar-exit:hover {
  background: rgba(255, 241, 237, .76);
  color: var(--amber-strong);
}

.topbar-exit {
  gap: 8px;
  min-width: 78px;
  padding: 0 8px 0 12px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  font-weight: 800;
}

.topbar-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  color: currentColor;
}

.operator-card {
  min-height: 40px;
  padding-left: 4px;
  border-left: 0;
}

.operator-card strong {
  color: var(--ink);
  font-size: 16px;
}

.workspace-head {
  align-items: flex-start;
  margin-bottom: 22px;
}

.workspace-head h1 {
  color: var(--ink);
  font-size: 34px;
  line-height: 1.12;
}

.section-tabs {
  border-bottom: 0;
  margin: -4px 0 20px;
  padding: 0;
}

.section-tab {
  min-height: 38px;
  border-color: var(--line);
  background: rgba(255, 254, 250, .72);
  color: var(--muted);
}

.section-tab.active {
  border-color: var(--amber);
  background: #fff0e8;
  color: var(--amber-strong);
}

.head-actions .btn-primary,
.btn-primary {
  border-color: var(--amber-strong);
  background: var(--amber-strong);
  color: #ffffff;
}

.head-actions .btn-secondary,
.btn-secondary,
button.secondary {
  border-color: var(--line-strong);
  background: rgba(255, 254, 250, .88);
  color: var(--ink-soft);
}

.data-panel,
.detail-panel,
.empty-state,
.filter-bar,
.skeleton-panel {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  min-height: 64px;
  padding: 18px 22px;
  background: rgba(255, 248, 246, .58);
}

.panel-head h2,
.detail-panel h2 {
  color: var(--ink);
  font-size: 19px;
}

.filter-bar {
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: rgba(255, 248, 246, .74);
}

.summary-card {
  min-height: 118px;
  border-color: var(--line);
  background:
    radial-gradient(circle at 92% 0, rgba(255, 219, 208, .7), transparent 34%),
    rgba(255, 254, 250, .9);
}

.summary-card span {
  color: var(--muted-strong);
}

.summary-card strong {
  color: var(--ink);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 0 0 12px 12px;
}

table {
  min-width: 0;
}

.data-panel > .table-wrap > table:not(.product-table) {
  table-layout: auto;
}

th,
td {
  height: 48px;
  padding: 11px 18px;
}

th {
  background: #f3f0e8;
  color: var(--muted-strong);
  font-size: 13px;
}

tbody tr:hover td {
  background: rgba(255, 241, 237, .78);
}

th:last-child,
td:last-child {
  width: 112px;
  white-space: nowrap;
}

th:nth-last-child(2),
td:nth-last-child(2) {
  width: 72px;
  white-space: nowrap;
}

td:last-child button,
.row-actions button {
  min-width: 88px;
  white-space: nowrap;
}

.mono,
.summary-card strong,
.status-badge {
  font-variant-numeric: tabular-nums;
}

.status-badge {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge::before {
  width: 7px;
  height: 7px;
}

.config-line,
.image-slot,
.stock-sku-row,
.timeline-content {
  border-color: var(--line);
  background: rgba(255, 241, 237, .56);
}

.timeline-item {
  min-height: 72px;
}

.timeline-head {
  gap: 10px;
}

.lookup-form,
.detail-surface,
.config-grid,
.summary-grid {
  padding: 18px 22px;
}

.editor-window-bar,
.product-editor-head {
  background: rgba(248, 243, 236, .98);
}

.nav-sub.active {
  border-color: transparent;
  background: rgba(193, 236, 159, .1);
  color: #f7ffe7;
  box-shadow: none;
}

.sidebar .nav:focus-visible,
.sidebar .nav-sub:focus-visible {
  outline: 1px solid rgba(193, 236, 159, .36);
  outline-offset: 0;
}

/* 倍朵后台布局对齐 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  gap: 24px;
}

.nav-list {
  gap: 12px;
}

.nav {
  border-radius: 8px;
}

.nav.active {
  border-radius: 8px;
}

.workspace-head {
  min-height: 0;
}

[data-view="admin"][data-section="workbench"] .workspace-head {
  display: none;
}

.workbench-shell {
  display: grid;
  gap: 24px;
}

.workbench-hero,
.workbench-panel,
.workbench-kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.workbench-hero {
  min-height: 162px;
  display: flex;
  align-items: center;
  padding: 28px 42px;
  background:
    radial-gradient(circle at 90% 25%, rgba(193, 236, 159, .34), transparent 22%),
    linear-gradient(90deg, rgba(255, 254, 250, .94), rgba(255, 254, 250, .7)),
    var(--surface-glass);
}

.workbench-hero h2,
.workbench-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.workbench-hero p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.workbench-hero p strong {
  color: var(--amber-strong);
}

.workbench-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.workbench-kpi {
  position: relative;
  container-type: inline-size;
  min-height: 162px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  padding: 24px 30px;
  color: var(--ink);
  text-align: left;
}

.workbench-kpi span {
  color: var(--ink-soft);
  font-size: 16px;
}

.workbench-kpi strong {
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.workbench-kpi strong em {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.kpi-mark {
  position: absolute;
  right: 24px;
  top: 28px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
}

.kpi-mark .admin-icon {
  width: 22px;
  height: 22px;
}

.kpi-mark.review {
  color: var(--amber);
}

.kpi-mark.orders {
  color: var(--info);
}

.kpi-mark.warning {
  color: var(--danger);
}

.kpi-mark.sales {
  color: var(--brand);
}

.workbench-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
}

.workbench-panel {
  overflow: hidden;
}

.workbench-panel-head {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
}

.workbench-link {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--amber-strong);
  font-weight: 800;
}

.workbench-list {
  display: grid;
  gap: 0;
  padding: 24px 30px;
}

.workbench-todo-item,
.activity-item {
  width: 100%;
  min-height: 78px;
  display: grid;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workbench-todo-item {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 16px;
}

.workbench-todo-item:hover,
.activity-item:hover,
.workbench-kpi:hover {
  background: rgba(255, 241, 237, .62);
}

.todo-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--line-strong);
}

.todo-check .admin-icon {
  width: 22px;
  height: 22px;
}

.workbench-todo-item strong,
.activity-item strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.workbench-todo-item small,
.activity-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.workbench-todo-item em {
  border-radius: 6px;
  padding: 5px 10px;
  background: var(--warning-soft);
  color: var(--amber-strong);
  font-style: normal;
  font-weight: 800;
}

.workbench-timeline {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 26px 28px 28px;
}

.activity-item {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 16px;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
}

.activity-dot.dot-1 {
  background: #c1ec9f;
}

.activity-dot.dot-2,
.activity-dot.dot-3 {
  background: var(--line);
}

.workbench-empty {
  padding: 24px 0;
  color: var(--muted);
}

.inventory-workbench,
.section-grid {
  gap: 20px;
}

@media (max-width: 960px) {
  .sidebar {
    background: var(--rail);
  }

  .side-brand {
    grid-template-columns: 38px minmax(0, 1fr);
    margin-bottom: 12px;
  }

  .side-brand::before {
    width: 38px;
    height: 38px;
  }

  .topbar {
    margin: -18px -18px 24px;
  }

  .workspace-head h1 {
    font-size: 28px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .workbench-kpis,
  .workbench-main-grid {
    grid-template-columns: 1fr;
  }
}

/* 倍朵后台布局微调 */
.workbench-shell {
  gap: 18px;
}

.workbench-hero {
  min-height: 126px;
  padding: 22px 42px;
}

.workbench-hero h2,
.workbench-panel h2 {
  font-size: 25px;
}

.workbench-hero p {
  margin-top: 10px;
}

.workbench-kpis {
  gap: 18px;
}

.workbench-kpi {
  min-height: 132px;
  gap: 12px;
  padding: 20px 28px;
}

.workbench-kpi strong {
  font-size: 38px;
}

.workbench-main-grid {
  gap: 18px;
}

.workbench-panel-head {
  min-height: 64px;
  padding: 0 28px;
}

.workbench-list {
  padding: 12px 28px;
}

.workbench-todo-item,
.activity-item {
  min-height: 52px;
}

.workbench-timeline {
  padding: 10px 26px 12px;
}

.activity-item {
  min-height: 44px;
}

.activity-item small {
  margin-top: 2px;
}

.sales-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.sales-metric-card {
  position: relative;
  container-type: inline-size;
  min-height: 146px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 30px;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 219, 208, .62), transparent 35%),
    var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.sales-metric-card span {
  color: var(--ink-soft);
  font-weight: 800;
}

.sales-metric-card strong {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sales-metric-card small {
  color: var(--brand);
  font-size: 14px;
}

.sales-metric-card:nth-child(3) strong {
  color: var(--danger);
}

.sales-metric-card:nth-child(3) small {
  color: var(--ink-soft);
}

.sales-metric-mark {
  position: absolute;
  right: 28px;
  top: 30px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
}

.sales-metric-mark .admin-icon {
  width: 22px;
  height: 22px;
}

.sales-metric-mark.pin {
  color: var(--amber-strong);
}

.sales-metric-mark.sales {
  color: var(--brand);
}

.sales-metric-mark.warning {
  color: var(--danger);
}

.audit-filter {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(260px, 1.4fr) minmax(180px, .8fr);
}

.audit-table-wrap {
  border-radius: 0;
}

.audit-table {
  min-width: 980px;
}

.audit-table th:last-child,
.audit-table td:last-child,
.audit-table th:nth-last-child(2),
.audit-table td:nth-last-child(2) {
  width: auto;
  white-space: normal;
}

.audit-table th,
.audit-table td {
  height: 56px;
  padding: 10px 14px;
}

.audit-table th:first-child,
.audit-table td:first-child {
  width: 126px;
  white-space: nowrap;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2),
.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 92px;
  white-space: nowrap;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
  width: 150px;
  white-space: nowrap;
}

.audit-actor {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.audit-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #c1ec9f;
  color: var(--rail);
  font-size: 13px;
  font-weight: 900;
}

.audit-avatar .admin-icon {
  width: 17px;
  height: 17px;
}

.audit-type {
  border-radius: 999px;
  font-weight: 800;
}

.audit-type.success {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--brand);
}

.audit-type.danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.audit-type.info {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--amber-strong);
}

.audit-time {
  color: var(--ink);
}

.audit-related-cell {
  min-width: 250px;
  color: var(--ink-soft);
}

.audit-related-documents {
  display: grid;
  gap: 5px;
}

.audit-related-document {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.audit-related-document .mono {
  overflow-wrap: anywhere;
}

.audit-related-label {
  color: var(--admin-muted);
  font-size: 12px;
}

.audit-footer {
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  background: rgba(255, 248, 246, .58);
}

.audit-footer strong {
  color: var(--ink);
  font-size: 18px;
}

@media (max-width: 960px) {
  .sales-metric-grid,
  .audit-filter {
    grid-template-columns: 1fr;
  }
}

/* 后台图标与文字对齐修正 */
.admin-icon {
  display: block;
  vertical-align: middle;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  line-height: 1;
}

.nav span {
  line-height: 1.2;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.topbar-actions,
.head-actions,
.row-actions,
.sales-qr-status-row,
.sales-qr-heading {
  align-items: center;
}

.topbar-exit,
.section-tab,
.btn-primary,
.btn-secondary,
button.secondary,
button.warn,
button.danger,
.workbench-link,
.system-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.topbar-exit {
  gap: 8px;
}

.topbar-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.status-badge {
  gap: 6px;
  vertical-align: middle;
}

.status-badge::before {
  flex: 0 0 auto;
}

.icon-bubble,
.kpi-mark,
.sales-metric-mark,
.todo-check,
.audit-avatar {
  display: grid;
  place-items: center;
  line-height: 1;
}

.icon-bubble .admin-icon,
.kpi-mark .admin-icon,
.sales-metric-mark .admin-icon,
.todo-check .admin-icon,
.audit-avatar .admin-icon {
  display: block;
}

.workbench-kpi,
.workbench-todo-item,
.activity-item {
  justify-content: stretch;
}

.workbench-kpi > span:first-child,
.sales-metric-card > span:first-child {
  width: calc(100% - 58px);
  max-width: none;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: normal;
}

@container (max-width: 190px) {
  .workbench-kpi .kpi-mark,
  .sales-metric-card .sales-metric-mark {
    display: none;
  }

  .workbench-kpi > span:first-child,
  .sales-metric-card > span:first-child {
    width: 100%;
  }
}

td:last-child button,
.row-actions button {
  min-height: 36px;
  align-self: center;
}

.side-brand {
  align-items: center;
  row-gap: 0;
}

.side-brand::before {
  grid-row: 1;
}

/* 侧栏品牌锁定图融入深绿背景，保留品牌识别但不再形成独立白色卡片。 */
.side-brand {
  width: 180px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  margin: 0 auto 22px;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.side-brand::before {
  content: none;
}

.side-brand-mark {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background-image: url("../assets/logo-breydo-lockup.png");
  background-repeat: no-repeat;
  background-size: 156px auto;
  background-position: -4px center;
}

.side-brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1;
  color: var(--ink);
}

.side-brand-copy strong {
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: .98;
  letter-spacing: 0;
}

.side-brand-copy span {
  color: var(--ink-soft);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.side-brand-copy b {
  color: var(--rail);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .side-brand {
    margin: 0 0 12px;
  }
}

/* 管理后台工作区使用冷静灰白表面，与登录页和浅色侧栏保持同一品牌语气。 */
:root {
  --bg: #f5f6f5;
  --surface: #ffffff;
  --surface-soft: #f6f7f6;
  --surface-strong: #ffffff;
  --surface-high: #ecefed;
  --surface-glass: rgba(255, 255, 255, .94);
  --ink: #1c241f;
  --ink-soft: #3c4a41;
  --muted: #647168;
  --muted-strong: #4e5c53;
  --line: #e2e6e3;
  --line-strong: #d1d7d2;
  --shadow: 0 8px 20px rgba(31, 55, 39, .08);
  --admin-workspace-bg: #f5f6f5;
  --admin-panel: rgba(255, 255, 255, .98);
  --admin-panel-soft: #f6f7f6;
  --admin-rail: #173900;
  --admin-rail-soft: #235006;
  --admin-amber: #b8743a;
  --admin-amber-soft: #faead7;
  --admin-danger: #b7352d;
  --admin-danger-soft: #fae3de;
  --admin-text: #1c241f;
  --admin-muted: #647168;
  --admin-line: rgba(44, 62, 50, .13);
  --admin-shadow: 0 6px 18px rgba(31, 45, 36, .05);
  --motion-fast: 160ms;
  --motion-base: 220ms;
  --motion-chart: 400ms;
  --motion-ease-standard: cubic-bezier(.4, 0, .2, 1);
  --motion-ease-out: cubic-bezier(.16, 1, .3, 1);
}

body {
  background: var(--admin-workspace-bg);
  color: var(--admin-text);
}

.admin-layout {
  grid-template-columns: 256px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid rgba(24, 57, 0, .12);
  background: var(--login-brand-surface);
  color: var(--ink);
  box-shadow: none;
}

.nav-list {
  gap: 14px;
}

.nav-section {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.nav-section-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 2px;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.nav-section-label::after {
  content: "";
  min-width: 18px;
  height: 1px;
  flex: 1 1 auto;
  background: rgba(24, 57, 0, .12);
}

.nav {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #405044;
  font-size: 14px;
}

.nav:hover {
  background: rgba(255, 255, 255, .66);
  color: var(--rail);
}

.nav.active {
  position: relative;
  background: var(--surface-strong);
  color: var(--rail);
  box-shadow: 0 6px 16px rgba(24, 57, 0, .1);
}

.nav.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: var(--brand);
}

.nav-sublist {
  border-left-color: rgba(55, 104, 2, .18);
}

.nav-sub {
  color: #516358;
}

.nav-sub:hover {
  background: rgba(255, 255, 255, .58);
  color: var(--rail);
}

.nav-sub.active {
  border-color: rgba(55, 104, 2, .18);
  background: rgba(255, 255, 255, .72);
  color: var(--rail);
}

.workspace {
  max-width: none;
  padding: 22px 28px 34px;
  background: var(--admin-workspace-bg);
}

.topbar {
  min-height: 58px;
  margin: -22px -28px 20px;
  border-bottom: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}

.operator-card {
  min-height: 36px;
  border-color: var(--admin-line);
  background: var(--surface-strong);
  box-shadow: none;
}

.workspace-head {
  margin-bottom: 16px;
}

.workspace-head h1 {
  font-size: 26px;
  line-height: 1.2;
}

.data-panel,
.detail-panel,
.empty-state,
.filter-bar,
.workbench-hero,
.workbench-revenue-overview,
.workbench-panel,
.workbench-kpi,
.sales-metric-card {
  border-color: var(--admin-line);
  border-radius: 10px;
  background: var(--admin-panel);
  box-shadow: var(--admin-shadow);
}

.section-grid,
.inventory-workbench,
.workbench-shell {
  gap: 14px;
}

[data-view="admin"][data-section="workbench"] .workspace {
  padding-top: 18px;
}

.workbench-hero {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  background: var(--admin-panel);
}

/* 工作台收益概览只读展示经营估算，不承载支付、退款或分账写操作。 */
.workbench-revenue-overview {
  min-height: 72px;
  display: grid;
  align-items: stretch;
  padding: 12px 18px;
  background: var(--admin-panel);
}

.workbench-revenue-grid {
  display: flex;
  align-items: center;
  min-width: 0;
}

.workbench-revenue-item {
  position: relative;
  min-width: 0;
  flex: 1 1 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 24px;
  color: var(--admin-text);
}

.workbench-revenue-item + .workbench-revenue-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: var(--admin-line);
}

.workbench-revenue-label,
.workbench-revenue-meta,
.workbench-revenue-trend {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-revenue-label {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
}

.workbench-revenue-item strong {
  overflow: hidden;
  color: var(--admin-text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.workbench-revenue-meta,
.workbench-revenue-trend {
  color: var(--admin-muted);
  font-size: 11px;
}

/* 今日销售额对比昨天只改变文字颜色，不改变金额口径或触发任何资金动作。 */
.workbench-revenue-trend {
  font-weight: 850;
}

.workbench-revenue-trend.up {
  color: #2f7d32;
}

.workbench-revenue-trend.down {
  color: var(--admin-danger);
}

.workbench-revenue-trend.neutral {
  color: var(--admin-muted);
}

.workbench-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--admin-amber);
  font-size: 12px;
  font-weight: 850;
}

.workbench-hero h2,
.workbench-panel h2 {
  font-size: 18px;
  line-height: 1.25;
}

.workbench-hero p {
  margin-top: 6px;
  color: var(--admin-muted);
  font-size: 13px;
}

.workbench-hero p strong {
  color: var(--admin-danger);
  font-size: 16px;
}

.workbench-control-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workbench-control-actions button {
  min-height: 34px;
  border-color: rgba(55, 104, 2, .2);
  border-radius: 8px;
  background: #f2f7f3;
  color: var(--admin-rail);
  letter-spacing: 0;
}

.workbench-control-actions button:first-child {
  border-color: rgba(183, 53, 45, .24);
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.workbench-kpis {
  gap: 12px;
}

.workbench-kpi {
  min-height: 96px;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
}

.workbench-kpi span {
  color: var(--admin-muted);
  font-size: 13px;
}

.workbench-kpi strong {
  font-size: 30px;
}

.workbench-kpi strong em {
  color: var(--admin-muted);
  font-size: 12px;
}

.kpi-mark {
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--admin-panel-soft);
}

.workbench-main-grid {
  grid-template-columns: minmax(280px, 1.08fr) minmax(280px, .96fr) minmax(260px, .82fr);
  gap: 14px;
}

.workbench-panel-head {
  min-height: 48px;
  padding: 0 16px;
}

.workbench-link {
  min-height: 30px;
  color: #557b1d;
  letter-spacing: 0;
}

.workbench-list,
.workbench-timeline,
.workbench-risk-list {
  display: grid;
  gap: 6px;
  padding: 12px 14px 14px;
}

.workbench-todo-item,
.activity-item,
.workbench-risk-item {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.workbench-todo-item:hover,
.activity-item:hover,
.workbench-kpi:hover,
.workbench-risk-item:hover {
  border-color: rgba(55, 104, 2, .14);
  background: #f7f8f7;
}

.workbench-todo-item strong,
.activity-item strong,
.workbench-risk-item strong {
  font-size: 14px;
}

.workbench-todo-item small,
.activity-item small,
.workbench-risk-item small {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 12px;
}

.workbench-todo-item em {
  background: var(--admin-amber-soft);
  color: #8a4f20;
  font-size: 12px;
}

.workbench-risk-item {
  width: 100%;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--admin-text);
  text-align: left;
}

.risk-severity-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--admin-danger);
  box-shadow: 0 0 0 4px rgba(183, 53, 45, .12);
}

.workbench-risk-copy {
  min-width: 0;
}

.workbench-risk-copy strong,
.workbench-risk-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-risk-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.workbench-risk-meta em,
.workbench-risk-meta b {
  max-width: 120px;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
}

.workbench-risk-meta em {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
  font-style: normal;
}

.workbench-risk-meta b {
  background: #edf2ef;
  color: #526058;
}

/* 首页以成果、趋势、风险和今日关注形成单向阅读顺序。 */
.workbench-overview {
  display: grid;
  gap: 14px;
}

.workbench-status-row {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2px;
}

.workbench-heading-status {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
}

.workbench-heading-status strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--admin-text);
  font-size: 13px;
}

.workbench-heading-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f7d32;
}

.workbench-heading-status.warning i {
  background: #986021;
}

.workbench-heading-status.danger i {
  background: var(--admin-danger);
}

.workbench-heading-status small {
  color: var(--admin-muted);
  font-size: 11px;
}

.workbench-result-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: var(--admin-panel);
  box-shadow: var(--admin-shadow);
}

.workbench-result-metric {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 18px;
}

.workbench-result-metric + .workbench-result-metric {
  border-left: 1px solid var(--admin-line);
}

.workbench-result-label,
.workbench-result-meta {
  overflow-wrap: anywhere;
  color: var(--admin-muted);
  font-size: 11px;
}

.workbench-result-metric strong {
  overflow-wrap: anywhere;
  color: var(--admin-text);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.workbench-result-metric.accent strong {
  color: #b65b3f;
}

.workbench-result-metric.success strong,
.workbench-result-meta.up {
  color: #2f7d32;
}

.workbench-result-metric.danger strong,
.workbench-result-meta.down {
  color: var(--admin-danger);
}

.workbench-result-meta {
  font-weight: 750;
}

.workbench-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 14px;
}

.workbench-span-two {
  grid-column: 1 / -1;
}

.workbench-trend-panel-head {
  min-height: 66px;
  align-items: center;
  gap: 24px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.workbench-trend-heading,
.workbench-trend-selection {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workbench-trend-heading h2,
.workbench-trend-heading p {
  margin: 0;
}

.workbench-trend-heading p,
.workbench-trend-selection span {
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.45;
}

.workbench-trend-selection {
  flex: 0 0 auto;
  justify-items: end;
  text-align: right;
}

.workbench-trend-selection strong {
  max-width: 180px;
  overflow-wrap: anywhere;
  color: var(--rail);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.workbench-chart-body {
  padding: 2px 18px 12px;
}

.workbench-sales-chart {
  min-width: 0;
}

.workbench-trend-canvas {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.workbench-frappe-chart {
  width: 100%;
  height: 180px;
  min-height: 180px;
}

.workbench-frappe-chart .chart-container,
.workbench-frappe-chart .frappe-chart,
.workbench-frappe-chart .graphics {
  width: 100%;
  height: 100% !important;
  min-height: 180px;
}

.workbench-frappe-chart .chart-container {
  padding: 0 !important;
  font-family: inherit;
}

.workbench-frappe-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.workbench-frappe-chart .chart-container .title,
.workbench-frappe-chart .chart-container .sub-title,
.workbench-frappe-chart .chart-container .chart-stats,
.workbench-frappe-chart .chart-container .x.axis,
.workbench-frappe-chart .chart-container .y.axis text,
.workbench-frappe-chart .chart-container .y-markers {
  display: none;
}

.workbench-frappe-chart .chart-container .y.axis line {
  stroke: var(--admin-line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.workbench-frappe-chart .chart-container .line-graph-path {
  fill: none !important;
  stroke: var(--brand) !important;
  stroke-width: 2.5px !important;
  vector-effect: non-scaling-stroke;
}

.workbench-frappe-chart .chart-container .dataset-units circle {
  fill: var(--admin-panel) !important;
  stroke: var(--brand) !important;
  stroke-width: 2px !important;
  cursor: pointer;
  transform: scale(1);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    fill var(--motion-fast) var(--motion-ease-standard),
    transform var(--motion-fast) var(--motion-ease-out);
}

.workbench-frappe-chart .chart-container .dataset-units circle:hover,
.workbench-frappe-chart .chart-container .dataset-units circle.workbench-trend-point-active {
  fill: var(--brand) !important;
  transform: scale(1.4);
}

.workbench-frappe-chart .graph-svg-tip {
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: var(--admin-panel);
  box-shadow: 0 8px 24px rgba(19, 32, 27, .14);
  color: var(--admin-muted);
}

.workbench-frappe-chart .graph-svg-tip strong,
.workbench-frappe-chart .graph-svg-tip .title {
  color: var(--rail);
}

.workbench-frappe-chart .graph-svg-tip .svg-pointer {
  border-top-color: var(--admin-panel);
}

.workbench-frappe-chart-fallback {
  display: grid;
  place-items: center;
  color: var(--admin-muted);
  font-size: 13px;
}

.workbench-trend-dates {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  box-sizing: border-box;
  margin-top: 2px;
}

.workbench-trend-date {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 2px;
  background: transparent;
  color: var(--admin-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.workbench-trend-date:hover,
.workbench-trend-date:focus-visible {
  background: #f7f8f7;
  color: var(--rail);
}

.workbench-trend-date.active {
  color: var(--rail);
  font-weight: 800;
}

.workbench-overview-risks .workbench-risk-list,
.workbench-management-list {
  padding-top: 4px;
  padding-bottom: 4px;
}

.workbench-management-list {
  display: grid;
  padding-right: 14px;
  padding-left: 14px;
}

.workbench-management-item {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 12px;
  border-bottom: 1px solid var(--admin-line);
}

.workbench-management-item:last-child {
  border-bottom: 0;
}

.workbench-management-item span {
  color: var(--admin-muted);
  font-size: 12px;
}

.workbench-management-item strong {
  grid-column: 2;
  justify-self: end;
  width: 100%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.workbench-management-item small {
  grid-column: 2;
  justify-self: end;
  width: 100%;
  color: #2f7d32;
  font-size: 10px;
  font-weight: 750;
  text-align: right;
}

.workbench-management-item.danger small {
  color: var(--admin-danger);
}

.workbench-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workbench-focus-grid > .workbench-empty {
  grid-column: 1 / -1;
}

.workbench-focus-item {
  min-width: 0;
  min-height: 80px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--admin-line);
  padding: 12px 16px;
  background: transparent;
  color: var(--admin-text);
  text-align: left;
}

.workbench-focus-item:last-child {
  border-right: 0;
}

.workbench-focus-item:hover {
  background: #f7f8f7;
}

.workbench-focus-item > span:first-child {
  color: #b65b3f;
  font-size: 16px;
  font-weight: 850;
}

.workbench-focus-item strong,
.workbench-focus-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-focus-item strong {
  font-size: 13px;
}

.workbench-focus-item small {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 11px;
}

.filter-bar {
  padding: 14px;
}

table th,
table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.detail-modal-backdrop,
.editor-backdrop,
.confirm-modal-backdrop {
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-modal,
.editor-modal,
.confirm-modal {
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: 0 24px 64px rgba(31, 55, 39, .2);
}

.detail-modal {
  width: min(880px, calc(100vw - 48px));
}

.detail-modal-wide .detail-modal,
.editor-modal {
  width: min(1040px, calc(100vw - 48px));
}

.toast {
  right: auto;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
}

@media (max-width: 1180px) {
  .workbench-main-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr);
  }

  .workbench-risk-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 18px;
  }

  .workbench-hero,
  .workbench-revenue-overview,
  .workbench-control-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .workbench-main-grid,
  .workbench-revenue-grid {
    grid-template-columns: 1fr;
  }

  .workbench-revenue-grid,
  .workbench-revenue-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .workbench-revenue-item {
    width: 100%;
    padding: 10px 0;
  }

  .workbench-revenue-item + .workbench-revenue-item::before {
    top: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 1px;
  }
}

/* 第二切片核心列表页覆盖层：统一商品和订单列表的扫描效率，不改变现有数据流。 */
[data-view="admin"]:not([data-section="workbench"]) .section-grid,
[data-view="admin"]:not([data-section="workbench"]) .inventory-workbench {
  gap: 14px;
}

[data-view="admin"]:not([data-section="workbench"]) .data-panel {
  overflow: hidden;
  border-radius: 10px;
}

[data-view="admin"]:not([data-section="workbench"]) .panel-head {
  min-height: 54px;
  align-items: center;
  padding: 12px 16px;
  background: var(--admin-panel);
}

[data-view="admin"]:not([data-section="workbench"]) .panel-head h2 {
  font-size: 17px;
}

[data-view="admin"]:not([data-section="workbench"]) .panel-head p {
  max-width: 760px;
  margin-top: 3px;
  font-size: 12px;
}

.filter-bar.compact-filter-bar,
.fulfillment-filter,
.funds-filter-bar {
  border-color: var(--admin-line);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.filter-bar.compact-filter-bar label,
.funds-filter-field {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
}

.system-pill {
  border-color: var(--admin-line);
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.filter-bar.compact-filter-bar {
  min-height: 54px;
  margin: 0;
  padding: 10px 12px;
}

.filter-bar.compact-filter-bar input,
.filter-bar.compact-filter-bar select,
.fulfillment-filter input,
.fulfillment-filter select {
  min-height: 34px;
  border-color: var(--admin-line);
  background-color: var(--surface-strong);
}

.table-wrap {
  border-top: 1px solid var(--admin-line);
  background: var(--surface-strong);
}

.data-panel > .table-wrap > table {
  min-width: 960px;
}

th,
td {
  height: 46px;
  padding: 10px 14px;
}

th {
  background: #f7f8f7;
  color: #526058;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 850;
}

td {
  color: var(--admin-text);
  font-size: 13px;
}

tbody tr:hover td {
  background: #f7f8f7;
}

.status-badge {
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
}

.product-table-wrap {
  overflow-x: auto;
}

.product-table {
  min-width: 860px;
}

.product-table th,
.product-table td {
  height: 64px;
  padding: 10px 14px;
}

.product-table th:nth-child(1) { width: 44%; }
.product-table th:nth-child(2) { width: 150px; }
.product-table th:nth-child(4) { width: 116px; }

.product-cell {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.product-cell strong {
  font-size: 14px;
}

.product-cell span,
.product-cell em {
  font-size: 12px;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.row-actions {
  gap: 6px;
}

td:last-child button,
.row-actions button {
  min-width: 76px;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  letter-spacing: 0;
}

.sales-metric-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.sales-metric-card {
  min-height: 102px;
  border-radius: 10px;
  padding: 16px;
}

.sales-metric-card strong {
  font-size: 30px;
}

.sales-metric-mark {
  right: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--admin-panel-soft);
}

.audit-filter,
.funds-filter-bar {
  margin-bottom: 14px;
}

@media (max-width: 1180px) {
  .funds-filter-bar {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .data-panel > .table-wrap > table {
    min-width: 920px;
  }
}

/* 第三切片中心操作弹窗：替代浏览器原生 prompt/confirm，并保留单笔危险操作的确认边界。 */
.action-dialog-open {
  overflow: hidden;
}

.admin-action-dialog {
  width: min(520px, calc(100vw - 32px));
}

.admin-action-dialog[data-tone="danger"] {
  border-color: rgba(183, 53, 45, .28);
}

.admin-action-dialog-copy {
  display: grid;
  gap: 8px;
}

.admin-action-dialog-copy p {
  margin: 0;
  color: var(--admin-muted);
  line-height: 1.6;
}

.admin-action-dialog-fields {
  display: grid;
  gap: 12px;
}

.admin-action-dialog-fields label {
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 850;
}

.admin-action-dialog-fields textarea,
.admin-action-dialog-fields input {
  border-color: var(--admin-line);
  background: var(--surface-strong);
}

.admin-action-dialog-fields textarea {
  min-height: 104px;
}

.admin-action-dialog-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--admin-danger);
  font-size: 12px;
  font-weight: 800;
}

/* 第四切片详情/编辑页覆盖层：只统一中心弹窗内部信息层级，不改变字段、接口或资金操作边界。 */
.detail-modal,
.editor-modal {
  border: 1px solid var(--admin-line);
  background: var(--admin-panel);
  box-shadow: 0 28px 72px rgba(31, 55, 39, .2);
}

.detail-modal {
  width: min(900px, calc(100vw - 48px));
}

.detail-modal-wide .detail-modal,
.editor-modal {
  width: min(1080px, calc(100vw - 48px));
}

.editor-window-bar {
  min-height: 44px;
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-panel-soft);
}

.detail-modal-body,
.editor-scroll-body {
  min-width: 0;
  padding: 0 22px 22px;
  background: var(--admin-panel);
  scrollbar-gutter: stable;
}

.editor-scroll-body {
  display: grid;
  gap: 14px;
}

.detail-modal-body .detail-head,
.editor-scroll-body .product-editor-head {
  margin: 0 -22px 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-panel);
}

.detail-modal-body .detail-head h2,
.editor-scroll-body .product-editor-head h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.detail-modal-body .detail-head p,
.editor-scroll-body .product-editor-head p {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 12px;
}

.detail-modal-body .detail-section,
.editor-scroll-body .detail-section {
  min-width: 0;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.detail-modal-body .detail-section:first-child,
.editor-scroll-body .detail-section:first-child {
  margin-top: 0;
}

.detail-modal-body .detail-section > h2,
.editor-scroll-body .detail-section > h2,
.editor-scroll-body .sku-editor-head h2,
.detail-modal-body .sales-qr-heading h2,
.editor-scroll-body .sales-qr-heading h2 {
  margin: 0 0 12px;
  color: var(--admin-text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.detail-modal-body .detail-list,
.editor-scroll-body .detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.detail-modal-body .detail-row,
.editor-scroll-body .detail-row {
  display: grid;
  grid-template-columns: minmax(96px, .34fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px dashed var(--admin-line);
}

.detail-modal-body .detail-row:last-child,
.editor-scroll-body .detail-row:last-child {
  border-bottom: 0;
}

.detail-modal-body .detail-row span:first-child,
.editor-scroll-body .detail-row span:first-child {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-modal-body .detail-row span:last-child,
.editor-scroll-body .detail-row span:last-child {
  min-width: 0;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-modal-body .detail-card,
.editor-scroll-body .detail-card,
.detail-modal-body .stock-sku-field,
.editor-scroll-body .stock-sku-field,
.detail-modal-body .sales-qr-panel,
.editor-scroll-body .sales-qr-panel {
  border-color: var(--admin-line);
  border-radius: 10px;
  background: var(--admin-panel-soft);
}

.detail-modal-body .timeline-wrap,
.editor-scroll-body .timeline-wrap {
  display: grid;
  gap: 10px;
  padding: 4px 0 0;
}

.detail-modal-body .timeline-wrap::before,
.editor-scroll-body .timeline-wrap::before {
  display: none;
}

.detail-modal-body .timeline-item,
.editor-scroll-body .timeline-item {
  display: grid;
  grid-template-columns: 126px 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.detail-modal-body .timeline-meta,
.editor-scroll-body .timeline-meta {
  color: var(--admin-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.detail-modal-body .timeline-marker,
.editor-scroll-body .timeline-marker {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 2px solid #d97757;
  border-radius: 999px;
  background: #fff8ef;
  box-shadow: 0 0 0 4px rgba(217, 119, 87, .12);
}

.detail-modal-body .timeline-content,
.editor-scroll-body .timeline-content {
  min-width: 0;
  padding: 12px 14px;
  border-color: var(--admin-line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.detail-modal-body .timeline-head,
.editor-scroll-body .timeline-head {
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 900;
}

.detail-modal-body .timeline-body,
.editor-scroll-body .timeline-body {
  margin-top: 5px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.editor-scroll-body .form-grid,
.detail-modal-body .form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.editor-scroll-body .form-grid label,
.detail-modal-body .form-grid label,
.product-form-stack label {
  min-width: 0;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 850;
}

.editor-scroll-body input,
.editor-scroll-body textarea,
.editor-scroll-body select,
.detail-modal-body input,
.detail-modal-body textarea,
.detail-modal-body select {
  min-height: 36px;
  border-color: var(--admin-line);
  border-radius: 8px;
  background-color: var(--surface-strong);
  color: var(--admin-text);
}

.editor-scroll-body textarea,
.detail-modal-body textarea {
  min-height: 96px;
  resize: vertical;
}

.editor-scroll-body .image-form-grid {
  grid-template-columns: minmax(260px, .88fr) minmax(280px, 1fr);
  gap: 14px;
}

.detail-modal-body .image-slot,
.editor-scroll-body .image-slot {
  border-color: var(--admin-line);
  border-radius: 10px;
  background: var(--admin-panel-soft);
}

.detail-modal-body .image-slot-head,
.editor-scroll-body .image-slot-head {
  gap: 12px;
}

.detail-modal-body .image-preview-shell,
.editor-scroll-body .image-preview-shell,
.detail-modal-body .image-preview-card,
.editor-scroll-body .image-preview-card,
.detail-modal-body .gallery-item,
.editor-scroll-body .gallery-item {
  border-radius: 10px;
  background: var(--surface-strong);
}

.detail-modal-body .image-preview-card img,
.editor-scroll-body .image-preview-card img,
.detail-modal-body .gallery-item img,
.editor-scroll-body .gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.editor-scroll-body .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.editor-scroll-body .sku-editor-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.editor-scroll-body .product-sku-table {
  overflow-x: auto;
  /* 规格表只负责横向浏览，纵向滚轮继续交给弹窗主体。 */
  overflow-y: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.editor-scroll-body .product-sku-table table {
  min-width: 1040px;
}

.editor-scroll-body .product-sku-table th,
.editor-scroll-body .product-sku-table td {
  height: 48px;
  padding: 9px 10px;
}

.editor-scroll-body .sku-main-cell {
  min-width: 150px;
}

.editor-scroll-body .sku-packaging-field {
  min-width: 180px;
}

.editor-scroll-body .actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 14px -22px -22px;
  padding: 12px 22px;
  border-top: 1px solid var(--admin-line);
  background: var(--admin-panel);
  box-shadow: 0 -12px 28px rgba(31, 55, 39, .07);
}

.detail-modal-body .actions {
  position: static;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detail-modal-body .actions button,
.editor-scroll-body .actions button {
  min-height: 34px;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .detail-modal,
  .detail-modal-wide .detail-modal,
  .editor-modal {
    width: calc(100vw - 24px);
  }

  .detail-modal-body .detail-list,
  .editor-scroll-body .detail-list,
  .editor-scroll-body .form-grid,
  .detail-modal-body .form-grid,
  .editor-scroll-body .image-form-grid,
  .editor-scroll-body .gallery-grid {
    grid-template-columns: 1fr;
  }

  .detail-modal-body .timeline-item,
  .editor-scroll-body .timeline-item {
    grid-template-columns: 1fr;
  }

  .detail-modal-body .timeline-marker,
  .editor-scroll-body .timeline-marker {
    display: none;
  }
}

/* 商品编辑窗口自适应修正：只扩大商品编辑弹窗的可用视口，避免长表单、图片区和 SKU 表被固定弹窗裁切。 */
.editor-modal.product-editor-panel {
  width: min(1180px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 32px);
  max-height: min(920px, calc(100dvh - 32px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.editor-modal.product-editor-panel .editor-scroll-body {
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding-bottom: 18px;
}

.editor-modal.product-editor-panel .product-form-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.editor-modal.product-editor-panel .product-form-stack > .detail-section {
  margin-top: 0;
}

@media (max-width: 960px) {
  .editor-modal.product-editor-panel {
    width: calc(100vw - 24px);
    height: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

/* 第五切片审计收尾：强化操作日志详情，不改变真实权限或写入接口。 */
.audit-table {
  min-width: 1180px;
}

.audit-detail-btn {
  min-width: 58px;
  min-height: 30px;
  padding: 0 10px;
}

.audit-detail-section {
  margin-top: 12px;
}

.audit-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-detail-summary {
  margin: 0;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.7;
}

.audit-detail-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .audit-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* 第六切片全局状态收尾：统一空态、加载、错误、禁用和键盘焦点，不改变任何后台数据或接口行为。 */
.empty-state {
  min-height: 168px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1px dashed var(--admin-line);
  border-radius: 10px;
  background: var(--admin-panel);
  color: var(--admin-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--admin-text);
  font-size: 15px;
}

.empty-state span {
  max-width: 520px;
  font-size: 12px;
  line-height: 1.65;
}

.skeleton-line {
  position: relative;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e7ede9;
}

.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
  animation: adminSkeletonSweep 1.4s ease-in-out infinite;
}

.skeleton-line.short { width: 34%; }
.skeleton-line.mid { width: 56%; }
.skeleton-line.long { width: 82%; }

@keyframes adminSkeletonSweep {
  to { transform: translateX(100%); }
}

.error-state,
.login-message:not(:empty) {
  border: 1px solid rgba(186, 26, 26, .2);
  border-radius: 10px;
  background: #fff4f1;
  color: var(--admin-danger);
}

.error-state {
  padding: 18px;
}

.table-wrap {
  scrollbar-gutter: stable;
}

.table-wrap::after {
  content: "";
  display: block;
  height: 1px;
}

button:disabled,
.config-switch:disabled {
  cursor: not-allowed;
  opacity: .56;
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(217, 119, 87, .26);
  outline-offset: 2px;
}

.status-badge,
.system-pill,
.funds-pill,
.action-badge {
  white-space: nowrap;
}

/* 顶部栏已展示当前目录标题，主内容区保留 sectionTitle 给脚本同步，但不再重复显示。 */
#sectionTitle {
  display: none;
}

.erp-emergency-section {
  border-left: 3px solid var(--admin-accent, #d97757);
}

.erp-emergency-section .sku-editor-head {
  align-items: flex-start;
}

.consumer-order-table {
  min-width: 1120px;
}

.erp-detail-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
}

.erp-event-table {
  min-width: 1080px;
  table-layout: fixed;
}

.erp-return-table {
  min-width: 620px;
}

.erp-event-table th:nth-child(1),
.erp-event-table td:nth-child(1) {
  width: 220px;
}

.erp-event-table th:nth-child(2),
.erp-event-table td:nth-child(2) {
  width: 120px;
}

.erp-event-table th:nth-child(3),
.erp-event-table td:nth-child(3) {
  width: 280px;
}

.erp-event-table th:nth-child(4),
.erp-event-table td:nth-child(4) {
  width: 220px;
}

.erp-event-table th:nth-child(5),
.erp-event-table td:nth-child(5) {
  width: 150px;
  white-space: nowrap;
}

.erp-event-table th:nth-child(6),
.erp-event-table td:nth-child(6) {
  width: 90px;
}

.erp-event-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.erp-event-table .mono {
  overflow-wrap: anywhere;
}

.status-badge.manual_review,
.status-badge.dead,
.status-badge.attention_required {
  border-color: rgba(186, 26, 26, .28);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.processing,
.status-badge.retrying,
.status-badge.waiting_config {
  border-color: rgba(153, 70, 42, .34);
  background: var(--warning-soft);
  color: var(--warning);
}

.erp-emergency-section p {
  margin: 6px 0 0;
  color: var(--admin-muted, #66745d);
}

.erp-emergency-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--admin-border, #d9dfd3);
}

.erp-emergency-sku {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, auto);
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--admin-border, #d9dfd3);
}

.erp-emergency-sku > div:first-child > span {
  display: block;
  margin-top: 4px;
  color: var(--admin-muted, #66745d);
}

.erp-emergency-summary,
.erp-emergency-form {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.erp-emergency-summary span {
  display: grid;
  gap: 4px;
  color: var(--admin-muted, #66745d);
}

.erp-emergency-form label {
  min-width: 220px;
}

@media (max-width: 760px) {
  .erp-emergency-sku {
    grid-template-columns: 1fr;
  }
}

/* 当前后台交互收口：不调整页面结构，只统一公共控件、滚动区域和弹窗反馈。 */
button {
  letter-spacing: 0;
}

button:not(:disabled):hover,
button:not(:disabled):active {
  transform: none;
}

button:disabled,
.config-switch:disabled {
  pointer-events: none;
}

input::placeholder,
textarea::placeholder {
  color: #8a9484;
  opacity: 1;
}

input[readonly],
textarea[readonly],
select:disabled {
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.filter-bar,
.filter-bar.compact-filter-bar,
.fulfillment-filter,
.funds-filter-bar {
  box-shadow: none;
}

.table-wrap,
.sidebar,
.editor-scroll-body,
.detail-modal-body {
  scrollbar-color: rgba(55, 104, 2, .32) transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.editor-scroll-body::-webkit-scrollbar,
.detail-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.editor-scroll-body::-webkit-scrollbar-thumb,
.detail-modal-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(55, 104, 2, .28);
  background-clip: padding-box;
}

.table-wrap::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.editor-scroll-body::-webkit-scrollbar-track,
.detail-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap {
  /* 横向滚动留在表格内，纵向滚轮继续交给页面或弹窗。 */
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
}

.table-wrap th {
  /* 只在表头呈现分块边界，表体保持干净；真实列宽仍由同一张 table 统一计算。 */
  border-right: 1px solid var(--admin-line);
}

.table-wrap th:last-child {
  border-right: 0;
}

.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background-color var(--motion-fast) var(--motion-ease-standard);
}

tbody tr:focus-within td {
  background: #f7f8f7;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: 180px;
  min-width: 180px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
  width: 250px;
  min-width: 250px;
}

.audit-table th:last-child,
.audit-table td:last-child {
  width: 76px;
  min-width: 76px;
  white-space: nowrap;
}

.toast {
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface-strong);
  box-shadow: 0 12px 30px rgba(23, 32, 17, .16);
}

.detail-modal-backdrop,
.editor-backdrop,
.confirm-modal-backdrop {
  padding: 20px;
  background: rgba(18, 30, 13, .5);
  /* 暗色遮罩已能区分层级，无需在滚动期间全屏实时模糊。 */
  backdrop-filter: none;
}

.detail-modal,
.editor-modal,
.confirm-modal {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: 0 24px 64px rgba(18, 30, 13, .22);
}

.editor-window-bar,
.confirm-modal-head {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--surface-strong);
}

.editor-window-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 7px;
}

.detail-modal-body,
.editor-scroll-body {
  background: var(--surface-strong);
}

.detail-modal-body .detail-section,
.editor-scroll-body .detail-section {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.editor-scroll-body > .product-editor-summary-section {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.editor-scroll-body .product-sku-table th:nth-child(7),
.editor-scroll-body .product-sku-table td:nth-child(7) {
  width: 92px;
  min-width: 92px;
}

.editor-scroll-body .product-sku-table th {
  position: static;
}

.editor-scroll-body .product-sku-table td:nth-child(7) select {
  min-width: 72px;
  padding-right: 28px;
}

.confirm-modal {
  width: min(460px, calc(100vw - 32px));
}

.confirm-modal-head {
  padding: 0 18px;
}

.confirm-modal-copy,
.admin-action-dialog-copy {
  padding: 18px;
}

.admin-action-dialog-fields,
.admin-action-dialog-error {
  margin-right: 18px;
  margin-left: 18px;
}

.confirm-modal-actions {
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
}

.admin-action-dialog[data-tone="danger"] {
  border-top: 4px solid var(--danger);
}

.admin-action-dialog[data-tone="warning"] {
  border-top: 4px solid var(--warning);
}

.editor-modal.product-editor-panel > .product-editor-actions {
  position: static;
  z-index: 3;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 -10px 24px rgba(23, 32, 17, .08);
}

@media (max-width: 1400px) {
  .funds-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .funds-filter-actions {
    justify-content: flex-start;
  }

  .data-panel > .table-wrap > .product-table {
    min-width: 760px;
  }
}

@media (max-width: 1100px) {
  .funds-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .funds-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .confirm-modal-actions button {
    width: 100%;
  }
}

.detail-modal-body .sales-qr-panel {
  border-radius: 8px;
}

@media (max-width: 760px) {
  .sales-qr-panel {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px 18px;
  }

  .sales-qr-preview,
  .sales-qr-placeholder {
    width: 132px;
    height: 132px;
  }

  .sales-qr-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .sales-qr-panel {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .sales-qr-meta {
    justify-items: center;
  }

  .sales-qr-actions {
    grid-column: auto;
    justify-content: center;
  }
}

.consumer-order-table th:last-child,
.table-wrap td.admin-row-action-cell {
  width: 128px;
  min-width: 128px;
  overflow: visible;
  text-align: left;
}

/* 售后退款编号保持紧凑，把主要阅读空间留给原因，并让操作表头与按钮共用中心线。 */
.data-panel > .table-wrap > .refund-table {
  min-width: 960px;
  table-layout: fixed;
}

.refund-table th:first-child,
.refund-table td:first-child {
  width: 250px;
}

.refund-table th:nth-child(2),
.refund-table td:nth-child(2) {
  width: 178px;
}

.refund-table th:nth-child(3),
.refund-table td:nth-child(3) {
  width: 116px;
}

.refund-table th:nth-child(4),
.refund-table td:nth-child(4) {
  width: 90px;
}

.refund-table th:nth-child(6),
.refund-table td:nth-child(6) {
  width: 152px;
}

.refund-table th:last-child,
.refund-table td.admin-row-action-cell {
  width: 96px;
  min-width: 96px;
  text-align: center;
}

.refund-table-identifier {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refund-table .admin-row-action-direct {
  width: 100%;
  justify-content: center;
}

.admin-row-action-menu {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.admin-row-action-menu[open] {
  z-index: 30;
}

.admin-row-action-trigger {
  display: inline-flex;
  min-width: 64px;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  list-style: none;
  text-align: left;
  white-space: nowrap;
  transition:
    background var(--motion-fast) var(--motion-ease-standard),
    color var(--motion-fast) var(--motion-ease-standard);
}

.admin-row-action-trigger::-webkit-details-marker {
  display: none;
}

.admin-row-action-trigger:hover,
.admin-row-action-menu[open] > .admin-row-action-trigger {
  background: var(--surface-soft);
  color: var(--brand);
}

.admin-row-action-trigger:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.admin-row-action-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--motion-fast) var(--motion-ease-out);
}

.admin-row-action-menu[open] .admin-row-action-chevron {
  transform: rotate(180deg);
}

.admin-row-action-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  /* details 会先展开、再触发定位事件；定位完成前隐藏可避免默认位置闪现。 */
  visibility: hidden;
  min-width: 88px;
  width: max-content;
  max-width: 220px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-row-action-popover.is-fixed {
  position: fixed;
  z-index: 80;
  visibility: visible;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}

table tbody tr:nth-last-child(-n+2) .admin-row-action-popover {
  top: auto;
  bottom: calc(100% + 6px);
}

.admin-row-action-item {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.admin-row-action-item:hover,
.admin-row-action-item:focus-visible {
  background: var(--surface-soft);
  color: var(--brand);
  transform: none;
}

.admin-row-action-item.danger {
  display: flex;
  border: 0;
  background: transparent;
  color: var(--danger);
}

.admin-row-action-item.danger:hover,
.admin-row-action-item.danger:focus-visible {
  background: var(--danger-soft);
  color: var(--danger);
}

/* 商品列表直接展开规格，商品资料与规格维护保持两个清晰入口。 */
.product-row-toggle {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.product-row-toggle:hover {
  background: transparent;
}

.product-row-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.product-row-toggle .product-cell-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: visible;
  white-space: normal;
}

.product-list-row.is-expanded > td {
  border-bottom-color: transparent;
  background: #f2f7f3;
}

.product-list-row > td:not(.admin-row-action-cell) {
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-ease-standard);
}

.product-list-row:hover > td:not(.admin-row-action-cell) {
  background: #f5f8f6;
}

.product-list-row.is-expanded:hover > td:not(.admin-row-action-cell) {
  background: #f2f7f3;
}

.product-sku-detail-row > td {
  height: auto;
  padding: 0;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.product-sku-detail-row:hover > td {
  background: var(--surface-soft);
}

.product-sku-panel {
  min-width: 0;
  padding: 18px 20px 20px;
}

.product-sku-panel-head,
.product-sku-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-sku-panel-head {
  margin-bottom: 12px;
}

.product-sku-panel-head h3,
.product-sku-editor-summary h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.product-sku-panel-head p,
.product-sku-editor-summary p,
.initial-sku-section .sku-editor-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.product-sku-panel-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-sku-panel-table table {
  min-width: 860px;
  table-layout: fixed;
}

.product-sku-panel-table th,
.product-sku-panel-table td {
  height: 58px;
  padding: 10px 12px;
  vertical-align: middle;
}

.product-sku-panel-table th {
  line-height: 1.35;
  white-space: normal;
}

.product-sku-panel-table th:nth-child(1) { width: 17%; }
.product-sku-panel-table th:nth-child(2) { width: 10%; }
.product-sku-panel-table th:nth-child(3) { width: 8%; }
.product-sku-panel-table th:nth-child(4) { width: 10%; }
.product-sku-panel-table th:nth-child(5) { width: 12%; }
.product-sku-panel-table th:nth-child(6) { width: 14%; }
.product-sku-panel-table th:nth-child(7) { width: 11%; }
.product-sku-panel-table th:nth-child(8) { width: 8%; }
.product-sku-panel-table th:nth-child(9) { width: 10%; }

.product-sku-panel-table th:last-child,
.product-sku-panel-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -10px 0 18px rgba(23, 32, 17, .06);
}

.product-sku-panel-table th:last-child {
  z-index: 2;
  background: var(--surface-soft);
}

.product-sku-panel-table td:first-child strong,
.product-sku-code {
  display: block;
}

.product-sku-code {
  margin-top: 3px;
  color: var(--muted);
}

.product-sku-edit {
  min-width: 84px;
  white-space: nowrap;
}

.product-sku-empty {
  height: 82px !important;
  color: var(--muted);
  text-align: center;
}

.product-sku-panel-loading,
.product-sku-panel-error {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.product-sku-panel-error {
  flex-direction: column;
  text-align: center;
}

.product-sku-panel .erp-emergency-section {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--admin-accent, #d97757);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.initial-sku-section .sku-editor-head {
  align-items: flex-start;
}

.sku-form-grid {
  margin-top: 14px;
}

.sku-stock-preview-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.sku-stock-preview-field > strong {
  flex: 0 0 auto;
}

.home-carousel-form {
  display: grid;
  min-width: 0;
}

.home-carousel-list {
  display: grid;
  min-width: 0;
}

.home-carousel-row {
  display: grid;
  grid-template-columns: 96px minmax(240px, 1fr) 96px 72px minmax(220px, auto);
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.home-carousel-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.home-carousel-row select,
.home-carousel-row input[type="number"] {
  width: 100%;
  min-width: 0;
}

.home-carousel-preview {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 96px;
}

.home-carousel-preview img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.home-carousel-preview span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.home-carousel-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  white-space: nowrap;
}

.home-carousel-enabled input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.home-carousel-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.home-carousel-row-actions button {
  min-width: 74px;
}

.home-carousel-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.home-carousel-save-bar {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: var(--surface-soft);
}

.sku-cover-field {
  margin-top: 2px;
}

.sku-cover-field .image-preview-shell {
  min-height: 164px;
}

.sku-cover-field .image-preview-card img,
.editor-scroll-body .sku-cover-field .image-preview-card img {
  height: 150px;
  aspect-ratio: auto;
  object-fit: contain;
}

.editor-modal.sku-editor-modal {
  width: min(780px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
}

.sku-editor-modal .editor-scroll-body {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.sku-editor-modal #skuForm {
  margin-top: 18px;
}

.sku-editor-modal > .product-editor-actions {
  position: static;
  justify-content: flex-end;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  background: var(--surface);
  box-shadow: 0 -10px 24px rgba(23, 32, 17, .08);
}

@media (max-width: 760px) {
  .home-carousel-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 12px;
  }

  .home-carousel-preview {
    grid-row: span 4;
    width: 84px;
  }

  .home-carousel-row > label:not(.home-carousel-sku-field),
  .home-carousel-row-actions {
    grid-column: 2;
  }

  .home-carousel-row-actions {
    justify-content: flex-start;
  }

  .home-carousel-row-actions button {
    flex: 1 1 132px;
  }

  .product-table-wrap {
    overflow: visible;
  }

  .product-list-panel > .product-table-wrap > .product-table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .product-table > thead {
    display: none;
  }

  .product-table > tbody,
  .product-table > tbody > tr,
  .product-table > tbody > tr > td {
    display: block;
    width: 100%;
  }

  .product-table > tbody {
    max-width: 100%;
  }

  .product-table > tbody > .product-list-row {
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .product-table > tbody > .product-list-row > td {
    height: auto;
    border: 0;
    padding: 6px 0;
  }

  .product-table > tbody > .product-list-row > td:nth-child(n + 2):nth-child(-n + 3) {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .product-table > tbody > .product-list-row > td:nth-child(2)::before { content: "商品编码"; }
  .product-table > tbody > .product-list-row > td:nth-child(3)::before { content: "库存状态"; }

  .product-table > tbody > .product-list-row > td:nth-child(n + 2):nth-child(-n + 3)::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }

  .product-table > tbody > .product-list-row .mono {
    overflow-wrap: anywhere;
  }

  .product-table > tbody > .product-list-row > .admin-row-action-cell {
    display: flex;
    justify-content: flex-end;
  }

  .product-sku-detail-row > td {
    display: block;
    width: 100%;
  }

  .product-sku-panel {
    padding: 14px 12px 16px;
  }

  .product-sku-panel-head,
  .product-sku-editor-summary {
    align-items: flex-start;
  }

  .product-sku-panel-head {
    flex-direction: column;
  }

  .product-sku-panel-head button {
    width: 100%;
  }

  .product-sku-panel-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .product-sku-panel-table table {
    min-width: 0;
    table-layout: auto;
  }

  .product-sku-panel-table thead {
    display: none;
  }

  .product-sku-panel-table tbody {
    display: grid;
    gap: 10px;
  }

  .product-sku-panel-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 14px;
    background: var(--surface);
  }

  .product-sku-panel-table td {
    display: grid;
    align-content: start;
    gap: 5px;
    height: auto;
    min-width: 0;
    border: 0;
    padding: 0;
  }

  .product-sku-panel-table td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
  }

  .product-sku-panel-table td:nth-child(1),
  .product-sku-panel-table td:nth-child(6),
  .product-sku-panel-table td:last-child {
    grid-column: 1 / -1;
  }

  .product-sku-panel-table td:nth-child(1)::before { content: "规格"; }
  .product-sku-panel-table td:nth-child(2)::before { content: "每规格瓶数"; }
  .product-sku-panel-table td:nth-child(3)::before { content: "标签"; }
  .product-sku-panel-table td:nth-child(4)::before { content: "销售价"; }
  .product-sku-panel-table td:nth-child(5)::before { content: "本地备用库存"; }
  .product-sku-panel-table td:nth-child(6)::before { content: "ERP 可售库存"; }
  .product-sku-panel-table td:nth-child(7)::before { content: "本地状态"; }
  .product-sku-panel-table td:nth-child(8)::before { content: "状态"; }

  .product-sku-panel-table th:last-child,
  .product-sku-panel-table td:last-child {
    position: static;
    border-left: 0;
    box-shadow: none;
  }

  .product-sku-edit {
    width: 100%;
  }

  .product-sku-empty {
    grid-column: 1 / -1;
  }

  .editor-modal.sku-editor-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .sku-editor-modal .sku-form-grid {
    grid-template-columns: 1fr;
  }
}

/* 全局核查修复：统一响应式导航、列表可操作性和查看详情的信息层级。 */
.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}

.sidebar-toggle .admin-icon {
  width: 20px;
  height: 20px;
}

.sidebar-backdrop {
  display: none;
}

.admin-row-action-direct {
  display: inline-flex;
  align-items: center;
}

.admin-row-action-button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 8px;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-row-action-button:hover,
.admin-row-action-button:focus-visible {
  background: var(--surface-soft);
  color: var(--rail);
}

.admin-row-action-button.danger {
  color: var(--danger);
}

.product-list-panel {
  min-height: 0;
}

.fulfillment-filter {
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, .7fr) minmax(260px, 1.4fr) auto;
  align-items: center;
}

.admin-list-filter button {
  min-height: 40px;
  white-space: nowrap;
}

.data-refresh-button {
  min-width: 96px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.fulfillment-filter .system-pill {
  min-width: 0;
  min-height: 34px;
  height: auto;
  justify-content: flex-start;
  padding: 8px 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.consumer-order-table .status-badge.paid,
.detail-summary .status-badge.paid[data-group="consumer-order"] {
  border-color: rgba(180, 83, 9, .28);
  background: var(--warning-soft);
  color: var(--warning);
}

/* 状态密集页面只保留语义色文字和圆点，内部表面统一使用中性灰白。 */
.filter-bar,
.filter-bar.compact-filter-bar,
.fulfillment-filter,
.funds-filter-bar {
  border-color: var(--admin-line);
  background: var(--surface-strong);
}

.system-pill:not(.danger):not(.warn),
.status-badge,
.status-badge[class],
.funds-pill,
.funds-pill[class] {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.data-panel > .filter-bar,
.data-panel > .funds-filter-bar {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  border-radius: 0;
}

.data-panel > .filter-bar + .table-wrap,
.data-panel > .funds-filter-bar + .table-wrap {
  border-top: 0;
}

.detail-modal-compact .detail-modal {
  width: min(620px, calc(100vw - 48px));
}

.detail-modal-standard .detail-modal {
  width: min(820px, calc(100vw - 48px));
}

.detail-modal-wide .detail-modal {
  width: min(1040px, calc(100vw - 48px));
}

.detail-modal-body .detail-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -22px 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.detail-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-summary > div > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-actions,
.detail-section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-actions button,
.detail-section-actions button {
  min-height: 36px;
  border-radius: 7px;
}

.detail-notice {
  margin: 12px 0 0;
  border-left: 3px solid var(--warning);
  padding: 9px 11px;
  background: var(--warning-soft);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.detail-modal-body .detail-section .mono.muted,
.detail-modal-body .detail-row .mono.muted {
  font-size: 11px;
}

@media (min-width: 961px) and (max-width: 1280px) {
  .admin-layout {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .workspace {
    padding: 0 22px 28px;
  }

  .topbar {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .workbench-result-metric {
    padding-right: 14px;
    padding-left: 14px;
  }

  .workbench-result-label,
  .workbench-result-meta,
  .workbench-result-metric strong {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .workspace-head h1 {
    font-size: 30px;
  }

  .fulfillment-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fulfillment-filter .system-pill {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  body.admin-sidebar-open {
    overflow: hidden;
  }

  .admin-layout {
    display: block;
    position: relative;
  }

  .sidebar {
    position: fixed;
    z-index: 72;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(284px, calc(100vw - 48px));
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 24px 16px 18px;
    box-shadow: 18px 0 40px rgba(18, 30, 13, .24);
    transform: translateX(-105%);
    transition: transform var(--motion-base) var(--motion-ease-out);
  }

  .admin-layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 71;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(18, 30, 13, .5);
    box-shadow: none;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .side-brand {
    margin-bottom: 20px;
  }

  .nav-list,
  .nav-group,
  .nav-sublist {
    display: grid;
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  .nav-list {
    gap: 8px;
    padding: 0;
  }

  .nav-list::after {
    display: none;
  }

  .nav-group {
    gap: 5px;
  }

  .nav-sublist {
    gap: 5px;
    margin: 0 0 4px 14px;
    border-left: 1px solid rgba(193, 236, 159, .2);
    padding-left: 10px;
  }

  .nav,
  .nav-sub {
    width: 100%;
  }

  .topbar {
    min-height: 60px;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 10px 14px;
  }

  .topbar-title {
    flex: 1 1 auto;
  }

  .topbar-title strong {
    font-size: 18px;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .workbench-overview-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workbench-span-two {
    grid-column: auto;
  }

  .workbench-result-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-result-metric + .workbench-result-metric {
    border-left: 0;
  }

  .workbench-result-metric:nth-child(even) {
    border-left: 1px solid var(--admin-line);
  }

  .workbench-result-metric:nth-child(n + 3) {
    border-top: 1px solid var(--admin-line);
  }

  .fulfillment-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .fulfillment-filter .system-pill {
    grid-column: auto;
  }

  .data-panel > .table-wrap > table:not(.product-table) {
    min-width: 760px;
  }

  .consumer-order-table th:first-child,
  .consumer-order-table td:first-child {
    width: 156px;
    min-width: 156px;
  }

  .consumer-order-table th:nth-child(4),
  .consumer-order-table td:nth-child(4) {
    width: 180px;
    min-width: 180px;
  }

  .consumer-order-table th:nth-child(5),
  .consumer-order-table td:nth-child(5) {
    width: 88px;
    min-width: 88px;
  }

  .consumer-order-table td:first-child .mono {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .table-wrap table:has(td.admin-row-action-cell) th:last-child {
    position: sticky;
    z-index: 3;
    right: 0;
    background: var(--surface-soft);
  }

  .table-wrap td.admin-row-action-cell {
    position: sticky;
    z-index: 2;
    right: 0;
    background: var(--surface);
    box-shadow: -10px 0 18px rgba(23, 32, 17, .08);
  }

  .detail-modal-backdrop {
    place-items: stretch;
    padding: 12px;
  }

  .detail-modal-compact .detail-modal,
  .detail-modal-standard .detail-modal,
  .detail-modal-wide .detail-modal {
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: none;
    border-radius: 8px;
  }

  .detail-modal-body {
    padding: 0 16px 18px;
  }

  .detail-modal-body .detail-summary {
    margin: 0 -16px 12px;
    padding: 14px 16px;
  }

  .detail-modal-body .detail-section {
    margin-top: 10px;
    padding: 14px 12px;
  }

  .detail-actions,
  .detail-section-actions {
    justify-content: stretch;
    padding: 10px 12px;
  }

  .detail-actions button,
  .detail-section-actions button {
    flex: 1 1 132px;
  }
}

@media (max-width: 760px) {
  .workbench-status-row {
    justify-content: flex-start;
  }

  .workbench-heading-status {
    justify-content: flex-start;
  }

  .workbench-trend-panel-head {
    align-items: flex-start;
    gap: 12px;
  }

  .workbench-trend-canvas {
    height: 156px;
  }

  .workbench-frappe-chart,
  .workbench-frappe-chart .chart-container,
  .workbench-frappe-chart .frappe-chart,
  .workbench-frappe-chart .graphics {
    height: 156px !important;
    min-height: 156px;
  }

  .workbench-focus-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workbench-focus-item {
    min-height: 68px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }

  .workbench-focus-item:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .operator-card {
    display: none;
  }

  .topbar-exit {
    min-width: 68px;
  }

  .workbench-result-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .workbench-result-metric:nth-child(even) {
    border-left: 0;
  }

  .workbench-result-metric + .workbench-result-metric,
  .workbench-result-metric:nth-child(n + 3) {
    border-top: 1px solid var(--admin-line);
  }

  .workbench-chart-body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .workbench-trend-date {
    min-height: 40px;
    font-size: 9px;
  }

  .detail-summary {
    align-items: flex-start;
  }
}

/* 动效只用于确认界面状态变化，不参与布局计算，也不延迟任何业务操作。 */
#content > :not(.editor-backdrop):not(.detail-modal-backdrop):not(.confirm-modal-backdrop):not(.hidden) {
  /* 只在播放前应用起始帧，结束后释放 transform，固定定位菜单才能继续使用视口坐标。 */
  animation: adminContentEnter var(--motion-base) var(--motion-ease-out) backwards;
}

.nav-group:not(.is-collapsed) .nav-sublist {
  transform-origin: top left;
  animation: adminNavGroupEnter var(--motion-base) var(--motion-ease-out) both;
}

.sidebar-backdrop:not(.hidden) {
  animation: adminBackdropEnter var(--motion-fast) var(--motion-ease-standard) both;
}

.detail-modal-backdrop:not(.hidden),
.editor-backdrop:not(.hidden),
.confirm-modal-backdrop:not(.hidden) {
  animation: adminBackdropEnter var(--motion-fast) var(--motion-ease-standard) both;
}

.detail-modal-backdrop:not(.hidden) .detail-modal,
.editor-backdrop:not(.hidden) .editor-modal,
.confirm-modal-backdrop:not(.hidden) .confirm-modal {
  animation: adminModalEnter var(--motion-base) var(--motion-ease-out) both;
}

.toast:not(.hidden) {
  animation: adminToastEnter var(--motion-fast) var(--motion-ease-out) both;
}

.sidebar-backdrop:hover,
.sidebar-backdrop:active {
  transform: none;
}

.workbench-frappe-chart .chart-container {
  animation: adminChartFade var(--motion-chart) var(--motion-ease-out) both;
}

@keyframes adminContentEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes adminNavGroupEnter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes adminBackdropEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes adminModalEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes adminToastEnter {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes adminChartFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 统一图片库由商品规格和首页推荐共用，选择历史图片时不产生新的上传文件。 */
.product-image-library-backdrop {
  z-index: 80;
}

.editor-modal.product-image-library-modal {
  width: min(960px, calc(100vw - 48px));
  height: auto;
  max-height: min(780px, calc(100dvh - 40px));
  grid-template-rows: auto minmax(0, auto);
  border-radius: 8px;
}

.product-image-library-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 18px 20px 20px;
}

.product-image-library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 520px) auto;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.product-image-library-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: end;
}

.product-image-library-search label {
  grid-column: 1 / -1;
  color: var(--admin-muted, var(--muted));
  font-size: 12px;
  font-weight: 850;
}

.product-image-library-search input {
  width: 100%;
  min-width: 0;
}

.product-image-library-results {
  min-height: 0;
  max-height: min(600px, calc(100dvh - 174px));
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(55, 104, 2, .32) transparent;
  scrollbar-width: thin;
}

.product-image-library-summary {
  margin-bottom: 10px;
  color: var(--admin-muted, var(--muted));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.product-image-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.product-image-library-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 132px minmax(64px, auto);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.product-image-library-item:hover {
  border-color: var(--brand);
  background: var(--surface-strong);
}

.product-image-library-item:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.product-image-library-item.selected {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.product-image-library-media {
  min-width: 0;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.product-image-library-media img {
  width: 100%;
  height: 132px;
  display: block;
  object-fit: contain;
  background: var(--surface-strong);
}

.product-image-library-meta {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
}

.product-image-library-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-library-meta small {
  min-width: 0;
  color: var(--admin-muted, var(--muted));
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.product-image-library-selected {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(217, 119, 87, .42);
  border-radius: 6px;
  padding: 3px 7px;
  background: #fff4ed;
  color: var(--amber-strong);
  font-size: 11px;
  font-weight: 850;
}

.product-image-library-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--admin-muted, var(--muted));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.product-image-library-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--admin-muted, var(--muted));
  text-align: center;
}

.product-image-library-state strong {
  color: var(--ink);
  font-size: 15px;
}

.product-image-library-state.error-state span {
  max-width: 440px;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .editor-modal.product-image-library-modal {
    width: calc(100vw - 20px);
    height: auto;
    max-height: calc(100dvh - 20px);
  }

  .product-image-library-body {
    gap: 12px;
    padding: 14px;
  }

  .product-image-library-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-image-library-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .product-image-library-toolbar > .btn-primary {
    width: 100%;
  }

  .product-image-library-results {
    max-height: calc(100dvh - 220px);
  }

  .product-image-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-image-library-item {
    grid-template-rows: 108px minmax(68px, auto);
  }

  .product-image-library-media img {
    height: 108px;
  }
}

/* 小程序首页管理保持操作区紧凑，将视觉高度留给真实首页预览。 */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.mini-home-page {
  display: grid;
  grid-template-columns: minmax(584px, 1fr) 372px;
  gap: 20px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.mini-home-editor-column,
.mini-home-preview-column,
.mini-home-preview-sticky,
.mini-home-panel,
.mini-home-carousel-form,
.mini-home-product-list,
.mini-home-carousel-list {
  min-width: 0;
}

.mini-home-editor-column {
  display: grid;
  gap: 20px;
}

.mini-home-panel {
  overflow: hidden;
  border-radius: 8px;
}

.mini-home-panel-head {
  min-height: 68px;
  align-items: center;
  gap: 16px;
}

.mini-home-panel-head > div {
  min-width: 0;
}

.mini-home-panel-head p {
  font-variant-numeric: tabular-nums;
}

.mini-home-panel-head .mini-home-carousel-size-hint {
  margin-top: 3px;
}

.mini-home-panel-head > button {
  flex: 0 0 auto;
}

.mini-home-add-button,
.mini-home-carousel-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.mini-home-add-button .admin-icon,
.mini-home-carousel-actions .admin-icon {
  width: 16px;
  height: 16px;
}

.mini-home-product-row,
.mini-home-inactive-row {
  display: grid;
  grid-template-columns: 44px 62px minmax(160px, 1fr) 72px 104px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border-top: 1px solid var(--line);
  padding: 10px 18px;
  background: var(--surface);
}

.mini-home-product-row:hover {
  background: #fffcf7;
}

.mini-home-product-row.is-dragging,
.mini-home-carousel-row.is-dragging {
  position: relative;
  z-index: 2;
  border-color: rgba(55, 104, 2, .38);
  background: #f4faee;
  box-shadow: var(--shadow);
}

.mini-home-drag-handle {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  align-self: center;
  border-color: transparent;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.mini-home-drag-handle:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--brand);
  transform: none;
}

.mini-home-drag-handle:active,
.mini-home-drag-handle[aria-pressed="true"] {
  cursor: grabbing;
}

.mini-home-drag-handle .admin-icon {
  width: 20px;
  height: 20px;
}

.mini-home-product-thumb,
.mini-home-carousel-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.mini-home-product-thumb {
  position: relative;
  width: 62px;
  height: 62px;
}

.mini-home-product-thumb img,
.mini-home-carousel-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.mini-home-product-thumb img {
  position: absolute;
  inset: 0;
  padding: 8px;
}

.mini-home-product-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mini-home-product-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.mini-home-product-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mini-home-position {
  color: var(--muted-strong);
  text-align: center;
}

.mini-home-visibility {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-home-visibility.is-visible {
  border-color: rgba(55, 104, 2, .22);
  background: var(--success-soft);
  color: var(--success);
}

.mini-home-inactive-products:empty {
  display: none;
}

.mini-home-inactive-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 18px;
  background: var(--surface-soft);
}

.mini-home-inactive-head strong {
  color: var(--muted-strong);
  font-size: 12px;
}

.mini-home-inactive-head span {
  min-width: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.mini-home-inactive-row {
  grid-template-columns: 44px 62px minmax(160px, 1fr) 104px;
  background: rgba(248, 243, 236, .62);
  opacity: .76;
}

.mini-home-inactive-spacer {
  width: 44px;
  height: 44px;
}

.mini-home-carousel-row {
  display: grid;
  grid-template-columns: 44px 116px minmax(250px, 1fr) 66px 44px;
  align-items: center;
  gap: 14px;
  min-height: 158px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--surface);
}

.mini-home-carousel-thumb {
  position: relative;
  width: 116px;
  height: 130px;
}

.mini-home-carousel-thumb img {
  height: 104px;
}

.mini-home-carousel-thumb span {
  width: 100%;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.mini-home-carousel-fields {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.mini-home-segmented {
  width: min(100%, 292px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 3px;
  background: var(--surface-soft);
}

.mini-home-segmented button {
  min-height: 34px;
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--muted-strong);
  box-shadow: none;
}

.mini-home-segmented button:hover {
  background: rgba(55, 104, 2, .06);
  transform: none;
}

.mini-home-segmented button.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 5px rgba(23, 32, 17, .1);
}

.mini-home-carousel-sku-field {
  gap: 5px;
}

.mini-home-carousel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-home-switch-field {
  justify-items: center;
  gap: 8px;
  color: var(--muted-strong);
}

.mini-home-switch {
  position: relative;
  width: 46px;
  height: 28px;
  display: block;
}

.mini-home-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 46px;
  min-height: 28px;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.mini-home-switch > span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-high);
  transition: background 160ms ease, border-color 160ms ease;
}

.mini-home-switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 32, 17, .22);
  transition: transform 160ms ease;
}

.mini-home-switch input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}

.mini-home-switch input:checked + span::after {
  transform: translateX(18px);
}

.mini-home-switch input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mini-home-icon-button {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
}

.mini-home-icon-button .admin-icon {
  width: 18px;
  height: 18px;
}

.mini-home-icon-button.danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.mini-home-icon-button.danger:hover {
  border-color: rgba(186, 26, 26, .18);
  background: var(--danger-soft);
}

.mini-home-save-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--surface-soft);
}

.mini-home-save-state {
  color: var(--muted);
  font-size: 12px;
}

.mini-home-empty {
  min-height: 112px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.mini-home-empty strong {
  font-size: 14px;
}

.mini-home-preview-sticky {
  position: sticky;
  top: 18px;
}

.mini-home-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mini-home-preview-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.mini-home-preview-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.mini-home-preview-live {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(55, 104, 2, .2);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-home-preview-live > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.mini-home-preview {
  display: grid;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 14px;
  background: #e9e6de;
}

.mini-home-phone {
  width: 348px;
  height: min(716px, calc(100dvh - 190px));
  min-height: 610px;
  display: grid;
  grid-template-rows: 24px 42px minmax(0, 1fr) 54px;
  overflow: hidden;
  border: 7px solid #1f241d;
  border-radius: 34px;
  background: #fffaf1;
  box-shadow: 0 16px 36px rgba(23, 32, 17, .18);
}

.mini-home-phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #fffaf1;
  color: #20301a;
  font-size: 9px;
  font-weight: 800;
}

.mini-home-phone-title {
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(55, 104, 2, .08);
  color: #183900;
  font-size: 15px;
  font-weight: 900;
}

.mini-home-phone-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.mini-home-phone-body::-webkit-scrollbar {
  display: none;
}

.mini-home-phone-carousel {
  position: relative;
  height: 218px;
  overflow: hidden;
  background: transparent;
}

.mini-home-phone-carousel > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 16px 28px 52px;
}

.mini-home-phone-carousel.is-image > img {
  padding: 0;
  object-fit: contain;
}

.mini-home-phone-carousel.is-empty {
  background: #f1eee7;
}

.mini-home-phone-carousel-copy {
  position: absolute;
  top: 22px;
  left: 18px;
  max-width: 168px;
  display: grid;
  gap: 4px;
}

.mini-home-phone-carousel-copy small {
  display: none;
}

.mini-home-phone-carousel-copy strong {
  color: #183900;
  font-size: 18px;
  line-height: 1.25;
}

.mini-home-phone-carousel-copy span {
  color: #536349;
  font-size: 10px;
}

.mini-home-phone[data-preview-mode="single"] .mini-home-phone-body {
  background: #fbf5e9;
}

.mini-home-phone-carousel.is-single-home {
  height: 330px;
  margin: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mini-home-phone-carousel.is-single-home > img {
  padding: 90px 88px 56px;
}

.mini-home-phone-carousel.is-single-home.is-image > img {
  padding: 0;
}

.mini-home-phone-carousel.is-single-home .mini-home-phone-carousel-copy {
  top: 12px;
  right: 18px;
  left: 18px;
  max-width: none;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.mini-home-phone-carousel.is-single-home .mini-home-phone-carousel-copy small {
  display: block;
  color: #9a7d47;
  font-size: 9px;
  font-weight: 800;
}

.mini-home-phone-carousel.is-single-home .mini-home-phone-carousel-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.mini-home-phone-carousel.is-single-home .mini-home-phone-carousel-copy span {
  color: #183900;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
}

.mini-home-phone-carousel-price {
  position: absolute;
  right: 18px;
  bottom: 21px;
  left: 18px;
  color: #183900;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.mini-home-phone-carousel.is-single-home .mini-home-phone-dots {
  bottom: 8px;
}

.mini-home-phone-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}

.mini-home-phone-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(24, 57, 0, .28);
}

.mini-home-phone-dots i.active {
  width: 12px;
  border-radius: 4px;
  background: #376802;
}

.mini-home-phone-section-head span {
  padding-bottom: 2px;
  color: #606957;
  font-size: 12px;
  white-space: nowrap;
}

.mini-home-phone-section-head h3 {
  margin: 5px 0 0;
  color: #16200f;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.mini-home-single-content {
  padding-bottom: 16px;
}

.mini-home-single-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 12px 0;
  overflow: hidden;
  border: 1px solid rgba(55, 104, 2, .12);
  border-radius: 10px;
  background: #fffefa;
}

.mini-home-single-stats > div {
  min-width: 0;
  padding: 14px 3px 12px;
  text-align: center;
}

.mini-home-single-stats > div:not(:last-child) {
  border-right: 1px solid rgba(55, 104, 2, .12);
}

.mini-home-single-stats strong {
  display: block;
  overflow: hidden;
  color: #183900;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-single-stats small {
  margin-left: 1px;
  font-family: inherit;
  font-size: 10px;
}

.mini-home-single-stats span {
  display: block;
  margin-top: 6px;
  color: #6b6e62;
  font-size: 8px;
}

.mini-home-single-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 24px 18px 8px;
  color: #183900;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 800;
}

.mini-home-single-rule::before,
.mini-home-single-rule::after {
  height: 1px;
  background: rgba(154, 125, 71, .32);
  content: "";
}

.mini-home-single-sku-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 12px;
}

.mini-home-single-sku-card {
  min-width: 0;
  display: grid;
  justify-items: center;
  padding: 12px 10px;
  border: 1px solid rgba(55, 104, 2, .12);
  border-radius: 10px;
  background: #fffefa;
  text-align: center;
}

.mini-home-single-sku-tag {
  min-height: 18px;
  padding: 3px 7px;
  border: 1px solid rgba(154, 125, 71, .28);
  border-radius: 9px;
  color: #795f2e;
  font-size: 8px;
  line-height: 1.25;
}

.mini-home-single-sku-image {
  position: relative;
  width: 100%;
  height: 92px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  margin: 4px 0 7px;
}

.mini-home-single-sku-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-home-single-sku-card > strong,
.mini-home-single-sku-card > span,
.mini-home-single-sku-card > b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-single-sku-card > strong {
  color: #23301c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
}

.mini-home-single-sku-card > span:not(.mini-home-single-sku-tag) {
  margin-top: 3px;
  color: #737768;
  font-size: 8px;
}

.mini-home-single-sku-card > b {
  margin-top: 7px;
  color: #183900;
  font-size: 12px;
  font-weight: 900;
}

.mini-home-phone-products {
  display: grid;
  gap: 14px;
  padding: 28px 14px 10px;
}

.mini-home-phone-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.mini-home-phone-section-head > div > small {
  display: block;
  color: #7d6231;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.4px;
}

.mini-home-phone-product-grid {
  display: grid;
  gap: 14px;
}

.mini-home-layout-two,
.mini-home-layout-four {
  grid-template-columns: minmax(0, 1fr);
}

.mini-home-layout-three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-home-phone-product-card {
  position: relative;
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-rows: 1fr;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 15, .12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(22, 32, 15, .08);
}

.mini-home-layout-three .mini-home-phone-product-card.is-primary {
  grid-column: 1 / -1;
}

.mini-home-layout-three .mini-home-phone-product-card.is-primary .mini-home-phone-product-copy {
  padding-top: 14px;
  padding-bottom: 14px;
}

.mini-home-layout-three .mini-home-phone-product-card.is-primary .mini-home-phone-product-copy strong {
  margin-top: 7px;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact {
  min-height: 166px;
  grid-template-columns: 1fr;
  grid-template-rows: 102px minmax(0, 1fr);
}

.mini-home-phone-product-image {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(22, 32, 15, .12);
  background: #f6f4ee;
}

.mini-home-phone-product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 10px;
}

.mini-home-phone-product-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px 36px 15px 16px;
}

.mini-home-phone-product-copy small {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(169, 133, 69, .34);
  border-radius: 999px;
  background: rgba(169, 133, 69, .08);
  color: #7d6231;
  font-size: 10px;
  font-weight: 600;
}

.mini-home-phone-product-copy > small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-phone-product-copy strong {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  color: #16200f;
  margin-top: 9px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.mini-home-phone-product-copy span {
  display: none;
}

.mini-home-phone-product-copy b {
  margin-top: auto;
  padding-top: 11px;
  color: #183900;
  font-size: 18px;
  font-weight: 600;
}

.mini-home-phone-product-copy b small {
  min-height: 0;
  margin-left: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #606957;
  font-size: 11px;
  font-weight: 500;
}

.mini-home-phone-product-chevron {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #183900;
  font-size: 24px;
  font-style: normal;
  line-height: 1;
  transform: translateY(-50%);
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-copy {
  padding: 11px 12px 13px;
  text-align: center;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-image {
  border-right: 0;
  border-bottom: 1px solid rgba(22, 32, 15, .12);
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-copy > small {
  display: none;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-copy strong {
  margin-top: 0;
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-copy b {
  width: 100%;
  padding-top: 6px;
  font-size: 14px;
  text-align: center;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-copy span {
  display: none;
}

.mini-home-layout-three .mini-home-phone-product-card.is-compact .mini-home-phone-product-chevron {
  display: none;
}

.mini-home-phone-products > button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 0;
  border: 1px solid rgba(55, 104, 2, .24);
  border-radius: 18px;
  background: #ffffff;
  color: #376802;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.mini-home-phone-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #777667;
}

.mini-home-phone-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  border-top: 1px solid rgba(55, 104, 2, .1);
  background: #fffefa;
  color: #777667;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.mini-home-phone-tabs .active {
  color: #376802;
}

@media (max-width: 1100px) {
  .mini-home-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini-home-preview-column {
    order: -1;
  }

  .mini-home-preview-sticky {
    position: static;
  }

  .mini-home-preview {
    min-height: 660px;
  }

  .mini-home-phone {
    height: 650px;
    min-height: 650px;
  }
}

@media (max-width: 760px) {
  .mini-home-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-home-panel-head > button {
    width: 100%;
  }

  .mini-home-product-row,
  .mini-home-inactive-row {
    grid-template-columns: 44px 54px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
  }

  .mini-home-product-thumb {
    width: 54px;
    height: 54px;
  }

  .mini-home-position,
  .mini-home-visibility,
  .mini-home-inactive-row .status-badge {
    grid-column: 3;
    justify-self: start;
  }

  .mini-home-inactive-spacer {
    width: 44px;
  }

  .mini-home-carousel-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 10px;
    padding: 12px;
  }

  .mini-home-carousel-thumb,
  .mini-home-carousel-fields {
    grid-column: 2;
  }

  .mini-home-carousel-thumb {
    width: 100%;
    height: 178px;
  }

  .mini-home-carousel-thumb img {
    height: 150px;
  }

  .mini-home-switch-field {
    grid-column: 3;
    grid-row: 1;
  }

  .mini-home-icon-button {
    grid-column: 3;
    align-self: end;
  }

  .mini-home-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-home-save-bar .btn-primary {
    width: 100%;
  }

  .mini-home-preview {
    min-height: 0;
    padding: 12px 8px;
  }

  .mini-home-phone {
    width: min(348px, calc(100vw - 70px));
    height: 640px;
    min-height: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-home-switch > span,
  .mini-home-switch > span::after {
    transition: none;
  }
}
