/* ==========================================================================
   CSS 变量与主题系统（杂志级暖白纸张质感 & 深灰蓝暗色主题）
   ========================================================================== */
:root {
  /* 基础字号（通过 JS 动态调整，范围 14px - 20px） */
  --base-font-size: 16px;

  /* 浅色模式色板 */
  --bg-page: #faf7f2;
  --bg-header: rgba(250, 247, 242, 0.88);
  --bg-card: #ffffff;
  --bg-subtle: #f2ede4;
  --bg-hover: #ebe5da;
  --bg-pill: #efeae0;
  --bg-pill-active: #1c1b18;

  --text-primary: #1c1b18;
  --text-secondary: #57534a;
  --text-muted: #8a8478;
  --text-on-accent: #ffffff;
  --text-pill-active: #ffffff;

  --border-color: #e6e0d5;
  --border-strong: #d5cdbf;

  --accent-color: #b84a27;
  --accent-hover: #9c3b1c;
  --accent-soft: rgba(184, 74, 39, 0.1);

  /* 徽章配色（浅色） */
  --badge-1-bg: #fcebe6; --badge-1-fg: #a93819;
  --badge-2-bg: #fff3db; --badge-2-fg: #9c6006;
  --badge-3-bg: #eef2ff; --badge-3-fg: #3b4cca;
  --badge-4-bg: #e6f6f0; --badge-4-fg: #0f6e4f;
  --badge-5-bg: #f3eafa; --badge-5-fg: #6c2d9c;
  --badge-6-bg: #eaeef3; --badge-6-fg: #36495d;

  /* 热榜前三名专属色 */
  --rank-1-bg: #d94126; --rank-1-fg: #ffffff;
  --rank-2-bg: #e67725; --rank-2-fg: #ffffff;
  --rank-3-bg: #d49b1a; --rank-3-fg: #ffffff;
  --rank-default-bg: #f2ede4; --rank-default-fg: #6b655b;

  /* 阴影与圆角 */
  --shadow-card: 0 2px 10px rgba(28, 27, 24, 0.035), 0 1px 2px rgba(28, 27, 24, 0.03);
  --shadow-hover: 0 6px 18px rgba(28, 27, 24, 0.065);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* 间距与尺寸：桌面阅读区控制在 720-780px 之间并居中 */
  --container-max: 760px;
  --card-padding: 18px;
  --mobile-nav-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

/* 深色模式色板 */
[data-theme="dark"] {
  --bg-page: #11151c;
  --bg-header: rgba(17, 21, 28, 0.88);
  --bg-card: #1a202c;
  --bg-subtle: #232b3a;
  --bg-hover: #2b3547;
  --bg-pill: #232b3a;
  --bg-pill-active: #e8ecf2;

  --text-primary: #eaeef5;
  --text-secondary: #a8b3c4;
  --text-muted: #717e94;
  --text-on-accent: #ffffff;
  --text-pill-active: #11151c;

  --border-color: #293242;
  --border-strong: #374357;

  --accent-color: #e06d48;
  --accent-hover: #ec7e5b;
  --accent-soft: rgba(224, 109, 72, 0.16);

  /* 徽章配色（深色） */
  --badge-1-bg: rgba(224, 109, 72, 0.18); --badge-1-fg: #f79d80;
  --badge-2-bg: rgba(235, 170, 56, 0.18); --badge-2-fg: #f5c369;
  --badge-3-bg: rgba(105, 130, 245, 0.18); --badge-3-fg: #9eb0ff;
  --badge-4-bg: rgba(45, 185, 135, 0.18); --badge-4-fg: #6ee0b6;
  --badge-5-bg: rgba(176, 115, 235, 0.18); --badge-5-fg: #d1a6fa;
  --badge-6-bg: rgba(140, 160, 185, 0.18); --badge-6-fg: #b8c8dc;

  --rank-1-bg: #d94a30; --rank-1-fg: #ffffff;
  --rank-2-bg: #d97529; --rank-2-fg: #ffffff;
  --rank-3-bg: #c28e19; --rank-3-fg: #ffffff;
  --rank-default-bg: #252e3d; --rank-default-fg: #94a1b5;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.36);
}

/* ==========================================================================
   全局基础重置
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: var(--base-font-size);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.8;
  /* 为移动端底部导航栏留出安全间距，防止遮挡正文底部 */
  padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 28px);
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, select {
  font-family: inherit;
  font-size: inherit;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   顶部 Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
}

.brand-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.font-controls {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
}

.font-controls .icon-btn {
  border: none;
  border-radius: 0;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 600;
}

.font-controls .icon-btn + .icon-btn {
  border-left: 1px solid var(--border-color);
}

.icon-btn {
  appearance: none;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primary-btn {
  appearance: none;
  background: var(--text-primary);
  color: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.primary-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.primary-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ==========================================================================
   刷新状态通知条
   ========================================================================== */
.refresh-banner {
  background-color: var(--accent-soft);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.84rem;
}

.refresh-banner-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   主体容器与报告选择器
   ========================================================================== */
.main-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 16px 24px;
}

.selector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.selector-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.selector-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.select-input {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  min-width: 115px;
}

.select-input:focus {
  border-color: var(--accent-color);
}

.select-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.report-meta-badge {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================================
   导航 Tab（移动端底部固定 + 桌面端顶部横向）
   ========================================================================== */
.desktop-tabs {
  display: none;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.tab-btn {
  appearance: none;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-pill-active);
  color: var(--text-pill-active);
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.mobile-nav-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.mobile-nav-icon {
  font-size: 1.15rem;
  line-height: 1.1;
}

.mobile-nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.mobile-nav-btn.active {
  color: var(--accent-color);
}

/* ==========================================================================
   骨架屏、空状态、错误状态
   ========================================================================== */
.state-box {
  padding: 8px 0;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  margin-bottom: 14px;
}

.skeleton-line {
  height: 14px;
  background: var(--bg-subtle);
  border-radius: 4px;
  margin-bottom: 12px;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-title {
  width: 38%;
  height: 20px;
  margin-bottom: 18px;
}

.skeleton-short {
  width: 65%;
  margin-bottom: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}

.state-loading-text {
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.state-error,
.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.state-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.state-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.state-desc {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.retry-btn {
  appearance: none;
  background: var(--accent-color);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.retry-btn:hover {
  background: var(--accent-hover);
}

.section-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 2px;
}

/* ==========================================================================
   Tab 1: AI 深度研判卡片与富文本分段排版
   ========================================================================== */
.ai-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
}

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.ai-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.badge-theme-1 { background: var(--badge-1-bg); color: var(--badge-1-fg); }
.badge-theme-2 { background: var(--badge-2-bg); color: var(--badge-2-fg); }
.badge-theme-3 { background: var(--badge-3-bg); color: var(--badge-3-fg); }
.badge-theme-4 { background: var(--badge-4-bg); color: var(--badge-4-fg); }
.badge-theme-5 { background: var(--badge-5-bg); color: var(--badge-5-fg); }
.badge-theme-6 { background: var(--badge-6-bg); color: var(--badge-6-fg); }

.ai-card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.ai-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-para {
  margin: 0 0 14px;
  font-size: 0.96rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  word-break: break-word;
}

.ai-card-body > .ai-para:last-child {
  margin-bottom: 0;
}

/* 段落开头的醒目标签徽章（例如“全网霸屏”、“【核心矛盾】”等前缀标签） */
.ai-inline-badge {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
  background: var(--accent-soft);
  color: var(--accent-color);
  vertical-align: baseline;
}

/* 数字序号分段行 (1. / 2. 等) */
.ai-numbered-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.ai-num-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  margin-top: 2px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.ai-num-content {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  word-break: break-word;
}

/* 序号列表项的前导结论短语 / 角色名：独立成行加粗小标题 */
.ai-lead {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.6;
}

.ai-num-body {
  display: block;
  color: var(--text-secondary);
}

/* ==========================================================================
   Tab 2: 海外与科技 RSS 信息流
   ========================================================================== */
.rss-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rss-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.rss-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.rss-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rss-feed-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

.rss-time {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.rss-title-main {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
}

.rss-title-sub {
  margin: 6px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  word-break: break-word;
}

/* ==========================================================================
   Tab 3: 分类热榜
   ========================================================================== */
.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.category-pills::-webkit-scrollbar {
  height: 4px;
}

.category-pills::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.pill-btn {
  appearance: none;
  background: var(--bg-pill);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--bg-pill-active);
  color: var(--text-pill-active);
  border-color: var(--bg-pill-active);
}

.pill-count {
  font-size: 0.74rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.hot-groups-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hot-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
}

.hot-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.hot-group-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hot-group-count {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.hot-items-list {
  display: flex;
  flex-direction: column;
}

.hot-item-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--border-color);
}

.hot-item-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.hot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--rank-default-bg);
  color: var(--rank-default-fg);
  flex-shrink: 0;
}

.hot-rank.rank-1 { background: var(--rank-1-bg); color: var(--rank-1-fg); }
.hot-rank.rank-2 { background: var(--rank-2-bg); color: var(--rank-2-fg); }
.hot-rank.rank-3 { background: var(--rank-3-bg); color: var(--rank-3-fg); }

.hot-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hot-item-link {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
  transition: color 0.15s ease;
}

.hot-item-link:hover {
  color: var(--accent-color);
}

.hot-item-source {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   电脑端响应式适配 (>= 768px)
   ========================================================================== */
@media (min-width: 768px) {
  :root {
    --card-padding: 22px 24px;
  }

  body {
    padding-bottom: 48px;
  }

  .header-inner {
    padding: 14px 24px;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .main-container {
    padding: 22px 24px 36px;
  }

  .desktop-tabs {
    display: flex;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .hot-item-main {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .hot-item-source {
    flex-shrink: 0;
    text-align: right;
  }
}

/* ==========================================================================
   新增：元数据状态栏、30 秒导读、荧光高亮、溯源角标与 Popover
   ========================================================================== */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tldr-banner {
  background: linear-gradient(135deg, rgba(184, 74, 39, 0.10), rgba(251, 191, 36, 0.14));
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .tldr-banner {
  background: linear-gradient(135deg, rgba(224, 109, 72, 0.18), rgba(251, 191, 36, 0.10));
}

.tldr-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-color);
  margin-bottom: 6px;
}

.tldr-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--text-primary);
}

/* AI 正文中的 **加粗** 转为荧光笔高亮 */
.ai-highlight {
  background: rgba(251, 191, 36, 0.18);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 溯源角标：移动端点击热区不小于 32x32px */
.cite-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 2px 8px;
  margin: 0 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--accent-color);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.cite-chip:hover {
  background: var(--accent-soft);
}

/* 前端回退匹配到的事件短语：虚线下划线 */
.cite-match {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-color);
}

/* 独立源点速览：平台小卡片与两组 Bullet */
.source-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-subtle);
}

.source-card:last-child {
  margin-bottom: 0;
}

.source-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.source-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 8px 0 4px;
}

.source-bullet-list {
  margin: 0 0 4px;
  padding-left: 18px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.source-bullet-list li {
  margin-bottom: 6px;
  font-size: 0.94rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* 独立源点每句可点击：句子本身就是链接，下划线表示可点，颜色与正文一致 */
.source-bullet-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 3px;
  cursor: pointer;
}

.source-bullet-link:active {
  opacity: 0.7;
}

/* 溯源 Popover / 底部抽屉 */
.popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.45);
}

.source-popover {
  position: fixed;
  z-index: 100;
  max-width: calc(100vw - 32px);
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  padding: 18px 18px 16px;
}

.source-popover-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.source-popover-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 8px;
  padding-right: 28px;
}

.source-popover-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.source-popover-sub {
  margin: 0 0 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
}

.source-popover-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-color);
  color: var(--text-on-accent);
  font-size: 0.88rem;
  font-weight: 700;
}

@media (max-width: 767px) {
  /* 移动端：底部轻量 Sheet 卡片 */
  .source-popover {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    top: auto;
    width: auto;
  }

  .main-container {
    padding-left: 16px;
    padding-right: 16px;
  }
}
