/* ==========================================================================
   AI 资讯看板 —— 样式表（无内联样式，全部通过 class / 变量控制）
   ========================================================================== */

/* ------------------------------- 主题变量 ------------------------------- */

:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --card-2: #fafcff;
  --text: #101728;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e6e9f2;
  --border-2: #d8ddec;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px -14px rgba(16, 24, 40, 0.18);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, 0.05), 0 18px 40px -20px rgba(16, 24, 40, 0.28);
  --cat-policy: #dc2626;
  --cat-market: #2563eb;
  --cat-tech: #059669;
  --cat-report: #7c3aed;
  --cat-product: #d97706;
  --cat-safety: #db2777;
  --ok: #10b981;
  --warn: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
  --hdr-h: 64px;
  --tabbar-h: 58px;
  --skeleton: linear-gradient(90deg, #eef1f8 25%, #f7f9fd 37%, #eef1f8 63%);
}

html[data-theme='dark'] {
  --bg: #0b1020;
  --bg-soft: #0e1526;
  --card: #121a2e;
  --card-2: #0f1729;
  --text: #e8ecf8;
  --muted: #92a0bd;
  --faint: #6b7a99;
  --border: #1e2942;
  --border-2: #29365a;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.35), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --cat-policy: #f87171;
  --cat-market: #60a5fa;
  --cat-tech: #34d399;
  --cat-report: #a78bfa;
  --cat-product: #fbbf24;
  --cat-safety: #f472b6;
  --skeleton: linear-gradient(90deg, #16203a 25%, #1b2742 37%, #16203a 63%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    --bg: #0b1020;
    --bg-soft: #0e1526;
    --card: #121a2e;
    --card-2: #0f1729;
    --text: #e8ecf8;
    --muted: #92a0bd;
    --faint: #6b7a99;
    --border: #1e2942;
    --border-2: #29365a;
    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-soft: rgba(129, 140, 248, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.35), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
    --cat-policy: #f87171;
    --cat-market: #60a5fa;
    --cat-tech: #34d399;
    --cat-report: #a78bfa;
    --cat-product: #fbbf24;
    --cat-safety: #f472b6;
    --skeleton: linear-gradient(90deg, #16203a 25%, #1b2742 37%, #16203a 63%);
  }
}

/* ------------------------------- 基础 ------------------------------- */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------- 顶栏 ------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(12px);
}

.hdr-in {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--hdr-h);
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo {
  display: flex;
  flex: none;
  filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.28));
}

.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-txt strong {
  font-size: 17px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-txt small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.hdr-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-ico {
  flex: none;
  color: var(--faint);
}

.search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.q-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
}

.q-clear:hover {
  color: var(--text);
}

/* hidden 属性需要压过 display:flex */
.q-clear[hidden] {
  display: none;
}

.updated {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

#updated-txt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.upd-suf {
  display: none;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 22%, transparent);
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 24%, transparent);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 24%, transparent);
}

.ibtn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ibtn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.i-sun {
  display: none;
}

html[data-theme='dark'] .i-moon {
  display: none;
}

html[data-theme='dark'] .i-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .i-moon {
    display: none;
  }
  html:not([data-theme='light']) .i-sun {
    display: block;
  }
}

/* ------------------------------- 主体骨架 ------------------------------- */

.main {
  padding-top: 18px;
  padding-bottom: 28px;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (min-width: 1024px) {
  .cols {
    grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
  }
  .side {
    position: sticky;
    top: calc(var(--hdr-h) + 14px);
    max-height: calc(100vh - var(--hdr-h) - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }
}

/* ------------------------------- 简报 ------------------------------- */

.brief {
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.brief::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.brief-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.brief-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.3px;
}

.badge-ai {
  padding: 2px 8px;
  font-size: 11.5px;
  border-radius: 999px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent-2) 34%, transparent);
  white-space: nowrap;
}

.brief-date {
  font-size: 12px;
  color: var(--faint);
  margin-left: auto;
}

.brief-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.brief-text.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brief-more {
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
}

.brief-pending {
  color: var(--muted);
  font-size: 13.5px;
}

.brief-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}

/* ------------------------------- KPI ------------------------------- */

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

@media (min-width: 720px) {
  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.kpi.clickable {
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.kpi.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.4px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------- 筛选控件 ------------------------------- */

.controls {
  padding: 12px 14px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tabs::-webkit-scrollbar,
.chips::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.tab:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.tab.on {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.tab-n {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
}

.tab.on .tab-n {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.chips {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-2);
}

.chip.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
  font-weight: 600;
}

.chip-n {
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.chip.on .chip-n {
  color: var(--accent);
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.seg button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.seg button.on {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.active {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.active-label {
  font-size: 12.5px;
  color: var(--faint);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-clear {
  margin-left: 2px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
}

.link-clear:hover {
  text-decoration: underline;
}

/* ------------------------------- 资讯卡片 ------------------------------- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 2px 2px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.day-head::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.day-head .dh-tag {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--accent-soft);
  color: var(--accent);
}

.item {
  padding: 13px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-2);
}

.item-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.src-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: hsl(var(--sh) 72% 52% / 0.13);
  color: hsl(var(--sh) 58% 34%);
  border: 1px solid hsl(var(--sh) 68% 55% / 0.28);
}

html[data-theme='dark'] .src-badge {
  color: hsl(var(--sh) 72% 76%);
  background: hsl(var(--sh) 70% 60% / 0.16);
  border-color: hsl(var(--sh) 70% 60% / 0.32);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .src-badge {
    color: hsl(var(--sh) 72% 76%);
    background: hsl(var(--sh) 70% 60% / 0.16);
    border-color: hsl(var(--sh) 70% 60% / 0.32);
  }
}

.cat-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--cc);
  white-space: nowrap;
}

.cat-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cc);
}

.cat-policy {
  --cc: var(--cat-policy);
}
.cat-market {
  --cc: var(--cat-market);
}
.cat-tech {
  --cc: var(--cat-tech);
}
.cat-report {
  --cc: var(--cat-report);
}
.cat-product {
  --cc: var(--cat-product);
}
.cat-safety {
  --cc: var(--cat-safety);
}

.item-lang {
  font-size: 12px;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--bg-soft);
  white-space: nowrap;
}

.item-time {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-title {
  margin: 7px 0 0;
  font-size: 15.5px;
  font-weight: 620;
  line-height: 1.5;
  letter-spacing: 0.1px;
}

.item-title a {
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.22s ease, color 0.18s ease;
}

.item-title a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}

.item-title a::after {
  content: '↗';
  margin-left: 4px;
  font-size: 11px;
  color: var(--faint);
  vertical-align: 2px;
}

.item-sum {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.item-bot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.tag {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease;
}

button.tag:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.score {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score .ico {
  color: var(--accent);
  font-size: 11px;
}

.feed-foot {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}

.btn {
  min-height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* 空 / 错误 / 骨架 */

.state {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
}

.state h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.state .btn {
  margin-top: 12px;
}

.sk {
  padding: 14px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  background: var(--skeleton);
  background-size: 400% 100%;
  animation: sk 1.2s ease-in-out infinite;
}

.sk-line + .sk-line {
  margin-top: 9px;
}

@keyframes sk {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ------------------------------- 数据面板 ------------------------------- */

.stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  padding: 14px 16px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-title {
  font-size: 14.5px;
  font-weight: 650;
}

.panel-sub {
  font-size: 11.5px;
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}

/* 六维度计数 */

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

.dim-cell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 5px;
  min-width: 0;
  padding: 9px 10px 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.dim-cell::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--dc);
}

.dim-cell:hover {
  border-color: var(--dc);
  transform: translateY(-1px);
}

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

.dim-cell strong {
  grid-row: span 2;
  color: var(--dc);
  font-size: 18px;
  line-height: 1.2;
}

.dim-cell small {
  color: var(--faint);
  font-size: 10.5px;
}

/* 图表 */

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart .grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .axis {
  fill: var(--faint);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* 面板更窄（≈330px）时等比缩小，需要更大字号才够看 */
@media (max-width: 760px) {
  .chart .axis {
    font-size: 17px;
  }
}

.chart .bar-policy {
  fill: var(--cat-policy);
}
.chart .bar-market {
  fill: var(--cat-market);
}
.chart .bar-tech {
  fill: var(--cat-tech);
}
.chart .bar-report {
  fill: var(--cat-report);
}
.chart .bar-product {
  fill: var(--cat-product);
}
.chart .bar-safety {
  fill: var(--cat-safety);
}

.chart .hit {
  fill: transparent;
  cursor: pointer;
}

.chart .hit:hover {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--lc);
}

.tip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -108%);
  transition: opacity 0.12s ease;
}

.tip.on {
  opacity: 1;
}

.tip-date {
  font-weight: 650;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.tip-row i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--lc);
}

.tip-row b {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 来源条形榜 */

.src-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.src-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  transition: background-color 0.16s ease;
}

.src-row:hover {
  background: var(--bg-soft);
}

.src-row.on {
  background: var(--accent-soft);
}

.src-name {
  flex: none;
  width: 92px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-bar {
  flex: 1 1 auto;
  min-width: 30px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.src-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.src-num {
  flex: none;
  width: 40px;
  text-align: right;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 热词云 */

.cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 8px;
}

.cloud button {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--text);
  line-height: 1.35;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.cloud button:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
}

.cloud .w {
  color: var(--faint);
  font-size: 11px;
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

/* 榜单 */

.rank {
  display: flex;
  flex-direction: column;
}

.rank-row {
  display: flex;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 8px;
  transition: background-color 0.16s ease;
}

.rank-row + .rank-row {
  border-top: 1px solid var(--border);
}

.rank-row:hover {
  background: var(--bg-soft);
}

.rank-i {
  flex: none;
  width: 18px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.rank-body {
  flex: 1 1 auto;
  min-width: 0;
}

.rank-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rank-title:hover {
  color: var(--accent);
}

.rank-desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rank-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rank-meta .ico {
  color: var(--accent);
}

.tag-mini {
  padding: 0 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 11.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------- 页脚 ------------------------------- */

.foot {
  padding-bottom: 26px;
}

.foot-grid {
  display: grid;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 720px) {
  .foot-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 32px;
  }
}

.foot-block h3 {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.foot-src {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.foot-src a {
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.foot-src a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.foot-p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
}

.foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------- 底部视图切换 ------------------------------- */

.tabbar {
  display: none;
}

@media (max-width: 1023px) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    gap: 6px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }

  .tabbtn {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--muted);
    font-size: 11.5px;
  }

  .tabbtn.on {
    color: var(--accent);
    background: var(--accent-soft);
  }

  body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  body[data-view='feed'] #side {
    display: none;
  }

  body[data-view='stats'] #feed-col {
    display: none;
  }

  body[data-view='stats'] .kpis,
  body[data-view='stats'] #brief-card {
    display: none;
  }

  /* 触控目标 >= 40px */
  .tab {
    height: 40px;
    padding: 0 15px;
  }

  .chip {
    height: 40px;
    padding: 0 14px;
  }

  .seg button {
    height: 38px;
    padding: 0 16px;
  }

  .brand {
    min-height: 40px;
  }

  .src-row {
    min-height: 40px;
  }

  .q-clear {
    width: 30px;
    height: 30px;
  }

  .link-clear {
    padding: 9px 6px;
  }

  .cloud button {
    min-height: 36px;
  }

  .brief-more {
    min-height: 40px;
    padding: 8px 2px;
  }

  .item-bot .tag {
    min-height: 32px;
    padding: 4px 12px;
  }

  .foot-src a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
  }
}

/* ------------------------------- 响应式（顶栏） ------------------------------- */

@media (max-width: 900px) {
  .search {
    width: 220px;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 14px;
  }

  /* 第一行：品牌 + 更新时间 + 主题按钮；第二行：整行搜索框 */
  .hdr-in {
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .hdr-tools {
    display: contents;
  }

  .brand {
    order: 1;
  }

  .updated {
    order: 2;
    margin-left: auto;
  }

  .upd-pre {
    display: none;
  }

  .upd-suf {
    display: inline;
  }

  #theme {
    order: 3;
  }

  .search {
    order: 4;
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
  }

  .brand-txt small {
    display: none;
  }

  .brief {
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .brief-text {
    font-size: 14px;
    line-height: 1.75;
  }

  /* KPI：紧凑 2x2，两行总高 < 170px */
  .kpis {
    gap: 10px;
    margin-bottom: 14px;
  }

  .kpi {
    padding: 10px 12px;
  }

  .kpi-label {
    font-size: 12px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .kpi-sub {
    display: none;
  }

  .item-title {
    font-size: 15px;
  }

  .src-name {
    width: 76px;
  }
}

@media (max-width: 420px) {
  #updated-txt {
    font-size: 12px;
  }

  .kpi-value {
    font-size: 19px;
  }
}

/* ------------------------------- 动效偏好 ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .item:hover {
    transform: none;
  }
}
