/* 抖音后台的统一组件尺度；仅在抖音页面加载。 */
body.theme-douyin {
  --bg: #f4f7f9;
  --ink: #2d3748;
  --ink-2: #4a5568;
  --mute: #718096;
  --line: #e8eef4;
  --line-strong: #d5dee8;
  --accent: #ff2442;
  --accent-deep: #d40f2c;
  --accent-soft: #ffe4e9;
  --dy-cyan: #ff6b84;
  --dy-pink: #ff2442;
  --dy-chart-pink: #ff2442;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  line-height: 1.6;
}
/* 抖音页铺满整个窗口：全站 .wrap 的 max-width:1280 在 1920 屏上会留出 500+px 空白。 */
body.theme-douyin .wrap { padding: 24px; max-width: none; }
/* 竞品分析首屏右栏两张卡（更新数据 / 日历分析）瘦身：说明压缩、可折叠，让「作品榜单」直接进首屏。
   ⚠ 选择器必须带上 .card 把特异性提到 (0,3,1) —— 本文件末尾还有一条
   body.theme-douyin .card { padding: 24px }（同特异性），写在后面的会赢，光写 .dy-update-card 会被压掉。 */
body.theme-douyin .card.dy-update-card, body.theme-douyin .card.dy-calendar-card { padding: 16px 18px; }
body.theme-douyin .dy-update-card .dy-eyebrow { display: none; }
body.theme-douyin .dy-update-card .dy-update-status { margin: 6px 0 0; }
body.theme-douyin .dy-calendar-card .dy-fold-body > .muted { margin: 4px 0 8px; }
body.theme-douyin .dy-calendar-card .dy-presets, body.theme-douyin .dy-calendar-card .dy-months { margin-top: 6px; }
.theme-douyin .workspace-top { min-height: 60px; box-shadow: none; }
.theme-douyin .brand-mark-douyin { background: transparent; color: var(--ink); padding: 0; box-shadow: none; font-size: 18px; border-radius: 0; }
.theme-douyin .brand-mark-douyin .douyin-brand-text { background: transparent; color: var(--ink) !important; padding: 0; border-radius: 0; font-size: 18px; font-weight: 600; letter-spacing: 0; }
.theme-douyin .side-nav { box-shadow: none; background: #fff; }
.theme-douyin .side-link { border-radius: var(--radius-sm); }
/* 左侧两个抖音入口保持黑白，内容区使用小红书配色。 */
.theme-douyin .side-link-douyin:hover { background: #ececec; color: #000 !important; }
.theme-douyin .side-link-douyin.active { background: #000; color: #fff !important; box-shadow: none; }
.theme-douyin .card, .theme-douyin .hot-video-board { padding: 20px; margin-bottom: 16px; border-radius: 6px; box-shadow: var(--shadow); }
.theme-douyin h1 { font-size: 24px; line-height: 1.45; margin: 0 0 12px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.theme-douyin h2 { font-size: 18px; line-height: 1.5; margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.theme-douyin h3 { font-size: 16px; line-height: 1.5; margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.theme-douyin p { margin: 0 0 16px; line-height: 1.7; overflow-wrap: anywhere; }
.theme-douyin .card > p:last-child { margin-bottom: 0; }
.theme-douyin .muted { color: var(--ink-2); font-size: 13px; }
.theme-douyin .dy-detail-page .card > p.muted, .theme-douyin .dy-creator-card > p.muted { margin: 0 0 16px; font-size: 13px; }
.theme-douyin small, .theme-douyin .dy-metric-date, .theme-douyin .dy-task-key { font-size: 12px; line-height: 1.5; color: var(--mute); }
.theme-douyin a { transition: color .15s; }
.theme-douyin a:focus-visible, .theme-douyin button:focus-visible, .theme-douyin summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-douyin .dy-content-link { color: var(--ink); font-weight: 500; }
.theme-douyin .dy-content-link:hover { color: var(--accent); }
.theme-douyin form { margin: 0; }
.theme-douyin input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .theme-douyin select {
  min-width: 0; max-width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font: inherit;
}
.theme-douyin select { appearance: auto; -webkit-appearance: auto; }
.theme-douyin textarea { min-width: 0; max-width: 100%; width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font: inherit; line-height: 1.6; resize: vertical; }
.theme-douyin input::placeholder, .theme-douyin textarea::placeholder { color: #a8abb2; }
.theme-douyin input:focus, .theme-douyin select:focus, .theme-douyin textarea:focus { box-shadow: 0 0 0 3px #dedee0; border-color: var(--accent); }
.theme-douyin input[type=checkbox], .theme-douyin input[type=radio] { width: 16px; min-width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--accent); }
.theme-douyin input[type=file] { height: auto !important; min-height: 36px; padding: 5px 8px !important; width: 340px; }
.theme-douyin input[type=file]::file-selector-button { font: inherit; color: var(--ink-2); border: 0; background: #f5f7fa; border-radius: 3px; margin-right: 10px; padding: 3px 8px; cursor: pointer; }
.theme-douyin .ca-btn {
  min-height: 36px; height: 36px; padding: 0 16px; font-size: 14px; font-weight: 400; line-height: 1; border-radius: 4px; vertical-align: middle; gap: 6px; flex: 0 0 auto;
}
.theme-douyin .ca-btn-sm, .theme-douyin .dy-table .ca-btn { min-height: 30px; height: 30px; padding: 0 10px; font-size: 13px; }
.theme-douyin .ca-btn-primary { border: 1px solid var(--accent); color: #fff; background: var(--accent); }
.theme-douyin .ca-btn-primary:hover { filter: none; background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.theme-douyin .ca-btn-ghost { border-color: var(--line-strong); color: var(--ink-2); background: #fff; }
.theme-douyin .ca-btn-ghost:hover { background: var(--accent-soft); border-color: #bfc2c4; color: var(--accent); }
.theme-douyin .ca-btn:disabled { opacity: .5; cursor: not-allowed; }
.theme-douyin .dy-danger-button { color: #f56c6c; }
.theme-douyin .dy-danger-button:hover { background: #fef0f0; border-color: #fbc4c4; color: #f56c6c; }
.theme-douyin .seg-tabs { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; margin-bottom: 16px; gap: 12px; overflow-x: auto; overflow-y: hidden; }
.theme-douyin .seg-tab { flex: 0 0 auto; padding: 14px 8px; font-size: 14px; font-weight: 400; color: var(--ink-2); margin-bottom: 0; }
body.theme-douyin .seg-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.theme-douyin .dy-eyebrow { font-size: 11px; letter-spacing: .08em; color: var(--mute); margin-bottom: 6px; font-weight: 500; }
.theme-douyin .dy-section-head { margin-bottom: 12px; align-items: center; }
.theme-douyin .dy-section-head h2, .theme-douyin .dy-section-head h3 { margin: 0; }
/* ⚠ 本文件复用了小红书页面的组件类名，但其中不少类在 style.css 里从未定义。
   只写 grid-template-columns / gap / align-items 而漏写 display 时，元素仍是 display:block，
   「左右并排」「两列表单」「卡片栅格」会静默塌成一列。以下每组都显式声明 display。 */
/* 竞品分析首屏：对齐小红书排版 —— 顶部两张操作卡（更新数据 / 日历分析）单列通栏，
   下面是关键词标签行，再往下才是榜单。
   ⚠ 原来的「左榜单 + 右 340px 操作栏」两栏布局已弃用（用户要求照搬小红书），
   不要再给 .dy-analysis-top 设 grid-template-columns 多列。 */
.theme-douyin .dy-analysis-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* 手机端默认折叠顶部两张操作卡（douyin.html 的结构后脚本负责置 open=false）：
   脚本接管前先把展开内容藏起来，否则会「先展开再收起」闪一下。
   .dy-fold-ready 由脚本加上，所以脚本失效时内容不会被永久藏住。 */
@media (max-width: 1200px) {
  html.dy-mobile:not(.dy-fold-ready) .theme-douyin .dy-analysis-top .dy-fold > .dy-fold-body { display: none; }
}
/* 顶部两张卡用 <details> 做折叠：去掉浏览器自带三角标，改用标题前的 ▸/▾。
   标题行是 <summary>，里面只能放行内元素，所以用 span 而不是 div/h2。 */
.theme-douyin .dy-fold-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 12px; margin: 0; cursor: pointer; list-style: none; }
.theme-douyin .dy-fold-summary::-webkit-details-marker { display: none; }
.theme-douyin .dy-fold-title { display: block; min-width: 0; }
.theme-douyin .dy-fold-h { display: block; font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.theme-douyin .dy-fold-h::before { content: "▸"; display: inline-block; width: 12px; margin-right: 4px; color: var(--mute); font-size: 12px; }
.theme-douyin .dy-fold[open] > .dy-fold-summary .dy-fold-h::before { content: "▾"; }
.theme-douyin .dy-fold-summary:hover .dy-fold-h { color: var(--accent); }
.theme-douyin .dy-fold[open] > .dy-fold-summary { margin-bottom: 10px; }
.theme-douyin .dy-fold-meta { text-align: right; }
.theme-douyin .dy-fold-summary .dy-count { padding: 3px 10px; min-width: 0; }
.theme-douyin .dy-fold-summary .dy-count strong { font-size: 17px; }
.theme-douyin .dy-fold-summary .dy-count span { font-size: 11px; }
.theme-douyin .dy-count { border: 0; background: #f5f7fa; border-radius: 6px; padding: 16px 20px; min-width: 110px; text-align: center; }
.theme-douyin .dy-count strong { font-size: 28px; color: var(--ink); font-weight: 600; }
.theme-douyin .dy-count span { font-size: 12px; color: var(--mute); }
.theme-douyin .dy-range-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 16px 0; }
.theme-douyin .dy-range-form label { display: flex; flex-direction: column; gap: 6px; width: auto; min-width: 0; color: var(--ink-2); font-size: 13px; white-space: normal; }
.theme-douyin .dy-range-form input:not([type=checkbox]):not([type=hidden]), .theme-douyin .dy-range-form select { width: 170px; margin: 0; }
.theme-douyin .dy-range-form label.dy-link-field input { width: min(380px, 70vw); }
.theme-douyin .dy-range-form label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 8px; align-self: center; }
.theme-douyin .dy-range-form > span { align-self: flex-end; padding-bottom: 8px; }
/* 批量更新按钮独占一行、压在筛选条件上方：flex-basis:100% 在 flex-wrap 下强制换行，
   后面的分类/复选标签自然落到第二行。 */
.theme-douyin .dy-range-form > .dy-range-submit { flex: 0 0 100%; display: flex; align-items: center; gap: 12px; }
.theme-douyin .dy-end-date .dy-visually-hidden { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
.theme-douyin .dy-presets, .theme-douyin .dy-months { gap: 8px; margin-top: 12px; }
.theme-douyin .dy-preset { min-height: 28px; padding: 3px 10px; border-radius: 4px; background: #fff; border-color: var(--line-strong); font-size: 12px; font-weight: 400; }
.theme-douyin .dy-preset:hover, .theme-douyin .dy-preset.is-on { background: var(--accent-soft); color: var(--accent); border-color: #bfc2c4; }
.theme-douyin .dy-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.theme-douyin .dy-account-import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 18px; }
.theme-douyin .dy-account-extract-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.theme-douyin .dy-account-extract-form input { min-width: 190px; }
.theme-douyin .dy-action-row form, .theme-douyin .row form { display: inline-flex; align-items: center; gap: 8px; }
.theme-douyin .card > form:not(.dy-range-form):not(.dy-settings-grid):not(.dy-ai-form) { margin: 12px 0; }
.theme-douyin .hot-video-boards, .theme-douyin .dy-detail-grid, .theme-douyin .dy-audience-grid { gap: 16px; align-items: start; }
.theme-douyin .hot-video-board h2 { font-size: 16px; }
.theme-douyin .hot-video-board, .theme-douyin .dy-detail-grid > .card, .theme-douyin .dy-audience-grid > .card { margin-bottom: 0; }
.theme-douyin .hot-video-boards, .theme-douyin .dy-detail-grid, .theme-douyin .dy-audience-grid { margin-bottom: 16px; }
/* 四榜在桌面是 repeat(4, minmax(0,1fr))，单卡仅约 296px。原来一行塞四列（末列还固定 110px），
   标题列被压到只剩 36px、文字竖排。改成两行：序号｜封面｜标题 ／ 指标与链接，标题列约有 160px。 */
.theme-douyin .dy-rank-item { padding: 12px 0; gap: 8px 12px; min-height: 88px; align-items: center; grid-template-columns: 24px 48px minmax(0, 1fr); }
/* 榜单缩略图必须显式定尺：img 是替换元素，grid 固定轨道的 min-width:auto 会取原图固有宽度，
   不写 width/height 就按原图比例溢出（实测 323x430），一条就把整个榜单行撑到 430px 高。 */
.theme-douyin .dy-rank-cover { display: block; width: 48px; height: 64px; min-width: 0; object-fit: cover; border-radius: 4px; background: #f5f7fa; grid-row: span 2; }
.theme-douyin .dy-rank-item .dy-rank-end { grid-column: 3; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; }
.theme-douyin .hot-video-rank { color: var(--mute); font-size: 14px; }
.theme-douyin .hot-video-rank.rank-1, .theme-douyin .hot-video-rank.rank-2, .theme-douyin .hot-video-rank.rank-3 { color: var(--accent); }
.theme-douyin .hot-video-title { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.55; }
.theme-douyin .hot-video-meta { color: var(--mute); font-size: 12px; }
.theme-douyin .dy-rank-end { gap: 6px; min-width: 0; }
.theme-douyin .dy-rank-end strong { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.theme-douyin .dy-rank-end a { color: var(--accent); font-size: 12px; }
.theme-douyin .dy-web-rank-list { list-style: none; margin: 0; padding: 0; }
.theme-douyin .dy-web-rank-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 110px; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.theme-douyin .dy-web-rank-list li:last-child { border-bottom: 0; }
.theme-douyin .dy-web-rank { text-align: center; color: var(--mute); }
.theme-douyin .dy-web-rank-main { min-width: 0; }
.theme-douyin .dy-web-rank-main > a, .theme-douyin .dy-target-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.theme-douyin .dy-web-rank-main small { display: block; margin-top: 6px; }
.theme-douyin .dy-table { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.theme-douyin .dy-table th, .theme-douyin .dy-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.theme-douyin .dy-table thead th { font-size: 13px; font-weight: 500; color: var(--ink-2); background: #f5f7fa; }
.theme-douyin .dy-table tbody th { font-weight: 500; }
.theme-douyin .dy-table tbody tr:hover { background: #f5f7fa; }
.theme-douyin .dy-table .row { gap: 8px !important; }
.theme-douyin .dy-table td:last-child > .row { margin-bottom: 8px; }
.theme-douyin .dy-table td.dy-number, .theme-douyin .dy-video-table th:nth-child(n+5):nth-child(-n+9), .theme-douyin .dy-video-table td:nth-child(n+5):nth-child(-n+9) { text-align: right; font-variant-numeric: tabular-nums; }
.theme-douyin .dy-video-table { min-width: 1320px; }
.theme-douyin .dy-video-table th:first-child { width: 4%; }
.theme-douyin .dy-video-table th:nth-child(2) { width: 24%; }
.theme-douyin .dy-video-table th:nth-child(3) { width: 11%; }
.theme-douyin .dy-video-table th:nth-child(4) { width: 11%; }
.theme-douyin .dy-video-table th:nth-child(n+5):nth-child(-n+9) { width: 7%; }
.theme-douyin .dy-video-table th:last-child { width: 15%; }
/* 作品表首列：封面 + 标题必须横向并排。原先只写了 gap 没有 display:flex，
   于是封面（img 又没定尺，按原图尺寸渲染）把标题挤到下方，一行高达 400px。 */
.theme-douyin .dy-video-cell { display: flex; align-items: flex-start; gap: 12px; }
.theme-douyin .dy-video-cell > img {
  flex: 0 0 auto; display: block; width: 56px; height: 74px; min-width: 0;
  object-fit: cover; border-radius: 4px; background: #f5f7fa;
}
.theme-douyin .dy-video-cell .dy-cover-empty {
  flex: 0 0 auto; width: 56px; height: 74px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border-radius: 4px; background: #f5f7fa; color: var(--mute); line-height: 1.3;
}
/* 封面链接失效时脚本会置 hidden，但上面的 display:block/inline-flex 会盖掉 UA 的 [hidden] */
.theme-douyin img[hidden], .theme-douyin .dy-cover-empty[hidden] { display: none !important; }
.theme-douyin .dy-video-title { min-width: 0; }
.theme-douyin .dy-video-cell a { font-weight: 500; font-size: 14px; }
.theme-douyin .dy-type-tag, .theme-douyin .dy-status-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; margin-top: 6px; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 4px; white-space: nowrap; color: var(--ink-2); background: #f5f7fa; }
.theme-douyin .dy-status-tag { margin-top: 0; }
.theme-douyin .dy-status-tag.is-success { color: #529b2e; border-color: #d1edc4; background: #f0f9eb; }
.theme-douyin .dy-status-tag.is-muted { color: #909399; background: #f4f4f5; }
.theme-douyin .dy-work-actions { gap: 6px; font-size: 13px; }
.theme-douyin .dy-analysis-link, .theme-douyin .dy-original-link { font-size: 13px; }
.theme-douyin .dy-target-table { table-layout: fixed; min-width: 1120px; }
.theme-douyin .dy-target-table th:first-child { width: 34%; }
.theme-douyin .dy-target-table th:nth-child(2) { width: 13%; }
.theme-douyin .dy-target-table th:nth-child(3) { width: 16%; }
.theme-douyin .dy-target-table th:nth-child(4) { width: 8%; }
.theme-douyin .dy-target-table th:last-child { width: 29%; }
.theme-douyin .dy-task-table { min-width: 760px; table-layout: fixed; }
.theme-douyin .dy-task-table th:first-child { width: 60%; }
.theme-douyin .dy-task-table th:nth-child(2) { width: 28%; }
.theme-douyin .dy-task-table th:last-child { width: 12%; }
.theme-douyin .dy-task-history { list-style: none; margin: 12px 0; padding: 0; max-height: 360px; overflow: auto; }
.theme-douyin .dy-task-history li { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.theme-douyin .dy-task-history li:nth-child(even) { background: #f5f7fa; }
.theme-douyin [data-panel=statistics] .dy-table { table-layout: fixed; }
.theme-douyin [data-panel=statistics] .dy-table th:last-child, .theme-douyin [data-panel=statistics] .dy-table td:last-child { text-align: right; }
.theme-douyin [data-panel=statistics] .dy-calendar th:last-child, .theme-douyin [data-panel=statistics] .dy-calendar td:last-child { text-align: center; }
/* 关键词按紧凑标签排列，常用操作直接显示。 */
.theme-douyin .dy-keyword-list {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 9px 10px; max-height: 62vh; overflow: auto;
}
.theme-douyin .dy-keyword-item {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 8px;
  max-width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}
.theme-douyin .dy-keyword-check { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; cursor: pointer; }
.theme-douyin .dy-keyword-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.theme-douyin .dy-keyword-bulk select { width: auto; max-width: 160px; }
.theme-douyin .dy-keyword-update-settings { display: grid; gap: 8px; margin: 12px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.theme-douyin .dy-keyword-update-settings > form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.theme-douyin .dy-keyword-update-settings details { margin: 0; }
.theme-douyin .dy-keyword-schedule-form { display: grid; gap: 10px; margin-top: 8px; }
.theme-douyin .dy-keyword-schedule-form input[type=time] { width: auto; }
.theme-douyin .dy-keyword-name { min-width: 0; max-width: 150px; font-size: 13px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.theme-douyin .dy-keyword-state { flex: 0 0 auto; font-size: 11px; color: #529b2e; }
.theme-douyin .dy-keyword-state.is-muted { color: #909399; }
.theme-douyin .dy-keyword-actions { display: flex; align-items: center; gap: 4px; margin-left: 3px; }
.theme-douyin .dy-keyword-actions form { display: inline-flex; align-items: center; gap: 4px; }
.theme-douyin .dy-keyword-categories { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.theme-douyin .dy-keyword-categories button { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 10px; background: var(--paper); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.theme-douyin .dy-keyword-categories button.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-douyin .dy-keyword-categories span { color: var(--mute); font-size: 11px; }
.theme-douyin .dy-keyword-actions .ca-btn { min-height: 25px; height: 25px; padding: 0 7px; font-size: 11px; }
.theme-douyin .dy-keyword-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.theme-douyin .dy-keyword-toolbar label { color: var(--ink-2); font-size: 13px; }
.theme-douyin .dy-keyword-toolbar input { width: min(320px, 100%); }
.theme-douyin .dy-keyword-item[hidden] { display: none; }
.theme-douyin details { margin-top: 12px; }
.theme-douyin summary { font-size: 13px; color: var(--ink-2); cursor: pointer; line-height: 1.7; }
.theme-douyin details[open] > summary { margin-bottom: 12px; }
.theme-douyin .dy-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; margin-top: 20px; }
.theme-douyin .dy-settings-grid fieldset { margin: 0; padding: 20px; border-radius: 6px; border-color: var(--line-strong); }
.theme-douyin .dy-settings-grid legend { padding: 0 8px; color: var(--ink); font-size: 16px; font-weight: 500; }
.theme-douyin .dy-settings-grid label { display: grid; grid-template-columns: 185px minmax(0, 1fr); align-items: center; gap: 12px; margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
/* ⚠ 必须写足 3 个 :not()：上面的通用输入框规则带动词 :not([type=checkbox]):not([type=radio]):not([type=hidden])，
   特异性 (0,4,1) 高于本条的 (0,3,2)，否则 max-width:260px 会被压掉、输入框拉满整列。 */
.theme-douyin .dy-settings-grid label > input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.theme-douyin .dy-settings-grid label > select { width: 100%; max-width: 260px; }
.theme-douyin .dy-settings-grid label:has(input[type=checkbox]), .theme-douyin .dy-ai-form label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; }
.theme-douyin .dy-settings-grid label:has(textarea), .theme-douyin .dy-ai-form label:has(textarea) { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.theme-douyin .dy-settings-grid textarea, .theme-douyin .dy-ai-form textarea { margin: 0; }
.theme-douyin .dy-settings-grid .row { gap: 12px !important; margin: 16px 0 8px; }
.theme-douyin .dy-settings-grid .row label { margin: 0; }
.theme-douyin .dy-ai-settings { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.theme-douyin .dy-ai-settings > p, .theme-douyin .dy-ai-settings > label:has(textarea) { grid-column: 1 / -1; }
.theme-douyin .dy-form-footer { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.theme-douyin .dy-ai-form { margin-top: 16px; }
.theme-douyin .dy-ai-form label { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.theme-douyin [role=alert] { background: #fdf6ec; color: #9a6700; border: 1px solid #faecd8; border-radius: 4px; padding: 12px; font-size: 13px; }
.theme-douyin .dy-detail-nav { margin-bottom: 16px; font-size: 13px; }
.theme-douyin .dy-detail-hero { grid-template-columns: 160px minmax(0, 1fr); gap: 24px; }
.theme-douyin .dy-detail-cover { width: 160px; height: 220px; border-radius: 6px; }
.theme-douyin .dy-detail-info h1 { font-size: 24px; max-width: 1100px; }
.theme-douyin .dy-detail-tags { gap: 8px; margin: 16px 0; }
.theme-douyin .dy-detail-tags span { border-radius: 4px; color: var(--ink-2); background: #f5f7fa; font-size: 12px; }
.theme-douyin .dy-detail-hero-metrics { gap: 24px; margin: 20px 0; }
.theme-douyin .dy-detail-hero-metrics div { min-width: 120px; padding-right: 24px; }
.theme-douyin .dy-detail-hero-metrics strong { font-size: 24px; font-weight: 600; color: var(--ink); }
.theme-douyin .dy-detail-section-nav { padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; gap: 24px; }
.theme-douyin .dy-metric-grid { gap: 12px; }
.theme-douyin .dy-metric { padding: 16px; background: #f5f7fa; border-radius: 4px; }
.theme-douyin .dy-metric strong { font-size: 24px; font-weight: 600; color: var(--ink); }
.theme-douyin .dy-calendar th, .theme-douyin .dy-calendar td { text-align: center; }
.theme-douyin .dy-calendar td { height: 64px; vertical-align: top; }
.theme-douyin .dy-calendar strong { display: block; width: fit-content; margin: 4px auto 0; padding: 1px 6px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 400; }
.theme-douyin .dy-word-cloud { gap: 12px 16px; justify-content: flex-start; line-height: 1.6; padding: 16px; border-radius: 4px; background: #f5f7fa; }
.theme-douyin .dy-word-cloud span { color: var(--ink-2); }
.theme-douyin .dy-author-works { min-width: 620px; table-layout: fixed; }
.theme-douyin .dy-author-works th:first-child { width: 68%; }
.theme-douyin .dy-author-works th:nth-child(2) { width: 20%; }
.theme-douyin .dy-author-works th:last-child { width: 12%; }
.theme-douyin .dy-author-works a.dy-content-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.theme-douyin #dy-report { max-width: none; margin-top: 16px; overflow-wrap: anywhere; }
.theme-douyin #dy-report .ai-report-section-title { font-size: 1.05rem; }
.theme-douyin #dy-report .ai-report-section-body { font-size: 0.86rem; }
.theme-douyin #dy-report-nav { gap: 8px; margin: 16px 0; }
.theme-douyin #dy-report-nav a { border-radius: 4px; font-size: 13px; padding: 5px 10px; background: #f5f7fa; }
.theme-douyin .dy-report-section h2 { font-size: 18px; }
@media (max-width: 1200px) {
  .theme-douyin .dy-settings-grid label { grid-template-columns: 155px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body.theme-douyin .wrap { padding: 16px; }
  .theme-douyin .dy-settings-grid, .theme-douyin .dy-ai-settings, .theme-douyin .hot-video-boards, .theme-douyin .dy-detail-grid, .theme-douyin .dy-audience-grid { grid-template-columns: 1fr; }
  .theme-douyin .dy-range-form { gap: 12px; }
  .theme-douyin .dy-range-form label:first-child { width: auto; }
}
@media (max-width: 600px) {
  .theme-douyin .card, .theme-douyin .hot-video-board { padding: 16px; }
  .theme-douyin .dy-detail-hero { grid-template-columns: 1fr; }
  .theme-douyin .dy-detail-hero-metrics { gap: 16px; }
  .theme-douyin .dy-detail-hero-metrics div { min-width: 90px; padding-right: 16px; }
  .theme-douyin .dy-settings-grid label { grid-template-columns: 1fr; gap: 6px; }
  .theme-douyin .dy-settings-grid fieldset { padding: 16px; }
  .theme-douyin .dy-rank-item { grid-template-columns: 20px 40px minmax(0, 1fr); gap: 8px; }
  .theme-douyin .dy-rank-cover { width: 40px; height: 54px; }
  .theme-douyin .dy-rank-item .dy-rank-end { grid-column: 3; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
  .theme-douyin .dy-web-rank-list li { grid-template-columns: 20px minmax(0, 1fr); }
  .theme-douyin .dy-web-rank-list .dy-rank-end { grid-column: 2; flex-direction: row; justify-content: flex-end; align-items: center; gap: 12px; }
  .theme-douyin .dy-range-form > label { flex: 1 1 150px; }
  .theme-douyin .dy-range-form label.dy-link-field { flex-basis: 100%; }
  .theme-douyin .dy-range-form input:not([type=checkbox]):not([type=hidden]), .theme-douyin .dy-range-form select { width: 100% !important; }
}

/* 批量导入面板（关键词 / 账号名单）：折叠块 + 整宽多行输入 */
.theme-douyin .dy-import-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.theme-douyin .dy-import-panel > summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
  list-style: revert;
}
.theme-douyin .dy-import-panel[open] > summary { margin-bottom: 10px; }
.theme-douyin .dy-import-panel textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}
.theme-douyin .card > form > textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}
/* 待处理账号表里嵌入的表单不换行，避免 select 被压到第二行 */
.theme-douyin .dy-table select { min-width: 200px; max-width: 100%; }

/* ---------- 布局补全：这些类在 style.css 中没有任何定义，缺 display 就会塌成一列 ---------- */

/* 卡片栅格：视频详情的趋势、榜单，样本统计的作者 Top10 都复用它 */
.theme-douyin .dy-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.theme-douyin .dy-audience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.theme-douyin .dy-detail-grid > .card, .theme-douyin .dy-audience-grid > .card { margin-bottom: 0; }

/* 作者详情页的指标条、样本统计的词云 */
.theme-douyin .dy-detail-hero-metrics { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.theme-douyin .dy-word-cloud { display: flex; flex-wrap: wrap; align-items: baseline; }

/* 图表容器必须自带高度，否则 ECharts 初始化时读到 0 高度、画布不显示 */
.theme-douyin .dy-chart { width: 100%; min-height: 320px; }
.theme-douyin .dy-audience-card .dy-chart { min-height: 280px; }
.theme-douyin .dy-audience-card .dy-data-details { margin-top: 8px; }
.theme-douyin .dy-audience-table-scroll { overflow: auto; max-height: 320px; }

/* 图表沿用小红书强调红与辅助色。 */
.theme-douyin .dy-line { stroke: var(--dy-chart-pink); stroke-width: 2.5; }
.theme-douyin .dy-dot { fill: var(--dy-chart-pink); }
.theme-douyin .dy-area { fill: url(#dy-trend-area); opacity: 1; }
.theme-douyin .dy-bar-fill { background: var(--accent); }
.theme-douyin .dy-bar-track { background: #eef2f6; }
.theme-douyin #dy-audience .dy-bar-fill { background: var(--accent); }
.theme-douyin #dy-audience .dy-bar-track { background: #eef2f6; }
.theme-douyin #dy-radar .dy-compare-row:nth-child(3n+1) .dy-bar-fill { background: #ff2442; }
.theme-douyin #dy-radar .dy-compare-row:nth-child(3n+2) .dy-bar-fill { background: #8ec5ff; }
.theme-douyin #dy-radar .dy-compare-row:nth-child(3n+3) .dy-bar-fill { background: #22a06b; }

/* 空态提示（原先无样式时会紧贴上一行） */
.theme-douyin .dy-empty { margin: 0; padding: 20px 0; color: var(--ink-2); font-size: 13px; }

/* 表格滚动容器：这个类原先没有任何定义，dy-video-table 最小宽 1240px 会直接把卡片撑破。
   同时限高 + 表头吸顶，318 行的作品表、228 行的待处理账号表不再把页面拉到 16000px。 */
.theme-douyin .dy-table-scroll { overflow: auto; max-height: 70vh; border-radius: var(--radius-sm); }
.theme-douyin .dy-table-scroll .dy-table thead th { position: sticky; top: 0; z-index: 2; }
.theme-douyin .dy-table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.theme-douyin .dy-table-scroll::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 5px; }
.theme-douyin .dy-table-scroll::-webkit-scrollbar-thumb:hover { background: #c0c4cc; }

/* 原网页互动榜单没有封面列，标题只保留两行；避免把整篇发布文案当标题铺满卡片 */
.theme-douyin .dy-web-boards .dy-detail-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.theme-douyin .dy-web-rank-list li { padding: 10px 0; }


/* 榜单一行 4 列（指数/点赞/粉丝/时长）。条目已压缩成紧凑单行卡片，
   桌面端每卡约 440px 宽足够。≤1280px 退回两列，≤720px 单列。 */
@media (min-width: 1281px) {
  .theme-douyin .hot-video-boards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 901px) and (max-width: 1280px) {
  .theme-douyin .hot-video-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 首页「更新数据」卡片 */
.theme-douyin .dy-update-card { margin-bottom: 16px; }
.theme-douyin .dy-update-card .dy-range-form { margin: 12px 0 0; }
.theme-douyin .dy-update-card .dy-range-form > label { flex: 0 1 auto; }
.theme-douyin .dy-update-card .dy-range-form > label > input { width: 130px; }
.theme-douyin .dy-update-card .dy-range-form > label:first-child > input { width: 240px; }
.theme-douyin .dy-update-status { margin: 12px 0 0 !important; font-size: 13px; }

/* ---- 首页榜单：标题缩小、条目单行化、TOP 徽标（2026-10-13 用户要求） ---- */
/* 榜单卡标题（视频指数榜/点赞榜…）缩小 */
.theme-douyin .hot-video-board h2 { font-size: 13px; margin-bottom: 6px; }
.theme-douyin .hot-video-board { padding: 10px 10px 8px; }
/* 条目压成紧凑卡片：TOP徽标｜小封面｜标题+作者时间（单行截断）｜右侧数值与操作 */
.theme-douyin .dy-rank-item { grid-template-columns: 40px 40px minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; gap: 6px; min-height: 0; padding: 5px 6px; }
.theme-douyin .dy-rank-item .dy-rank-cover { width: 40px; height: 40px; object-fit: cover; }
/* 右侧：数值独占一行右对齐，下面两个操作排成小胶囊按钮 */
.theme-douyin .dy-rank-item .dy-rank-end { grid-column: 4; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px 5px; min-width: 100px; }
.theme-douyin .dy-rank-item .dy-rank-end .hot-video-val { flex: 0 0 100%; text-align: right; font-size: 15px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.theme-douyin .dy-rank-item .dy-rank-end a { box-sizing: border-box; font-size: 11px; line-height: 1.5; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.theme-douyin .dy-rank-item .dy-rank-end a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link { border-color: #c9cacc; background: #f4f4f5; color: var(--ink); }
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-done { border-color: var(--line-strong); background: #f5f7fa; color: var(--ink-2); }
.theme-douyin .dy-rank-item .hot-video-main { display: block; min-width: 0; }
.theme-douyin .dy-rank-item .hot-video-main small { display: none; }
.theme-douyin .dy-rank-item .hot-video-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; line-height: 1.4; }
.theme-douyin .dy-rank-item .hot-video-meta { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 前三名 TOP 徽标 */
.theme-douyin .hot-video-rank.is-top { display: inline-block; width: 40px; text-align: center; font-size: 10.5px; font-weight: 700; padding: 3px 0; border-radius: 4px; }
.theme-douyin .dy-rank-item .hot-video-rank { width: 40px; text-align: center; font-size: 12px; color: var(--mute); font-weight: 600; }
.theme-douyin .hot-video-rank.is-top.rank-1 { background: var(--accent); color: #fff; }
.theme-douyin .hot-video-rank.is-top.rank-2 { background: #4a4a4d; color: #fff; }
.theme-douyin .hot-video-rank.is-top.rank-3 { background: #77777d; color: #fff; }

/* 顶部两张操作卡现在分处两个页签（日历分析留在竞品分析，更新数据移到关键词管理），
   宽屏下各自的表单横向排列即可；只有窄屏才把控件拉满一行。
   用卡片类而不是 .dy-analysis-top 定位 —— 更新数据卡已经不在那个容器里了。 */
.theme-douyin .dy-analysis-top .dy-presets { display: flex; flex-wrap: wrap; }
.theme-douyin .dy-analysis-top .dy-months { display: flex; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.theme-douyin .dy-analysis-top .dy-months > span { color: var(--mute); font-size: 12px; margin-right: 4px; }
@media (max-width: 720px) {
  .theme-douyin .dy-update-card .dy-range-form,
  .theme-douyin .dy-calendar-card .dy-range-form { flex-direction: column; align-items: stretch; gap: 12px; }
  .theme-douyin .dy-update-card .dy-range-form > label,
  .theme-douyin .dy-calendar-card .dy-range-form > label { flex: 1 1 auto; width: 100%; }
  .theme-douyin .dy-update-card .dy-range-form > label > input:not([type=checkbox]):not([type=hidden]),
  .theme-douyin .dy-update-card .dy-range-form > label > select,
  .theme-douyin .dy-calendar-card .dy-range-form > label > input:not([type=checkbox]):not([type=hidden]),
  .theme-douyin .dy-calendar-card .dy-range-form > label > select { width: 100%; }
  /* 日期两个字段改成上下排列，「至」分隔符就没意义了 */
  .theme-douyin .dy-calendar-card .dy-range-form > span.muted { display: none; }
  .theme-douyin .dy-update-card .dy-range-form > button,
  .theme-douyin .dy-calendar-card .dy-range-form > button { align-self: stretch; }
}
/* 关键词标签行（对齐小红书的品类标签行 .up-cat-tabs）：
   左边是标签（只放本区间有作品的词），右边是搜索框，切词走服务端 ?keyword_id=。
   ⚠ .up-cat-tabs 是 display:grid，隐式列是 auto → 标签不换行时会被撑到 4400px 宽，
     把整个文档拽出横向滚动条。必须显式把列钉成 minmax(0, 1fr)。 */
.theme-douyin .dy-kw-tabs { grid-template-columns: minmax(0, 1fr); }
/* 整行一条下划线（原先挂在 .up-cat-seg 上，改成挂在 bar 上）：
   展开成多行时它落在最后一行下面，折叠时正好是标签的下沿。 */
.theme-douyin .dy-kw-bar { display: flex; align-items: flex-start; gap: 12px; min-width: 0; border-bottom: 1px solid var(--line); }
.theme-douyin .dy-kw-bar .up-cat-seg { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; gap: 4px; margin: 0; border-bottom: 0; }
/* 放不下就折成一行（用户 2026-10-14：不要左右滑动，改成折叠 + 展开）。
   --dy-kw-row 由模板里的脚本按第一个标签的实测高度写入，别写死 px 对不上字体。 */
.theme-douyin .dy-kw-tabs.is-collapsed .up-cat-seg { max-height: var(--dy-kw-row, 36px); overflow: hidden; }
/* 分类选中态与页面主导航一致。 */
.theme-douyin .dy-kw-bar .seg-tab { padding: 6px 8px; font-size: 0.84rem; font-weight: 400; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.theme-douyin .dy-kw-bar .seg-tab:hover { color: var(--accent); border-bottom-color: #ff9caf; }
.theme-douyin .dy-kw-bar .seg-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.theme-douyin .dy-kw-bar .up-cat-seg .seg-tab.active .up-cat-count { color: var(--accent); background: var(--accent-soft); }
.theme-douyin .dy-kw-group-panel[hidden] { display: none; }
.theme-douyin .dy-kw-group-panel { padding: 9px 10px 7px; border-radius: 9px; background: #f8f9fb; }
.theme-douyin .dy-kw-words { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.theme-douyin .dy-kw-words.is-collapsed { display: none; }
.theme-douyin .dy-kw-word { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink-2); font-size: 12px; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.theme-douyin .dy-kw-word:hover, .theme-douyin .dy-kw-word.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-douyin .dy-kw-word .dy-kw-menu-count { color: var(--ink-2); background: #ededee; }
.theme-douyin .dy-kw-word.active .dy-kw-menu-count { color: var(--accent); background: #fff; }
.theme-douyin .dy-kw-menu-count.is-zero { color: var(--mute); background: transparent; }
.theme-douyin .dy-kw-group-panel .dy-kw-toggle { margin-top: 5px; }
.theme-douyin .dy-kw-none { padding: 8px 2px; font-size: 13px; }
/* 说明行 + 「展开全部 / 收起」 */
.theme-douyin .dy-kw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-douyin .dy-kw-toggle { flex: 0 0 auto; appearance: none; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.theme-douyin .dy-kw-toggle:hover { text-decoration: underline; }
.theme-douyin .dy-kw-toggle[hidden] { display: none; }
.theme-douyin .dy-kw-search { position: relative; flex: 0 0 auto; width: 200px; max-width: 42vw; }
.theme-douyin .dy-kw-search input[type=search] { width: 100%; margin: 0; padding: 6px 10px; font-size: 13px; }
.theme-douyin .dy-kw-menu { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; width: max(220px, 100%); max-height: 320px; overflow: auto; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; box-shadow: 0 12px 28px rgba(0, 0, 0, .12); }
.theme-douyin .dy-kw-menu[hidden] { display: none; }
.theme-douyin .dy-kw-menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--ink); font-size: 13px; text-decoration: none; }
.theme-douyin .dy-kw-menu a:hover, .theme-douyin .dy-kw-menu a:focus-visible { background: var(--accent-soft); color: var(--accent); }
/* 菜单第一项「全部关键词」= 取消筛选，与下面的词拉开一点距离 */
.theme-douyin .dy-kw-menu-all { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 2px; font-weight: 600; }
.theme-douyin .dy-kw-menu-count { flex: 0 0 auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--mute); font-size: 11px; font-weight: 700; text-align: center; }
.theme-douyin .dy-kw-menu-empty { margin: 6px 8px; font-size: 12px; }
/* 说明文案收进一个「?」气泡：默认只占 18px，悬停/键盘聚焦才展开（用户 2026-10-15）。
   图标放在 seg 与搜索框之间、且必须在 .up-cat-seg 之外 —— .seg-tabs 有 overflow-y:hidden，
   放进去气泡会被裁掉。气泡用 :focus-within 而非 :focus，这样 Tab 进里面的链接不会闪走。 */
.theme-douyin .dy-kw-help { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 5px 0 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--mute); font-size: 11px; font-weight: 700; line-height: 1; cursor: help; }
.theme-douyin .dy-kw-help:hover, .theme-douyin .dy-kw-help:focus-visible { border-color: var(--accent); color: var(--accent); }
.theme-douyin .dy-kw-help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-douyin .dy-kw-help-pop { display: none; position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 460px; max-width: min(460px, calc(100vw - 48px)); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; box-shadow: 0 12px 28px rgba(0, 0, 0, .12); color: var(--ink-2); font-size: 12px; font-weight: 400; line-height: 1.6; text-align: left; white-space: normal; }
.theme-douyin .dy-kw-help:hover .dy-kw-help-pop,
.theme-douyin .dy-kw-help:focus-within .dy-kw-help-pop { display: block; }
/* 图标与气泡之间有 8px 空隙，鼠标斜穿时 :hover 会断一下（气泡闪）。用伪元素把空隙并进气泡；
   左右各外扩 12px，否则从图标左下角斜着移向气泡仍会漏出去。 */
.theme-douyin .dy-kw-help-pop::before { content: ''; position: absolute; top: -12px; left: -12px; right: -12px; height: 12px; }
/* 「查看全部作品」整串换行，不要被拆成「…作品 / 品」。 */
.theme-douyin .dy-kw-help-pop a { color: var(--accent); font-weight: 600; white-space: nowrap; }
@media (max-width: 720px) {
  .theme-douyin .dy-kw-bar { flex-direction: column; align-items: stretch; }
  .theme-douyin .dy-kw-help { align-self: flex-start; margin-top: 0; }
  /* 窄屏下 bar 变成纵向、图标跑到最左，气泡若仍右对齐会整块跑到屏幕外（实测 left = -419）。
     改成从图标左沿向右展开。 */
  .theme-douyin .dy-kw-help-pop { left: 0; right: auto; }
  .theme-douyin .dy-kw-search { width: 100%; max-width: none; }
}
.theme-douyin .dy-analysis-rankings { padding: 20px; }
.theme-douyin .dy-account-analysis .up-cat-seg .seg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.theme-douyin .dy-account-analysis .up-cat-seg .seg-tab.active .up-cat-count { color: var(--accent); background: #e7e7e9; }
.theme-douyin .dy-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px 14px; margin: 14px 0; }
.theme-douyin .dy-category-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13px; }
.theme-douyin .dy-category-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-douyin .dy-category-item select { flex: 0 0 100px; width: 100px; }
.theme-douyin .dy-analysis-rankings .hot-video-head { margin-bottom: 14px; }
.theme-douyin .dy-analysis-rankings .hot-video-head h2 { margin: 0 0 4px; }
.theme-douyin .dy-analysis-rankings .hot-video-head p { margin: 0; }
.theme-douyin .dy-analysis-rankings .hot-video-boards { margin-bottom: 0; }
.theme-douyin .dy-analysis-rankings .hot-video-board { padding: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: none; border-radius: 6px; }
.theme-douyin .dy-analysis-rankings .hot-video-board-title { color: var(--ink-2); font-size: 13px; margin-bottom: 8px; }
/* 一屏 4 个榜单（指数/点赞/收藏/评论）；右栏占走 340px 后左栏会变窄，
   所以改成按可用宽度自动排（≥280px 一列）——1920 屏仍是 4 列，窄屏自动变 3/2 列。 */
.theme-douyin .dy-analysis-rankings .hot-video-boards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.theme-douyin .dy-analysis-rankings .dy-compact-rank { grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 4px; min-height: 0; padding: 5px 2px; }
.theme-douyin .dy-compact-rank .hot-video-rank { width: 16px; text-align: center; font-size: 11px; font-weight: 700; color: var(--mute); }
.theme-douyin .dy-compact-rank .hot-video-rank.rank-1 { color: var(--accent); }
.theme-douyin .dy-compact-rank .hot-video-rank.rank-2,
.theme-douyin .dy-compact-rank .hot-video-rank.rank-3 { color: var(--ink-2); }
.theme-douyin .dy-compact-rank .hot-video-main { min-width: 0; }
.theme-douyin .dy-compact-rank .hot-video-title,
.theme-douyin .dy-compact-rank .hot-video-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-douyin .dy-compact-rank .hot-video-title { font-size: 12px; font-weight: 600; line-height: 1.3; }
.theme-douyin .dy-compact-rank .hot-video-meta { font-size: 10px; line-height: 1.25; }
.theme-douyin .dy-compact-rank .hot-video-val { font-size: 12px; color: var(--ink); }
.theme-douyin .dy-compact-rank .hot-video-item-actions { display: flex; gap: 3px; }
.theme-douyin .dy-compact-rank .hot-video-item-actions a { padding: 1px 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink-2); font-size: 10px; line-height: 1.35; white-space: nowrap; }
.theme-douyin .dy-compact-rank .hot-video-item-actions a.dy-analysis-link { border-color: #a9a9ac; color: var(--ink); }
.theme-douyin .dy-compact-rank .hot-video-item-actions a:hover { border-color: var(--accent); color: var(--accent); }
.theme-douyin .dy-index-rank { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.theme-douyin .dy-index-rank summary { width: fit-content; color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.theme-douyin .dy-index-rank .hot-video-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 10px; }
.theme-douyin .dy-index-rank .dy-compact-rank { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.theme-douyin .dy-analysis-authors > h2 { margin: 0 0 4px; }
.theme-douyin .dy-analysis-authors > p { margin: 0 0 14px; }
.theme-douyin .dy-analysis-authors .up-leader-board { border-radius: var(--radius-sm); }
.theme-douyin .dy-analysis-authors .up-leader-val { font-variant-numeric: tabular-nums; }
.theme-douyin .dy-analysis-authors .dy-author-name-btn { flex: 1; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; }
@media (max-width: 1100px) { .theme-douyin .dy-analysis-rankings .hot-video-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .theme-douyin .dy-analysis-rankings .hot-video-boards { grid-template-columns: minmax(0, 1fr); }
  .theme-douyin .dy-index-rank .hot-video-list { grid-template-columns: minmax(0, 1fr); }
  .theme-douyin .dy-analysis-rankings .dy-compact-rank { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .theme-douyin .dy-compact-rank .hot-video-val { grid-column: 3; grid-row: 1; }
  .theme-douyin .dy-compact-rank .hot-video-item-actions { grid-column: 2 / 4; justify-self: end; }
}

/* 账号追踪抽屉：账号概况 + 统计周期 + 作品榜（含视频指数）。
   抽屉挂在 body 下（不在 seg-panel 内），所以用 .theme-douyin 后代选择器。 */
.theme-douyin .dy-au-hero { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; }
.theme-douyin .dy-au-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: block; background: #f0f2f5; }
.theme-douyin .dy-au-name { margin: 0 0 2px; font-size: 17px; }
.theme-douyin .dy-au-meta { margin: 0 0 4px; font-size: 12px; color: var(--mute); }
.theme-douyin .dy-au-more { font-size: 12px; color: var(--accent); text-decoration: none; }
.theme-douyin .dy-au-more:hover { text-decoration: underline; }
.theme-douyin .dy-au-error { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: #fef2f2; color: #b42318; font-size: 13px; }
.theme-douyin .dy-au-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.theme-douyin .dy-au-kpi { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: #fafbfc; }
.theme-douyin .dy-au-kpi .k { font-size: 12px; color: var(--mute); }
.theme-douyin .dy-au-kpi .v { font-size: 17px; font-weight: 700; }
.theme-douyin .dy-au-sec-title { margin: 18px 0 8px; font-size: 14px; }
.theme-douyin .dy-au-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.theme-douyin .dy-au-table th, .theme-douyin .dy-au-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.theme-douyin .dy-au-table th:not(:first-child), .theme-douyin .dy-au-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.theme-douyin .dy-au-note { margin: 8px 0 0; font-size: 12px; line-height: 1.6; }
.theme-douyin .dy-au-empty { margin: 0; font-size: 13px; line-height: 1.7; }
.theme-douyin .dy-au-works { display: grid; gap: 8px; }
.theme-douyin .dy-au-work { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.theme-douyin .dy-au-work > img, .theme-douyin .dy-au-work-cover-empty { width: 44px; height: 58px; flex: 0 0 auto; display: block; border-radius: 4px; object-fit: cover; background: #f0f2f5; }
.theme-douyin .dy-au-work-main { flex: 1 1 auto; min-width: 0; }
.theme-douyin .dy-au-work-title { display: block; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-douyin .dy-au-work-title:hover { color: var(--accent); }
.theme-douyin .dy-au-work-meta { font-size: 12px; margin-top: 2px; }
/* 「主页」来源小标：这几个字是账号更新时顺带抓的主页作品，不是创作者中心作品榜 */
.theme-douyin .dy-au-work-src { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line-strong)); border-radius: 3px; background: var(--accent-soft); color: var(--accent-deep); font-size: 11px; line-height: 16px; }
.theme-douyin .dy-au-work-numbers { font-size: 12px; color: var(--ink-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.theme-douyin .dy-au-work-numbers strong { color: var(--ink); }
.theme-douyin .dy-au-work-actions { display: flex; gap: 12px; margin-top: 4px; font-size: 12px; }
.theme-douyin .dy-au-work-actions a { color: var(--accent); text-decoration: none; }
.theme-douyin .dy-au-work-actions a:hover { text-decoration: underline; }

/* 账号追踪页顶部「更新数据」操作条：更新入口必须一眼可见（用户反馈原来埋在页面底部） */
.theme-douyin .dy-track-actions { border-left: 3px solid var(--accent); }
.theme-douyin .dy-track-actions .dy-section-head { margin-bottom: 0; }
.theme-douyin .dy-track-actions .dy-range-form { margin: 10px 0 4px; gap: 12px; }
.theme-douyin .dy-track-actions .dy-range-submit { flex: 0 0 auto; }
.theme-douyin .dy-track-actions > p.muted { margin: 0; font-size: 12px; line-height: 1.65; }
/* 操作条内部横向排列，避免「仅更新此分类」文字悬在按钮上方 */
.theme-douyin .dy-track-actions .dy-range-form { align-items: center; }
.theme-douyin .dy-track-actions .dy-range-form > label { flex-direction: row; align-items: center; gap: 8px; align-self: auto; color: var(--ink-2); font-size: 13px; }
.theme-douyin .dy-track-actions .dy-range-form > label > input:not([type=checkbox]) { width: 170px; }
/* 榜单里还没取过数的账号：显示「待更新」而不是破折号，避免被当成数据缺失/坏了 */
.theme-douyin .up-leader-val.is-pending { color: var(--mute); font-weight: 400; font-size: 12px; }

/* 与小红书页面共用视觉尺度，保留抖音现有数据布局。 */
/* 竞品分析改成「左榜单 + 右操作栏」两栏后，1280px 会把右栏挤窄、且 1920 屏右侧仍空 500px；
   所以只有这一个页面（/dygjc/douyin 竞品分析）横铺到 1680px —— 左栏宽度与改造前基本一致，
   右栏正好落进原来那块空白。其它抖音页（账号 / 广告 / 详情）保持 1280px 不变。 */
body.theme-douyin.is-dy-wide .wrap { max-width: 1680px; }
body.theme-douyin .wrap { max-width: 1280px; padding: 24px; }
body.theme-douyin .card { padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
body.theme-douyin .seg-tabs { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 4px; }
body.theme-douyin .seg-tab { padding: 11px 16px; font-weight: 700; }
body.theme-douyin .ca-btn { border-radius: 999px; font-weight: 600; }
body.theme-douyin input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
body.theme-douyin select, body.theme-douyin textarea { border-radius: var(--radius-sm); background: #f7fafc; }
body.theme-douyin .dy-preset, body.theme-douyin .dy-rank-item .dy-rank-end a { border-radius: 999px; }
body.theme-douyin .dy-keyword-item, body.theme-douyin .dy-analysis-rankings .hot-video-board { border-radius: var(--radius-sm); }
body.theme-douyin .dy-analysis-rankings .hot-video-board { padding: 12px; background: var(--bg); box-shadow: none; }
body.theme-douyin .brand-mark-douyin { color: var(--accent); }
body.theme-douyin .brand-mark-douyin { border-left: 3px solid transparent; border-image: linear-gradient(var(--dy-cyan), var(--dy-pink)) 1; padding-left: 10px; }
body.theme-douyin .brand-mark-douyin .douyin-brand-text { color: var(--ink) !important; }
body.theme-douyin .dy-update-card { position: relative; overflow: hidden; }
body.theme-douyin .dy-update-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--dy-cyan), var(--dy-pink)); }

/* 「设置」页的二级页签做成「分段控件」：顶部页签仍用下划线，二级换成药丸分段，
   层级一眼可分，四个标签也聚成一个整体。只作用于抖音爆款设置页这一组；
   抖音广告页那两排（我方/竞品）暂未改动。 */
body.theme-douyin [data-storage-key="douyin-settings-sub"] > .seg-tabs.dygg-sub-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%;
  margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
}
body.theme-douyin [data-storage-key="douyin-settings-sub"] > .seg-tabs.dygg-sub-tabs .seg-tab {
  padding: 7px 14px; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 0; border-radius: 9px;
}
body.theme-douyin [data-storage-key="douyin-settings-sub"] > .seg-tabs.dygg-sub-tabs .seg-tab:hover { background: var(--paper); color: var(--ink); }
body.theme-douyin [data-storage-key="douyin-settings-sub"] > .seg-tabs.dygg-sub-tabs .seg-tab.active { background: var(--accent); color: #fff; }

/* 更新与分析设置沿用小红书的单列卡片和分行控件。 */
.theme-douyin .dy-crawl-settings { display: grid; gap: 14px; max-width: 52rem; width: 100%; }
.theme-douyin [data-panel="crawl"] > .card { max-width: 52rem; }
.theme-douyin .dy-crawl-settings .crawl-settings-top h2 { margin: 0 0 4px; }
.theme-douyin .dy-crawl-settings .crawl-settings-top p { margin: 0; }
.theme-douyin .dy-crawl-settings .btn-primary { flex: 0 0 auto; }
.theme-douyin .dy-crawl-settings .dy-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; }
.theme-douyin .dy-crawl-settings .dy-settings-grid > .dy-settings-card { min-width: 0; margin: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.theme-douyin .dy-crawl-settings .dy-settings-grid > .dy-settings-card > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.theme-douyin .dy-crawl-settings .dy-settings-grid > .dy-settings-card > h3::before { content: ""; width: 3px; height: 13px; flex: 0 0 3px; border-radius: 2px; background: linear-gradient(var(--dy-cyan), var(--dy-pink)); }
.theme-douyin .dy-crawl-settings .dy-settings-grid > .dy-settings-card:not(.dy-schedule-card) > label { padding: 10px 0; border-bottom: 1px solid var(--line); }
.theme-douyin .dy-crawl-settings .dy-settings-grid > .dy-settings-card:not(.dy-schedule-card) > label:last-child { border-bottom: 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .toggle-row > div:first-child { min-width: 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .pace-row { padding: 16px 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .toggle-row > input,
.theme-douyin .dy-crawl-settings .dy-schedule-card .toggle-row > select { width: 175px; flex: 0 0 auto; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .window-days input,
.theme-douyin .dy-crawl-settings .dy-gap-inputs input { width: 74px; }
.theme-douyin .dy-crawl-settings .dy-gap-inputs { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.theme-douyin .dy-crawl-settings .dy-schedule-card label.switch { display: inline-block; flex: 0 0 44px; width: 44px; height: 24px; margin: 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card label.switch input { width: 0; height: 0; min-width: 0; margin: 0; }
.theme-douyin .dy-crawl-settings .dy-schedule-card label.ai-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 10px; color: var(--ink); border-radius: 999px; }
.theme-douyin .dy-crawl-settings .dy-schedule-card .ai-window-chips { margin-top: 10px; }
.theme-douyin .dy-crawl-settings .dy-form-footer { grid-column: auto; padding: 0; border: 0; }

/* 榜单「详情 / 分析」沿用小红书的侧边抽屉，原页面可单独访问。 */
.theme-douyin .dy-post-drawer .nd-drawer-stack { width: min(1120px, 82vw); max-width: none; }
.theme-douyin .dy-post-drawer.is-analysis .nd-drawer-stack { width: 60vw; max-width: 60vw; }
.theme-douyin .dy-post-drawer.is-analysis .nd-drawer-panel { background: linear-gradient(180deg, #fff8f9 0%, #fff 140px); }
.theme-douyin .dy-post-drawer.is-analysis .nd-drawer-head { border-bottom: 0; padding-bottom: 0.55rem; background: transparent; }
.theme-douyin .dy-post-drawer.is-analysis .dy-post-drawer-heading > span { color: #ff2442; font-weight: 700; letter-spacing: 0.08em; }
.theme-douyin .dy-post-drawer.is-analysis .dy-post-drawer-heading h2 { font-size: 1.02rem; max-width: min(48vw, calc(100% - 0.5rem)); }
.theme-douyin .dy-post-drawer.is-analysis .dy-post-drawer-full { display: none; }
.theme-douyin .dy-post-drawer .nd-drawer-body { display: flex; overflow: hidden; padding: 0; }
.theme-douyin .dy-post-drawer iframe { display: block; width: 100%; height: 100%; flex: 1 1 auto; border: 0; background: #fff; }
.theme-douyin .dy-post-drawer iframe[hidden], .theme-douyin .dy-post-drawer .dy-post-drawer-full[hidden] { display: none; }
.theme-douyin .dy-post-drawer-heading { min-width: 0; }
.theme-douyin .dy-post-drawer-heading > span { display: block; font-size: 11px; line-height: 1.2; }
.theme-douyin .dy-post-drawer-heading h2 { max-width: min(60vw, 870px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-douyin .dy-post-drawer-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.theme-douyin .dy-post-drawer .nd-drawer-close:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--line-strong); }
.theme-douyin:has(.dy-post-drawer.is-open.is-analysis) #dy-workflow-modal,
.theme-douyin:has(.dy-post-drawer.is-open.is-analysis) #dy-workflow-dock { display: none; }
.theme-douyin .dy-ai-progress h2 { margin: 0 0 12px; }
.theme-douyin .dy-ai-progress .crawl-progress { margin: 12px 0; }
.theme-douyin .dy-ai-progress.is-active .crawl-progress-bar { width: 32% !important; animation: dy-ai-indeterminate 1.6s ease-in-out infinite; }
@keyframes dy-ai-indeterminate { from { transform: translateX(-110%); } to { transform: translateX(325%); } }
/* 分析按钮按结果着色；失败原因放在悬停提示与分析抽屉内。 */
.theme-douyin a.dy-analysis-link.is-pending { border-color: #b8c2ce; color: #667085; background: #fff; }
.theme-douyin a.dy-analysis-link.is-done,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-done { border-color: #79c9a3; color: #146b45; background: #eefaf3; }
.theme-douyin a.dy-analysis-link.is-manual,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-manual { border-color: #b9a5e8; color: #6044a8; background: #f6f1ff; }
.theme-douyin a.dy-analysis-link.is-failed,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-failed { border-color: #ed8792; color: #b42335; background: #fff1f2; }
.theme-douyin .dy-analysis-legend { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; margin-top: 7px; font-size: 11px; }
.theme-douyin .dy-analysis-legend span { padding: 1px 5px; border: 1px solid; border-radius: 4px; }
.theme-douyin .dy-analysis-legend .is-pending { border-color: #b8c2ce; color: #667085; }
.theme-douyin .dy-analysis-legend .is-done { border-color: #79c9a3; color: #146b45; }
.theme-douyin .dy-analysis-legend .is-manual { border-color: #b9a5e8; color: #6044a8; }

/* 榜单操作与小红书的详情 / 分析按钮保持一致。 */
.theme-douyin .hot-video-item .hot-video-item-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  padding: 0 0.28rem;
  margin: 0;
  border: 1px solid #f5c2c5;
  border-radius: 4px;
  background: #fff;
  color: #c0272d;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
}
.theme-douyin .hot-video-item .hot-video-item-actions a:hover {
  border-color: #ff2442;
  background: #ff2442;
  color: #fff;
}
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link.is-done {
  border-color: #9fd6bb;
  background: #f0faf5;
  color: #0f7b4a;
}
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link.is-done:hover {
  border-color: #0f7b4a;
  background: #0f7b4a;
  color: #fff;
}
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link:not(.is-done):not(.is-manual),
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link:not(.is-done):not(.is-manual) {
  border-color: #f5c2c5;
  background: #fff;
  color: #c0272d;
}
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link:not(.is-done):not(.is-manual):hover,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link:not(.is-done):not(.is-manual):hover {
  border-color: #ff2442;
  background: #ff2442;
  color: #fff;
}
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-done {
  border-color: #9fd6bb;
  background: #f0faf5;
  color: #0f7b4a;
}
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-done:hover {
  border-color: #0f7b4a;
  background: #0f7b4a;
  color: #fff;
}
.theme-douyin .dy-analysis-legend .is-failed { border-color: #ed8792; color: #b42335; }

/* 关键词页日历与小红书竞品分析使用相同的区间表单和月份导航。 */
body.theme-douyin .card.dy-calendar-card { padding: 20px; }
.theme-douyin .dy-calendar-card h2 { margin: 0 0 4px; }
.theme-douyin .dy-calendar-card .range-form { margin-bottom: 0; }
.theme-douyin .dy-calendar-card .month-jump { margin-top: 0.85rem; }
.theme-douyin .dy-kw-group-panel { padding: 8px 10px; }
.theme-douyin .dy-kw-group-panel .dy-kw-toggle { margin-top: 0; }
.theme-douyin .dy-kw-group-panel .dy-kw-words:not(.is-collapsed) + .dy-kw-toggle { margin-top: 8px; }
.theme-douyin .dy-video-table .dy-table-sequence { color: var(--mute); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.theme-douyin .dy-video-table th:first-child { text-align: center; }
.theme-douyin .dy-video-table .dy-table-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.theme-douyin .dy-video-table .dy-table-sort:hover,
.theme-douyin .dy-video-table th[aria-sort="ascending"] .dy-table-sort,
.theme-douyin .dy-video-table th[aria-sort="descending"] .dy-table-sort { color: var(--accent); }
.theme-douyin .dy-video-table .dy-table-sort-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; background: #e8ecf0; color: #627086; font-size: 14px; line-height: 1; }
.theme-douyin .dy-video-table th[aria-sort="ascending"] .dy-table-sort-icon,
.theme-douyin .dy-video-table th[aria-sort="descending"] .dy-table-sort-icon { background: var(--accent-soft); color: var(--accent); }
.theme-douyin .dy-video-table .dy-work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.theme-douyin .dy-video-table .dy-work-actions a:not(.dy-original-link) { display: inline-flex; align-items: center; justify-content: center; padding: 1px 5px; border: 1px solid #f5c2c5; border-radius: 4px; background: #fff; color: #c0272d; font-size: 12px; font-weight: 600; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.theme-douyin .dy-video-table .dy-work-actions a:not(.dy-original-link):hover { border-color: #ff2442; background: #ff2442; color: #fff; }
.theme-douyin .dy-video-table .dy-work-actions a.dy-analysis-link.is-done { border-color: #9fd6bb; background: #f0faf5; color: #0f7b4a; }
.theme-douyin .dy-video-table .dy-work-actions a.dy-analysis-link.is-done:hover { border-color: #0f7b4a; background: #0f7b4a; color: #fff; }
.theme-douyin .dy-video-table .dy-work-actions .dy-original-link { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.theme-douyin .dy-video-table td:nth-child(3) > .muted,
.theme-douyin .dy-video-table td:nth-child(4) > .muted,
.theme-douyin .dy-video-table .dy-metric-date { display: block; }
.theme-douyin .dy-video-table .dy-metric-date { font-size: 11px; white-space: nowrap; }
.theme-douyin .dy-video-table .dy-work-actions a.dy-analysis-link.is-manual,
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link.is-manual,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-manual { border-color: #9fd6bb; background: #f0faf5; color: #0f7b4a; }
.theme-douyin .dy-video-table .dy-work-actions a.dy-analysis-link.is-manual:hover,
.theme-douyin .hot-video-item .hot-video-item-actions a.dy-analysis-link.is-manual:hover,
.theme-douyin .dy-rank-item .dy-rank-end a.dy-analysis-link.is-manual:hover { border-color: #0f7b4a; background: #0f7b4a; color: #fff; }
.theme-douyin .dy-analysis-legend .is-manual { border-color: #9fd6bb; color: #0f7b4a; }

body.theme-douyin.is-dy-embed { min-height: 100%; background: #fff; }
body.theme-douyin.is-dy-embed .app { display: block; min-height: 100%; }
body.theme-douyin.is-dy-embed .side-nav,
body.theme-douyin.is-dy-embed .workspace-top,
body.theme-douyin.is-dy-embed .mobile-tabs,
body.theme-douyin.is-dy-embed .dy-detail-nav,
body.theme-douyin.is-dy-embed .nd-video-page > p:first-child { display: none; }
body.theme-douyin.is-dy-embed .workspace { width: 100%; min-width: 0; margin: 0; }
body.theme-douyin.is-dy-embed .wrap { max-width: none; padding: 16px; }
body.theme-douyin.is-dy-embed .card { padding: 18px; margin-bottom: 14px; box-shadow: none; border: 1px solid var(--line); }
body.theme-douyin.is-dy-embed .dy-detail-page { max-width: none; }
body.theme-douyin.is-dy-embed .dy-ai-page { padding: 0; }
body.theme-douyin.is-dy-embed .dy-ai-page-title { display: none; }
body.theme-douyin.is-dy-embed .dy-ai-page #dy-report { margin-top: 0; }
.theme-douyin .dy-ai-page #dy-report { margin: 0; }
.theme-douyin .dy-ai-message { margin: 0 0 0.6rem; font-size: 0.8rem; }
.theme-douyin .ai-run-modal .dy-ai-form { display: flex; flex-direction: column; min-height: 0; margin: 0; flex: 1 1 auto; }
.theme-douyin .ai-run-modal .dy-ai-form .ai-run-modal-body { min-height: 0; }
.theme-douyin .ai-run-modal .dy-ai-form label { margin: 0.35rem 0; font-size: 0.82rem; }
body.theme-douyin.is-dy-embed .dy-detail-page .card h1 { font-size: 19px; line-height: 1.5; }
.theme-douyin .dy-embed-back { margin-bottom: 14px; }
.theme-douyin .dy-ai-options { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.theme-douyin .dy-ai-options summary { margin: 0; color: var(--ink); font-weight: 600; }
.theme-douyin .dy-ai-options[open] summary { margin-bottom: 16px; }
.theme-douyin .dy-ai-options label:last-child { margin-bottom: 0; }
.theme-douyin .dy-ai-submit { display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) {
  body.theme-douyin .wrap { padding: 14px; }
  .theme-douyin .dy-post-drawer .nd-drawer-stack { width: 100vw; }
  .theme-douyin .dy-post-drawer.is-analysis .nd-drawer-stack { width: 100vw; max-width: 100vw; }
  .theme-douyin .dy-post-drawer-heading h2 { max-width: 42vw; }
  .theme-douyin .dy-post-drawer-full { display: none; }
  .theme-douyin .dy-crawl-settings .dy-schedule-card .toggle-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .theme-douyin .dy-crawl-settings .dy-gap-inputs { justify-content: flex-start; }
}

/* 抖音爆款 UP 统计沿用小红书的榜单配色与抽屉密度。 */
.theme-douyin .dy-account-analysis .up-leader-detail {
  color: #c0272d;
  background: #fff;
  border-color: #f5c2c5;
}
.theme-douyin .dy-account-analysis .up-leader-detail:hover {
  color: #fff;
  background: #ff2442;
  border-color: #ff2442;
}
.theme-douyin #dy-author-drawer .nd-drawer-stack { width: 60vw; max-width: 60vw; }
.theme-douyin #dy-author-drawer .nd-up-hl-item .note-hit-detail {
  display: block;
  width: 100%;
  color: #c0272d;
  background: #fff;
  border: 1px solid #f5c2c5;
  border-radius: 4px;
  padding: 0 0.28rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.theme-douyin #dy-author-drawer .nd-up-hl-item .note-hit-detail:hover {
  color: #fff;
  background: #ff2442;
  border-color: #ff2442;
}
.theme-douyin #dy-author-drawer .nd-drawer-panel-sub .nd-drawer-body { padding: 0; overflow: hidden; }
.theme-douyin #dy-author-drawer .nd-drawer-panel-sub iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.theme-douyin #dy-author-drawer button.nd-drawer-close:hover {
  background: #fff5f5;
  color: #c0272d;
  border-color: #f5c2c5;
}
@media (max-width: 700px) { .theme-douyin #dy-author-drawer .nd-drawer-stack { width: 100vw; } }
