/* 飞轮增长平台 · 设计系统 v1.2
   参考主流 SaaS / 互联网产品：中性灰底 + 白色内容面板、单一品牌色只用于行动与选中态、
   边框优先（少用阴影）、4px 栅格、统一 14px 正文与 20px 页面标题、信息按「标题 → 摘要 → 元数据」分层 */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e6e8ec;
  --border-strong: #d4d8df;
  --text: #1f2329;
  --text-2: #4e5969;
  --text-3: #86909c;
  --primary: #3b5bfd;
  --primary-600: #2c47e0;
  --primary-50: #eef1ff;
  --primary-100: #dde4ff;
  --success: #12a150;
  --success-50: #e8f8ee;
  --warning: #d97706;
  --warning-50: #fff5e6;
  --danger: #e5484d;
  --danger-50: #fff0f0;
  --info: #0b8fd6;
  --info-50: #e7f5fd;
  --muted: #6b7280;
  --muted-50: #f2f3f5;
  --violet: #7c3aed;
  --violet-50: #f3efff;
  --hot: #ef4444;
  --warm: #f59e0b;
  --cool: #64748b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --appbar-h: 56px;
  --sidebar-w: 216px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; line-height: 1.35; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
svg.icon { flex: none; vertical-align: -3px; }
::selection { background: var(--primary-100); }

/* ---------------- 应用外壳：顶栏 + 侧边栏 + 内容 ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 150; height: var(--appbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 20px 0 16px; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.appbar .brand { width: calc(var(--sidebar-w) - 16px); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, #5b7cff 0%, #3b5bfd 50%, #12b5a5 100%);
}
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-search {
  flex: 0 1 420px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; transition: border-color .12s, box-shadow .12s, background .12s;
}
.appbar-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: 14px var(--font); }
.appbar-search input::placeholder { color: var(--text-3); }
.appbar-search:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.appbar-search kbd { font: 11px/18px var(--mono); padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-3); }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.appbar .appbar-menu, .appbar .appbar-search-btn { display: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border); white-space: nowrap;
}
.status-pill:hover { color: var(--text); border-color: var(--border-strong); }
.status-pill.mock { color: #9a5a05; background: var(--warning-50); border-color: #fbe1b6; }
.status-pill.bad { color: #b42318; background: var(--danger-50); border-color: #f9cfcf; }
.avatar-btn { display: grid; place-items: center; border-radius: 50%; }
.avatar-btn:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 2px; }

.app { display: flex; min-height: calc(100vh - var(--appbar-h)); }
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: var(--appbar-h); height: calc(100vh - var(--appbar-h));
  display: flex; flex-direction: column; padding: 10px 10px 8px; background: var(--surface); border-right: 1px solid var(--border);
}
.nav { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.nav-group { font-size: 12px; color: var(--text-3); padding: 18px 10px 6px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin: 1px 0;
  border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s;
}
.nav-item .icon { color: var(--text-3); transition: color .12s; }
.nav-item:hover { background: var(--muted-50); color: var(--text); }
.nav-item:hover .icon { color: var(--text-2); }
.nav-item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.nav-item.active .icon { color: var(--primary); }
.nav-item .nav-badge {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; background: var(--muted-50); color: var(--text-2);
}
.nav-item .nav-badge.alert { background: var(--danger-50); color: var(--danger); }
.nav-item.active .nav-badge { background: var(--primary-100); color: var(--primary); }
.sidebar-foot { padding: 10px 10px 2px; border-top: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.mode-pill.mock { background: var(--warning-50); color: var(--warning); }
.mode-pill.live { background: var(--success-50); color: var(--success); }
.mode-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.main { flex: 1; min-width: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px 32px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-weight: 600; }
.page-head .sub { color: var(--text-3); margin-top: 4px; font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumb { display: flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------------- 下拉菜单（details 实现，无需 JS 也可用） ---------------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; min-width: 272px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: menu-in .12s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--muted-50); color: var(--text); }
.menu-item .icon { margin-top: 2px; color: var(--text-3); }
.menu-item b { display: block; font-weight: 500; font-size: 13.5px; line-height: 1.4; }
.menu-item small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.4; margin-top: 1px; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu form { margin: 0; }

/* ---------------- 栅格 ---------------- */
.grid { display: grid; gap: 16px; }
.grid > *, .stack > *, .review > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cols-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; } .clamp-3 { -webkit-line-clamp: 3; }
.mono { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .hint { color: var(--text-3); font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.card-body { padding: 16px 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
a.card { color: inherit; display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

/* ---------------- KPI ---------------- */
.kpi { padding: 16px 18px; }
.kpi-label { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 0 6px; flex-wrap: wrap; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.kpi-value small { font-size: 14px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.kpi-foot { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.delta { font-weight: 600; font-size: 12.5px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--text-3); }

/* ---------------- 徽标 / 标签 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: var(--muted-50); color: var(--muted); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; background: var(--muted-50); color: var(--text-2); white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.plat { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; }
.prio { display: inline-grid; place-items: center; min-width: 42px; height: 26px; padding: 0 8px; border-radius: 7px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.prio.hot { background: #fff0ef; color: var(--hot); }
.prio.warm { background: #fff7e8; color: #d97706; }
.prio.cool { background: var(--muted-50); color: var(--cool); }
.tag { color: var(--primary); background: var(--primary-50); border-radius: 5px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--muted-50); color: var(--text); }
.btn:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0e8a44; color: #fff; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-50); color: var(--danger); border-color: #f7c6c7; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--muted-50); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 32px; padding: 0; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
form.inline { display: inline; }

/* ---------------- 表单 ---------------- */
.input, .select, .textarea {
  width: 100%; height: 32px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 13.5px var(--font); transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input-sm, .select-sm { height: 30px; font-size: 13px; }
.select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d95a5' stroke-width='2.4' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .help { font-size: 12px; color: var(--text-3); }
.field .req { color: var(--danger); margin-left: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 9px; color: var(--text-3); }
.search .input { padding-left: 32px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* 可选卡片（平台 / 调性 / 选题多选） */
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .choice-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s; height: 100%; }
.choice:hover .choice-box { border-color: var(--primary-100); }
.choice input:checked + .choice-box { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(59, 91, 253, .08); }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--primary-100); }
.choice .choice-title { font-weight: 600; font-size: 13.5px; }
.choice .choice-desc { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* 分段控件 */
.segmented { display: inline-flex; padding: 3px; background: var(--muted-50); border-radius: 9px; gap: 2px; }
.segmented a, .segmented label { padding: 4px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.segmented a.active, .segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.segmented label { padding: 0; }
.segmented label span { display: block; padding: 4px 12px; border-radius: 7px; }
.segmented input { display: none; }

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { padding: 10px 2px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 11.5px; background: var(--muted-50); color: var(--text-3); border-radius: 9px; padding: 0 7px; line-height: 18px; }
.tab.active .count { background: var(--primary-50); color: var(--primary); }

/* ---------------- 筛选条 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: 260px; }
.toolbar .select { width: auto; min-width: 120px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: var(--radius); }
.table thead th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.card .table th:first-child, .card .table td:first-child { padding-left: 20px; }
.card .table th:last-child, .card .table td:last-child { padding-right: 20px; }

/* ---------------- 进度 ---------------- */
.progress { height: 6px; border-radius: 4px; background: var(--muted-50); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.progress.success > span { background: var(--success); }
.stackbar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--muted-50); }
.stackbar > span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; margin: 8px 0; }
.bar-row .bar { height: 8px; border-radius: 4px; background: var(--muted-50); overflow: hidden; }
.bar-row .bar > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--muted-50); color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------------- 提示 / 弹窗 ---------------- */
.toast-wrap { position: fixed; top: calc(var(--appbar-h) + 12px); right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--border); font-size: 13.5px; animation: toast-in .2s ease-out; }
.toast.ok .icon { color: var(--success); }
.toast.err .icon { color: var(--danger); }
.toast.warn .icon { color: var(--warning); }
.toast.hide { opacity: 0; transform: translateY(-6px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-info { background: var(--info-50); color: #0a6aa0; border-color: #cbe8f8; }
.alert-warning { background: var(--warning-50); color: #9a5a05; border-color: #fbe1b6; }
.alert-danger { background: var(--danger-50); color: #b42318; border-color: #f9cfcf; }
.alert-success { background: var(--success-50); color: #0b7a3b; border-color: #c4ecd3; }
dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(17, 24, 39, .38); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------------- 列表 ---------------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: #fbfcfe; color: inherit; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; }
.quote { position: relative; padding: 10px 14px 10px 16px; background: var(--surface-2); border-left: 3px solid var(--primary-100); border-radius: 0 8px 8px 0; color: var(--text-2); }
.quote.lg { font-size: 15.5px; color: var(--text); padding: 14px 18px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 9px 12px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.section-title { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin: 0 0 8px; letter-spacing: .02em; }

/* ---------------- 工作台：飞轮 ---------------- */
.flywheel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: stretch; }
.fw-arrow { display: grid; place-items: center; color: var(--border-strong); }
.fw-stage { padding: 18px; }
.fw-stage .fw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fw-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.fw-icon.c1 { background: #fff1ef; color: #ef5a3c; }
.fw-icon.c2 { background: var(--primary-50); color: var(--primary); }
.fw-icon.c3 { background: #e8faf6; color: #0f9f8f; }
.fw-stage .fw-title { font-weight: 600; }
.fw-stage .fw-desc { font-size: 12px; color: var(--text-3); }
.fw-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fw-metrics .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fw-metrics .l { font-size: 12px; color: var(--text-3); }
.todo { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: #fbfcfe; color: var(--text); }
.todo .todo-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.todo .todo-count { font-size: 18px; font-weight: 650; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.todo.done { color: var(--text-3); }

/* ---------------- 痛点卡片 ---------------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 12px; }
.pcard.rejected { opacity: .62; }
.pcard .pc-top { display: flex; align-items: flex-start; gap: 10px; }
.pcard .pc-title { font-weight: 600; font-size: 14.5px; line-height: 1.45; color: var(--text); flex: 1; }
.pcard .pc-title:hover { color: var(--primary); }
.pcard .pc-quote { font-size: 13px; color: var(--text-2); }
.pcard .pc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pcard .pc-foot { display: flex; align-items: center; gap: 6px; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: auto; }
.pcard .pc-select { position: absolute; top: 12px; right: 12px; }
.pcard .pc-select input { width: 15px; height: 15px; accent-color: var(--primary); }
.bulkbar { position: sticky; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: #1d2330; color: #fff; box-shadow: var(--shadow-lg); }
.bulkbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .2); }
.score-row { display: grid; grid-template-columns: 70px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; margin: 9px 0; }
.score-row .bar { height: 7px; border-radius: 4px; background: var(--muted-50); overflow: hidden; }
.score-row .bar > span { display: block; height: 100%; border-radius: 4px; }
.ring { --p: 50; --c: var(--primary); width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--muted-50) 0); }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 22px; font-weight: 700; }

/* ---------------- 审核台 ---------------- */
.review { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.review-list { position: sticky; top: calc(var(--appbar-h) + 16px); max-height: calc(100vh - var(--appbar-h) - 32px); display: flex; flex-direction: column; }
.review-list .list { overflow-y: auto; }
.ritem { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); border-left: 3px solid transparent; }
.ritem:hover { background: #fbfcfe; color: var(--text); }
.ritem.active { background: var(--primary-50); border-left-color: var(--primary); }
.ritem .grow { min-width: 0; flex: 1; }
.ritem .t { font-weight: 500; font-size: 13.5px; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist .ck { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.checklist .ck .icon { margin-top: 2px; }
.checklist .ck.pass .icon { color: var(--success); }
.checklist .ck.fail .icon { color: var(--danger); }
.checklist .ck.warn .icon { color: var(--warning); }
.title-options label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin-bottom: 6px; font-size: 13.5px; }
.title-options label:hover { border-color: var(--primary-100); }
.title-options input { margin-top: 4px; accent-color: var(--primary); }
.editor { font-size: 14px; line-height: 1.85; min-height: 380px; }
.wordcount { font-size: 12px; color: var(--text-3); }
.wordcount.bad { color: var(--danger); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--surface) 70%, rgba(255, 255, 255, 0)); padding-top: 12px; }

/* ---------------- 产品矩阵 ---------------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.prod { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.prod-head { display: flex; gap: 12px; align-items: flex-start; }
.prod-avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 16px; }
.prod-name { font-weight: 600; font-size: 15px; color: var(--text); }
.prod-score { margin-left: auto; text-align: right; }
.prod-score .s { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.prod-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prod-kpis .v { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }
.prod-kpis .l { font-size: 12px; color: var(--text-3); }
.prod-foot { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.prod-foot b { color: var(--text); font-weight: 600; }
.spark { display: block; }
.chart { width: 100%; min-height: 320px; }
.chart.sm { min-height: 240px; }

/* ---------------- 文档 / Markdown ---------------- */
.prose { line-height: 1.8; color: var(--text); }
.prose h1 { font-size: 20px; margin: 4px 0 14px; }
.prose h2 { font-size: 16px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 14.5px; margin: 18px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 10px; }
.prose blockquote { margin: 8px 0 14px; padding: 8px 14px; background: var(--surface-2); border-left: 3px solid var(--primary-100); color: var(--text-2); border-radius: 0 8px 8px 0; }
.prose table { border-collapse: collapse; margin: 8px 0 14px; font-size: 13px; width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 500; }
.prose code { background: var(--muted-50); padding: 1px 5px; border-radius: 4px; }
pre.code { background: #0f1422; color: #d6deeb; padding: 14px 16px; border-radius: 10px; overflow: auto; line-height: 1.6; margin: 0; }
.body-preview { white-space: pre-wrap; line-height: 1.85; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
  .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main, .cols-wide { grid-template-columns: minmax(0, 1fr); }
  .flywheel { grid-template-columns: minmax(0, 1fr); }
  .fw-arrow { transform: rotate(90deg); height: 18px; }
}
@media (min-width: 900px) and (max-width: 1200px) {
  /* 笔记本 / 平板横屏：指标卡保持一行，不把审核台、商机列表挤到第二屏 */
  .cols-4:has(> .kpi) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols-5:has(> .kpi) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cols-4:has(> .kpi) > .kpi, .cols-5:has(> .kpi) > .kpi { padding: 12px 14px; }
  .cols-4:has(> .kpi) .kpi-value, .cols-5:has(> .kpi) .kpi-value { font-size: 22px; }
}
@media (max-width: 1024px) and (min-width: 769px) {
  /* 平板：侧边栏收成图标栏，顶栏品牌只留图标 */
  :root { --sidebar-w: 64px; }
  .appbar .brand { width: auto; }
  .appbar .brand-name, .nav-group, .nav-item span.lbl, .nav-badge, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .review { grid-template-columns: minmax(0, 1fr); }
  .review-list { position: static; max-height: 320px; }
  .status-pill .status-text { display: none; }
}
@media (max-width: 720px) {
  .cols-2, .cols-3, .cols-4, .cols-5, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .search { width: 100%; }
}

/* ---------------- 开关 ---------------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary-100); outline-offset: 2px; }

/* ---------------- 局部刷新 ---------------- */
.container.is-loading { opacity: .65; transition: opacity .12s; pointer-events: none; }
.src-fields { display: none; }
.src-fields.active { display: contents; }

/* ================= 手机端适配（≤ 768px）=================
   顶栏（菜单 / 品牌 / 搜索 / 新建 / 头像）+ 抽屉式导航；单列布局；输入框 16px 防止 iOS 聚焦放大；表格横向滚动；触控目标 ≥ 36px */
.nav-overlay { display: none; }
@media (max-width: 768px) {
  :root { --sidebar-w: 268px; --appbar-h: 52px; }
  body { -webkit-text-size-adjust: 100%; }
  .appbar { gap: 6px; padding: 0 8px; padding-top: env(safe-area-inset-top); }
  .appbar .appbar-menu, .appbar .appbar-search-btn { display: inline-flex; }
  .appbar .brand { width: auto; flex: 1; min-width: 0; }
  .appbar .brand-mark { width: 28px; height: 28px; }
  .appbar-search { display: none; }
  .appbar-right { gap: 4px; }
  .status-pill { width: 30px; padding: 0; justify-content: center; }
  .status-pill .status-text, .hide-sm { display: none; }
  .appbar .menu > summary.btn { width: 34px; padding: 0; }
  .menu-panel { position: fixed; top: calc(var(--appbar-h) + 6px); left: 8px; right: 8px; min-width: 0; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 200; width: var(--sidebar-w);
    padding: 14px 12px calc(12px + env(safe-area-inset-bottom)); transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; z-index: 190; background: rgba(17, 24, 39, .35); }
  body.nav-open { overflow: hidden; }
  .sidebar .nav-item { padding: 0 12px; height: 42px; }

  .container { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  h1 { font-size: 19px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .page-head .actions { justify-content: flex-start; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .breadcrumb { font-size: 12.5px; }

  .grid { gap: 12px; }
  .cols-2, .cols-3, .cols-main, .cols-wide, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 21px; }
  .card-head { padding: 12px 14px; flex-wrap: wrap; }
  .card-body { padding: 14px; }
  .list-item, .todo { padding: 12px 14px; }

  .flywheel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px 14px; padding: 0 14px 4px; scrollbar-width: none; }
  .flywheel::-webkit-scrollbar { display: none; }
  .fw-stage { flex: 0 0 84%; scroll-snap-align: start; padding: 14px; }
  .fw-arrow { display: none; }
  .fw-stage .fw-head { margin-bottom: 10px; }
  .fw-metrics .v { font-size: 18px; }

  .pcards, .products { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .prod-kpis .v { font-size: 14px; }

  .toolbar { gap: 8px; }
  .toolbar .search { width: 100%; order: -1; }
  .toolbar .select { flex: 1 1 40%; min-width: 0; }
  .toolbar .spacer { display: none; }

  .input, .select, .textarea { font-size: 16px; height: 40px; }
  .textarea { height: auto; }
  .btn { height: 38px; }
  .btn-sm { height: 34px; }
  .btn-xs { height: 32px; padding: 0 10px; }
  .btn-icon { width: 38px; }
  .switch { transform: scale(1.1); }

  .tabs { gap: 18px; -webkit-overflow-scrolling: touch; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .segmented { max-width: 100%; overflow-x: auto; }

  .card > table.table, .card-body > table.table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 10px 12px; white-space: nowrap; }
  .table td.small, .table td[style*="max-width"] { white-space: normal; min-width: 180px; }

  .review { grid-template-columns: minmax(0, 1fr); }
  .review-list { position: static; max-height: 42vh; }
  .review .grid { grid-template-columns: 1fr !important; }
  .editor { min-height: 260px; }
  .sticky-actions { position: sticky; bottom: env(safe-area-inset-bottom); background: var(--surface); padding: 10px 0; flex-wrap: wrap; }

  dialog.modal, dialog.modal.wide { width: calc(100vw - 16px); max-width: none; margin: auto auto 8px; border-radius: 14px; }
  .modal-body { max-height: 70vh; }
  .modal-foot .btn { flex: 1; }

  .bulkbar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .toast-wrap { left: 10px; right: 10px; top: calc(var(--appbar-h) + 8px + env(safe-area-inset-top)); }
  .toast { min-width: 0; max-width: none; }
  .chart { min-height: 260px; }
  .kv { grid-template-columns: 76px 1fr; }
  .ring { width: 72px; height: 72px; }
  .ring > div { width: 56px; height: 56px; font-size: 19px; }
  .auth-card { padding: 22px 18px; }
}

/* ================= 登录 / 初始化 ================= */
.auth-body { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 500px at 10% -10%, #e9edff 0%, transparent 60%), radial-gradient(900px 400px at 110% 110%, #e3f7f3 0%, transparent 55%), var(--bg); }
.auth-wrap { width: min(400px, calc(100vw - 32px)); padding: 24px 0; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 36px; height: 36px; }
.auth-brand .brand-name { font-size: 18px; font-weight: 650; }
.auth-card { padding: 28px 26px; margin-bottom: 14px; }
.auth-card h1 { font-size: 20px; }
.auth-submit { width: 100%; height: 40px; margin-top: 6px; }
.demo-cred { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.demo-cred .mono { user-select: all; color: var(--text); }

/* ---------------- 模型状态点 / 头像 ---------------- */
.health-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9cdd4; flex: none; }
.health-dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-50); }
.health-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-50); animation: pulse 1.6s infinite; }
.health-dot.mock { background: var(--warning); box-shadow: 0 0 0 3px #fde9c8; }
.health-dot.unknown { background: #c9cdd4; }
.health-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-50); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, .15); } }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #5b7cff, #12b5a5); color: #fff; font-weight: 600; font-size: 13px; }
.user-avatar:hover { color: #fff; }

/* ---------------- 只读角色：隐藏所有写操作入口（服务端同样强制校验） ---------------- */
body.role-viewer form[method="post" i] button[type="submit"]:not(.allow-viewer),
body.role-viewer button[formmethod="post" i]:not(.allow-viewer),
body.role-viewer [data-dialog],
body.role-viewer .pc-select,
body.role-viewer .c-chk input,
body.role-viewer #bulkbar,
body.role-viewer .viewer-hide { display: none !important; }

/* ---------------- 模型测试结果 ---------------- */
.probe { padding: 0 16px 14px; }
.probe .alert { margin: 0 0 6px; }
.probe-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.probe-row:last-child { border-bottom: 0; }
.probe-row .health-dot { margin-top: 6px; }
.probe-row.bad .tiny:not(.muted) { color: var(--danger); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.search-hit mark { background: #fff3c4; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------------- AI 商机 ---------------- */
.opp-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 230px; gap: 14px; padding: 16px 18px; align-items: start; }
.opp-rank { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 650; font-size: 13px;
  background: var(--primary-50); color: var(--primary); }
.opp-item:nth-child(-n+3) .opp-rank { background: linear-gradient(135deg, #7c3aed, #3b5bfd); color: #fff; }
.opp-idea { font-size: 15.5px; font-weight: 650; color: var(--text); line-height: 1.45; }
a.opp-idea:hover { color: var(--primary); }
.opp-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }
.opp-meta b { font-weight: 600; color: var(--text-3); margin-right: 4px; }
.opp-score { min-width: 52px; height: 40px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center;
  font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: #5b21b6; background: #f3efff; }
.opp-dims { display: grid; gap: 4px; margin-top: 10px; }
.opp-dim { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; }
.opp-dim i { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #7c3aed var(--v), var(--muted-50) var(--v)); }
.opp-card .opp-idea { font-size: 17px; }
.kpi-link:hover { border-color: var(--primary-100); }
@media (max-width: 768px) {
  .opp-item { grid-template-columns: 28px minmax(0, 1fr); }
  .opp-side { grid-column: 1 / -1; }
  .opp-side .row { justify-content: flex-start !important; }
}
.opp-card .score-row { grid-template-columns: 112px 1fr 36px; }

/* ================= v1.2 新组件 ================= */
/* 页面问候 */
.greet h1 { font-size: 22px; }
.greet .sub { font-size: 13.5px; }

/* 增长漏斗（工作台第一屏）：原声 → 痛点 → AI 商机 → 内容 → 营收 */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); }
.funnel-step { position: relative; display: block; padding: 16px 22px 16px 24px; color: var(--text); min-width: 0; }
.funnel-step + .funnel-step { border-left: 1px solid var(--border); }
.funnel-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.funnel-step:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.funnel-step:hover { background: var(--surface-2); color: var(--text); }
.funnel-step + .funnel-step::before {
  content: ""; position: absolute; left: -6px; top: 50%; width: 10px; height: 10px; background: var(--surface);
  border-top: 1px solid var(--border); border-right: 1px solid var(--border); transform: translateY(-50%) rotate(45deg); z-index: 1;
}
.fs-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.fs-label .icon { color: var(--text-3); }
.fs-value { margin-top: 8px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fs-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.fs-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-step.hl .fs-value { color: var(--primary); }

/* 精简待办：只展示需要处理的事项 */
.todo-lite { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: var(--text); border-bottom: 1px solid var(--border); }
.todo-lite:last-child { border-bottom: 0; }
.todo-lite:hover { background: var(--surface-2); color: var(--text); }
.todo-lite .dot { width: 8px; height: 8px; flex: none; }
.todo-lite .t { flex: 1; min-width: 0; font-size: 13.5px; }
.todo-lite .t small { display: block; color: var(--text-3); font-size: 12px; }
.todo-lite .n { font-weight: 650; font-variant-numeric: tabular-nums; }
.all-clear { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: var(--text-2); font-size: 13.5px; }
.all-clear .icon { color: var(--success); }

/* 数据列表行（痛点卡片等）：标题 + 摘要为主，数值右对齐成列，减少徽标噪音 */
.dlist-head, .drow { display: grid; grid-template-columns: 22px 52px minmax(0, 1fr) 132px 56px 64px 76px 118px; gap: 14px; align-items: center; }
.dlist-head { padding: 10px 20px; font-size: 12.5px; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0; }
.dlist-head .num, .drow .num { text-align: right; font-variant-numeric: tabular-nums; }
.drow { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.drow:last-child { border-bottom: 0; }
.drow:hover { background: var(--surface-2); }
.drow.rejected { opacity: .55; }
.drow input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); }
.drow-title { display: block; font-weight: 600; color: var(--text); line-height: 1.45; }
.drow-title:hover { color: var(--primary); }
.drow-sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow-meta { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow-actions { display: flex; gap: 4px; justify-content: flex-end; }
.drow .flag { color: var(--success); margin-left: 6px; vertical-align: -2px; }
.score-pill { display: inline-grid; place-items: center; min-width: 38px; height: 22px; padding: 0 6px; border-radius: 5px; font-size: 12.5px;
  font-weight: 650; font-variant-numeric: tabular-nums; color: var(--violet); background: var(--violet-50); }
.score-pill.empty { color: var(--text-3); background: var(--muted-50); font-weight: 500; }

/* 设置：左侧二级导航 + 右侧内容 */
.settings-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 24px; align-items: start; }
.subnav { position: sticky; top: calc(var(--appbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.subnav a { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.subnav a .icon { color: var(--text-3); }
.subnav a:hover { background: var(--surface); color: var(--text); }
.subnav a.active { background: var(--surface); color: var(--primary); box-shadow: inset 0 0 0 1px var(--border); }
.subnav a.active .icon { color: var(--primary); }
.subnav .subnav-group { font-size: 12px; color: var(--text-3); padding: 14px 12px 4px; }

@media (max-width: 1100px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel-step:nth-child(4) { border-left: 0; }
  .funnel-step:nth-child(n+4) { border-top: 1px solid var(--border); }
  .funnel-step:nth-child(4)::before { display: none; }
  .dlist-head, .drow { grid-template-columns: 22px 52px minmax(0, 1fr) 64px 76px 110px; }
  .dlist-head .c-persona, .drow .c-persona, .dlist-head .c-freq, .drow .c-freq { display: none; }
}
@media (max-width: 768px) {
  .funnel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .funnel::-webkit-scrollbar { display: none; }
  .funnel-step { flex: 0 0 44%; scroll-snap-align: start; padding: 14px 16px; border-top: 0 !important; }
  .funnel-step:nth-child(4) { border-left: 1px solid var(--border); }
  .funnel-step::before { display: none; }
  .fs-value { font-size: 22px; }
  .dlist-head { display: none; }
  .drow { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "chk title score" "chk meta acts"; gap: 6px 10px; padding: 12px 14px; }
  .drow > .c-chk { grid-area: chk; align-self: start; padding-top: 2px; }
  .drow > .c-title { grid-area: title; }
  .drow > .c-opp { grid-area: score; }
  .drow > .c-prio, .drow > .c-persona, .drow > .c-freq { display: none; }
  .drow > .c-status { grid-area: meta; justify-self: start; }
  .drow > .drow-actions { grid-area: acts; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 4px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; }
  .subnav .subnav-group { display: none; }
}

/* 设置页：表单优先，窄屏时右侧说明卡片移到表单下方 */
.settings-main .cols-main { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1400px) { .settings-main .cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) { .card-head .hint { display: none; } }

/* ================= v1.3：互动热度 / 证据 / 复核 ================= */
.heat { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 12px;
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.heat.hot { color: #c2410c; background: #fff1e8; }
.heat.warm { color: #b45309; background: #fff7e6; }
.heat.cool { color: var(--text-2); background: var(--muted-50); }
.drow-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.drow-tags > span:not(.heat) { font-size: 11.5px; color: var(--text-3); background: var(--muted-50); border-radius: 4px; padding: 0 6px; line-height: 18px; }
.drow-tags .heat { height: 18px; font-size: 11.5px; padding: 0 6px; }
.evidence { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.evidence:last-child { border-bottom: 0; }
.ev-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-metrics { font-weight: 500; }
.ev-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.ev-text { line-height: 1.7; }
.ev-url { font-size: 11px; color: var(--text-3); word-break: break-all; }
.ev-images { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-images img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--muted-50); }
.review-box { padding: 14px 16px; border-radius: 10px; background: #f3fbf9; border: 1px solid #cdeee6; }
.review-box .score-pill { color: #0f766e; background: #ddf5ef; }
.rv-list { margin: 4px 0 8px; padding-left: 20px; color: var(--text-2); }
.rv-list li { margin: 2px 0; }
.opp-sources { display: flex; flex-direction: column; gap: 3px; }
.opp-sources a { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.opp-sources a:hover { color: var(--primary); }
.coverage > summary::-webkit-details-marker { display: none; }
.coverage > summary { list-style: none; }
.coverage[open] > summary { border-bottom: 1px solid var(--border) !important; }
@media (max-width: 768px) { .evidence { padding: 12px 14px; } .ev-images img { width: 76px; height: 76px; } }

/* ================= 采集助手 ================= */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.steps li { line-height: 1.7; }
.code-pill { background: var(--muted-50); padding: 3px 8px; border-radius: 6px; }

/* 审查修复：卡片头部内容多时换行而不是挤压标题；超窄屏（< 360px）让出顶栏空间给平台名称 */
.card-head { flex-wrap: wrap; }
.card-head > h2, .card-head > h3 { min-width: 0; }
@media (max-width: 360px) { .appbar .appbar-search-btn { display: none; } }

/* 一次性密钥（API Token / 临时密码）：只读输入框，点一下全选 */
.secret-box { flex: 1; min-width: 0; max-width: 460px; background: var(--surface, #fff); cursor: text; }
.alert .grow { flex: 1; min-width: 0; }

/* ---------- 配图与发布（v1.6） ---------- */
.gallery { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.thumb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb-img { display: block; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); aspect-ratio: 3 / 4; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.thumb-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.pubrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.pubrow:last-of-type { border-bottom: none; }
.pubacc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.pubacc[hidden] { display: none; }
.pcard .pc-cover { display: block; margin: -16px -16px 4px; border-radius: 10px 10px 0 0; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.pcard .pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-wrap { display: flex; justify-content: center; }
.phone { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px 28px; box-shadow: 0 8px 30px rgba(15, 23, 42, .08); color: #1f2329; }
.phone-cover { width: 100%; border-radius: 8px; display: block; margin-bottom: 14px; aspect-ratio: 2.35 / 1; object-fit: cover; }
.phone-title { font-size: 21px; line-height: 1.45; margin: 4px 0 14px; }
.phone-article { font-size: 15.5px; line-height: 1.85; }
.phone-article img { max-width: 100%; border-radius: 6px; display: block; margin: 16px auto 6px; }
.phone-article h2 { font-size: 18px; border-left: 4px solid var(--success); padding-left: 10px; margin: 26px 0 12px; }
.phone-text { white-space: pre-wrap; font-size: 15px; line-height: 1.8; }
.phone-slides { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: -4px -4px 12px; padding: 4px; }
.phone-slides img { width: 88%; flex: 0 0 auto; border-radius: 10px; scroll-snap-align: center; }
.phone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 12px; }
.phone-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.phone-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: #2563eb; font-size: 14px; }
.phone-cta { margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--success-50); color: var(--success); font-weight: 600; }
[data-show-for][hidden] { display: none; }
@media (max-width: 720px) {
  .acc-row { flex-wrap: wrap; }
  .acc-row > .row { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .phone { border-radius: 12px; padding: 14px 12px 22px; }
}
