:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #eaecf0;
  --brand: #ff5a1f;
  --brand-2: #ff2d55;
  --brand-soft: #fff3ed;
  --green: #067647;
  --green-soft: #e7f8ef;
  --amber: #b54708;
  --amber-soft: #fff6e6;
  --blue: #175cd3;
  --blue-soft: #eaf3ff;
  --red: #b42318;
  --red-soft: #feeceb;
  --purple: #6941c6;
  --purple-soft: #f4f0ff;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

button, input, textarea, select { font-family: inherit; color: inherit; }

button { border: 0; background: none; cursor: pointer; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d5dae1; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #b9c0ca; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background:
    radial-gradient(560px 260px at -20% -10%, rgba(255, 90, 31, 0.16), transparent 68%),
    radial-gradient(420px 300px at 130% 110%, rgba(46, 144, 250, 0.1), transparent 70%),
    #0b0f16;
  color: #cbd2dc;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }

.brand-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #ff7324, #ff2d55);
  color: #fff; font-size: 18px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(255, 69, 58, 0.35);
}

.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong { font-size: 14.5px; color: #fff; letter-spacing: 0.2px; }
.brand-text span { font-size: 9px; letter-spacing: 1.6px; color: #6b7686; font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid transparent;
  color: #93a0b1; font-size: 13.5px; font-weight: 500;
  text-align: left; transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }

.nav-short { display: none; }

.nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #e8ecf2; }

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 90, 31, 0.24), rgba(255, 45, 85, 0.05));
  border-color: rgba(255, 90, 31, 0.38);
}

.nav-item.active svg { color: #ff8a5c; opacity: 1; }

.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: #ff4d1c; color: #fff;
  border-radius: 9px; font-size: 10.5px; font-style: normal; font-weight: 700;
}
.nav-badge[hidden] { display: none; }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 14px 6px 0; }

.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-copy { display: flex; flex-direction: column; gap: 2px; }
.auto-copy strong { font-size: 12.5px; color: #c8d0db; font-weight: 600; }
.auto-copy span { font-size: 10.5px; color: #6b7686; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: #2b3442; transition: background 0.2s; cursor: pointer;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch input:checked + i { background: linear-gradient(135deg, #ff5a1f, #ff2d55); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid #ff8a5c; outline-offset: 2px; }

.switch.light i { background: #e4e7ec; }
.switch.light i::after { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.25); }
.switch.light input:checked + i { background: linear-gradient(135deg, #ff5a1f, #ff2d55); }

.mode-pill {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: #6b7686;
}
.mode-pill i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}

.page-heading h1 { font-size: 19px; font-weight: 750; letter-spacing: -0.3px; }
.page-heading p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.clock { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.view { flex: 1; overflow: auto; padding: 22px 28px 44px; }
.view.inbox-view { overflow: hidden; padding: 18px 24px 24px; }

.boot-loading {
  height: 60vh; display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--ink-3); font-size: 13px;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #e4e7ec; border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; color: var(--ink);
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #ff5a1f, #ff2d55);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 69, 58, 0.24);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255, 69, 58, 0.32); filter: brightness(1.03); }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #d0d5dd; background: #fcfcfd; }

.btn-dark { background: #101828; color: #fff; }
.btn-dark:hover { background: #1d2939; }

.btn-soft { background: var(--brand-soft); color: #cf3f0e; }
.btn-soft:hover { background: #ffe7db; }

.btn-danger-ghost { background: #fff; border-color: var(--line); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: #fecdca; }

.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid transparent;
  color: #667085; transition: 0.15s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: #f2f4f7; color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; background: none; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.input, .select, textarea.input {
  width: 100%;
  border: 1px solid #e4e7ec; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #b0b8c4; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: #ffb59b;
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.field { margin-bottom: 14px; }
.field > label, .field-label { display: block; font-size: 12.5px; font-weight: 600; color: #344054; margin-bottom: 6px; }
.field-hint { font-size: 11px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #98a2b3; pointer-events: none; }
.search-box .input { padding-left: 31px; }

/* ---------- Layout building blocks ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; }

.stat-card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 0 auto auto;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--glow, transparent); filter: blur(26px); opacity: 0.55;
  pointer-events: none;
}
.stat-card.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--soft, #f2f4f7); color: var(--tone, #667085);
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; padding-right: 40px; }
.stat-value { font-size: 25px; font-weight: 750; letter-spacing: -0.6px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

.todo-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: 12px; padding: 10px 14px; margin-top: 14px;
  box-shadow: var(--shadow-sm);
}
.todo-strip.is-clear { border-left-color: var(--green); }
.todo-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.todo-title svg { width: 15px; height: 15px; color: var(--red); }
.todo-strip.is-clear .todo-title svg { color: var(--green); }
.todo-sub { font-size: 12px; color: var(--ink-3); }
.todo-items { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid #fecdca;
  font-size: 12px; font-weight: 600;
  transition: background 0.15s;
}
.todo-item strong { font-variant-numeric: tabular-nums; }
.todo-item:hover { background: #fee4e2; }

.late-tag {
  display: inline-flex; align-items: center; margin-left: 6px;
  padding: 2px 7px; border-radius: 6px;
  background: var(--red-soft); color: var(--red);
  font-size: 10px; font-weight: 700; white-space: nowrap;
  vertical-align: middle;
}
.late-text { color: var(--red); font-weight: 600; }

.tone-orange { --tone: #cf3f0e; --soft: #fff1e8; --glow: rgba(255, 90, 31, 0.16); }
.tone-amber { --tone: #b54708; --soft: #fff6e6; --glow: rgba(247, 144, 9, 0.16); }
.tone-blue { --tone: #175cd3; --soft: #eaf3ff; --glow: rgba(46, 144, 250, 0.14); }
.tone-green { --tone: #067647; --soft: #e7f8ef; --glow: rgba(18, 183, 106, 0.14); }
.tone-red { --tone: #b42318; --soft: #feeceb; --glow: rgba(240, 68, 56, 0.12); }
.tone-purple { --tone: #6941c6; --soft: #f4f0ff; --glow: rgba(127, 86, 217, 0.14); }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.section-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-top: 16px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-head .muted { font-size: 11.5px; color: var(--ink-3); }
.card-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.link-btn { color: #cf3f0e; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.link-btn svg { width: 13px; height: 13px; }
.link-btn:hover { color: var(--brand); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.t-green { background: var(--green-soft); color: var(--green); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-gray { background: #f2f4f7; color: #475467; }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.t-orange { background: var(--brand-soft); color: #cf3f0e; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Platform overview ---------- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 14px; }

.plat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.plat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.plat-head { display: flex; align-items: center; gap: 10px; }
.plat-logo {
  border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.plat-name { min-width: 0; }
.plat-name strong { display: block; font-size: 13.5px; font-weight: 700; }
.plat-name span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-head .pill { margin-left: auto; }

.plat-metrics { display: flex; gap: 22px; margin: 14px 0 12px; }
.metric span { display: block; font-size: 10.5px; color: var(--ink-3); }
.metric b { display: block; font-size: 16px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 40px; }
.spark i { flex: 1; height: 100%; background: #f0f2f5; border-radius: 4px; position: relative; overflow: hidden; }
.spark i b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px; background: linear-gradient(180deg, #ffb08a, #ff5a1f); }
.spark i.today b { background: linear-gradient(180deg, #ff7a45, #ff2d55); }
.spark-caption { font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 7-day trend ---------- */
.trend-card { overflow: hidden; }
.trend-sum { font-size: 11.5px; color: var(--ink-3); }
.trend-sum b { color: var(--ink); font-size: 13px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.trend-chart { display: flex; align-items: flex-end; gap: 10px; height: 192px; padding: 18px 20px 16px; }
.trend-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.trend-val { font-size: 10.5px; color: var(--ink-3); margin-bottom: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-col i {
  flex: 1; width: 100%; max-width: 46px;
  display: flex; align-items: flex-end;
  background: #f3f5f8; border-radius: 8px; overflow: hidden;
}
.trend-col i b {
  display: block; width: 100%; border-radius: 8px;
  background: linear-gradient(180deg, #ffb08a, #ff5a1f);
  transition: height 0.3s;
}
.trend-col.today i b { background: linear-gradient(180deg, #ff7a45, #ff2d55); }
.trend-col.today .trend-val { color: #cf3f0e; font-weight: 700; }
.trend-day { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; white-space: nowrap; }
.trend-orders { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Avatars & lists ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  user-select: none;
}

.pending-list { display: flex; flex-direction: column; }
.pending-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 18px; border-top: 1px solid #f2f4f7;
  cursor: pointer; transition: background 0.12s;
}
.pending-row:first-child { border-top: 0; }
.pending-row:hover { background: #fafbfc; }
.pending-main { min-width: 0; flex: 1; }
.pending-top { display: flex; align-items: center; gap: 7px; }
.pending-name { font-size: 13px; font-weight: 650; }
.pending-time { margin-left: auto; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.pending-msg {
  font-size: 12px; color: var(--ink-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pending-row .btn-sm { flex-shrink: 0; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px;
}
.empty svg { width: 34px; height: 34px; color: #c6cdd6; margin-bottom: 10px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-3);
  background: #fcfcfd; padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-top: 1px solid #f2f4f7; vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr[data-action] { cursor: pointer; }
.table .check { width: 34px; }
.table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.table .num { font-variant-numeric: tabular-nums; }

.prod-cell { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.prod-thumb {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #f4f5f7; font-size: 14px; font-weight: 700; color: #667085;
}
.prod-title { font-size: 12.5px; font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-sku { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.price { font-weight: 650; font-variant-numeric: tabular-nums; }
.stock-low { color: var(--red); font-weight: 650; }
.stock-low small { display: block; font-size: 9.5px; font-weight: 600; color: var(--red); opacity: 0.8; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.table td.actions { text-align: right; white-space: nowrap; }
.logi b { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.logi small { display: block; font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 1px; }
.muted-dash { color: #c6cdd6; }
.sync-cell { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.sync-cell b { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.sync-cell.outdated b { color: var(--amber); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.result-hint { font-size: 12px; color: var(--ink-3); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 550; color: var(--ink-2);
  cursor: pointer; transition: 0.15s; white-space: nowrap;
}
.chip:hover { border-color: #d0d5dd; background: #fcfcfd; }
.chip.active { background: #101828; border-color: #101828; color: #fff; }
.chip small { font-size: 10px; opacity: 0.6; font-variant-numeric: tabular-nums; }

.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #101828; color: #fff; border-radius: 12px;
  padding: 9px 12px; margin-bottom: 12px;
  font-size: 12px;
  animation: slide-up 0.18s ease;
}
.batch-bar strong { color: #ffb08a; }
.batch-bar .spacer { flex: 1; }
.batch-bar .btn { padding: 6px 11px; font-size: 12px; color: #fff; border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); }
.batch-bar .btn:hover { background: rgba(255, 255, 255, 0.13); }

/* ---------- Inbox ---------- */
.inbox {
  height: 100%;
  display: grid; grid-template-columns: 348px minmax(0, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.inbox.has-cust { grid-template-columns: 320px minmax(0, 1fr) 296px; }

.conv-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: #fff; }

.pane-head { padding: 14px 14px 10px; border-bottom: 1px solid #f2f4f7; display: flex; flex-direction: column; gap: 10px; }
.pane-head .chip-row { gap: 5px; }
.pane-head .chip { padding: 5px 9px; font-size: 11.5px; }
.pane-tools { display: flex; align-items: center; gap: 8px; }
.pane-tools .search-box { flex: 1; min-width: 0; }
.pane-tools .btn { flex-shrink: 0; padding: 7px 9px; }

/* Customer profile */
.cust-pane {
  display: flex; flex-direction: column; gap: 17px;
  border-left: 1px solid var(--line); background: #fff;
  padding: 16px 16px 24px; overflow-y: auto; min-height: 0;
}
.cust-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #f2f4f7; }
.cust-head .avatar { width: 40px; height: 40px; font-size: 15px; }
.cust-head strong { display: block; font-size: 13.5px; font-weight: 700; }
.cust-head span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.cust-block { display: flex; flex-direction: column; }
.cust-label { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.4px; margin-bottom: 8px; }
.cust-label svg { width: 12px; height: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand-soft); color: #cf3f0e;
  font-size: 11px; font-weight: 600;
}
.tag-chip button { color: #cf3f0e; opacity: 0.6; font-size: 13px; line-height: 1; padding: 0 1px; }
.tag-chip button:hover { opacity: 1; }
.tag-form { display: flex; gap: 6px; margin-top: 8px; }
.tag-form .input { padding: 6px 9px; font-size: 12px; border-radius: 8px; }
.tag-form .btn { flex-shrink: 0; }
.cust-block textarea.input { font-size: 12px; line-height: 1.55; resize: vertical; background: #fcfcfd; }
.cust-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cust-stats div { background: #fbfcfd; border: 1px solid #f2f4f7; border-radius: 9px; padding: 8px 9px; }
.cust-stats span { display: block; font-size: 10px; color: var(--ink-3); }
.cust-stats b { display: block; font-size: 12px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.cust-line { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 9px; }
.cust-line b { color: var(--ink-2); font-weight: 600; }
.cust-orders { display: flex; flex-direction: column; gap: 6px; }
.cust-order { display: flex; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid #f2f4f7; border-radius: 9px; background: #fbfcfd; }
.cust-order b { display: block; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.cust-order span { display: block; font-size: 9.5px; color: var(--ink-3); margin-top: 2px; }
.cust-order .right { text-align: right; flex-shrink: 0; }
.cust-order .right strong { font-size: 11.5px; }
.cust-order .pill { margin-top: 4px; padding: 2px 7px; font-size: 9.5px; }
.cust-empty { font-size: 11px; color: var(--ink-3); }

.conv-list { flex: 1; overflow-y: auto; padding: 4px 0 10px; }

.conv-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.conv-item:hover { background: #fafbfc; }
.conv-item.active { background: #fff5ef; border-left-color: var(--brand); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-name.unread-name { font-weight: 750; }
.conv-time { margin-left: auto; font-size: 10px; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; }
.conv-preview { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview.unread { color: #7a5b4d; font-weight: 500; }
.conv-preview mark { background: #ffec9e; color: inherit; border-radius: 3px; padding: 0 1px; }
.conv-hit { display: inline-block; margin-right: 4px; padding: 0 5px; border-radius: 4px; background: var(--brand-soft); color: #cf3f0e; font-size: 9.5px; font-weight: 700; line-height: 15px; vertical-align: 1px; }
.conv-bottom { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.mini-plat { font-size: 10px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.mini-plat i { width: 5px; height: 5px; border-radius: 50%; }
.unread-dot {
  margin-left: auto; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: #ff4d1c; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.conv-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: 9.5px; font-weight: 600;
}
.conv-status svg { width: 10px; height: 10px; }
.conv-item.resolved .conv-name { color: #475467; }
.conv-item.resolved .conv-preview { color: #98a2b3; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f7f8fa; }

.chat-head {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 20px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.chat-head .avatar { width: 36px; height: 36px; font-size: 13px; }
.chat-user { min-width: 0; }
.chat-user strong { font-size: 14px; font-weight: 700; }
.chat-user .chat-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.chat-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #d0d5dd; }
.chat-meta > span, .chat-meta .pill, .chat-meta .agent-chip { white-space: nowrap; }
.chat-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chat-head .right .btn, .chat-head .right .pill { flex-shrink: 0; white-space: nowrap; }
.chat-user { flex: 1; min-width: 0; }
.chat-user .chat-meta { flex-wrap: nowrap; overflow: hidden; }
.auto-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--green); background: var(--green-soft); padding: 3px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.auto-badge svg { width: 11px; height: 11px; }

.back-btn { display: none; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 22px 12px;
  background-image: radial-gradient(#e7ebf1 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}

.msg-row { display: flex; gap: 9px; margin-bottom: 16px; align-items: flex-end; }
.msg-row.agent { flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.msg-col { max-width: 68%; display: flex; flex-direction: column; }
.msg-row.agent .msg-col { align-items: flex-end; }
.msg-name { font-size: 10px; color: var(--ink-3); margin: 0 4px 4px; }
.msg-bubble {
  padding: 9px 13px; border-radius: 4px 14px 14px 14px;
  background: #fff; color: var(--ink);
  font-size: 13px; line-height: 1.65;
  border: 1px solid #eceff3;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.agent .msg-bubble {
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(135deg, #ff6a2e, #ff3d5e);
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 69, 58, 0.18);
}
.msg-time { font-size: 9.5px; color: var(--ink-3); margin: 5px 4px 0; font-variant-numeric: tabular-nums; }
.msg-row.agent .msg-time { color: #b8a7a1; }
.auto-tag {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 5px; font-size: 9.5px; color: #cf3f0e;
  background: #fff; border: 1px solid #ffe0d3;
  padding: 2px 7px; border-radius: 999px;
}
.auto-tag svg { width: 10px; height: 10px; }

.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--ink-3); text-align: center; padding: 20px;
}
.chat-empty .big-ico {
  width: 66px; height: 66px; border-radius: 20px;
  display: grid; place-items: center; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--line);
  color: #c0c8d2; box-shadow: var(--shadow-sm);
}
.chat-empty .big-ico svg { width: 28px; height: 28px; }
.chat-empty strong { font-size: 14px; color: var(--ink-2); }
.chat-empty span { font-size: 12px; }

.composer-wrap { flex-shrink: 0; position: relative; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px 10px; }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  border: 1px solid #e4e7ec; border-radius: 12px;
  padding: 11px 13px; font-size: 13px; line-height: 1.55;
  background: #fcfcfd; transition: border-color 0.15s, box-shadow 0.15s;
}
.composer textarea:focus { outline: none; border-color: #ffb59b; background: #fff; box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.1); }
.composer .quick-btn { width: 44px; height: 44px; border-radius: 12px; background: #f7f8fa; border: 1px solid #eceff3; color: #667085; display: grid; place-items: center; }
.composer .quick-btn:hover { background: var(--brand-soft); color: #cf3f0e; border-color: #ffe0d3; }
.composer .quick-btn svg { width: 18px; height: 18px; }
.composer .btn-primary { height: 44px; padding: 0 18px; border-radius: 12px; }
.composer-hint { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-3); margin-top: 7px; padding-left: 3px; }
.composer-hint .sep { width: 3px; height: 3px; border-radius: 50%; background: #d0d5dd; }

.quick-pop {
  position: absolute; bottom: calc(100% - 6px); left: 16px; z-index: 30;
  width: 330px; max-width: calc(100% - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
  overflow: hidden;
  animation: slide-up 0.16s ease;
}
.quick-pop[hidden] { display: none; }
.quick-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid #f2f4f7; font-size: 12px; font-weight: 700; }
.quick-pop-list { max-height: 260px; overflow-y: auto; padding: 5px; }
.quick-pop-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; }
.quick-pop-item:hover { background: #f7f8fa; }
.quick-pop-item b { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.quick-pop-item span { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@keyframes slide-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Automation ---------- */
.banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid #ffe3d6;
  background: linear-gradient(120deg, #fff7f2, #fffdfb 60%);
  margin-bottom: 16px;
}
.banner .banner-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #fff; border: 1px solid #ffe3d6; color: #e04f16;
}
.banner .banner-ico svg { width: 20px; height: 20px; }
.banner h3 { font-size: 13.5px; font-weight: 700; }
.banner p { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.55; }
.banner .switch { margin-left: auto; }
.banner .state-label { margin-left: auto; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 9px; }

.tester-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 17px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.tester-head { margin-bottom: 11px; }
.tester-form { display: flex; align-items: center; gap: 8px; }
.tester-form .search-box { flex: 1; min-width: 0; }
.tester-form .select { width: 152px; flex-shrink: 0; }
.tester-result { margin-top: 11px; }
.tester-hit { border: 1px solid #abefc6; background: #f6fef9; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--green); }
.tester-hit b { display: block; margin-bottom: 4px; }
.tester-hit p { color: var(--ink-2); line-height: 1.65; }
.tester-warn { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--amber); }
.tester-miss { border: 1px dashed #e4e7ec; background: #fbfcfd; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--ink-3); }

.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.rule-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rule-index {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #f2f4f7; color: #667085;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rule-name { font-size: 13px; font-weight: 700; }
.rule-top .pill { margin-left: 0; }
.rule-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.keyword-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.keyword-chip { font-size: 10.5px; padding: 2px 8px; border-radius: 6px; background: #f2f4f7; color: #475467; }
.rule-reply { font-size: 12px; color: var(--ink-2); margin-top: 9px; line-height: 1.6; background: #fbfcfd; border: 1px dashed #e9ecf1; border-radius: 9px; padding: 8px 11px; }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; display: flex; flex-direction: column; gap: 7px; }
.qr-card:hover { border-color: #ffd4c2; }
.qr-head { display: flex; align-items: center; gap: 8px; }
.qr-head b { font-size: 12.5px; font-weight: 700; }
.qr-head .row-actions { margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.qr-card:hover .qr-head .row-actions { opacity: 1; }
.qr-text { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Platforms ---------- */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(262px, 1fr)); gap: 16px; }
.plat-detail { padding: 17px 18px; }
.plat-detail .plat-head { margin-bottom: 13px; }
.connect-form { border-top: 1px solid #f2f4f7; padding-top: 13px; margin-top: 4px; }
.connect-form .field { margin-bottom: 10px; }
.connect-form .input { font-size: 12px; padding: 8px 11px; }
.plat-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 13px 0; }
.plat-info .cell:first-child { grid-column: 1 / -1; }
.plat-info .cell { background: #fbfcfd; border: 1px solid #f2f4f7; border-radius: 9px; padding: 8px 10px; }
.plat-info .cell span { display: block; font-size: 10px; color: var(--ink-3); }
.plat-info .cell b { display: block; font-size: 11.5px; font-weight: 600; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.notice-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.notice-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.notice-card > p { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.step { border: 1px solid #f2f4f7; border-radius: 11px; padding: 12px; background: #fbfcfd; }
.step b { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.step b i { width: 18px; height: 18px; border-radius: 50%; background: #101828; color: #fff; font-size: 10px; font-style: normal; display: grid; place-items: center; }
.step p { font-size: 11px; color: var(--ink-3); line-height: 1.6; margin-top: 6px; }
.warn-line { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 11.5px; line-height: 1.6; display: flex; gap: 8px; align-items: flex-start; }
.warn-line svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

/* ---------- Order detail ---------- */
.od-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.od-kicker { display: block; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.4px; }
.od-no { display: block; font-size: 15px; font-weight: 750; margin-top: 3px; font-variant-numeric: tabular-nums; }
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.od-grid > div { background: #fbfcfd; border: 1px solid #f2f4f7; border-radius: 10px; padding: 9px 11px; min-width: 0; }
.od-grid > div > span { display: block; font-size: 10px; color: var(--ink-3); margin-bottom: 4px; }
.od-grid b { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.od-grid .wide { grid-column: 1 / -1; }
.od-grid .pill { margin-top: 1px; }
.od-title { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.4px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px dashed #eef1f4; }
.od-logi { display: flex; align-items: center; gap: 10px; background: #fbfcfd; border: 1px solid #f2f4f7; border-radius: 10px; padding: 10px 12px; }
.od-logi > div { min-width: 0; }
.od-logi span { display: block; font-size: 10px; color: var(--ink-3); }
.od-logi b { display: block; font-size: 12.5px; margin-top: 2px; letter-spacing: 0.3px; word-break: break-all; }
.od-logi .btn { margin-left: auto; flex-shrink: 0; }
.od-empty { font-size: 11.5px; color: var(--ink-3); background: #fbfcfd; border: 1px dashed #e4e7ec; border-radius: 10px; padding: 11px 12px; }
.od-alert {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 12px; padding: 9px 12px;
  border-radius: 10px; font-size: 12px; line-height: 1.5;
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid #fde3b8;
}
.od-alert.danger { background: var(--red-soft); color: var(--red); border-color: #fecdca; }
.od-alert svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.od-timeline { display: flex; flex-direction: column; padding-top: 2px; }
.od-event { display: flex; gap: 10px; padding-bottom: 12px; position: relative; }
.od-event::before { content: ""; position: absolute; left: 4px; top: 13px; bottom: 0; width: 1px; background: #e7ebf1; }
.od-event:last-child { padding-bottom: 0; }
.od-event:last-child::before { display: none; }
.od-dot { width: 9px; height: 9px; border-radius: 50%; background: #d0d5dd; margin-top: 4px; flex-shrink: 0; z-index: 1; }
.od-event.latest .od-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.od-event b { display: block; font-size: 12px; font-weight: 600; }
.od-event span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(520px, 100%); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px;
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.28);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal > form { display: flex; flex-direction: column; min-height: 0; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; flex-shrink: 0; }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfcfd; flex-shrink: 0; }
.modal-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.modal.modal-lg { width: min(720px, 100%); }

/* ---------- 商品 CSV 导入 ---------- */
.import-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.import-head strong { font-size: 13.5px; }
.import-file {
  margin-top: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 22px 16px; border: 1.5px dashed #d0d5dd; border-radius: 12px;
  background: #fcfcfd; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.import-file:hover { border-color: var(--brand); background: #fff8f3; }
.import-file svg { width: 22px; height: 22px; color: var(--brand); }
.import-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; font-size: 11.5px; color: var(--ink-3); }
.import-file-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-file-name svg { width: 13px; height: 13px; flex-shrink: 0; }
.import-counts { margin-left: auto; }
.import-counts .ok { color: var(--green); }
.import-counts .bad { color: #d92d20; }
.import-table { font-size: 11.5px; }
.import-table th, .import-table td { padding: 8px 10px; vertical-align: top; }
.import-table .imp-prod { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.import-table .imp-prod b { font-weight: 600; color: var(--ink); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-table .imp-prod span { font-size: 10.5px; color: var(--ink-3); }
.import-table .imp-reason { margin-top: 4px; font-size: 10.5px; color: #b42318; line-height: 1.4; }
.import-table tr.import-bad td { background: #fff8f7; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  max-width: 380px; padding: 10px 15px;
  background: #101828; color: #fff;
  border-radius: 11px; font-size: 12px; line-height: 1.5;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.26);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  pointer-events: auto;
}
.toast.ok { background: #067647; }
.toast.warn { background: #b54708; }
.toast.out { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- AI 接待概览 ---------- */
.is-warn { color: var(--red) !important; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }

.ai-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; }

.ai-card {
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  background:
    radial-gradient(340px 180px at 100% 0%, rgba(127, 86, 217, 0.1), transparent 70%),
    var(--panel);
}
.ai-card-head { display: flex; align-items: center; gap: 11px; }
.ai-orb {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #9e77ed, #6941c6);
  color: #fff; box-shadow: 0 8px 18px rgba(127, 86, 217, 0.3);
}
.ai-orb svg { width: 21px; height: 21px; }
.ai-orb.sm { width: 34px; height: 34px; border-radius: 10px; }
.ai-orb.sm svg { width: 17px; height: 17px; }
.ai-card-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ai-card-copy b { font-size: 14px; font-weight: 700; }
.ai-card-copy span { font-size: 11.5px; color: var(--ink-3); }

.ai-rate-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.ai-rate-top b { font-size: 20px; font-weight: 750; color: var(--purple); font-variant-numeric: tabular-nums; }
.ai-meter { margin-top: 7px; height: 8px; border-radius: 6px; background: #f1eefb; overflow: hidden; }
.ai-meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #b692f6, #7f56d9); transition: width 0.3s; }

.ai-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ai-metrics > div { background: #faf9ff; border: 1px solid #f0ecfb; border-radius: 10px; padding: 9px 10px; }
.ai-metrics span { display: block; font-size: 10.5px; color: var(--ink-3); }
.ai-metrics b { display: block; font-size: 16px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

.ai-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--ink-3);
}

/* ---------- 团队负载 ---------- */
.team-load .card-head { padding-bottom: 12px; }
.team-load-list { display: flex; flex-direction: column; padding: 6px 6px 10px; }
.team-load-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; transition: background 0.12s; }
.team-load-row:hover { background: #fafbfc; }
.agent-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.agent-avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.team-load-main { flex: 1; min-width: 0; }
.team-load-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.team-load-top b { font-size: 12.5px; font-weight: 650; }
.agent-role { font-size: 10.5px; color: var(--ink-3); }
.mini-warn { font-size: 9.5px; font-weight: 700; color: var(--red); background: var(--red-soft); padding: 1px 6px; border-radius: 6px; }
.online-dot { margin-left: auto; font-style: normal; font-size: 10px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.online-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d0d5dd; }
.online-dot.on { color: var(--green); }
.online-dot.on::before { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16); }
.load-bar { margin-top: 6px; height: 6px; border-radius: 5px; background: #f0f2f5; overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7cd4a8, #12b76a); transition: width 0.3s; }
.load-bar i.high { background: linear-gradient(90deg, #fdb022, #f79009); }
.load-bar i.full { background: linear-gradient(90deg, #f97066, #f04438); }
.team-load-num { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-load-num b { font-size: 13px; color: var(--ink); font-weight: 700; }

/* ---------- 收件箱：标记与操作 ---------- */
.conv-flag { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; line-height: 1.6; }
.conv-flag.human { background: var(--red-soft); color: var(--red); }
.conv-flag.urgent { background: var(--amber-soft); color: var(--amber); }
.conv-agent { font-size: 10px; color: var(--ink-3); padding-left: 8px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-bottom > .unread-dot, .conv-bottom > .conv-status { margin-left: auto; }

.agent-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: 10px; font-weight: 600; }
.agent-chip svg { width: 11px; height: 11px; }

.ai-tag {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 5px;
  font-size: 9.5px; color: var(--purple);
  background: #f5f0ff; border: 1px solid #e6dcff;
  padding: 2px 7px; border-radius: 999px;
}
.ai-tag svg { width: 10px; height: 10px; }

.chat-ops {
  flex-shrink: 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 9px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.ops-item { display: flex; align-items: center; gap: 7px; }
.ops-label { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.ops-label svg { width: 12px; height: 12px; }
.ops-statuses { gap: 6px; margin-left: auto; }
.select-xs { width: auto; padding: 5px 26px 5px 9px; font-size: 11.5px; border-radius: 8px; background-position: right 8px center; }

.ai-suggest {
  margin-bottom: 10px; padding: 11px 13px; border-radius: 12px;
  background: linear-gradient(135deg, #f7f2ff, #fdf5fb);
  border: 1px solid #e9ddff;
}
.ai-suggest-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-suggest-title { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--purple); }
.ai-suggest-title svg { width: 13px; height: 13px; }
.ai-suggest-meta { font-size: 10px; color: #8b7bb8; }
.ai-suggest p { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin: 7px 0 9px; white-space: pre-wrap; word-break: break-word; }
.ai-suggest-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 客服团队页 ---------- */
.team-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.team-kpis > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.team-kpis > div:first-child { border-left: 0; }
.team-kpis span { display: block; font-size: 11.5px; color: var(--ink-3); }
.team-kpis b { display: block; font-size: 23px; font-weight: 750; letter-spacing: -0.4px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.team-kpis b small { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }

.team-notice { margin-top: 14px; border-left: 4px solid var(--purple); }
.team-notice h3 { display: flex; align-items: center; gap: 6px; }
.team-notice h3 svg { width: 16px; height: 16px; color: var(--purple); }

.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); gap: 14px; }
.agent-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.agent-card:hover { box-shadow: var(--shadow); }
.agent-card.offline { background: #fbfbfc; }
.agent-card-top { display: flex; align-items: center; gap: 10px; }
.agent-card-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.agent-card-name b { font-size: 13.5px; font-weight: 700; }
.agent-card-name span { font-size: 10.5px; color: var(--ink-3); }
.agent-load { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.agent-load .load-bar { flex: 1; margin-top: 0; }
.agent-load span { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.agent-stats > div { background: #fafbfc; border-radius: 9px; padding: 7px 9px; }
.agent-stats span { display: block; font-size: 10px; color: var(--ink-3); }
.agent-stats b { display: block; font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.agent-foot { margin-top: 10px; }
.agent-foot .online-dot { margin-left: 0; }

.queue-cust { display: flex; align-items: center; gap: 8px; min-width: 0; }
.queue-cust > div { min-width: 0; }
.queue-cust b { font-size: 12.5px; font-weight: 650; }
.queue-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); min-width: 0; }
.queue-msg { font-style: normal; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.queue-time { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.team-table tr.is-human td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.team-table .select-xs { min-width: 92px; }

/* ---------- 知识库 ---------- */
.kb-banner { align-items: center; flex-wrap: wrap; }
.kb-banner-stats { margin-left: auto; display: flex; gap: 24px; text-align: right; }
.kb-banner-stats b { display: block; font-size: 20px; font-weight: 750; color: var(--purple); font-variant-numeric: tabular-nums; }
.kb-banner-stats span { font-size: 10.5px; color: var(--ink-3); }
.kb-chips { margin: 12px 0; }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kb-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 9px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.kb-card:hover { box-shadow: var(--shadow); }
.kb-card.is-off { background: #fbfbfc; opacity: 0.72; }
.kb-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-cat { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 10.5px; font-weight: 600; }
.kb-card h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px; }
.kb-card .keyword-row { margin: 0; }
.kb-content {
  font-size: 12px; color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 10.5px; color: var(--ink-3);
}
.kb-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.kb-foot svg { width: 11px; height: 11px; }
.kb-foot .row-actions { margin-left: auto; }

.kb-test-card { border-radius: 12px; padding: 13px 14px; border: 1px solid var(--line); background: #fff; }
.kb-test-card.hit { border-color: #e6dcff; background: linear-gradient(135deg, #faf7ff, #fff); }
.kb-test-card.escalate { border-color: #fecdca; background: var(--red-soft); }
.kb-test-card.miss { border-color: #fedf89; background: var(--amber-soft); }
.kb-test-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kb-test-top b { font-size: 12.5px; font-weight: 700; }
.kb-test-top span { font-size: 10.5px; color: var(--ink-3); }
.kb-test-card p { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin-top: 8px; }
.kb-test-card .keyword-row { margin: 9px 0 0; }
.kb-test-mode { display: inline-block; margin-top: 9px; font-size: 10.5px; color: var(--ink-3); }
.conf-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 700; }
.conf-bar { margin-top: 8px; height: 6px; border-radius: 5px; background: #f1eefb; overflow: hidden; }
.conf-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #b692f6, #7f56d9); }

/* ---------- AI 设置 ---------- */
.ai-settings {
  margin-top: 18px; padding: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ai-settings-head { display: flex; align-items: center; gap: 11px; }
.ai-settings-copy { flex: 1; min-width: 0; }
.ai-settings-stats { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); }
.ai-settings-stats b { color: var(--purple); font-size: 15px; margin-left: 3px; font-variant-numeric: tabular-nums; }
.ai-switch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.ai-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #faf9ff; border: 1px solid #f0ecfb; border-radius: 12px; padding: 11px 14px;
}
.ai-switch b { display: block; font-size: 12.5px; }
.ai-switch span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.ai-fields { margin-top: 14px; }
.ai-settings-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-3);
}

/* ---------- 平台卡片 KPI ---------- */
.plat-kpis { display: flex; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.plat-kpis > div { flex: 1; min-width: 0; padding-left: 10px; border-left: 1px solid var(--line); }
.plat-kpis > div:first-child { padding-left: 0; border-left: 0; }
.plat-kpis span { display: block; font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.plat-kpis b { display: block; font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- AI 运营 ---------- */
.head-links { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ops-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(127, 86, 217, 0.1), transparent 70%),
    var(--panel);
}
.ops-banner-copy { flex: 1; min-width: 220px; }
.ops-banner-copy .section-title { display: flex; align-items: center; gap: 8px; }
.ops-banner-copy p { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.ops-banner-copy b { color: var(--ink); }
.ops-banner-links { display: flex; gap: 8px; }

.ops-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 16px; }
.ops-kpi {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 13px;
}
.ops-kpi-ico {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--soft); color: var(--tone);
}
.ops-kpi-ico svg { width: 16px; height: 16px; }
.ops-kpi-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ops-kpi-label { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.ops-kpi-body b { font-size: 19px; font-weight: 750; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.ops-kpi-body em {
  font-style: normal; font-size: 9.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ops-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); }
.ops-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ops-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

.ops-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 18px 20px 16px; }
.ops-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.ops-col-total { font-size: 10.5px; color: var(--ink-3); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.ops-bar-wrap { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.ops-bar {
  width: 100%; border-radius: 8px; background: #f3f5f8; overflow: hidden;
  display: flex; flex-direction: column-reverse; gap: 2px;
}
.ops-bar b { display: block; width: 100%; min-height: 2px; }
.seg-auto { background: #12b76a; }
.seg-accepted { background: #7f56d9; }
.seg-dismissed { background: #d0d5dd; }
.seg-handoff { background: #f79009; }
.seg-escalated { background: #f04438; }
.ops-day { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; white-space: nowrap; }

.gap-list, .rank-list { padding: 6px 8px 10px; }
.gap-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.gap-row:hover { background: #fafbfc; }
.gap-rank {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px;
  background: var(--amber-soft); color: var(--amber);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.gap-main { flex: 1; min-width: 0; }
.gap-main b {
  display: block; font-size: 12.5px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gap-main span { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.gap-main em { font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.gap-conf { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.gap-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gap-actions .btn { padding: 5px 9px; font-size: 11px; }

.rank-row { padding: 10px; border-radius: 10px; }
.rank-row:hover { background: #fafbfc; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rank-top b {
  font-size: 12.5px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-top span { font-size: 11px; color: var(--purple); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-bar { margin-top: 7px; height: 6px; border-radius: 5px; background: #f1eefb; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #b692f6, #7f56d9); }
.rank-sub { display: block; margin-top: 5px; font-size: 10px; color: var(--ink-3); }
.rank-list .empty, .gap-list .empty { padding: 28px 12px; }

.ops-log { padding: 4px 8px 10px; }
.ops-log-row {
  width: 100%; display: grid;
  grid-template-columns: 66px 60px minmax(0, 1fr) 88px 120px;
  align-items: center; gap: 10px; padding: 9px 10px;
  border: 0; background: none; border-radius: 10px;
  text-align: left; font: inherit; color: inherit;
}
.ops-log-row.is-link { cursor: pointer; }
.ops-log-row.is-link:hover { background: #fafbfc; }
.ops-log-time { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.ops-log-plat { min-width: 0; }
.ops-log-text { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-log-src {
  font-size: 10px; color: var(--ink-3); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ops-log-row .pill { justify-self: start; }
.ops-log .empty { padding: 28px 12px; }

.gap-draft-note {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--purple-soft); color: var(--purple);
  font-size: 11.5px; line-height: 1.5;
}
.gap-draft-note svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- 客户 360 ---------- */
.custp-full { margin-left: auto; flex-shrink: 0; }
.custp-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.custp-cell-body { min-width: 0; }
.custp-name { display: flex; align-items: center; gap: 6px; }
.custp-name b { font-size: 12.5px; font-weight: 650; }
.custp-name .pill { padding: 1px 7px; font-size: 9.5px; }
.custp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.custp-tag { font-size: 10px; color: var(--ink-2); background: #f4f6f8; border-radius: 6px; padding: 1px 6px; }
.custp-tag.muted { color: var(--ink-3); background: transparent; padding-left: 0; }
.custp-plats { display: flex; flex-wrap: wrap; gap: 5px; }
.custp-num { display: flex; align-items: baseline; gap: 8px; }
.custp-num b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.custp-num span { font-size: 11px; color: var(--ink-3); }
.custp-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.custp-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.custp-flags .pill { padding: 1px 7px; font-size: 9.5px; }
.custp-flags-mobile { display: none; }
.custp-kpis b small { white-space: nowrap; }

.custp-modal { display: flex; flex-direction: column; gap: 14px; }
.custp-hero { display: flex; align-items: center; gap: 12px; }
.custp-avatar { width: 46px; height: 46px; font-size: 17px; }
.custp-hero-copy { min-width: 0; }
.custp-hero-name { display: flex; align-items: center; gap: 8px; }
.custp-hero-name strong { font-size: 16px; }
.custp-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: 10.5px; color: var(--ink-3); }
.custp-ai { border: 1px solid #ece7fb; background: linear-gradient(135deg, #faf8ff, #fff); border-radius: 12px; padding: 12px 14px; }
.custp-ai-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--purple); letter-spacing: 0.3px; }
.custp-ai-head svg { width: 14px; height: 14px; }
.custp-ai p { margin-top: 6px; font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.custp-suggests { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.custp-suggests .pill { font-size: 10px; padding: 2px 8px; }
.custp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.custp-stats > div { background: #fbfcfd; border: 1px solid #f2f4f7; border-radius: 10px; padding: 9px 11px; }
.custp-stats span { display: block; font-size: 10px; color: var(--ink-3); }
.custp-stats b { display: block; margin-top: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.custp-cols { gap: 18px; }
.custp-convs { display: flex; flex-direction: column; gap: 6px; }
.custp-conv { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid #f2f4f7; border-radius: 9px; background: #fbfcfd; }
.custp-conv-copy { flex: 1; min-width: 0; }
.custp-conv-copy b { display: block; font-size: 10.5px; }
.custp-conv-copy span { display: block; margin-top: 2px; font-size: 10px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custp-conv .btn { flex-shrink: 0; }

/* ---------- 售后工单 ---------- */
.as-kpis b small { white-space: nowrap; }
.as-no { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11.5px; font-weight: 650; letter-spacing: 0.2px; }
.as-sub { margin-top: 3px; font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.as-sub-amount { display: none; }
.as-cust { display: flex; align-items: center; gap: 6px; }
.as-cust b { font-size: 12.5px; font-weight: 650; }
.as-cust .pill { padding: 1px 7px; font-size: 9.5px; }
.as-reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; color: var(--ink-2); line-height: 1.55; max-width: 240px; }
.as-table td { vertical-align: middle; }
.as-hero { display: flex; align-items: center; gap: 12px; }
.as-hero-copy { min-width: 0; }
.as-hero-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.as-hero-name strong { font-size: 16px; }
.as-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: 10.5px; color: var(--ink-3); }
.as-reason-box { border: 1px solid #f2f4f7; background: #fbfcfd; border-radius: 12px; padding: 11px 14px; }
.as-reason-box > span { font-size: 10px; color: var(--ink-3); letter-spacing: 0.4px; }
.as-reason-box p { margin-top: 5px; font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.as-reason-box .as-reject { color: #b42318; font-size: 11.5px; }
.as-tools { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.as-tool { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--ink-3); }
.as-tool .select { min-width: 132px; height: 32px; }
.as-logis { display: flex; flex-direction: column; gap: 6px; }
.as-logi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid #f2f4f7; border-radius: 9px; background: #fbfcfd; font-size: 11.5px; }
.as-logi span { color: var(--ink-3); font-size: 10.5px; }
.as-logi b { font-weight: 600; }
.as-ev-text { display: block; margin-top: 2px; font-style: normal; font-size: 10.5px; line-height: 1.5; color: var(--ink-2); }
.as-kpi-overdue { display: block; margin-top: 5px; font-size: 10.5px; font-style: normal; font-weight: 700; color: var(--red); }
.as-toolbar-left { flex-direction: column; align-items: flex-start; gap: 8px; }
.as-reasons { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.as-reasons-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.as-reasons-head b { font-size: 13px; }
.as-reasons-head span { font-size: 10.5px; color: var(--ink-3); }
.as-reason-bars { margin-top: 12px; display: grid; gap: 10px; }
.as-reason-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px 78px; align-items: center; gap: 10px; font-size: 11.5px; }
.as-reason-label { font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-reason-track { height: 8px; border-radius: 999px; background: #f2f4f7; overflow: hidden; }
.as-reason-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff8a5c, #ff5a1f); }
.as-reason-row b { text-align: right; font-variant-numeric: tabular-nums; }
.as-reason-amount { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 经营报表 ---------- */
.rep-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rep-toolbar .result-hint { margin-left: auto; }
.rep-table-scroll { overflow-x: auto; }
.rep-platform-table th, .rep-platform-table td { padding: 11px 14px; }
.rep-shop { display: flex; align-items: center; gap: 9px; }
.rep-shop b { display: block; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.rep-shop span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.rep-share { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.rep-share-track { flex: 1; height: 6px; border-radius: 999px; background: #f2f4f7; overflow: hidden; }
.rep-share-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb27a, #ff5a1f); }
.rep-share span { width: 36px; text-align: right; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rep-refund-cell { display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; }
.rep-refund-cell small { font-size: 10px; color: var(--ink-3); }
.rep-trend-wrap { overflow-x: auto; }
.rep-trend { display: flex; align-items: flex-end; gap: 9px; height: 188px; padding: 18px 20px 14px; }
.rep-trend.is-wide { min-width: 840px; gap: 5px; }
.rep-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.rep-col em { font-style: normal; font-size: 10px; color: var(--ink-3); margin-bottom: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-col i { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; }
.rep-col i b { display: block; width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #ffb27a, #ff7a45); min-height: 3px; }
.rep-col.today i b { background: linear-gradient(180deg, #ff7a45, #ff2d55); }
.rep-col.today em { color: #cf3f0e; font-weight: 700; }
.rep-col span { font-size: 10px; color: var(--ink-3); margin-top: 7px; white-space: nowrap; }
.rep-refund-list { padding: 6px 8px 10px; }
.rep-refund-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; }
.rep-refund-row:hover { background: #fafbfc; }
.rep-refund-main { flex: 1; min-width: 0; }
.rep-refund-main b { display: block; font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-refund-main span { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 10.5px; color: var(--ink-3); flex-wrap: wrap; }
.rep-refund-main em { font-style: normal; }
.rep-refund-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.rep-refund-amt { font-size: 12.5px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.rep-refund-list .empty { padding: 28px 12px; }

/* ---------- 库存补货 ---------- */
.inv-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.inv-chips { display: flex; flex-direction: column; gap: 6px; }
.inv-toolbar .result-hint { margin-left: auto; text-align: right; max-width: 360px; line-height: 1.5; }
.inv-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 18px; }
.inv-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.inv-field > span { color: var(--ink-3); }
.inv-field em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.inv-field .select { width: 74px; }
.inv-hint { flex: 1 1 280px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.inv-table-scroll { overflow-x: auto; }
.inv-table th, .inv-table td, .inv-plat-table th, .inv-plat-table td { padding: 11px 14px; }
.inv-prod { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.inv-prod b { display: block; font-size: 12.5px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-prod span { display: block; margin-top: 1px; font-size: 10.5px; color: var(--ink-3); }
.inv-cover { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.inv-cover-track { flex: 1; height: 6px; border-radius: 999px; background: #f2f4f7; overflow: hidden; }
.inv-cover-track i { display: block; height: 100%; border-radius: 999px; background: #12b76a; }
.inv-cover-track i.lv-out { background: #f04438; }
.inv-cover-track i.lv-critical { background: #f79009; }
.inv-cover-track i.lv-low { background: #2e90fa; }
.inv-cover span { width: 44px; text-align: right; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-restock b { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-restock small { margin-left: 2px; font-size: 10px; color: var(--ink-3); }
.inv-table td.stock-out { color: var(--red); font-weight: 700; }
.inv-plat-out { color: var(--red); font-weight: 650; }
.inv-plat-critical { color: #b54708; font-weight: 650; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .inbox.has-cust { grid-template-columns: 316px minmax(0, 1fr); }
  .cust-pane { display: none; }
}

@media (max-width: 1180px) {
  .two-col { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 316px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .brand { padding: 0 4px 0 0; }
  .brand-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .brand-text { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; flex: 1; padding: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .nav-item svg { display: none; }
  .nav-label { display: none; }
  .nav-short { display: inline; }
  .nav-badge { position: static; transform: none; margin-left: 3px; min-width: 17px; height: 17px; }
  .sidebar-foot { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar .clock { display: none; }
  .page-heading h1 { font-size: 16.5px; }
  .page-heading p { display: none; }
  .topbar-actions .btn { padding: 8px 11px; font-size: 12px; }
  .view { padding: 16px 14px 32px; }
  .view.inbox-view { padding: 10px 10px 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 21px; }
  .two-col { gap: 12px; }
  .connect-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; border-radius: 14px; }
  .inbox .chat-pane { display: none; }
  .inbox.is-chat .conv-pane { display: none; }
  .inbox.is-chat .chat-pane { display: flex; }
  .back-btn { display: inline-grid; }
  .chat-head { padding: 10px 12px; gap: 8px; }
  .chat-head .auto-badge { display: none; }
  .chat-head .right { gap: 6px; }
  .chat-head .right .pill { display: none; }
  .chat-head .right .btn { padding: 6px 9px; font-size: 11px; white-space: nowrap; }
  .trend-chart { height: 164px; gap: 5px; padding: 14px 12px 12px; }
  .trend-val { font-size: 9px; margin-bottom: 4px; }
  .trend-day, .trend-orders { font-size: 9px; }
  .trend-sum { font-size: 10.5px; }
  .trend-sum b { font-size: 12px; }
  .msg-col { max-width: 82%; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .toasts { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .toast { max-width: none; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 16px; max-height: 92vh; }
  .import-head { flex-direction: column; align-items: stretch; }
  .import-head .btn { align-self: flex-start; }
  .import-file { padding: 16px 12px; }
  .import-counts { margin-left: 0; flex-basis: 100%; }
  .import-table th:nth-child(3), .import-table td:nth-child(3),
  .import-table th:nth-child(4), .import-table td:nth-child(4) { display: none; }
  .import-table .imp-prod b { max-width: none; white-space: normal; }
  .quick-pop { width: calc(100% - 32px); }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right { flex-wrap: wrap; }
  .toolbar-right .search-box { flex: 1 1 100%; order: -1; }
  .tester-form { flex-wrap: wrap; }
  .tester-form .search-box { flex: 1 1 100%; }
  .tester-form .select { flex: 1; width: auto; }
  .plat-info { grid-template-columns: 1fr 1fr; }
  .od-grid { grid-template-columns: 1fr; }
  .od-grid .wide { grid-column: auto; }

  .order-table thead { display: none; }
  .order-table, .order-table tbody { display: block; }
  .order-table tr {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 7px 10px; padding: 12px 14px;
    border-top: 1px solid #f2f4f7;
  }
  .order-table tbody tr:first-child { border-top: 0; }
  .order-table td { border: 0; padding: 0; }
  .order-table td:nth-child(1) { flex: 1 1 100%; font-size: 12px; font-weight: 650; }
  .order-table td:nth-child(4), .order-table td:nth-child(8), .order-table td.no-logi { display: none; }
  .order-table td:nth-child(5) { margin-left: auto; font-size: 12.5px; }
  .order-table td:nth-child(6) { flex: 1 1 100%; }
  .order-table td:nth-child(6) .logi { display: flex; gap: 6px; align-items: baseline; }
  .order-table td:nth-child(6) .logi small { margin-top: 0; }
  .order-table td:nth-child(9) { margin-left: auto; }
  .order-table td[colspan] { flex: 1 1 100%; }
  .order-table .row-actions { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

  .todo-strip { padding: 9px 12px; gap: 8px 10px; }
  .todo-title { font-size: 12px; }
  .todo-item { font-size: 11.5px; padding: 3px 9px; }

  .product-table thead { display: none; }
  .product-table, .product-table tbody { display: block; }
  .product-table tr {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 10px; padding: 12px 14px;
    border-top: 1px solid #f2f4f7;
  }
  .product-table tbody tr:first-child { border-top: 0; }
  .product-table td { border: 0; padding: 0; }
  .product-table td:nth-child(1) { flex: 0 0 auto; }
  .product-table td:nth-child(2) { flex: 1 1 calc(100% - 60px); min-width: 0; overflow: hidden; }
  .product-table td:nth-child(2) .prod-cell { min-width: 0; overflow: hidden; }
  .product-table td:nth-child(2) .prod-cell > div { min-width: 0; }
  .product-table td:nth-child(2) .prod-title { max-width: none; width: 100%; }
  .product-table td:nth-child(4) { margin-left: auto; font-size: 12.5px; }
  .product-table td:nth-child(6), .product-table td:nth-child(8) { display: none; }
  .product-table td:nth-child(9) { flex: 1 1 100%; }
  .product-table td[colspan] { flex: 1 1 100%; }
}

@media (max-width: 1180px) {
  .ai-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .team-kpis { grid-template-columns: 1fr 1fr; }
  .team-kpis > div:nth-child(3) { border-left: 0; }
  .team-kpis > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ai-metrics { grid-template-columns: 1fr 1fr; }
  .kb-banner-stats { margin-left: 0; width: 100%; justify-content: flex-start; text-align: left; }
  .kb-grid { grid-template-columns: 1fr; }
  .ai-switch-grid { grid-template-columns: 1fr; }
  .chat-ops { gap: 8px 14px; padding: 8px 14px; }
  .plat-kpis { flex-wrap: wrap; gap: 10px 0; }
  .plat-kpis > div { flex: 1 1 33.33%; }
}

@media (max-width: 760px) {
  .agent-grid { grid-template-columns: 1fr; }
  .team-kpis > div { padding: 12px 14px; }
  .team-kpis b { font-size: 20px; }
  .team-table thead { display: none; }
  .team-table, .team-table tbody { display: block; }
  .team-table tr {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 10px; padding: 12px 14px;
    border-top: 1px solid #f2f4f7;
  }
  .team-table tbody tr:first-child { border-top: 0; }
  .team-table td { border: 0; padding: 0; }
  .team-table td:nth-child(1) { flex: 1 1 100%; }
  .team-table td:nth-child(2), .team-table td:nth-child(3) { flex: 1 1 calc(50% - 5px); }
  .team-table td:nth-child(4) { flex: 1 1 100%; }
  .team-table td:nth-child(5) { margin-left: auto; }
  .team-table td:nth-child(6) { flex: 0 0 auto; }
  .team-table .select-xs { width: 100%; min-width: 0; }
  .team-table td[colspan] { flex: 1 1 100%; }
  .chat-head { flex-wrap: wrap; row-gap: 8px; }
  .chat-head .chat-user { flex: 1 1 0; }
  .chat-user .chat-meta > span:not(.agent-chip):not(.pill):not(.sep) { display: none; }
  .chat-user .chat-meta .sep { display: none; }
  .chat-user .chat-meta { gap: 5px; }
  .chat-head .right {
    flex: 1 1 100%; margin-left: 0; justify-content: flex-end;
    padding-top: 7px; border-top: 1px dashed var(--line);
  }
  .composer-hint { display: none; }
  .section-head { flex-wrap: wrap; row-gap: 8px; }
  .section-head > .toolbar-right { flex: 1 1 100%; }
  .section-head .toolbar-right .search-box { flex: 1 1 auto; }
  .section-head .toolbar-right .btn { flex-shrink: 0; }
  .chat-ops .ops-item { flex: 1 1 45%; }
  .ops-statuses { flex: 1 1 100%; margin-left: 0; }
  .ai-suggest-actions .btn { flex: 1 1 auto; }
  .ai-settings { padding: 14px; }
  .ai-settings-stats { display: none; }
  .kb-banner { padding: 14px; }
  .kb-banner-stats { gap: 18px; }
  .kb-banner-stats b { font-size: 18px; }
  .plat-kpis > div { flex: 1 1 33.33%; }
}

@media (max-width: 1180px) {
  .ops-kpis { grid-template-columns: repeat(3, 1fr); }
  .ops-log-row { grid-template-columns: 60px 56px minmax(0, 1fr) 84px; }
  .ops-log-src { display: none; }
}

@media (max-width: 900px) {
  .ops-banner-links { flex: 1 1 100%; justify-content: flex-end; }
  .ops-kpi-label { white-space: normal; }
}

@media (max-width: 760px) {
  .ops-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ops-kpi { padding: 11px; gap: 8px; }
  .ops-kpi-ico { width: 28px; height: 28px; border-radius: 8px; }
  .ops-kpi-body b { font-size: 17px; }
  .ops-chart { height: 160px; gap: 5px; padding: 12px; }
  .ops-col-total, .ops-day { font-size: 9px; }
  .ops-legend { gap: 8px; font-size: 9.5px; }
  .ops-chart-card .card-head, .ops-banner { flex-wrap: wrap; }
  .ops-banner { padding: 14px; }
  .ops-log-row { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; padding: 9px 8px; }
  .ops-log-plat, .ops-log-src { display: none; }
  .gap-row { flex-wrap: wrap; row-gap: 6px; }
  .gap-main { flex: 1 1 calc(100% - 32px); }
  .gap-conf { margin-left: 32px; }
  .gap-actions { flex: 1 1 100%; justify-content: flex-end; }
  .gap-draft-note { align-items: flex-start; }
}

@media (max-width: 760px) {
  .custp-col-plat, .custp-col-state { display: none; }
  .custp-flags-mobile { display: flex; margin-top: 4px; }
  .custp-table th, .custp-table td { padding: 10px 12px; }
  .custp-table .row-actions { flex-wrap: wrap; }
  .custp-table .custp-sub { word-break: keep-all; }
  .custp-num { flex-direction: column; align-items: flex-start; gap: 1px; }
  .custp-stats { grid-template-columns: 1fr 1fr; }
  .custp-hero { align-items: flex-start; }
  .custp-modal { gap: 12px; }
  .custp-modal .grid-2 { row-gap: 14px; }
  .custp-ai { padding: 11px 12px; }
  .as-col-reason, .as-col-owner, .as-col-time, .as-col-amount { display: none; }
  .as-sub-amount { display: inline; }
  .as-table th, .as-table td { padding: 10px 12px; }
  .as-table .late-tag { display: flex; width: max-content; margin: 4px 0 0; }
  .as-reason { max-width: none; }
  .as-hero { align-items: flex-start; }
  .as-tool { flex: 1 1 140px; }
  .as-tool .select { width: 100%; }
  .as-reasons { padding: 14px; }
  .as-reason-row { grid-template-columns: 76px minmax(0, 1fr) 46px; }
  .as-reason-amount { display: none; }
  .rep-col-share, .rep-col-aov, .rep-col-as { display: none; }
  .rep-platform-table th, .rep-platform-table td { padding: 10px 12px; }
  .rep-shop span { display: none; }
  .rep-trend-card .card-head { flex-wrap: wrap; row-gap: 8px; }
  .rep-trend-card .card-head-right { flex-wrap: wrap; }
  .rep-toolbar .result-hint { margin-left: 0; }
  .rep-trend { height: 160px; padding: 12px; }
  .rep-trend.is-wide { min-width: 720px; }
  .rep-trend.is-wide .rep-col span { visibility: hidden; }
  .rep-trend.is-wide .rep-col:nth-child(5n+1) span, .rep-trend.is-wide .rep-col:last-child span { visibility: visible; }
  .rep-refund-row { padding: 9px 6px; }
  .inv-toolbar .result-hint { margin-left: 0; text-align: left; max-width: none; }
  .inv-settings { gap: 10px 14px; padding: 12px 14px; }
  .inv-hint { flex-basis: 100%; }
  .inv-settings-card .card-head { flex-wrap: wrap; row-gap: 4px; }
  .inv-settings-card .card-head .muted { display: none; }
  .inv-col-daily, .inv-col-rev, .inv-col-amt, .inv-plat-low, .inv-plat-lost { display: none; }
  .inv-table, .inv-table tbody { display: block; }
  .inv-table thead { display: none; }
  .inv-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-top: 1px solid #f2f4f7; }
  .inv-table tbody tr:first-child { border-top: 0; }
  .inv-table td { border: 0; padding: 0; }
  .inv-table td:nth-child(1) { flex: 1 1 100%; }
  .inv-table td:nth-child(2) { display: none; }
  .inv-table td:nth-child(4) { flex: 1 1 120px; min-width: 0; }
  .inv-table td:nth-child(3)::before { content: "库存 "; color: var(--ink-3); font-size: 10.5px; font-weight: 400; }
  .inv-table td:nth-child(6)::before { content: "补货 "; color: var(--ink-3); font-size: 10.5px; font-weight: 400; }
  .inv-table td:nth-child(5) .pill { font-size: 10.5px; }
  .inv-prod { min-width: 0; }
  .inv-prod b { max-width: 210px; }
  .inv-cover { min-width: 0; }
  .inv-cover span { width: 40px; }
  .inv-plat-table, .inv-plat-table tbody { display: block; }
  .inv-plat-table thead { display: none; }
  .inv-plat-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 12px 14px; border-top: 1px solid #f2f4f7; }
  .inv-plat-table tbody tr:first-child { border-top: 0; }
  .inv-plat-table td { border: 0; padding: 0; font-size: 12px; }
  .inv-plat-table td:nth-child(1) { flex: 1 1 100%; }
  .inv-plat-table td::before { color: var(--ink-3); font-size: 10.5px; }
  .inv-plat-table td:nth-child(2)::before { content: "在售 "; }
  .inv-plat-table td:nth-child(3)::before { content: "缺货 "; }
  .inv-plat-table td:nth-child(4)::before { content: "断货风险 "; }
  .inv-plat-table td:nth-child(6)::before { content: "补货 "; }
  .inv-plat-table td:nth-child(7)::before { content: "金额 "; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================== 账号体系 ===================== */
body.auth-locked .app { display: none; }
body.auth-locked #modal-root { display: none; }

.auth-root {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.auth-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 12% 8%, rgba(255, 90, 31, 0.20), transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(59, 130, 246, 0.18), transparent 55%),
    #0b0f16;
}
.auth-card {
  position: relative; width: min(400px, 100%);
  background: #fff; border-radius: 20px; padding: 30px 28px 24px;
  box-shadow: 0 30px 70px rgba(8, 12, 20, 0.45);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .brand-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff5a1f, #ff2d55); color: #fff; font-weight: 800; font-size: 19px;
}
.auth-brand .brand-text strong { display: block; font-size: 15px; color: var(--ink, #101828); }
.auth-brand .brand-text span { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3, #667085); }
.auth-card h2 { font-size: 21px; font-weight: 800; color: var(--ink, #101828); margin-bottom: 6px; }
.auth-sub { font-size: 12.5px; color: var(--ink-3, #667085); margin-bottom: 20px; line-height: 1.5; }
.auth-form .field { margin-bottom: 14px; }
.auth-error {
  background: var(--red-soft, #fef3f2); color: var(--red, #b42318);
  border: 1px solid #fecdca; border-radius: 9px;
  padding: 9px 12px; font-size: 12px; margin-bottom: 12px;
}
.auth-submit { height: 42px; font-size: 14px; }
.auth-demo { margin-top: 20px; border-top: 1px dashed var(--line, #eaecf0); padding-top: 16px; }
.auth-demo > span { font-size: 11.5px; color: var(--ink-3, #667085); display: block; margin-bottom: 9px; }
.auth-demo-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth-demo-item {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 8px;
  border: 1px solid var(--line, #eaecf0); border-radius: 10px; background: #fafbfc;
  cursor: pointer; text-align: left; transition: 0.15s;
}
.auth-demo-item:hover { border-color: #ffb79c; background: #fff7f3; }
.auth-demo-item b { font-size: 12px; color: var(--ink, #101828); }
.auth-demo-item span { font-size: 10px; color: var(--ink-3, #667085); font-variant-numeric: tabular-nums; }

/* 顶栏用户菜单 */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 5px; border: 1px solid var(--line, #eaecf0);
  border-radius: 999px; background: #fff; cursor: pointer; transition: 0.15s;
}
.user-chip:hover { border-color: #d0d5dd; background: #fcfcfd; }
.user-chip-main { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-chip-main b { font-size: 12.5px; color: var(--ink, #101828); }
.user-chip-main small { font-size: 10.5px; color: var(--ink-3, #667085); }
.user-caret { font-size: 10px; color: var(--ink-3, #667085); }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 232px;
  background: #fff; border: 1px solid var(--line, #eaecf0); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.16); padding: 8px; z-index: 60;
}
.user-pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line, #eaecf0); margin-bottom: 6px; }
.user-pop-head div { display: flex; flex-direction: column; line-height: 1.25; }
.user-pop-head b { font-size: 13px; color: var(--ink, #101828); }
.user-pop-head span { font-size: 11px; color: var(--ink-3, #667085); }
.user-pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 0; background: transparent; border-radius: 9px;
  font-size: 12.5px; color: var(--ink-2, #475467); cursor: pointer; text-align: left;
}
.user-pop-item svg { width: 15px; height: 15px; color: var(--ink-3, #667085); }
.user-pop-item:hover { background: #f4f6f8; }
.user-pop-item.danger { color: var(--red, #b42318); }
.user-pop-item.danger svg { color: var(--red, #b42318); }

/* 账号设置弹窗摘要 */
.acct-summary {
  display: flex; align-items: center; gap: 11px; padding: 12px;
  background: #f8fafc; border: 1px solid var(--line, #eaecf0); border-radius: 12px; margin-bottom: 16px;
}
.acct-summary div { display: flex; flex-direction: column; line-height: 1.3; }
.acct-summary b { font-size: 13.5px; color: var(--ink, #101828); }
.acct-summary span { font-size: 11.5px; color: var(--ink-3, #667085); }

/* 账号管理视图 */
.user-table .user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell-main { display: flex; flex-direction: column; line-height: 1.2; }
.user-cell-main b { font-size: 12.5px; color: var(--ink, #101828); }
.user-cell-main span { font-size: 11px; color: var(--ink-3, #667085); }
.self-tag { font-size: 9.5px; font-weight: 600; color: #cf3f0e; background: var(--brand-soft, #fff1ea); border-radius: 5px; padding: 1px 5px; margin-left: 4px; }
.user-tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 11.5px; color: var(--ink-3, #667085); line-height: 1.6; }
.user-tip svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.user-table td.actions .btn + .btn { margin-left: 6px; }

@media (max-width: 760px) {
  .auth-root { padding: 16px; align-items: flex-start; padding-top: 7vh; }
  .auth-card { padding: 24px 20px 20px; border-radius: 16px; }
  .auth-demo-list { grid-template-columns: 1fr; }
  .user-chip-main { display: none; }
  .user-caret { display: none; }
  .user-pop { width: 220px; }
  .user-table td.actions .btn { padding: 6px 8px; }

  /* 账号表转卡片 */
  .user-table-wrap { border: 0; box-shadow: none; background: transparent; overflow: visible; }
  .user-table thead { display: none; }
  .user-table, .user-table tbody { display: block; width: 100%; }
  .user-table tr {
    display: block; border: 1px solid var(--line, #eaecf0); border-radius: 12px;
    background: #fff; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  }
  .user-table td {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; border: 0; padding: 5px 0;
  }
  .user-table td::before { font-size: 11px; color: var(--ink-3, #667085); }
  .user-table td:nth-child(1) { padding-top: 0; }
  .user-table td:nth-child(1)::before { content: ""; }
  .user-table td:nth-child(2)::before { content: "角色"; }
  .user-table td:nth-child(3)::before { content: "状态"; }
  .user-table td:nth-child(4)::before { content: "最近登录"; }
  .user-table td.actions {
    justify-content: flex-start; gap: 8px; margin-top: 8px; padding-top: 10px;
    border-top: 1px dashed var(--line, #eaecf0); text-align: left;
  }
  .user-table td.actions::before { content: ""; }
}
