/* 设计令牌：:root 放跨主题通用的等宽字体栈与消息文本字号（改这里可整体缩放阅读字号）；
   主题色统一由 body[data-theme=dark|light] 下的 CSS 变量提供，组件只引用变量以便一键换肤 */
:root {
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  /* 消息文本层级：改这里即可整体调整阅读字号 */
  --fs-message: 17px;         /* 消息正文 / 详情正文 */
  --fs-message-title: 19px;   /* 消息标题 */
  --fs-message-meta: 13.5px;  /* 来源 / 时间 / 标签 */
}
* { box-sizing: border-box; }
/* 关键：CSS 中带 display 的组件会覆盖 UA 的 [hidden]{display:none}，
   导致抽屉 / 弹框 / 横幅设置 hidden 后仍显示、点 × 也关不掉 */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.6 "Inter", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body[data-theme="dark"] {
  --bg: #080c14; --bg-soft: #0b111c; --panel: #101725; --panel-2: #141d2d;
  --line: #1e2a3c; --line-soft: #182233; --text: #e7eefb; --text-2: #c3cfe2;
  --muted: #8091aa; --faint: #5d6e87; --accent: #4c9dff; --cyan: #3ad0cf;
  --green: #23c58c; --orange: #ffab3d; --red: #ff5a6a; --purple: #a886ff;
  --bar: #0d1523; --shadow: 0 12px 40px rgba(0,0,0,.45);
}
body[data-theme="light"] {
  --bg: #f2f5fa; --bg-soft: #e9eef6; --panel: #ffffff; --panel-2: #f7f9fd;
  --line: #dbe3ef; --line-soft: #e8edf5; --text: #16213a; --text-2: #33425e;
  --muted: #64748b; --faint: #94a3b8; --accent: #1f6fd0; --cyan: #0e9c9c;
  --green: #0d9c6c; --orange: #c67a00; --red: #d83a4b; --purple: #7a55d8;
  --bar: #ffffff; --shadow: 0 12px 40px rgba(24,42,74,.16);
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------- 顶栏 ---------- */
/* 顶栏固定 66px 高、z-index:30 盖在内容之上：品牌 + 连接徽标 + 搜索 + 视图切换 + 操作按钮；
   flex 布局中搜索框 flex:1 自适应，操作区 margin-left:auto 右对齐 */
.topbar {
  flex: 0 0 66px; display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: var(--bar); border-bottom: 1px solid var(--line); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.brand-mark {
  width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px;
  font-size: 20px; color: #07101e; background: linear-gradient(145deg,#5cb0ff,#2ad6c6);
  box-shadow: 0 0 18px rgba(76,157,255,.28);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; }
.brand-name span { font: 600 12.5px/1 var(--mono); color: var(--cyan); letter-spacing: 2px; margin-left: 4px; }
.brand-sub { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.live-badge {
  display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 5px 10px;
  border: 1px solid rgba(35,197,140,.35); border-radius: 999px; background: rgba(35,197,140,.08);
  color: var(--green); font-size: 14px; font-weight: 600;
}
.live-badge.offline { border-color: rgba(255,90,106,.4); background: rgba(255,90,106,.08); color: var(--red); }
.live-badge.loading { border-color: rgba(255,171,61,.4); background: rgba(255,171,61,.08); color: var(--orange); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.live-badge.offline .pulse { background: var(--red); animation: none; }
.live-badge.loading .pulse { background: var(--orange); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(35,197,140,0); } 100% { box-shadow: 0 0 0 0 rgba(35,197,140,0); } }

.top-search {
  position: relative; flex: 1; max-width: 620px; min-width: 180px; display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 10px 0 13px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.top-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76,157,255,.12); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15.5px; }
.top-search input::placeholder { color: var(--faint); }
.top-search input::-webkit-search-cancel-button { display: none; }
.top-search kbd { font: 13.5px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
#clearSearch { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.suggestions {
  position: absolute; top: 42px; left: 0; right: 0; z-index: 50; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow);
}
.suggestion { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 15px; }
.suggestion:hover { background: var(--panel-2); color: var(--accent); }
.suggestion small { float: right; color: var(--faint); font: 12.5px var(--mono); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.clock { text-align: right; margin-right: 4px; line-height: 1.15; }
.clock span { display: block; font: 600 17px var(--mono); color: var(--text-2); }
.clock small { font-size: 12.5px; color: var(--faint); }
.view-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-btn { width: 32px; height: 32px; border: 0; background: var(--panel); color: var(--muted); font-size: 16px; }
.view-btn + .view-btn { border-left: 1px solid var(--line); }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: rgba(76,157,255,.16); color: var(--accent); }
.icon-btn {
  width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 17px; transition: .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.active { color: var(--cyan); }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 布局 ---------- */
/* 三栏 grid：左 244px 侧栏 / 中 minmax(0,1fr) 自适应主区 / 右 292px 统计栏；
   min-height:0 让各栏独立滚动而不撑破视口；断点在文件末尾逐级收窄列宽 */
.layout { flex: 1; display: grid; grid-template-columns: 244px minmax(0,1fr) 292px; min-height: 0; }
.sidebar, .rightbar { background: var(--bg-soft); }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 8px; }
.rightbar { border-left: 1px solid var(--line); overflow-y: auto; padding: 14px 12px 28px; }
.nav-group { margin-bottom: 10px; }
.group-title {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none;
  padding: 6px 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px; color: var(--faint); text-transform: uppercase;
}
.group-title:hover { color: var(--muted); }
.group-title .caret { font-size: 11.5px; transition: transform .18s; }
.nav-group.collapsed .caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-list { display: none; }
.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 9px; border: 1px solid transparent;
  border-radius: 7px; background: transparent; color: var(--text-2); font-size: 15px; text-align: left; transition: .13s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: rgba(76,157,255,.14); border-color: rgba(76,157,255,.28); color: var(--accent); font-weight: 600; }
.nav-item .ico { width: 16px; text-align: center; font-size: 15.5px; color: var(--faint); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .count { margin-left: auto; font: 13px var(--mono); color: var(--faint); }
.nav-item.active .count { color: var(--accent); }
.side-foot { padding: 10px 16px 14px; font-size: 13px; color: var(--faint); line-height: 1.9; border-top: 1px solid var(--line-soft); }
.tiny-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }

.source-search { width: 100%; margin: 6px 0 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 14px; outline: none; }
.source-row { display: flex; align-items: center; gap: 7px; padding: 4px 7px; border-radius: 5px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.source-row:hover { background: var(--panel); }
.source-row.muted-source { opacity: .35; }
.source-row .sdot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; background: var(--faint); }
.source-row .sdot.ok { background: var(--green); }
.source-row .sdot.error { background: var(--red); }
.source-row .sdot.empty, .source-row .sdot.running, .source-row .sdot.idle { background: var(--orange); }
.source-row .sname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row .snum { font: 12.5px var(--mono); color: var(--faint); }
.source-region { font-size: 12px; color: var(--faint); padding: 7px 7px 3px; letter-spacing: 1px; }

/* ---------- 主区 ---------- */
/* 主内容区独立纵向滚动（overflow-y:auto）；feed-head 标题与筛选按钮两端对齐；
   .ghost-btn / .primary-solid 为次级 / 主行动按钮的通用样式 */
.feed { overflow-y: auto; padding: 18px 24px 70px; min-width: 0; }
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.feed-head h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.feed-head p { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.feed-head-actions { display: flex; gap: 7px; }
.ghost-btn { padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 14px; transition: .15s; }
.ghost-btn:hover { color: var(--text); border-color: var(--accent); }
.ghost-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(76,157,255,.1); }
.primary-btn { color: var(--accent); }
#filterBadge { display: inline-block; min-width: 15px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: var(--accent); color: #fff; font: 12.5px/16px var(--mono); text-align: center; }
.primary-solid { padding: 8px 16px; border: 0; border-radius: 7px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; }
.primary-solid:hover { filter: brightness(1.12); }

.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; transition: .14s; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { color: var(--accent); background: rgba(76,157,255,.12); border-color: rgba(76,157,255,.42); }
.chip.hot { color: var(--red); border-color: rgba(255,90,106,.35); }
.chip.hot.active { background: rgba(255,90,106,.12); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.active-filters .af { padding: 3px 8px; border: 1px dashed var(--line); border-radius: 5px; }
.active-filters button { border: 0; background: transparent; color: var(--red); margin-left: 4px; }

.rumor-banner {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 14px; padding: 12px 14px;
  background: rgba(255,171,61,.09); border: 1px solid rgba(255,171,61,.34);
  border-left: 3px solid var(--orange); border-radius: 9px;
}
.rumor-banner-icon { font-size: 17px; color: var(--orange); }
.rumor-banner strong { font-size: 15px; color: var(--orange); }
.rumor-banner p { margin: 3px 0 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.rumor-banner b { color: var(--orange); }

.feed-toolbar { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.filter-count { font: 14px var(--mono); color: var(--faint); margin-right: auto; }
.switch { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track { width: 28px; height: 16px; border-radius: 10px; background: var(--line); position: relative; transition: .18s; }
.switch-track::after { content:''; position:absolute; top:3px; left:3px; width:10px; height:10px; border-radius:50%; background: var(--faint); transition: .18s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { left: 15px; background: #fff; }
.mini-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 5px; font-size: 13px; padding: 2px 7px; }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }

.new-notice { margin-top: 12px; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-align: center; background: rgba(76,157,255,.12); border: 1px solid rgba(76,157,255,.36); color: var(--accent); font-size: 15px; font-weight: 600; animation: fadeDown .25s ease; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* 信息流时间轴（关键布局）：.feed-list::before 用绝对定位画一条竖直渐变线（left:78px 对齐时间列），
   每张 .news-card 以「78px 时间列 + 1fr 卡片列」两列网格排布，.card-time .dot 绝对定位压在线上作节点；
   节点颜色随来源层级/传闻/重点变化，形成「时间线 + 卡片」结构。
   信息密度：body[data-density=compact] 下收紧间距、隐藏摘要与计数，由顶栏 densityBtn 切换并持久化 */
.feed-list { position: relative; margin-top: 14px; }
body[data-density="compact"] .feed-list { margin-top: 8px; }
.feed-list::before { content:''; position:absolute; left:78px; top:4px; bottom:6px; width:1px; background: linear-gradient(180deg,var(--accent),var(--line) 25%,var(--line) 88%,transparent); opacity:.45; }
.news-card { display: grid; grid-template-columns: 78px minmax(0,1fr); position: relative; padding-bottom: 12px; cursor: pointer; }
/* 只在真正新增的卡片上播放进入动画，避免每次重绘整页闪动 */
.news-card.is-new { animation: cardIn .26s ease both; }
body[data-density="compact"] .news-card { padding-bottom: 6px; }
@keyframes cardIn { from { opacity:0; transform:translateY(-7px); } to { opacity:1; transform:none; } }
.news-card.is-new .card-body { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(76,157,255,.1); }
.news-card.selected .card-body { border-color: var(--cyan); }
.card-time { text-align: right; padding: 13px 17px 0 0; position: relative; }
.card-time time { display: block; font: 600 14px var(--mono); color: var(--text-2); }
.card-time .tdate { display: block; font: 12.5px var(--mono); color: var(--faint); margin-top: 1px; }
.card-time .rel { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.card-time .dot { position: absolute; right: -4.5px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--line); }
.news-card.tier-primary .card-time .dot { background: var(--green); }
.news-card.is-rumor .card-time .dot { background: var(--orange); }
.news-card.important .card-time .dot { background: var(--red); box-shadow: 0 0 0 2px rgba(255,90,106,.3), 0 0 10px rgba(255,90,106,.4); }
.card-body { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px 12px; transition: border-color .15s, transform .15s; }
body[data-density="compact"] .card-body { padding: 8px 13px 7px; }
.news-card:hover .card-body { border-color: var(--accent); transform: translateY(-1px); }
.news-card.is-rumor .card-body { border-left: 3px solid var(--orange); }
.news-card.is-official .card-body { border-left: 3px solid var(--green); }
.news-card.unread .card-title::after { content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--accent); margin-left:7px; vertical-align:middle; }
.card-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.badge { font-size: 12px; line-height: 1.7; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.tier-primary { color: var(--green); border-color: rgba(35,197,140,.5); background: rgba(35,197,140,.08); }
.badge.tier-community { color: var(--orange); border-color: rgba(255,171,61,.5); }
.badge.rumor { color: var(--orange); border-color: rgba(255,171,61,.5); background: rgba(255,171,61,.1); font-weight: 600; }
.badge.official { color: var(--green); border-color: rgba(35,197,140,.5); background: rgba(35,197,140,.1); font-weight: 600; }
.badge.important { color: var(--red); border-color: rgba(255,90,106,.5); background: rgba(255,90,106,.09); }
.badge.tag { color: var(--accent); border-color: rgba(76,157,255,.35); }
.badge.en { color: var(--purple); border-color: rgba(168,134,255,.4); }
.badge.region { color: var(--cyan); border-color: rgba(58,208,207,.35); }
.card-title { margin: 0; font-size: var(--fs-message-title); font-weight: 600; line-height: 1.5; color: var(--text); }
body[data-density="compact"] .card-title { font-size: 17px; }
.card-title a:hover { color: var(--accent); }
.card-summary { margin: 8px 0 0; font-size: var(--fs-message); line-height: 1.65; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
body[data-density="compact"] .card-summary { display: none; }
body[data-density="compact"] .card-meta { margin-top: 6px; }
.card-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 11px; font-size: var(--fs-message-meta); color: var(--faint); }
.card-meta .source { color: var(--text-2); }
.card-meta .also { color: var(--faint); }
.symbol { font: 12.5px var(--mono); color: var(--accent); background: rgba(76,157,255,.1); border: 1px solid rgba(76,157,255,.22); padding: 1px 5px; border-radius: 4px; }
.meta-spacer { flex: 1; }
.mini-btn.faved { color: var(--orange); border-color: var(--orange); }
.origin-link { color: var(--accent); font-size: 13px; white-space: nowrap; }
.origin-link:hover { text-decoration: underline; }
.rumor-note { margin-top: 8px; padding: 5px 9px; border-radius: 5px; background: rgba(255,171,61,.08); color: var(--orange); font-size: 13px; line-height: 1.6; }
.rumor-note.official { background: rgba(35,197,140,.07); color: var(--green); }
mark { background: rgba(255,205,90,.24); color: var(--text); border-radius: 2px; padding: 0 1px; }

/* 专题 / 聚类视图 */
/* 卡片网格：auto-fill + minmax(280px,1fr) 按容器宽度自适应列数，窄屏媒体查询降为单列；
   聚类卡用 3px 左边框与主题卡区分 */
.topics-view, .clusters-view { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 12px; }
.topic-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px; }
.topic-card h3 { margin: 0 0 9px; font-size: 15.5px; color: var(--text); display: flex; justify-content: space-between; }
.topic-card h3 em { font: 13.5px var(--mono); color: var(--accent); font-style: normal; }
.topic-link { display: block; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 14px; line-height: 1.55; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-link:hover { color: var(--accent); }
.topic-link time { font: 12.5px var(--mono); color: var(--faint); margin-right: 6px; }
.cluster-card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--purple); border-radius: 10px; padding: 13px; cursor: pointer; }
.cluster-card:hover { border-color: var(--accent); }
.cluster-card h3 { margin: 0 0 7px; font-size: 15.5px; line-height: 1.5; }
.cluster-meta { font-size: 13px; color: var(--faint); }
.cluster-sources { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.load-more { text-align: center; margin-top: 16px; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 47px; color: var(--line); }
.empty-state h3 { margin: 12px 0 4px; font-size: 17px; color: var(--text-2); }
.empty-state p { margin: 3px 0; font-size: 14px; }
.empty-state .empty-note { color: var(--faint); font-size: 13.5px; margin-top: 12px; }

/* ---------- 右栏 ---------- */
/* .card 为统一统计卡容器；stat-grid 两列统计块，dist / hot-topics 为横向占比条，
   条宽由 JS 按组内最大值归一化后以内联 style 写入 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px; margin-bottom: 11px; }
.card-title { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--text-2); margin-bottom: 11px; }
.card-title .muted { font-weight: 400; font-size: 13px; color: var(--faint); }
.mini-live { font: 11.5px var(--mono); letter-spacing: 1px; color: var(--green); border: 1px solid rgba(35,197,140,.4); border-radius: 3px; padding: 1px 5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 7px; padding: 8px 9px; }
.stat b { display: block; font: 700 19px var(--mono); color: var(--text); line-height: 1.25; }
.stat span { font-size: 12.5px; color: var(--muted); }
.dist { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.dist-row .dname { width: 42px; flex: 0 0 42px; }
.dist-row .dbar { flex: 1; height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.dist-row .dbar i { display: block; height: 100%; border-radius: 3px; }
.dist-row .dval { width: 24px; text-align: right; font: 12.5px var(--mono); color: var(--faint); }
.hot-topics { display: flex; flex-direction: column; gap: 6px; }
.topic-row { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.topic-row:hover .tname { color: var(--accent); }
.topic-row .tname { width: 70px; flex: 0 0 70px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-row .tbar { flex: 1; height: 5px; border-radius: 3px; background: var(--line-soft); }
.topic-row .tbar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg,var(--accent),var(--cyan)); }
.topic-row .tval { font: 12.5px var(--mono); color: var(--faint); width: 22px; text-align: right; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-item { display: block; padding-left: 8px; border-left: 2px solid var(--red); cursor: pointer; }
.mini-item:hover .mit { color: var(--accent); }
.mini-item .mit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.mini-item .mim { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
.source-summary { display: flex; flex-wrap: wrap; gap: 5px; }
.ss-chip { font-size: 12.5px; padding: 3px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.ss-chip.ok { color: var(--green); border-color: rgba(35,197,140,.4); }
.ss-chip.error { color: var(--red); border-color: rgba(255,90,106,.4); }
.risk-card { background: linear-gradient(160deg,rgba(255,171,61,.06),var(--panel) 55%); border-color: rgba(255,171,61,.2); }
.risk-card p { margin: 0 0 7px; font-size: 13px; line-height: 1.7; color: var(--muted); }

/* ---------- 财经日历 ---------- */
/* toolbar 为多组 chip 筛选 + 搜索框；按天 .cal-day 分组，每条 .cal-event 用
   58px / 20px / 1fr / 74px 四列网格对齐时间、重要度、标题、倒计时；
   high/mid 用 inset 左边框标色，passed 半透明表示已过 */
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 14px; padding: 11px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.cal-group { display: flex; align-items: center; gap: 5px; }
.cal-group > span { font-size: 13px; color: var(--faint); margin-right: 3px; }
.cal-toolbar-meta { margin-left: auto; font-size: 13px; color: var(--faint); }
.cal-toolbar-meta b { color: var(--accent); font: 600 13.5px var(--mono); }
.cal-search { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft); color: var(--text); font-size: 14px; outline: none; width: 150px; }
.cal-day { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.cal-day-head { display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cal-day-head b { font-size: 15.5px; color: var(--text); }
.cal-day-head .week { font-size: 13.5px; color: var(--muted); }
.cal-day-head .tag-today { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: rgba(76,157,255,.15); color: var(--accent); }
.cal-day-head .cnt { margin-left: auto; font: 13px var(--mono); color: var(--faint); }
.cal-event { display: grid; grid-template-columns: 58px 20px minmax(0,1fr) 74px; align-items: center; gap: 9px; padding: 8px 13px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 15px; }
.cal-event:last-child { border-bottom: 0; }
.cal-event:hover { background: var(--panel-2); }
.cal-event.high { box-shadow: inset 3px 0 0 var(--red); }
.cal-event.mid { box-shadow: inset 3px 0 0 var(--orange); }
.cal-event.passed { opacity: .55; }
.cal-time { font: 600 14px var(--mono); color: var(--accent); }
.cal-imp { font-size: 13.5px; text-align: center; color: var(--faint); }
.cal-event.high .cal-imp { color: var(--red); }
.cal-event.mid .cal-imp { color: var(--orange); }
.cal-main { min-width: 0; }
.cal-title { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover .cal-title { color: var(--accent); }
.cal-sub { display: flex; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--faint); }
.cal-sub .badge { font-size: 11.5px; padding: 0 5px; }
.cal-right { text-align: right; font: 13px var(--mono); color: var(--faint); }
.cal-right .upcoming { color: var(--green); }
.cal-right .ongoing { color: var(--orange); }
.cal-loading, .cal-error { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 15px; }
.cal-error { color: var(--orange); }
.cal-mini-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; cursor: pointer; }
.cal-mini-row:hover .cal-mini-title { color: var(--accent); }
.cal-mini-row time { font: 12.5px var(--mono); color: var(--accent); flex: 0 0 36px; }
.cal-mini-title { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 右栏查看更多 ---------- */
/* 右栏卡片底部的「查看更多」入口：通栏、上边框分隔、悬停下划线 */
.card-more { display: block; width: 100%; margin-top: 9px; padding: 6px 0 0; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--accent); font-size: 13.5px; text-align: left; }
.card-more:hover { text-decoration: underline; }

/* ---------- 资金龙虎榜 ---------- */
/* 状态条 + tab + KPI 网格 + 各类数据表；.cap-flow-row 用 108px / 1fr / 108px 三列
   加中轴双向条表示资金流入流出（红进绿出），.cap-table 统一数值右对齐，
   .cap-expand 控制超过阈值的长表展开/收起 */
.capital-status { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 11px 14px; margin: 4px 0 13px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; font-size: 13.5px; color: var(--text-2); }
.capital-status b { color: var(--text); }
.capital-status .cap-state { padding: 2px 8px; border-radius: 4px; background: rgba(76,157,255,.14); color: var(--accent); font-size: 12.5px; }
.capital-status .cap-warn { color: var(--orange); }
.capital-status .cap-refresh { margin-left: auto; }
.cap-tabs { display: flex; gap: 6px; margin-bottom: 13px; }
.cap-tab { padding: 6px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 14.5px; }
.cap-tab:hover { color: var(--text); }
.cap-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(76,157,255,.1); font-weight: 600; }
.cap-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 9px; margin-bottom: 14px; }
.cap-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; }
.cap-kpi span { display: block; font-size: 12.5px; color: var(--muted); }
.cap-kpi b { display: block; margin-top: 3px; font: 700 20px var(--mono); }
.cap-kpi small { display: block; font-size: 11.5px; color: var(--faint); }
.cap-pos { color: var(--red); }
.cap-neg { color: var(--green); }
.cap-section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 13px; overflow: hidden; }
.cap-section-head { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cap-section-head h3 { margin: 0; font-size: 15.5px; }
.cap-section-head .cap-cnt { font: 12.5px var(--mono); color: var(--faint); }
.cap-section-head .cap-src { margin-left: auto; font-size: 12px; color: var(--faint); }
.cap-flow-row { display: grid; grid-template-columns: 108px minmax(0,1fr) 108px; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.cap-flow-row:last-child { border-bottom: 0; }
.cap-flow-row .cap-name { color: var(--text-2); }
.cap-flow-row .cap-name em { font-style: normal; font-size: 11.5px; color: var(--faint); margin-left: 4px; }
.cap-flow-row .cap-val { text-align: right; font: 600 14px var(--mono); }
.cap-bar { height: 9px; border-radius: 5px; background: var(--line-soft); position: relative; overflow: hidden; }
.cap-bar::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--faint); opacity: .5; }
.cap-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.cap-bar i.in { left: 50%; background: var(--red); }
.cap-bar i.out { right: 50%; background: var(--green); }
.cap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cap-table th { padding: 8px 12px; text-align: right; background: var(--panel-2); color: var(--faint); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.cap-table th:first-child, .cap-table td:first-child { text-align: left; }
.cap-table th:nth-child(2), .cap-table td:nth-child(2) { text-align: left; }
.cap-table td { padding: 9px 12px; text-align: right; border-top: 1px solid var(--line-soft); color: var(--text-2); white-space: nowrap; }
.cap-table tbody tr:hover { background: var(--panel-2); }
.cap-table .cap-code { font: 12px var(--mono); color: var(--faint); margin-right: 6px; }
.cap-table .cap-reason { max-width: 250px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--faint); }
.cap-expand { display: block; width: 100%; padding: 9px; border: 0; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--accent); font-size: 13.5px; }
.cap-expand:hover { background: var(--panel); }
.cap-note { padding: 11px 14px; margin-bottom: 13px; border: 1px solid rgba(255,171,61,.3); border-radius: 8px; background: rgba(255,171,61,.06); font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.cap-note b { color: var(--orange); }
.cap-empty { padding: 30px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- 抽屉 / 弹窗 ---------- */
/* 抽屉 / 弹窗显隐（关键）：元素默认带 hidden 属性，由文件顶部 [hidden]{display:none!important}
   强制隐藏以覆盖组件自身的 display 声明；JS 打开时移除 hidden，.drawer 从右侧滑入（slideIn），
   .drawer-mask 全屏遮罩点击可关闭，.modal 用 grid place-items:center 居中；
   z-index 递增 60(遮罩)/70(抽屉)/80(弹窗)/90(toast) 保证层级 */
.drawer-mask { position: fixed; inset: 0; background: rgba(3,7,14,.6); z-index: 60; backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 430px; max-width: 94vw; z-index: 70; display: flex; flex-direction: column; background: var(--bg-soft); border-left: 1px solid var(--line); box-shadow: var(--shadow); animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.detail-drawer { width: 480px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-close { border: 0; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.filter-section { margin-bottom: 18px; }
.filter-section h4 { margin: 0 0 8px; font-size: 13.5px; letter-spacing: 1px; color: var(--faint); text-transform: uppercase; }
.filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-opt { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); font-size: 14px; }
.filter-opt:hover { color: var(--text); }
.filter-opt.active { color: var(--accent); border-color: var(--accent); background: rgba(76,157,255,.1); }
.detail-title { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 0 0 12px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.detail-table td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); vertical-align: top; }
.detail-table td:first-child { width: 76px; color: var(--faint); }
.detail-summary { font-size: var(--fs-message); line-height: 1.85; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.detail-subtitle { margin: 18px 0 8px; font-size: 13.5px; letter-spacing: 1px; color: var(--faint); text-transform: uppercase; }
.detail-link { display: block; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--text-2); }
.detail-link:hover { color: var(--accent); }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
/* 帮助弹窗卡片与快捷键网格：.help-grid 两列展示 kbd + 说明；.toast 为底部居中的轻提示 */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(3,7,14,.6); }
.modal-card { width: 430px; max-width: 92vw; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; padding: 16px 18px; font-size: 14px; color: var(--text-2); }
.help-grid kbd { display: inline-block; min-width: 22px; padding: 1px 5px; margin-right: 6px; border: 1px solid var(--line); border-radius: 4px; font: 12.5px var(--mono); text-align: center; color: var(--accent); }
.help-note { margin: 0; padding: 0 18px 18px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.toast { position: fixed; bottom: 58px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 9px 16px; border-radius: 8px; background: var(--panel); border: 1px solid var(--accent); color: var(--text); font-size: 14px; box-shadow: var(--shadow); }

/* 页脚免责声明：flex 不参与伸缩、固定在底部；.collapsed 由「×」按钮切换隐藏 */
.disclaimer { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 18px; background: var(--bar); border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--muted); }
.disclaimer strong { color: var(--orange); white-space: nowrap; }
.disclaimer span { flex: 1; }
.disclaimer button { border: 0; background: transparent; color: var(--faint); font-size: 19px; }
.disclaimer.collapsed { display: none; }

/* ---------- 事件日历（历史 / 未来既定事件，按日期查看） ---------- */
.events-view { padding: 4px 0 30px; }
.ev-toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.ev-nav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ev-nav button, .ev-strip button {
  min-height: 32px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text-2); font-size: 13px; cursor: pointer;
}
.ev-nav button:hover, .ev-strip button:hover { border-color: var(--accent); color: var(--accent); }
.ev-nav input[type="date"] {
  padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-family: var(--mono); font-size: 13px;
}
.ev-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 10px 0; }
.ev-strip button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; }
.ev-strip button b { font-family: var(--mono); font-size: 13px; }
.ev-strip button small { color: var(--faint); font-size: 10.5px; }
.ev-strip button.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.ev-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-search {
  margin-left: auto; min-width: 180px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bar); color: var(--text); font-size: 12.5px; outline: none;
}
.ev-summary { color: var(--muted); font-size: 12.5px; margin: 4px 2px 10px; }
.ev-list { display: flex; flex-direction: column; gap: 7px; }
.ev-row {
  display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px;
  background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--line);
  border-radius: 10px; padding: 11px 13px;
}
.ev-row.high { border-left-color: var(--red); }
.ev-row.mid { border-left-color: var(--orange); }
.ev-time { color: var(--text-2); font-family: var(--mono); font-size: 13px; }
.ev-main b { display: block; font-size: 15px; font-weight: 600; line-height: 1.5; }
.ev-main small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; margin-top: 3px; }
.ev-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.ev-tags i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.ev-tags i.origin-rule { border-color: var(--purple); color: var(--purple); }
.ev-tags i.origin-official { border-color: var(--green); color: var(--green); }
.ev-tags i.origin-news { border-color: var(--cyan); color: var(--cyan); }
.ev-tags a { color: var(--accent); font-size: 11.5px; text-decoration: none; }
.ev-tags a:hover { text-decoration: underline; }

/* 响应式断点（关键布局）：1450px 收窄三栏 → 1180px 隐藏右栏 → 820px 移动端改单列纵向堆叠；
   窄屏下导航变横向滚动、时间轴移到左侧、卡片改单列，保证小屏可读可操作 */
@media (max-width: 1450px) { .layout { grid-template-columns: 220px minmax(0,1fr) 262px; } .feed { padding: 16px 18px 60px; } }
@media (max-width: 1180px) { .layout { grid-template-columns: 212px minmax(0,1fr); } .rightbar { display: none; } .brand { min-width: 165px; } }
@media (max-width: 820px) {
  .topbar { gap: 9px; padding: 8px 11px; height: auto; flex-basis: auto; flex-wrap: wrap; }
  .brand { min-width: auto; } .brand-sub, .clock, .top-search kbd { display: none; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  .layout { display: block; overflow-y: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .side-scroll { max-height: 148px; }
  .nav-group { margin-bottom: 4px; } .group-title { padding: 3px 6px; } .nav-list { flex-direction: row; overflow-x: auto; gap: 5px; }
  .nav-item { white-space: nowrap; width: auto; padding: 4px 9px; } .nav-item .count { display: none; }
  .side-foot { display: none; }
  .feed { padding: 14px 11px 40px; }
  .feed-list::before { left: 8px; }
  .news-card { grid-template-columns: 1fr; padding-left: 22px; }
  .card-time { text-align: left; padding: 0 0 4px; display: flex; gap: 8px; align-items: baseline; }
  .card-time .dot { left: -18px; right: auto; top: 4px; }
  .card-time .rel, .card-time .tdate { display: inline; }
  .topics-view, .clusters-view { grid-template-columns: 1fr; }
  .disclaimer { font-size: 12.5px; }
}
