/* =========================================================
   识图 · 以图搜商品 · 组合报价
   仪表盘布局：左侧图标栏 + 顶部搜索栏 + 主区卡片 + 右侧报价栏。
   浅灰底、白色圆角卡片、少量柔和色块、黑色胶囊按钮。纯 CSS，无构建步骤。
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #f0f0f3;
  --card: #ffffff;
  --tile: #f4f4f6;
  --tile-2: #ececf0;
  --line: rgba(24, 24, 27, .07);
  --line-2: rgba(24, 24, 27, .12);
  --line-3: rgba(24, 24, 27, .2);

  --ink: #17171a;
  --ink-2: #4f4f57;
  --ink-3: #8b8b94;
  --ink-4: #b9b9c0;

  /* 柔和色块：只用在 hero、概览卡和小标签上 */
  --lav: #d5d0fa;
  --lav-2: #ecebfd;
  --lav-ink: #5143c4;
  --peach: #ffdcc2;
  --peach-2: #fdeee2;
  --peach-ink: #b1561a;
  --pink: #f8d3ec;
  --pink-2: #fbeaf5;
  --pink-ink: #ad3a80;
  --mint: #cfeedd;
  --mint-2: #e6f5ed;
  --mint-ink: #1f7a4c;

  --same: #22a05d;
  --similar: #e38b1f;
  --danger: #c4321f;

  --r-xs: 10px;
  --r-sm: 14px;
  --r: 20px;
  --r-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04);
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 12px 32px -16px rgba(24, 24, 27, .16);
  --shadow-lg: 0 2px 6px rgba(24, 24, 27, .05), 0 30px 70px -24px rgba(24, 24, 27, .28);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --gap: 16px;
  --side-w: 348px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(81, 67, 196, .18); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.i { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-3);
}

/* ---------- 通用：卡片 / 按钮 / 小标签 ---------- */
.card { background: var(--card); border-radius: var(--r); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s, opacity .2s, box-shadow .2s;
}
.btn:hover { background: var(--tile); border-color: var(--line-3); }
.btn:active { transform: scale(.97); }
.btn .i { width: 16px; height: 16px; }
.btn.dark { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2c2c31; border-color: #2c2c31; box-shadow: 0 8px 20px -10px rgba(24, 24, 27, .6); }
.btn.dark:disabled { background: #d6d6db; border-color: #d6d6db; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.light { border-color: transparent; background: rgba(255, 255, 255, .72); }
.btn.light:hover { background: #fff; }
.btn.soft { border-color: transparent; background: var(--tile); }
.btn.soft:hover { background: var(--tile-2); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.added { background: var(--same); border-color: var(--same); color: #fff; }
.btn.loading { pointer-events: none; opacity: .6; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:hover { color: var(--ink); background: var(--tile); }
.icon-btn .i { width: 17px; height: 17px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--tile);
}
.pill.lav { color: var(--lav-ink); background: var(--lav-2); }
.pill.peach { color: var(--peach-ink); background: var(--peach-2); }
.pill.pink { color: var(--pink-ink); background: var(--pink-2); }
.pill.mint { color: var(--mint-ink); background: var(--mint-2); }
.pill.white { color: var(--ink); background: rgba(255, 255, 255, .92); }
.pill.dark { color: #fff; background: var(--ink); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.link-btn:hover { color: var(--ink); background: var(--tile); }
.link-btn .i { width: 14px; height: 14px; }
.link-btn:disabled { opacity: .4; cursor: default; background: none; }

/* ---------- 外框：左侧图标栏 + 工作区 ---------- */
.shell { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  margin: 14px 0 14px 14px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--r);
  background: var(--card);
}
.rail-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
}
.rail-logo svg { width: 21px; height: 21px; }
.rail-nav { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.rail-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.rail-btn:hover { color: var(--ink); background: var(--tile); }
.rail-btn.active { color: #fff; background: var(--ink); }
.rail-btn .i { width: 19px; height: 19px; }
/* 悬停提示 */
.rail-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  color: #fff;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity .2s, transform .2s var(--ease);
  z-index: 50;
}
.rail-btn:hover::after { opacity: 1; transform: translate(0, -50%); }

.workspace { min-width: 0; padding: 14px 14px 32px 16px; }

/* ---------- 顶栏 ---------- */
.topbar { position: relative; z-index: 30; display: flex; align-items: center; gap: 10px; margin-bottom: var(--gap); }
.searchbar {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 20px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.searchbar:focus-within { border-color: var(--line-3); box-shadow: 0 0 0 4px rgba(24, 24, 27, .04); }
.searchbar > .i { width: 18px; height: 18px; color: var(--ink-3); }
.searchbar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar .btn { height: 38px; }
.searchbar.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

/* 搜索联想面板：聚焦时出现 */
.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 16px 18px 14px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .2s, transform .25s var(--ease);
}
.searchbar:focus-within .suggest { opacity: 1; pointer-events: auto; transform: none; }
.suggest-title { margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--tile);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.chip:hover { color: var(--ink); background: var(--lav-2); }
.chip.en { font-family: var(--font-num); }
.suggest-hint { margin-top: 12px; font-size: 12px; color: var(--ink-3); }

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.status b { color: var(--ink); font-weight: 600; }
.status .sep { width: 1px; height: 14px; background: var(--line-2); }
.st-meta { color: var(--ink-3); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #d9a441; animation: breathe 1.4s ease-in-out infinite; }
.status.ready .pulse { background: var(--same); animation: none; box-shadow: 0 0 0 3px var(--mint-2); }
.status.error .pulse { background: var(--danger); animation: none; }
@keyframes breathe { 50% { opacity: .3; } }

.user { position: relative; }
.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--lav);
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  color: var(--lav-ink);
  cursor: pointer;
}
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 8px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .2s, transform .25s var(--ease);
}
.user.open .user-menu { opacity: 1; pointer-events: auto; transform: none; }
.user-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu .who b { display: block; font-size: 14px; }
.user-menu .who small { font-size: 12px; color: var(--ink-3); }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 13px;
  text-align: left;
  color: var(--ink-2);
  cursor: pointer;
}
.menu-item:hover { color: var(--ink); background: var(--tile); }
.menu-item .i { width: 16px; height: 16px; }

/* ---------- 内容区：主列 + 右侧报价栏 ---------- */
.content { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--gap); align-items: start; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 26px; }

.block-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.block-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.block-head .sub { margin-left: 10px; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }

/* ---------- 演示四步 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--gap); }
.step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: background .25s, color .25s, transform .2s;
}
.step:hover { transform: translateY(-1px); }
.step-no {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--tile);
  transition: background .25s, color .25s;
}
.step-no .i { width: 15px; height: 15px; stroke-width: 2.6; }
.step-text { min-width: 0; }
.step-text b { display: block; font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-text small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done .step-no { color: var(--mint-ink); background: var(--mint-2); }
.step.active { color: #fff; background: var(--ink); }
.step.active .step-no { color: var(--ink); background: #fff; }
.step.active small { color: rgba(255, 255, 255, .6); }
/* 当前这一步轻轻呼吸，提示"下一步点这里" */
.step.active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 21px;
  border: 2px solid var(--lav);
  animation: ring 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ring { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

.step-tag {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  vertical-align: 2px;
}
.step-tag.inv { margin-right: 2px; color: var(--ink); background: #fff; vertical-align: 0; }

/* ---------- 第 1 步：客户照片 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 40%);
  grid-template-areas: "copy chat" "cases cases" "extra extra";
  gap: 20px 24px;
  padding: 28px;
  /* clip 而不是 hidden：hidden 会变成可滚动容器，装饰圆超出的部分会被 scrollIntoView 滚出来 */
  overflow: hidden;
  overflow: clip;
  border-radius: var(--r-lg);
  background: var(--lav);
  isolation: isolate;
  scroll-margin-top: 14px;
  transition: box-shadow .3s;
}
/* 两个装饰圆，给色块一点层次 */
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
}
.hero::before { width: 360px; height: 360px; right: -60px; top: -150px; }
.hero::after { width: 220px; height: 220px; right: 210px; bottom: -150px; background: rgba(255, 255, 255, .18); }
body.dragging .hero { box-shadow: 0 0 0 3px var(--ink); }

.hero-copy { grid-area: copy; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hero h1 { font-size: clamp(22px, 2.1vw, 29px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.hero p { max-width: 470px; font-size: 14px; line-height: 1.65; color: #3d3866; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-facts .pill { height: 26px; padding: 0 11px; font-size: 12px; color: #3d3866; background: rgba(255, 255, 255, .55); }
.hero-facts .pill b { font-family: var(--font-num); color: var(--ink); }
.hero-extra { grid-area: extra; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: -6px; }
.hero-extra .link-btn { color: #3d3866; }
.hero-extra .link-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.hero-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #4d477a; }
.hero-hint kbd { background: rgba(255, 255, 255, .6); border-color: transparent; color: #4d477a; }
body.static .live-only { display: none !important; }

/* 客户照片：6 张一排 */
.cases { grid-area: cases; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.case {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 7px 7px 10px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  text-align: left;
  cursor: pointer;
  transition: background .2s, box-shadow .25s, transform .3s var(--ease);
  animation: rise .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.case:hover { background: #fff; transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(39, 30, 110, .6); }
.case.active { background: #fff; box-shadow: 0 0 0 2px var(--ink), 0 16px 30px -18px rgba(39, 30, 110, .6); }
.case-img { height: 104px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 13px; background: #fff; }
.case-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.case-no {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
}
.case .pill { align-self: flex-start; height: 20px; padding: 0 7px; font-size: 10.5px; margin: 0 3px; }
.case-title { padding: 0 4px; font-size: 13px; font-weight: 650; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case.sk { height: 168px; cursor: default; animation: shimmer 1.4s linear infinite; background: linear-gradient(90deg, rgba(255,255,255,.45), rgba(255,255,255,.8), rgba(255,255,255,.45)); background-size: 200% 100%; }

/* 右侧"聊天框"：客户问、系统答 */
.chat {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  /* 和有内容时一样高：点照片后聊天框不变高，下面的照片不会跟着往下跳 */
  min-height: 316px;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px -26px rgba(39, 30, 110, .55);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; font-size: 13.5px; font-weight: 650; }
.chat-head small { display: block; font-size: 11.5px; color: var(--ink-3); }
.chat-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; color: var(--peach-ink); background: var(--peach-2); }
.chat-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.chat-idle {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  border: 1.5px dashed var(--line-2);
  border-radius: 14px;
  color: var(--ink-3);
}
.chat-idle .i { width: 26px; height: 26px; margin-bottom: 4px; color: var(--lav-ink); }
.chat-idle b { font-size: 13.5px; color: var(--ink-2); }
.chat-idle small { max-width: 240px; font-size: 12px; line-height: 1.6; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; animation: msgIn .35s var(--ease) backwards; }
.msg.in { align-self: flex-start; background: var(--tile); border-top-left-radius: 6px; }
.msg.out { align-self: flex-end; color: #fff; background: var(--ink); border-top-right-radius: 6px; animation-delay: .1s; }
.msg.out b { font-family: var(--font-num); }
.msg.out .btn { margin-top: 8px; height: 30px; padding: 0 12px; font-size: 12px; color: var(--ink); background: #fff; border-color: #fff; }
.msg.photo { display: flex; align-items: center; gap: 12px; padding: 7px 14px 7px 7px; }
.msg.photo p { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.msg.note { align-self: center; max-width: 100%; padding: 4px 12px; font-size: 12px; color: var(--ink-3); background: var(--tile); border-radius: 999px; }
.msg .thinking { display: inline-flex; align-items: center; gap: 8px; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }

/* 照片 + 扫描效果 */
.frame { position: relative; display: flex; flex: none; max-width: 45%; }
.frame img { max-width: 100%; max-height: 104px; object-fit: contain; border-radius: 12px; background: #fff; }
.vf { position: absolute; inset: -5px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.vf i { position: absolute; width: 14px; height: 14px; border: 2px solid var(--lav-ink); }
.vf i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 7px; }
.vf i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 7px; }
.vf i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 7px; }
.vf i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 7px; }
.chat.scanning .vf, .chat.done .vf { opacity: 1; }
.chat.done .vf i { border-color: var(--same); }
.scan { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.beam {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(213, 208, 250, 0) 50%, rgba(213, 208, 250, .7) 100%);
  border-bottom: 2px solid var(--lav-ink);
  transform: translateY(-100%);
  animation: beam 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
.chat.scanning .scan { opacity: 1; }
@keyframes beam { to { transform: translateY(0); } }
.spin-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 概览色块卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  padding: 16px 18px 16px;
  border-radius: var(--r);
  animation: rise .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.stat.lav { background: var(--lav-2); }
.stat.peach { background: var(--peach-2); }
.stat.pink { background: var(--pink-2); }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--ink); }
.stat-ic .i { width: 17px; height: 17px; }
.stat-top b { font-size: 13.5px; font-weight: 600; }
.stat-num { display: flex; align-items: baseline; gap: 5px; margin-top: auto; }
.stat-num b { font-family: var(--font-num); font-size: 32px; font-weight: 650; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-num span { font-size: 13px; color: var(--ink-2); }
.stat-bar { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .85); }
.stat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transform-origin: left; animation: growX 1s var(--ease) backwards; animation-delay: .25s; }
.stat-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.stat-foot b { font-family: var(--font-num); font-weight: 600; color: var(--ink); }
.stat.sk { animation: shimmer 1.4s linear infinite; background: linear-gradient(90deg, #e9e9ed, #f5f5f7, #e9e9ed); background-size: 200% 100%; }
@keyframes growX { from { transform: scaleX(0); } }

/* ---------- 结果区工具条 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.select {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--card);
  border: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.select > span { flex: none; white-space: nowrap; }
.select:hover { border-color: var(--line-2); }
.select.on { border-color: var(--ink); color: var(--ink-2); }
.select select {
  -webkit-appearance: none;
  appearance: none;
  max-width: 140px;
  padding: 0 20px 0 0;
  border: 0;
  outline: none;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 14px;
}
.results-block { scroll-margin-top: 14px; }

/* 结果图例：告诉看的人每个标签什么意思 */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 16px; padding: 12px 16px; border-radius: 16px; background: var(--card); font-size: 12.5px; color: var(--ink-2); }
.legend:empty { display: none; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend .pill { flex: none; }
.legend .tip { color: var(--ink-3); }
.legend .tip .i { width: 14px; height: 14px; }

/* ---------- 检索流水线 ---------- */
.pipeline {
  position: relative;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--card);
  scroll-margin-top: 14px;
  animation: rise .35s var(--ease);
}
.pipeline.running::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 28%;
  height: 3px;
  border-radius: 999px;
  background: var(--lav-ink);
  animation: indet 1.1s ease-in-out infinite;
}
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(360%); } }
.p-query { width: 96px; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--tile); }
.p-query img { max-width: 100%; max-height: 72px; object-fit: contain; mix-blend-mode: multiply; }
.p-query.text { width: auto; max-width: 240px; padding: 0 22px; background: var(--lav-2); color: var(--lav-ink); font-size: 15px; font-weight: 650; }
.p-query.text span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.p-step { min-width: 0; padding: 16px 20px; border-left: 1px solid var(--line); }
.p-step .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.p-step .n {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--tile);
}
.p-step.done .n { color: var(--mint-ink); background: var(--mint-2); }
.p-step .n .i { width: 11px; height: 11px; stroke-width: 2.8; }
.p-step .v { margin-top: 5px; font-family: var(--font-num); font-size: 22px; font-weight: 650; line-height: 1.25; white-space: nowrap; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.p-step .v small { margin: 0 8px 0 3px; font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.p-step .v small:last-child { margin-right: 0; }
.p-step .s { margin-top: 2px; font-size: 11.5px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-total { min-width: 156px; display: flex; flex-direction: column; justify-content: center; padding: 16px 22px; color: #fff; background: var(--ink); }
.p-total .k { font-size: 12px; color: rgba(255, 255, 255, .6); }
.p-total .v { margin-top: 3px; font-family: var(--font-num); font-size: 28px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p-total .v small { margin-left: 3px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .6); letter-spacing: 0; }
.dots { display: inline-flex; gap: 5px; align-items: center; height: 27px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); animation: dot 1s ease-in-out infinite; }
.p-total .dots i { background: rgba(255, 255, 255, .5); }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.context { display: flex; align-items: center; gap: 9px; margin: -8px 0 18px; font-size: 13px; color: var(--ink-3); }
.context b { color: var(--ink); font-weight: 600; }
.context .i { width: 16px; height: 16px; }

/* ---------- 结果分层 ---------- */
.tier { margin-bottom: 30px; }
.tier-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.tier-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; }
.tier-head p { font-size: 12.5px; color: var(--ink-3); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 14px; }

/* ---------- 商品卡 ---------- */
.prod {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: var(--r);
  background: var(--card);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: rise .5s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * 35ms);
}
.prod:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.prod.in-cart { box-shadow: inset 0 0 0 1.5px var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.prod-media {
  position: relative;
  height: 186px;
  padding: 26px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--tile);
}
.prod-media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.prod:hover .prod-media img { transform: scale(1.05); }
.prod-media .pill { position: absolute; top: 9px; }
.prod-media .tag { left: 9px; }
.prod-media .score { right: 9px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.prod.same .score .dot { background: var(--same); }
.prod.similar .score .dot { background: var(--similar); }
.score small { margin-left: -3px; font-size: 9.5px; font-weight: 500; color: var(--ink-3); }
.incart { position: absolute; left: 9px; bottom: 9px; display: none; }
.incart .i { width: 12px; height: 12px; stroke-width: 2.6; }
.prod.in-cart .incart { display: inline-flex; animation: rise .25s var(--ease); }

.prod-body { flex: 1; display: flex; flex-direction: column; padding: 12px 8px 0; }
.prod-brand { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-name {
  min-height: 2.7em;
  margin: 3px 0 2px;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-meta { font-size: 12px; color: var(--ink-3); }
.prod-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 12px; }
.prod-price .unit { font-size: 12px; color: var(--ink-3); }
.supplier-link {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: calc(100% + 12px);
  margin: 6px -6px 0;
  padding: 6px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 12.5px;
  text-align: left;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .2s;
}
.supplier-link:hover { background: var(--tile); }
.supplier-link > span:not(.pill) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supplier-link .pill { flex: none; }
.supplier-link .i { width: 14px; height: 14px; color: var(--ink-3); }
.prod-actions { display: flex; gap: 8px; padding: 10px 8px 8px; }
.prod-actions .btn.dark { flex: 1; }

/* 金额：小数上标，学参考稿的 "42¹⁶" */
.amt { font-family: var(--font-num); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt .cur { margin-right: 1px; font-size: .55em; font-weight: 600; }
.amt sup { margin-left: 1px; font-size: .5em; font-weight: 600; vertical-align: .75em; line-height: 0; }
.prod-price .amt { font-size: 22px; }

/* 骨架屏 */
.skeleton { pointer-events: none; animation: none; }
.skeleton .prod-media, .sk-line {
  background: linear-gradient(90deg, #ececf0 0%, #f6f6f8 50%, #ececf0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 11px; margin: 0 8px 9px; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- 引导 / 空状态 ---------- */
/* 还没选照片时：先讲清楚结果怎么看 */
.intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.intro-card { padding: 20px 20px 22px; border-radius: var(--r); background: var(--card); animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.intro-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.intro-card h3 { margin-bottom: 6px; font-size: 15px; font-weight: 650; }
.intro-card p { font-size: 13px; line-height: 1.7; color: var(--ink-3); }
.intro-card .eg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.intro-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.intro-hint .i { width: 16px; height: 16px; transform: rotate(-90deg); }

.state { padding: 52px 24px; text-align: center; border-radius: var(--r); background: var(--card); color: var(--ink-3); animation: rise .35s var(--ease); }
.state > .i { width: 28px; height: 28px; margin: 0 auto 14px; color: var(--ink-4); }
.state.error > .i { color: var(--danger); }
.state h3 { margin-bottom: 6px; font-size: 16px; font-weight: 650; color: var(--ink); }
.state p { max-width: 460px; margin: 0 auto 18px; font-size: 13px; }

/* ---------- 右侧报价栏 ---------- */
.side {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 2px -2px; }
.side-head h2 { font-size: 16px; font-weight: 650; }
.side-head span { font-size: 12px; color: var(--ink-3); }
.side-close { display: none; }

.quote-card { padding: 18px; }
.qc-head { display: flex; align-items: center; gap: 12px; }
.cart-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
}
.cart-icon .i { width: 18px; height: 18px; }
.cart-icon .count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--lav-ink);
  background: var(--lav);
  box-shadow: 0 0 0 2px #fff;
}
.cart-icon .count[data-zero] { display: none; }
.qc-head h2 { font-size: 16px; font-weight: 650; }
.qc-head p { margin-top: 1px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-head > div { min-width: 0; flex: 1; }
.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.14); } }

.qc-total { margin: 20px 0 6px; }
.qc-total .k { font-size: 12.5px; color: var(--ink-3); }
.qc-total .amt { display: block; margin-top: 2px; font-size: 44px; line-height: 1.05; }
.qc-sub { font-size: 12.5px; color: var(--ink-3); }
.qc-sub b { font-family: var(--font-num); font-weight: 600; color: var(--ink); }
.margin-bar { display: flex; gap: 3px; height: 6px; margin: 14px 0 0; }
.margin-bar i { display: block; height: 100%; border-radius: 999px; transition: width .45s var(--ease); }
.margin-bar .c { background: var(--tile-2); }
.margin-bar .p { background: var(--ink); }
.margin-legend { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; color: var(--ink-3); }

.markup { margin-top: 18px; padding: 14px 14px 12px; border-radius: var(--r-sm); background: var(--tile); }
.markup-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.markup-head small { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); }
.markup-head output { font-family: var(--font-num); font-size: 15px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] {
  --fill: 27.5%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  margin: 12px 0 0;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / var(--fill) 100% no-repeat, #dcdce2;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--ink);
  box-shadow: 0 2px 6px rgba(24, 24, 27, .25);
  transition: transform .15s;
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.range-scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

.qc-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.qc-mini div { padding: 10px 12px; border-radius: 12px; background: var(--tile); }
.qc-mini span { display: block; font-size: 11px; color: var(--ink-3); }
.qc-mini b { display: block; margin-top: 2px; font-family: var(--font-num); font-size: 15px; font-weight: 650; white-space: nowrap; }

.items-card { padding: 16px 18px 8px; }
.items-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.items-head h3 { font-size: 14.5px; font-weight: 650; }
.cart-items { display: flex; flex-direction: column; }
.ci {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-areas: "img name del" "img qty sub";
  column-gap: 12px;
  row-gap: 6px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.ci:first-child { border-top: 0; }
.ci.new { animation: slideIn .4s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } }
.ci-img { grid-area: img; align-self: center; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 12px; background: var(--tile); }
.ci-img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ci-name { grid-area: name; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.35; }
.ci-name > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-name small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.ci-del { grid-area: del; align-self: start; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-4); cursor: pointer; }
.ci-del .i { width: 13px; height: 13px; }
.ci-del:hover { color: var(--ink); background: var(--tile); }
.stepper { grid-area: qty; display: inline-flex; align-items: center; width: max-content; overflow: hidden; border-radius: 999px; background: var(--tile); }
.stepper button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.stepper button:hover { color: var(--ink); background: var(--tile-2); }
.stepper .i { width: 12px; height: 12px; }
.stepper input {
  width: 40px;
  height: 28px;
  border: 0;
  outline: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 650;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ci-sub { grid-area: sub; align-self: center; text-align: right; font-size: 14px; }
.cart-empty { display: grid; justify-items: center; gap: 5px; padding: 22px 12px 18px; text-align: center; font-size: 12.5px; color: var(--ink-3); text-wrap: balance; }
.cart-empty .i { width: 24px; height: 24px; margin-bottom: 4px; color: var(--ink-4); }
.cart-empty b { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* 预置组合卡：照参考稿的课程卡 */
.bundles { display: flex; flex-direction: column; gap: 12px; }
.bundle {
  padding: 16px 16px 14px;
  border-radius: var(--r);
  background: var(--card);
  transition: box-shadow .25s;
  animation: rise .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.bundle.active { box-shadow: inset 0 0 0 1.5px var(--ink); }
.bundle.loading { opacity: .6; pointer-events: none; }
.bd-tags { display: flex; gap: 6px; margin-bottom: 10px; }
.bd-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bd-title h3 { font-size: 15px; font-weight: 650; line-height: 1.35; }
.bd-count { flex: none; display: flex; align-items: baseline; gap: 2px; font-family: var(--font-num); }
.bd-count b { font-size: 24px; font-weight: 650; line-height: 1; letter-spacing: -.02em; }
.bd-count small { font-size: 11.5px; color: var(--ink-3); }
.bd-note { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.bd-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.bd-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bd-meta .i { width: 14px; height: 14px; color: var(--ink-3); }
.bd-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.avatars { display: flex; align-items: center; }
.avatars span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-left: -8px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--tile);
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.avatars span:first-child { margin-left: 0; }
.avatars img { width: 100%; height: 100%; padding: 4px; object-fit: contain; mix-blend-mode: multiply; }
.avatars .more { color: var(--lav-ink); background: var(--lav-2); }
.bundle.sk { height: 196px; animation: shimmer 1.4s linear infinite; background: linear-gradient(90deg, #e9e9ed, #f5f5f7, #e9e9ed); background-size: 200% 100%; }

/* ---------- 手机端：悬浮按钮 + 抽屉 ---------- */
.cart-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  display: none;
  align-items: center;
  gap: 11px;
  height: 56px;
  padding: 0 20px 0 7px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 30px -12px rgba(24, 24, 27, .55);
  cursor: pointer;
  transition: opacity .3s, transform .3s var(--ease);
}
.cart-fab .cart-icon { color: var(--ink); background: #fff; }
.cart-fab .cart-icon .count { box-shadow: 0 0 0 2px var(--ink); }
.fab-text { text-align: left; line-height: 1.2; }
.fab-text small { display: block; font-size: 11px; color: rgba(255, 255, 255, .6); }
.fab-text b { font-family: var(--font-num); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.scrim { display: none; }

/* ---------- 拖拽遮罩 ---------- */
.drop-overlay {
  position: fixed;
  inset: 14px;
  z-index: 70;
  display: grid;
  place-items: center;
  border: 2px dashed var(--lav-ink);
  border-radius: var(--r-lg);
  background: rgba(236, 235, 253, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
body.dragging .drop-overlay { opacity: 1; }
.drop-overlay > div { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--lav-ink); }
.drop-overlay .i { width: 44px; height: 44px; }
.drop-overlay b { font-size: 20px; font-weight: 650; color: var(--ink); }
.drop-overlay small { font-size: 13px; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(92vw, 480px);
  padding: 10px 20px 10px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--ease);
}
.toast .ti { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--mint); }
.toast .ti .i { width: 13px; height: 13px; stroke-width: 2.8; }
.toast.error .ti { color: #fff; background: var(--danger); }
.toast small { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .6); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.fly { position: fixed; z-index: 100; object-fit: contain; padding: 6px; border-radius: 14px; background: var(--tile); box-shadow: var(--shadow-lg); pointer-events: none; mix-blend-mode: normal; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(24, 24, 27, .3); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box { position: relative; width: 100%; max-height: calc(100vh - 48px); overflow: auto; border-radius: var(--r-lg); background: var(--card); box-shadow: 0 40px 100px -30px rgba(24, 24, 27, .45); animation: pop .4s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--tile); color: var(--ink-2); cursor: pointer; }
.modal-close .i { width: 15px; height: 15px; }
.modal-close:hover { color: var(--ink); background: var(--tile-2); }

/* 供应商比价 */
.modal-box.sheet { max-width: 620px; padding: 26px; }
.sheet-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-right: 40px; }
.sheet-head .thumb { width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: 18px; background: var(--tile); }
.sheet-head .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sheet-head h2 { margin: 6px 0 2px; font-size: 20px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
.sheet-head p { font-size: 12.5px; color: var(--ink-3); }
.sup-list { display: flex; flex-direction: column; gap: 10px; }
.sup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 16px; border-radius: 16px; background: var(--tile); animation: rise .4s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.sup.best { background: var(--mint-2); }
.sup-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14.5px; font-weight: 650; }
.sup-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.sup-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sup-meta .i { width: 13px; height: 13px; }
.sup-cost { text-align: right; }
.sup-cost .amt { font-size: 22px; }
.sup-cost small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.sup-cost small.ok { color: var(--mint-ink); font-weight: 600; }
.sup-bar { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .9); }
.sup-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink-4); transform-origin: left; animation: growX .8s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.sup.best .sup-bar i { background: var(--mint-ink); }
.sheet-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
.sheet-note .i { width: 15px; height: 15px; }

/* 报价单（纸张） */
.modal-box.paper { max-width: 980px; }
.paper-doc { padding: 40px 44px 26px; }
.paper-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 0 44px 20px 0; border-bottom: 1.5px solid var(--ink); }
.paper-brand { display: flex; align-items: center; gap: 11px; }
.paper-brand .rail-logo { width: 34px; height: 34px; border-radius: 10px; }
.paper-brand b { display: block; font-size: 15px; font-weight: 650; }
.paper-brand small { display: block; font-size: 11.5px; color: var(--ink-3); }
.paper-title { text-align: right; }
.paper-title h2 { font-size: 26px; font-weight: 700; letter-spacing: .16em; line-height: 1.1; }
.paper-title span { font-size: 10.5px; letter-spacing: .36em; color: var(--ink-4); }
.paper-meta { display: grid; grid-template-columns: 2fr 1fr 1.2fr .8fr; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.paper-meta span { display: block; margin-bottom: 3px; font-size: 11.5px; color: var(--ink-3); }
.paper-meta b { font-weight: 600; }
.paper-kpis { display: grid; grid-template-columns: 1.1fr 2fr; gap: 12px; margin: 22px 0 24px; }
.kpi { padding: 13px 15px; border-radius: 14px; background: var(--tile); }
.kpi .k { display: block; font-size: 11.5px; color: var(--ink-3); }
.kpi .v { display: block; margin-top: 3px; font-family: var(--font-num); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi.hero-kpi { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 20px 22px; background: var(--lav); }
.kpi.hero-kpi .k { color: #3d3866; }
.kpi.hero-kpi .amt { font-size: 42px; line-height: 1; }
.kpi.hero-kpi .kpi-sub { font-size: 12px; color: #3d3866; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.table-wrap { overflow-x: auto; }
table.qt { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12.5px; }
.qt th { padding: 0 8px 10px; text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.qt td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.qt .idx { color: var(--ink-4); font-variant-numeric: tabular-nums; }
.qt .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qt .strong { font-weight: 650; }
.qt .prod-cell { display: flex; align-items: center; gap: 10px; }
.qt .prod-cell img { width: 38px; height: 38px; flex: none; padding: 3px; object-fit: contain; border-radius: 10px; background: var(--tile); mix-blend-mode: multiply; }
.qt .prod-cell b { font-weight: 600; }
.qt .sub { display: block; font-size: 11px; color: var(--ink-3); }
.qt .sku { font-family: var(--mono); font-size: 10.5px; }
.qt .unit { font-size: 11px; color: var(--ink-3); }
.qt tfoot td { padding-top: 14px; font-size: 14px; font-weight: 650; border-top: 1.5px solid var(--ink); border-bottom: 0; }
.paper-warn { margin-top: 14px; padding: 10px 14px; border-radius: 12px; font-size: 12.5px; color: var(--peach-ink); background: var(--peach-2); }
.paper-note { margin-top: 18px; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }
.paper-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 44px 22px; border-top: 1px solid var(--line); }

/* ---------- 登录页 ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(1040px, 100%);
  min-height: 600px;
  padding: 12px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 36px 32px;
  overflow: hidden;
  overflow: clip;
  border-radius: 24px;
  background: var(--lav);
  isolation: isolate;
}
.login-art::before, .login-art::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.login-art::before { width: 420px; height: 420px; right: -160px; top: -120px; }
.login-art::after { width: 260px; height: 260px; left: -90px; bottom: -110px; background: rgba(255, 255, 255, .2); }
.login-brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; }
.login-art h1 { margin-top: 40px; font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.login-art p { margin-top: 12px; max-width: 360px; font-size: 14px; line-height: 1.7; color: #3d3866; }
.login-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* 插画：三张"识别结果卡"叠放 */
.login-ill { position: relative; flex: 1; min-height: 220px; margin-top: 16px; }
.ill-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px -20px rgba(39, 30, 110, .6);
}
.ill-card .ill-img { height: 112px; display: grid; place-items: center; border-radius: 12px; background: var(--tile); }
.ill-card .ill-img svg { width: 56px; height: 86px; }
.ill-line { height: 8px; margin-top: 9px; border-radius: 999px; background: var(--tile-2); }
.ill-line.short { width: 55%; }
.ill-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.ill-price { font-family: var(--font-num); font-size: 15px; font-weight: 700; }
.ill-btn { width: 44px; height: 18px; border-radius: 999px; background: var(--ink); }
.ill-card:nth-child(1) { transform: translate(-150%, -46%) rotate(-10deg); }
.ill-card:nth-child(2) { z-index: 2; transform: translate(-50%, -54%); }
.ill-card:nth-child(3) { transform: translate(50%, -46%) rotate(10deg); }
.ill-card:nth-child(2) .ill-img { background: var(--peach-2); }
.ill-card:nth-child(3) .ill-img { background: var(--pink-2); }
.ill-scan { position: absolute; inset: -8px; pointer-events: none; }
.ill-scan i { position: absolute; width: 16px; height: 16px; border: 2px solid var(--ink); }
.ill-scan i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.ill-scan i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.ill-scan i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.ill-scan i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.ill-match { position: absolute; top: -12px; right: -12px; z-index: 3; }

.login-form { display: flex; flex-direction: column; justify-content: center; padding: 40px 56px; }
.login-form h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-form > p { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.login-form form { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 8px 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--tile);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field-box:focus-within { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(24, 24, 27, .05); }
.field-box > .i { width: 17px; height: 17px; color: var(--ink-3); }
.field-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.field-box input::placeholder { color: var(--ink-4); }
.login-error { min-height: 20px; font-size: 13px; color: var(--danger); }
.login-form form.shake { animation: shake .4s; }
.login-foot { margin-top: 28px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 响应式 ---------- */
@media (max-width: 1400px) {
  .step { padding: 11px 13px; gap: 10px; }
  .step-text small { display: none; }
}

@media (max-width: 1180px) {
  .content { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(400px, 100vw);
    max-height: none;
    padding: 14px;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    transition: transform .45s var(--ease);
  }
  body.cart-open { overflow: hidden; }
  body.cart-open .side { transform: none; }
  .side-close { display: grid; margin-left: auto; }
  .cart-fab { display: flex; }
  body.cart-open .cart-fab { opacity: 0; pointer-events: none; transform: scale(.94); }
  .scrim { position: fixed; inset: 0; z-index: 55; display: block; background: rgba(24, 24, 27, .28); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.cart-open .scrim { opacity: 1; pointer-events: auto; }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: 60px; }
}

@media (max-width: 1080px) {
  .cases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "copy" "cases" "extra" "chat"; padding: 24px 20px; }
  .stats { grid-template-columns: 1fr; }
  .stat { min-height: 0; }
  .intro { grid-template-columns: 1fr; }
  .chat { min-height: 0; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .p-query { display: none; }
  .p-step { border-left: 0; border-bottom: 1px solid var(--line); }
  .p-step.s2 { border-left: 1px solid var(--line); }
  .p-step.s3 { border-bottom: 0; }
  .p-total { min-width: 0; }
  .paper-kpis { grid-template-columns: 1fr; }
  .paper-meta { grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-ill { display: none; }
  .login-form { padding: 32px 22px 28px; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .workspace { padding: 10px 10px 32px; }
  .topbar { gap: 8px; }
  .searchbar { height: 46px; padding-left: 16px; }
  .searchbar kbd, .searchbar .btn { display: none; }
  .status { width: 46px; height: 46px; padding: 0; justify-content: center; }
  .status .st-label, .status .st-meta, .status .sep { display: none; }
  .avatar { width: 46px; height: 46px; font-size: 15px; }
  .hero h1 { font-size: 21px; }
  .steps { display: flex; gap: 8px; margin: 0 -10px 12px; padding: 0 10px 2px; overflow-x: auto; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .step { flex: none; padding: 8px 14px 8px 8px; }
  .step-no { width: 28px; height: 28px; }
  .cases { gap: 8px; }
  .case-img { height: 88px; }
  .case-title { font-size: 12px; }
  .legend { gap: 6px 12px; padding: 10px 12px; font-size: 12px; }
  .block-head { flex-direction: column; align-items: stretch; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .select select { max-width: none; flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod { padding: 6px; }
  .prod-media { height: 150px; padding: 22px 14px 14px; }
  .prod-body { padding: 10px 6px 0; }
  .prod-name { font-size: 13.5px; }
  .prod-price .amt { font-size: 19px; }
  .prod-actions { flex-direction: column-reverse; gap: 6px; padding: 8px 6px 6px; }
  .p-step { padding: 13px 14px; }
  .p-step .v { font-size: 19px; }
  .p-total { padding: 13px 14px; }
  .p-total .v { font-size: 22px; }
  .modal { padding: 0; align-items: end; }
  .modal-box { max-height: 92vh; border-radius: 24px 24px 0 0; }
  .modal-box.sheet { padding: 22px 18px; }
  .paper-doc { padding: 26px 18px 18px; }
  .paper-head { flex-direction: column; align-items: flex-start; }
  .paper-title { text-align: left; }
  .paper-actions { padding: 14px 18px 20px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .login-page { padding: 12px; }
  .login-art { padding: 26px 24px; }
  .login-art h1 { margin-top: 26px; font-size: 24px; }
}

@media (hover: none) and (pointer: coarse) {
  .only-pointer { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 打印：只留报价单 ---------- */
@media print {
  @page { margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #fff !important; }
  body > *:not(.modal) { display: none !important; }
  .modal { position: static; display: block; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
  .modal-box { max-width: none !important; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; animation: none; }
  .modal-close, .paper-actions { display: none !important; }
  .paper-doc { padding: 0; }
  .paper-head { padding-right: 0; }
  table.qt { min-width: 0; }
  .paper-kpis, .qt tr { break-inside: avoid; }
}
