/* 双鸣好物集 管理后台 · 企业风设计系统
   中性灰底 + 深色侧栏 + 商务蓝主色；紧凑表格、统一 34px 控件高度、6px 圆角。 */
:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --line: #e4e7ec;
  --line-soft: #eef0f4;
  --text: #1d2129;
  --text-2: #4e5969;
  --muted: #86909c;
  --primary: #1f5bd6;
  --primary-hover: #1849b0;
  --primary-soft: #eef3fd;
  --success: #138a4a;
  --success-soft: #e8f6ee;
  --warning: #b86e00;
  --warning-soft: #fdf4e3;
  --danger: #cf3a2c;
  --danger-soft: #fdeeec;
  --sidebar: #141a24;
  --sidebar-2: #1d2532;
  --sidebar-text: #a9b1bd;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18);
  /* 兼容旧脚本中引用的变量名 */
  --green: var(--primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Inter, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
svg { display: block; }

/* ---------- 表单控件 ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  width: 100%; min-height: 34px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #c9ced6; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 91, 214, .12); }
input::placeholder, textarea::placeholder { color: #a9b0ba; }
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2386909c' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 11px center; }
input[type=checkbox] { width: 15px; min-height: 15px; height: 15px; padding: 0; margin: 0; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
input[type=file] { padding: 5px; background: var(--surface-2); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
label input, label select, label textarea { font-weight: 400; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text-2); cursor: pointer; }
.required { color: var(--danger); }
.subtle { color: var(--muted); font-size: 12px; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.inline-error { color: var(--danger); font-size: 12px; line-height: 1.6; }
.inline-error:empty { display: none; }

/* ---------- 按钮 ---------- */
.primary, .secondary, .danger, .small-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid transparent; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.danger { background: var(--surface); border-color: #f1c4bf; color: var(--danger); }
.danger:hover:not(:disabled) { background: var(--danger-soft); }
.small-button, .danger.small { min-height: 28px; padding: 0 10px; font-size: 12px; }
.small-button { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.small-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.text-button { border: 0; background: none; padding: 4px 6px; color: var(--primary); font-size: 13px; border-radius: 4px; }
.text-button:hover:not(:disabled) { background: var(--primary-soft); }
.full { width: 100%; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.delete-product { color: var(--danger) !important; }
.delete-product:hover:not(:disabled) { border-color: var(--danger) !important; background: var(--danger-soft) !important; }

/* ---------- 登录 ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #141a24 0, #141a24 42%, var(--bg) 42%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 10px; padding: 36px 32px 32px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.login-brand strong { display: block; font-size: 17px; }
.login-brand span:not(.brand-mark) { font-size: 12px; color: var(--muted); }
.login-card input { min-height: 40px; }
.login-card .primary { min-height: 40px; font-size: 14px; }
.login-remember { font-size: 13px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 600; font-size: 17px; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- 框架 ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 208px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; color: #fff; }
.brand:hover { color: #fff; }
.brand .brand-mark { width: 32px; height: 32px; font-size: 15px; }
.brand-text { font-size: 14px; font-weight: 600; line-height: 1.3; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); margin-top: 2px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-button { position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--sidebar-text); font-size: 14px; text-align: left; }
.nav-button svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-button small { display: none; }
.nav-button:hover { background: var(--sidebar-2); color: #fff; }
.nav-button.active { background: var(--primary); color: #fff; }
.nav-button.active svg { opacity: 1; }
.sidebar-bottom { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid #252e3c; font-size: 13px; color: #d5dae2; }
.sidebar-bottom .avatar { width: 28px; height: 28px; border-radius: 50%; background: #2a3445; display: grid; place-items: center; font-size: 12px; color: #fff; }
.sidebar-bottom #admin-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-bottom .text-button { color: var(--sidebar-text); font-size: 12px; }
.sidebar-bottom .text-button:hover { background: var(--sidebar-2); color: #fff; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.page-header { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-content { padding: 20px 28px 40px; max-width: 1600px; width: 100%; }
.page-panel { min-width: 0; }

/* ---------- 通用容器 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.panel > h2 { margin-bottom: 12px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.section-header p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter-fields { display: flex; gap: 8px; flex: 1; min-width: 0; }
.filter-fields input { max-width: 280px; }
.filter-fields select, #application-status { width: 140px; }
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.list-meta:has(> span:empty:only-child) { display: none; }
.notice { padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--success-soft); border: 1px solid #bfe5cd; color: var(--success); font-size: 13px; overflow-wrap: anywhere; }
.notice.error { background: var(--danger-soft); border-color: #f3c7c2; color: var(--danger); }
.info-strip { padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--text-2); font-size: 13px; }
.warning-box { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--warning-soft); border: 1px solid #f3dfb4; color: #8a5a00; font-size: 12px; line-height: 1.8; }
.warning-box ul { margin: 0; padding-left: 16px; }
.error-box { padding: 12px 14px; border-radius: var(--radius); background: var(--danger-soft); border: 1px solid #f3c7c2; color: var(--danger); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-state.compact { padding: 24px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 状态标签 ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; white-space: nowrap; color: var(--text-2); background: #f0f2f5; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.published, .badge.approved, .badge.active, .badge.ready, .badge.committed { color: var(--success); background: var(--success-soft); }
.badge.pending, .badge.processing, .badge.queued { color: var(--warning); background: var(--warning-soft); }
.badge.rejected, .badge.suspended, .badge.failed { color: var(--danger); background: var(--danger-soft); }
.badge.draft, .badge.archived { color: var(--muted); background: #f0f2f5; }
.cleanup-pending, .cleanup-processing { color: var(--warning); background: var(--warning-soft); }
.cleanup-retry, .cleanup-failed { color: var(--danger); background: var(--danger-soft); }
.cleanup-succeeded, .cleanup-complete { color: var(--success); background: var(--success-soft); }
.cleanup-retained { color: var(--primary); background: var(--primary-soft); }

/* ---------- 总览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); text-align: left; }
.stat-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(31, 91, 214, .08); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 30px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-note { font-size: 12px; color: var(--muted); }
.stat-card:hover .stat-note { color: var(--primary); }
.stat-card.attention .stat-value { color: var(--warning); }

/* ---------- 表格 ---------- */
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; height: 42px; padding: 0 14px; background: var(--surface-2); color: var(--text-2); font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: middle; }
tbody tr:hover td { background: #f9fafc; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.price { text-align: right; }
.actions-heading { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.row-actions .small-button, .row-actions .danger { min-height: 28px; padding: 0 10px; font-size: 12px; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.product-thumb { width: 44px; height: 44px; border-radius: 4px; border: 1px solid var(--line-soft); background: var(--surface-2); object-fit: contain; flex-shrink: 0; }
.image-placeholder { display: grid; place-items: center; color: #b8bec7; font-size: 10px; }
.product-name { color: var(--text); font-weight: 500; max-width: 340px; overflow-wrap: anywhere; line-height: 1.45; }
.product-model { font-size: 12px; color: var(--muted); margin-top: 2px; }
.price { color: var(--text); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price.retail-price { color: var(--text-2); font-weight: 400; }
.product-selection-cell { width: 44px; padding-left: 16px; padding-right: 4px; }
.table-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.list-count { font-size: 13px; color: var(--text-2); }
.products-selection-bar { display: flex; align-items: center; gap: 12px; }
.products-selection-summary { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.products-selection-summary strong { font-weight: 500; color: var(--text-2); }
#product-bulk-publish-hint, #product-bulk-publish-result { margin: 8px 16px; }
#product-bulk-publish-result ul { max-height: 240px; overflow: auto; padding-left: 20px; }

/* 高级操作折叠区 */
.advanced-panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.advanced-panel > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-size: 13px; color: var(--text-2); user-select: none; }
.advanced-panel > summary::-webkit-details-marker { display: none; }
.advanced-panel > summary::after { content: '展开'; float: right; color: var(--muted); font-size: 12px; }
.advanced-panel[open] > summary::after { content: '收起'; }
.advanced-panel[open] > summary { border-bottom: 1px solid var(--line); }
.advanced-panel > *:not(summary) { margin: 16px; }
.products-delete-all-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #f3d1cd; border-radius: var(--radius); background: #fffafa; }
.products-delete-all-bar strong { font-size: 13px; color: var(--danger); font-weight: 500; }
.products-delete-all-bar p { margin-top: 2px; }
.cleanup-toolbar { display: flex; gap: 8px; flex-shrink: 0; }
.cleanup-summary { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cleanup-table { min-width: 640px; }
.cleanup-key { font-size: 12px; max-width: 320px; overflow-wrap: anywhere; }
.cleanup-operation { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cleanup-last-error { font-size: 12px; color: var(--danger); max-width: 320px; overflow-wrap: anywhere; }
.products-delete-description { font-size: 14px; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.products-delete-warning { margin: 12px 0 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.7; }
#products-delete-confirmation-label { margin-bottom: 10px; }
#products-delete-dialog form { margin: 0; }

/* ---------- 弹窗 ---------- */
.editor-dialog, .review-dialog { width: calc(100% - 32px); max-width: 880px; max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.review-dialog { max-width: 520px; }
dialog::backdrop { background: rgba(15, 20, 30, .45); }
.dialog-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 16px; }
.dialog-header > div { min-width: 0; }
.dialog-header .subtle { margin-top: 2px; overflow-wrap: anywhere; }
.dialog-body { padding: 20px 24px; }
.dialog-body > p { margin-bottom: 14px; }
.dialog-body > label + label { margin-top: 14px; }
.dialog-footer { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.dialog-footer .inline-error { margin-right: auto; max-width: 65%; }
#homepage-slide-dialog .dialog-footer { flex-wrap: wrap; }
#homepage-dialog-progress { flex-basis: 100%; margin: 0; }

/* 产品编辑器 */
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.editor-grid .wide { grid-column: 1 / -1; }
.field-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.field-group-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field-group-header h3 { font-size: 13px; color: var(--text); }
.repeater-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.repeater-row input { flex: 1; min-width: 0; }
.repeater-row .remove-row { flex-shrink: 0; width: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.repeater-row .remove-row:hover { color: var(--danger); border-color: var(--danger); }
.image-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.image-preview img { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.image-preview a { display: block; }
.image-picker { align-items: flex-start; }
.image-tile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.image-tile.is-cover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.image-tile img { width: 112px; height: 112px; border: 0; background: var(--surface-2); }
.image-tile-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: space-between; }
.image-tile-actions .small-button { min-height: 24px; padding: 0 7px; font-size: 12px; }
.image-cover-badge { font-size: 12px; color: #fff; background: var(--primary); border-radius: 4px; padding: 1px 8px; }
.image-remove { color: var(--danger) !important; }
.image-picker-hint { flex-basis: 100%; }
.draft-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- 首页轮播 ---------- */
.homepage-settings { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.homepage-settings-fields { display: flex; align-items: center; gap: 20px; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; font-weight: 400; }
.inline-field input { width: 84px; }
.homepage-toolbar { display: flex; align-items: center; gap: 8px; margin: 0; }
.homepage-add-actions, .homepage-slide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#homepage-status { color: var(--warning); }
#homepage-error { margin-bottom: 10px; }
.homepage-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.homepage-slide { display: block; padding: 0; margin: 0; min-width: 0; }
.homepage-slide-preview { display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: zoom-in; }
.homepage-slide-preview:hover { border-color: var(--primary); }
.homepage-slide-image { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.homepage-slide-number { display: block; text-align: center; font-size: 12px; color: var(--muted); padding-top: 6px; }
.homepage-slide-large { display: block; width: 100%; height: 44vh; max-height: 460px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.homepage-slide-editor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.homepage-slide-editor > p { overflow-wrap: anywhere; }
.homepage-slide-actions .danger { margin-left: auto; }
.homepage-picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.homepage-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }
.homepage-image-grid > .empty-state { grid-column: 1 / -1; }
.homepage-image-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.homepage-image-choice:hover { border-color: var(--primary); color: var(--primary); }
.homepage-choice-image { width: 100%; height: 130px; object-fit: contain; background: var(--surface-2); border-radius: 4px; }
.homepage-share-settings { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 20px; align-items: center; }
.homepage-share-settings h2 { margin-bottom: 4px; }
.homepage-share-settings p { margin-bottom: 14px; }
.homepage-share-preview { aspect-ratio: 5 / 4; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.homepage-share-image { width: 100%; height: 100%; object-fit: cover; }
.homepage-share-preview > .subtle { padding: 16px; text-align: center; }

/* ---------- 批量导入 ---------- */
.upload-panel { padding: 20px; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 20px; border: 1px dashed #c6ccd5; border-radius: 8px; background: var(--surface-2); text-align: center; cursor: pointer; color: var(--text-2); font-weight: 400; transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 4px; }
.file-drop-icon svg { width: 20px; height: 20px; }
.file-drop strong { font-size: 14px; color: var(--text); font-weight: 500; }
.file-drop span { font-size: 12px; color: var(--muted); }
.file-drop input { max-width: 380px; margin-top: 8px; background: var(--surface); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-list:empty { display: none; }
.file-chip { padding: 4px 10px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 12px; overflow-wrap: anywhere; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.import-pricing-preset, .price-adjustment-panel { margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.import-pricing-preset:empty { display: none; }
.import-pricing-preset h3, .price-adjustment-panel h3 { font-size: 13px; margin-bottom: 2px; }
.price-rule-controls { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.price-rule-variants { grid-column: 1 / -1; }
.price-adjustment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.price-adjustment-preview { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.price-adjustment-preview table { min-width: 0; table-layout: fixed; }
.price-adjustment-preview th { height: 36px; }
.price-adjustment-preview td, .price-adjustment-preview th { padding: 6px 12px; }
.price-adjustment-preview th:first-child { width: 44%; }
.price-adjustment-preview td { overflow-wrap: anywhere; }
.price-variant-row td { font-size: 12px; color: var(--muted); }

.import-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.import-history { padding: 14px 10px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.import-history-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.import-history-heading .text-button { color: var(--danger); font-size: 12px; }
.job-list { display: flex; flex-direction: column; gap: 4px; }
.job-row { position: relative; min-width: 0; }
.job-button { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; text-align: left; color: var(--text); }
.job-button:hover { background: var(--surface-2); }
.job-button.active { background: var(--primary-soft); border-color: #cddaf6; }
.job-filenames { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; padding-right: 34px; }
.job-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.job-meta .badge { height: 20px; font-size: 11px; }
.job-clear { position: absolute; top: 8px; right: 6px; font-size: 12px; color: var(--muted); padding: 2px 6px; }
.job-clear:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.import-detail { padding: 20px 22px; min-height: 280px; }
.job-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.job-heading h2 { font-size: 16px; margin-bottom: 2px; overflow-wrap: anywhere; }
.job-time { font-size: 12px; color: var(--muted); }
.progress-track { height: 4px; margin: 16px 0; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.progress-track span { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--primary); animation: progress 1.4s ease-in-out infinite alternate; }
@keyframes progress { from { transform: translateX(-60%); } to { transform: translateX(200%); } }
.operation-progress { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.operation-progress-label { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.operation-progress progress { display: block; width: 100%; height: 6px; margin-top: 8px; accent-color: var(--primary); }
.operation-progress-detail { margin-top: 4px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.operation-progress-detail:empty { display: none; }
.operation-progress[data-status=error] { background: var(--danger-soft); border-color: #f3c7c2; }
.operation-progress[data-status=error] .operation-progress-label, .operation-progress[data-status=error] .operation-progress-detail { color: var(--danger); }
.operation-progress[data-status=complete] { border-color: #bfe5cd; }
#import-save-progress { margin: 0; }

.draft-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; margin-top: 16px; border-top: 1px solid var(--line-soft); }
.draft-toolbar > :nth-child(2) { margin-right: auto; font-size: 13px; color: var(--text-2); }
.draft-count { font-size: 13px; font-weight: 500; }
.draft-hint { margin: 12px 0 0; }
.import-draft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.draft-card { position: relative; min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.draft-card:hover { border-color: #c4cdd9; box-shadow: 0 4px 12px rgba(16, 24, 40, .06); }
.draft-price-selection { position: absolute; top: 14px; left: 14px; z-index: 1; flex-direction: row; align-items: center; gap: 0; font-size: 0; }
.draft-price-selection input { width: 16px; height: 16px; background: #fff; box-shadow: 0 0 0 2px #fff; border-radius: 3px; }
.draft-preview { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; }
.draft-thumb-frame { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.draft-preview .draft-cover { display: block; width: 100%; height: 100%; object-fit: contain; }
.draft-preview .draft-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.draft-preview .draft-price { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: pre-line; overflow-wrap: anywhere; max-width: 100%; }
.draft-publish-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.draft-validation-note { margin-top: 4px; font-size: 12px; color: var(--danger) !important; }
.draft-duplicate { border-color: #ecd3a0; }
.draft-preview .duplicate-badge { align-self: flex-start; }
.duplicate-badge { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--warning-soft); color: var(--warning); font-size: 11px; line-height: 20px; }
.drafts-empty { grid-column: 1 / -1; padding: 24px 0; }
.draft-dialog .draft-editor { padding: 0; }
.draft-dialog-preview { margin-bottom: 18px; }
.draft-dialog-image { display: block; width: 100%; height: 36vh; max-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

.import-duplicates, .import-rejections { margin: 8px 0 0; padding: 10px 14px; border-radius: 8px; }
.import-duplicates { border: 1px solid #f0dcb0; background: #fffbf2; }
.import-rejections { border: 1px solid #f3c7c2; background: #fffafa; }
.import-duplicates > summary, .import-rejections > summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.import-duplicates > summary { color: var(--warning); }
.import-rejections > summary { color: var(--danger); }
.import-duplicates > .subtle { margin: 2px 0 6px; }
.duplicate-row, .import-rejection-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(0, 0, 0, .06); }
.import-duplicates summary + p + .duplicate-row { border-top: 0; }
.duplicate-info, .import-rejection-row > div { flex: 1; min-width: 0; }
.duplicate-info strong, .import-rejection-row strong { font-size: 13px; font-weight: 500; color: var(--text); }
.duplicate-info p { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.import-rejection-row p { font-size: 12px; color: var(--danger); margin-top: 2px; }
.duplicate-control select { width: 200px; }
.import-accepted-summary { margin-bottom: 14px; }

.commit-panel { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 20px -22px -20px; padding: 10px 22px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; backdrop-filter: blur(6px); }
.commit-panel > p { font-size: 12px; color: var(--muted); }
.commit-actions { display: flex; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; max-width: 100%; overflow-x: auto; }
.commit-actions button { white-space: nowrap; flex-shrink: 0; }
.commit-panel #import-save-progress { flex: 1 1 220px; }
.import-action-error { padding: 10px 14px; border: 1px solid #f3c7c2; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.import-issue-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.import-issue-details > summary { cursor: pointer; margin-top: 6px; }
.import-issue-details .import-issue-list { max-height: 240px; overflow: auto; }
.import-issue-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid #f3c7c2; }
.import-issue-row > div { min-width: 0; }
.import-issue-name { font-weight: 500; }
.import-action-error .import-issue-row p { font-size: 12px; color: var(--danger); margin-top: 2px; }

.unmatched-gallery { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.unmatched-gallery h3 { margin-bottom: 2px; }
.unmatched-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 12px; }
.unmatched-image-link { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.unmatched-thumb { width: 100%; height: 100px; object-fit: contain; }
.unmatched-image-link > span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.unmatched-image-select { color: var(--primary); }

/* ---------- 认证与店铺 ---------- */
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.review-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.review-card-header p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.review-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0; font-size: 13px; }
.review-info dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.review-info dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.review-reason { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-note { margin-top: 10px; font-size: 12px; color: var(--warning); }
.review-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- 响应式 ---------- */
@media (min-width: 1440px) { .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 14px 10px; }
  .brand { justify-content: center; padding: 2px 0 18px; }
  .brand-text, .nav-button span, .sidebar-bottom #admin-name, .sidebar-bottom .avatar { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .sidebar-bottom { justify-content: center; padding: 12px 0 0; }
  .import-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .review-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; }
  .sidebar nav { flex-direction: row; gap: 4px; }
  .nav-button { width: 40px; height: 36px; flex-shrink: 0; }
  .sidebar-bottom { margin: 0 0 0 auto; border: 0; padding: 0; }
  .page-header { position: static; height: 52px; padding: 0 16px; }
  .page-content { padding: 14px 16px 32px; }
  .toolbar, .filter-fields, .form-footer, .homepage-settings, .homepage-settings-fields, .homepage-toolbar, .section-header, .products-delete-all-bar, .table-head-bar { flex-direction: column; align-items: stretch; }
  .table-head-bar { padding: 10px 14px; }
  .filter-fields input, .filter-fields select, #application-status { max-width: none; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 24px; }
  .import-layout { grid-template-columns: minmax(0, 1fr); }
  .import-history { position: static; max-height: none; }
  .job-list { flex-direction: row; overflow-x: auto; }
  .job-row { flex-shrink: 0; width: 220px; }
  .import-draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-grid, .price-rule-controls, .homepage-picker-fields, .homepage-share-settings, .review-info { grid-template-columns: minmax(0, 1fr); }
  .duplicate-row, .import-rejection-row { flex-wrap: wrap; }
  .duplicate-control, .duplicate-control select { width: 100%; }
  .commit-panel { margin: 16px -16px -16px; padding: 12px 16px; }
  .homepage-slides { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-dialog, .review-dialog { width: 100%; max-width: none; max-height: 100vh; border-radius: 0; }
}

/* ---------- 补充：总览快捷操作、改价折叠、文件选择 ---------- */
.overview-quick-panel { margin-top: 16px; }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-action { height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 14px; text-align: left; display: flex; align-items: center; justify-content: space-between; }
.quick-action::after { content: '→'; color: var(--muted); }
.quick-action:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.quick-action:hover::after { color: var(--primary); }
.preset-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text); }
.preset-details > summary::-webkit-details-marker { display: none; }
.preset-details > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.preset-details[open] > summary::before { transform: rotate(45deg); }
.preset-details[open] > summary { margin-bottom: 4px; }
.import-pricing-preset { padding: 12px 16px; }
.file-drop { position: relative; }
.file-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; max-width: none; }
@media (max-width: 780px) { .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) { .commit-panel { position: static; } }

/* =====================================================================
   结构重做：产品分类导航 + 状态标签、侧滑编辑抽屉、导入步骤与逐款核对、
   总览工作台、认证申请表格
   ===================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.primary-soft { background: var(--primary-soft) !important; border-color: #cddaf6 !important; color: var(--primary) !important; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tab-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: #eceff3; color: var(--text-2); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* 状态标签（产品 / 认证申请共用） */
.status-tabs { display: flex; align-items: center; gap: 2px; padding: 3px; background: #e9ecf1; border-radius: 8px; flex-wrap: wrap; }
.status-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; }
.status-tab:hover { color: var(--text); }
.status-tab.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.status-tab.active .tab-count { background: var(--primary-soft); color: var(--primary); }
.status-tab.warn .tab-count { background: var(--warning-soft); color: var(--warning); }

/* 产品管理布局 */
.products-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.category-nav { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding: 10px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.category-nav-title { padding: 4px 10px 8px; font-size: 12px; color: var(--muted); }
.draftbox-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.draftbox-toolbar { gap: 12px; justify-content: space-between; }
.draftbox-toolbar input { width: min(300px, 100%); }
.draftbox-heading { padding: 16px 18px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.draftbox-publish-bar { display: flex; align-items: center; gap: 12px; }
.draftbox-select-all { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.draftbox-publish-hint { margin: 0 18px 8px; }
.draftbox-publish-result { margin: 0 18px 10px; }
.draftbox-publish-result ul { margin: 6px 0 0; padding-left: 18px; }
.draftbox-pick { flex: none; width: 18px; height: 18px; }
.draftbox-heading p { margin: 5px 0 0; }
.draftbox-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.draftbox-image { width: 64px; height: 64px; flex: none; object-fit: contain; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-2); }
.draftbox-info { min-width: 0; flex: 1; }
.draftbox-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draftbox-source { color: var(--muted); font-size: 12px; }
.draftbox-info > .subtle { margin-top: 3px; }
.draftbox-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.draftbox-tag { display: inline-block; color: #9a4b08; background: #fff3de; border-radius: 4px; padding: 2px 7px; font-size: 12px; }
.draftbox-tag.clear { color: #16805a; background: #eaf7ef; }
.draftbox-details { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .draftbox-layout { grid-template-columns: 1fr; } .draftbox-types { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; } }
@media (max-width: 780px) { .draftbox-toolbar { align-items: stretch; } .draftbox-toolbar input { width: 100%; } .draftbox-row { align-items: flex-start; gap: 9px; padding: 12px; } .draftbox-image { width: 48px; height: 48px; } }
.category-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2); font-size: 13px; text-align: left; }
.category-item:hover { background: var(--surface-2); color: var(--text); }
.category-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.category-item.child { padding-left: 24px; font-size: 12px; height: 30px; }
.category-item.empty { color: #b3b9c2; }
.category-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.category-item.active .category-count { color: var(--primary); }
.products-toolbar { flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-right input { width: 240px; }
.table-tip { margin-right: auto; padding-left: 12px; }
.category-cell { white-space: nowrap; }

/* 行内改价 */
.price-edit { min-height: 28px; padding: 0 8px; margin-right: -8px; border: 1px dashed transparent; border-radius: 4px; background: none; color: inherit; font: inherit; font-weight: inherit; white-space: nowrap; }
.price-edit:hover:not(:disabled) { border-color: #b9c6dc; background: var(--primary-soft); color: var(--primary); }
.pending-price .price-edit { color: var(--warning); font-weight: 500; }
.price-input { width: 108px; min-height: 30px; padding: 4px 8px; text-align: right; }

/* 产品编辑：右侧抽屉 */
#product-dialog { position: fixed; inset: 0 0 0 auto; width: min(760px, 100vw); max-width: none; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; animation: drawer-in .2s ease-out; }
#product-dialog[open] { display: flex; }
#product-dialog > form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
#product-dialog .dialog-body { flex: 1; overflow: auto; padding-top: 0; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 编辑器分区 */
.editor-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; margin: 0 -24px 4px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.editor-tab { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.editor-tab:hover { border-color: var(--primary); color: var(--primary); }
.editor-section { padding: 18px 0 20px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 56px; }
.editor-section:last-child { border-bottom: 0; }
.editor-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--text); }
.editor-section-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }
.editor-section .field-group { margin-top: 16px; padding-top: 0; border-top: 0; }
.editor-section .image-preview { margin-top: 0; }
.image-address, .pricing-fold { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.image-address > summary, .pricing-fold > summary { cursor: pointer; padding: 9px 12px; font-size: 13px; color: var(--text-2); list-style: none; }
.image-address > summary::-webkit-details-marker, .pricing-fold > summary::-webkit-details-marker { display: none; }
.image-address > summary::after, .pricing-fold > summary::after { content: '展开'; float: right; font-size: 12px; color: var(--muted); }
.image-address[open] > summary::after, .pricing-fold[open] > summary::after { content: '收起'; }
.image-address > .editor-grid { padding: 4px 12px 12px; }
.pricing-fold > .price-adjustment-panel { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.pricing-fold > .price-adjustment-panel > h3 { display: none; }

/* 批量导入 */
.import-layout { grid-template-columns: 240px minmax(0, 1fr); }
.import-new { margin-bottom: 14px; }
.import-new.active { box-shadow: 0 0 0 3px rgba(31, 91, 214, .18); }
.import-main { min-width: 0; }
.import-main > .panel { margin-bottom: 0; }
.import-steps { display: flex; list-style: none; margin: 4px 0 20px; padding: 0; counter-reset: none; }
.import-step { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; position: relative; }
.import-step:not(:last-child)::after { content: ''; flex: 1; height: 1px; margin: 0 12px; background: var(--line); }
.import-step.done:not(:last-child)::after { background: var(--primary); }
.step-index { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.import-step.done { color: var(--text-2); }
.import-step.done .step-index { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary); }
.import-step.current { color: var(--text); font-weight: 500; }
.import-step.current .step-index { background: var(--primary); border-color: var(--primary); color: #fff; }
.import-step.error .step-index { background: var(--danger); border-color: var(--danger); color: #fff; }
.step-label { white-space: nowrap; }
.import-detail { display: block; }
.import-detail .job-heading { flex-wrap: wrap; }
.import-detail .job-heading > .import-steps { flex-basis: 100%; margin: 14px 0 2px; }
.import-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.import-done-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; font-size: 22px; margin-bottom: 6px; }
.import-done h3 { font-size: 16px; }
.import-done-actions { display: flex; gap: 8px; margin-top: 12px; }
.draft-toolbar { margin-top: 8px; }
.draft-toolbar .primary.small { min-height: 30px; padding: 0 12px; font-size: 12px; }
.draft-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.draft-filter { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.draft-filter.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.draft-filter.flag-review .tab-count, .draft-filter.flag-duplicate .tab-count, .draft-filter.flag-warning .tab-count { background: var(--warning-soft); color: var(--warning); }
.draft-filter.flag-invalid .tab-count { background: var(--danger-soft); color: var(--danger); }
.draft-pricing { margin: 0 0 12px; }
.draft-card[data-flags~="review"] .draft-price { color: var(--warning); font-weight: 500; }

/* 逐款核对：左原图、右编辑，底部上一款 / 下一款 */
.draft-dialog { max-width: 1180px; width: calc(100% - 48px); height: calc(100vh - 48px); }
.draft-dialog[open] { display: flex; flex-direction: column; }
.draft-dialog .dialog-body.draft-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; padding: 0; overflow: hidden; }
.draft-source-pane { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface-2); border-right: 1px solid var(--line); overflow: auto; }
.draft-source-pane .draft-dialog-preview { margin: 0; flex: 1; min-height: 0; }
.draft-source-pane .draft-dialog-image { height: 100%; max-height: none; min-height: 320px; background: var(--surface); }
.draft-source-label { text-align: center; }
.draft-edit-pane { overflow: auto; padding: 0 24px 20px; }
.draft-edit-pane .editor-tabs { margin: 0 -24px 4px; }
.draft-edit-pane .product-editor > .warning-box:first-child { margin-top: 16px; }
.draft-position { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 84px; text-align: center; }
.footer-spacer { flex: 1; }
.draft-dialog .dialog-footer { justify-content: flex-start; }

/* 总览工作台 */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.overview-grid .panel { margin: 0; }
.todo-list, .recent-list { display: flex; flex-direction: column; }
.todo-item, .recent-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; color: var(--text); }
.todo-item:last-child, .recent-item:last-child { border-bottom: 0; }
.todo-item:hover, .recent-item:hover { background: var(--surface-2); }
.todo-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-text strong { font-size: 14px; font-weight: 500; }
.todo-count { font-size: 22px; font-weight: 600; color: #c0c6cf; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.todo-item.has-value .todo-count { color: var(--warning); }
.recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.recent-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 认证申请详情 */
.detail-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#application-detail-dialog .dialog-header > div { display: flex; align-items: center; gap: 10px; }

@media (max-width: 1100px) {
  .products-layout { grid-template-columns: minmax(0, 1fr); }
  .category-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .category-nav-title { display: none; }
  .category-item, .category-item.child { width: auto; padding: 0 10px; }
  .draft-dialog .dialog-body.draft-split { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .draft-source-pane { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .draft-source-pane .draft-dialog-image { min-height: 0; height: 32vh; }
  .draft-edit-pane { overflow: visible; }
}
@media (max-width: 780px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .toolbar-right input { width: 100%; }
  .table-tip { display: none; }
  .import-steps .step-label { display: none; }
  .draft-dialog { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
  #product-dialog { width: 100vw; }
}

.category-toggle { width: 100%; margin-top: 6px; font-size: 12px; text-align: left; padding: 6px 10px; }
.duplicate-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.duplicate-box .duplicate-control select { width: 190px; background-color: #fff; }
.recognition-originals, .recognition-evidence { margin-top: 1rem; }
.recognition-originals pre, .recognition-evidence pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto; }
@media (max-width: 1100px) { .import-layout { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 780px) {
  .import-layout { grid-template-columns: minmax(0, 1fr); }
  .commit-actions { flex-wrap: wrap; overflow-x: visible; }
}

/* 识别器拿不准的草稿 */
.review-badge { background: var(--danger-soft, #fdecec); color: var(--danger, #c0392b); }
