/* ===== 共用样式：基于 trae/theme-intel-20260810.html 框架（深色 GitHub-dark 风）
   新增首页表格与验证页统计样式 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;900&display=swap');

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2333;
  --ink: #e6edf3;
  --muted: #8b949e;
  --rule: #30363d;
  --accent: #f85149;
  --accent2: #d29922;
  --green: #3fb950;
  --blue: #58a6ff;
  --red-bg: rgba(248,81,73,0.12);
  --gold-bg: rgba(210,153,34,0.12);
  --gray-bg: rgba(139,148,158,0.12);
  --green-bg: rgba(63,185,80,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ===== 报告页 Header ===== */
.report-header {
  background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 2.2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.report-header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--green));
}
.report-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: 0.02em; }
.report-header .subtitle { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
/* 首页标题栏：单行紧凑 */
.report-header-home { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.75rem; padding: 1.3rem 2rem; }
.report-header-home h1 { font-size: 1.5rem; margin-bottom: 0; }
.report-header-home .subtitle { margin-bottom: 0; font-size: 0.92rem; }
.report-header .meta-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.meta-tag {
  background: var(--bg3); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.25rem 0.75rem; font-size: 0.8rem; color: var(--muted);
}
.meta-tag.hot { color: var(--accent); border-color: var(--accent); }

/* ===== 章节 ===== */
section { margin-bottom: 2.5rem; }
h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--accent); display: inline-block; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--accent2); margin: 1.5rem 0 0.75rem; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 1rem 0 0.5rem; }
p { margin-bottom: 0.75rem; }
strong { color: var(--ink); font-weight: 600; }

/* ===== Callout ===== */
.callout { background: var(--bg2); border-left: 4px solid var(--accent2); border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin: 1rem 0; font-size: 0.9rem; }
.callout.warn { border-left-color: var(--accent); }
.callout.info { border-left-color: var(--blue); }
.callout.success { border-left-color: var(--green); }

/* ===== 题材卡 ===== */
.theme-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; transition: border-color 0.2s; }
.theme-card:hover { border-color: var(--accent2); }
.theme-card .theme-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.theme-card .theme-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge.policy { background: rgba(88,166,255,0.15); color: var(--blue); }
.badge.industry { background: rgba(63,185,80,0.15); color: var(--green); }
.badge.sudden { background: rgba(248,81,73,0.15); color: var(--accent); }
.badge.fundamental { background: rgba(210,153,34,0.15); color: var(--accent2); }
.badge.big { background: var(--red-bg); color: var(--accent); border: 1px solid var(--accent); }
.badge.mid { background: var(--gold-bg); color: var(--accent2); border: 1px solid var(--accent2); }
.badge.small { background: var(--gray-bg); color: var(--muted); border: 1px solid var(--muted); }
.badge.new { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }

/* ===== 指标网格 ===== */
.factor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 0.75rem 0; }
.factor-item { background: var(--bg3); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.8rem; }
.factor-item .label { color: var(--muted); display: block; font-size: 0.75rem; }
.factor-item .value { color: var(--ink); font-weight: 600; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: 720px; border-radius: 8px; border: 1px solid var(--rule); margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 760px; }
thead { position: sticky; top: 0; z-index: 10; }
th { background: var(--bg3); color: var(--ink); font-weight: 600; text-align: left; padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--rule); white-space: nowrap; }
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); color: var(--muted); vertical-align: top; }
td.stock-name { color: var(--ink); font-weight: 500; white-space: nowrap; }
tr:hover td { background: rgba(88,166,255,0.04); }
.up { color: var(--accent); } .down { color: var(--green); }

/* 评分徽章 */
.score { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.85rem; min-width: 2.5rem; text-align: center; }
.score.red { background: var(--red-bg); color: var(--accent); border: 1px solid var(--accent); }
.score.gold { background: var(--gold-bg); color: var(--accent2); border: 1px solid var(--accent2); }
.score.gray { background: var(--gray-bg); color: var(--muted); border: 1px solid var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1rem 0; }

/* 杂项 */
.muted-note { font-size: 0.82rem; color: var(--muted); margin: 0.5rem 0 1rem; }
.dash-list { list-style: none; padding-left: 0; margin: 0.5rem 0 1rem; }
.dash-list li { position: relative; padding-left: 1.1rem; margin-bottom: 0.5rem; color: var(--muted); }
.dash-list li::before { content: '▸'; position: absolute; left: 0; color: var(--accent2); }
.dash-list li b { color: var(--ink); }

footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.8rem; color: var(--muted); }
.disclaimer { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem; margin-top: 1.5rem; }

/* ===================== 首页 / 全量页 两列表格 ===================== */
/* 原先的 .home-table 在窄屏下因 display:block 错位（字节源列掉到左列下方），
   现改为：保留两列表格结构，窄屏用外层 .table-scroll 横向滚动，不再打散表格。 */
.home-h2-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin: 2rem 0 0.75rem; }
.home-h2-wrap:first-of-type { margin-top: 1.5rem; }
.home-h2 { font-size: 1.2rem; font-weight: 700; margin: 0; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); display: inline-block; }
.home-h2-note { font-size: 0.82rem; color: var(--muted); }

/* 窄屏横向滚动容器：表格保持两列并排，超出视口部分横向滚动，不换行、不错位 */
.table-scroll { overflow-x: auto; margin-bottom: 0.5rem; }
.home-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.home-table > thead > tr > th {
  background: var(--bg3); color: var(--ink); font-weight: 600; font-size: 0.95rem;
  text-align: left; padding: 0.7rem 1rem; border-bottom: 2px solid var(--rule); white-space: nowrap;
}
.home-col { vertical-align: top; border-right: 1px solid var(--rule); padding: 0; }
.home-col:last-child { border-right: none; }
.home-col .more-wrap { border-top: 1px solid var(--rule); }

/* 内嵌表（日期/报告/验证 或 日期/情报） */
.inner-table { width: 100%; max-width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
/* 两列版（日期/情报）：情报 = 72%，与三列版的 报告(42%)+验证(30%) 右边界对齐 */
.inner-table.cols-2 thead tr th:nth-child(1) { width: 28%; }
.inner-table.cols-2 thead tr th:nth-child(2) { width: 72%; }
/* 三列版（日期/报告/验证）：日期28% + 报告42% + 验证30% */
.inner-table.cols-3 thead tr th:nth-child(1) { width: 28%; }
.inner-table.cols-3 thead tr th:nth-child(2) { width: 42%; }
.inner-table.cols-3 thead tr th:nth-child(3) { width: 30%; }
.inner-table td { overflow-wrap: anywhere; word-break: break-word; }
.inner-table thead tr th { background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 600; text-align: left; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inner-table tbody tr td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--rule); font-size: 0.85rem; color: var(--muted); vertical-align: middle; }
.inner-table tbody tr:last-child td { border-bottom: none; }
.inner-table .rec-date { font-weight: 700; color: var(--ink); font-size: 0.9rem; white-space: nowrap; }
.inner-table a { font-size: 0.85rem; }
.inner-table .verify-l { color: var(--accent2); }
.inner-table .rec-empty { color: var(--muted); text-align: center; padding: 1.2rem 0; }

.more-wrap { padding: 0.5rem 1rem; text-align: right; }
.more-wrap a { font-size: 0.85rem; font-weight: 600; }
.home-note { margin-top: 1.5rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* 分页器（更多页） */
.pager { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; margin: 1.5rem 0; }
.pager .pg-link { background: var(--bg2); border: 1px solid var(--rule); border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 0.85rem; color: var(--blue); }
.pager .pg-link:hover { border-color: var(--accent2); text-decoration: none; }
.pager .pg-cur { background: var(--accent); color: #fff; border-radius: 6px; padding: 0.35rem 0.7rem; font-size: 0.85rem; font-weight: 700; }
.pager .pg-info { font-size: 0.8rem; color: var(--muted); margin-left: 0.5rem; }

/* ===================== 验证页专用 ===================== */
.verify-group { margin-bottom: 2rem; }
.verify-group h3 { color: var(--accent2); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.25rem; text-align: center; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-card .lbl { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.verdict { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.verdict.hit { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.verdict.miss { background: var(--red-bg); color: var(--accent); border: 1px solid var(--accent); }
.verdict.na { background: var(--gray-bg); color: var(--muted); border: 1px solid var(--muted); }

/* 首页导航卡（盘前题材情报入口） */
.home-nav { margin-bottom: 1.5rem; }
.nav-card {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem 1.25rem; transition: border-color 0.2s, transform 0.1s;
}
.nav-card:hover { border-color: var(--accent2); text-decoration: none; transform: translateY(-1px); }
.nav-card .nav-ico { font-size: 1.6rem; }
.nav-card .nav-txt { display: flex; flex-direction: column; }
.nav-card .nav-txt b { color: var(--ink); font-size: 1rem; }
.nav-card .nav-txt i { color: var(--muted); font-style: normal; font-size: 0.8rem; margin-top: 0.15rem; }

/* 首页 footer（邮箱 / 统计 / 内部说明） */
.foot-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; justify-content: center; text-align: center; }
.foot-item { font-size: 0.85rem; color: var(--muted); }
.foot-item a { color: var(--blue); font-weight: 600; }
.foot-item b { color: var(--ink); }
.foot-warn { color: var(--accent2); font-weight: 600; }

/* 友商列留空占位 */
.rec.empty { color: var(--muted); }
.rec.empty .tag-line2 { font-size: 0.8rem; }

/* 返回首页链接 */
.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.85rem; }

@media (max-width: 768px) {
  .container { padding: 1rem 0.75rem 3rem; }
  .factor-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .report-header h1 { font-size: 1.4rem; }
  .rec { grid-template-columns: 90px 1fr; }
  .rec a.verify-l { grid-column: 1 / -1; }
  /* 窄屏下首页/全量页表格保持两列并排，由外层 .table-scroll 横向滚动，不再打散 */
}
