/* StorePilot 选品工作台 —— 响应式真页面（按 5 张设计稿重建） */
:root {
  --brand: #2f6bff;
  --brand-soft: #eaf1ff;
  --green: #16b46a;
  --orange: #ff9f1c;
  --red: #ff5b5b;
  --ink: #0b1b33;
  --ink-2: #33415c;
  --muted: #8995a8;
  --dim: #a5afbf;
  --line: rgba(11, 27, 51, .08);
  --bg: #f2f6fc;
  --card: #fff;
  --r: 16px;
  --shadow: 0 10px 26px rgba(11, 27, 51, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
img { display: block; }

/* ---------- 顶栏 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; gap: 18px; padding: 0 26px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; flex: 0 0 auto; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.brand .logo img { width: 22px; height: 22px; }
.brand .sub { font-size: 12px; color: var(--dim); font-weight: 500; letter-spacing: .04em; }
.nav { display: flex; gap: 6px; margin-left: 10px; overflow-x: auto; }
.nav a { padding: 9px 16px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: #f4f7fd; color: var(--brand); }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.cart-pill { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13.5px; color: var(--ink-2); }
.cart-pill b { color: var(--brand); }
.who { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.who .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2f6bff, #7db4ff); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.back { font-size: 13px; color: var(--muted); }

/* ---------- 布局 ---------- */
.layout { display: flex; align-items: flex-start; gap: 22px; max-width: 1560px; margin: 0 auto; padding: 22px 26px 60px; }
.sidebar { width: 208px; flex: 0 0 208px; background: #fff; border-radius: var(--r); padding: 14px 10px; box-shadow: var(--shadow);
  position: sticky; top: 88px; }
.sidebar .cap { font-size: 11px; color: var(--dim); letter-spacing: .12em; padding: 6px 14px 8px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; color: var(--ink-2); font-size: 14.5px; margin-bottom: 3px; }
.sidebar a:hover { background: #f4f7fd; color: var(--ink); }
.sidebar a.on { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar a .ic { width: 18px; text-align: center; font-size: 15px; }
.main { flex: 1; min-width: 0; }

/* ---------- 通用 ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-h .sub { font-size: 13px; color: var(--dim); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { margin: 0; font-size: 17px; }
.card-h .more { font-size: 13px; color: var(--brand); font-weight: 600; }
.muted { color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; color: var(--dim); font-size: 13.5px; padding: 44px 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tag.g { background: #e9f9ef; color: var(--green); }
.tag.y { background: #fff7e6; color: var(--orange); }
.tag.r { background: #fdecec; color: var(--red); }
.tag.b { background: var(--brand-soft); color: var(--brand); }

.btn { height: 42px; padding: 0 20px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-size: 14px; color: var(--ink); }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.pri:hover { background: #2358d8; color: #fff; }
.btn.ghost { background: #f3f8ff; border-color: #cfe0ff; color: var(--brand); font-weight: 600; }
.btn.ghost:hover { background: var(--brand); color: #fff; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- 首页 hero ---------- */
.hero { border-radius: 20px; padding: 30px 34px; margin-bottom: 20px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef5ff 0%, #dce9ff 55%, #cfe2ff 100%); }
.hero .ai { width: 84px; height: 84px; border-radius: 18px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2f6bff, #7db4ff); color: #fff; font-size: 30px; font-weight: 800; box-shadow: 0 12px 26px rgba(47,107,255,.35); }
.hero .txt { flex: 1; min-width: 280px; }
.hero h1 { margin: 0; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -.03em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .sub { margin-top: 9px; font-size: 14.5px; color: var(--ink-2); }
.hero .act { flex: 0 0 auto; }
.hero .act .btn { height: 54px; padding: 0 28px; border-radius: 999px; font-size: 15.5px; box-shadow: 0 12px 26px rgba(47,107,255,.3); }

/* ---------- 推荐卡片 ---------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pcard { display: flex; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid rgba(11,27,51,.06);
  box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(47,107,255,.14); }
.pcard .pic { width: 128px; flex: 0 0 128px; background: #f2f5fa; }
.pcard .pic img { width: 100%; height: 100%; object-fit: cover; }
.pcard .info { padding: 14px 16px 16px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.pcard .t { font-size: 15px; font-weight: 700; line-height: 1.45; min-height: 44px; }
.pcard .ln { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px dashed #eef2f8; }
.pcard .ln b { font-weight: 700; }
.pcard .ln b.g { color: var(--green); }
.pcard .act { margin-top: auto; display: flex; gap: 8px; }
.pcard .act .btn { flex: 1; }

/* ---------- 信息条 ---------- */
.infostrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; background: #fff; border-radius: 16px;
  padding: 20px 24px; box-shadow: var(--shadow); margin-top: 20px; }
.infostrip .it { display: flex; gap: 12px; align-items: flex-start; }
.infostrip .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; }
.infostrip .l { font-size: 11.5px; color: var(--dim); }
.infostrip .v { font-size: 14.5px; font-weight: 700; margin-top: 3px; }
.infostrip .n { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.tip { margin-top: 14px; background: var(--brand-soft); border-radius: 12px; padding: 13px 18px; font-size: 12.5px; color: #3f5b86; line-height: 1.8; }

/* ---------- 筛选 ---------- */
.filters { background: #fff; border-radius: 16px; padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.frow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.frow:last-child { border-bottom: 0; }
.frow .lab { width: 62px; flex: 0 0 62px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.frow .opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }
.chip { height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.frow input[type=number] { height: 38px; width: 100px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; font-size: 13.5px; outline: 0; }
.frow select { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; font-size: 13.5px; outline: 0; background: #fff; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 38px; }
.stepper button { width: 40px; height: 36px; border: 0; background: #fff; font-size: 17px; color: var(--ink); }
.stepper button:hover { background: var(--brand-soft); color: var(--brand); }
.stepper input { width: 60px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-size: 14px; font-weight: 700; outline: 0; }

/* ---------- 表格 ---------- */
.tbwrap { overflow-x: auto; }
.tb { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.tb th { text-align: left; font-size: 11.5px; color: var(--dim); font-weight: 600; padding: 11px 12px; background: #fafbfe; white-space: nowrap; }
.tb td { padding: 13px 12px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
.tb tr:last-child td { border-bottom: 0; }
.tb tbody tr:hover { background: #fafcff; }
.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
.tb .pos { color: var(--green); font-weight: 700; }
.tb .thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: #f2f5fa; }
.tb .prod { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.tb .prod .nm { font-weight: 600; line-height: 1.4; }

/* ---------- 两列 ---------- */
.split2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.split3 { display: grid; grid-template-columns: 1.1fr 1.4fr .9fr; gap: 18px; }

/* ---------- 详情 ---------- */
.dhead { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.dhead .pic { width: 170px; height: 170px; border-radius: 14px; object-fit: cover; background: #f2f5fa; }
.dhead .t { font-size: 20px; font-weight: 800; line-height: 1.4; }
.ring { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: conic-gradient(var(--brand) 0deg 320deg, #eef2f8 320deg 360deg); }
.ring i { width: 80px; height: 80px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-style: normal; }
.ring b { font-size: 25px; color: var(--brand); line-height: 1; }
.ring span { font-size: 9.5px; color: var(--dim); margin-top: 3px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.mcard { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.mcard .l { font-size: 11.5px; color: var(--dim); }
.mcard .v { font-size: 20px; font-weight: 800; margin-top: 5px; }
.mcard .v.b { color: var(--brand); }
.mcard .v.g { color: var(--green); }
.sec { margin-top: 20px; }
.sec h3 { margin: 0 0 10px; font-size: 15.5px; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed #eef2f8; }
.chk .ic { width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 auto; }
.chk .ic.ok { background: #e9f9ef; color: var(--green); }
.chk .ic.warn { background: #fff7e6; color: var(--orange); }
.chk .ic.bad { background: #fdecec; color: var(--red); }
.ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 2; }
.spark { width: 100%; height: 90px; }

/* ---------- 榜单 ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eef2f8; cursor: pointer; }
.rank-item:hover { background: #fafcff; }
.rank-item .no { width: 24px; text-align: center; font-weight: 800; color: var(--dim); font-size: 15px; }
.rank-item .no.top { color: var(--orange); }
.rank-item img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: #f2f5fa; }
.rank-item .nm { flex: 1; font-size: 13px; line-height: 1.4; }
.rank-item .up { font-size: 12px; color: var(--green); font-weight: 700; }
.risk-list .ri { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eef2f8; font-size: 13px; }
.risk-list .ri .nm { flex: 1; line-height: 1.4; }

/* ---------- 选品车 ---------- */
.cart-line { display: flex; align-items: center; gap: 14px; }
.price-in { width: 96px; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; text-align: right; font-size: 13.5px; outline: 0; }
.cart-bar { position: sticky; bottom: 0; margin-top: 16px; background: #0b1b33; color: #fff; border-radius: 14px; padding: 15px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: 0 -8px 24px rgba(11,27,51,.12); }
.cart-bar .n { font-size: 14.5px; }
.cart-bar .n b { font-size: 20px; color: #7dffb0; }
.cart-bar .sp { flex: 1; }
.cart-bar .btn { height: 44px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(11,27,51,.95); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px; z-index: 99; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .split3 { grid-template-columns: 1.2fr 1fr; }
  .split3 > :last-child { grid-column: 1 / -1; }
  .split2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .layout { flex-direction: column; padding: 16px 14px 40px; gap: 14px; }
  .sidebar { width: 100%; flex: none; position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .sidebar .cap { display: none; }
  .sidebar a { margin-bottom: 0; white-space: nowrap; padding: 9px 13px; font-size: 13.5px; }
  .sidebar a .ic { display: none; }
  .topbar-in { padding: 0 14px; gap: 10px; height: auto; min-height: 62px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .brand .sub { display: none; }
  .hero { padding: 22px 20px; gap: 16px; }
  .hero .ai { width: 64px; height: 64px; font-size: 24px; border-radius: 15px; }
  .dhead { grid-template-columns: 1fr; }
  .dhead .pic { width: 100%; height: 190px; }
}
@media (max-width: 620px) {
  .pcards { grid-template-columns: 1fr; }
  .pcard .pic { width: 104px; flex-basis: 104px; }
  .top-right .who span { display: none; }
  .split3 { grid-template-columns: 1fr; }
  .frow .lab { width: 100%; flex: 1 1 100%; }
  .tb { min-width: 720px; }
}
