:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #faf9fc;
  --ink: #211a2a;
  --muted: #7d7586;
  --line: #ece8f0;
  --purple: #6b22b4;
  --purple-dark: #4d1487;
  --purple-soft: #f2eafb;
  --teal: #16b5a5;
  --green: #19a66a;
  --orange: #ef8d32;
  --red: #e45454;
  --blue: #3977d5;
  --sidebar: #17131e;
  --sidebar-soft: #251d2f;
  --shadow: 0 12px 35px rgba(42, 24, 57, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.account-page-stack { display: grid; gap: 18px; }
.account-overview-panel { overflow: hidden; }
.account-balance-grid { margin: 0; padding: 0 22px 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.account-balance-card .cell-sub { display: block; margin-top: 8px; }
.account-payout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.account-payout-card { min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.account-payout-card .metric-top { margin-bottom: 12px; }
.account-payout-card .status-badge { font-size: 11px; }
.account-safety-note { border-left: 4px solid var(--purple); }
.account-withdrawal-form .account-confirm { display: flex; align-items: center; gap: 10px; }
.account-withdrawal-form .account-confirm input { width: auto; }
.negative { color: var(--red); }

@media (max-width: 1100px) {
  .account-balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-payout-grid { grid-template-columns: 1fr; }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 44px 24px;
  background:
    radial-gradient(circle at 16% 15%, rgba(177, 89, 240, .22), transparent 30%),
    radial-gradient(circle at 86% 75%, rgba(39, 206, 181, .16), transparent 28%),
    linear-gradient(135deg, #17131e 0%, #2e173f 55%, #17131e 100%);
}

.login-brand {
  position: fixed;
  left: 36px;
  top: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.login-brand strong, .sidebar-brand strong { display: block; font-size: 20px; letter-spacing: 2px; }
.login-brand span, .sidebar-brand span { display: block; margin-top: 3px; color: #bdb1c8; font-size: 11px; letter-spacing: 1px; }

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  color: #fff;
  font-weight: 800;
  font-size: 25px;
  background: linear-gradient(145deg, #9e3be5, #5a16a3 62%, #391069);
  box-shadow: 0 14px 28px rgba(91, 23, 158, .35), inset 0 1px rgba(255, 255, 255, .25);
}

.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 19px; }

.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 24px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}

.login-heading { margin-bottom: 30px; }
.eyebrow { color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.login-heading h1 { margin: 10px 0 8px; font-size: 30px; }
.login-heading p { margin: 0; color: var(--muted); line-height: 1.7; }

.compliance-footer { color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.compliance-footer a { color: inherit; text-decoration: none; }
.compliance-footer a:hover { color: var(--purple); text-decoration: underline; }
.login-compliance { position: fixed; right: 24px; bottom: 18px; left: 24px; color: #cfc5d7; }
.workspace-compliance { padding: 0 30px 22px; }

label { display: block; }
label > span { display: block; margin-bottom: 8px; color: #51495a; font-weight: 700; font-size: 13px; }
.login-card label + label { margin-top: 18px; }

input, select, textarea {
  width: 100%;
  border: 1px solid #ddd7e3;
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input:focus, select:focus, textarea:focus {
  border-color: #8b48ca;
  box-shadow: 0 0 0 3px rgba(107, 34, 180, .1);
}

textarea { min-height: 90px; resize: vertical; }

.primary, .secondary, .ghost, .danger, .warning {
  border: 0;
  border-radius: 10px;
  padding: 10px 17px;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}

.primary:hover, .secondary:hover, .danger:hover, .warning:hover { transform: translateY(-1px); }
.primary { color: #fff; background: linear-gradient(135deg, #7d2bc4, #5a16a3); box-shadow: 0 8px 18px rgba(91, 22, 163, .2); }
.secondary { color: #fff; background: var(--teal); }
.ghost { color: #5a5164; background: #f1eef4; }
.danger { color: #fff; background: var(--red); }
.warning { color: #fff; background: var(--orange); }
.wide { width: 100%; margin-top: 28px; padding: 13px 18px; }
.compact { padding: 8px 12px; font-size: 12px; }
.text-button { border: 0; padding: 4px; color: var(--purple); background: transparent; font-weight: 700; }
.text-button.red { color: var(--red); }
.login-hint { margin: 18px 0 0; text-align: center; color: #948b9c; font-size: 12px; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 238px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(180deg, #17131e, #1c1624 68%, #15111b);
  box-shadow: 10px 0 30px rgba(35, 25, 44, .08);
  transition: transform .22s;
}

.sidebar-brand {
  height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-brand strong { font-size: 17px; }
.nav-list { padding: 18px 12px; overflow-y: auto; }
.nav-section { padding: 18px 14px 8px; color: #71677d; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  margin: 3px 0;
  border: 0;
  border-radius: 10px;
  color: #c9c1d1;
  background: transparent;
  text-align: left;
}

.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(119, 41, 189, .86), rgba(82, 22, 142, .7)); box-shadow: 0 8px 22px rgba(83, 25, 137, .22); }
.nav-item.nav-quick-add { margin-bottom: 7px; border: 1px dashed rgba(199, 151, 239, .42); color: #ead8fa; background: rgba(119, 41, 189, .16); }
.nav-item.nav-quick-add:hover { border-color: rgba(222, 186, 252, .72); background: rgba(119, 41, 189, .28); }
.nav-icon { width: 20px; text-align: center; font-size: 18px; opacity: .95; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--red); text-align: center; font-size: 10px; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px 22px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #35d59d; box-shadow: 0 0 0 5px rgba(53, 213, 157, .1); }
.sidebar-foot strong { display: block; font-size: 12px; }
.sidebar-foot small { display: block; margin-top: 3px; color: #786e82; font-size: 10px; }

.workspace { margin-left: 238px; min-height: 100vh; }
.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
}

.topbar h1 { margin: 4px 0 0; font-size: 22px; }
.breadcrumbs { margin: 0; color: #9c94a4; font-size: 11px; }
.breadcrumbs span { color: var(--purple); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.today { color: #8e8596; font-size: 12px; }
.admin-chip { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-left: 1px solid var(--line); }
.admin-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #9a46da, #5b18a0); font-weight: 800; }
.admin-chip strong, .admin-chip small { display: block; }
.admin-chip small { margin-top: 2px; color: #99919f; font-size: 10px; }
.menu-toggle { display: none; border: 0; border-radius: 9px; padding: 8px 10px; background: var(--purple-soft); color: var(--purple); }

.content { padding: 28px 30px 48px; }
.page-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.page-actions .spacer { margin-left: auto; }
.refund-runtime-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 10px; }
.refund-runtime-card { min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 6px 18px rgba(48, 30, 60, .035); }
.refund-runtime-card span, .refund-runtime-card strong, .refund-runtime-card small { display: block; }
.refund-runtime-card span { color: var(--muted); font-size: 10px; font-weight: 700; }
.refund-runtime-card strong { margin-top: 9px; font-size: 17px; }
.refund-runtime-card small { margin-top: 6px; color: #958d9c; font-size: 9px; line-height: 1.5; }
.refund-runtime-card .refund-runtime-ok { color: var(--green); }
.refund-runtime-card .refund-runtime-off { color: var(--orange); }
.refund-safety-note { display: grid; gap: 5px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #eadcf4; border-radius: 12px; background: #faf7fc; }
.refund-safety-note strong, .refund-safety-note span { display: block; }
.refund-safety-note strong { color: #5f347b; font-size: 11px; }
.refund-safety-note span { color: var(--muted); font-size: 10px; line-height: 1.65; }
.refund-safety-note.warning { border-color: #f2d5a8; background: #fff9ef; }
.refund-safety-note.warning strong { color: #9b5b09; }
.refund-safety-note.danger { border-color: #f2c6ca; background: #fff5f6; }
.refund-safety-note.danger strong { color: #b43542; }
.refund-confirmation { display: grid; gap: 14px; }
.refund-confirmation-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.refund-confirmation-summary span { color: var(--muted); font-size: 12px; }
.refund-confirmation-summary strong { min-width: 0; overflow-wrap: anywhere; text-align: right; font-size: 14px; }
.refund-confirmation .form-actions { margin-top: 4px; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; }
.metric-card {
  min-height: 122px;
  padding: 20px;
  border: 1px solid rgba(230, 225, 234, .9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(48, 30, 60, .04);
}
.metric-card .metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-card .metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--purple); background: var(--purple-soft); font-size: 18px; }
.metric-card.teal .metric-icon { color: #0d9286; background: #e5f8f5; }
.metric-card.orange .metric-icon { color: #d56e17; background: #fff1e2; }
.metric-card.red .metric-icon { color: #ce3f4b; background: #fdecee; }
.metric-card.blue .metric-icon { color: #2b67c0; background: #eaf1fc; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 17px; font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.metric-value small { margin-left: 3px; color: #948b9c; font-size: 11px; font-weight: 500; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .8fr); gap: 18px; margin-top: 18px; }
.dashboard-grid.three { grid-template-columns: 1.3fr 1fr; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(43, 27, 54, .04); overflow: hidden; }
.panel-header { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-header .panel-actions { margin-left: auto; }
.panel-body { padding: 20px; }

.chart-wrap { height: 260px; position: relative; }
.chart { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #eeeaf1; stroke-width: 1; }
.chart-area { fill: url(#areaGradient); }
.chart-line { fill: none; stroke: var(--purple); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: var(--purple); stroke-width: 2.5; }
.chart-label { fill: #928999; font-size: 10px; }

.ranking-list { display: grid; gap: 14px; }
.ranking-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rank { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #62596b; background: #f3eff6; font-size: 11px; font-weight: 800; }
.ranking-row:nth-child(-n+3) .rank { color: #fff; background: linear-gradient(135deg, #8a38cd, #5a16a3); }
.ranking-copy strong, .ranking-copy span { display: block; }
.ranking-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ranking-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.ranking-value { font-weight: 800; font-size: 12px; }

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 11px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--surface);
}
.filters .wide-filter { grid-column: span 2; }
.filters input, .filters select { padding: 9px 11px; font-size: 12px; }
.filters .date-filter { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filters .date-filter input { min-width: 0; width: 100%; box-sizing: border-box; }
.filter-actions { display: flex; gap: 8px; align-items: end; }

.tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }

/* Used when an order has more than one after-sale request. The whole row is
   the hit target so operators can select the case from the order queue without
   losing the request number or current state. */
.list-select { display: grid; gap: 8px; margin-top: 16px; }
.list-select-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: inherit; text-align: left; cursor: pointer; }
.list-select-row:hover { border-color: var(--primary, #6b22b4); background: var(--surface-muted, #faf7fc); }
.list-select-row span:first-child { display: grid; gap: 4px; }
.list-select-row small { color: var(--muted, #887d8c); }
.tab { position: relative; flex: 0 0 auto; border: 0; padding: 15px 14px; color: var(--muted); background: transparent; font-size: 12px; }
.tab.active { color: var(--purple); font-weight: 800; }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); }
.tab b { margin-left: 5px; padding: 2px 6px; border-radius: 999px; color: #7d7385; background: #f0edf3; font-size: 9px; }
.tab.active b { color: var(--purple); background: var(--purple-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: #8b8392; background: #fbfafc; text-align: left; font-size: 11px; font-weight: 700; white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid #f0edf2; vertical-align: top; font-size: 12px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fdfbff; }
tbody tr:last-child td { border-bottom: 0; }

.cell-title { display: block; max-width: 270px; color: #302638; font-weight: 700; line-height: 1.5; }
.cell-sub { display: block; margin-top: 4px; color: #9a929f; font-size: 10px; line-height: 1.5; }
.money { color: var(--purple); font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-low { color: var(--red); font-weight: 800; }
.stock-value-action { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.stock-edit-button { padding: 4px 6px; color: var(--purple); background: var(--purple-soft); }
.account-provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-provider-card { min-width: 0; padding: 14px 16px; border: 1px solid #ece6ef; border-radius: 12px; background: #fcfbfd; }
.account-provider-card > span, .account-provider-card > small { display: block; color: var(--muted); font-size: 10px; }
.account-provider-card > strong { display: block; margin: 9px 0 5px; color: #33263b; font-size: 18px; font-variant-numeric: tabular-nums; }
.account-provider-card .account-provider-time { font-size: 12px; }
.account-provider-note { margin-top: 14px; }
.account-platform-review-note { margin: -2px 0 18px; }
.account-fixed-destination { display: grid; gap: 4px; min-height: 42px; padding: 10px 12px; border: 1px solid #dfd1e8; border-radius: 9px; color: #46334f; background: #fbf7fd; }
.account-fixed-destination strong { font-size: 12px; }
.account-fixed-destination small { color: var(--muted); font-size: 10px; }
.promotion-live { color: var(--red); font-weight: 800; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; white-space: nowrap; font-size: 10px; font-weight: 800; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pending_payment { color: #c47b24; background: #fff2df; }
.status-paid { color: #a6369b; background: #faeaf9; }
.status-pending_review { color: #c47b24; background: #fff2df; }
.status-approved_pending_payout { color: #2d6fc2; background: #eaf2fc; }
.withdrawal-waiting-settlement { display: inline-block; color: #6b7280; max-width: 180px; line-height: 1.4; }
.status-rejected { color: #cf4854; background: #fdebed; }
.status-shipped { color: #2d6fc2; background: #eaf2fc; }
.status-completed, .status-on_sale, .status-active, .status-synced { color: #16875c; background: #e6f7f0; }
.status-cancelled, .status-off_sale, .status-inactive { color: #7d7583; background: #efedf1; }
.status-refunded, .status-failed, .status-aftersale, .status-payment_exception { color: #cf4854; background: #fdebed; }
.status-pending_config, .status-syncing { color: #c47b24; background: #fff2df; }
.status-unauthorized, .status-not_configured, .status-disabled, .status-unsupported, .status-invalid, .status-unavailable { color: #8a6b29; background: #fff6df; }

.product-cell { display: flex; gap: 11px; min-width: 260px; }
.product-thumb { width: 54px; height: 54px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; border: 1px solid #eee8f1; background: #f5f1f7; }
.order-products { display: flex; align-items: center; }
.order-products img { width: 42px; height: 42px; object-fit: cover; border: 2px solid #fff; border-radius: 9px; background: #f3eff5; }
.order-products img + img { margin-left: -12px; }
.action-group { display: flex; flex-wrap: wrap; gap: 6px; min-width: 120px; }
.account-withdrawal-actions { min-width: 165px; }
.mini-button { border: 1px solid #e3dce8; border-radius: 7px; padding: 6px 8px; color: #665d6e; background: #fff; font-size: 10px; font-weight: 700; }
.mini-button:hover { border-color: #b998d2; color: var(--purple); }
.mini-button.primary-action { border-color: #bfa0d8; color: var(--purple); background: var(--purple-soft); }

.empty-state { padding: 65px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 18px; color: var(--purple); background: var(--purple-soft); font-size: 24px; }
.empty-state strong { display: block; color: #5b5263; }
.empty-state p { margin: 8px 0 0; font-size: 12px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; justify-content: flex-end; background: rgba(24, 18, 30, .46); backdrop-filter: blur(2px); }
.modal { width: min(660px, 94vw); height: 100%; overflow-y: auto; background: #fff; box-shadow: -24px 0 60px rgba(28, 17, 37, .2); animation: slideIn .2s ease-out; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } }
.modal > header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); }
.modal h2 { margin: 5px 0 0; font-size: 21px; }
.modal .icon-button { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; color: #766d7d; background: #f2eff4; font-size: 22px; }
.modal-body { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.permission-editor { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbfd; }
.permission-editor legend { padding: 0 6px; color: var(--text, #302638); font-size: 13px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 2px 2px; }
.permission-option { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; min-width: 0; padding: 9px 10px; border: 1px solid #eee8f1; border-radius: 9px; background: #fff; cursor: pointer; }
.permission-option:hover { border-color: #c9a9df; background: #fdf9ff; }
.permission-option input { grid-row: span 2; accent-color: var(--purple); }
.permission-option span { min-width: 0; color: #403448; font-size: 11px; line-height: 1.35; }
.permission-option small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .permission-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.inline-actions input { flex: 1; min-width: 0; }
.inline-actions button { flex: 0 0 auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.product-stock-notice { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; border: 1px solid #eadcf2; border-radius: 11px; color: #766b80; background: #fbf7fd; font-size: 11px; line-height: 1.5; }
.product-stock-notice strong { color: #382842; font-size: 14px; }
.product-stock-list { display: grid; gap: 9px; }
.product-stock-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.product-stock-row > span { min-width: 0; }
.product-stock-row b, .product-stock-row small { display: block; }
.product-stock-row b { color: #3d3345; font-size: 12px; }
.product-stock-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.product-stock-row input { width: 112px; flex: 0 0 auto; }
.product-stock-row.is-inactive { opacity: .58; background: #faf9fa; }

.modal.shipping-editor-modal { width: min(1040px, 98vw); background: #f6f6f8; }
.shipping-editor-modal > header { padding: 18px 24px; }
.shipping-editor-modal .modal-body { padding: 0; background: #f6f6f8; }
.shipping-editor-form { min-height: calc(100vh - 82px); }
.shipping-editor-section { margin: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(43, 27, 54, .04); }
.shipping-editor-heading { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff, #fcf9ff); }
.shipping-editor-heading > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: var(--purple); background: var(--purple-soft); font-size: 11px; font-weight: 900; }
.shipping-editor-heading h3 { margin: 0; font-size: 16px; }
.shipping-editor-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.shipping-rules-heading > strong { margin-left: auto; padding: 6px 10px; border-radius: 999px; color: var(--purple); background: var(--purple-soft); font-size: 10px; }
.shipping-basic-grid { display: grid; grid-template-columns: minmax(260px, 1.5fr) 1fr 1fr; gap: 14px; padding: 20px 20px 14px; }
.shipping-basic-grid label > span, .shipping-rule-fields label > span, .shipping-preview-inputs label > span { margin-bottom: 6px; font-size: 10px; }
.shipping-charge-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 20px; }
.shipping-mode-option { position: relative; display: block; cursor: pointer; }
.shipping-mode-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shipping-mode-option > span { display: flex; min-height: 54px; flex-direction: column; justify-content: center; padding: 12px 14px; border: 1px solid #e1d9e6; border-radius: 12px; background: #fcfbfd; transition: border-color .18s, box-shadow .18s, background .18s; }
.shipping-mode-option strong, .shipping-mode-option small { display: block; }
.shipping-mode-option strong { font-size: 11px; }
.shipping-mode-option small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.shipping-mode-option input:checked + span { border-color: #9a58d1; background: #f7effc; box-shadow: 0 0 0 2px rgba(107, 34, 180, .08); }
.shipping-mode-warning { margin: -6px 20px 20px; padding: 10px 12px; border-radius: 10px; color: #9b651c; background: #fff6e8; font-size: 10px; line-height: 1.55; }
.shipping-rule-list { display: grid; gap: 13px; padding: 18px 20px 0; }
.shipping-rule-card { overflow: hidden; border: 1px solid #e7e0eb; border-radius: 14px; background: #fcfbfd; }
.shipping-rule-card.is-nationwide { border-color: #d7c0e8; background: #fdfaff; }
.shipping-rule-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #ece6ef; background: #fff; }
.shipping-rule-card > header > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.shipping-rule-card > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.shipping-rule-index { color: #9b92a1; font-size: 9px; font-weight: 800; }
.shipping-rule-badge { padding: 4px 7px; border-radius: 999px; color: #6e3997; background: #f1e5f9; font-size: 8px; font-weight: 800; }
.shipping-rule-badge.is-specific { color: #147c58; background: #e7f6f0; }
.shipping-rule-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.mini-button.danger-text { color: #bc4350; }
.shipping-rule-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 14px; }
.shipping-rule-fields input, .shipping-rule-fields select { padding: 9px 10px; font-size: 10px; }
.shipping-region-selector { grid-column: 1 / -1; }
.shipping-province-picker { overflow: hidden; border: 1px solid #e4dce9; border-radius: 12px; background: #fff; }
.shipping-province-picker summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 12px; cursor: pointer; color: #5f5666; font-size: 10px; font-weight: 800; list-style: none; }
.shipping-province-picker summary::-webkit-details-marker { display: none; }
.shipping-province-picker summary::before { content: '›'; color: var(--purple); font-size: 17px; transform: rotate(0); transition: transform .18s; }
.shipping-province-picker[open] summary::before { transform: rotate(90deg); }
.shipping-province-picker summary strong { margin-left: auto; padding: 4px 7px; border-radius: 999px; color: var(--purple); background: var(--purple-soft); font-size: 8px; }
.shipping-province-picker summary small { color: var(--muted); font-size: 8px; font-weight: 600; }
.shipping-province-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 10px 12px; border-top: 1px solid #f0ebf2; }
.shipping-province-groups fieldset { min-width: 0; margin: 10px 0 0; padding: 7px; border: 1px solid #eee8f1; border-radius: 9px; }
.shipping-province-groups legend { padding: 0 4px; color: #817588; font-size: 8px; font-weight: 800; }
.shipping-province-groups fieldset > div { display: grid; gap: 3px; }
.shipping-province-option { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 40px; padding: 5px 7px; border-radius: 8px; cursor: pointer; color: #5d5365; background: #faf8fb; font-size: 9px; }
.shipping-province-option:hover { background: #f5eff9; }
.shipping-province-option input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--purple); }
.shipping-province-option em { display: none; grid-column: 2; color: #a46b24; font-size: 7px; font-style: normal; line-height: 1.35; }
.shipping-province-option.is-unavailable { cursor: not-allowed; color: #aaa1ae; background: #f3f1f4; }
.shipping-province-option.is-unavailable em, .shipping-province-option.is-conflict em { display: block; }
.shipping-province-option.is-conflict { color: #a63e4b; background: #fff0f2; box-shadow: inset 0 0 0 1px #efb5bd; }
.shipping-custom-regions { display: block; margin-top: 10px; }
.shipping-custom-regions small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.shipping-region-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; min-height: 23px; margin-top: -4px; }
.shipping-region-chip { padding: 4px 7px; border-radius: 999px; color: #65596e; background: #eee8f2; font-size: 8px; font-weight: 700; }
.shipping-region-chip.is-empty { color: #9c929f; background: #f3f0f4; }
.shipping-region-chip.is-custom { color: #8a5b1e; background: #fff1d9; }
.shipping-region-chip.is-conflict { color: #a13846; background: #ffe2e6; box-shadow: inset 0 0 0 1px #efb1ba; }
.shipping-region-warning { grid-column: 1 / -1; margin: -4px 0 0; padding: 8px 10px; border-radius: 8px; color: #a13846; background: #fff0f2; font-size: 8px; line-height: 1.5; }
.shipping-rule-preview { margin: 0; padding: 10px 14px; border-top: 1px dashed #e4dce8; color: #706579; background: #f7f3f9; font-size: 9px; line-height: 1.6; }
.shipping-rule-add { display: flex; gap: 8px; padding: 14px 20px 0; }
.shipping-editor-section > .editor-tip { margin: 14px 20px 20px; }
.shipping-preview-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; padding: 18px 20px 0; }
.shipping-preview-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.shipping-preview-inputs input { padding: 9px 10px; font-size: 10px; }
.shipping-preview-region { grid-column: span 2; }
.shipping-preview-inputs button { min-height: 39px; }
.shipping-preview-result { display: flex; min-height: 112px; flex-direction: column; justify-content: center; padding: 16px; border: 1px solid #d9c4e9; border-radius: 13px; color: #665a70; background: linear-gradient(135deg, #fbf5ff, #fff); }
.shipping-preview-result span { color: var(--purple); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.shipping-preview-result strong { margin-top: 7px; color: #261d2e; font-size: 22px; }
.shipping-preview-result p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.shipping-preview-result.is-loading { opacity: .7; }
.shipping-preview-result.is-error { border-color: #efb5bd; background: #fff4f5; }
.shipping-preview-result.is-error span, .shipping-preview-result.is-error strong { color: #a13846; }
.shipping-editor-actions { position: sticky; z-index: 3; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .97); box-shadow: 0 -12px 30px rgba(46, 29, 58, .08); backdrop-filter: blur(8px); font-size: 10px; }
.shipping-editor-actions > div { display: flex; gap: 9px; }

.modal.product-editor-modal { width: min(1180px, 98vw); background: #f6f6f8; }
.product-editor-modal > header { padding: 18px 24px; }
.product-editor-modal .modal-body { padding: 0; background: #f6f6f8; }
.product-editor-form { min-height: calc(100vh - 82px); }
.product-editor-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); align-items: start; gap: 18px; padding: 18px; }
.product-editor-nav {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(44, 28, 57, .05);
}
.product-editor-nav button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 11px;
  padding: 9px;
  color: #736a7c;
  background: transparent;
  text-align: left;
}
.product-editor-nav button span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #f2eff4; font-size: 11px; font-weight: 800; }
.product-editor-nav button strong { font-size: 12px; }
.product-editor-nav button.active { color: var(--purple); background: var(--purple-soft); }
.product-editor-nav button.active span { color: #fff; background: linear-gradient(135deg, #8737cc, #5b17a3); }
.product-editor-nav p { margin: 6px 5px 2px; color: #a098a6; font-size: 10px; line-height: 1.65; }
.product-editor-sections { min-width: 0; display: grid; gap: 18px; }
.product-editor-section { scroll-margin-top: 96px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(43, 27, 54, .04); }
.editor-section-header { display: flex; align-items: center; gap: 12px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff, #fcf9ff); }
.editor-section-header > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--purple); background: var(--purple-soft); font-size: 11px; font-weight: 900; }
.editor-section-header h3 { margin: 0; font-size: 17px; }
.editor-section-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.editor-basic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; padding: 22px; }
.editor-fields { padding: 22px; }
.editor-basic-layout .editor-fields { padding: 0; }
.editor-subsection .editor-fields { padding: 0; }
.product-live-preview { align-self: start; padding: 13px; border: 1px solid #eee8f1; border-radius: 16px; background: #fbfafc; }
.product-live-image { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 13px; background: #f0ecf3; }
.product-live-image img { width: 100%; height: 100%; object-fit: cover; }
.product-live-image.empty img { display: none; }
.product-live-image.empty::before { content: "暂无主图"; position: absolute; inset: 0; display: grid; place-items: center; color: #aaa1b1; font-size: 12px; }
.product-live-image > span { position: absolute; top: 9px; left: 9px; padding: 4px 7px; border-radius: 999px; color: #fff; background: rgba(39, 25, 50, .72); font-size: 9px; font-weight: 800; }
.product-live-preview > strong { display: block; margin-top: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.product-live-preview > p { min-height: 32px; margin: 5px 0 10px; color: #918899; font-size: 10px; line-height: 1.55; }
.product-live-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-live-meta b { color: #e45454; font-size: 18px; }
.product-live-meta span { color: #98909e; font-size: 10px; }
.readonly-sales { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 10px; background: #f2eff4; }
.readonly-sales span { color: #746b7c; font-size: 10px; }
.readonly-sales strong { color: #51475a; font-size: 14px; }
.readonly-sales small { grid-column: 1 / -1; color: #a39ba8; font-size: 9px; }
.editor-subsection { padding: 22px; border-bottom: 1px solid var(--line); }
.editor-subsection:last-child { border-bottom: 0; }
.editor-subsection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.editor-subsection-head h4 { margin: 0; font-size: 14px; }
.editor-subsection-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.image-source-actions { display: flex; flex: 1; justify-content: flex-end; gap: 8px; }
.image-source-actions input { width: min(330px, 50%); padding: 8px 10px; font-size: 11px; }
.image-dropzone { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; padding: 16px; border: 1.5px dashed #cdb9dc; border-radius: 13px; color: #81758a; background: #fbf8fd; transition: border-color .18s, background .18s, box-shadow .18s; }
.image-dropzone > span { font-size: 10px; line-height: 1.6; }
.image-dropzone.is-dragover { border-color: var(--purple); background: #f4eafb; box-shadow: inset 0 0 0 2px rgba(107, 34, 180, .08); }
.image-dropzone.is-busy { opacity: .58; }
.product-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.product-media-card { min-width: 0; overflow: hidden; border: 1px solid #e8e1ec; border-radius: 13px; background: #fff; cursor: grab; transition: border-color .18s, box-shadow .18s, opacity .18s, transform .18s; }
.product-media-card:active { cursor: grabbing; }
.product-media-card.is-main { border-color: #9a58d1; box-shadow: 0 0 0 2px rgba(107, 34, 180, .08); }
.product-media-card.is-dragging { opacity: .42; }
.product-media-card.is-dragover { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(107, 34, 180, .14); transform: translateY(-2px); }
.product-media-preview { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f2eff4; }
.detail-media-grid .product-media-preview { aspect-ratio: 3 / 4; }
.product-media-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-media-card.is-broken .product-media-preview::after { content: "图片暂时无法预览"; position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: #9e94a5; background: #f2eff4; text-align: center; font-size: 10px; }
.product-media-order, .product-media-main { position: absolute; top: 8px; display: grid; place-items: center; height: 23px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.product-media-order { left: 8px; min-width: 23px; padding: 0 6px; color: #fff; background: rgba(37, 26, 47, .72); }
.product-media-main { right: 8px; padding: 0 8px; color: #fff; background: var(--purple); }
.product-media-drag { position: absolute; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 999px; color: #fff; background: rgba(37, 26, 47, .74); font-size: 9px; font-weight: 800; cursor: grab; touch-action: none; user-select: none; }
.product-media-alt { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px; font-size: 10px; }
.product-media-alt:focus { box-shadow: inset 0 -2px var(--purple); }
.product-media-controls { display: grid; gap: 8px; padding: 9px; }
.product-media-controls select { padding: 7px 8px; font-size: 10px; }
.product-media-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-button.icon-only { width: 28px; padding-right: 0; padding-left: 0; }
.mini-button:disabled { cursor: not-allowed; opacity: .4; }
.mini-button.remove-reference { color: #c04a54; }
.product-media-empty, .inline-empty { grid-column: 1 / -1; padding: 28px 18px; border: 1px dashed #dcd3e2; border-radius: 13px; color: #988fa0; background: #fcfafc; text-align: center; }
.product-media-empty strong, .product-media-empty span { display: block; }
.product-media-empty strong { color: #6f6578; font-size: 12px; }
.product-media-empty span { margin-top: 5px; font-size: 10px; }
.inline-empty { padding: 18px; font-size: 11px; }
.inline-controls { display: flex; gap: 12px; margin: -2px 0 15px; }
.inline-controls label { width: 160px; }
.inline-controls label > span { margin-bottom: 5px; font-size: 10px; }
.inline-controls input, .inline-controls select { padding: 8px 9px; font-size: 11px; }
.detail-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 22px; }
.detail-editor-card { padding: 14px; border: 1px solid #eae5ed; border-radius: 13px; background: #fcfbfd; }
.detail-editor-card.full { grid-column: 1 / -1; }
.detail-editor-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.detail-editor-title strong { font-size: 12px; }
.detail-editor-title > div { display: flex; gap: 6px; }
.detail-editor-title select { width: 78px; padding: 6px; font-size: 10px; }
.detail-editor-title input { width: 58px; padding: 6px; font-size: 10px; }
.detail-editor-card textarea { min-height: 110px; font-size: 11px; line-height: 1.65; }
.spec-group-list { display: grid; gap: 10px; }
.spec-group-row { display: grid; grid-template-columns: 30px minmax(130px, .55fr) minmax(230px, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid #eae4ee; border-radius: 12px; background: #fcfbfd; }
.spec-group-number { width: 28px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 800; }
.spec-group-row label > span { margin-bottom: 5px; font-size: 10px; }
.spec-group-row input { padding: 8px 9px; font-size: 11px; }
.sku-editor-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.sku-editor-table { min-width: 1120px; }
.sku-editor-table th { padding: 10px; }
.sku-editor-table td { padding: 9px; vertical-align: middle; }
.sku-editor-table input, .sku-editor-table select { padding: 8px; border-radius: 8px; font-size: 10px; }
.sku-editor-table .sku-combination-cell { min-width: 220px; }
.sku-code-input { min-width: 145px; }
.sku-code-input[readonly] { color: #817889; background: #f4f1f5; }
.sku-number-input { min-width: 86px; }
.sku-stock-input { min-width: 76px; }
.sku-erp-input { min-width: 135px; }
.sku-row-number { display: block; margin-top: 5px; color: #aaa1af; font-size: 9px; text-align: center; }
.removed-sku-box { margin-top: 12px; padding: 12px; border: 1px solid #eadde5; border-radius: 12px; background: #fff8fa; }
.removed-sku-box strong { font-size: 11px; }
.removed-sku-box p { margin: 4px 0 9px; color: #9a7886; font-size: 9px; }
.removed-sku-chip { border: 1px solid #e6cad6; border-radius: 999px; margin: 0 6px 5px 0; padding: 5px 9px; color: #a24464; background: #fff; font-size: 9px; }
.editor-tip { margin-top: 13px; padding: 12px 14px; border-radius: 11px; color: #6b6073; background: #f6f1fa; font-size: 10px; line-height: 1.65; }
#product-section-service .editor-tip { margin: 0 22px 22px; }
.shipping-template-field { display: grid; gap: 7px; }
.shipping-template-field > span { font-size: 11px; font-weight: 800; }
.shipping-template-control { display: flex; gap: 8px; align-items: center; }
.shipping-template-control select { min-width: 0; flex: 1; }
.shipping-template-control button { flex: 0 0 auto; }
.inline-manage-link { width: fit-content; color: var(--purple); font-size: 10px; font-weight: 800; text-decoration: none; }
.inline-manage-link:hover { text-decoration: underline; }
.shipping-template-field small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.shipping-weight-field { padding: 10px; border: 1px solid transparent; border-radius: 11px; transition: border-color .18s, background .18s; }
.shipping-weight-field.is-relevant { border-color: #d7c0e8; background: #fbf6fe; }
.shipping-weight-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.product-editor-actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -12px 30px rgba(46, 29, 58, .08);
  backdrop-filter: blur(8px);
}
.product-editor-actions strong, .product-editor-actions span { display: block; }
.product-editor-actions strong { font-size: 11px; }
.product-editor-actions span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.detail-section { margin-bottom: 24px; }
.detail-section h3 { margin: 0 0 12px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.detail-item { padding: 13px 14px; background: #fff; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item span, .detail-item strong { display: block; }
.detail-item span { color: #958d9c; font-size: 10px; }
.detail-item strong { margin-top: 5px; line-height: 1.5; font-size: 12px; word-break: break-all; }
.refund-last-error strong { color: var(--red); white-space: pre-wrap; }
.refund-submit:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.timeline { position: relative; margin-left: 8px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 7px; bottom: 8px; width: 1px; background: #dfd8e4; }
.timeline-row { position: relative; margin-bottom: 17px; }
.timeline-row::before { content: ""; position: absolute; left: -21px; top: 4px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 2px #d5bae9; }
.timeline-row strong { display: block; font-size: 12px; }
.timeline-row span { display: block; margin-top: 4px; color: #9a929f; font-size: 10px; }
.package-list { display: grid; gap: 10px; }
.package-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfafd; }
.package-head, .package-logistics { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.package-head strong { font-size: 12px; }
.package-logistics { margin-top: 10px; color: #655b6d; font-size: 11px; }
.package-actions { margin-top: 10px; }
.batch-package-list { display: grid; gap: 7px; min-width: 110px; }
.batch-package-list label { display: flex; align-items: center; gap: 6px; font-size: 10px; white-space: nowrap; }
.batch-package-list input { accent-color: var(--purple); }
.batch-shipment-list { display: grid; gap: 12px; margin-bottom: 16px; }
.batch-shipment-row { display: grid; grid-template-columns: minmax(180px, 1fr) 1fr 1fr; gap: 12px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fcfafd; }
.batch-shipment-row strong { font-size: 11px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; }
.settings-note { padding: 18px; border-radius: 13px; color: #5d5265; background: #f7f2fb; line-height: 1.75; font-size: 12px; }
.settings-note strong { color: var(--purple); }
.coupon-recipient-result { padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; color: #6f6578; background: #faf9fc; line-height: 1.65; }
.coupon-recipient-result strong, .coupon-recipient-result span { display: block; }
.coupon-recipient-result strong { color: #554b5e; font-size: 12px; }
.coupon-recipient-result span { margin-top: 3px; font-size: 11px; }
.coupon-recipient-result.is-loading { border-color: #d7c2ea; color: #6d5681; background: #f8f2fc; }
.coupon-recipient-result.is-loading strong { color: var(--purple); }
.coupon-recipient-result.is-found { border-color: #b9e0ce; color: #356d56; background: #f1faf6; }
.coupon-recipient-result.is-found strong { color: #17784e; }
.coupon-recipient-result.is-warning { border-color: #f2d5a8; color: #865a1d; background: #fff9ef; }
.coupon-recipient-result.is-warning strong { color: #9b5b09; }
.coupon-recipient-result.is-error { border-color: #efb5bd; color: #963c49; background: #fff4f5; }
.coupon-recipient-result.is-error strong { color: #ad3545; }
.member-coupon-selection { display: flex; align-items: flex-start; gap: 9px; }
.member-coupon-selection input { flex: 0 0 auto; width: auto; margin-top: 3px; }
.member-coupon-summary { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf7fd; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.7; }
.marketing-carousel-list { display: grid; gap: 16px; margin: 18px 0; }
.marketing-carousel-item { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fcfafd; }
.marketing-carousel-item > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #f7f2fb; }
.marketing-carousel-item > header strong, .marketing-carousel-item > header span { display: block; }
.marketing-carousel-item > header strong { font-size: 12px; }
.marketing-carousel-item > header span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.marketing-carousel-item > .form-grid { padding: 16px; }
.marketing-image-control { display: grid; grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr); gap: 14px; align-items: center; padding: 12px; border: 1px dashed #d9c9e5; border-radius: 12px; background: #fff; }
.marketing-image-control input[type="file"] { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 9px; font-size: 10px; }
.marketing-image-control .panel-actions { justify-content: flex-start; margin-top: 9px; }
.marketing-image-control small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.marketing-image-preview { display: grid; place-items: center; min-height: 105px; overflow: hidden; border-radius: 10px; color: var(--muted); background: #f5f1f7; font-size: 10px; text-align: center; }
.marketing-image-preview img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.storefront-decoration-form { display: grid; gap: 18px; padding-bottom: 96px; }
.storefront-intro .panel-header { align-items: flex-start; }
.storefront-intro .settings-note { margin: 0 20px 20px; }
.storefront-revision { display: grid; gap: 5px; justify-items: end; color: var(--purple); font-size: 11px; }
.storefront-revision small { color: var(--muted); font-size: 9px; }
.storefront-section .panel-header h2 { display: inline-block; margin-left: 8px; }
.storefront-step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--purple); background: #f3e9fb; font-size: 10px; font-weight: 800; }
.storefront-sort-list { display: grid; gap: 10px; }
.storefront-sort-card { display: grid; grid-template-columns: 34px minmax(220px, 1fr) minmax(130px, .35fr) auto; gap: 12px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fcfafd; }
.storefront-sort-card label { min-width: 0; }
.storefront-order { display: grid; place-items: center; align-self: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--purple); font-size: 11px; font-weight: 800; }
.storefront-stable-id { grid-column: 2 / -1; color: var(--muted); font-size: 9px; word-break: break-all; }
.storefront-add-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.storefront-add-row select { flex: 1; }
.storefront-featured-card { grid-template-columns: 34px 46px minmax(220px, 1fr) auto; align-items: center; }
.storefront-featured-card .product-thumb { width: 42px; height: 42px; border-radius: 9px; }
.storefront-featured-card .product-thumb.missing { display: grid; place-items: center; color: var(--muted); background: #f2edf5; }
.storefront-featured-card strong, .storefront-featured-card small { display: block; }
.storefront-featured-card small { margin-top: 4px; color: var(--muted); font-size: 9px; word-break: break-all; }
.storefront-confirm-bar { position: sticky; z-index: 8; bottom: 14px; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 15px 18px; border: 1px solid #d7c3e8; border-radius: 14px; background: rgba(255, 255, 255, .96); box-shadow: 0 14px 38px rgba(60, 25, 87, .16); backdrop-filter: blur(10px); }
.storefront-confirm-bar strong, .storefront-confirm-bar span { display: block; }
.storefront-confirm-bar strong { font-size: 12px; }
.storefront-confirm-bar span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.storefront-confirm-bar .primary:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.home-popup-carousel-item > header .panel-actions { flex-wrap: wrap; }
.home-popup-carousel-item > header button { padding: 7px 10px; font-size: 10px; }
.points-entry-plan p { margin: 10px 0 12px; }
.points-page-stack { display: grid; gap: 18px; }
.points-section-heading { padding: 0 2px; }
.points-rule-grid .detail-item { min-height: 92px; }
.points-privacy-note { margin: 16px 0; }
.points-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.points-pagination .panel-actions { display: flex; gap: 8px; }
.points-positive { color: var(--green); }
.points-negative { color: var(--red); }
.points-confirm { display: flex; align-items: center; gap: 9px; }
.points-confirm input { width: auto; flex: 0 0 auto; accent-color: var(--purple); }
.points-confirm span { margin: 0; }
.connection-state { display: flex; align-items: center; gap: 10px; padding: 14px; margin-bottom: 16px; border: 1px solid #dceee9; border-radius: 12px; background: #f0faf7; }
.connection-state.off { border-color: #efe4d7; background: #fff8ee; }
.connection-state .signal { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(25, 166, 106, .1); }
.connection-state.off .signal { background: var(--orange); box-shadow: 0 0 0 5px rgba(239, 141, 50, .1); }

.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 17px; border-radius: 11px; color: #fff; background: #2f2636; box-shadow: 0 14px 40px rgba(34, 22, 42, .25); animation: toastIn .2s; }
.toast.success { background: #147c58; }
.toast.error { background: #bd3f4b; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1000px) {
  .product-editor-layout { grid-template-columns: 1fr; }
  .product-editor-nav { z-index: 2; top: 80px; grid-template-columns: repeat(4, 1fr); }
  .product-editor-nav p { display: none; }
  .product-editor-nav button { grid-template-columns: 25px 1fr; padding: 7px; }
  .product-editor-nav button span { width: 24px; height: 24px; }
  .product-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .modal.product-editor-modal, .modal.shipping-editor-modal { width: 100%; }
  .shipping-editor-section { margin: 12px; }
  .shipping-basic-grid { grid-template-columns: 1fr; }
  .shipping-charge-modes { grid-template-columns: 1fr; }
  .shipping-rule-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shipping-rule-card > header { align-items: flex-start; flex-direction: column; }
  .shipping-rule-actions { flex-wrap: wrap; }
  .product-editor-layout { gap: 12px; padding: 12px; }
  .product-editor-nav { top: 74px; gap: 4px; padding: 7px; overflow-x: auto; }
  .product-editor-nav button { min-width: 108px; }
  .editor-basic-layout, .detail-editor-grid { grid-template-columns: 1fr; }
  .product-live-preview { width: min(280px, 100%); }
  .editor-subsection-head { align-items: stretch; flex-direction: column; }
  .image-source-actions { justify-content: flex-start; flex-wrap: wrap; }
  .image-source-actions input { width: 100%; }
  .image-dropzone { align-items: stretch; flex-direction: column; }
  .product-media-grid { grid-template-columns: 1fr; }
  .spec-group-row { grid-template-columns: 30px 1fr; }
  .spec-group-row .spec-values, .spec-group-row button { grid-column: 2; }
  .product-editor-actions { grid-template-columns: 1fr 1fr; }
  .product-editor-actions > div { grid-column: 1 / -1; }
  .storefront-sort-card, .storefront-featured-card { grid-template-columns: 34px 1fr; align-items: start; }
  .storefront-sort-card > label, .storefront-sort-card > div, .storefront-sort-card > small,
  .storefront-featured-card > div { grid-column: 2; }
  .storefront-featured-card .product-thumb { grid-column: 2; }
  .storefront-confirm-bar { grid-template-columns: 1fr 1fr; }
  .storefront-confirm-bar > div { grid-column: 1 / -1; }
}

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

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-toggle { display: block; }
  .dashboard-grid, .dashboard-grid.three, .settings-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .wide-filter { grid-column: span 2; }
  .today { display: none; }
  .shipping-province-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shipping-preview-layout { grid-template-columns: 1fr; }
  .refund-runtime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .login-brand { position: static; margin-bottom: 20px; }
  .login-view { display: flex; flex-direction: column; }
  .login-card { padding: 28px 22px; }
  .login-compliance { position: static; margin-top: 22px; }
  .workspace-compliance { padding: 0 14px 18px; }
  .topbar { padding: 13px 16px; }
  .topbar h1 { font-size: 18px; }
  .admin-chip { display: none; }
  .content { padding: 18px 14px 36px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 108px; padding: 15px; }
  .metric-value { font-size: 20px; }
  .filters { grid-template-columns: 1fr; }
  .filters .wide-filter { grid-column: auto; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .marketing-image-control { grid-template-columns: 1fr; }
  .points-pagination { align-items: stretch; flex-direction: column; }
  .refund-runtime-grid { grid-template-columns: 1fr; }
  .modal { width: 100%; }
  .shipping-rule-fields { grid-template-columns: 1fr; }
  .shipping-province-groups, .shipping-preview-inputs { grid-template-columns: 1fr; }
  .shipping-preview-region { grid-column: auto; }
  .shipping-rule-add, .shipping-editor-actions { align-items: stretch; flex-direction: column; }
  .shipping-rule-add button, .shipping-editor-actions button { flex: 1; }
}
