:root {
  --bg: #f8f4ee;
  --panel: #fffdfa;
  --ink: #2c211b;
  --ink-soft: #4d3f36;
  --muted: #8b7b6e;
  --line: #eee2d6;
  --line-strong: #e0d0c2;
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-soft: #fdeee2;
  --accent: #a16207;
  --accent-soft: #fdf3e2;
  --danger: #bf4038;
  --danger-soft: #fbeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(74, 44, 25, 0.05), 0 10px 30px rgba(74, 44, 25, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
input, select, textarea { outline: none; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.spacer { flex: 1; }

/* ---------------- Layout shell ---------------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 208px; flex: 0 0 208px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 10px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease;
  z-index: 45;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 8px; }
.side-brand .logo { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; font-size: 16px; }
.side-title { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: 0; white-space: normal; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--ink-soft); font-weight: 500; text-align: left;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-item:hover { background: #f7f0e8; color: var(--brand-dark); }
.side-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; }
.side-icon svg { width: 19px; height: 19px; }
.side-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-item .badge { margin-left: auto; }
.side-toggle {
  margin-top: auto; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fcf8f2; color: var(--muted); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.side-toggle:hover { color: var(--brand); border-color: var(--line-strong); }
.side-toggle svg { width: 18px; height: 18px; transition: transform 0.18s ease; }

/* 侧栏底部：账号与折叠 */
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-me {
  display: flex; align-items: center; gap: 9px;
  min-width: 0; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #f8f2ea;
}
.me-avatar {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12px; font-weight: 700;
}
.me-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-meta span { font-size: 11px; color: var(--muted); white-space: nowrap; }
#app.side-collapsed .side-me { justify-content: center; padding: 7px 0; }
#app.side-collapsed .me-meta { display: none; }

/* 设置面板入口 */
.pref-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.pref-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fdfaf6; text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pref-row:hover { border-color: var(--line-strong); background: #f9f3ea; }
.pref-icon {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.pref-icon svg { width: 18px; height: 18px; }
.pref-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pref-text strong { font-size: 13px; }
.pref-text span { font-size: 11.5px; color: var(--muted); }
.pref-arrow { color: var(--muted); font-size: 18px; line-height: 1; }

/* 折叠：只保留图标 */
#app.side-collapsed .sidebar { width: 64px; flex-basis: 64px; padding-left: 8px; padding-right: 8px; }
#app.side-collapsed .side-title,
#app.side-collapsed .side-label,
#app.side-collapsed .side-item .badge { display: none; }
#app.side-collapsed .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
#app.side-collapsed .side-item { justify-content: center; padding: 9px 0; }
#app.side-collapsed #sideToggle svg { transform: rotate(180deg); }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #e07b39, #c2410c);
  color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 6px 14px rgba(194, 65, 12, 0.25);
  overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text h1 { font-size: 16px; letter-spacing: 0.5px; }
.brand-text p { font-size: 11.5px; color: var(--muted); letter-spacing: 0.3px; }

.tabs { display: flex; gap: 4px; background: #f3ebe1; padding: 4px; border-radius: 11px; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 18px; border-radius: 8px;
  color: var(--ink-soft); font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--brand-dark); }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 4px rgba(74, 44, 25, 0.1); }
.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--brand-soft);
  color: var(--brand); font-size: 11px; font-weight: 600;
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.page-head { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.page-head h1 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.page-head p { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0; }
.key-state {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.key-state.ok { background: var(--brand-soft); color: var(--brand); }

/* ---------------- Layout ---------------- */
main { width: 100%; padding: 22px 28px 48px; max-width: 1680px; margin: 0 auto; min-width: 0; }

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

.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 0;
}
.panel-head h2 { font-size: 15.5px; }
.panel-head p { margin-top: 3px; }

.chip {
  padding: 5px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; white-space: nowrap; font-weight: 500;
}
.chip.warn { background: #fdf1d9; color: #946200; }
.chip.muted { background: #eef0f2; color: #5a6570; }

.workbench {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.intake { padding-bottom: 20px; position: sticky; top: 88px; }
.intake > *:not(.panel-head) { margin-left: 22px; margin-right: 22px; }
@media (min-width: 1181px) {
  .intake { max-height: calc(100vh - 110px); overflow-y: auto; }
}

/* ---------------- Dropzone ---------------- */
.dropzone {
  margin-top: 18px;
  border: 1.5px dashed var(--line-strong);
  background: #fcf8f2;
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dz-icon {
  width: 42px; height: 42px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 50%; background: #fff; color: var(--brand);
  font-size: 22px; border: 1px solid var(--line);
}
.dz-title { font-weight: 600; color: var(--ink); }
.dz-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.file-list { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 10px; background: #fffdfa;
}
.file-type {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  background: var(--brand-soft); color: var(--brand);
  text-transform: uppercase;
}
.file-type.warn { background: var(--accent-soft); color: var(--accent); }
.file-main { min-width: 0; flex: 1; }
.file-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-meta .ok { color: var(--brand); }
.file-meta .warn { color: var(--accent); }
.file-role {
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 3px 5px; font-size: 11px; color: var(--ink-soft);
}
.icon-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 7px; font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: #f5efe8; color: var(--ink); }

.paste-block { margin-top: 16px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.label-row label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
textarea {
  width: 100%; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; background: #fffdfa; line-height: 1.6;
}
textarea:focus, input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1); }

.intake-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */
.btn {
  border: 1px solid transparent; cursor: pointer;
  padding: 8px 15px; border-radius: 9px;
  font-weight: 500; font-size: 13px;
  transition: all 0.15s ease; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(194, 65, 12, 0.18); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.primary:disabled { opacity: 0.55; cursor: wait; }
.btn.ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.lg { padding: 10px 20px; font-size: 14px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #f6dcd9; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

/* ---------------- Drafts ---------------- */
.drafts { padding-bottom: 20px; min-height: 320px; }
.draft-list { display: grid; gap: 16px; padding: 16px 22px 0; }
.draft-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.draft-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #fcf8f2; border-bottom: 1px solid var(--line);
}
.draft-card-head h3 { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-card-body { padding: 16px; }
.draft-card-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; border-top: 1px dashed var(--line); background: #fffdfa;
}

/* ---------------- Form ---------------- */
.form-section + .form-section { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 12px;
}
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-section-title .tag {
  text-transform: none; letter-spacing: 0;
  font-weight: 500; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
}
.form-section-title .tag.manual { background: var(--accent-soft); color: var(--accent); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field.span-2 { grid-column: span 2; }
.field > span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.field > span em { font-style: normal; color: var(--danger); margin-left: 2px; }
.field input, .field select {
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; background: #fff; width: 100%; min-width: 0;
}
.field input::placeholder { color: #b9a99a; }
.field .inline { display: flex; gap: 6px; }
.field .inline input { flex: 1; }

.extra-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.extra-row input { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 0; }
.add-extra { margin-top: 4px; }

.track-list { display: grid; gap: 8px; }
.track-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(120px, 1fr) auto auto auto 26px;
  gap: 8px; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fffdfa;
}
.track-carrier,
.track-no {
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 9px; background: #fff; min-width: 0;
}
.track-carrier { min-width: 80px; }
.track-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.track-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; color: var(--ink-soft); }
.track-check input { width: auto; }
.track-row.track-locked {
  background: #f2ebe4;
  border-color: var(--line);
}
.track-row.track-locked .track-carrier,
.track-row.track-locked .track-no {
  background: #f0e8e0;
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}
.track-row.track-locked .track-time,
.track-row.track-locked .track-check {
  color: var(--muted);
}
.track-pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px;
}
.track-pager:empty { display: none; }
.track-pager .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.summary-box {
  background: #fcf8f2; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; color: var(--ink-soft); white-space: pre-wrap;
}
.summary-box + .summary-box { margin-top: 10px; }
.summary-label { font-size: 11.5px; font-weight: 600; color: var(--brand); margin-bottom: 4px; }

.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-item {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; background: #fffdfa; font-size: 12px; max-width: 100%;
}
.attach-item a { color: var(--ink-soft); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.attach-item a:hover { color: var(--brand); }
.attach-item .role { font-size: 10.5px; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; }
.attach-item .role.attachment { color: var(--accent); background: var(--accent-soft); }

.main-image-row { display: flex; gap: 8px; align-items: center; }
.main-image-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; background: #fff;
}
.main-image-preview {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: #fcf8f2 center/cover no-repeat; flex: none;
}

.file-text {
  margin: 6px 0 0; padding: 10px 12px; max-height: 220px; overflow: auto;
  background: #f8f2ea; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all;
  color: var(--ink-soft); font-family: inherit;
}
.mt-8 { margin-top: 8px; }

/* ---------------- Table ---------------- */
.library { padding-bottom: 16px; }
.lib-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 20px 22px; flex-wrap: wrap;
}
.lib-title h2 { font-size: 16px; }
.lib-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-filters input, .lib-filters select {
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 11px; background: #fff;
}
.lib-filters input { width: 280px; }

/* 未入库 / 已入库 切换 */
.status-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(74, 44, 25, 0.05);
}
.status-opt {
  border: 0; background: none; padding: 5px 11px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.status-opt b { font-weight: 600; margin-left: 2px; }
.status-opt.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(74, 44, 25, 0.12); }

/* 多选 */
.btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.col-select { width: 38px; text-align: center; }
.check-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line-strong); background: #fff; vertical-align: middle;
}
.check-box.on { background: var(--brand); border-color: var(--brand); }
.check-box.on::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
tr.is-selected td { background: var(--brand-soft); }
.lib-card { position: relative; }
.lib-card .card-check { position: absolute; top: 8px; left: 8px; z-index: 2; }
.lib-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.select-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(74, 44, 25, 0.18);
}
.select-count { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }

.columns-wrap { position: relative; }
.column-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 320px; max-width: calc(100vw - 24px); max-height: 62vh;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; box-shadow: 0 16px 40px rgba(74, 44, 25, 0.16);
}
.column-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.column-panel-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.column-panel-sub { display: none; font-size: 11.5px; color: var(--muted); }
.column-close { display: none; }
.column-list { display: grid; gap: 3px; }
.column-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 7px; }
.column-row:hover { background: #faf4ec; }
.column-row label { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; min-width: 0; }
.column-row input[type="checkbox"] { width: auto; margin: 0; }
.column-move {
  width: 22px; height: 22px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--muted); font-size: 11px; cursor: pointer;
}
.column-move:hover:not(:disabled) { color: var(--brand); border-color: var(--line-strong); }
.column-move:disabled { opacity: 0.35; cursor: default; }
/* 拖动排序手柄 */
.drag-handle {
  flex: none; width: 20px; height: 22px; padding: 0;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--muted); font-size: 14px; line-height: 1;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.drag-handle:hover { color: var(--brand); background: #faf4ec; }
.drag-handle:active { cursor: grabbing; }
.drag-handle.disabled { opacity: 0.25; cursor: default; }
.column-row.dragging, .export-row.dragging {
  opacity: 0.7; background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.column-panel .hint { margin-top: 8px; }

/* 字段设置面板里的分区与筛选项 */
.panel-block + .panel-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel-block-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.filter-rows { display: grid; gap: 7px; }
.filter-row { display: flex; align-items: center; gap: 6px; }
.filter-label { flex: none; width: 58px; font-size: 12.5px; color: var(--ink-soft); }
.filter-row select {
  flex: 1 1 0; min-width: 0; width: auto;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 8px; background: #fff; font-size: 12.5px;
}
/* 双滑块区间 */
.range-box { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dual-range { position: relative; height: 22px; }
.dual-range::before,
.dual-range::after {
  content: ''; position: absolute; top: 9px; height: 4px; border-radius: 999px; pointer-events: none;
}
.dual-range::before { left: 0; right: 0; background: var(--line-strong); }
.dual-range::after { left: var(--lo, 0%); right: calc(100% - var(--hi, 100%)); background: var(--brand); }
.dual-range input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.dual-range input[type="range"]:focus { outline: none; }
.dual-range input[type="range"]::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
  width: 16px; height: 16px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(74, 44, 25, 0.2);
}
.dual-range input[type="range"]::-moz-range-track { height: 22px; background: transparent; border: 0; }
.dual-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: pointer;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(74, 44, 25, 0.2);
}
.range-text { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.2; }
/* 手机端类目选择页 */
.category-pick-btn { display: none; }
.category-page { z-index: 130; }
.category-options { display: grid; gap: 6px; padding-bottom: 18px; }
.category-group { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.category-option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.category-option:hover { border-color: var(--brand); }
.category-option.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.table-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); display: block; }
.table-link { color: var(--brand); font-size: 12px; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-wrap { overflow: auto; padding: 0 8px; }
.lib-cards { display: none; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1140px; }
.data-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fcf8f2; position: sticky; top: 0;
}
.data-table td { padding: 12px; border-bottom: 1px solid #f0e8e0; vertical-align: top; }
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }
.data-table tbody tr:hover { background: #faf4ec; }
.cell-title { font-weight: 600; color: var(--ink); max-width: 300px; }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 催寄样 / 催链接 提醒特效 */
.urge-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 12px; padding: 12px 14px;
  border: 1px solid #f4d69b; border-radius: 12px;
  background: linear-gradient(120deg, #fffaf0, #fff4dc);
  box-shadow: 0 6px 18px rgba(191, 124, 18, 0.08);
  animation: urgeBannerIn 0.35s ease;
}
.urge-banner-icon {
  position: relative; width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: #f59e0b; color: #fff; font-weight: 800;
}
.urge-banner-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: urgeRing 1.8s ease-out infinite;
}
.urge-banner-main strong { font-size: 13px; color: #92400e; }
.urge-banner-main p { font-size: 12px; color: #a16207; margin-top: 3px; line-height: 1.6; }
.urge-banner-chip { display: inline-block; padding: 1px 8px; margin-right: 5px; border-radius: 999px; font-weight: 600; }
.urge-banner-chip.sample { background: #fde68a; color: #92400e; }
.urge-banner-chip.link { background: #bfdbfe; color: #1e40af; }

.urge-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.urge-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.urge-tag::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; animation: urgeDot 1.2s ease-in-out infinite;
}
.urge-tag.sample { background: #fef3c7; color: #b45309; }
.urge-tag.link { background: #dbeafe; color: #1d4ed8; }

.urge-row.sample { --urge-glow: rgba(245, 158, 11, 0.5); }
.urge-row.link { --urge-glow: rgba(59, 130, 246, 0.45); }
.urge-row { animation: urgeRowGlow 1.8s ease-in-out infinite; }
.urge-row.sample td { background: #fffaf0; }
.urge-row.link td { background: #f5f9ff; }
.urge-row.sample td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.urge-row.link td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
.urge-row td:last-child { box-shadow: inset -3px 0 0 var(--urge-glow); }

.urge-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid; border-radius: 12px;
}
.urge-alert.sample { background: #fff8ec; border-color: #f6d9a8; }
.urge-alert.link { background: #f2f7ff; border-color: #c9dcfb; }
.urge-alert-main { flex: 1; min-width: 0; }
.urge-alert-main strong { display: block; font-size: 13px; }
.urge-alert.sample .urge-alert-main strong { color: #92400e; }
.urge-alert.link .urge-alert-main strong { color: #1e40af; }
.urge-alert-main p { margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--ink-soft); word-break: break-word; }
.urge-alert-main p.urge-reason { color: #1d4ed8; font-weight: 600; }
.urge-alert > .btn { flex: none; }
.urge-alert-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.urge-pulse {
  position: relative; width: 9px; height: 9px; flex: none;
  margin-top: 5px; border-radius: 50%; background: #f59e0b;
}
.urge-alert.link .urge-pulse { background: #3b82f6; }
.urge-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: urgeRing 1.6s ease-out infinite;
}
.urge-flash { animation: urgeFlash 1.9s ease; }

.field > span.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.urge-last { font-size: 11px; color: var(--muted); }

.urge-log-list { display: grid; gap: 6px; }
.urge-log-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fdfaf6; font-size: 12px;
}
.urge-log-type,
.urge-log-status {
  flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.urge-log-type.sample { color: #92400e; background: #fff3d6; }
.urge-log-type.link { color: #1e40af; background: #e8f0ff; }
.urge-log-status { color: var(--muted); background: #f2ebe4; font-weight: 500; }
.urge-log-status.clear { color: #3f7a4a; background: #eaf4ec; }
.urge-log-text { flex: 1; min-width: 120px; color: var(--ink-soft); word-break: break-word; }
.urge-log-time { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }

.urge-modal { max-width: 480px; }
.urge-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.urge-modal-icon {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: #fff3d6; color: #b45309; font-weight: 800;
}
.urge-modal textarea {
  width: 100%; resize: vertical; min-height: 90px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 9px 10px; font-family: inherit; font-size: 13px; line-height: 1.6;
}

@keyframes urgeRing {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes urgeDot {
  50% { opacity: 0.25; transform: scale(0.7); }
}
@keyframes urgeRowGlow {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 6px var(--urge-glow, rgba(245, 158, 11, 0.45))); }
}
@keyframes urgeFlash {
  0%, 100% { box-shadow: none; }
  20%, 60% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35); }
}
@keyframes urgeBannerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes notifNudge {
  0%, 88%, 100% { transform: none; }
  91% { transform: rotate(-4deg); }
  94% { transform: rotate(4deg); }
  97% { transform: rotate(-2deg); }
}
.notif-btn.has-unread { animation: notifNudge 2.4s ease-in-out infinite; }
.notif-btn .badge { animation: urgeDot 1.4s ease-in-out infinite; }
.price-main { font-weight: 600; color: var(--brand-dark); display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; }
.price-item { white-space: nowrap; }
.price-was { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
.price-now { color: var(--brand); font-weight: 700; }
.price-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.expiry-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.expiry-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand-dark);
}
.expiry-badge.expiry-red {
  background: #fdecea; color: #c0392b; font-weight: 700;
  border: 1px solid #f3bdb7;
}
.expiry-badge.expiry-amber { background: #fdf3e5; color: #b06616; }
.expiry-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.expiry-line .expiry-sub { margin-top: 0; }
.status-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.status-pill.draft { background: var(--accent-soft); color: var(--accent); }
.status-pill.inStock { background: var(--brand-soft); color: var(--brand); }
.sample-pill { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; }
.sample-pill.yes { background: var(--brand-soft); color: var(--brand); }
.sample-pill.no { background: #f3ece5; color: var(--muted); }
.col-actions { text-align: right; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty {
  text-align: center; padding: 56px 20px; color: var(--muted);
}
.empty-mark {
  width: 48px; height: 48px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: #f5efe8; color: #b3a69a; font-weight: 700;
}
.empty p { color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }
.empty span { font-size: 12px; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 14px 22px 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 8px;
  cursor: pointer; color: var(--ink-soft); font-size: 12.5px;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-info { font-size: 12px; color: var(--muted); margin-right: 6px; }
#invitePagination, #notifPagination, #archivePagination, .live-item-pagination, .log-pagination { padding: 10px 0 0; }

/* ---------------- Drawer ---------------- */
.drawer-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(45, 28, 16, 0.28);
  transition: opacity 0.2s;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: 94vw; max-width: 620px;
  background: #fff;
  box-shadow: -10px 0 40px rgba(74, 44, 25, 0.14);
  display: flex; flex-direction: column;
  animation: slide-in 0.22s ease;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 16px; }
.drawer-head .icon-btn { margin-left: auto; font-size: 22px; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 28px; }
.drawer-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 22px; border-top: 1px solid var(--line); background: #fdfaf6;
}

/* ---------------- Modal ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(45, 28, 16, 0.32);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 560px;
  background: #fff; border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(74, 44, 25, 0.25);
  animation: pop 0.18s ease;
}
.modal.small { width: 100%; max-width: 420px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal > .field { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.check-row input { margin-top: 2px; }
.modal-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }

/* ---------------- Toast ---------------- */
/* ============================ 登录 / 角色 ============================ */

.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 18% 14%, rgba(194, 65, 12, 0.10), transparent 38%),
    radial-gradient(circle at 82% 82%, rgba(200, 160, 90, 0.18), transparent 42%),
    #faf4ee;
}
.auth-card {
  width: 100%; max-width: 430px; min-width: 0; padding: 30px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(74, 44, 25, 0.12);
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .logo { margin: 0 auto 10px; width: 46px; height: 46px; font-size: 22px; }
.auth-brand h1 { font-size: 21px; margin-bottom: 4px; }
.auth-brand p { font-size: 12.5px; color: var(--muted); }
.auth-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.auth-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.auth-form { display: grid; gap: 12px; }
.auth-form .field { display: grid; gap: 5px; }
.auth-form .field span { font-size: 12px; color: var(--ink-soft); }
.auth-form input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: #fff; font-size: 13.5px;
}
.auth-form .btn { width: 100%; justify-content: center; }
.auth-error { display: none; padding: 8px 11px; border-radius: 8px; background: #fdecea; color: #c0392b; font-size: 12.5px; }
.auth-error.show { display: block; }
.auth-switch { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.auth-switch a { color: var(--brand); text-decoration: none; }
.auth-badge { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; }

/* 注册 / 审核流程步骤与提示 */
.auth-steps {
  display: flex; gap: 6px; margin: 0 0 14px; padding: 0;
  list-style: none; counter-reset: auth-step;
}
.auth-steps li {
  flex: 1; padding: 6px 4px; border-radius: 8px;
  background: #f8f4ee; color: var(--muted);
  font-size: 11.5px; text-align: center; white-space: nowrap;
}
.auth-steps li::before { counter-increment: auth-step; content: counter(auth-step) ". "; }
.auth-steps li.done { background: var(--brand-soft); color: var(--brand-dark); }
.auth-steps li.active { background: var(--brand); color: #fff; font-weight: 600; }
.auth-note {
  margin: 0 0 14px; padding: 10px 12px;
  border-radius: 10px; background: #fdf6e7; border: 1px solid #f3e3c0;
  color: #8a5c1c; font-size: 12.5px; line-height: 1.65;
}

.user-chip {
  max-width: 170px; padding: 5px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.coop-card {
  margin-bottom: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(135deg, #fdf7ef, #fdfbf6);
}
.coop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.coop-head strong { font-size: 13.5px; }
.coop-head .muted { font-size: 11.5px; }
.coop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; }
.product-shipping-info { margin-bottom: 14px; }
.coop-item span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.coop-item strong { display: block; font-size: 12.5px; font-weight: 600; word-break: break-all; }
.coop-item.wide { grid-column: span 2; }

/* 合作信息：主播介绍 / 合作流程 / 操作指引 */
.coop-hero-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coop-avatar {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--brand); color: #fff; font-size: 18px; font-weight: 600; letter-spacing: 1px;
}
.coop-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coop-hero-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coop-hero-title strong { font-size: 15.5px; }
.coop-hero-title .muted { font-size: 11.5px; }
.coop-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid #f0dfc3; white-space: nowrap;
}
.coop-lede { margin-top: 10px; font-size: 12.8px; line-height: 1.85; color: var(--ink-soft); }
.coop-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.coop-tag { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.coop-flow {
  list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin: 0; padding: 0;
}
.coop-flow li { padding: 10px 11px; border: 1px solid var(--line); background: #fff; }
.coop-flow strong { font-size: 12.5px; }
.coop-flow .desc { display: block; margin-top: 4px; font-size: 11px; line-height: 1.55; color: var(--muted); }
.step-no {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  margin-right: 5px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 600; vertical-align: 1px;
}
.coop-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.coop-guide > div { padding: 10px 12px; border: 1px dashed var(--line-strong); background: #fff; }
.coop-guide strong { font-size: 12.5px; }
.coop-guide p { margin-top: 4px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }

.invite-create { display: flex; gap: 8px; margin: 12px 0; }
.invite-create input, .invite-link-row input {
  flex: 1; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 12.5px;
}
.invite-link-row { display: flex; gap: 6px; }
.invite-list { display: grid; gap: 6px; max-height: 230px; overflow: auto; margin-top: 10px; }
.invite-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px;
}
.invite-row .grow { flex: 1; min-width: 0; }
.invite-row .muted { font-size: 11px; }
.invite-row .btn { flex: none; }
.invite-state { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: #fdf1e6; color: var(--brand); }
.invite-state.used { background: #eef1f5; color: #6b7785; }
.invite-state.expired { background: #f5f0e6; color: #9a7b3f; }

.sales-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.sales-total strong { font-size: 17px; color: var(--brand-dark); }
.sales-list { display: grid; gap: 6px; }
.sale-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fcf8f2;
}
.sale-row .grow { flex: 1; min-width: 0; }
.sale-session { font-size: 13px; font-weight: 600; }
.sale-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.sale-amount { font-size: 13px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.sales-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.sales-form input {
  padding: 7px 9px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fff; font-size: 12px;
}
.sales-form input[data-sale-session] { flex: 1; min-width: 150px; }
.sales-form input[data-sale-amount] { width: 110px; }
.sales-form input[data-sale-qty] { width: 90px; }

@media (max-width: 900px) {
  .coop-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coop-guide { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .coop-grid { grid-template-columns: 1fr; }
  .coop-item.wide { grid-column: span 1; }
  .coop-flow { grid-template-columns: 1fr; }
  .coop-badge { order: 3; }
  .auth-card { padding: 22px; }
  .urge-banner { margin: 0 12px 10px; align-items: flex-start; }
  .urge-alert { flex-wrap: wrap; }
  .urge-alert-actions { flex-direction: row; width: 100%; }
}

.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #3a2416; color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(74, 44, 25, 0.25);
  animation: toast-in 0.2s ease;
  max-width: min(560px, 92vw);
}
.toast.error { background: #7c2a25; }
.toast.success { background: var(--brand-dark); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------------- Loading ---------------- */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn.ghost .spinner { border-color: rgba(194, 65, 12, 0.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; align-items: center; gap: 10px;
  padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px;
  color: var(--muted); font-size: 13px; margin: 16px 22px 0;
}
.loading-overlay .spinner { border-color: rgba(194, 65, 12, 0.2); border-top-color: var(--brand); }

/* 等待遮罩：读取手卡、AI 整理时转圈提示 */
.busy-overlay {
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(44, 33, 27, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.busy-card {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 24px 24px;
  background: #fffdfa;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(74, 44, 25, 0.28);
  text-align: center;
}
.busy-card strong { font-size: 15px; color: var(--ink); }
.busy-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.busy-spinner {
  width: 34px; height: 34px; margin-bottom: 6px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: spin 0.75s linear infinite;
}

@media (max-width: 1180px) {
  .workbench { grid-template-columns: 1fr; }
  .intake { position: static; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  main { padding: 16px 14px 40px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 10px 14px; }
  .brand { min-width: 0; }
  .page-head { flex: 1 1 0; }
  .page-head h1 { font-size: 16px; }
  .page-head p {
    font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .top-actions { width: auto; justify-content: flex-end; flex-wrap: wrap; row-gap: 8px; }
  .form-grid, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .track-row { grid-template-columns: 1fr auto; }
  .track-no { grid-column: 1 / -1; }
  .track-row .icon-btn { justify-self: end; }
  .lib-filters input { width: 100%; }
  .lib-filters { width: 100%; }
  .column-panel {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    width: auto; height: auto; max-height: none; max-width: none;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom));
    border: 0; border-radius: 0;
    background: #faf6f0;
    z-index: 120;
    overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; touch-action: pan-y;
  }
  .column-panel-head {
    position: sticky; top: 0; z-index: 2;
    margin: 0 -12px 10px;
    padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .column-panel-title strong { font-size: 16px; }
  .column-panel-sub { display: block; }
  .column-close {
    display: grid; place-items: center;
    width: 34px; height: 34px; font-size: 20px;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fcf8f2;
  }
  .column-list { gap: 8px; padding-top: 2px; }
  /* 手机上每行做成独立卡片，只留拖动和勾选 */
  .column-row {
    gap: 10px; padding: 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(74, 44, 25, 0.04);
  }
  .column-row:hover { background: #fff; }
  .column-row[data-locked="1"] { background: #f7f2ea; border-style: dashed; }
  .column-row label { font-size: 14px; gap: 10px; }
  .column-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); }
  .column-row .column-move { display: none; }
  .drag-handle {
    width: 32px; height: 32px; font-size: 18px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fcf8f2; color: var(--ink-soft);
  }
  .column-panel .hint { padding: 12px 4px 4px; line-height: 1.6; }
  /* 面板里的分区在手机上做成独立卡片 */
  .panel-block {
    padding: 14px; border-radius: 12px;
    background: #fff; border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(74, 44, 25, 0.04);
  }
  .panel-block + .panel-block {
    margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line);
  }
  .panel-block-title { font-size: 13px; margin-bottom: 10px; }
  .column-panel .panel-block .hint { padding: 0; margin-top: 10px; }
  .filter-rows { gap: 10px; }
  .filter-label { width: 64px; font-size: 14px; }
  .filter-row select { padding: 10px 10px; font-size: 14px; }
  .category-native { display: none; }
  .category-pick-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    flex: 1 1 0; min-width: 0;
    padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
    background: #fff; color: var(--ink); font: inherit; font-size: 14px; text-align: left;
  }
  .category-pick-btn::after { content: '›'; color: var(--muted); }
  .category-option { font-size: 14px; padding: 12px; }
  .dual-range { height: 28px; }
  .dual-range::before, .dual-range::after { top: 12px; height: 5px; }
  .dual-range input[type="range"] { height: 28px; }
  .dual-range input[type="range"]::-webkit-slider-runnable-track { height: 28px; }
  .dual-range input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: 4px; }
  .dual-range input[type="range"]::-moz-range-track { height: 28px; }
  .dual-range input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; }
  .range-text { font-size: 12px; }
  /* 导出字段也用同样的卡片样式 */
  .export-tools { flex-wrap: wrap; gap: 8px; margin: 12px 0; }
  .export-fields { gap: 8px; }
  .export-row {
    gap: 10px; padding: 10px 12px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(74, 44, 25, 0.04);
  }
  .export-row .drag-handle {
    width: 32px; height: 32px; font-size: 17px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fcf8f2; color: var(--ink-soft);
  }
  .export-row .export-move { display: none; }
  .export-row .export-field { font-size: 14px; gap: 10px; }
  .export-row .export-field input { width: 20px; height: 20px; }
}

/* ---------------- 直播选品 ---------------- */
.sessions-panel { padding: 22px; min-height: 420px; }
.sessions-head { display: flex; justify-content: flex-end; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sessions-head h2 { font-size: 17px; }
.sessions-head p { margin-top: 3px; }
.sessions-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.session-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: #fff; cursor: pointer; transition: all .15s ease;
}
.session-card:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(74, 44, 25, .06); transform: translateY(-1px); }
.session-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.session-status { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #f2ebe4; color: var(--muted); white-space: nowrap; }
.session-status.planning { background: var(--accent-soft); color: var(--accent); }
.session-status.notified { background: var(--brand-soft); color: var(--brand); }
.session-time { font-size: 12px; color: var(--muted); }
.session-card h3 { font-size: 15px; margin: 10px 0 4px; }
.session-meta { font-size: 12.5px; color: var(--muted); }
.session-progress { margin-top: 12px; }
.session-progress-bar { height: 6px; border-radius: 999px; background: #f3ebe1; overflow: hidden; }
.session-progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e07b39, #c2410c); border-radius: 999px; transition: width .3s; }
.session-progress span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.session-card-foot { margin-top: 14px; display: flex; gap: 8px; }

.live-detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.live-detail-summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.live-detail-summary strong { font-size: 15px; }
.live-detail-summary span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.live-detail-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.live-detail-tools .btn.danger { color: var(--danger); border-color: #eccdc7; }
.live-order-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.live-item-check {
  flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: #fff;
}
.live-item-check.on { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.live-item.selecting { cursor: pointer; }
.live-item.is-selected { background: #fffaf4; }
.live-select-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 24px); padding: 8px 12px 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, 0.97); box-shadow: 0 12px 30px rgba(74, 44, 25, 0.18);
}
.live-select-bar .select-count { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.live-select-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.live-coop { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; padding: 14px 16px; margin-top: 14px; background: #faf4ec; border: 1px solid var(--line); border-radius: 10px; }
.live-coop div { display: flex; flex-direction: column; gap: 2px; }
.live-coop div.wide { grid-column: 1 / -1; }
.live-coop span { font-size: 11.5px; color: var(--muted); }
.live-coop strong { font-size: 13px; font-weight: 600; }
.live-coop .btn { justify-self: start; align-self: center; }
.live-notify-hint { padding: 0 2px; }

.live-groups { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.brand-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.brand-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; background: #faf4ec; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand-group-head strong { font-size: 13.5px; margin-right: 8px; }
.live-items { display: flex; flex-direction: column; }
.live-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-bottom: 1px solid var(--line); }
.live-item:last-child { border-bottom: 0; }
.live-item-thumb {
  flex: none; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #faf4ec; display: flex; align-items: center; justify-content: center;
}
.live-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-item-thumb span { font-size: 11px; color: var(--muted); }
.live-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.live-item-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.live-item-spec { font-size: 12px; color: var(--muted); }
.live-item-prices { display: flex; flex-wrap: wrap; gap: 6px; }
.live-item-price {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 8px; border-radius: 6px; background: #f7f1ea;
  font-size: 11.5px; color: var(--muted);
}
.live-item-price b { font-size: 13px; font-weight: 600; color: var(--ink); }
.live-item-price.hl { background: var(--brand-soft); color: var(--brand); }
.live-item-price.hl b { color: var(--brand); }
.live-item-ship { font-size: 12px; color: var(--muted); }
.live-item-link-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12px; }
.live-item-link-row.none { color: var(--muted); }
.live-item-label { flex: none; color: var(--muted); }
.live-item-link { color: #2d5f9e; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item-link:hover { text-decoration: underline; }
.live-item-link-row .link-raw { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.live-state { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: #f2ebe4; color: var(--muted); }
.live-state.awaiting_sample { background: var(--accent-soft); color: var(--accent); }
.live-state.shipped { background: #e8f0fb; color: #2d5f9e; }
.live-state.received { background: var(--brand-soft); color: var(--brand); }
.tracking-form { display: flex; gap: 6px; align-items: center; }
.tracking-form input { width: 170px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; background: #fff; }
.live-empty { padding: 48px 10px; }

/* 选品弹窗 */
.picker-modal { width: 100%; max-width: 720px; display: flex; flex-direction: column; max-height: 86vh; }
.picker-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.picker-toolbar { display: flex; gap: 10px; align-items: center; margin: 16px 0 10px; }
.picker-toolbar input { flex: 1; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; }
.picker-list { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 10px; min-height: 200px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #fdfaf7; }
.pick-row.disabled { opacity: .62; cursor: default; }
.pick-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.pick-main { flex: 1; min-width: 0; }
.pick-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { padding: 30px; text-align: center; }
.picker-modal .pagination { padding: 10px 0 0; justify-content: space-between; }

@media (max-width: 900px) {
  .sidebar { width: 64px; flex-basis: 64px; padding-left: 8px; padding-right: 8px; }
  .side-title, .side-label, .side-item .badge, .side-toggle { display: none; }
  .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-item { justify-content: center; padding: 9px 0; }
  .side-me { justify-content: center; padding: 7px 0; }
  .me-meta { display: none; }
  .session-grid { grid-template-columns: 1fr 1fr; }
  .live-item { grid-template-columns: 1fr; }
  .live-item-actions { justify-content: flex-start; }
  .tracking-form { width: 100%; }
  .tracking-form input { flex: 1; width: auto; }
}
@media (max-width: 720px) {
  .sessions-panel { padding: 16px; }
  .live-detail-bar { align-items: flex-start; }
  .live-detail-tools { gap: 6px; }
  .live-detail-tools .btn { padding: 6px 10px; font-size: 12px; }
  .live-item { padding: 12px; gap: 10px; }
  .live-item-thumb { width: 64px; height: 64px; }
  .live-item-prices { gap: 4px; }
  .live-order-move .btn { padding: 6px 14px; font-size: 13px; }
  .live-item-price { padding: 2px 6px; font-size: 11px; }
  .live-item-price b { font-size: 12px; }
  .live-select-bar {
    left: 8px; right: 8px; bottom: 72px; transform: none; max-width: none;
    justify-content: space-between; border-radius: 14px; padding: 10px 12px;
  }
  .live-select-actions { gap: 6px; }
  .live-select-actions .btn { padding: 6px 10px; font-size: 12px; }
  .picker-modal { max-height: 92vh; }
}

/* 样品复用 */
.live-state.reuse { background: #eef6ee; color: #2f7d4f; }
.live-coop-reuse { background: #f2f8f2; }
.live-coop-reuse strong { color: #2f7d4f; }

/* 样品评估与链接 */
.live-state.link_requested { background: var(--accent-soft); color: var(--accent); }
.live-state.link_submitted { background: #e8f0fb; color: #2d5f9e; }
.live-state.ready { background: #e3f4e8; color: #1f7a44; }
.live-state.sample_rejected { background: var(--danger-soft); color: var(--danger); }
.link-url { display: block; color: #2d5f9e; font-size: 12px; word-break: break-all; text-decoration: none; }
.link-url:hover { text-decoration: underline; }
.link-raw { font-size: 12px; color: var(--ink-soft); word-break: break-all; }
.link-form input { width: 230px; }
.text-red { color: var(--danger); font-size: 12px; }

/* 直播销量回填 */
.live-sales { font-size: 12px; font-weight: 600; color: #b45309; margin-top: 2px; }
.live-sales-editor { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--line); }
.live-sales-editor input { width: 140px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; background: #fff; }
.live-sales-editor input[data-sales-note] { flex: 1; min-width: 160px; }

/* 数据看板与选品单收尾 */
.live-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.live-stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.live-stat span { color: var(--muted); font-size: 12px; }
.live-stat strong { font-size: 20px; }
.session-status.finished { background: #eef0f2; color: #5a6570; }
.live-reship { font-size: 12px; color: #8a5a00; margin-top: 3px; }
.reship-form { margin-top: 6px; }
@media (max-width: 720px) {
  .live-stat.extra { display: none; }

  /* 选品单卡片：手机端一排两个 */
  .session-card-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .session-time { font-size: 11px; }
  .session-card h3 { font-size: 13.5px; margin: 6px 0 2px; line-height: 1.35; }
  .session-card-sales { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 6px; }
  .session-card-sales span { font-size: 11px; }
  .session-card-sales strong { font-size: 15px; }
  .session-card-foot { margin-top: 8px; gap: 6px; flex-wrap: wrap; }
  .session-card-foot .btn { padding: 5px 8px; font-size: 11.5px; }
}

/* 排品顺序与上播清单 */
.live-order-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.live-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px 14px; background: #faf4ec; border-bottom: 1px solid var(--line); }
.live-order-head strong { font-size: 13.5px; margin-right: 8px; }
.live-order-move { display: flex; gap: 4px; }
.live-order-move .btn:disabled { opacity: .35; cursor: default; }
.live-order-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-right: 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.live-order-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn.tiny.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.live-item-grip {
  flex: none; display: grid; place-items: center;
  width: 16px; margin-top: 3px;
  color: var(--muted); font-size: 14px; line-height: 1;
  cursor: grab; user-select: none;
}
.live-item.sorting { background: #fffdf9; }
.live-item.sorting:active { cursor: grabbing; }
.live-item.sorting .live-item-thumb,
.live-item.sorting .live-item-link { pointer-events: none; }
.live-item.dragging { opacity: .45; }
.live-item.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.live-item.drop-after { box-shadow: inset 0 -2px 0 var(--brand); }
@media (max-width: 720px) {
  /* 触屏不支持 HTML5 拖拽，用手柄只会误导，隐藏后用 ↑ ↓ 微调 */
  .live-item-grip { display: none; }
  .live-sort-tip-desktop { display: none; }
}
.live-sort-tip-touch { display: none; }
@media (max-width: 720px) {
  .live-sort-tip-touch { display: inline; }
}

/* 消息中心 */
.notif-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 10px;
}
.notif-btn svg { width: 18px; height: 18px; display: block; }
.notif-btn .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px;
}
.notif-modal { width: 92vw; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column; }
.notif-list { flex: 1; overflow-y: auto; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; width: 100%; font: inherit; color: inherit; }
.notif-row:hover { border-color: var(--brand); }
.notif-row.unread { background: #fff6ec; border-color: #f6d9a8; }
.notif-type { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #f2ebe4; color: #6b5a4c; }
.notif-type.reject { background: #fdecec; color: #b42318; }
.notif-type.done { background: #fef3c7; color: #b45309; }
.notif-type.sample,
.notif-type.link,
.notif-type.reship { background: var(--brand-soft); color: var(--brand); }
.notif-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.notif-body { font-size: 12.5px; color: var(--muted); }
.notif-time { font-size: 11.5px; color: #a8988b; margin-top: 2px; }
.notif-dot { width: 6px; height: 6px; border-radius: 50%; background: #e5484d; display: inline-block; }
.notif-empty { padding: 28px 0; }

/* 品牌端销售卡片 */
.brand-sales-card { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 16px 18px; border: 1px solid #f6d9a8; border-radius: 12px; background: linear-gradient(120deg, #fff8ec, #fdf1e0); }
.brand-sales-label { font-size: 12.5px; color: #8a5c1c; }
.brand-sales-amount { font-size: 26px; font-weight: 700; color: #b45309; line-height: 1.1; }
.brand-sales-sub { font-size: 12px; color: var(--muted); }
.session-brand-sales { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.session-brand-sales strong { color: #b45309; font-size: 14px; }

/* 品牌方名册 */
.brand-modal { width: 94vw; max-width: 620px; max-height: 82vh; display: flex; flex-direction: column; }
.brand-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.brand-list { flex: 1; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.brand-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.brand-row.is-pending { border-color: #f0dcb4; background: #fffdf7; }
.brand-row-pending-hint { color: #946200; }
.brand-pending-tip {
  margin-bottom: 10px; padding: 10px 12px;
  border: 1px solid #f3e3c0; border-radius: 10px;
  background: #fdf6e7; color: #8a5c1c; font-size: 12.5px; line-height: 1.6;
}
.brand-row[data-brand-id] { cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.brand-row[data-brand-id]:hover { border-color: var(--brand); background: #fffdfa; }
.brand-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.brand-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand-detail-head h3 { margin: 0; }
.brand-detail-head p { margin: 4px 0 0; }
.brand-detail-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
#brandMask .modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.brand-password { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.5px; user-select: all; }
.reset-box { margin-top: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: #fdfaf6; }
.reset-box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.reset-box-row { display: flex; gap: 8px; align-items: center; }
.reset-box-row input {
  flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 12px; color: var(--ink-2);
}
#exportMask .modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.export-tools { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; }
.export-fields { display: flex; flex-direction: column; gap: 6px; }
.export-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--line); background: #fdfaf6;
  border-radius: 8px;
}
.export-row .export-field { flex: 1; min-width: 0; }
.export-move { flex: none; display: flex; gap: 4px; }
.export-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.export-field input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.export-hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.brand-avatar { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.brand-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-row-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.brand-row-title strong { font-size: 13.5px; }
.brand-row-meta { font-size: 12px; color: var(--muted); }
.brand-row-active { flex: none; font-size: 11.5px; color: #a08f80; white-space: nowrap; }
.brand-row-open { font-size: 11.5px; color: var(--brand); white-space: nowrap; }
.brand-empty { padding: 36px 8px; }
@media (max-width: 640px) {
  .brand-row-active { display: none; }
}

/* 批量操作 */
.batch-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fdfaf6; }
.batch-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.batch-head strong { font-size: 13.5px; }
.batch-items { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.batch-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.batch-item input { accent-color: var(--brand); }
.batch-form { display: flex; gap: 8px; flex-wrap: wrap; }
.batch-form input { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.batch-sales-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.batch-sales-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 80px; gap: 8px; align-items: center; }
.batch-sales-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-sales-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; box-sizing: border-box; }
.archive-sales-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px; align-items: center; }
.archive-sales-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; box-sizing: border-box; }
.archive-modal { max-width: 560px; }
.archive-modal .batch-sales-list { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.archive-foot { align-items: center; justify-content: flex-end; }
.archive-foot [data-archive-total] { margin-right: auto; }
@media (max-width: 720px) {
  .batch-sales-row { grid-template-columns: minmax(0, 1fr) 90px 70px; }
  .archive-sales-row { grid-template-columns: minmax(0, 1fr) 110px; }
}

/* 新建商品内的 AI 建档 */
.intake-panel { border: 1px dashed var(--line-strong); border-radius: 12px; background: #fcf8f2; padding: 14px 14px 12px; }
.intake-drop { margin: 10px 0; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: #fff; padding: 14px 12px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.intake-drop:hover, .intake-drop.drag { border-color: var(--brand); background: var(--brand-soft); }
.intake-drop strong { font-size: 13px; }
.intake-drop span { font-size: 11.5px; color: var(--muted); }
.intake-files { margin-top: 4px; max-height: 200px; }
.paste-block.compact { margin-top: 10px; }
.paste-block.compact textarea { min-height: 68px; }
.intake-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.intake-panel .form-section-title { margin-top: 14px; }
.intake-panel .form-section-title:first-child { margin-top: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 500; margin-left: 6px; }
.tag.manual { background: #f3ebe1; color: var(--muted); }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-item { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 3px 4px 3px 9px; font-size: 12px; max-width: 100%; }
.attach-item a { color: var(--brand-dark); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.attach-item a:hover { text-decoration: underline; }
.attach-title { margin-top: 16px; }
.mt-8 { margin-top: 8px; }

/* ---------------- 导航页统一：直角扁平区块 ---------------- */
#view-library .panel,
#view-library .coop-card,
#view-sessions .panel,
#view-sessions .live-stat,
#view-sessions .live-coop,
#view-sessions .brand-group,
#view-sessions .live-order-panel,
#view-brands .panel,
#view-brands .brand-row,
#view-anchor .panel,
#view-anchor .coop-card { border-radius: 0; box-shadow: none; }
#view-anchor .coop-card { margin-bottom: 0; }
#view-anchor .coop-card + .coop-card { border-top: 0; }

/* 直播选品：页内表单 */
.session-form { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); background: #fdfaf6; }
.session-form h3 { font-size: 15px; }
.session-form > .muted { margin-top: 3px; }
.session-form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.session-form .modal-actions { margin-top: 12px; }

/* 直播选品：卡片 */
.session-card-sales { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; }
.session-card-sales span { font-size: 12px; color: var(--muted); }
.session-card-sales strong { font-size: 17px; color: var(--brand); }

/* 品牌方库页面 */
.brands-panel { padding: 22px; min-height: 420px; }
#view-brands .brand-list { flex: none; overflow: visible; margin: 14px 0 0; }
.brand-total { margin-top: 12px; }

@media (max-width: 900px) {
  .session-form-grid { grid-template-columns: 1fr; }
}

/* ---------------- 导航页卡片尺寸统一 ---------------- */
#view-library .library,
#view-sessions .sessions-panel,
#view-brands .brands-panel { min-height: 480px; }

#view-sessions .live-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* 电脑端：选品单列表一行一条 */
#view-sessions .session-grid { display: flex; flex-direction: column; gap: 8px; }
#view-sessions .session-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  min-height: 0; padding: 12px 16px;
}
#view-sessions .session-card-main { flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 14px; }
#view-sessions .session-card-top { flex: none; flex-direction: column; align-items: flex-start; gap: 3px; }
#view-sessions .session-card h3 {
  flex: 1; min-width: 0; margin: 0; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#view-sessions .session-card-sales { flex: none; margin: 0; gap: 8px; }
#view-sessions .session-card-sales strong { font-size: 15px; }
#view-sessions .session-card-foot { margin: 0 0 0 auto; flex-wrap: nowrap; }
#view-sessions .session-card-foot .btn.danger { color: var(--danger); border-color: #eccdc7; }
#view-brands .brand-row { min-height: 76px; align-items: center; }

@media (max-width: 900px) {
  #view-sessions .live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* 手机端：选品单恢复为卡片 */
@media (max-width: 720px) {
  #view-sessions .session-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  #view-sessions .session-card { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 12px; }
  #view-sessions .session-card-main { display: block; flex: none; }
  #view-sessions .session-card h3 {
    margin: 6px 0 2px; font-size: 14px;
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  #view-sessions .session-card-sales { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 6px; }
  #view-sessions .session-card-sales strong { font-size: 15px; }
  #view-sessions .session-card-foot { margin: 10px 0 0; flex-wrap: wrap; }
}

/* ---------------- 导航页与子页面模块尺寸统一 ---------------- */
/* 三页主面板内边距统一 22px，内容左右边界一致 */
#view-sessions .sessions-panel,
#view-brands .brands-panel { padding: 22px; }

/* 内容宽度基准：所有导航页内容左右 22px */
#view-library .lib-toolbar { padding: 22px 22px 16px; }
#view-library .table-wrap { padding: 0 22px 8px; }
#view-library .pagination { padding: 14px 22px 6px; }

/* 标题字号与标题区留白统一 */
#view-library .lib-title h2,
#view-sessions .sessions-head h2,
#view-brands .sessions-head h2 { font-size: 17px; }
#view-sessions .sessions-head,
#view-brands .sessions-head { margin-bottom: 16px; }

/* 直播详情：模块间距与统计块高度统一 */
#sessionDetailView { display: flex; flex-direction: column; gap: 14px; }
#sessionDetailView > * { margin-top: 0; margin-bottom: 0; }
#view-sessions .live-stat { min-height: 84px; }

/* ---------------- 设置页 ---------------- */
#view-settings .settings-panel { padding: 22px; min-height: 480px; border-radius: 0; box-shadow: none; }
.settings-head { margin-bottom: 16px; }
.settings-head h2 { font-size: 17px; }
.settings-block { padding-top: 22px; border-top: 1px solid var(--line); }
.settings-block + .settings-block { margin-top: 22px; }
.settings-block:first-of-type { border-top: none; padding-top: 0; }
.settings-block h3 { font-size: 15px; margin-bottom: 4px; }
.settings-block > .muted { margin-bottom: 12px; }
.settings-block .key-state { margin: 6px 0 12px; }
.settings-block .modal-actions { margin-top: 14px; }

/* ---------------- 紧凑留白 ---------------- */
main { padding: 12px 16px 24px; }
#view-library .library { padding-bottom: 10px; }
#view-library .lib-toolbar { padding: 12px 12px 10px; }
#view-library .table-wrap { padding: 0 12px 6px; }
#view-library .pagination { padding: 10px 12px 4px; }
#view-sessions .sessions-panel,
#view-brands .brands-panel,
#view-settings .settings-panel { padding: 12px; }
#view-sessions .sessions-head,
#view-brands .sessions-head { margin-bottom: 10px; }
#sessionDetailView { gap: 10px; }
#view-sessions .session-card { padding: 12px; }
#view-sessions .session-card h3 { margin: 8px 0 3px; }
#view-sessions .live-stat { padding: 10px 12px; }
#view-sessions .live-coop { padding: 12px; gap: 8px 14px; }
#view-brands .brand-row { padding: 10px 12px; }
.settings-head { margin-bottom: 10px; }
.settings-block { padding-top: 12px; }
.settings-block + .settings-block { margin-top: 12px; }
.settings-block .modal-actions { margin-top: 10px; }

@media (max-width: 720px) {
  main { padding: 10px 10px 20px; }
}

/* ---------------- 手机竖屏适配 ---------------- */
@media (max-width: 640px) {
  html { scrollbar-gutter: auto; }
  html, body {
    -webkit-text-size-adjust: 100%;
    width: 100%; max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }
  #app, .app-shell, .app-body, main, .view {
    width: 100%; max-width: 100%; min-width: 0;
  }
  .app-shell { display: block; min-height: 100dvh; }
  /* 商品列表只响应上下滑动，避免斜着划时页面左右跟着动 */
  main { touch-action: pan-y; }

  /* 侧栏改为底部导航，给内容让出整屏宽度 */
  .sidebar,
  #app.side-collapsed .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; flex: none; height: auto;
    flex-direction: row; align-items: stretch;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 50; gap: 0;
  }
  .side-brand, .side-foot, .side-toggle { display: none !important; }
  .side-nav {
    flex: 1; flex-direction: row; justify-content: space-around;
    gap: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-item,
  #app.side-collapsed .side-item {
    flex: 1 1 0; min-width: 52px; width: auto;
    flex-direction: column; justify-content: center; gap: 2px;
    padding: 5px 2px; border-radius: 8px; text-align: center;
    position: relative;
  }
  .side-label,
  #app.side-collapsed .side-label {
    display: block; font-size: 10px; line-height: 1.2; white-space: nowrap;
  }
  .side-icon { width: 20px; height: 20px; flex: 0 0 20px; }
  .side-icon svg { width: 18px; height: 18px; }
  .side-item .badge,
  #app.side-collapsed .side-item .badge {
    display: inline-grid !important; position: absolute; top: 1px; right: 6px;
    min-width: 15px; height: 15px; padding: 0 4px; font-size: 9.5px;
  }
  .app-body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }

  .topbar { padding: 7px 10px; gap: 8px; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 6px 10px; font-size: 12px; }
  .notif-btn .badge { min-width: 17px; height: 17px; }

  main { padding: 8px 8px 16px; }
  .panel { border-radius: 12px; }

  .lib-toolbar { padding: 12px 10px 8px; gap: 8px; }
  .lib-title { width: 100%; }
  .lib-filters { width: 100%; gap: 6px; }
  .lib-filters .btn { flex: 1 1 auto; padding: 8px 10px; }
  .status-switch { flex: 1 1 auto; min-width: 150px; }
  .status-opt { flex: 1 1 0; padding: 8px 6px; font-size: 12.5px; }
  .select-bar {
    left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom));
    transform: none; justify-content: space-between;
    padding: 10px 12px; border-radius: 14px;
  }
  .col-select { width: 34px; }
  /* 手机端用商品卡片代替表格 */
  #view-library .table-wrap { padding: 0 2px 4px; overflow: visible; }
  .table-wrap .data-table { display: none; }
  .lib-cards {
    display: grid; gap: 8px; padding: 0;
    width: 100%; max-width: 100%; overflow: hidden;
  }
  .lib-cards:empty { display: none; }
  .lib-card {
    display: grid; grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px; padding: 10px; background: #fff;
    width: 100%; max-width: 100%; min-width: 0;
    border: 1px solid var(--line); border-radius: 12px;
  }
  .lib-card.urge-row { border-color: #f4d69b; background: #fffdf7; }
  .lib-card.no-media { grid-template-columns: minmax(0, 1fr); }
  .lib-card-media {
    width: 88px; height: 88px; border-radius: 10px; overflow: hidden;
    display: grid; place-items: center; background: #f5efe8;
    color: #b3a69a; font-size: 12px;
  }
  .lib-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .lib-card-main, .lib-card-meta, .lib-card-badges { min-width: 0; max-width: 100%; }
  .lib-card-main { display: flex; flex-direction: column; gap: 4px; }
  .lib-card-title {
    font-size: 13.5px; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere; word-break: break-word;
  }
  .lib-card-sub {
    font-size: 11.5px; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere; word-break: break-word;
  }
  .lib-card-badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .lib-card-price .price-main { font-size: 13.5px; gap: 2px 8px; flex-wrap: wrap; }
  .lib-card-price .price-item { white-space: normal; }
  .lib-card-price .price-sub { font-size: 11px; flex-wrap: wrap; }
  .lib-card-meta {
    display: flex; flex-wrap: wrap; gap: 2px 10px;
    font-size: 11px; color: var(--muted);
  }
  .lib-card-meta span {
    max-width: 100%;
    white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  }
  .lib-card-extra {
    display: grid; gap: 3px; padding-top: 6px; margin-top: 2px;
    border-top: 1px dashed var(--line);
  }
  .lib-card-extra-row {
    display: grid; grid-template-columns: 56px minmax(0, 1fr);
    gap: 6px; align-items: start; font-size: 11.5px;
  }
  .lib-card-extra-row > span { color: var(--muted); }
  .lib-card-extra-row > div {
    min-width: 0; overflow-wrap: anywhere; word-break: break-word;
  }
  .lib-card-extra-row .cell-clip {
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .lib-card-extra-row .price-main { font-size: 12px; flex-wrap: wrap; }
  .lib-card-extra-row .cell-sub { font-size: 10.5px; }
  .lib-card-actions {
    grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px;
    padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line);
  }
  .lib-card-actions .btn { min-height: 30px; }
  .lib-card-badges .tag { margin-left: 0; }
  .pagination { justify-content: center; padding: 10px 8px 4px; }
  .page-btn { min-width: 34px; height: 34px; }

  .urge-banner { margin: 0 8px 8px; padding: 10px; gap: 8px; }

  /* 抽屉占满屏幕 */
  .drawer { width: 100%; max-width: 100%; }
  .drawer-head { padding: 14px 14px 12px; }
  .drawer-head h2 { font-size: 15px; }
  .drawer-body { padding: 14px 14px 20px; }
  .drawer-foot {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .drawer-foot .btn { flex: 1 1 auto; justify-content: center; }

  /* 弹窗改为底部弹出 */
  .modal-mask { padding: 0; place-items: end center; }
  .modal,
  .modal.small {
    width: 100%; max-width: 100%; max-height: 92dvh; overflow: auto;
    border-radius: 16px 16px 0 0;
    padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
  .two-col { grid-template-columns: 1fr; gap: 10px; }
  .picker-modal, .notif-modal { width: 100%; }

  .auth-screen { padding: 14px; min-height: 100dvh; }
  .auth-card { padding: 20px 16px; }
  .auth-brand h1 { font-size: 19px; }
  .auth-steps { gap: 4px; }
  .auth-steps li { font-size: 10.5px; padding: 5px 2px; }

  .coop-card { padding: 12px; }
  .coop-hero-head { gap: 8px; }
  .coop-hero-title strong { font-size: 14.5px; }
  .coop-lede { font-size: 12.5px; }

  .sessions-panel, .brands-panel, #view-settings .settings-panel { padding: 12px 10px; }
  .sessions-actions { width: 100%; }
  .sessions-actions .btn { flex: 1 1 auto; justify-content: center; }
  .session-row { padding: 10px 12px; }
  .live-item { padding: 10px 12px; }
  .tracking-form, .link-form { flex-wrap: wrap; }
  .tracking-form input, .link-form input { width: 100%; flex: 1 1 100%; }
  .live-sales-editor input { width: 100%; }
  .live-sales-editor input[data-sales-note] { flex: 1 1 100%; }

  .brand-sales-card { padding: 14px; }
  .brand-sales-amount { font-size: 22px; }

  .batch-form input, .invite-create input { width: 100%; min-width: 0; flex: 1 1 100%; }
  .invite-create { flex-wrap: wrap; }
  .archive-sales-row { grid-template-columns: minmax(0, 1fr) 96px; }
  .batch-sales-row { grid-template-columns: minmax(0, 1fr) 84px 68px; gap: 6px; }

  /* 避免 iPhone 聚焦输入框时自动放大 */
  input, select, textarea { font-size: 16px; }

  .toast-wrap {
    left: 10px; right: 10px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    transform: none; align-items: stretch;
  }
  .toast { max-width: none; text-align: center; }
}



