/* Market Emotion 介绍页（/about），登录页（/login）也共用这里的顶栏与版面。
   沿用 TWSVP 与看板的视觉：浅灰底、白色直角描边卡片、黑色强调、Noto Sans SC + Manrope。
   唯一放大的元素是主视觉里的「今日情绪」实时读数。 */
:root {
  --bg: #efefef;
  --surface: #ffffff;
  --panel: #f3f3f3;
  --ink: #121417;
  --muted: #6b7280;
  --border: #e0e0e0;
  --heat: #ff4015;
  --nav-height: 64px;
  --drawer-height: 76px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #151922;
  --panel: #1b202c;
  --ink: #f5f7fb;
  --muted: #9aa3b2;
  --border: #2a3140;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-height); touch-action: manipulation; } /* 不缩放：连点两下不放大；视口 maximum-scale=1 挡住输入框聚焦放大 */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── 顶栏（同 TWSVP 首页：Logo + 名称 + 标语，右侧简繁切换） ── */
.nav {
  position: sticky; /* 与共用顶栏一致：顶栏占位，页面不再预留顶栏高度（否则卡片上方多出一段空白） */
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 32px; height: 32px; display: block; }
.brand-text { display: grid; gap: 1px; }
.brand-text b { font-family: "Manrope", sans-serif; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.app-download-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.app-download-link:hover { border-color: currentColor; }
.lang-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.lang-btn {
  padding: 2px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lang-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--border); background: var(--panel); }

/* ── 页面 ── */
.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--drawer-height) + 40px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 16px;
}
section, .hero { background: var(--surface); border: 1px solid var(--border); padding: 20px; }

/* ── 邀请横幅（/about?invite=SE…） ── */
.invite-banner { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--ink); }
.invite-banner[hidden] { display: none; }
.invite-banner-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.invite-banner-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }
.invite-banner em { color: var(--heat); font-style: normal; font-weight: 700; }

/* ── 主视觉 ── */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(18, 20, 23, 0.16) 1px, transparent 1px), radial-gradient(rgba(255, 64, 21, 0.22) 1px, transparent 1px);
  background-size: 12px 12px, 22px 22px;
  background-position: 0 0, 40px 30px;
  opacity: .35;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  pointer-events: none;
}
:root[data-theme="dark"] .hero::before { background-image: radial-gradient(rgba(245, 247, 251, 0.16) 1px, transparent 1px), radial-gradient(rgba(255, 64, 21, 0.28) 1px, transparent 1px); }
.hero > * { position: relative; }
.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
/* 两段成对轮换（动词 + 对象），后段都是 7 个字，切换时不换行、不抖动 */
.hero-word, .hero-object { display: inline-block; transition: opacity .28s ease, transform .28s ease; }
.hero-word { min-width: 2em; }
.hero-object { transition-delay: .06s; }
.hero-word.swap, .hero-object.swap { opacity: 0; transform: translateY(6px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-lead { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 34em; }

/* 今日情绪：与看板「A股短线情绪」卡同款（twsvp.css 的 .card / .pulse-main / .score-ring / .dimension-bars） */
.live { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 4px; }
.live-tile {
  display: block;
  min-width: 0;
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease;
}
.live-tile:hover { border-color: var(--ink); }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-title { font-size: 15px; font-weight: 600; line-height: 1.45; }
.live-posture {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.live-main { display: flex; align-items: center; gap: 18px; margin: 16px 0; }
.live-ring {
  --score: 0;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(var(--ink) calc(var(--score) * 1%), var(--panel) 0);
}
.live-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.live-ring > div { position: relative; text-align: center; }
.live-score { display: block; font-family: "Manrope", sans-serif; font-size: 38px; font-weight: 700; line-height: 1; }
.live-ring small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.live-copy { min-width: 0; }
.live-copy > span { color: var(--muted); font-size: 12px; }
.live-phase { display: block; margin: 2px 0 6px; font-size: 28px; font-weight: 600; line-height: 1.25; }
.live-summary { color: var(--muted); font-size: 13px; line-height: 1.6; }
.live-summary:empty { display: none; }
.live-dims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.live-dim span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.live-dim i { display: block; height: 4px; overflow: hidden; background: var(--panel); }
.live-dim em { display: block; width: 0; height: 100%; background: var(--ink); }
.live-dim b { display: block; margin-top: 5px; font-family: "Manrope", sans-serif; font-size: 14px; font-weight: 600; }
.live-time { display: block; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.live-market { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* 个股技术分析入口：输入后到 /technicalanalysis?q=（未登录先去登录，回来时已填好） */
.ta-tile { display: grid; gap: 10px; padding: 14px 12px; background: var(--surface); border: 1px solid var(--border); }
.ta-tile:focus-within { border-color: var(--ink); }
.ta-tile .live-market { margin-bottom: 0; color: var(--ink); font-size: 15px; line-height: 1.45; } /* 与情绪卡标题同款 */
.ta-tile .live-time { margin-top: 0; padding-top: 8px; }
/* 输入框：/shared/form.css 的 .se-bar（全站统一） */
.hero-note { padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ── 四步阅读 ── */
.steps-intro { display: grid; gap: 6px; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.35; }
.steps-intro p, .feature-text p, .markets p, .board p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.steps-intro .steps-note { font-size: 12px; }
.feature { display: grid; gap: 16px; }
.feature-text { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: baseline; }
.step-no {
  grid-row: span 2;
  align-self: start;
  padding: 4px 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
h3 { font-size: 17px; font-weight: 700; line-height: 1.4; }
.feature-shot { display: block; background: var(--bg); border: 1px solid var(--border); padding: 12px; }
.feature-shot img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.fade-bottom img {
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}
.fade-tail img {
  -webkit-mask-image: linear-gradient(180deg, #000 90%, transparent);
  mask-image: linear-gradient(180deg, #000 90%, transparent);
}

/* ── 数据来源（Wind MCP） ── */
.data-source { display: grid; gap: 12px; }
.data-source > p { color: var(--muted); font-size: 14px; line-height: 1.7; }
/* 2×2 格子：用 1px 间隙透出底色当分隔线 */
.source-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--border); border: 1px solid var(--border); }
.source-list li { display: grid; gap: 4px; align-content: start; padding: 12px; background: var(--surface); }
.source-list b { font-size: 14px; font-weight: 600; }
.source-list span { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 360px) {
  .source-list { grid-template-columns: 1fr; }
}

/* ── 看板 ── */
.boards { display: grid; gap: 12px; }
.board { display: grid; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--border); }
.board > div:first-child { display: grid; gap: 4px; }
.board-links { display: flex; gap: 8px; }
.board-link {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.board-link:hover { border-color: var(--ink); }

/* ── 页脚 ── */
.footer { display: grid; gap: 2px; padding: 4px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ── 底部单一行动（同 TWSVP 首页的底部抽屉） ── */
.drawer {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(15, 20, 25, 0.08);
}
.drawer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--drawer-height);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.drawer-copy { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.4; }
.drawer-cta {
  flex: none;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 520px) {
  .hero-title { font-size: 30px; }
}
@media (max-width: 380px) {
  .hero-title { font-size: 28px; }
  .live-main { gap: 14px; }
  .live-ring { width: 96px; height: 96px; }
  .live-score { font-size: 32px; }
  .live-phase { font-size: 24px; }
  .drawer-copy { display: none; }
  .drawer-cta { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-word, .hero-object, .live-tile, .board-link { transition: none; }
}

/* ── 每日看点：最新几篇（about.js 读 /api/news?view=latest） ── */
.news-intro { display: grid; gap: 12px; }
.news-intro > p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.news-latest { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.news-latest[hidden] { display: none; }
.news-latest li { border-bottom: 1px solid var(--border); }
.news-latest a { display: grid; gap: 4px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.news-latest small { color: var(--muted); font-size: 12px; }
.news-latest span { font-size: 15px; font-weight: 600; line-height: 1.55; }
.news-latest a:hover span { text-decoration: underline; }
/* 2026-11-20 改版：四个看板卡与近期短线情绪 */
.tab-card h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.tab-card h3 svg { width: 22px; height: 22px; flex: none; }
.tab-items { display: grid; gap: 6px; margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.recent-wrap { overflow-x: auto; }
.recent-wrap[hidden] { display: none; }
.recent-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.recent-table th, .recent-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.recent-table th:first-child, .recent-table td:first-child { text-align: left; }
.recent-table thead th { color: var(--muted); font-size: 12px; font-weight: 500; }
.recent-table a { color: inherit; }
@media (min-width: 900px) { .tab-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
