/* ===== 主题变量 ===== */
:root {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --text: #1a1d24;
  --text-secondary: #5c6370;
  --border: #e5e7eb;
  --brand: #2563eb;
  --brand-weak: #eff4ff;
  --up: #d92e2e;      /* 红涨（中文习惯） */
  --up-bg: #fdf0f0;
  --down: #0a9d6c;    /* 绿跌 */
  --down-bg: #ecf9f4;
  --flat: #8a919c;
  --spark-line: #c6ccd6;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-card: #161c24;
    --text: #e6e8eb;
    --text-secondary: #9aa4b2;
    --border: #262d38;
    --brand: #60a5fa;
    --brand-weak: #16202e;
    --up: #f87171;
    --up-bg: #2a1a1c;
    --down: #34d399;
    --down-bg: #12261f;
    --flat: #6b7280;
    --spark-line: #39414d;
    --shadow: none;
  }
}

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ===== 页头 ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 24px; }
.brand-text small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.2;
}

.nav { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}
.nav-link:hover { text-decoration: none; background: var(--brand-weak); }
.nav-link.active { color: var(--brand); background: var(--brand-weak); font-weight: 600; }

/* ===== 报告头部 ===== */
main { padding: 32px 20px 48px; }

.report-head { margin-bottom: 28px; }

.report-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.headline {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
}

.trading-notes { color: var(--text-secondary); font-size: 13px; }

/* ===== 区块 ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.global-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.global-view-body p { margin-bottom: 10px; }
.global-view-body p:last-child { margin-bottom: 0; }

/* ===== 市场卡片 ===== */
.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.market-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.indices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.index-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.index-name { font-size: 13px; color: var(--text-secondary); }
.index-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.index-change { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.sparkline { display: block; width: 100%; height: 34px; margin-top: 8px; }
.spark-path {
  fill: none;
  stroke: var(--spark-line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-dot { stroke: var(--bg-card); stroke-width: 2; }
.spark-dot.up { fill: var(--up); }
.spark-dot.down { fill: var(--down); }
.spark-dot.flat { fill: var(--flat); }

/* ===== 日期翻页导航 ===== */
.report-date {
  display: flex;
  align-items: center;
  gap: 12px;
}
.day-nav {
  font-size: 13px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  white-space: nowrap;
}
.day-nav:hover { text-decoration: none; border-color: var(--brand); }
.day-nav[hidden] { display: none; }

.up   { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

.market-summary { margin-bottom: 16px; }

/* ===== 美股期货盘前 ===== */
.futures-block {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.futures-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.futures-title { font-weight: 700; font-size: 14px; }
.futures-asof { font-size: 12px; color: var(--text-secondary); }
.futures-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13px;
  margin-bottom: 4px;
}
.future-tile { display: flex; gap: 6px; align-items: baseline; }
.future-name { color: var(--text-secondary); }
.future-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.futures-outlook {
  font-size: 13.5px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.highlights { list-style: none; margin-bottom: 4px; }
.highlights li {
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-weak);
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
  font-size: 14px;
}
.highlights li strong { display: block; margin-bottom: 2px; }

/* ===== 个股表格 ===== */
.stocks-table-wrap { overflow-x: auto; }
.stocks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stocks-table th, .stocks-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.stocks-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
}
.stocks-table tr:last-child td { border-bottom: none; }
.stocks-table .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.stocks-table .sym { color: var(--text-secondary); font-size: 12px; }

/* ===== 大V观点 ===== */
.kol-views { margin-bottom: 28px; }

.kol-card {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.kol-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-weak);
  color: var(--brand);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kol-body { min-width: 0; }

.kol-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.kol-name { font-weight: 700; }
.kol-handle { color: var(--text-secondary); font-size: 13px; }

.kol-view { font-size: 14.5px; margin-bottom: 8px; }

.kol-note {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--brand-weak);
  border-radius: 8px;
  margin-bottom: 8px;
}

.kol-meta { font-size: 12px; color: var(--text-secondary); }

.kol-disclaimer {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 2px;
  margin: 16px 0 8px;
}

/* ===== 推文时间线（kol.html）===== */
.kol-profile { margin-bottom: 20px; }
.kol-profile .kol-card { margin-bottom: 0; }
.kol-handle:hover { text-decoration: underline; }

.tweet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.tweet-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tweet-type {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--brand-weak);
  color: var(--brand);
  font-weight: 600;
}
.tweet-type-retweet { background: var(--down-bg); color: var(--down); }
.tweet-type-reply, .tweet-type-quote { background: var(--up-bg); color: var(--up); }

.tweet-text {
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.tweet-zh {
  font-size: 14px;
  color: var(--text);
  background: var(--brand-weak);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.tweet-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.tweet-media img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.tweet-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tweet-metrics { font-size: 12px; color: var(--text-secondary); }
.tweet-link { font-size: 13px; }

.kol-empty {
  text-align: center;
  padding: 48px 0 24px;
  color: var(--text-secondary);
}
.kol-empty-note { font-size: 13px; margin-top: 6px; }

/* ===== 风险 & 关注 ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

.risks, .watchlist {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.risks ul, .watchlist ul { list-style: none; }
.risks li, .watchlist li {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.risks li:last-child, .watchlist li:last-child { border-bottom: none; }
.watchlist li strong { display: block; }
.watchlist li span { color: var(--text-secondary); font-size: 13px; }

.generated-at {
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
}

/* ===== 归档列表 ===== */
.archive-list { list-style: none; }
.archive-list li { margin-bottom: 10px; }
.archive-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.archive-list a:hover {
  text-decoration: none;
  border-color: var(--brand);
}
.archive-list .arrow { color: var(--text-secondary); }

/* ===== 状态 ===== */
.loading, .error {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 0;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}
.site-footer p { margin-bottom: 4px; }

@media (max-width: 600px) {
  .headline { font-size: 21px; }
  .header-inner { height: 56px; }
  .brand-text small { display: none; }
  main { padding-top: 24px; }
}
