/* ============================================================
   Peec 复刻原型 · 中国 AI 引擎版 — 设计系统
   ============================================================ */
:root {
  --bg: #FAFAF7;
  --panel: #FFFFFF;
  --sidebar: #F4F3EE;
  --ink: #111110;
  --ink2: #3C3C34;
  --muted: #7C7C70;
  --faint: #A3A296;
  --line: #E6E4DB;
  --line2: #F1EFE8;
  --lime: #D8F26B;
  --up: #17845B;
  --down: #C4443B;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 17, 16, .04), 0 8px 24px -18px rgba(17, 17, 16, .25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--lime); color: var(--ink); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #DCDAD0; border-radius: 9px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 布局 ================= */
.app { display: grid; grid-template-columns: 246px minmax(0, 1fr); height: 100vh; overflow: hidden; }

/* ================= 侧边栏 ================= */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 9px; padding: 2px 6px 16px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  box-shadow: inset 0 -6px 12px rgba(216, 242, 107, .35);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-size: 16px; letter-spacing: -.02em; }
.logo-text span { font-size: 10.5px; color: var(--muted); letter-spacing: .01em; }

.proj-switch {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: 11px; background: #fff; border: 1px solid var(--line);
  margin-bottom: 18px; transition: .16s;
}
.proj-switch:hover { border-color: #D6D3C7; box-shadow: 0 2px 8px -4px rgba(0,0,0,.15); }
.proj-ava { width: 26px; height: 26px; border-radius: 8px; background: var(--lime); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.proj-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; overflow: hidden; }
.proj-name { font-size: 12.5px; font-weight: 600; }
.proj-domain { font-size: 10.5px; color: var(--faint); }
.proj-switch .chev { margin-left: auto; color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
  padding: 14px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 9px; color: var(--ink2); font-size: 13.2px;
  transition: background .14s, color .14s; text-align: left;
}
.nav-item svg { color: var(--muted); transition: color .14s; flex: none; }
.nav-item:hover { background: #EDEBE3; }
.nav-item.active { background: var(--ink); color: #fff; font-weight: 500; }
.nav-item.active svg { color: var(--lime); }
.nav-count, .nav-dot {
  margin-left: auto; font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.nav-count { color: var(--faint); background: #E9E7DE; padding: 1px 6px; border-radius: 20px; }
.nav-item.active .nav-count { background: rgba(255,255,255,.14); color: #fff; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #E0742B; }

.side-foot { margin-top: auto; padding-top: 18px; }
.crawl-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
.crawl-head { font-size: 10.5px; color: var(--faint); letter-spacing: .04em; }
.crawl-time { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 1px; }
.crawl-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.crawl-bar { height: 3px; border-radius: 3px; background: #EEECE3; margin-top: 9px; overflow: hidden; }
.crawl-bar i { display: block; height: 100%; width: 38%; background: var(--ink); border-radius: 3px; }
.demo-note { font-size: 10px; color: var(--faint); text-align: center; padding: 10px 0 2px; }

/* ================= 主区 ================= */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 26px; border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 247, .88); backdrop-filter: blur(10px); z-index: 20;
}
.crumbs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: #CFCDC2; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.seg { display: flex; background: #EFEDE5; border-radius: 9px; padding: 2px; }
.seg button {
  padding: 4px 11px; border-radius: 7px; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; transition: .14s;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 500;
  background: #fff; border: 1px solid var(--line); transition: .14s; white-space: nowrap;
}
.btn:hover { border-color: #D2CFC2; background: #FDFDFB; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #2A2A24; border-color: #2A2A24; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #EFEDE5; color: var(--ink); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 下拉 */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 7px); width: 226px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px;
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.28); animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.dropdown-panel .dp-title { font-size: 10.5px; color: var(--faint); padding: 4px 8px 6px; letter-spacing: .04em; }
.check-row {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px;
  border-radius: 8px; font-size: 12.5px; text-align: left;
}
.check-row:hover { background: #F7F6F0; }
.check-box {
  width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid #D6D3C6; display: grid; place-items: center;
  flex: none; transition: .14s;
}
.check-row.on .check-box { background: var(--ink); border-color: var(--ink); color: #fff; }
.check-row .dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }

/* ================= 视图 ================= */
.view { flex: 1; overflow-y: auto; padding: 24px 26px 72px; }
.view-inner { max-width: 1420px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-title { font-size: 21px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 3px; }
.page-sub { font-size: 12.5px; color: var(--muted); max-width: 720px; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card.tight { padding: 15px 17px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { font-size: 11.5px; color: var(--faint); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-3-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.mt { margin-top: 14px; }

/* KPI */
.kpi { position: relative; }
.kpi .k-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi .k-value { font-size: 30px; font-weight: 640; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .k-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.kpi .k-foot { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--faint); }
.kpi .k-chart { margin-top: 8px; }

/* 提示气泡 */
.info-dot {
  width: 13px; height: 13px; border-radius: 50%; border: 1px solid #CFCCC0; color: var(--faint);
  font-size: 9px; display: inline-grid; place-items: center; cursor: help; position: relative; flex: none;
}
.info-dot:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: 145%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 400; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; width: 216px; z-index: 50; white-space: normal; text-align: left;
}

/* 图表 */
.chart-wrap { position: relative; width: 100%; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute; z-index: 30; pointer-events: none;
  background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.3); padding: 8px 10px; min-width: 132px;
}
.tip-date { font-size: 10.5px; color: var(--faint); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tip-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.7; }
.tip-row i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.tip-row span { color: var(--muted); }
.tip-row b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none; }
.legend-item i { width: 8px; height: 8px; border-radius: 2px; }
.legend-item.off { opacity: .35; }

/* 横条 */
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 54px; align-items: center; gap: 10px; }
.hbar-label { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 5px; }
.hbar-track { height: 7px; border-radius: 6px; background: #F2F0E9; position: relative; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.hbar-ghost { position: absolute; top: -2px; width: 1.5px; height: 11px; background: #B9B6A8; }
.hbar-val { font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }

/* 表格 */
.tbl-wrap { overflow: auto; margin: 0 -20px -18px; padding: 0 20px 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; color: var(--faint);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff;
  position: sticky; top: 0; z-index: 2;
}
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FBFAF5; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 11px; color: var(--faint); }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .mini { width: 54px; height: 4px; border-radius: 3px; background: #F2F0E9; overflow: hidden; }
.bar-cell .mini i { display: block; height: 100%; background: #111110; border-radius: 3px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; white-space: nowrap; line-height: 1.6;
}
.tag-i { background: #EEEAFE; color: #5B4BE8; }
.tag-c { background: #E7F0FF; color: #2F6BFF; }
.tag-b { background: #F3F8DA; color: #6B7A14; }
.tag-m { background: #FDEEE0; color: #B6631A; }
.tag-g { background: #F1EFE8; color: var(--muted); }
.tag-dark { background: var(--ink); color: #fff; }
.tag-lime { background: var(--lime); color: #3C4A00; }
.tag-up { background: #E4F4EC; color: var(--up); }
.tag-down { background: #FBEAE8; color: var(--down); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pill.pos { background: #E7F4EC; color: #177A52; }
.pill.neu { background: #F2F0E9; color: #6F6E62; }
.pill.neg { background: #FBEAE8; color: #B8402F; }
.pill.rank { background: #F3F1E9; color: var(--ink2); font-weight: 600; }
.pill.rank.top { background: var(--ink); color: #fff; }

/* 抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 92vw); z-index: 90;
  background: #fff; border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(0,0,0,.35);
  transform: translateX(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head .close { position: absolute; right: 16px; top: 15px; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.drawer-head .close:hover { background: #F2F0E9; color: var(--ink); }
.drawer-body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }
.drawer-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; padding-right: 30px; }
.drawer-tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

.seg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px -20px 0; padding: 0 20px; }
.seg-tabs button { padding: 8px 0; margin-right: 14px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.answer-box {
  background: #FBFAF5; border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px;
  font-size: 12.8px; line-height: 1.85; color: var(--ink2); white-space: pre-wrap;
}
.answer-box .brand-hl { background: var(--lime); padding: 0 3px; border-radius: 3px; font-weight: 500; }
.answer-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; color: var(--faint); }
.cite-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cite-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--line2); border-radius: 10px; }
.cite-idx { width: 18px; height: 18px; border-radius: 5px; background: #F1EFE8; display: grid; place-items: center; font-size: 10px; color: var(--muted); flex: none; margin-top: 1px; }
.cite-domain { font-size: 12px; font-weight: 500; }
.cite-type { font-size: 10.5px; color: var(--faint); }

/* 遮罩 */
.scrim { position: fixed; inset: 0; background: rgba(17,17,16,.18); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 80; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* 建议卡 */
.rec {
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: #fff;
  box-shadow: var(--shadow); display: flex; gap: 14px; transition: .16s;
}
.rec:hover { border-color: #D5D2C5; transform: translateY(-1px); box-shadow: 0 12px 30px -20px rgba(0,0,0,.35); }
.rec.done { opacity: .55; }
.rec.done .rec-title { text-decoration: line-through; }
.rec-main { flex: 1; min-width: 0; }
.rec-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.rec-title { font-size: 13.5px; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.rec-why { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 5px; }
.rec-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; font-size: 11px; color: var(--faint); }
.rec-meta b { color: var(--ink2); font-weight: 600; }
.rec-side { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; }
.rec-actions { display: flex; gap: 6px; margin-top: 10px; }
.check-done { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #D8D5C8; display: grid; place-items: center; color: transparent; transition: .15s; }
.check-done:hover { border-color: var(--ink); }
.rec.done .check-done { background: var(--ink); border-color: var(--ink); color: var(--lime); }

/* 属性行 */
.attr-row { display: grid; grid-template-columns: 104px 1fr 1fr 58px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.attr-row:last-child { border-bottom: none; }
.attr-name { font-size: 12.5px; }
.attr-track { height: 6px; border-radius: 5px; background: #F2F0E9; overflow: hidden; }
.attr-track i { display: block; height: 100%; border-radius: 5px; }
.attr-val { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* 核查卡 */
.claim { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.claim + .claim { margin-top: 10px; }
.claim-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.claim-text { font-size: 12.8px; font-weight: 500; line-height: 1.55; }
.claim-detail { font-size: 11.8px; color: var(--muted); line-height: 1.65; margin-top: 5px; }
.claim-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 10.5px; color: var(--faint); }

/* 设置 */
.form-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.form-row:last-child { border-bottom: none; }
.form-label { width: 128px; font-size: 12.5px; color: var(--muted); flex: none; }
.input {
  flex: 1; max-width: 340px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; background: #FDFDFB; outline: none; transition: .15s;
}
.input:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(17,17,16,.06); }
.switch { width: 34px; height: 20px; border-radius: 99px; background: #DDDACE; position: relative; transition: .18s; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(14px); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); z-index: 120;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 12.5px;
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: .25s;
  display: flex; align-items: center; gap: 9px;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--lime); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 空态 */
.empty { text-align: center; padding: 40px 0; color: var(--faint); font-size: 12.5px; }

/* 迷你统计条 */
.stat-strip { display: flex; gap: 0; border-top: 1px solid var(--line2); margin-top: 12px; padding-top: 11px; }
.stat-strip > div { flex: 1; padding-right: 10px; }
.stat-strip .s-label { font-size: 10.5px; color: var(--faint); }
.stat-strip .s-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.split-line { height: 1px; background: var(--line2); margin: 14px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.fs11 { font-size: 11px; }
.fs12 { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-3-2, .g-1-1 { grid-template-columns: minmax(0, 1fr); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding: 12px 8px; }
  .logo-text, .proj-meta, .nav-item span.lbl, .nav-count, .crawl-card, .demo-note, .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .proj-switch { justify-content: center; padding: 6px; }
  .view { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .g4, .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   真实应用追加样式：登录 / 引导 / 表单 / 弹层
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background:
    radial-gradient(900px 480px at 18% 8%, rgba(216,242,107,.55), transparent 60%),
    radial-gradient(700px 420px at 88% 92%, rgba(91,75,232,.14), transparent 62%),
    #FAFAF7;
}
.auth-card {
  width: 392px; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 28px 24px; box-shadow: 0 40px 80px -50px rgba(17,17,16,.45);
}
.auth-logo { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.auth-title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; background: #FDFDFB; outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink); background: #fff; box-shadow: 0 0 0 3px rgba(17,17,16,.06);
}
.auth-actions { margin-top: 18px; }
.auth-actions .btn { width: 100%; justify-content: center; padding: 10px; font-size: 13px; }
.auth-switch { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-switch button { color: var(--ink); font-weight: 600; text-decoration: underline; }
.auth-error { background: #FBEAE8; color: #B8402F; border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-bottom: 12px; }

/* ---------- Onboarding 向导（Peec 式七步）---------- */
.ob-wrap { max-width: 780px; margin: 0 auto; padding: 44px 26px 60px; }
.ob-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 20px; }
.ob-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 11px 4px 5px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.ob-step .n { width: 18px; height: 18px; border-radius: 50%; background: var(--line2); color: var(--muted); font-size: 10.5px; display: flex; align-items: center; justify-content: center; flex: none; }
.ob-step.on { color: var(--ink); border-color: var(--ink); font-weight: 500; }
.ob-step.on .n { background: var(--ink); color: #fff; }
.ob-step.done { color: var(--ink2); }
.ob-step.done .n { background: var(--up); color: #fff; }
.ob-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow); min-height: 400px; }
.ob-title { font-size: 21px; font-weight: 600; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ob-sub { font-size: 13px; color: var(--muted); margin: 0 0 18px; line-height: 1.7; }
.ob-badge { font-size: 11px; font-weight: 400; color: var(--ink2); background: var(--line2); border-radius: 99px; padding: 3px 10px; }
.ob-badge-ai { color: #3C3489; background: #EEEDFE; }
.ob-field { margin-bottom: 15px; }
.ob-field label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 5px; font-weight: 500; }
.ob-field input, .ob-field textarea, .ob-field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.ob-field input:focus, .ob-field textarea:focus, .ob-field select:focus { outline: none; border-color: var(--ink); }
.ob-field textarea { resize: vertical; }
.ob-urlrow { display: flex; gap: 9px; }
.ob-urlrow input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 13px; font-family: inherit; background: #fff; }
.ob-urlrow input:focus { outline: none; border-color: var(--ink); }
.ob-ol { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--ink2); line-height: 1.9; }
.ob-alt { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.ob-link { background: none; border: none; padding: 0; font-size: 12.5px; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-family: inherit; }
.ob-link:hover { color: var(--ink); }
.ob-link:disabled { color: var(--faint); cursor: default; }
.ob-sitecard { background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 12.5px; }
.ob-sitecard-t { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.ob-sitecard-row { display: flex; gap: 10px; margin-top: 4px; }
.ob-sitecard-row span { color: var(--muted); flex: none; }
.ob-sitecard-row b { font-weight: 500; color: var(--ink2); }
.ob-chips { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; background: #fff; }
.ob-chips input { border: none; outline: none; flex: 1; min-width: 120px; font-size: 12.5px; padding: 3px 2px; font-family: inherit; background: transparent; }
.ob-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--line2); border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 12px; color: var(--ink2); }
.ob-chip button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.ob-chip button:hover { color: var(--ink); }
.ob-topiclist { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ob-topic { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.ob-topic-main { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ob-topic-main button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.ob-topic-main button:hover { color: var(--down); }
.ob-topic-why { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.ob-empty { font-size: 12.5px; color: var(--muted); padding: 14px 0; text-align: center; grid-column: 1 / -1; }
.ob-slider-row { margin-bottom: 18px; }
.ob-slider-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink2); font-weight: 500; margin-bottom: 4px; }
.ob-slider-val { color: var(--ink); }
.ob-slider-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ob-slider-row input[type=range] { width: 100%; accent-color: var(--ink); }
.ob-seg { display: flex; gap: 7px; margin: 4px 0 14px; }
.ob-seg-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 12.5px; color: var(--ink2); cursor: pointer; font-family: inherit; }
.ob-seg-btn.on { border-color: var(--ink); color: var(--ink); font-weight: 500; background: var(--line2); }
.ob-preview { background: var(--bg); border: 1px solid var(--line2); border-radius: 11px; padding: 12px 14px; font-size: 12.5px; color: var(--ink2); line-height: 1.7; }
.ob-preview-t { font-weight: 500; margin-bottom: 2px; }
.ob-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ob-colcard { border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.ob-colcard-t { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.ob-colcard-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.ob-mklist { display: flex; flex-wrap: wrap; gap: 7px; }
.ob-mk { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 13px; font-size: 12.5px; color: var(--ink2); cursor: pointer; font-family: inherit; }
.ob-mk.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.ob-ptable-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 340px; }
.ob-ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ob-ptable th { position: sticky; top: 0; background: var(--bg); text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ob-ptable td { padding: 7px 10px; border-bottom: 1px solid var(--line2); color: var(--ink2); }
.ob-ptable tr:last-child td { border-bottom: none; }
.ob-row-off { opacity: .45; }
.ob-td-check { width: 30px; text-align: center; }
.ob-td-del { width: 30px; text-align: center; }
.ob-td-del button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.ob-td-del button:hover { color: var(--down); }
.ob-td-topic { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.ob-ptag { display: inline-block; font-size: 11px; background: var(--line2); border-radius: 6px; padding: 1px 7px; color: var(--ink2); }
.ob-ptag-b { background: #EEEDFE; color: #3C3489; }
.ob-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.ob-foot-r { display: flex; align-items: center; gap: 14px; }
.ob-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .85); border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--ink2); z-index: 5; }
.ob-spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: obSpin .8s linear infinite; }
@keyframes obSpin { to { transform: rotate(360deg); } }
@media (max-width: 720px) { .ob-twocol, .ob-topiclist { grid-template-columns: 1fr; } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(17,17,16,.28); z-index: 110;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: min(520px, 94vw); background: #fff; border-radius: 16px; padding: 20px 22px;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.5); animation: pop .16s ease-out;
}
.modal h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.modal .m-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.pill-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }

.progress-toast { min-width: 260px; }
.progress-toast .bar { height: 4px; background: rgba(255,255,255,.18); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress-toast .bar i { display: block; height: 100%; background: var(--lime); transition: width .3s; }

.switch-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.switch-row:last-child { border-bottom: none; }
.switch-row .grow { flex: 1; min-width: 0; }
.engine-name { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.engine-meta { font-size: 10.5px; color: var(--faint); margin-top: 2px; }

.tag-click { cursor: pointer; }
.hint { font-size: 11px; color: var(--faint); line-height: 1.65; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

/* ---------- 开放 API ---------- */
.code-block {
  background: #FAFAF6; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.8; color: var(--ink2);
  white-space: pre-wrap; word-break: break-all;
}
.key-reveal {
  background: var(--lime); border: 1px solid #C6DE55; border-radius: 10px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.6; word-break: break-all; color: #1F2A00;
}

/* ---------- 接入向导 ---------- */
.modal.wide { width: min(940px, 96vw); padding: 0; overflow: hidden; }
.wiz { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: minmax(0, 1fr); max-height: 84vh; }
.wiz-nav { background: var(--bg); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; min-height: 0; }
.wiz-nav-title { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.wiz-nav-sub { font-size: 10.5px; color: var(--faint); margin: 3px 0 14px; line-height: 1.5; }
.wiz-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid transparent;
  background: transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; margin-bottom: 3px; font: inherit; color: inherit; }
.wiz-item:hover { background: #fff; }
.wiz-item.on { background: #fff; border-color: var(--line); box-shadow: 0 4px 14px -10px rgba(0,0,0,.4); }
.wiz-item .n { width: 18px; height: 18px; border-radius: 50%; background: var(--line2); color: var(--muted);
  font-size: 10px; display: grid; place-items: center; flex: none; }
.wiz-item.on .n { background: var(--lime); color: var(--ink); }
.wiz-item .t { font-size: 12px; font-weight: 500; }
.wiz-item .s { font-size: 10px; color: var(--faint); margin-top: 1px; }
.wiz-nav-foot { font-size: 10px; color: var(--faint); line-height: 1.6; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.wiz-body { padding: 20px 24px 22px; overflow-y: auto; min-height: 0; min-width: 0; }
.wiz-body h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -.015em; }
.wiz-vendor { font-size: 11px; color: var(--faint); margin-bottom: 12px; }
.wiz-lead { font-size: 12.5px; line-height: 1.72; color: var(--ink); background: #FBFAF4;
  border: 1px solid var(--line2); border-left: 2px solid var(--lime); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.wiz-chip { font-size: 10.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line2);
  border-radius: 20px; padding: 3px 9px; }
.wiz-chip b { color: var(--ink); font-weight: 500; }
.wiz-sec { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
.wiz-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.wiz-steps li { counter-increment: st; position: relative; padding-left: 26px; font-size: 12px; line-height: 1.75;
  color: var(--ink); margin-bottom: 7px; }
.wiz-steps li::before { content: counter(st); position: absolute; left: 0; top: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: 9.5px; display: grid; place-items: center; }
.wiz-steps li code, .wiz-gotcha code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 4px; }
.wiz-gotcha { background: #FFFBF0; border: 1px solid #F0E2BE; border-radius: 8px; padding: 10px 12px; margin-top: 4px; }
.wiz-gotcha div { font-size: 11.5px; line-height: 1.7; color: #6B5423; padding-left: 12px; position: relative; }
.wiz-gotcha div::before { content: '·'; position: absolute; left: 2px; font-weight: 700; }
.wiz-note { font-size: 11px; line-height: 1.7; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 9px 11px; }
.wiz-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wiz-form .full { grid-column: 1 / -1; }
.wiz-form label { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.wiz-form input, .wiz-form select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  font-size: 11.5px; background: #fff; color: var(--ink); outline: none; }
.wiz-form input:focus, .wiz-form select:focus { border-color: #C9D18A; box-shadow: 0 0 0 3px rgba(216,242,107,.28); }
.wiz-form .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wiz-test { margin-top: 12px; border-radius: 8px; border: 1px dashed var(--line); padding: 11px 12px; font-size: 11.5px; line-height: 1.7; }
.wiz-test.ok { border-style: solid; border-color: #CDE3B4; background: #F7FCF2; }
.wiz-test.bad { border-style: solid; border-color: #F0CFCA; background: #FFF7F6; }
.wiz-test .kv { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); margin: 6px 0; }
.wiz-test .kv b { color: var(--ink); font-weight: 600; }
.wiz-test .sample { background: #fff; border: 1px solid var(--line2); border-radius: 6px; padding: 8px 9px;
  font-size: 11px; color: #3A3A36; max-height: 92px; overflow: auto; white-space: pre-wrap; }
.wiz-test .cite { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-foot { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 18px -24px -22px; padding: 12px 24px 16px; background: #fff; border-top: 1px solid var(--line2);
  box-shadow: 0 -10px 18px -14px rgba(0,0,0,.35); }
.wiz-foot .right { display: flex; gap: 8px; }
.btn.attention { box-shadow: 0 0 0 3px rgba(216,242,107,.55); }
@media (max-width: 760px) {
  .wiz { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); max-height: 88vh; }
  .wiz-nav { border-right: none; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; padding: 12px; }
  .wiz-nav-title, .wiz-nav-sub, .wiz-nav-foot { display: none; }
  .wiz-item { white-space: nowrap; margin: 0; }
  .wiz-form { grid-template-columns: 1fr; }
}

/* ============================================================
   Agent 问答
   ============================================================ */
.agent-wrap { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; }
.agent-msgs { flex: 1; overflow-y: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 14px; }
.msg-row { display: flex; gap: 10px; max-width: 88%; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava { flex: none; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; background: var(--panel); border: 1px solid var(--line); }
.msg-row.user .msg-ava { background: var(--ink); color: #fff; border-color: var(--ink); }
.bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; font-size: 13px; line-height: 1.75; min-width: 0; }
.msg-row.user .bubble { background: var(--ink); color: #fff; border-color: var(--ink); }
.msg-row.user .bubble a { color: #fff; }
.bubble .md > *:first-child { margin-top: 0; }
.bubble .md > *:last-child { margin-bottom: 0; }
.bubble .md p { margin: 0 0 8px; }
.bubble .md h3 { font-size: 13.5px; margin: 12px 0 6px; }
.bubble .md h4 { font-size: 13px; margin: 10px 0 5px; color: var(--muted); }
.bubble .md ul, .bubble .md ol { margin: 0 0 8px; padding-left: 20px; }
.bubble .md li { margin: 2px 0; }
.bubble .md table { border-collapse: collapse; margin: 4px 0 10px; font-size: 12px; }
.bubble .md th, .bubble .md td { border: 1px solid var(--line); padding: 4px 9px; text-align: left; }
.bubble .md th { background: var(--bg); font-weight: 600; }
.bubble .md code { background: var(--line2); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.bubble .md a { color: var(--blue, #2F6BFF); }
.msg-meta { font-size: 10.5px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pack-details { margin-top: 6px; font-size: 11px; }
.pack-details summary { cursor: pointer; color: var(--muted); user-select: none; }
.pack-details pre { white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; margin-top: 6px; max-height: 220px; overflow: auto; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.think { display: inline-flex; gap: 4px; padding: 4px 2px; }
.think i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: think 1s infinite ease-in-out; }
.think i:nth-child(2) { animation-delay: .15s; }
.think i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.agent-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.agent-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font-size: 12px; color: var(--ink); cursor: pointer; transition: .14s; }
.agent-chip:hover { border-color: var(--ink); }
.agent-inputbar { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.agent-inputbar textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; font-family: inherit; background: var(--panel); color: var(--ink); max-height: 120px; }
.agent-inputbar textarea:focus { outline: none; border-color: var(--ink); }
.agent-err { border-color: #E8613C; color: #B33A1A; }

/* 技能栏 + 记忆 */
.agent-skills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 2px 2px; border-top: 1px dashed var(--line); margin-top: 2px; }
.agent-skills-label { font-size: 11.5px; color: var(--muted); flex: none; }
.remember-btn { align-self: flex-start; margin-top: 4px; background: none; border: none; color: var(--muted); font-size: 10.5px; cursor: pointer; padding: 2px 4px; opacity: 0; transition: opacity .14s; }
.msg-row.user:hover .remember-btn { opacity: 1; }
.remember-btn:hover { color: var(--ink); text-decoration: underline; }
.mem-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg); }
.mem-content { flex: 1; font-size: 12.5px; line-height: 1.6; word-break: break-all; }
.mem-ops { display: flex; align-items: center; gap: 5px; flex: none; }

/* ---------- 知识库（答案快照）---------- */
.lib-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 10px; border-bottom: 1px solid var(--line2);
  cursor: pointer; border-radius: 10px; transition: background .14s;
}
.lib-row:last-child { border-bottom: none; }
.lib-row:hover { background: #FBFAF5; }
.lib-side { width: 96px; flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lib-day { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.lib-q { font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.lib-a {
  font-size: 12.2px; color: var(--muted); line-height: 1.72; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lib-q mark, .lib-a mark { background: var(--lime); color: inherit; border-radius: 3px; padding: 0 2px; }
.lib-meta { display: flex; gap: 10px; align-items: center; margin-top: 7px; font-size: 10.5px; color: var(--faint); flex-wrap: wrap; }
.lib-chev { flex: none; color: #C6C3B6; margin-top: 4px; }
.lib-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lib-toolbar .input { max-width: none; }
.lib-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.lib-filters .seg button { padding: 5px 10px; white-space: nowrap; }
.lib-snip { font-size: 12.6px; line-height: 1.85; color: var(--ink2); }

/* ---------- 需求工坊 ---------- */
.sc {
  display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sc-hi { background: #111110; color: #fff; }
.sc-mid { background: #EAF1FF; color: #2F6BFF; }
.sc-low { background: #F2F0E9; color: var(--muted); }
.row-out { opacity: .42; }
.row-out .cell-strong { text-decoration: line-through; }
.tbl tbody tr:hover { background: #FBFAF5; }

/* ---------- 极简导航：3 个主入口 + 「更多」 ----------
   产品方向：把 11 个平铺入口收成 3 个每天都会看的（总览/问题/竞品），
   其余放进可折叠的「更多」，默认不打扰。 */
.nav-more-btn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  margin: 10px 0 2px; padding: 7px 10px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font-size: 11.5px; color: var(--muted); letter-spacing: .02em;
  font-family: inherit; text-align: left;
}
.nav-more-btn:hover { background: #EDEBE3; color: var(--ink2); }
.nav-more-btn svg { margin-left: auto; transition: transform .16s; color: var(--faint); }
.nav-more-btn.open svg { transform: rotate(180deg); }
.nav-more { display: grid; gap: 1px; }
.nav-more[hidden] { display: none; }
.nav-more .nav-item { font-size: 12.5px; color: var(--muted); padding: 7px 10px; }
.nav-more .nav-item .lbl { font-weight: 400; }
.nav-more .nav-item.active { background: #EDEBE3; color: var(--ink); font-weight: 500; }

/* ---------- 抓取成本单 ---------- */
.cost-modal { max-width: 440px; }
.cost-list { display: grid; gap: 8px; margin: 16px 0 10px; }
.cost-tier {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-family: inherit; transition: border-color .14s, background .14s;
}
.cost-tier:hover { border-color: var(--ink); background: #FBFAF5; }
.ct-main { display: grid; gap: 2px; }
.ct-main b { font-size: 13.5px; }
.ct-main span { font-size: 11.5px; color: var(--muted); }
.ct-num { font-size: 11.5px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-foot { font-size: 11px; color: var(--faint); line-height: 1.7; }

/* ---------- 竞品发现（从真实回答里挖出来的品牌） ---------- */
.disc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.disc-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-family: inherit; transition: border-color .14s, background .14s;
}
.disc-item:hover { border-color: var(--ink); background: #FBFAF5; }
.disc-item:disabled { opacity: .55; cursor: default; }
.di-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.di-count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.di-add { margin-left: auto; font-size: 11.5px; color: var(--ink2); white-space: nowrap; }

/* ---------- Prompt 建议弹窗 ---------- */
.sug-list { display: grid; gap: 7px; max-height: 46vh; overflow: auto; margin: 14px 0 6px; padding-right: 4px; }
.sug-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.sug-item:hover { background: #FBFAF5; }
.sug-item input { margin-top: 3px; flex: none; }
.sug-main { display: grid; gap: 5px; min-width: 0; }
.sug-text { font-size: 13px; line-height: 1.55; color: var(--ink); }
.sug-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sug-dots { font-size: 9px; letter-spacing: 1px; color: var(--ink2); }
.sug-loading { display: grid; place-items: center; padding: 30px 0 10px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--ink);
  animation: sug-spin .8s linear infinite;
}
@keyframes sug-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- 首轮检测发射台（空总览的衔接页） ---------- */
.launch { max-width: 720px; padding: 28px 28px 24px; }
.launch-head { margin-bottom: 18px; }
.launch-head .card-title { font-size: 19px; }
.launch-step {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; margin-bottom: 9px;
}
.launch-step.done { border-color: #DDE9DC; background: #F7FBF7; }
.launch-step.todo { border-style: dashed; }
.ls-ico {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.launch-step.done .ls-ico { background: #12A594; color: #fff; }
.launch-step.todo .ls-ico { background: #EDEBE3; color: var(--muted); }
.ls-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ls-main b { font-size: 13.5px; font-weight: 620; }
.ls-main span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.launch-cta { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.launch-cta .btn-dark { padding: 11px 22px; font-size: 14px; }
.launch-est { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 总览改版：KPI 瘦身条 + 矩阵 + 差距 + 行动 + 回答流 ---------- */
.kpi-strip { display: flex; gap: 0; padding: 14px 20px; flex-wrap: wrap; }
.kpi-strip .ks { flex: 1; min-width: 110px; display: flex; flex-direction: column; gap: 2px; padding: 0 14px; border-left: 1px solid var(--line); }
.kpi-strip .ks:first-child { border-left: none; }
.kpi-strip .ks b { font-size: 19px; font-weight: 640; letter-spacing: -.02em; }
.kpi-strip .ks span { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.kpi-strip .ks i { font-style: normal; font-size: 11px; }
.kpi-strip .ks i.up { color: var(--down, #C2410C); }
.kpi-strip .ks i.down { color: #16A34A; }
.row-us td { background: #FBFBF4; }
.matrix-tbl td { padding: 11px 12px; }
.matrix-tbl .cell-weak b { color: var(--down, #C2410C); }
.matrix-tbl .cell-weak { background: #FDF6F3; }
.thin-note { padding: 14px 20px; font-size: 12.5px; color: var(--muted); }
.gap-list { display: flex; flex-direction: column; gap: 10px; }
.gap-line { font-size: 13px; line-height: 1.65; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.gap-line b { font-weight: 620; }
.act-list { display: flex; flex-direction: column; gap: 10px; }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.act-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-main b { font-size: 13px; font-weight: 620; }
.act-main span { font-size: 12px; color: var(--muted); line-height: 1.55; }
.ra-list { display: flex; flex-direction: column; gap: 9px; }
.ra-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ra-eng { flex: none; width: 64px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding-top: 2px; }
.ra-eng i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ra-main { flex: 1; min-width: 0; }
.ra-main .ra-q { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 2px; }
.ra-main p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.ra-row .tag { flex: none; }
