/* 新版「搜索任务」页（创建搜索 / 搜索结果）。
   外观按原型 prototypes/shadcn-style/search-create.html、search-results.html；
   pages/search-center.js 动态输出的旧版类名（task-op-mark、creator-*、result-*、sc-modal 等）在这里按原型样式重写。
   只用 ds.css 颜色变量，深色模式自动跟随。 */

/* ================= 布局：左栏任务 + 右栏工作区（原型 .split） ================= */
.sc-layout {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100vh - 128px); min-height: 560px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card);
}
.sc-tasks { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-right: 1px solid var(--border); background: var(--card); }
.sc-workspace { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.sc-content { flex: 1; min-width: 0; }
.task-panel-backdrop { display: none; }
#task-panel-toggle { display: none; }

/* 创建搜索：不显示任务栏，页面按原型 search-create.html 铺在画布上 */
body.search-creation-active .sc-layout { display: block; height: auto; min-height: 0; border: 0; border-radius: 0; overflow: visible; background: none; }
body.search-creation-active .sc-workspace { overflow: visible; }
body.search-creation-active .sc-tasks,
body.search-creation-active .task-panel-backdrop,
body.search-creation-active .pane-head { display: none !important; }

.view { display: none; }
.view.active { display: block; }
.detail { padding: 20px 24px; }

/* ---------- 左栏（原型 aside） ---------- */
.tp-head { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.tp-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.tp-head .segmented { display: flex; }
.tp-head .segmented button { flex: 1; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.task-platform-tabs button b { font-weight: 500; color: var(--muted-foreground); font-size: 11px; }
.task-platform-tabs button.is-loading b { opacity: .5; }
.tp-bulk { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.tp-bulk label { cursor: pointer; }
.tp-bulk .btn { margin-left: auto; }
.tp-list { flex: 1; min-height: 0; overflow: auto; padding: 8px; display: grid; gap: 8px; align-content: start; }
.tp-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); }
.tp-foot .btn { margin-left: auto; }
.tp-list > .loading { padding: 32px 12px; text-align: center; color: var(--muted-foreground); font-size: 13px; }

.task { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--card); }
.task:hover { border-color: var(--ring); }
.task.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.task.bulk-selected { background: var(--soft); }
.task:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.task > .checkbox { margin-top: 3px; flex-shrink: 0; }
.task-card-main { flex: 1; min-width: 0; }
.task .t1 { display: flex; align-items: center; gap: 6px; }
.task .t1 b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .task-platform-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted-foreground); }
.task .t2, .task .t3 { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.task .task-region-list { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .task-status-text { color: var(--foreground); }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--muted-foreground); }
.status-dot.active { background: var(--brand); }
.status-dot.completed { background: var(--info); }
.status-dot.failed { background: var(--destructive); }
.task-mail-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-mail-pending { color: var(--warning); }
.task-op-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.task-op-mark { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--secondary); color: var(--muted-foreground); font-size: 11px; font-weight: 500; white-space: nowrap; }
.task-op-mark.is-exported { background: var(--info-soft); color: var(--info); border-color: transparent; }
.task-op-mark.is-linked { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.task-op-mark.is-unknown { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.task-mini-progress { height: 3px; margin-top: 8px; }
.task-archive-one { position: absolute; top: 6px; right: 6px; height: 24px; padding: 0 8px; font-size: 12px; background: var(--background); opacity: 0; transition: opacity .12s; }
.task:hover .task-archive-one, .task.bulk-selected .task-archive-one, .task:focus-within .task-archive-one { opacity: 1; }
.task-load-more { width: 100%; }
.task-platform-loading { display: grid; justify-items: center; gap: 6px; padding: 32px 12px; text-align: center; color: var(--muted-foreground); font-size: 13px; }
.task-platform-loading strong { color: var(--foreground); font-weight: 500; }
.task-platform-loading-spinner, .sc-spinner, .result-loading-spinner, .search-export-loading-spinner {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: var(--brand); animation: sc-spin 1s linear infinite; display: inline-block;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }

/* ---------- 右栏头（原型 .pane-head） ---------- */
.pane-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.pane-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pane-title h2 { margin: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
#page-subtitle { color: var(--muted-foreground); font-size: 13px; }

/* ================= 创建搜索（原型 search-create.html） ================= */
.sc-create-head { padding-top: 20px; display: grid; gap: 16px; }
.sec-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--primary); color: var(--primary-foreground); }
.mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#platforms button:disabled { opacity: .4; cursor: not-allowed; }
.mode-btn { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground); cursor: pointer; text-align: left; }
.mode-btn:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.mode-btn.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.mode-btn svg { margin-top: 2px; flex-shrink: 0; }
.mode-btn b { display: block; font-weight: 500; }
.mode-btn small { color: var(--muted-foreground); font-size: 12px; }
.platform-shell { justify-self: start; }
.platform-seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; }
.platform-seg button svg { width: 16px; height: 16px; }
.platform-shell.is-switching .platform-seg { animation: sc-pulse .26s ease-out; }
@keyframes sc-pulse { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); } }
.smart-prompt-footer { margin-top: 12px; }
.smart-prompt-footer #interpret-btn { margin-left: auto; }
.examples { gap: 6px; font-size: 13px; }
.examples .badge { cursor: pointer; background: var(--background); color: var(--foreground); }
.examples .badge:hover { background: var(--accent); }
.sc-task-name { max-width: 360px; }
.sc-narrow { max-width: 300px; margin: 0; }
.sc-stack { display: grid; gap: 16px; }
.sc-stack > .field, .sc-stack .form-grid .field { margin-bottom: 0; }
.form-grid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .field { margin-bottom: 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-weight: 400; cursor: pointer; user-select: none; }
.check-chip:has(input:checked) { border-color: var(--primary); background: var(--muted); }
.check-chip:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.collapsible > summary { cursor: pointer; font-size: 14px; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary svg { transition: transform .15s; }
.collapsible[open] > summary svg { transform: rotate(90deg); }
.collapsible .body { display: grid; gap: 12px; margin-top: 12px; padding-left: 22px; }
.foot-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sc-grow { flex: 1; min-width: 0; }
.sc-grow small { display: block; margin-top: 2px; font-size: 12px; }
.sc-status { margin: 8px 0 0; color: var(--muted-foreground); font-size: 13px; }
.sc-status:empty { display: none; }
.row > .sc-status { margin: 0; flex: 1; min-width: 0; }
.sc-status[data-state="failed"], .sc-status[data-state="rejected"] { color: var(--destructive); }
.sc-status[data-state="partial"], .sc-status[data-state="cancelled"] { color: var(--warning); }

/* 关键词识别结果（renderUnifiedKeywordResult 输出：b / .creator-link-summary em / div span / .creator-link-error） */
.kw-result { display: grid; gap: 8px; margin-top: 12px; font-size: 13px; }
.kw-result:empty { display: none; }
.kw-result b { font-weight: 500; }
.kw-result > div { display: flex; gap: 6px; flex-wrap: wrap; }
.kw-result > div:not(.creator-link-summary) span { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--secondary); font-size: 12px; }
.creator-link-summary em { font-style: normal; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--muted-foreground); }
.creator-link-error { margin: 0; color: var(--destructive); }

/* ---------- 确认搜索计划 ---------- */
#view-plan .card-head .hint { display: block; margin-top: 2px; font-size: 12px; color: var(--muted-foreground); }
#view-plan .tags { flex-wrap: wrap; }
.sc-between { justify-content: space-between; }
.hard .chip-remove { border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: var(--muted-foreground); font-size: 14px; line-height: 1; }
.hard .chip-remove:hover { color: var(--destructive); }
#soft-plan { min-height: 80px; }
.sc-kw-head { margin-bottom: 8px; }
.sc-kw-head .section-title { margin: 0; }
.sc-region-editor { margin-left: auto; font-size: 13px; }
.sc-region-editor select { width: 140px; }
.sc-kw-head .sc-region-editor[hidden] + .btn { margin-left: auto; }
#keyword-expansion-summary { margin: 0 0 4px; }
.sc-domains { font-size: 13px; margin: 0 0 8px; }
.sc-domains:empty { display: none; }
.kw-list { display: grid; gap: 6px; }
.kw-row { display: flex; gap: 6px; align-items: center; }
.kw-row .input { flex: 1; }
.sc-plan-note { margin-right: auto; font-size: 13px; }

/* ================= 任务进度与控制 ================= */
.task-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.task-hero > div { flex: 1; min-width: 0; }
.task-hero .task-live-eyebrow, .task-hero h3 { display: none; } /* 任务名已在右栏头部；英文阶段标签与下方状态重复 */
.task-hero p { margin: 0; color: var(--muted-foreground); font-size: 13px; }
.task-hero .task-status { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
#task-enrichment-summary { margin: 0 0 12px; }
.sc-live-card { padding-top: 20px; }
.live { display: flex; gap: 16px; align-items: center; }
.live .spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--muted); border-top-color: var(--brand); animation: sc-spin 1s linear infinite; flex-shrink: 0; }
.live.is-paused .spin { animation: none; border-color: var(--brand); }
.sc-kicker { font-size: 12px; }
#task-live-copy { margin: 4px 0 0; font-size: 13px; }
.live .counters { margin-left: auto; display: flex; gap: 24px; text-align: right; flex-shrink: 0; }
.live .counters b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live .counters small { color: var(--muted-foreground); font-size: 12px; }
.sc-progress { margin: 16px 0; }
.steps > div.active { color: var(--foreground); font-weight: 500; }
.steps > div.active::before { background: var(--primary); }
.kw-details > summary { padding: 14px 20px; cursor: pointer; font-weight: 500; }
#task-keywords-body { padding-top: 0; font-size: 13px; }
#task-keywords-body h4 { margin: 12px 0 6px; font-size: 13px; font-weight: 500; }
#task-keywords-body h4:first-child { margin-top: 0; }
#task-keywords-body ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
#task-keywords-body li { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--secondary); font-size: 12px; }
.task-keywords-note { margin: 0 0 8px; color: var(--muted-foreground); }
.task-keywords-note.is-warning { color: var(--warning); }
#task-release-hint { margin: 0 0 12px; }
.task-actions { gap: 8px; }
.sc-push { margin-left: auto; }

/* ================= 结果 ================= */
/* 结果摘要在右栏头，跟在任务名后面（方案 B） */
.sc-result-stats { display: flex; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; }
.sc-result-stats b { margin-left: 3px; color: var(--foreground); font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-result-stats[hidden], .sc-result-stats [hidden] { display: none; }
#metric-new-wrap { cursor: help; border-radius: 4px; }
#metric-new-wrap:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.sc-new-data-definition { min-width: 0; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 8px 10px; font-size: 12px; line-height: 1.5; color: var(--foreground); white-space: normal; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#result-task-state { margin: 0 0 8px; }
.commandbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.commandbar .result-search-box { flex: 1 1 240px; min-width: 200px; max-width: 420px; }
.commandbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.commandbar .more > .popover { right: 0; left: auto; min-width: 160px; }
.commandbar .sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding-right: 4px; cursor: pointer; }
.commandbar .hard-filter-tag-count { margin-left: 2px; }
.email-lookup-btn.is-running { border-color: var(--brand); color: var(--brand); }
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > .popover { display: block; }
.menu-item:disabled { opacity: .5; cursor: default; }
.result-status { color: var(--muted-foreground); font-size: 13px; margin-bottom: 12px; }
.result-status:empty { display: none; }
.result-status .btn { margin-left: 8px; }
.email-lookup-summary { margin: -4px 0 12px; }

/* 结果卡网格：同一行卡片等高，操作按钮统一贴底 */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: stretch; }
.rc { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; }
.rc.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.rc.library-result-card { border-style: dashed; }
.rc-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rc-head > .checkbox { flex-shrink: 0; }
.creator-profile-avatar { flex-shrink: 0; text-decoration: none; }
.result-avatar { position: relative; overflow: hidden; width: 40px; height: 40px; font-size: 14px; }
.result-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 名字单行截断，完整名字在 title */
.rc-name { flex: 1; min-width: 0; }
.rc-name strong { display: block; min-width: 0; font-weight: 600; font-size: 14px; }
.rc-name strong > span, .rc-name strong a { display: flex; align-items: center; gap: 2px; min-width: 0; }
.rc-name strong span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-name strong svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--muted-foreground); }
/* id 选择器压过 ds.css 的全局链接色（达人名用正文色） */
#result-body .rc-name strong a { color: inherit; text-decoration: none; }
#result-body .rc-name strong a:hover span { text-decoration: underline; }
.rc-name small { display: block; color: var(--muted-foreground); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 状态短标签：一行，位置固定在名字下面 */
.rc-state { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.state-chip-group { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.state-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; max-width: 100%; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--secondary); color: var(--foreground-2); text-decoration: none; }
.state-chip > span:not(.sr-only) { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
/* 已联系：BD 名不能被省略号截掉 */
.state-chip.creator-contact-mark > span:not(.sr-only) { max-width: none; }
.state-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.state-chip.tone-success { background: var(--success-soft); color: var(--success); }
.state-chip.tone-warning { background: var(--warning-soft); color: var(--warning); }
.state-chip.tone-danger { background: var(--destructive-soft); color: var(--destructive); }
.state-chip.tone-info { background: var(--info-soft); color: var(--info); }
.state-chip.tone-brand { background: var(--brand-soft); color: var(--brand); }
.state-chip.tone-muted { background: transparent; border: 1px solid var(--border); color: var(--muted-foreground); }
#result-body a.state-chip { color: var(--success); }
.state-chip [data-lucide="loader-circle"], .state-chip .lucide-loader-circle { animation: sc-spin 1.6s linear infinite; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
/* 外链邮箱补查（external-contact-status.js 输出 details） */
.rc-state .external-contact-status { display: contents; font-size: 12px; color: var(--muted-foreground); }
.rc-state .external-contact-status:empty { display: none; }
.rc-state .external-contact-status summary { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; font-weight: 500; cursor: pointer; list-style: none; }
.rc-state .external-contact-status summary::-webkit-details-marker { display: none; }
.rc-state .external-contact-status details[open] { flex-basis: 100%; }
.rc-state .external-contact-status details > div, .rc-state .external-contact-status details > ul { margin-top: 4px; overflow-wrap: anywhere; }
.rc-state .external-contact-status ul { margin-bottom: 0; padding-left: 18px; }
.rc-state .external-contact-status a { display: inline-block; margin-top: 4px; color: var(--brand); }

/* 固定指标条：粉丝 | 均播 | 中位 | 互动率（带货任务为 GMV） */
.rc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr); border: 1px solid var(--border); border-radius: var(--radius); }
.rc-kpis > div { padding: 6px 8px; min-width: 0; }
.rc-kpis > div + div { border-left: 1px solid var(--border); }
.rc-kpis span { display: block; font-size: 11px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-kpis b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.rc-kpis b.is-empty { color: var(--muted-foreground); font-weight: 500; font-size: 13px; }
.rc-kpis .kpi-gmv { background: var(--brand-soft); border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; color: var(--brand); }
.rc-kpis .kpi-gmv span, .rc-kpis .kpi-gmv b { color: var(--brand); }
/* 指标格里只取 GMV 行的金额（口径和类目由条件栏、标签组展示） */
.kpi-gmv .rc-gmv { display: block; }
.kpi-gmv .rc-gmv:empty { display: none; }
.kpi-gmv .rc-gmv:not(:empty) ~ .gmv-empty { display: none; }
.kpi-gmv .rc-gmv > :not(b) { display: none; }

/* 标签组：GMV 类目 + 内容大类 + AI 标签，最多两行 */
.rc-tags { display: flex; gap: 4px; flex-wrap: wrap; max-height: 44px; overflow: hidden; align-items: center; }
.rc-tags .rc-gmv { display: contents; }
.rc-tags .rc-gmv > b { display: none; }
/* GMV 口径（如「美妆个护类近 7 天 GMV」）放在标签组最前面，周期和类目一眼可见 */
.rc-tags .rc-gmv > span.muted { display: inline-flex; align-items: center; height: 20px; font-size: 11px; color: var(--brand); white-space: nowrap; }
.ai-tag-pending { font-size: 12px; color: var(--muted-foreground); }
.rc-tags .badge { height: 20px; padding: 0 6px; font-size: 11px; }
.creator-taxonomy-tags, .result-ai-tag-list { display: contents; }
.creator-taxonomy-tags.is-pending span { color: var(--muted-foreground); font-size: 12px; }
.ai-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--secondary); font-size: 11px; color: var(--foreground-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-tag-track, .ai-tag-niche { background: var(--brand-soft); color: var(--brand); }
.ai-tag-audience, .ai-tag-identity { background: var(--info-soft); color: var(--info); }
.ai-tag-commercial, .ai-tag-brand { background: var(--warning-soft); color: var(--warning); }
.ai-tag-more { background: transparent; border: 1px solid var(--border); }

/* 代表视频：小缩略图 + 标题 + 数据 */
.result-media-strip { display: block; }
.video { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: var(--radius); color: inherit; text-decoration: none; }
#result-body a.video { color: inherit; }
a.video:hover { background: var(--accent); }
.result-media-strip.is-youtube .video { grid-template-columns: 80px minmax(0, 1fr); }
.video .cover { width: 48px; height: 64px; border-radius: 6px; background: var(--muted); display: grid; place-items: center; color: var(--muted-foreground); position: relative; overflow: hidden; }
.result-media-strip.is-youtube .video .cover { width: 80px; height: 45px; }
.video .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video .cover > b { position: relative; z-index: 1; font-size: 13px; color: var(--muted-foreground); }
.video:not(.is-loading):not(.is-unavailable) .cover > b { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.video .video-skeleton { position: absolute; inset: 0; display: none; background: linear-gradient(90deg, var(--muted), var(--soft), var(--muted)); background-size: 200% 100%; animation: sc-shimmer 1.2s linear infinite; }
.video.is-loading .video-skeleton { display: block; }
.video.is-loading .cover img { opacity: 0; }
@keyframes sc-shimmer { to { background-position: -200% 0; } }
.result-video-text { min-width: 0; }
.result-video-text em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-style: normal; font-size: 12px; font-weight: 500; color: var(--foreground); overflow-wrap: anywhere; }
.result-video-text small { display: flex; gap: 10px; margin-top: 4px; color: var(--muted-foreground); font-size: 12px; }

/* 关键词与原始命中：一行，展开后显示列表 */
.creator-hit-details > summary { display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 12px; color: var(--muted-foreground); list-style: none; min-width: 0; }
.creator-hit-details > summary::-webkit-details-marker { display: none; }
.creator-hit-details > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-hit-details > summary svg { width: 13px; height: 13px; flex-shrink: 0; }
.creator-hit-details > div { margin-top: 4px; }
.creator-hit-details .btn { margin-top: 4px; }
.library-result-reason { padding: 6px 10px; border-radius: 6px; background: var(--soft); border: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.library-result-reason p { margin: 0 0 4px; }
.library-result-reason a { color: var(--brand); }

/* 底部一行：左边次要信息，右边操作 */
.rc-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-foreground); border-top: 1px solid var(--border); padding-top: 10px; }
.rc-foot-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-actions { margin-left: auto; display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-shrink: 0; }
.candidate-toggle-btn { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.candidate-toggle-btn:hover { opacity: .9; }
.candidate-toggle-btn.is-added { background: var(--secondary); color: var(--secondary-foreground); box-shadow: none; }

/* 结果区空状态 / 加载 / 失败 */
.result-grid-empty, .result-switch-loading {
  grid-column: 1 / -1; display: grid; place-items: center; gap: 8px; padding: 48px 16px; text-align: center;
  color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: 12px; font-size: 14px;
}
.result-grid-empty small, .result-switch-loading small { display: block; font-size: 12px; }
.result-switch-loading strong, .result-friendly-error strong { color: var(--foreground); font-weight: 500; }
.result-friendly-error-icon { font-size: 22px; }
.result-loading-bars { display: flex; gap: 6px; }
.result-loading-bars i { width: 40px; height: 6px; border-radius: 999px; background: var(--muted); animation: sc-fade 1.2s ease-in-out infinite; }
.result-loading-bars i:nth-child(2) { animation-delay: .2s; }
.result-loading-bars i:nth-child(3) { animation-delay: .4s; }
@keyframes sc-fade { 50% { opacity: .4; } }
.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 16px; font-size: 13px; color: var(--muted-foreground); }

/* 空状态 / 加载中（原型 .empty） */
.sc-empty { margin-top: 40px; }
.sc-empty b { color: var(--foreground); font-weight: 500; }
.sc-empty .btn { margin-top: 8px; }

/* ================= 弹窗（硬筛 / 导出字段 / 导出进度；旧版 .sc-modal 结构，按原型 .dialog 外观） ================= */
.sc-modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.sc-modal.open { display: flex; }
.sc-modal-backdrop { position: absolute; inset: 0; border: 0; padding: 0; background: var(--overlay); cursor: default; }
.sc-modal-card {
  position: relative; width: 480px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto;
  padding: 24px; background: var(--background); color: var(--foreground);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); animation: sc-zoom .15s ease-out;
}
.sc-modal-card.lg, #search-export-field-modal .sc-modal-card { width: 720px; }
@keyframes sc-zoom { from { opacity: 0; transform: scale(.96); } }
.sc-modal-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; padding-right: 32px; }
.sc-modal-desc { margin: 0 0 16px; font-size: 13px; }
.sc-modal-card > header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.sc-modal-card > header > div { flex: 1; }
.sc-modal-card > header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.sc-modal-card > header p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 13px; }
.sc-modal-card > header .sheet-close { position: static; }
.sc-modal-card > footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.sc-pull { margin-right: auto; }

.hf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.hf-grid .field { margin-bottom: 0; min-width: 0; position: relative; }
.hf-grid .field > label { font-size: 13px; }
.hard-filter-dropdown { position: relative; }
.hard-filter-dropdown > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 14px; }
.hard-filter-dropdown > summary::-webkit-details-marker { display: none; }
.hard-filter-dropdown > summary > span { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hard-filter-dropdown > summary > b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.hard-filter-dropdown-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; width: max(100%, 220px); padding: 6px;
  background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.hard-filter-dropdown-upward .hard-filter-dropdown-panel { top: auto; bottom: calc(100% + 4px); }
.hard-filter-option-search { margin-bottom: 4px; }
.hard-filter-picker, .creator-track-options { display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.hard-filter-picker label, .creator-track-options label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 4px; font-size: 13px; font-weight: 400; cursor: pointer; }
.hard-filter-picker label:hover, .creator-track-options label:hover { background: var(--accent); }
.hard-filter-picker label[hidden], .creator-track-options label[hidden] { display: none !important; }
.creator-track-options input { accent-color: var(--brand); }
#hf-visual-tag { display: flex; }
#hf-visual-tag label { white-space: nowrap; flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
#hf-visual-tag label input { position: absolute; opacity: 0; pointer-events: none; }
#hf-visual-tag label:has(input:checked) { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
#hf-visual-tag label:has(input:focus-visible) { outline: 2px solid var(--ring); }
#hf-visual-analysis-note { display: block; font-size: 12px; margin-top: 4px; }

/* 导出字段（exportFieldModal 动态生成） */
.export-field-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.export-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.export-field-grid label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.export-field-grid input { accent-color: var(--brand); }

/* Excel 下载中（openExportLoadingModal 动态生成） */
.search-export-loading-card {
  position: relative; width: 380px; max-width: 100%; padding: 28px 24px; text-align: center;
  background: var(--background); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.search-export-loading-visual { display: grid; place-items: center; height: 40px; margin-bottom: 8px; }
.search-export-loading-check { display: none; font-size: 28px; font-weight: 700; color: var(--brand); }
.search-export-loading-modal.is-success .search-export-loading-spinner { display: none; }
.search-export-loading-modal.is-success .search-export-loading-check { display: block; }
.search-export-loading-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.search-export-loading-card p { margin: 0; color: var(--muted-foreground); font-size: 13px; }
.search-export-loading-card small { display: block; margin-top: 8px; color: var(--muted-foreground); font-size: 12px; }

/* 恢复任务自动发信（search_mail_resume.js 用原生 <dialog>） */
.sc-native-dialog { width: 520px; max-width: calc(100vw - 32px); padding: 24px; color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.sc-native-dialog::backdrop { background: var(--overlay); }
.sc-native-dialog h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.sc-native-dialog p { margin: 0 0 8px; font-size: 14px; }

/* ================= 找相似（similar-influencers.js 运行时注入的样式；同 components/legacy-modules.css，本页不再加载该文件） ================= */
html body .sim-inf-overlay { z-index: 70; background: var(--overlay); }
html body .sim-analysis-overlay { z-index: 72; background: var(--overlay); }
html body .sim-inf-modal, html body .sim-inf-inline { background: var(--canvas); color: var(--foreground); border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
html body .sim-inf-head, html body .sim-inf-inline-topbar { background: var(--background); border-bottom-color: var(--border); }
html body .sim-inf-head h2 { font-size: 18px; font-weight: 600; }
html body .sim-inf-head p, html body .sim-inf-name small, html body .sim-inf-selected-count, html body .sim-inf-state { color: var(--muted-foreground); }
html body .sim-inf-close { background: transparent; color: var(--muted-foreground); border-radius: 6px; }
html body .sim-inf-close:hover { background: var(--accent); color: var(--foreground); }
html body .sim-inf-inline .sim-inf-close { border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-weight: 500; }
html body .sim-inf-source { background: var(--brand-soft); border-color: transparent; color: var(--foreground-2); border-radius: var(--radius); }
html body .sim-inf-source strong { color: var(--brand); }
html body .sim-inf-selectbar { background: var(--background); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
html body .sim-inf-select-all { color: var(--foreground); font-weight: 500; }
html body .sim-inf-select-all input, html body .sim-inf-card-select input { accent-color: var(--brand); }
html body .sim-inf-batch-add, html body .sim-inf-add { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); font-weight: 500; }
html body .sim-inf-batch-add:disabled { border-color: var(--border); background: var(--muted); color: var(--muted-foreground); }
html body .sim-inf-card { background: var(--card); border-color: var(--border); border-radius: 12px; }
html body .sim-inf-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 15%, transparent); }
html body .sim-inf-card.is-added { border-color: var(--border); background: var(--soft); }
html body .sim-inf-card-select { background: var(--background); border-color: var(--border); }
html body .sim-inf-avatar-wrap, html body .sim-inf-avatar-wrap img { background: var(--brand-soft); color: var(--brand); }
html body .sim-inf-score { background: var(--brand-soft); color: var(--brand); }
html body .sim-inf-reasons span { background: var(--secondary); color: var(--foreground-2); }
html body .sim-inf-tags span { background: var(--info-soft); color: var(--info); }
html body .sim-inf-summary, html body .sim-inf-metrics { color: var(--foreground-2); }
html body .sim-inf-metrics b, html body .sim-inf-meta b { color: var(--foreground); }
html body .sim-inf-meta { background: var(--soft); color: var(--muted-foreground); }
html body .sim-inf-meta a { color: var(--brand); }
html body .sim-inf-video { background: var(--muted); }
html body .sim-inf-video-empty { color: var(--muted-foreground); }
html body .sim-inf-profile, html body .sim-analysis-rerun { border: 1px solid var(--input); background: var(--background); color: var(--foreground); }
html body .sim-inf-analyze { border: 1px solid var(--input); background: var(--brand-soft); color: var(--brand); }
html body .sim-inf-spinner { border-color: var(--border); border-top-color: var(--brand); }
html body .sim-analysis-panel { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-lg); }
html body .sim-analysis-head, html body .sim-analysis-footer { border-color: var(--border); }
html body .sim-analysis-head p { color: var(--muted-foreground); }
html body .sim-analysis-status { background: var(--brand-soft); color: var(--brand); }
html body .sim-analysis-status.is-failed { background: var(--destructive-soft); color: var(--destructive); }
html body .sim-analysis-kpis div, html body .sim-analysis-curated-row { border-color: var(--border); background: var(--card); color: var(--muted-foreground); }
html body .sim-analysis-kpis b, html body .sim-analysis-curated-row b { color: var(--foreground); }
html body .sim-analysis-curated-row span, html body .sim-analysis-curated-row small { color: var(--muted-foreground); }
html body .sim-analysis-report { background: var(--soft); color: var(--foreground-2); }

/* ================= 窄屏 ================= */
@media (max-width: 1100px) {
  .sc-layout { grid-template-columns: minmax(0, 1fr); }
  #task-panel-toggle { display: inline-flex; }
  /* 任务栏变抽屉（setTaskPanelOpen 切换 .open / body.task-panel-open） */
  .sc-tasks { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(340px, 88vw); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform .2s; }
  .sc-tasks.open { transform: none; }
  body.task-panel-open .task-panel-backdrop { display: block; position: fixed; inset: 0; z-index: 44; border: 0; background: var(--overlay); }
  .hf-grid, .export-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sc-layout { height: auto; min-height: 0; }
  .detail { padding: 16px; }
  .pane-head { padding: 12px 16px; }
  .mode-switch, .grid-2, .form-grid, .form-grid.thirds, .hf-grid, .export-field-grid { grid-template-columns: minmax(0, 1fr); }
  .pane-head { flex-wrap: wrap; }
  .pane-head .pane-title { flex: 1 1 100%; }
  .sc-result-stats { order: 2; flex: 1 1 auto; }
  #view-task-progress { order: 3; }
  .rc-kpis b:not(.is-empty) { font-size: 14px; letter-spacing: -.02em; }
  .commandbar .result-search-box { flex: 1 1 100%; max-width: none; order: -1; }
  .commandbar-end { margin-left: 0; justify-content: flex-start; }
  .live { flex-wrap: wrap; }
  .live .counters { margin-left: 0; text-align: left; }
  .task-archive-one { opacity: 1; }
}

/* 确认搜索计划 → 项目与关键词类型（search-center-attribution.js） */
.sc-attr { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px 16px; align-items: start; }
.sc-attr .field { margin: 0; }
.sc-attr-list { display: flex; flex-wrap: wrap; gap: 8px 12px; padding-top: 22px; }
.sc-attr-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.sc-attr-kw { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-attr-row select { width: auto; min-width: 104px; }
@media (max-width: 760px) {
  .sc-attr { grid-template-columns: 1fr; }
  .sc-attr-list { padding-top: 0; }
}

/* 已淘汰（11-18）：本 BD 记了淘汰原因的达人默认隐藏，本页有隐藏时才出现开关 */
.sc-rejected-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }
.sc-rejected-toggle[hidden], #result-body .creator-result-card[hidden] { display: none !important; }

/* 结果加载失败时的请求编号：可整段选中复制，不抢主信息 */
.result-request-id { color: var(--muted-foreground); font-size: 11px; user-select: all; font-variant-numeric: tabular-nums; }
