@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7f3;
  --panel: #ffffff;
  --ink: #25342b;
  --muted: #6f8073;
  --line: #e8eee8;
  --line-strong: #dfe8df;
  --forest: #173d30;
  --forest-soft: #d6ebdb;
  --accent: #c8e883;
  --accent-ink: #244630;
  --danger: #b4483c;
  --danger-soft: #fbeceb;
  --amber: #ab6134;
  --amber-soft: #faede1;
  --ok: #2f7a52;
  --ok-soft: #e8f4ec;
  --blue: #35617e;
  --blue-soft: #e9f1f7;
  --shadow: 0 1px 2px rgba(23, 61, 48, 0.05), 0 8px 24px rgba(23, 61, 48, 0.05);
  --radius: 12px;
  font-family: 'DM Sans', 'Noto Sans SC', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #82b99a; outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 15% 10%, #e6f1e3, transparent 45%), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.auth-brand b { display: block; font-size: 17px; }
.auth-brand small { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.6; }
.auth-note { margin-top: 16px; padding: 11px 13px; border-radius: 10px; background: #f3f6f1; color: var(--muted); font-size: 12px; line-height: 1.65; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: 0 0 236px; background: var(--forest); color: #eaf3ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; overflow-y: auto; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.13); margin-bottom: 14px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.brand b { display: block; font-size: 16px; letter-spacing: 0.3px; }
.brand small { display: block; color: #b2cbb6; font-size: 10px; margin-top: 2px; letter-spacing: 0.6px; }
.nav-label { color: #8fb19e; text-transform: uppercase; font-size: 10px; letter-spacing: 1.5px; padding: 9px 14px; }
.nav-btn { width: 100%; border: 0; background: transparent; color: #c6d9ca; text-align: left; padding: 10px 13px; border-radius: 9px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; margin: 2px 0; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-btn.active { background: var(--forest-soft); color: #194431; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.nav-count { margin-left: auto; background: #faede1; color: #ab6134; border-radius: 6px; padding: 1px 6px; font-size: 10px; }
.side-bottom { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.13); padding: 14px 6px 2px; }
.side-user { color: #dbeadf; font-size: 12px; line-height: 1.6; padding: 0 8px; }
.side-user b { display: block; font-size: 13px; color: #fff; }
.side-hint { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 10px 11px; font-size: 11px; line-height: 1.6; color: #c1d3c7; background: rgba(255, 255, 255, 0.04); margin-top: 10px; }
.side-hint b { color: #d5ee8e; }

.main { flex: 1; min-width: 0; }
.topbar { height: 66px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; gap: 14px; position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--forest-soft); color: #194431; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.content { padding: 24px 26px 60px; max-width: 1500px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 5px; }
.page-heading h1 { font-size: 25px; letter-spacing: -0.2px; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.6; }
.h-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 基础组件 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.line { height: 1px; background: var(--line); margin: 16px 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; } .sidebar { display: none; } .content { padding: 18px 14px 50px; } }

.btn { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 9px; padding: 9px 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.btn:hover { border-color: #b9cfc0; background: #fbfdfb; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: #1e4b3b; }
.btn.soft { background: #eef5ea; border-color: #d9e8d5; color: #295640; }
.btn.danger { background: var(--danger-soft); border-color: #eecdc9; color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.tiny { padding: 4px 8px; font-size: 11px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f3f6f1; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #f0f2f1; color: #64766a; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: #46584b; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field input, .field select, .field textarea { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 10px; font-size: 13px; background: #fff; min-height: 40px; width: 100%; }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #91b69d; box-shadow: 0 0 0 3px rgba(168, 206, 173, 0.22); outline: none; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.req { color: #b4483c; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .field-grid.two, .field-grid.three { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media (max-width: 760px) { .span2 { grid-column: auto; } }

.filterbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filterbar input, .filterbar select { border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; font-size: 13px; background: #fff; min-height: 38px; }
.filterbar .search { min-width: 260px; flex: 1; max-width: 360px; }
.recycle-picker { margin-top:8px; max-height:230px; overflow:auto; border:1px solid var(--line); border-radius:9px; background:#fff; }
.recycle-picker-item { display:flex; align-items:flex-start; gap:9px; padding:8px 10px; border-bottom:1px solid var(--line); font-size:12px; cursor:pointer; }
.recycle-picker-item:last-child { border-bottom:0; }
.recycle-picker-item:hover { background:#f7f9f6; }
.recycle-picker-item input { margin-top:2px; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th { text-align: left; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); padding: 11px 14px; background: #f7f9f6; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tr:hover td { background: #fbfdfb; }
.product-cell { display: flex; align-items: center; gap: 10px; }
.thumb { width: 42px; height: 42px; border-radius: 9px; background: #f0f3ef; border: 1px solid var(--line); object-fit: cover; display: grid; place-items: center; color: #9bac9f; font-size: 16px; flex: 0 0 42px; }
.product-cell strong { display: block; font-size: 13px; }
.product-cell small { color: var(--muted); font-size: 11px; }

.stat-card { position: relative; padding: 16px 18px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-num { font-size: 28px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -0.5px; }
.stat-note { font-size: 11px; color: var(--muted); line-height: 1.5; }
.stat-icon { position: absolute; right: 14px; top: 14px; color: #c7d8cc; font-size: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
.tab.active { color: #194431; border-bottom-color: var(--forest); background: #f6faf4; }
.tab .count { margin-left: 6px; background: #f0f2f1; border-radius: 8px; padding: 1px 6px; font-size: 10px; color: #64766a; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* ---------- 步骤条 ---------- */
.wizard-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.step-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.step-item.current { color: var(--ink); font-weight: 600; }
.step-bubble { width: 26px; height: 26px; border-radius: 50%; background: #eef1ee; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #7c8d80; }
.step-item.current .step-bubble { background: var(--forest); color: #fff; }
.step-item.done .step-bubble { background: var(--forest-soft); color: #194431; }
.step-rule { flex: 1; height: 1px; background: var(--line-strong); min-width: 20px; }
.wizard-bottom { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.form-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-title h2 { font-size: 15px; }
.form-title small { color: var(--muted); font-size: 11px; }
.section-number { font-size: 11px; font-weight: 700; color: #7c8d80; background: #f0f3ef; border-radius: 6px; padding: 3px 6px; }

/* ---------- 图片位 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-slot { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px; background: #fbfcfb; position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 168px; }
.photo-slot.filled { border-style: solid; background: #fff; }
.photo-slot b { font-size: 12px; font-weight: 600; }
.photo-slot small { font-size: 11px; color: var(--muted); }
.photo-preview { width: 100%; height: 82px; border-radius: 8px; background: #f0f3ef; display: grid; place-items: center; overflow: hidden; color: #9bac9f; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: 6px; }
.photo-actions button { border: 1px solid var(--line-strong); background: #fff; border-radius: 7px; font-size: 11px; padding: 4px 8px; }
.photo-caption { border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 7px; font-size: 11px; width: 100%; }
/* 标准槽 Caption 由编号/固定英文自动生成，只读避免误填；旧数据不一致时用按钮一键改标准值。 */
.photo-caption[readonly] { background: #f4f7f3; color: #52655a; cursor: default; }
.photo-caption-note { font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.photo-caption-note.warn-text { color: #a46a12; }
.photo-slot { outline: none; }
.photo-slot:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.photo-slot.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.photo-color .search-select-trigger { min-height: 30px; font-size: 11px; padding: 4px 7px; }
.photo-color .search-select-menu { font-size: 11px; }
.hidden { display: none !important; }

/* ---------- 价格表 ---------- */
.price-scroll { overflow-x: auto; }
table.price-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 780px; }
table.price-table th, table.price-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.price-table th { background: #f7f9f6; font-size: 11px; color: var(--muted); font-weight: 600; }
table.price-table td:first-child { background: #fbfcfb; font-weight: 600; color: #46584b; width: 190px; }
table.price-table input, table.price-table select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 6px; font-size: 12px; min-width: 78px; }
.calc { color: #194431; font-weight: 600; }
.calc.final { color: #1d5c3d; background: #eef7f0; }

/* ---------- 详情 ---------- */
.detail-hero { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .detail-hero { grid-template-columns: 1fr; } }
.detail-photo { width: 100%; aspect-ratio: 1; border-radius: 12px; background: #f0f3ef; overflow: hidden; display: grid; place-items: center; color: #9bac9f; }
.detail-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gallery img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: #fff; }
.detail-rows { display: grid; gap: 0; margin-top: 6px; }
.detail-row { display: grid; grid-template-columns: 190px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row b { font-weight: 600; color: #46584b; font-size: 12px; }
.copy-paragraphs { white-space: pre-wrap; }
@media (max-width: 640px) { .detail-row { grid-template-columns: 1fr; gap: 3px; } }

/* 市场参考汇率卡片专用布局：管理设置是双栏，卡片位于半宽的 .field-grid.two 内，
   不能复用 .detail-row 的 190px 固定标签列（会把值列挤到约 60px，中文逐字换行、数字竖排）。
   这里标签与值同行、可自然折行；参考值整行显眼；数值与文字完整横向显示。右侧 ASI 卡仍用 .detail-row。 */
.fx-meta-rows { display: grid; gap: 0; margin-top: 8px; min-width: 0; }
.fx-rate-hero { padding: 6px 0 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.fx-rate-hero .fx-rate-label { display: block; font-size: 12px; font-weight: 600; color: #46584b; margin-bottom: 3px; }
.fx-rate-hero .fx-rate-value { display: block; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; font-weight: 600; }
.fx-meta-row { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.fx-meta-row:last-child { border-bottom: 0; }
.fx-meta-row > b { flex: 0 0 auto; font-weight: 600; color: #46584b; font-size: 12px; }
.fx-meta-row > span { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.fx-meta-row > span > small { display: inline-block; line-height: 1.6; }

.notice { border-radius: 10px; padding: 11px 13px; font-size: 12px; line-height: 1.65; border: 1px solid; }
.notice.info { background: var(--blue-soft); border-color: #d3e3ee; color: #2c5570; }
.notice.warn { background: var(--amber-soft); border-color: #f0ddc9; color: #8d5327; }
.notice.bad { background: var(--danger-soft); border-color: #eecdc9; color: #92392f; }
.notice.ok { background: var(--ok-soft); border-color: #cfe6d6; color: #256344; }
/* 渠道单价来源分解：基础运价 + 附加费 = 当前单价（只读展示，不参与计算） */
.rate-formula { margin-top: 3px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.rate-formula span { white-space: normal; }
.rate-formula b { color: var(--ink); font-size: 12.5px; }
.rate-version { color: var(--muted); }
/* 本渠道沿用旧表：与「生效运价 v3」并排，避免员工把 v3 的局部调价当成该渠道也调过价。 */
.rate-source { margin-top: 4px; padding: 4px 7px; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: 4px; font-size: 11.5px; line-height: 1.55; color: #8d5327; }
.rate-source .badge { margin-right: 4px; }
.rate-pending { margin-top: 6px; }
.rate-pending b { display: block; margin-bottom: 2px; }

.validation-list { display: grid; gap: 7px; }
.validation-item { font-size: 12px; line-height: 1.6; padding: 8px 11px; border-radius: 8px; }
.validation-item.bad { background: var(--danger-soft); color: #92392f; }
.validation-item.warn { background: var(--amber-soft); color: #8d5327; }
.validation-item.ok { background: var(--ok-soft); color: #256344; }

/* ---------- 弹层与提示 ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 40, 30, 0.42); display: flex; justify-content: flex-end; z-index: 60; }
.modal { width: min(560px, 100%); background: #fff; height: 100%; overflow-y: auto; padding: 22px 24px 40px; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.12); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; }
.modal-head h2 { font-size: 17px; }
.modal-close { border: 0; background: #f0f3ef; border-radius: 8px; width: 30px; height: 30px; font-size: 16px; color: #64766a; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: #1c3d31; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #8f3a30; }

.kv { font-size: 12px; color: var(--muted); line-height: 1.7; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #f2f6f0; border: 1px solid #e0e9dd; color: #3b5844; border-radius: 20px; padding: 3px 10px; font-size: 11px; }
.chip button { border: 0; background: transparent; color: #7c8d80; padding: 0 0 0 4px; }
.countdown { font-variant-numeric: tabular-nums; color: var(--amber); font-weight: 600; }
.notice-list { max-height: 380px; overflow-y: auto; display: grid; gap: 8px; }
.notice-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6; background: #fbfdfb; }
.notice-item b { display: block; font-size: 12px; margin-bottom: 2px; }
.notice-item time { color: var(--muted); font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.permission-grid label { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: #46584b; }
.permission-grid input { margin-top: 2px; }
.permission-grid label.disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 620px) { .permission-grid { grid-template-columns: 1fr; } }

/* ---------- 第二阶段：运价与调价 ---------- */
.modal.modal-wide { width: min(880px, 100%); }
.fr-thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.fr-thumbs figure { margin: 0; width: 168px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.fr-thumbs img { display: block; width: 100%; height: 108px; object-fit: cover; background: #f2f5f1; }
.fr-thumbs figcaption { padding: 7px 8px; font-size: 11px; line-height: 1.5; color: var(--muted); word-break: break-all; }
.fr-thumbs figcaption .btn { margin-top: 5px; }
.card .section-head h3 { font-size: 14px; }
.price-table td .badge { white-space: nowrap; }
.grid.three .notice.info { min-height: 96px; }
/* 待确认项筛选与进度：165 项逐项核对，不因分页而丢失或跳过规则 */
.fr-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.fr-filter-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.fr-progress { height: 8px; border-radius: 6px; background: #e7eee4; overflow: hidden; margin: 8px 0 6px; }
.fr-progress span { display: block; height: 100%; background: #4f8a5b; transition: width .2s ease; }
.fr-thumbs figure { max-width: 220px; }
.fr-thumbs figcaption .btn.tiny { padding: 2px 6px; font-size: 10px; }
.price-scroll .price-table select { max-width: 220px; }
.fr-inline-resolutions { display: grid; gap: 7px; margin-top: 8px; }
.fr-inline-item { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; }
.fr-inline-item .fr-inline-label { font-weight: 400; }
.fr-inline-item .fr-inline-control { margin-top: 5px; }
.fr-inline-item input[data-fr-res] { max-width: 360px; }
.fr-inline-item details { margin-top: 5px; }
.fr-inline-item summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.fr-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.fr-inline-resolutions [data-fr-inline-feedback] { margin: 0; }

/* 第三阶段 §2：统计与对比是工作台内可展开 / 收起的板块，行数多时在板块内滚动。 */
.stats-panel { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats-panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.stats-panel > summary::-webkit-details-marker { display: none; }
.stats-panel > summary::before { content: '▸'; color: var(--muted); font-size: 13px; margin-right: 2px; }
.stats-panel[open] > summary::before { content: '▾'; }
.stats-panel > summary > span:first-child { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; }
.stats-panel[open] > summary { border-bottom-color: var(--line-strong); }
.stats-panel-body { padding: 16px 18px 18px; }
.stats-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.stats-filters label.small { display: inline-flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; }
.stats-filters .btn { font-size: 12px; }
.stats-filters input[type="number"] { width: 96px; }
.stats-scroll { max-height: 340px; overflow-y: auto; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.stats-scroll table.data-table th { position: sticky; top: 0; z-index: 1; }
.stats-scroll table.data-table { min-width: 720px; }
.stats-panel .notice { margin-left: 0; margin-right: 0; }

/* ASI 勾选列表：员工直接勾选已审核产品与拟下架旧品，不显示内部 ID */
.asi-picker { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }
.asi-pick-row { display: grid; grid-template-columns: 18px 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.asi-pick-row + .asi-pick-row { border-top: 1px solid var(--line); }
.asi-pick-row:hover { background: #f7faf6; }
.asi-pick-row.is-disabled { cursor: default; opacity: .72; }
.asi-pick-row input { width: 16px; height: 16px; }
.asi-pick-main { min-width: 0; }
.asi-pick-main strong { display: block; font-size: 12.5px; }
.asi-pick-main small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asi-pick-state { text-align: right; font-size: 11px; max-width: 200px; }
.asi-pick-row[hidden] { display: none; }
@media (max-width: 760px) {
  .asi-pick-row { grid-template-columns: 18px 42px minmax(0, 1fr); }
  .asi-pick-state { grid-column: 2 / -1; text-align: left; max-width: none; }
}

/* ---------- 录入页：基础资料逐行布局（已确认测试版结构） ---------- */
.basics-rows { display: grid; gap: 10px; }
.basics-row { display: grid; gap: 12px 14px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.basics-row .field { gap: 5px; }
.basics-row .field label { font-size: 11.5px; }
.basics-row.purpose-material { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.basics-row.size-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.basics-row.imprint-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.3fr) minmax(0, 1fr); }
.basics-row.lead-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.basics-row.packing-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.6fr) minmax(0, 0.7fr) minmax(0, 1.5fr); }
.basics-row.origin-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.basics-row.supplier-contact-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .basics-row.size-row, .basics-row.imprint-row, .basics-row.packing-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .basics-row, .basics-row.size-row, .basics-row.imprint-row, .basics-row.lead-row,
  .basics-row.packing-row, .basics-row.origin-row, .basics-row.supplier-contact-row,
  .basics-row.purpose-material { grid-template-columns: 1fr; }
}

/* ---------- 录入页：固定单位的尺寸盒（In / lbs 贴在框内） ---------- */
.dimension-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dimension-box { display: flex; align-items: center; gap: 6px; flex: 1 1 96px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 0 9px; min-height: 40px; }
.dimension-box:focus-within { border-color: #91b69d; box-shadow: 0 0 0 3px rgba(168, 206, 173, 0.22); }
.dimension-axis { font-size: 11px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.dimension-box input { border: 0 !important; background: transparent; padding: 0 !important; min-height: 0 !important; width: 100%; min-width: 0; font-size: 13px; box-shadow: none !important; }
.dimension-unit { font-size: 11px; color: #96a79b; flex: 0 0 auto; }
.dimension-times { color: #a9b8ad; font-size: 12px; flex: 0 0 auto; }
.fixed-unit-field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 0 10px; min-height: 40px; }
.fixed-unit-field:focus-within { border-color: #91b69d; box-shadow: 0 0 0 3px rgba(168, 206, 173, 0.22); }
.fixed-unit-field input { border: 0 !important; background: transparent; padding: 0 !important; min-height: 0 !important; width: 100%; font-size: 13px; box-shadow: none !important; }
.fixed-unit-field span { font-size: 11px; color: #96a79b; }

/* ---------- 录入页：可搜索下拉（印花方式 / 印花位置 / 单色 Caption） ---------- */
.search-select { position: relative; }
.search-select-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 8px 10px; font-size: 13px; text-align: left; }
.search-select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-select-chevron { color: #96a79b; font-size: 12px; flex: 0 0 auto; }
.search-select-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.search-select-menu[hidden] { display: none; }
.search-select-menu input[type="search"] { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 8px; font-size: 12px; }
.search-select-options { max-height: 216px; overflow-y: auto; display: grid; gap: 2px; }
.search-select-option { border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 6px; font-size: 12px; color: var(--ink); }
.search-select-option:hover { background: #f2f6f1; }
.search-select-option.selected { background: var(--forest-soft); color: var(--forest); font-weight: 600; }
.search-select-option[hidden] { display: none; }
.search-select-add { border: 1px dashed var(--line-strong); background: #fbfcfb; border-radius: 7px; padding: 7px 8px; font-size: 12px; text-align: left; color: var(--forest); }
.search-select-add[hidden] { display: none; }

/* ---------- 录入页：供应商凭证缩略图 ---------- */
.proof-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 8px; }
.proof-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.proof-preview { height: 66px; display: grid; place-items: center; background: #f3f6f2; color: var(--muted); font-size: 11px; font-weight: 600; overflow: hidden; }
.proof-preview img { width: 100%; height: 100%; object-fit: cover; }
.proof-name { padding: 4px 6px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proof-remove { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(23, 61, 48, 0.72); color: #fff; font-size: 11px; line-height: 1; padding: 0; }
.supplier-card .section-head { margin-bottom: 8px; }

/* 供应商凭证上传区域：可点击聚焦（粘贴）、可拖入文件、有明显的「上传文件」按钮。 */
.proof-zone { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 10px; background: #f7faf7; outline: none; }
.proof-zone:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.proof-zone.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
/* 运价页两个上传区域（完整运价表 / 运价截图）：可拖入、可聚焦粘贴，拖拽经过时高亮。 */
.freight-drop-zone { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 10px; background: #f7faf7; outline: none; cursor: default; }
.freight-drop-zone:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.freight-drop-zone.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.freight-drop-hint { color: var(--muted); }

/* 录入页附件位（规格书 / 证明文件）：一个位置一份，可拖入、可聚焦粘贴，图片给缩略图。 */
.attach-zone { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 8px 10px; background: #f7faf7; outline: none; display: flex; flex-direction: column; gap: 6px; }
.attach-zone:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.attach-zone.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.attach-body { min-height: 34px; display: flex; align-items: center; }
.attach-empty { font-size: 12px; color: var(--muted); }
.attach-file { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attach-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.attach-badge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 6px; background: #eef2ee; font-size: 11px; font-weight: 600; color: #4b5b4d; }
.attach-name { font-size: 12px; word-break: break-all; }
.attach-status { font-size: 11px; color: var(--forest); }
.attach-status:empty { display: none; }
.attach-hint { font-size: 11px; color: var(--muted); }

/* 导出页纯表格区（DC 旧表 / 当前模板）：可拖入、可聚焦粘贴，按各自原格式收文件。 */
.export-zone { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 8px 10px; background: #f7faf7; outline: none; display: flex; flex-direction: column; gap: 6px; }
.export-zone:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.export-zone.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.export-zone-inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; padding: 6px 8px; }
.export-hint { font-size: 11px; color: var(--muted); }

/* 候选详情「继续追加截图」区：拖入/粘贴多张，与追加按钮共用校验。 */
.freight-append-zone { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 8px 10px; background: #f7faf7; outline: none; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.freight-append-zone:focus-visible { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.freight-append-zone.drag-over { border-color: var(--forest); border-style: solid; background: var(--forest-soft, #eef5ef); box-shadow: 0 0 0 2px rgba(31, 92, 62, 0.16); }
.proof-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proof-hint { font-size: 11px; color: var(--muted); }
.proof-busy { font-size: 12px; color: var(--forest); margin: 6px 0; }

/* ---------- 录入页：颜色对照（中文原文 → 平台英文） ---------- */
.color-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; padding: 10px 12px; }
.color-panel-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.color-panel-head b { font-size: 12px; color: #46584b; }
.color-panel-head .small { font-size: 11px; line-height: 1.5; }
.color-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.color-table th, .color-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.color-table th { font-size: 11px; color: var(--muted); font-weight: 600; background: #f4f7f3; }
.color-table tr.bad td { background: #fdf6f5; }
.color-table td b { color: #1d5c3d; }
.color-fix { width: 100%; min-height: 32px !important; border: 1px solid #e6c9a8 !important; border-radius: 7px; padding: 4px 8px !important; font-size: 12px; background: #fff !important; }
.color-final { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); font-size: 12px; }
.color-final b { color: #1d5c3d; }

/* ---------- 录入页：21 规范色根 + 「描述词 + 色根」规则展示 ---------- */
.color-roots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 8px; }
.color-roots .small { margin-right: 2px; }
.color-root { display: inline-block; padding: 1px 6px; border-radius: 5px; background: #f0f4ef; color: #4a5d50; font-size: 10.5px; font-weight: 600; }
.color-rule { display: block; margin-top: 2px; font-size: 10.5px; color: #8a9a8f; font-weight: 400; }

/* ---------- 录入页：包装方式单选（SAGE Item Packaging 16 项候选，只能选 1 项） ---------- */
.packaging-field select { width: 100%; }
.packaging-picked { margin-top: 8px; font-size: 12px; color: var(--forest); }
.packaging-picked b { font-weight: 600; }
.packaging-alert { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #fdf3e7; border: 1px solid #f0d9b8; color: #8a5a1f; font-size: 12px; line-height: 1.7; }
.packaging-alert b { font-weight: 600; }
.packaging-alert .btn { margin-left: 6px; vertical-align: baseline; }

/* ---------- 录入第三步：当前草稿完整预览（差异.md 第 9 项） ---------- */
.draft-preview .section-head { margin-bottom: 10px; }
.draft-preview-scroll { max-height: 76vh; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 11px; background: #fcfdfc; padding: 18px 20px; }
.preview-hero { padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.preview-title { font-size: 24px; line-height: 1.3; margin: 4px 0 8px; letter-spacing: -0.2px; }
.preview-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink); margin-top: 4px; }
.preview-meta b { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; min-width: 62px; }
.preview-section { padding: 14px 0; border-bottom: 1px dashed var(--line-strong); }
.preview-section:last-child { border-bottom: 0; padding-bottom: 4px; }
.preview-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.preview-section-head h3 { font-size: 12px; letter-spacing: 0.6px; color: #46584b; text-transform: uppercase; margin-right: auto; }
.preview-rows { display: grid; gap: 6px; }
.preview-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 12px; font-size: 12.5px; line-height: 1.65; align-items: start; }
.preview-row > b { color: #5b6d60; font-weight: 600; }
.preview-row > .preview-value { color: var(--ink); word-break: break-word; min-width: 0; }
.preview-text { font-size: 13px; line-height: 1.8; color: #3d5246; white-space: pre-wrap; margin-bottom: 8px; }
.preview-blank { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 600; }
.preview-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 10px; }
.preview-image { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; }
.preview-image-missing { border-color: #eecdc9; background: #fdf8f7; }
.preview-thumb { aspect-ratio: 1; border-radius: 8px; background: #f2f5f1; display: grid; place-items: center; overflow: hidden; color: #9aab9e; font-size: 11px; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-image b { font-size: 12px; color: #3f5347; }
.preview-caption { font-size: 11px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.preview-file { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-supplier { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; }
.preview-supplier + .preview-supplier { margin-top: 10px; }
.preview-supplier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.preview-supplier-head b { font-size: 12.5px; color: var(--forest); }
.preview-fees { font-size: 12px; }
.preview-proofs { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-proof { margin: 0; width: 78px; display: flex; flex-direction: column; gap: 3px; }
.preview-proof img, .preview-proof-file { width: 78px; height: 58px; border-radius: 7px; border: 1px solid var(--line); object-fit: cover; display: grid; place-items: center; background: #f3f6f2; color: var(--muted); font-size: 11px; font-weight: 600; }
.preview-proof figcaption { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.preview-table th, .preview-table td { border-bottom: 1px solid var(--line); padding: 8px 9px; text-align: left; vertical-align: top; }
.preview-table th { background: #f4f7f3; font-size: 10.5px; letter-spacing: 0.3px; color: var(--muted); text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.preview-table td:first-child { font-weight: 600; color: #46584b; white-space: nowrap; }
.preview-platforms { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .preview-row { grid-template-columns: 1fr; gap: 2px; }
  .draft-preview-scroll { padding: 14px; max-height: none; }
}

/* ---------- 已批准渠道目录：员工可选渠道（2026-11-13 新增需求） ---------- */
.fr-channel-tools { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf6; }
.fr-channel-count { padding-bottom: 9px; white-space: nowrap; }
.fr-channel-count b { font-size: 15px; color: var(--forest); }
[data-fr-channel-row][hidden] { display: none; }
.channel-stopped { color: #9a6a12; font-weight: 600; }

/* ---------- AI 帮写（第五阶段）：生成建议 → 逐项预览 → 单项应用 ---------- */
.ai-suggest-block { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ai-suggest-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfa; padding: 12px 14px; }
.ai-suggest-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ai-suggest-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ai-suggest-row b { font-size: 12.5px; }
.ai-suggest-value { margin-top: 4px; font-size: 13px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.ai-suggest-value .chip { margin: 1px 2px 1px 0; }
.ai-suggest-actions { display: flex; align-items: center; white-space: nowrap; }
.ai-suggest-actions button[disabled] { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 720px) { .ai-suggest-row { grid-template-columns: 1fr; } }
