/* ============================================================
   AI 选品池 · 浅色极简商务
   Design tokens
   ============================================================ */
:root {
  --bg: #f4f7fd;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --sidebar-deep: #f8faff;
  --input-bg: #f8faff;

  --border: #e7edf8;
  --border-strong: #dbe4f5;

  --text: #344762;
  --heading: #16233d;
  --muted: #8493ab;
  --muted-2: #a3b0c6;

  --primary: #4564f8;
  --primary-hover: #3550e0;
  --primary-soft: #ebf0ff;
  --primary-line: #d0ddff;
  --blue: #496dff;
  --price: #466bfc;
  --price-soft: #edf2ff;

  --green: #16a87e;
  --green-text: #149468;
  --green-soft: #eaf9f3;
  --red: #e44f64;
  --red-soft: #fff0f2;
  --yellow: #a1741c;
  --yellow-soft: #fdf5e5;
  --blue-soft: #edf2ff;
  --success: #16a87e;
  --danger: #e44f64;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 2px 6px rgba(28, 59, 103, 0.035), 0 10px 28px rgba(38, 78, 165, 0.06);
  --shadow-hover: 0 10px 25px rgba(38, 78, 165, 0.11);
  --shadow-lg: 0 18px 44px rgba(28, 59, 103, 0.12);
  --ring: 0 0 0 3px rgba(69, 100, 248, 0.13);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--heading); letter-spacing: -0.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

/* 选中文字：浅蓝底 + 深蓝字 */
::selection { background: #dbe4ff; color: #1b34a8; }
::-moz-selection { background: #dbe4ff; color: #1b34a8; }

/* 细微滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d8dce4; border: 3px solid transparent; background-clip: content-box; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #c3c9d4; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   布局
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.channel-bar {
  width: 248px;
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.channel-bar-header {
  height: 72px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(140deg, #519aff, #3b5df7);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 7px 19px rgba(77, 113, 255, 0.2);
  transform: rotate(-7deg);
}
.brand-mark svg { transform: rotate(7deg); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text b { font-size: 17.5px; font-weight: 800; color: var(--heading); letter-spacing: -0.02em; }
.brand-text small { font-size: 9.5px; letter-spacing: 0.2em; color: var(--muted-2); font-weight: 700; margin-top: 3px; }

.channel-scroll { flex: 1; overflow-y: auto; padding: 16px 12px 10px; }

.channel-group { padding: 0 0 4px; }
.group-title {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8fa0ba;
  font-weight: 750;
  padding: 0 10px;
  margin: 18px 0 8px;
}
.channel-group:first-child .group-title { margin-top: 0; }

.nav-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin: 2px 0;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: #71839f;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  position: relative;
  transition: 0.16s;
}
.nav-channel .nav-ico { width: 17px; height: 17px; flex: none; color: #98a8c2; display: grid; place-items: center; transition: color 0.16s; }
.nav-channel .nav-ico svg { width: 17px; height: 17px; }
.nav-channel:hover { background: #f3f6ff; color: var(--blue); }
.nav-channel:hover .nav-ico { color: var(--blue); }
.nav-channel.active {
  background: var(--primary-soft);
  color: #4267f7;
  font-weight: 750;
}
.nav-channel.active .nav-ico { color: #4267f7; }
.nav-channel.active::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #5f8bff, #4564f8);
}
.nav-pill {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 可折叠市场父菜单 */
.nav-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 2px 0;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: #71839f;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: 0.16s;
}
.nav-parent:hover { background: #f3f6ff; color: var(--blue); }
.nav-parent .twist {
  width: 14px;
  font-size: 11px;
  line-height: 1;
  flex: none;
  color: var(--muted-2);
  display: inline-block;
  transition: transform 0.14s;
}
.nav-children { padding: 0; }
.nav-child { margin-left: 14px; padding-left: 16px; font-size: 12.5px; height: 32px; }
.nav-child::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 1px;
  background: var(--border-strong);
}

/* 类目树 */
.tree { list-style: none; margin: 2px 0 4px; padding: 0; }
.tree-li { list-style: none; }
.tree-row { display: flex; align-items: center; gap: 5px; padding: 1px 8px 1px 24px; border-radius: 6px; }
.tree-row:hover { background: #f5f6f8; }
.tree-toggle { width: 12px; display: inline-block; cursor: pointer; color: var(--muted-2); font-size: 9px; flex: none; text-align: center; }
.tree-toggle.tree-leaf { visibility: hidden; }
.tree-node { color: #6c7480; font-size: 12.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node:hover { color: var(--heading); }
.tree-cn { color: var(--muted-2); font-size: 11px; font-weight: 400; margin-left: 4px; }
.tree-node.active { color: var(--primary); font-weight: 600; }
.tree-children { list-style: none; margin: 0; padding-left: 12px; }
.tree-empty { color: var(--muted); font-size: 12px; padding: 6px 10px 6px 24px; }

.channel-bar-footer {
  flex: none;
  border-top: 1px solid var(--border);
  padding: 11px 12px;
  min-height: 62px;
  display: flex;
  align-items: center;
  margin-top: auto;
}

/* 顶栏 */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.content-header {
  height: 62px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-root { font-size: 13px; color: var(--muted); }
.crumb-sep { color: var(--muted-2); font-size: 12px; }
.crumb h1 {
  font-size: 14px;
  font-weight: 650;
  color: var(--heading);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-actions { display: flex; align-items: center; gap: 10px; }

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 296px;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.top-search:hover { border-color: #cfdcf8; }
.top-search:focus-within { background: #fff; border-color: var(--primary); box-shadow: var(--ring); }
.top-search svg { color: var(--muted-2); flex: none; }
.top-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12.5px;
}
.top-search input:focus { box-shadow: none; border: none; }
.top-search kbd {
  flex: none;
  font-family: inherit;
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  background: #fff;
}

.app-main { flex: 1; overflow-y: auto; padding: 26px 32px 72px; }

/* ============================================================
   通用排版 / 页头
   ============================================================ */
.loading { color: var(--muted); padding: 48px; text-align: center; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; font-size: 13px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--heading); margin: 0 0 16px; }
.back-link { color: var(--muted); font-size: 13px; transition: color 0.14s; }
.back-link:hover { color: var(--heading); }

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-head p { margin: 7px 0 0; font-size: 13px; color: var(--muted); max-width: 640px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 区块标题（看板内的分类聚合预览等） */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 36px 0 16px;
}
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.section-head h2 small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.section-head .eyebrow { margin-bottom: 6px; }

/* 分隔面板 */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #5e708f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.15s;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover {
  background: #f7f9ff;
  border-color: #cfdcf8;
  color: var(--blue);
  filter: brightness(0.99);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); background: #eff3ff; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary {
  background: linear-gradient(110deg, #5180ff, #4564f8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 7px 17px rgba(73, 111, 255, 0.13);
}
.btn-primary:hover {
  background: linear-gradient(110deg, #5a88ff, #4a6bfb);
  border-color: transparent;
  color: #fff;
  filter: brightness(1.02);
  box-shadow: 0 9px 22px rgba(73, 111, 255, 0.24);
}
.btn-primary:active { background: linear-gradient(110deg, #4564f8, #3a57e0); }

.btn-danger { background: var(--red-soft); border-color: transparent; color: #e44f64; }
.btn-danger:hover { background: #ffe4e8; border-color: transparent; color: #d43c52; filter: none; }

.btn-fav { background: #fff; border-color: var(--border); color: #7386a6; }
.btn-fav:hover { background: var(--price-soft); border-color: var(--primary-line); color: var(--primary); }

.btn-sm { min-height: 31px; padding: 0 11px; font-size: 11px; border-radius: 7px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: #fff; border-color: var(--border); color: #5e708f; transform: none; }
.btn-primary:disabled { background: #e9ecf6; border-color: transparent; color: #9aa8c0; opacity: 1; box-shadow: none; }
.btn-primary:disabled:hover { background: #e9ecf6; border-color: transparent; color: #9aa8c0; }

.linkbtn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.linkbtn:hover { text-decoration: underline; }

/* ============================================================
   输入 / 选择
   ============================================================ */
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
select, textarea {
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  font-size: 12.5px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #cfdcf8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23878f9b' stroke-width='2.2' 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 10px center;
  cursor: pointer;
}

/* ============================================================
   工具栏
   ============================================================ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar input[type="text"] { min-width: 230px; }
.toolbar .spacer { flex: 1; }

/* 类目树下拉 */
.cat-tree-wrap { position: relative; }
.cat-tree-btn {
  height: 37px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: 0.15s;
}
.cat-tree-btn:hover { background: #fff; border-color: #cfdcf8; color: var(--blue); }
.cat-tree-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 330px;
  max-height: 430px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
}
.cat-tree-pop.open { display: block; }
.cat-clear {
  display: block;
  padding: 7px 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.cat-clear:hover { color: var(--heading); }
.cat-tree-pop .tree { margin: 0; }
.cat-tree-pop .tree-row { padding: 3px 6px 3px 4px; }
.cat-tree-pop .tree-node { font-size: 12.5px; }
.cat-tree-pop .tree-cn { font-size: 11px; }

/* ============================================================
   商品卡片
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 18px;
}
.pcard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.pcard:hover {
  border-color: #c2d2ff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.pcard img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  background: #f2f4f7;
  display: block;
}
.pcard .ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f4f7;
  color: var(--muted-2);
  font-size: 12px;
}
.pcard .body { padding: 13px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.pcard .name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 6px;
  color: var(--heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.pcard .name a:hover { color: var(--primary); }
.pcard .meta { color: var(--muted); font-size: 11.5px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .meta.price {
  color: var(--price);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 2px;
}
.pcard .price-note {
  color: var(--green);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}
.pcard .meta-market {
  color: var(--muted-2);
  font-size: 11px;
  margin-left: 7px;
}
.pcard .sel {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 6px;
  padding: 3px;
  line-height: 0;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12);
}
.pcard input[type="checkbox"], table.grid input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0;
}
.pcard .market-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 24, 39, 0.06);
  color: #5b6470;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
}
.pcard .card-actions {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}
.pcard .card-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 29px;
  padding: 0 6px;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 7px;
}
.pcard .card-actions .btn svg { width: 12px; height: 12px; }

/* ============================================================
   词根 / 分类聚合卡片
   ============================================================ */
.roots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.root-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: block;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.root-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 22px rgba(17, 24, 39, 0.07);
  transform: translateY(-2px);
}
.root-card .rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.root-card .rc-head-text { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.root-card .rc-name { display: flex; flex-direction: column; min-width: 0; }
.root-card .rc-name .rc-en {
  font-size: 14px; font-weight: 650; color: var(--heading);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.root-card .rc-name .rc-cn { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.root-card .rc-count { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.root-card .rc-thumb {
  position: relative;
  width: 68px; height: 68px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.root-card .rc-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.root-card .rc-thumb-ph { font-size: 20px; font-weight: 700; color: var(--muted-2); }
.root-card .rc-thumb-empty { background: #f7f8fa; }
.root-card .rc-metrics { display: flex; gap: 22px; margin: 0 0 12px; }
.root-card .rc-metrics .m .v { font-size: 16px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.root-card .rc-metrics .m .k { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.rc-bar { height: 5px; border-radius: 3px; overflow: hidden; display: flex; background: #eef0f4; gap: 1px; }
.rc-bar .seg-can { background: #c3c9d4; }
.rc-bar .seg-ava { background: var(--green); }
.rc-bar .seg-eli { background: #d9a3a3; }
.rc-legend { display: flex; gap: 14px; margin-top: 9px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ============================================================
   表格视图
   ============================================================ */
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.grid th, table.grid td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table.grid th {
  background: var(--sidebar-deep);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover td { background: #f7f9ff; }
table.grid td { font-variant-numeric: tabular-nums; }
table.grid img.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
/* 表格里的「类目树」列（一级 / 二级） */
table.grid td.tv-cat { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
table.grid td.tv-cat .tv-sep { color: var(--border-strong); margin: 0 4px; }

/* ============================================================
   状态徽标 / 标签
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-candidate { background: #f1f3f6; color: #6b7280; }
.badge-available { background: var(--green-soft); color: var(--green); }
.badge-eliminated { background: var(--red-soft); color: var(--red); }
.badge-onsale { background: var(--blue-soft); color: var(--blue); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  margin: 2px 4px 2px 0;
  background: #f4f5f8;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10.5px;
  color: #6b7280;
}

/* ============================================================
   分页
   ============================================================ */
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   表单 / 编辑页
   ============================================================ */
.form-wrap {
  max-width: 780px;
  background: var(--panel);
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; }
.form-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 18px;
}
.form-section-title::before {
  content: "";
  width: 3px; height: 10px;
  border-radius: 2px;
  background: var(--primary);
  opacity: 0.75;
}
.form-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-footer .spacer { flex: 1; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 7px;
  color: var(--heading);
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea { width: 100%; }
.form-row textarea { min-height: 76px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.attr-row { display: flex; gap: 8px; margin-bottom: 8px; }
.attr-row input { flex: 1; min-width: 0; }
.attr-row .btn { flex: none; }

.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; max-width: 1100px; }
.detail-layout > .form-wrap { max-width: none; }
.detail-side { position: sticky; top: 0; }
.img-preview {
  background: var(--panel);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.img-preview-title {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.img-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.img-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-preview-empty { color: var(--muted-2); font-size: 12px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .btn { flex: none; }
.form-row:empty { margin-bottom: 0; }

/* 只读自动计算字段 */
.field-readonly {
  background: #edf3fe !important;
  border-color: var(--primary-line) !important;
  color: var(--heading) !important;
  font-weight: 750 !important;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.field-readonly:hover { border-color: var(--primary-line) !important; }
.field-readonly:focus { background: #edf3fe !important; border-color: var(--primary-line) !important; box-shadow: none !important; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ============================================================
   看板
   ============================================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 17px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.metric .k {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  order: -1;
  margin: 0 0 8px;
}
.metric .v {
  font-size: 28px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
}
.chart-card > h3 {
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--heading);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card > h3::before {
  content: "";
  width: 3px; height: 11px;
  border-radius: 2px;
  background: var(--primary);
  opacity: 0.75;
}
.chart-box { position: relative; height: 248px; }

/* ============================================================
   导入
   ============================================================ */
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.import-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.import-box {
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.import-box.drag { border-color: var(--primary); background: #f7f9ff; }
.import-box p { margin: 8px 0; font-size: 13px; color: var(--text); }
.import-market { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.import-mode { margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 16px 12px;
  text-align: center;
  color: var(--muted);
}
.dropzone-prompt svg { color: #c6cedd; margin-bottom: 6px; }
.dropzone-prompt b { font-size: 13px; font-weight: 600; color: var(--text); }
.dropzone-prompt small { font-size: 11.5px; color: var(--muted); }

table.preview {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.preview th, table.preview td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.preview th {
  background: var(--sidebar-deep);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
table.preview tbody tr:last-child td { border-bottom: none; }
table.preview td.pv-ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.preview td.pv-narrow { max-width: 170px; }
table.preview tr.err td { background: var(--red-soft); }

/* ============================================================
   对比
   ============================================================ */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 11px 14px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: none; }
.compare-table th:last-child, .compare-table td:last-child { border-right: none; }
.compare-table thead th { background: var(--sidebar-deep); font-weight: 650; color: var(--heading); vertical-align: top; }
.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
  background: var(--sidebar-deep);
  font-weight: 600;
  color: var(--muted);
  width: 150px;
  white-space: nowrap;
  position: sticky;
  left: 0;
}
.compare-table tbody tr:hover td { background: #f7f9ff; }

/* ============================================================
   侧栏用户区
   ============================================================ */
.user-area { display: flex; align-items: center; gap: 8px; width: 100%; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #4a73ff, #8fa3ff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex: none;
  box-shadow: 0 4px 12px rgba(74, 115, 255, 0.22);
}
.user-meta { flex: 1; min-width: 0; line-height: 1.35; }
.user-meta .u-name {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
}
.user-meta .u-email { font-size: 12.5px; color: var(--heading); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .u-sub { font-size: 10.5px; color: var(--muted); }
.user-logout {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: #8b9bb4;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.15s;
}
.user-logout:hover { color: var(--red); background: var(--red-soft); border-color: #ffd9df; }
.admin-tag { color: var(--yellow); font-weight: 700; }

/* ============================================================
   登录 / 注册
   ============================================================ */
.auth-shell {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.09);
  overflow: hidden;
}
.auth-aside {
  background: linear-gradient(160deg, #151a24 0%, #1e2634 55%, #232d3f 100%);
  color: #fff;
  padding: 42px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -90px; bottom: -110px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(84, 116, 255, 0.34), transparent 65%);
}
.auth-aside .brand-mark { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); }
.auth-aside-brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-aside-brand b { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.auth-aside-mid { position: relative; z-index: 1; margin: 34px 0; }
.auth-aside-mid .eyebrow { color: rgba(255, 255, 255, 0.45); }
.auth-aside-mid h2 {
  color: #fff;
  font-size: 27px;
  line-height: 1.32;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.auth-aside-mid p { color: rgba(255, 255, 255, 0.6); font-size: 13px; margin: 0; line-height: 1.7; }
.auth-points { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255, 255, 255, 0.72); }
.auth-points svg { color: #7d95ff; flex: none; }
.auth-aside-foot { position: relative; z-index: 1; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.32); }

.auth-card { padding: 44px 42px; display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { margin: 0 0 6px; color: var(--heading); font-size: 23px; font-weight: 700; letter-spacing: -0.03em; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; padding: 3px; background: #f3f4f7; border-radius: 8px; }
.auth-tabs button {
  flex: 1; height: 32px; border: none; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-weight: 600; font-size: 12.5px; transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}
.auth-tabs button.active { background: #fff; color: var(--heading); box-shadow: 0 1px 3px rgba(17, 24, 39, 0.09); }
.auth-error { color: var(--red); font-size: 12px; margin: 2px 0 10px; min-height: 17px; }
.auth-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
  cursor: pointer;
  user-select: none;
}
.auth-remember input { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  width: 100%; height: 40px; margin-bottom: 12px;
}
.auth-card .btn { width: 100%; height: 40px; justify-content: center; margin-top: 4px; }
.auth-hint { color: var(--muted); font-size: 11.5px; margin-top: 14px; line-height: 1.6; }

/* 登录模式：隐藏侧栏与顶栏 */
body.auth-mode .channel-bar { display: none; }
body.auth-mode .content-header { display: none; }
body.auth-mode .content { background: var(--bg); }
body.auth-mode .app-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    radial-gradient(circle at 15% 10%, #ffffff 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, #eef1fb 0%, transparent 45%),
    var(--bg);
}
body.auth-mode .auth-shell { width: min(940px, 100%); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 8px);
  background: #1b2028;
  color: #fff;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 1200;
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.24);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }
.toast.success { background: #14603c; }

/* ============================================================
   悬浮 AI 助手
   ============================================================ */
.ai-cursor { color: var(--primary); animation: aiBlink 1s steps(1) infinite; }
@keyframes aiBlink { 50% { opacity: 0; } }
.ai-error { color: var(--red); }

.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(140deg, #519aff, #3b5df7);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(73, 111, 255, 0.32);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ai-fab.visible { display: flex; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(73, 111, 255, 0.4); }
.ai-fab.active { background: linear-gradient(140deg, #3b5df7, #2f49cc); }

.ai-chat {
  position: fixed;
  right: 24px;
  bottom: 88px;
  width: min(380px, calc(100vw - 32px));
  height: min(556px, calc(100vh - 120px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}
.ai-chat.open { display: flex; }
.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.ai-chat-title { font-weight: 650; color: var(--heading); font-size: 13px; letter-spacing: -0.01em; }
.ai-chat-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.ai-chat-close:hover { color: var(--heading); }
.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfbfc;
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }
.ai-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg-user .ai-bubble { background: linear-gradient(110deg, #5180ff, #4564f8); color: #fff; border-bottom-right-radius: 3px; }
.ai-msg-assistant .ai-bubble { background: #fff; color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.ai-msg-assistant .ai-bubble strong { color: var(--heading); }
.ai-chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.ai-chat-input textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--input-bg);
  font-size: 12.5px;
  line-height: 1.5;
}
.ai-chat-input textarea:focus { background: #fff; }
.ai-chat-send, .ai-chat-stop {
  border: none;
  border-radius: 8px;
  height: 38px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.ai-chat-send { background: linear-gradient(110deg, #5180ff, #4564f8); color: #fff; }
.ai-chat-send:hover { filter: brightness(1.04); }
.ai-chat-stop { background: var(--red-soft); color: var(--red); }

/* ============================================================
   工具栏（面板式：标题行 + 筛选行）
   ============================================================ */
.toolbar-card {
  display: block;
  padding: 0;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar-title strong { font-size: 13px; font-weight: 650; color: var(--heading); }
.toolbar-title small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }

.segmented { display: flex; gap: 2px; padding: 3px; background: #eef2fb; border-radius: 8px; }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 750;
  color: #8492a8;
  cursor: pointer;
  transition: 0.15s;
}
.segmented button:hover { color: var(--blue); }
.segmented button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(42, 84, 175, 0.09);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.filter-row .spacer { flex: 1; }
.field-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 37px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  flex: 1 1 210px;
  min-width: 170px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field-with-icon:hover { border-color: #cfdcf8; }
.field-with-icon:focus-within { background: #fff; border-color: var(--primary); box-shadow: var(--ring); }
.field-with-icon svg { color: var(--muted-2); flex: none; }
.field-with-icon input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12.5px;
}
.field-with-icon input:focus { box-shadow: none; border: none; }

/* 列表标题行：数量 + 全选 + 批量动作 */
.products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 14px;
}
.products-heading .ph-left { display: flex; align-items: baseline; gap: 8px; }
.products-heading b { font-size: 13px; font-weight: 650; color: var(--heading); }
.products-heading small { color: var(--muted); font-size: 11.5px; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.heading-actions .chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.heading-actions .chk input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.sel-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 看板：站点切换条 */
.mkt-panel { padding: 15px 18px 16px; margin-bottom: 18px; }

/* 分类聚合：一级类目树筛选 */
.l1-panel { padding: 15px 18px 16px; margin-bottom: 14px; }
.l1-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.l1-head b { display: block; font-size: 13.5px; font-weight: 650; color: var(--heading); letter-spacing: -0.01em; }
.l1-head small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.l1-assoc {
  flex: none;
  font-size: 11px;
  color: var(--blue);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.l1-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.l1-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}
.l1-chip i {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--input-bg);
  border-radius: 999px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.l1-chip:hover { border-color: var(--primary-line); color: var(--primary); }
.l1-chip:hover i { background: var(--primary-soft); color: var(--primary); }
.l1-chip.active {
  background: linear-gradient(110deg, #5180ff, #4564f8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(69, 100, 248, 0.24);
}
.l1-chip.active i { background: rgba(255, 255, 255, 0.22); color: #fff; }

.cat-controls-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cat-controls select {
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.cat-controls select:hover { border-color: var(--primary-line); }

/* 卡片内的类目路径（一级 / 二级） */
.cat-path {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cat-path .cp-l1 { color: var(--primary); font-weight: 600; }
.cat-path .cp-sep { color: var(--border-strong); }
.cat-path .cp-none { color: var(--muted-2); font-style: normal; }

/* 分类聚合：概览条 / 控件 / 编号卡片 */
.cat-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-wide { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; }
.stat-wide span { font-size: 12px; color: var(--muted); }
.stat-wide b { font-size: 20px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 14px;
  font-size: 12px;
  color: var(--muted);
}
.cat-controls label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 16px; }
.cat-tile {
  display: block;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  box-shadow: var(--shadow);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.cat-tile:hover {
  border-color: #c2d2ff;
  box-shadow: 0 8px 24px rgba(66, 112, 204, 0.08);
  transform: translateY(-2px);
}
.cat-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cat-num { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted-2); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.cat-ico { color: #c6cedd; flex: none; }
/* 右上角：该分类首个商品主图（方图） */
.cat-main { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-thumb {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f2f5fb;
  display: grid;
  place-items: center;
  color: #c3cfe4;
}
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-thumb-empty { background: #f5f8fe; }
.cat-en {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--heading);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-cn { font-size: 11.5px; color: var(--muted); margin-top: 3px; min-height: 17px; }
.cat-cn .cat-cn-todo { color: var(--muted-2); }
.cat-lower { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 13px; }
.cat-count { font-size: 17px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cat-count small { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.cat-price { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-meter {
  height: 6px;
  border-radius: 3px;
  background: #eef2fb;
  margin-top: 10px;
  overflow: hidden;
  display: flex;
  gap: 2px;
}
.cat-meter i { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width 0.3s; }
.cat-meter .m-ava { background: linear-gradient(90deg, #22c295, #16a87e); }
.cat-meter .m-can { background: #c9d8f6; }
.cat-meter .m-eli { background: #f3bcc6; }
.cat-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 导入：步骤条 / 提示 */
.wizard { padding: 18px 20px; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfbfc;
  transition: border-color 0.16s, background 0.16s;
}
.step.current { border-color: var(--primary-line); background: var(--primary-soft); }
.step.done { border-color: #d3e7db; background: var(--green-soft); }
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  flex: none;
}
.step.current .step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step b { display: block; font-size: 12.5px; font-weight: 600; color: var(--heading); }
.step small { font-size: 10.5px; color: var(--muted); }

.import-tips {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fbfbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.import-tips b { color: var(--text); font-weight: 600; }

/* 对比：表头商品卡 */
.comp-product { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.comp-product img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #f2f4f7;
}
.comp-product .cp-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 64px 24px;
  text-align: center;
}
.empty-state .es-ico { color: #cfd6e2; margin-bottom: 6px; }
.empty-state h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--heading); }
.empty-state p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 420px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1220px) {
  .app-main { padding: 22px 24px 64px; }
  .charts { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 900px) {
  .channel-bar { width: 66px; }
  .channel-bar-header { padding: 0; justify-content: center; }
  .brand-text { display: none; }
  .channel-scroll { padding: 12px 8px; }
  .group-title { display: none; }
  .nav-channel { justify-content: center; padding: 0; }
  .nav-channel .label { display: none; }
  .nav-channel .nav-pill { position: absolute; top: 3px; right: 4px; margin: 0; }
  .nav-parent { justify-content: center; padding: 0; }
  .nav-parent .label { display: none; }
  .nav-children { display: none !important; }
  .channel-bar-footer { padding: 10px 6px; justify-content: center; }
  .user-meta, .user-logout { display: none; }
  .user-area { width: auto; }
  .content-header { padding: 0 16px; }
  .top-search { display: none; }
  .app-main { padding: 18px 16px 60px; }
  .page-head h2 { font-size: 21px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .roots-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form-2col { grid-template-columns: 1fr; }
  .form-3col { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 14px 15px; }
  .metric .v { font-size: 23px; }
  .toolbar { padding: 10px; }
  .toolbar input[type="text"] { min-width: 0; flex: 1 1 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .compare-table th:first-child, .compare-table td:first-child { width: 100px; }
  .auth-card { padding: 30px 22px; }
  .ai-chat { right: 10px; left: 10px; width: auto; bottom: 78px; }
  .ai-fab { right: 14px; bottom: 14px; }
}
