/* ============ 虎讯财经 - 雪球风格样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand: #1a6cff;
  --brand-dark: #0f55d6;
  --up: #f04134;
  --down: #0aa15f;
  --text: #333;
  --text-sub: #8a8f99;
  --bg: #f5f6f8;
  --border: #eceef2;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }

/* ---------- 顶部导航 ---------- */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; height: 56px;
  display: flex; align-items: center; gap: 28px; padding: 0 16px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.logo-icon {
  display: inline-flex; width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand); color: #fff; align-items: center; justify-content: center;
  font-size: 18px;
}
.logo-text { color: var(--brand); }
.nav-menu { display: flex; gap: 24px; flex: 1; }
.nav-menu a { color: #555; font-size: 15px; padding: 4px 0; }
.nav-menu a:hover { color: var(--brand); }
.nav-menu a.active { color: var(--brand); font-weight: 600; border-bottom: 2px solid var(--brand); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.search-box {
  position: relative; background: var(--bg); border-radius: 18px;
  padding: 7px 34px 7px 14px; width: 200px;
}
.search-box input { border: none; outline: none; background: transparent; width: 100%; font-size: 13px; }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }
.btn-login {
  background: var(--brand); color: #fff; padding: 7px 18px;
  border-radius: 18px; font-size: 13px; transition: background .2s;
}
.btn-login:hover { background: var(--brand-dark); }

/* ---------- 行情滚动条 ---------- */
.ticker-bar {
  background: #fff; border-bottom: 1px solid var(--border);
  overflow: hidden; white-space: nowrap;
}
.ticker-track {
  display: inline-block; padding: 8px 0; white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item { display: inline-block; margin-right: 40px; font-size: 13px; }
.ticker-item .t-name { color: #555; margin-right: 6px; }
.ticker-item .t-price { font-weight: 600; margin-right: 6px; }
.ticker-item .t-chg { font-size: 12px; }

/* ---------- 布局 ---------- */
.container {
  max-width: 1100px; margin: 16px auto 0; padding: 0 16px;
  display: grid; grid-template-columns: 1fr 320px; gap: 16px;
  align-items: start;
}

.card {
  background: #fff; border-radius: 8px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-meta { font-size: 12px; color: var(--text-sub); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  display: inline-block; animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(240,65,52,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(240,65,52,0); }
  100% { box-shadow: 0 0 0 0 rgba(240,65,52,0); }
}
.auto-tag {
  font-size: 11px; color: var(--brand); background: rgba(26,108,255,.08);
  border: 1px solid rgba(26,108,255,.25); padding: 1px 8px; border-radius: 10px;
  font-weight: 400;
}

/* ---------- 要闻横幅 ---------- */
.flash-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 16px 0; padding: 10px 14px;
  background: linear-gradient(90deg, rgba(240,65,52,.07), rgba(240,65,52,.02));
  border-left: 3px solid var(--up); border-radius: 4px;
}
.flash-tag {
  background: var(--up); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 3px; flex-shrink: 0;
}
.flash-text { font-size: 14px; font-weight: 600; color: #b2291f; }

/* ---------- 直播流 ---------- */
.feed { padding: 4px 0; }
.feed-item {
  display: flex; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); position: relative;
}
.feed-item:hover { background: #fafbfd; }
.feed-time {
  flex-shrink: 0; width: 64px; text-align: right;
  color: var(--text-sub); font-size: 13px; padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--text); }
.feed-item:hover .feed-title { color: var(--brand); }
.feed-content { font-size: 13px; color: #666; line-height: 1.7; margin-top: 4px; }
.feed-tags { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.stock-tag {
  font-size: 12px; color: var(--brand); background: rgba(26,108,255,.07);
  padding: 2px 8px; border-radius: 3px;
}
.type-badge {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px;
  margin-right: 6px; vertical-align: 2px;
}
.badge-flash { background: var(--up); color: #fff; }
.badge-corp  { background: #ff8f1f; color: #fff; }
.badge-market{ background: var(--brand); color: #fff; }
.badge-policy{ background: #722ed1; color: #fff; }

.feed-item.is-important .feed-title { color: #b2291f; }

/* 新消息插入高亮 */
.feed-item.fresh { animation: fresh-in 2.4s ease-out; }
@keyframes fresh-in {
  0%   { background: rgba(26,108,255,.14); opacity: 0; transform: translateY(-8px); }
  20%  { opacity: 1; transform: translateY(0); }
  100% { background: transparent; }
}

.load-more-wrap { text-align: center; padding: 14px; }
.btn-more {
  border: 1px solid var(--border); background: #fafbfd; color: #666;
  padding: 8px 40px; border-radius: 18px; cursor: pointer; font-size: 13px;
}
.btn-more:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 侧栏：指数 ---------- */
.index-list { padding: 6px 0; }
.index-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.index-row:last-child { border-bottom: none; }
.idx-name { font-size: 13px; color: #555; }
.idx-price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.idx-chg { font-size: 12px; margin-left: 8px; font-variant-numeric: tabular-nums; }

/* ---------- 侧栏：热门话题 ---------- */
.hot-list { padding: 6px 0; list-style: none; }
.hot-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13px; cursor: pointer;
}
.hot-list li:hover .hot-title { color: var(--brand); }
.hot-rank {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  background: #e6e8ee; color: #8a8f99; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hot-list li:nth-child(1) .hot-rank { background: var(--up); color: #fff; }
.hot-list li:nth-child(2) .hot-rank { background: #ff8f1f; color: #fff; }
.hot-list li:nth-child(3) .hot-rank { background: #ffc53d; color: #fff; }
.hot-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-heat { font-size: 11px; color: var(--text-sub); }

/* ---------- 侧栏：热股榜 ---------- */
.stock-list { padding: 6px 0; }
.stock-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
  align-items: center; padding: 9px 16px; font-size: 13px;
}
.stock-row:hover { background: #fafbfd; }
.s-name { font-weight: 600; }
.s-code { font-size: 11px; color: var(--text-sub); margin-left: 4px; }
.s-price { font-variant-numeric: tabular-nums; }
.s-chg {
  min-width: 62px; text-align: center; padding: 2px 0;
  border-radius: 3px; font-size: 12px; color: #fff; font-variant-numeric: tabular-nums;
}

/* 涨跌色（A股习惯：涨红跌绿） */
.up   { color: var(--up); }
.down { color: var(--down); }
.s-chg.up   { background: var(--up); color: #fff; }
.s-chg.down { background: var(--down); color: #fff; }

/* ---------- App 卡片 ---------- */
.app-card { display: flex; gap: 12px; padding: 16px; align-items: center; }
.app-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #4d94ff);
  color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.app-title { font-weight: 600; font-size: 14px; }
.app-desc { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 页脚 / 提示 ---------- */
.footer { text-align: center; color: var(--text-sub); padding: 24px 16px 32px; font-size: 13px; }
.footer-sub { font-size: 12px; margin-top: 6px; opacity: .8; }

.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: rgba(20,30,50,.88); color: #fff; padding: 8px 20px;
  border-radius: 18px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .container { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
  .search-box { width: 140px; }
}
