* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }

:root {
  --app-zoom: 1.5;
  --sidebar-width: 272px;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --text: #182132;
  --muted: #667085;
  --line: #d9e0ea;
  --line-soft: #e8edf4;
  --primary: #12b886;
  --primary-strong: #099268;
  --primary-soft: #e6fcf5;
  --blue: #3b82f6;
  --warning: #f59f00;
  --danger: #e03131;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

@media (min-width: 821px) {
  body {
    zoom: var(--app-zoom);
  }
}

button, input, select, textarea { font: inherit; }
button { border: 0; }

.mobile-header { display: none; }

.mobile-header img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 6px;
}

.mobile-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-company-logo {
  margin-left: auto;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: #d6deea;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.logo {
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-shell {
  display: grid;
  grid-template-columns: 58px auto auto;
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-width: 0;
}

.logo-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #06251d;
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
  overflow: hidden;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text {
  min-width: 0;
}

.logo-text strong {
  display: block;
  color: #f8fafc;
  font-size: 17px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.company-inline-logo {
  width: 54px;
  height: 34px;
  object-fit: contain;
  border-radius: 0;
  flex: 0 0 auto;
  justify-self: start;
  margin-left: 4px;
}

.logo-text span {
  display: block;
  margin-top: 5px;
  color: #98a2b3;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
}

.nav-section {
  padding: 14px 10px 0;
}

.nav-title {
  padding: 0 10px 8px;
  color: #98a2b3;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-primary {
  padding-top: 18px;
}

.nav-insights,
.nav-system,
.nav-categories {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nav-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #b8c2d2;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(18,184,134,0.16); color: #63e6be; }
.nav-link { text-decoration: none; }
.nav-item .icon { width: 16px; text-align: center; opacity: .75; }
.nav-item .icon i { width: 16px; }

.nav-badge {
  margin-left: auto;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(18,184,134,0.18);
  color: #63e6be;
  font-size: 11px;
  font-weight: 700;
}

.main {
  margin-left: var(--sidebar-width);
  padding: 26px 32px 40px;
  min-width: 0;
}

.page { display: none; }
.page.active { display: block; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  min-width: 0;
}

.topbar h2 {
  color: var(--text) !important;
  letter-spacing: 0;
}

.topbar p { color: var(--muted) !important; }

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.search-box input,
.form-input,
.filter-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  outline: 0;
}

.search-box input { padding-left: 42px; }
.search-box input:focus,
.form-input:focus,
.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18,184,134,.13);
}

.filter-select { min-width: 160px; }

.filter-btn,
.add-btn,
.hotspot-btn,
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
  white-space: nowrap;
}

.filter-btn {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.filter-btn:hover { border-color: #b8c2d2; box-shadow: var(--shadow); }

.add-btn,
.btn-primary,
.hotspot-btn-primary {
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.add-btn:hover,
.btn-primary:hover,
.hotspot-btn-primary:hover {
  background: var(--primary-strong);
  box-shadow: 0 8px 20px rgba(18,184,134,.24);
}

.hotspot-btn-secondary,
.btn-secondary {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.tags-filter,
.platform-tabs,
.time-filter,
.view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tags-filter { margin-bottom: 22px; }

#page-topics .topbar {
  margin-bottom: 16px;
}

#page-topics .tags-filter {
  margin-bottom: 16px;
}

#page-topics .stats-grid {
  gap: 12px;
  margin-bottom: 16px;
}

#page-topics .stat-card {
  min-height: 76px;
  padding: 14px 16px;
}

#page-topics .stat-value {
  font-size: 25px;
  margin-bottom: 6px;
}

.tag,
.platform-tab,
.time-btn,
.view-btn {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.tag:hover,
.platform-tab:hover,
.time-btn:hover,
.view-btn:hover {
  border-color: #b8c2d2;
  color: var(--text);
}

.tag.active,
.platform-tab.active,
.time-btn.active,
.view-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}

.platform-tabs {
  margin-bottom: 18px;
  padding: 0;
  width: auto;
  background: transparent;
  border: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  min-height: 92px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}

.stat-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.stat-value.primary { color: var(--primary-strong); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }
.stat-label { color: var(--muted); font-size: 13px; }

.topics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.topics-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.topics-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.topics-grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
}

.topics-grid-list {
  grid-template-columns: 1fr;
}

.topic-card,
.ai-panel,
.log-row,
.modal {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}

.topic-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 16px;
  padding: 16px 18px;
  min-width: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.topic-card:hover {
  border-color: #b8c2d2;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.topic-header,
.topic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topic-header { margin-bottom: 12px; }
.topic-footer { border-top: 1px solid var(--line-soft); padding-top: 12px; }

.topic-main {
  min-width: 0;
}

.topic-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  border-left: 1px solid var(--line-soft);
  padding-left: 14px;
}

.topic-level1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.topic-probability {
  min-width: 92px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--danger);
  font-weight: 900;
}

.topic-probability strong {
  font-size: 18px;
  line-height: 1;
}

.topic-probability span {
  margin-top: 3px;
  font-size: 11px;
}

.topic-level2 {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
}

.topic-level2 .topic-category,
.topic-level2 .topic-hot,
.topic-level2 .topic-platform,
.candidate-level2 .topic-category,
.candidate-level2 .topic-hot,
.candidate-level2 .topic-platform {
  background: #fff9db;
  color: #b7791f;
}

.topic-level3,
.candidate-level3 {
  opacity: .86;
}

.topic-level3 .topic-tag,
.candidate-level3 .topic-tag,
.candidate-level3 .candidate-risk {
  background: #ebfbee;
  color: #2b8a3e;
}

.topic-category,
.topic-tag,
.hotspot-tag,
.topic-hot,
.topic-platform,
.candidate-risk {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.topic-category {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.topic-score,
.log-side span,
.ai-row span {
  color: var(--primary-strong);
  font-weight: 800;
}

.topic-score {
  white-space: nowrap;
}

.topic-title,
.hotspot-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.topic-desc,
.topic-source,
.topic-ref,
.hotspot-meta,
.log-meta,
.log-error,
.log-side small,
.ai-row p,
.ai-summary {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.topic-desc {
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}

.topic-actions,
.ai-row-actions,
.hotspot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.topic-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.adopt-btn {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.adopt-btn:hover {
  background: #c92a2a;
}

.adopt-btn.is-static {
  background: #f1f3f5;
  color: var(--muted);
  cursor: default;
}

.topic-side .topic-actions {
  width: 100%;
  justify-content: flex-end;
}

.action-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
}
.action-btn:hover { color: var(--text); background: #eef2f7; }
.action-btn.active { color: var(--warning); }

.topic-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}

.topic-ref {
  grid-column: 1 / -1;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.topic-ref-title {
  margin-bottom: 5px;
  color: var(--text);
  font-weight: 700;
}

.topic-ref-analysis {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topics-grid-list .topic-card {
  grid-template-columns: minmax(0, 1fr) 156px;
  align-items: start;
}

.topics-grid-list .topic-title {
  font-size: 16px;
}

.topics-grid-list .topic-desc {
  -webkit-line-clamp: 2;
  margin-bottom: 12px;
}

.section-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.candidate-panel {
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.candidate-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 10px;
}

.candidate-actions {
  display: grid;
  grid-template-columns: 138px 138px 72px 92px;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.candidate-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.candidate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 14px;
  min-height: 184px;
  padding: 14px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.candidate-level1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
}

.candidate-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.candidate-desc,
.candidate-reason {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.candidate-desc {
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.candidate-reason {
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.candidate-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  max-height: 54px;
  overflow: hidden;
}

.candidate-level2 {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.candidate-foot {
  grid-column: 1 / -1;
  margin-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.candidate-score {
  color: var(--primary-strong);
  font-weight: 800;
}

.candidate-foot .topic-actions {
  gap: 6px;
  flex: 0 0 auto;
}

.candidate-foot .hotspot-btn {
  min-width: 58px;
  padding: 0 12px;
}

.candidate-adopt {
  min-width: 82px;
  padding: 0 14px;
}

.candidate-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.hotspot-list {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  min-width: 0;
}

.hot-video-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hot-video-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hot-video-toolbar .platform-tabs {
  margin-bottom: 0;
}

.hot-video-signal-row {
  position: relative;
  z-index: 4;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 8px 2px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.hot-video-index-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.index-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.index-value {
  margin-top: 2px;
  color: var(--danger);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.index-value small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.index-trend {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ebfbee;
  color: #2b8a3e;
  font-weight: 900;
  white-space: nowrap;
}

.index-trend.is-flat {
  background: var(--panel-soft);
  color: var(--muted);
}

.index-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: 240px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.hot-video-signal-row:hover .index-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.index-tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.index-tooltip strong {
  color: var(--text);
}

.hot-video-ai-strip {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line-soft);
}

.hot-video-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ai-strip-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.compact-header {
  margin-bottom: 10px;
}

.hot-video-ai-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.hot-video-ai-brief .ai-summary {
  margin: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.ai-report-modal {
  width: min(1180px, calc(100vw - 48px));
}

.ai-report-body {
  max-height: min(74vh, 720px);
  overflow: auto;
}

.ai-report-section {
  margin-bottom: 16px;
}

.ai-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ai-report-grid .ai-row,
.ai-report-section .ai-row {
  min-height: 44px;
}

.hot-video-ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 8px;
}

.hot-video-ai-grid .ai-row,
.hot-video-ai-grid .ai-summary {
  min-height: 28px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.hot-video-ai-grid .ai-row strong,
.hot-video-ai-grid .ai-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-video-history-title {
  display: none;
}

.hot-video-ai-strip .hot-video-ai-history {
  display: none;
}

.hot-video-ai-history .ai-row {
  min-height: 40px;
}

.hot-video-ai-history .ai-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hot-video-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hot-video-feed-header {
  margin-top: 8px;
  margin-bottom: 8px;
}

.hot-video-feed-header .topics-title span {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  margin-left: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.compact-list {
  margin-top: 0;
}

.trend-header {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.compact-tabs {
  gap: 6px;
}

.compact-tabs .platform-tab {
  padding: 7px 10px;
  font-size: 12px;
}

.trend-item .hot-video-main {
  min-width: 0;
}

.hot-video-item {
  display: grid;
  grid-template-columns: 42px 132px minmax(0, 1fr) 108px;
  gap: 16px;
  align-items: center;
  min-height: 116px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  text-decoration: none;
  transition: background .16s ease;
}

.hot-video-item:last-child {
  border-bottom: 0;
}

.hot-video-item:hover {
  background: rgba(15, 23, 42, .025);
}

.hot-video-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 900;
}

.hot-video-rank.top3 {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.hot-video-cover {
  width: 132px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
}

.hot-video-cover-wrap {
  position: relative;
  width: 132px;
  height: 74px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--line-soft);
}

.hot-video-cover-wrap::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hot-video-cover-wrap img {
  position: relative;
  z-index: 1;
  display: block;
}

.hot-video-cover-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.hot-video-main {
  min-width: 0;
}

.hot-video-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.42;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.hot-video-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 6px;
  background: #eef6ff;
  color: #1c5d99;
  font-size: 11px;
  font-weight: 700;
}

.hot-video-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hot-video-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.hot-video-metrics span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.hot-video-score {
  text-align: right;
  padding-left: 8px;
}

.hot-video-score strong,
.hot-video-score span {
  display: block;
}

.hot-video-score strong {
  color: var(--primary-strong);
  font-size: 22px;
  line-height: 1.2;
}

.hot-video-score span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hotspot-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
.hotspot-item:last-child { border-bottom: 0; }
.hotspot-item:hover { background: var(--panel-soft); }
.hotspot-link { cursor: pointer; }
.hotspot-link:hover .hotspot-title { color: var(--primary-strong); }

.hotspot-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 900;
}
.hotspot-rank.top3 { background: var(--primary-soft); color: var(--primary-strong); }
.hotspot-content { min-width: 0; }
.hotspot-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspot-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspot-tag { white-space: nowrap; color: var(--primary-strong); background: var(--primary-soft); }

.ai-layout,
.ai-history-grid,
.ai-columns {
  display: grid;
  gap: 14px;
}
.ai-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); margin-bottom: 14px; }
.ai-history-grid,
.ai-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-panel { padding: 18px; }
.delta-ai-panel { margin-bottom: 16px; }

.delta-ai-strip {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.delta-ai-strip .topics-header {
  margin-bottom: 8px;
}

.delta-ai-strip .ai-summary {
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.delta-ai-strip .ai-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.delta-ai-strip .ai-row {
  min-height: 64px;
  padding: 9px 10px;
}

.delta-ai-strip .ai-row p {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-summary { margin-bottom: 14px; color: var(--text); }
.ai-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.ai-metrics div,
.ai-row {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
}
.ai-metrics span { display: block; font-size: 24px; font-weight: 900; color: var(--primary-strong); }
.ai-metrics small,
.ai-subtitle { color: var(--muted); font-size: 12px; }
.ai-subtitle { margin-bottom: 8px; font-weight: 800; }
.ai-list { display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: flex; justify-content: space-between; gap: 12px; }
.ai-row strong { line-height: 1.5; }

.log-provider-select { width: 180px; }
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.log-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.log-status-ok,
.log-status-error {
  min-width: 58px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.log-status-ok { background: var(--primary-soft); color: var(--primary-strong); }
.log-status-error { background: #fff5f5; color: var(--danger); }
.log-side { min-width: 160px; text-align: right; }
.log-side span,
.log-side small { display: block; }

.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-icon { font-size: 42px; margin-bottom: 10px; }

.compact-empty {
  padding: 26px 18px;
}

.compact-empty .empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15,23,42,.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { width: min(520px, 100%); overflow: hidden; }
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.modal-title { font-size: 17px; font-weight: 900; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
}
.modal-body { padding: 18px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
.form-textarea { min-height: 110px; resize: vertical; }
.btn { padding: 0 18px; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topics-grid-cards { grid-template-columns: 1fr; }
  .topics-grid-list { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .candidate-head {
    grid-template-columns: 1fr;
  }
  .candidate-actions {
    grid-template-columns: 140px 140px 72px 92px;
    justify-content: start;
  }
  .candidate-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body { width: 100%; overflow-x: clip; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: var(--sidebar);
    color: #fff;
  }
  .mobile-header span { color: #98a2b3; font-size: 12px; }
  .sidebar {
    position: static;
    width: 100vw;
    max-width: 100%;
    height: auto;
    display: block;
    border-right: 0;
  }
  .sidebar .logo,
  .nav-title,
  .nav-categories { display: none; }
  .nav-primary {
    padding: 10px 12px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    max-width: 100vw;
    scrollbar-width: none;
  }
  .nav-primary::-webkit-scrollbar,
  .tags-filter::-webkit-scrollbar,
  .platform-tabs::-webkit-scrollbar,
  .time-filter::-webkit-scrollbar,
  .view-toggle::-webkit-scrollbar { display: none; }
  .nav-primary .nav-item {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 12px;
    background: rgba(255,255,255,.04);
  }
  .nav-primary .nav-badge { display: none; }
  .main {
    margin-left: 0;
    padding: 16px 12px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar > div[style] {
    margin-left: 0 !important;
    width: 100%;
    flex-wrap: wrap;
    min-width: 0;
  }
  .search-box { min-width: 0; width: 100%; }
  .filter-btn,
  .add-btn,
  .filter-select { width: 100%; }
  .tags-filter,
  .platform-tabs,
  .time-filter,
  .view-toggle {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 100%;
  }
  .tag,
  .platform-tab,
  .time-btn,
  .view-btn { flex: 0 0 auto; }
  .stats-grid,
  .topics-grid,
  .ai-columns,
  .ai-history-grid,
  .ai-metrics {
    grid-template-columns: 1fr;
  }
  .page,
  .stats-grid,
  .topics-grid {
    width: 100%;
    max-width: calc(100vw - 24px);
    overflow: hidden;
  }
  .topics-grid {
    display: flex;
    flex-direction: column;
  }
  .topic-card,
  .stat-card,
  .ai-panel,
  .hotspot-list {
    width: 100%;
    max-width: 100%;
  }
  .topics-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .topics-header > div[style] {
    width: 100%;
    overflow-x: auto;
    max-width: 100%;
  }
  .topic-header,
  .topic-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .topic-title,
  .topic-desc,
  .topic-ref,
  .topic-source {
    max-width: 100%;
    min-width: 0;
  }
  .topic-title,
  .topic-desc,
  .topic-ref {
    word-break: break-all;
  }
  .topic-category {
    justify-self: start;
  }
  .topic-score {
    justify-self: end;
  }
  .topic-source {
    min-width: 0;
  }
  .topic-actions {
    width: 100%;
    justify-content: flex-start;
    margin: 8px 0 0;
  }
  .hotspot-item {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: flex-start;
    padding: 14px;
  }
  .hotspot-tag {
    grid-column: 2;
    width: fit-content;
  }
  .hotspot-title,
  .hotspot-meta {
    white-space: normal;
  }
  .log-row,
  .ai-row {
    flex-direction: column;
  }
  .hot-video-actions {
    width: 100%;
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hot-video-actions .filter-btn,
  .hot-video-actions .add-btn {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
  }
  .hot-video-actions .add-btn { grid-column: auto; }
  .hot-video-signal-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .index-tooltip {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }
  .hot-video-ai-strip {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }
  .hot-video-ai-grid {
    display: block;
  }
  .hot-video-ai-grid > div:not(:last-child) { display: none; }
  .hot-video-ai-grid .ai-summary {
    margin: 0;
    min-height: 0;
  }
  .hot-video-ai-history {
    grid-template-columns: 1fr;
  }
  .hot-video-item {
    grid-template-columns: 32px 78px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    align-items: start;
  }
  .hot-video-cover-wrap {
    width: 78px;
  }
  .hot-video-cover {
    width: 100%;
  }
  .hot-video-main {
    grid-column: 2 / 4;
  }
  .hot-video-score {
    grid-column: 2 / 4;
    text-align: left;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .hot-video-title {
    -webkit-line-clamp: 3;
  }
  .log-side {
    min-width: 0;
    text-align: left;
  }
}
