/* ============================================================
   抖音爆款选题工作台 · 现代设计系统
   Light-first · 柔和留白 · 品牌渐变仅用于 chrome/强调
   ============================================================ */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fbfcfe;
  --ink: #0f172a;
  --ink-2: #344054;
  --sub: #667085;
  --muted: #98a2b3;
  --line: rgba(16, 24, 40, .09);
  --line-2: rgba(16, 24, 40, .06);
  --brand: #fe2c55;
  --brand2: #ff6a3d;
  --brand-soft: rgba(254, 44, 85, .08);
  --violet: #6366f1;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --run: #2563eb;

  --grad: linear-gradient(135deg, var(--brand), var(--brand2));
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px -12px rgba(16, 24, 40, .16);
  --shadow: 0 2px 6px rgba(16, 24, 40, .05), 0 18px 40px -22px rgba(16, 24, 40, .22);
  --shadow-lg: 0 30px 80px -30px rgba(16, 24, 40, .35);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 460px at 12% -8%, rgba(254, 44, 85, .07), transparent 62%),
    radial-gradient(900px 420px at 102% -6%, rgba(99, 102, 241, .06), transparent 58%),
    var(--bg);
}
a { color: inherit; }
::selection { background: rgba(254, 44, 85, .16); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.logo {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  border-radius: 13px; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(254, 44, 85, .6);
}
.title { font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.subtitle { color: var(--sub); font-size: 12px; margin-top: 1px; }

.stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
#chip-raw::before { background: var(--violet); }
#chip-analyzed::before { background: var(--brand); }
#chip-pool::before { background: var(--ok); }
.chip.mode { background: linear-gradient(135deg, #fff3ec, #ffe9ef); color: var(--brand2); border-color: rgba(255, 106, 61, .25); }
.chip.mode::before { background: var(--brand2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  border-radius: var(--radius-sm); padding: 9px 15px;
  cursor: pointer; font-size: 13px; font-weight: 650; font-family: inherit;
  transition: transform .14s var(--ease), background .14s, border-color .14s, box-shadow .14s, color .14s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(254, 44, 85, .5); color: var(--brand); box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--grad); color: #fff; border: none;
  box-shadow: 0 10px 22px -12px rgba(254, 44, 85, .8);
}
.btn.primary:hover { color: #fff; filter: brightness(1.04); box-shadow: 0 12px 26px -10px rgba(254, 44, 85, .85); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  border: none; background: transparent; cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px; color: var(--sub);
  font-size: 16px; display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* ---------- 分段式导航 ---------- */
.tabs {
  position: sticky; top: 73px; z-index: 25;
  display: flex; gap: 3px; padding: 5px; margin: 16px auto 0;
  width: fit-content; max-width: calc(100% - 32px);
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: 15px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: none; background: none; cursor: pointer;
  padding: 9px 17px; border-radius: 11px;
  font-size: 13.5px; font-weight: 650; color: var(--sub);
  font-family: inherit; white-space: nowrap;
  transition: .16s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: #fff; background: var(--grad);
  box-shadow: 0 8px 18px -10px rgba(254, 44, 85, .8);
}

/* ---------- 布局 ---------- */
main { padding: 20px 24px 64px; max-width: 1320px; margin: 0 auto; }
.panel { display: none; animation: fadeUp .32s var(--ease); }
.panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px;
  padding: 11px 15px 11px 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: var(--panel) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3-3'/></svg>") no-repeat 13px center;
  transition: .15s;
}
.search:focus { outline: none; border-color: rgba(254, 44, 85, .55); box-shadow: 0 0 0 4px var(--brand-soft); }
.select, .num {
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--ink-2); background: var(--panel);
  cursor: pointer; transition: .15s;
}
.select:focus, .num:focus { outline: none; border-color: rgba(254, 44, 85, .55); box-shadow: 0 0 0 4px var(--brand-soft); }
.num { width: 120px; cursor: text; }

/* ---------- 通用卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* ---------- 采集库 ---------- */
.crawl-grid { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 18px; align-items: start; }
/* 卷展栏：每个抓取批次 / 分组一个独立网格，点头部收起展开 */
.cgroup { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 18px; align-items: start; }
.cgroup.collapsed .ccard { display: none; }
.cgroup-head {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 14px; color: var(--ink-2);
  margin: 16px 2px 4px; cursor: pointer; user-select: none;
}
.cgroup:first-child .cgroup-head { margin-top: 0; }
.cgroup-head:hover { color: var(--brand); }
.cgroup-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gchev { display: inline-block; width: 14px; font-size: 11px; color: var(--muted); transition: transform .18s var(--ease); }
.cgroup-head:hover .gchev { color: var(--brand); }
.cgroup-n { font-weight: 600; font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line-2); padding: 1px 9px; border-radius: 999px; order: 3; }

/* 抓取记录条：每一次抓取都留痕（含 0 新增） */
.crawl-runs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.run-item {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
  padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); color: var(--muted);
}
.run-item.latest { border-color: rgba(254, 44, 85, .35); background: var(--brand-soft); color: var(--ink-2); }
.run-item.zero { opacity: .85; border-style: dashed; }
.run-ts { font-weight: 650; color: var(--ink-2); }
.run-item.zero .run-ts { color: var(--muted); }
.run-n b { color: var(--brand); }
.run-pf { opacity: .85; }
.run-note-tag {
  margin-left: auto; font-size: 11px; padding: 0 8px; border-radius: 999px;
  background: #fff7e6; color: #b8860b; border: 1px solid #f0dcae;
}
.run-note { font-size: 12px; color: var(--muted); padding: 2px; }

/* 采集环境自检条 */
.cap-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.cap-item {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
}
.cap-ok { color: #0a8f4d; border-color: rgba(10, 143, 77, .3); background: #eaf6ee; }
.cap-warn { color: #b8860b; border-color: #f0dcae; background: #fff7e6; }
.cap-bad { color: #c0392b; border-color: rgba(192, 57, 43, .3); background: #fdeef0; }
.cap-info { color: var(--muted); }
.cap-loading { color: var(--muted); }

/* 抖音扫码登录面板 */
.login-box {
  margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed var(--line-2);
  border-radius: var(--radius); background: var(--panel-2, var(--panel));
}
.login-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.login-head .btn { padding: 4px 12px; font-size: 12px; }
.login-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
.login-qr-wrap { margin-top: 10px; display: none; }
.login-qr-wrap.on { display: block; }
/* 取码中（还没拿到图）：面板要**先显示出来**，否则用户点了「登录」只看到空白
   —— 抖音弹窗有风控延迟，第一张码通常要等 1~3 分钟。 */
.login-qr-wrap.pending .login-qr { display: none; }
.login-qr-wrap.pending .login-qr-hint {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 10px;
  background: #f8fafc; color: var(--sub); font-size: 12.5px; line-height: 1.5;
}
.login-qr-wrap.pending .login-qr-hint::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  animation: qrspin .8s linear infinite;
}
@keyframes qrspin { to { transform: rotate(360deg); } }
.login-qr {
  max-width: 220px; max-height: 220px; border-radius: 8px; display: block;
  border: 1px solid var(--line-2); background: #fff;
}
.login-qr-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.ccard {
  position: relative; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  cursor: pointer;
}
.ccard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(254, 44, 85, .28); }
.cthumb {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: linear-gradient(150deg, #2b3040, #14161d);
  display: flex; align-items: center; justify-content: center;
}
.cthumb .cimg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.ccard:hover .cthumb .cimg { transform: scale(1.05); }
.cthumb.noimg .cimg { display: none; }
/* 无封面：压缩高度 + 浅色渐变占位，避免整屏黑色块 */
.cthumb.noimg {
  aspect-ratio: 16 / 6;
  background:
    linear-gradient(135deg, rgba(254, 44, 85, .06), rgba(99, 102, 241, .07)),
    var(--bg);
  border-bottom: 1px solid var(--line-2);
}
.cthumb.noimg::after { display: none; }
.cthumb.noimg .cph { display: grid; place-items: center; font-size: 22px; opacity: .5; color: var(--muted); }
.cthumb.noimg .cdur { background: rgba(16, 24, 40, .5); color: #fff; }
.cthumb.noimg .cbadge { background: rgba(217, 119, 6, .92); border-color: rgba(255, 255, 255, .3); }
.cthumb::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(to top, rgba(6, 8, 14, .72), transparent);
  pointer-events: none;
}
.cdur {
  position: absolute; right: 9px; bottom: 9px; z-index: 2;
  background: rgba(6, 8, 14, .66); color: #fff; font-size: 11px;
  padding: 2px 7px; border-radius: 7px; backdrop-filter: blur(4px);
}
.cover-play {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .55);
  backdrop-filter: blur(3px); display: grid; place-items: center; color: #fff; font-size: 15px;
  opacity: 0; transition: .24s var(--ease); pointer-events: none;
}
.ccard:hover .cover-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.cbody { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 7px; }
.ctitle { font-weight: 700; font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.cmeta { color: var(--sub); font-size: 11.5px; display: flex; gap: 6px; flex-wrap: wrap; }
.ctags { display: flex; flex-wrap: wrap; gap: 5px; }
.ctag {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 600;
}
.cstats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.cstats .cs { background: var(--bg); border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.cfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.cacts { display: flex; gap: 6px; }
.ccard .c-analyze { color: var(--brand); border-color: rgba(254, 44, 85, .4); }
.ccard .c-analyze:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 已拆解 / 未拆解 角标 */
.cbadge {
  position: absolute; left: 9px; top: 9px; z-index: 2;
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(6, 8, 14, .58); color: #fff;
  backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .18);
}
.cbadge.ok { background: rgba(22, 163, 74, .92); border-color: rgba(255, 255, 255, .3); }
/* 无效条目（无标题 / 标题=时长） */
.ccard.junk { opacity: .52; }
.ccard.junk:hover { opacity: 1; }
.ccard.junk .cthumb { filter: grayscale(.85); }
.cstats .cs.hot { color: var(--brand); background: var(--brand-soft); }
/* 播放量：真实值实心；估算值加虚线与浅色；无数据显示 — 灰化 */
.cstats .cs.play { color: var(--violet); background: rgba(99, 102, 241, .09); }
.cstats .cs.play.est { border: 1px dashed rgba(99, 102, 241, .45); background: transparent; }
.cstats .cs.none { color: var(--muted); background: transparent; }
.cstats .cs.watching { color: var(--warn); background: rgba(217, 119, 6, .09); }

/* ---------- 采集库：分面筛选头 ---------- */
.crawl-head {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 14px 16px 12px;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
  position: sticky; top: 74px; z-index: 12;
  backdrop-filter: saturate(180%) blur(10px);
}
.crawl-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crawl-top .search { flex: 1 1 240px; min-width: 180px; }
.crawl-top .select { flex: none; }

.facets { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.facet-row { display: flex; align-items: flex-start; gap: 10px; }
.facet-label {
  flex: none; width: 58px; padding-top: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em;
}
.facet-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }

/* 分面为空时的说明文字（如库内无美妆内容） */
.facet-note { font-size: 11.5px; color: var(--muted, #8a8f98); line-height: 1.6; padding: 3px 2px; }

.fchip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink-2); font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: .16s var(--ease);
}
.fchip:hover { border-color: rgba(254, 44, 85, .4); color: var(--brand); background: var(--brand-soft); }
.fchip.active { background: var(--brand-soft); border-color: rgba(254, 44, 85, .55); color: var(--brand); font-weight: 700; }
.fchip.biz { background: var(--panel); border-color: var(--line); }
.fchip.biz.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(254, 44, 85, .8); }
.fc-n {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center;
}
.fchip.active .fc-n { background: rgba(255, 255, 255, .55); color: var(--brand); }
.fchip.biz.active .fc-n { background: rgba(255, 255, 255, .26); color: #fff; }

/* 隐藏无效：复选框视觉隐藏，整颗胶囊即开关 */
.toggle-chip { position: relative; color: var(--sub); }
.toggle-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-chip:has(input:checked) { background: #eaf6ee; border-color: rgba(22, 163, 74, .38); color: var(--ok); font-weight: 700; }
#crawl-reset { color: var(--sub); border-style: dashed; }
#crawl-reset:hover { color: var(--danger); border-color: rgba(220, 38, 38, .4); background: rgba(220, 38, 38, .06); }
.fchip.more { border-style: dashed; color: var(--violet); border-color: rgba(99, 102, 241, .35); background: rgba(99, 102, 241, .05); }
.fchip.more:hover { color: var(--violet); background: rgba(99, 102, 241, .11); border-color: rgba(99, 102, 241, .55); }

.crawl-stat {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--sub);
}
.crawl-stat b { color: var(--ink); font-weight: 800; }
.stat-strong { color: var(--ink-2); font-weight: 600; }
.stat-strong b { color: var(--brand); font-size: 15px; margin: 0 1px; }
.stat-date { font-weight: 600; color: var(--brand); white-space: nowrap; }
.select.active { border-color: rgba(254, 44, 85, .55); color: var(--brand); font-weight: 600; }
.stat-sep { width: 1px; height: 13px; background: var(--line); }

/* ---------- 爆款拆解（摘要卡，点击开抽屉） ---------- */
.vcard {
  position: relative; display: flex; gap: 13px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(254, 44, 85, .26); }
.vthumb {
  width: 74px; flex: none; border-radius: 12px; overflow: hidden;
  background: linear-gradient(150deg, #2b3040, #14161d);
  display: grid; place-items: center; color: var(--muted); font-size: 18px;
}
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vtitle { font-weight: 700; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.vhook { color: var(--ink-2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vtags { display: flex; gap: 5px; flex-wrap: wrap; }
.vstats { display: flex; gap: 5px; flex-wrap: wrap; }
.vstats .cs { font-size: 11px; font-weight: 650; color: var(--ink-2); background: var(--bg); border-radius: 7px; padding: 1px 8px; }
.vstats .cs.play { color: var(--violet); background: rgba(99, 102, 241, .09); }
.vstats .cs.play.est { border: 1px dashed rgba(99, 102, 241, .45); background: transparent; }
.vstats .cs.hot { color: var(--brand); background: var(--brand-soft); }
.vstats .cs.none { color: var(--muted); background: transparent; }
.vchev { align-self: center; color: var(--muted); font-size: 18px; flex: none; }

.pf {
  font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 650;
  background: var(--bg); color: var(--sub); white-space: nowrap;
}
.pf.douyin { background: var(--brand-soft); color: var(--brand); }
.pf.channels { background: #eaf6ee; color: var(--ok); }
.pf.xiaohongshu { background: #fdeef0; color: #ff2442; }
.pf.kuaishou { background: #fff3e6; color: #ff6a00; }
.pf.bilibili { background: #eaf3fd; color: #00a1d6; }
.pf.weibo { background: #fdf1e8; color: #e6162d; }
.pf.zhihu { background: #eaf2fb; color: #0066ff; }
.pf.tieba { background: #eef0fe; color: #4e6ef2; }

.tag {
  display: inline-block; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 2px 9px; margin: 2px 4px 2px 0;
  font-size: 11.5px; color: var(--sub); font-weight: 600;
}
.pt { color: var(--danger); }

.empty {
  grid-column: 1 / -1; text-align: center; color: var(--sub);
  padding: 56px 20px; font-size: 13.5px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--panel-2);
}

/* ---------- 选题池 ---------- */
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pcard { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.pcard .ptitle { font-weight: 750; font-size: 15px; letter-spacing: -.01em; }
.pcard .pmeta { color: var(--sub); font-size: 12px; margin: 5px 0 8px; }
.sec { margin: 8px 0; }
.sec .lbl { font-weight: 700; color: var(--brand2); font-size: 12px; margin-bottom: 3px; }

/* ---------- 控制台 ---------- */
.console-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 16px; }
.card-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s; }
.card-box:hover { box-shadow: var(--shadow); }
.card-box h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 750; }
.hint { color: var(--sub); font-size: 12px; margin: 4px 0 12px; line-height: 1.55; }
.card-box label { display: block; font-size: 12px; color: var(--sub); margin: 10px 0 5px; font-weight: 600; }
.card-box .chk { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.card-box .btn { margin-top: 12px; width: 100%; }
.type-chks { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; }
.type-chks .chk.sm {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2);
  margin: 0; background: var(--bg); border: 1px solid var(--line-2);
  padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: .14s;
}
.type-chks .chk.sm:hover { border-color: rgba(254, 44, 85, .4); }
.type-chks .chk.sm input { width: 0; height: 0; opacity: 0; position: absolute; }
.type-chks .chk.sm:has(input:checked) { background: var(--brand-soft); border-color: rgba(254, 44, 85, .45); color: var(--brand); font-weight: 650; }
.workbuddy-flow { margin-top: 10px; font-size: 12px; }
.workbuddy-flow hr { border: none; border-top: 1px dashed var(--line); margin: 12px 0; }
.upload {
  display: block; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  padding: 12px; text-align: center; cursor: pointer; color: var(--sub);
  font-size: 12px; margin-top: 9px; transition: .15s;
}
.upload:hover { border-color: rgba(254, 44, 85, .45); color: var(--brand); background: var(--brand-soft); }
.upload.big { padding: 22px; font-size: 13px; }
.upload input { display: none; }

/* ---------- 任务日志 ---------- */
.jobs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 750; font-size: 14px; }
.jobs { display: flex; flex-direction: column; gap: 12px; }
.job { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-xs); }
.job .jhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job .jname { font-weight: 700; font-size: 13.5px; }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.queued { background: var(--bg); color: var(--sub); }
.badge.running { background: #e0edff; color: var(--run); }
.badge.running::before { animation: pulse 1.2s infinite; }
.badge.done { background: #e7f7ec; color: var(--ok); }
.badge.failed { background: #fdeaea; color: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.jlog {
  background: #0b1220; color: #c7d2e4; border-radius: 10px;
  padding: 12px 13px; margin-top: 10px;
  font-family: ui-monospace, Menlo, Consolas, "SF Mono", monospace;
  font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap;
  line-height: 1.55;
}

/* ---------- 报告弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; animation: fade .2s; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: var(--panel); border-radius: var(--radius); width: min(920px, 94vw); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 750; }
.report-text { padding: 20px; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.65; margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ============================================================
   详情抽屉（点击卡片 → 单独展示这一条拆解）
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .44); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .26s var(--ease);
}
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(580px, 100vw);
  background: var(--panel); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform .34s var(--ease);
  border-left: 1px solid var(--line-2);
}
.drawer.show { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); z-index: 2;
}
.drawer-head .dh-title { font-weight: 750; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }

/* 详情内容 */
.d-hero { display: flex; gap: 14px; }
.d-cover {
  width: 96px; flex: none; aspect-ratio: 4/5; border-radius: 13px; overflow: hidden;
  background: linear-gradient(150deg, #2b3040, #14161d); display: grid; place-items: center;
  color: var(--muted); font-size: 22px; cursor: pointer;
}
.d-cover img { width: 100%; height: 100%; object-fit: cover; }
.d-hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.d-title { font-weight: 750; font-size: 16px; line-height: 1.4; letter-spacing: -.01em; }
.d-author { color: var(--sub); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.d-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.d-stats .cs { background: var(--bg); border-radius: 8px; padding: 3px 9px; font-size: 11.5px; font-weight: 650; color: var(--ink-2); }
/* 抽屉里的五格统计（播放/点赞/评论/收藏/分享） */
.d-stat {
  display: flex; flex-direction: column; gap: 0;
  background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 5px 11px; min-width: 62px;
}
.d-stat .k { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.d-stat .v { font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.d-stat.est { border-style: dashed; border-color: rgba(99, 102, 241, .45); background: rgba(99, 102, 241, .05); }
.d-stat.est .v { color: var(--violet); }
.d-stat.watching { border-color: rgba(217, 119, 6, .3); background: rgba(217, 119, 6, .06); }
.d-stat.watching .v { color: var(--warn); }
.est-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 5px; }
.stat-sum { color: var(--ink-2); font-weight: 600; }
.stat-sum b { color: var(--ink); }
.est-tip { font-style: normal; color: var(--violet); font-weight: 800; cursor: help; }
.stat-sum b.est-tip { color: var(--violet); }

.hook-quote {
  position: relative; margin: 18px 0 6px;
  background: linear-gradient(135deg, rgba(254, 44, 85, .06), rgba(255, 106, 61, .05));
  border: 1px solid rgba(254, 44, 85, .18);
  border-radius: 15px; padding: 15px 16px 14px 17px;
  font-size: 15px; line-height: 1.6; color: var(--ink);
}
.hook-quote::before {
  content: "“"; position: absolute; left: 8px; top: -2px;
  font-size: 40px; color: rgba(254, 44, 85, .2); font-family: Georgia, serif; line-height: 1;
}
.hook-quote .hook-type {
  display: inline-block; margin-left: 8px; transform: translateY(-1px);
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}

.dsec { margin: 20px 0; }
.dsec > h4 {
  margin: 0 0 9px; font-size: 11.5px; font-weight: 750; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.dsec > h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--grad); }
.dsec p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips .chip2 {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.chips .chip2.pain { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.chips .chip2.emo { background: #f5f3ff; border-color: #ede9fe; color: #6d28d9; }

/* 分镜时间线 */
.tl { position: relative; margin: 0; padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 16px 20px; }
.tl-item::before {
  content: ""; position: absolute; left: -1px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(254, 44, 85, .18);
}
.tl-item::after {
  content: ""; position: absolute; left: 4px; top: 15px; bottom: -2px;
  width: 2px; background: var(--line);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::after { display: none; }
.tl-ts { font-size: 11.5px; font-weight: 750; color: var(--brand); margin-bottom: 3px; }
.tl-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.tl-body .tl-visual { color: var(--sub); font-size: 12px; margin-top: 2px; }
.tl-purpose {
  display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 650;
  background: var(--brand-soft); color: var(--brand); padding: 1px 9px; border-radius: 999px;
}

.script-box {
  position: relative; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 13px; padding: 14px 15px; font-size: 13.5px; line-height: 1.7;
  color: var(--ink-2); white-space: pre-wrap;
}
.copy-btn {
  position: absolute; top: 9px; right: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--sub);
  border-radius: 8px; padding: 3px 10px; font-size: 11px; cursor: pointer;
  font-family: inherit; font-weight: 600; transition: .14s;
}
.copy-btn:hover { color: var(--brand); border-color: rgba(254, 44, 85, .5); }

.d-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.d-actions .btn { flex: 1; }
.d-src {
  margin-top: 14px; text-align: center; font-size: 11.5px; color: var(--muted);
}
.d-src .srcbadge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-2); font-weight: 650; }
.d-src .srcbadge.ai { background: var(--brand-soft); color: var(--brand); border-color: rgba(254, 44, 85, .25); }

/* 骨架屏 */
.sk { background: linear-gradient(90deg, #eef0f4 25%, #f6f7f9 37%, #eef0f4 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-hero { display: flex; gap: 14px; margin-bottom: 18px; }
.sk-cover { width: 96px; aspect-ratio: 4/5; border-radius: 13px; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.sk-line { height: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #101828; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 120; box-shadow: var(--shadow);
  opacity: 0; transition: .22s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .subtitle { display: none; }
  main { padding: 16px 16px 56px; }
  .tabs { top: auto; }
  .crawl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .drawer { width: 100vw; }
  .cards { grid-template-columns: 1fr; }
  .crawl-head { position: static; padding: 12px; }
  .facet-row { flex-direction: column; gap: 5px; }
  .facet-label { width: auto; padding-top: 0; }
  .facet-chips { gap: 5px; }
  .fchip { padding: 4px 9px; font-size: 11.5px; }
  .rtwo, .rgrid { grid-template-columns: 1fr; }
  .remix { padding: 13px 12px; }
  .op-grid { grid-template-columns: 1fr; }
  .cbox, .obox { padding: 13px 12px; }
}

/* ---------- 任务进度浮层 ---------- */
.jprog {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: min(370px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 14px 15px; display: flex; flex-direction: column; gap: 9px;
  animation: jpin .3s var(--ease);
}
.jprog[hidden] { display: none; }
@keyframes jpin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.jprog-head { display: flex; justify-content: space-between; align-items: center; }
.jprog-title { font-weight: 750; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.jprog-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
  animation: pulse 1.2s infinite;
}
.jprog.done .jprog-title::before { background: var(--ok); box-shadow: 0 0 0 3px #e7f7ec; animation: none; }
.jprog.failed .jprog-title::before { background: var(--danger); box-shadow: 0 0 0 3px #fdeaea; animation: none; }
.jprog-bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; position: relative; }
.jprog-fill { height: 100%; width: 0; border-radius: 999px; background: var(--grad); transition: width .4s var(--ease); }
.jprog-bar.indeterminate .jprog-fill { width: 35% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.jprog-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--sub); }
.jprog-meta #jp-pct { font-weight: 750; color: var(--brand); flex: none; }
.jprog-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.jprog-steps li { display: flex; align-items: center; gap: 8px; color: var(--sub); }
.jprog-steps .js-ico { width: 16px; text-align: center; font-size: 12px; flex: none; }
.jprog-steps li.js-done { color: var(--ink-2); }
.jprog-steps li.js-done .js-ico { color: var(--ok); }
.jprog-steps li.js-running { color: var(--brand); font-weight: 700; }
.jprog-steps li.js-running .js-ico { display: inline-block; animation: spin 1s linear infinite; }
.jprog-steps li.js-skipped { color: var(--muted); text-decoration: line-through; }
@keyframes spin { to { transform: rotate(360deg); } }
.jprog-log {
  margin: 0; max-height: 96px; overflow: auto;
  background: #0b1220; color: #c7d2e4; border-radius: 9px;
  padding: 8px 10px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.5; white-space: pre-wrap;
}

.jmini { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; margin: 8px 0 4px; }
.jmini-fill { height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s; }

/* ---------- 发布素材 ---------- */
.pub .pub-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.pub .pub-row:last-of-type { border-bottom: none; }
.pub .pub-k { width: 62px; flex: none; color: var(--sub); font-weight: 700; }
.pub .pub-v { flex: 1; color: var(--ink-2); word-break: break-word; }
.pub .copy-btn { position: static; flex: none; align-self: flex-start; }
.pub-actions { margin-top: 10px; }
.pub-actions .btn { width: 100%; }

/* ---------- 复刻提播放量方案 ---------- */
.remix {
  background: linear-gradient(180deg, rgba(99, 102, 241, .045), rgba(99, 102, 241, .012));
  border: 1px solid rgba(99, 102, 241, .18);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 18px;
}
.remix h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px !important; }
.rbadge {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--violet);
  border-radius: 999px; padding: 1px 9px; letter-spacing: .02em;
}
.rgoal { color: var(--ink-2); font-size: 13px; margin: 0 0 14px; }

.rblock { margin-bottom: 16px; }
.rblock:last-child { margin-bottom: 0; }
.rlabel {
  font-size: 12px; font-weight: 800; color: var(--violet);
  letter-spacing: .01em; margin-bottom: 7px;
}

.rgenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rgenes li {
  background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--violet);
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.6;
}
.rgenes li b { display: block; color: var(--ink); margin-bottom: 1px; }
.rgenes li span { color: var(--sub); }

.rtwo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rtwo .rblock { margin-bottom: 16px; }
.rlist { margin: 0; padding-left: 17px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.rblock.keep .rlabel { color: var(--ok); }
.rblock.swap .rlabel { color: var(--brand2); }
.rblock.keep { background: rgba(22, 163, 74, .045); border-radius: 10px; padding: 10px 12px; }
.rblock.swap { background: rgba(255, 106, 61, .05); border-radius: 10px; padding: 10px 12px; }

.rtl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rtl td { border-bottom: 1px dashed var(--line-2); padding: 8px 6px; vertical-align: top; }
.rtl tr:last-child td { border-bottom: none; }
.rt-t {
  width: 72px; flex: none; font-weight: 800; color: var(--violet);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rt-do { color: var(--ink); font-weight: 650; }
.rt-say { color: var(--brand); margin-top: 2px; }
.rt-why { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.rlev {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 9px 12px; margin-bottom: 8px;
}
.rlev-h { display: flex; align-items: center; gap: 7px; }
.rlev-n {
  width: 18px; height: 18px; flex: none; border-radius: 6px;
  background: var(--violet); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.rlev-h b { flex: 1; font-size: 12.5px; color: var(--ink); }
.rlev-h .copy-btn { position: static; }
.rlev-a { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; margin-top: 5px; }
.rlev-e { font-size: 11.5px; color: var(--ok); margin-top: 4px; font-weight: 600; }

.rtitle {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 7px 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--ink);
}
.rtitle span { flex: 1; }
.rtitle .copy-btn { position: static; }

.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ritem { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; }
.ritem .rk { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.ritem .rv { font-size: 12px; color: var(--ink-2); line-height: 1.55; }

.rwarn { background: rgba(220, 38, 38, .05); border: 1px solid rgba(220, 38, 38, .16); border-radius: 10px; padding: 9px 12px; }
.rwarn b { font-size: 12px; color: var(--danger); }
.rwarn ul { margin: 5px 0 0; padding-left: 17px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.rest {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(22, 163, 74, .07); border: 1px solid rgba(22, 163, 74, .2);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.ralt {
  font-size: 12px; color: var(--sub); line-height: 1.6;
  background: var(--panel); border: 1px dashed var(--line);
  border-radius: 10px; padding: 8px 11px; margin-bottom: 10px;
}

/* ---------- 用 AI 复刻 ---------- */
.aibox {
  background: linear-gradient(180deg, rgba(37, 99, 235, .045), rgba(37, 99, 235, .01));
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 18px;
}
.aibox .rlabel { color: var(--run); }
.cbadge-biz.ai { background: var(--run); }

.ai-path {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 10px 12px; margin-bottom: 9px;
}
.ai-path-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-path-h b { font-size: 12.5px; color: var(--ink); flex: 1; }
.ai-cost {
  font-size: 10.5px; font-weight: 700; color: var(--run);
  background: rgba(37, 99, 235, .09); border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.ai-fit { font-size: 12px; color: var(--sub); line-height: 1.6; margin-top: 4px; }
.ai-tools { font-size: 11.5px; color: var(--violet); font-weight: 650; margin-top: 4px; }
.ai-path .op-steps { margin-top: 6px; }

.ai-step {
  background: var(--panel); border: 1px solid var(--line-2);
  border-left: 3px solid var(--run); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 8px;
}
.ai-step-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-stage { font-size: 12.5px; font-weight: 800; color: var(--run); }
.ai-tool { font-size: 11px; color: var(--sub); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.ai-step-h .copy-btn { position: static; margin-left: auto; }
.ai-act { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 4px; }
.ai-prompt {
  background: #0f172a; color: #d6e2ff; border-radius: 9px;
  padding: 9px 11px; margin-top: 6px; font-size: 11.5px; line-height: 1.65;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  max-height: 190px; overflow: auto; word-break: break-word;
}
.ai-tip { font-size: 11.5px; color: var(--warn); margin-top: 5px; line-height: 1.55; }

.ai-toolline {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-2);
}
.ai-toolline:last-child { border-bottom: none; }
.ai-toolline b { width: 150px; flex: none; color: var(--ink); }
.ai-ts { font-size: 11px; color: var(--run); font-weight: 650; width: 120px; flex: none; }
.ai-tn { color: var(--sub); flex: 1; min-width: 140px; }
.aiwarn { margin-top: 8px; }

/* ---------- 生成文案 ---------- */
.cbox {
  background: linear-gradient(180deg, rgba(254, 44, 85, .04), rgba(254, 44, 85, .008));
  border: 1px solid rgba(254, 44, 85, .16);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 18px;
}
.cbadge-biz {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--brand);
  border-radius: 999px; padding: 1px 9px;
}
.cbox h4, .obox h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.rlabel .copy-btn { position: static; margin-left: 8px; vertical-align: middle; }

.cp-seg { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.cp-seg:last-child { border-bottom: none; }
.cp-ts {
  width: 58px; flex: none; font-size: 11.5px; font-weight: 800; color: var(--brand);
  font-variant-numeric: tabular-nums; padding-top: 1px;
}
.cp-line { font-size: 13px; color: var(--ink); line-height: 1.65; }
.cp-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.cp-body {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75;
}
.cp-cover {
  background: linear-gradient(140deg, #2b3040, #14161d); color: #fff;
  border-radius: 10px; padding: 14px 12px; font-size: 15px; font-weight: 800;
  line-height: 1.45; text-align: center;
}
.cp-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.cp-reply {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 7px 10px; margin-bottom: 6px; font-size: 12.5px; line-height: 1.6;
}
.cp-reply b { color: var(--brand); flex: none; }
.cp-reply span { flex: 1; color: var(--ink-2); min-width: 160px; }
.cp-reply .copy-btn { position: static; }

/* ---------- 运营方案 ---------- */
.obox {
  background: linear-gradient(180deg, rgba(22, 163, 74, .035), rgba(22, 163, 74, .008));
  border: 1px solid rgba(22, 163, 74, .18);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 18px;
}
.obox .rlabel { color: var(--ok); }
.op-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.op-main { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.6; }
.op-why { font-size: 12px; color: var(--sub); margin-top: 5px; line-height: 1.6; }
.op-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; font-size: 11.5px; color: var(--muted); }

.opt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.opt td { border-bottom: 1px dashed var(--line-2); padding: 7px 6px; vertical-align: top; }
.opt tr:last-child td { border-bottom: none; }
.op-day { width: 46px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.op-goal {
  width: 54px; font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; text-align: center;
  padding: 1px 6px !important; white-space: nowrap;
}
.opts .op-k { width: 84px; font-weight: 700; color: var(--ink); }
.opts .op-l { width: 150px; color: var(--violet); font-weight: 650; }
.opts .op-w { color: var(--sub); font-size: 11.5px; }

.op-kw { display: flex; flex-direction: column; gap: 6px; }
.op-kw > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.op-kw b { color: var(--muted); font-size: 11.5px; font-weight: 700; width: 34px; flex: none; }
.op-kw .op-why { width: 100%; font-size: 11.5px; }

.op-flow {
  background: var(--panel); border: 1px dashed rgba(22, 163, 74, .4);
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.65;
}
.op-steps { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.op-steps li { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.op-n {
  width: 17px; height: 17px; flex: none; margin-top: 2px; border-radius: 5px;
  background: var(--ok); color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}
.op-warn { margin-top: 8px; font-size: 11.5px; color: var(--warn); line-height: 1.6; }

.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.op-cell { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; }
.op-cell .k { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.op-cell .v { font-size: 12px; color: var(--ink-2); line-height: 1.55; }

.op-phase {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; margin-bottom: 7px;
}
.op-ph { flex: none; font-size: 11.5px; font-weight: 800; color: var(--ok); white-space: nowrap; padding-top: 1px; }
.op-task { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.op-target { font-size: 11.5px; color: var(--violet); font-weight: 650; margin-top: 2px; }

/* ============================================================
   IP 素材库（公有领域角色 + CC0 素材）
   ============================================================ */
.ip-hint { font-size: 12px; color: var(--muted); }
.ip-hint.ip-err { color: var(--danger); }

.ip-searchrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.ip-quick-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.ip-searchrow .chip { cursor: pointer; }
.ip-searchrow .chip:hover { border-color: var(--brand); color: var(--brand); }

.ip-subtabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.ip-sub {
  border: none; background: none; padding: 8px 13px; font-size: 13px; font-weight: 650;
  color: var(--sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.ip-sub:hover { color: var(--ink); }
.ip-sub.active { color: var(--brand); border-bottom-color: var(--brand); }

.ip-view { display: none; }
.ip-view.active { display: block; }

.ip-note {
  background: rgba(217, 119, 6, .07); border: 1px solid rgba(217, 119, 6, .28);
  border-radius: var(--radius-xs); padding: 10px 13px; font-size: 12.5px;
  color: var(--ink-2); line-height: 1.65; margin-bottom: 14px;
}

/* --- 素材卡片网格 --- */
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ip-card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-xs); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.ip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ip-thumb {
  width: 100%; height: 118px; object-fit: contain;
  background: var(--panel-2); border-radius: var(--radius-xs);
  border: 1px solid var(--line-2);
}
.ip-thumb-none { display: grid; place-items: center; font-size: 30px; color: var(--muted); }
.ip-title {
  font-size: 12.5px; font-weight: 650; color: var(--ink); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ip-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ip-src { font-size: 11px; color: var(--muted); }
.ip-author { font-size: 11px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lic { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.lic-pd { background: rgba(22, 163, 74, .12); color: #15803d; }
.lic-cc0 { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.lic-by { background: rgba(99, 102, 241, .13); color: #4f46e5; }
.lic-bysa { background: rgba(217, 119, 6, .13); color: #b45309; }
.lic-other { background: rgba(102, 112, 133, .13); color: var(--sub); }
.ip-attr { font-size: 10.5px; font-weight: 700; color: var(--warn); border: 1px dashed rgba(217,119,6,.4); padding: 1px 6px; border-radius: 999px; }

.ip-actions { display: flex; gap: 6px; margin-top: 2px; }
.ip-btn {
  flex: 1; text-align: center; font-size: 11.5px; font-weight: 650; text-decoration: none;
  padding: 5px 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  border: 1px solid rgba(254, 44, 85, .2);
}
.ip-btn:hover { background: var(--brand); color: #fff; }
.ip-btn.ghost { background: transparent; color: var(--sub); border-color: var(--line); }
.ip-btn.ghost:hover { background: var(--panel-2); color: var(--ink); }

/* --- 角色清单 --- */
.ip-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.ip-char {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow-xs);
}
.ip-char-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.ip-char-name { font-size: 14px; font-weight: 750; color: var(--ink); }
.ip-char-cn { font-size: 12px; color: var(--sub); }
.ip-st { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.ip-st.pd { background: rgba(22, 163, 74, .12); color: #15803d; }
.ip-st.soon { background: rgba(102, 112, 133, .13); color: var(--sub); }
.ip-char-src { font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
.ip-char-lic { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.ip-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ip-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--sub); }
.ip-biz { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); margin-bottom: 7px; }
.ip-biz b { color: var(--ok); }
.ip-caution { font-size: 12px; line-height: 1.6; color: #b45309; background: rgba(217,119,6,.07); border-left: 3px solid var(--warn); padding: 7px 10px; border-radius: 0 8px 8px 0; margin-bottom: 7px; }
.ip-kw { font-size: 11.5px; color: var(--muted); }
.ip-kw code { background: var(--panel-2); border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 5px; margin-right: 4px; font-size: 11px; }

/* --- 素材站 --- */
.ip-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ip-site {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 15px; box-shadow: var(--shadow-xs);
}
.ip-site-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.ip-site-name { font-size: 14.5px; font-weight: 750; color: var(--run); text-decoration: none; }
.ip-site-name:hover { text-decoration: underline; }
.ip-site-lic { font-size: 11px; font-weight: 700; color: #15803d; background: rgba(22,163,74,.1); padding: 2px 8px; border-radius: 999px; }
.ip-site-row { display: flex; gap: 9px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.ip-site-row > span { flex: none; width: 38px; color: var(--muted); font-weight: 700; font-size: 11.5px; }
.ip-site-note { font-size: 12px; color: var(--sub); line-height: 1.65; margin-top: 8px; }

/* --- 法律边界 --- */
.ip-legal { display: flex; flex-direction: column; gap: 10px; }
.ip-legal-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 15px; box-shadow: var(--shadow-xs);
}
.ip-legal-no {
  width: 24px; height: 24px; flex: none; border-radius: 8px;
  background: var(--violet); color: #fff; font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.ip-legal-t { font-size: 13.5px; font-weight: 750; color: var(--ink); margin-bottom: 4px; }
.ip-legal-b { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }

@media (max-width: 720px) {
  .ip-grid, .ip-chars, .ip-sites { grid-template-columns: 1fr; }
}

/* ---- 最新 · 热门 IP 形象 ---- */
.ip-searchrow .chip.on {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.ip-searchrow .chip.on:hover { color: #fff; }

.ip-cal {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; margin: 0 0 14px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px;
}
.ip-cal-label { font-weight: 700; color: var(--sub); }
.ip-cal-item {
  padding: 3px 9px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.ip-cal-item.on {
  background: #ecfdf5; border-color: #a7f3d0; color: #047857; font-weight: 650;
}

.ip-trend-metrics {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--sub); margin: 6px 0 8px;
}
.ip-trend-metrics b { color: #b45309; letter-spacing: 1px; font-weight: 600; }

/* ---- 零风险素材：风险徽标与来源图例 ---- */
.ip-safe-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; font-size: 12px; }
.ip-risk {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 650;
  white-space: nowrap;
}
.ip-risk.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.ip-risk.attr { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
