/* ============ 虎讯财经 - 移动端样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #1a6cff;
  --up: #f04134;
  --down: #0aa15f;
  --text: #222;
  --text-sub: #8a8f99;
  --bg: #f4f5f7;
  --border: #eceef2;
  --navbar-h: calc(56px + env(safe-area-inset-bottom));
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px;
  padding-bottom: var(--navbar-h);
}
a { text-decoration: none; color: inherit; }

/* ---------- 顶部栏 ---------- */
.m-header {
  background: #fff; height: 48px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.m-logo { display: flex; align-items: center; gap: 6px; }
.m-logo-icon {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.m-logo-text { color: var(--brand); font-size: 17px; font-weight: 700; }
.m-header-right { display: flex; gap: 16px; font-size: 17px; opacity: .75; }

/* ---------- 行情滚动条 ---------- */
.m-ticker { background: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.m-ticker-track {
  display: inline-block; padding: 7px 0; white-space: nowrap;
  animation: tk 36s linear infinite;
}
@keyframes tk { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-item { display: inline-block; margin-right: 26px; font-size: 12px; }
.tk-name { color: #555; margin-right: 4px; }
.tk-price { font-weight: 600; margin-right: 4px; }

/* ---------- 吸顶标签 ---------- */
.m-tabs {
  position: sticky; top: 0; z-index: 90;
  background: #fff; display: flex; padding: 0 6px;
  border-bottom: 1px solid var(--border);
}
.m-tab {
  flex: 1; text-align: center; padding: 11px 0 9px; font-size: 15px;
  color: #555; position: relative; cursor: pointer;
}
.m-tab.active { color: var(--brand); font-weight: 600; }
.m-tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; border-radius: 2px; background: var(--brand);
}

/* ---------- 新消息胶囊 ---------- */
.new-pill {
  position: fixed; top: 104px; left: 50%; z-index: 95;
  transform: translateX(-50%) translateY(-14px);
  background: var(--brand); color: #fff; font-size: 13px;
  padding: 8px 18px; border-radius: 18px;
  box-shadow: 0 4px 14px rgba(26,108,255,.4);
  opacity: 0; pointer-events: none; transition: all .3s;
}
.new-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- 直播流 ---------- */
.m-feed-wrap { background: #fff; margin-top: 8px; }
.m-feed-head {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px 8px; font-size: 15px; font-weight: 600;
}
.m-feed-time { margin-left: auto; font-size: 11px; color: var(--text-sub); font-weight: 400; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  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 6px rgba(240,65,52,0); }
  100% { box-shadow: 0 0 0 0 rgba(240,65,52,0); }
}

.m-item {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
}
.m-item:active { background: #f7f9fc; }
.m-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.m-item-time { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.m-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; color: #fff;
}
.badge-flash { background: var(--up); }
.badge-corp  { background: #ff8f1f; }
.badge-market{ background: var(--brand); }
.badge-policy{ background: #722ed1; }
.m-item-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.m-item.is-important .m-item-title { color: #b2291f; }
.m-item-content { font-size: 13px; color: #666; line-height: 1.65; margin-top: 5px; }
.m-item-tags { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.m-stock-tag {
  font-size: 11px; color: var(--brand); background: rgba(26,108,255,.07);
  padding: 2px 8px; border-radius: 3px;
}

/* 新消息高亮 */
.m-item.fresh { animation: fresh 2.2s ease-out; }
@keyframes fresh {
  0%   { background: rgba(26,108,255,.15); opacity: 0; transform: translateY(-6px); }
  20%  { opacity: 1; transform: translateY(0); }
  100% { background: transparent; }
}

.m-feed-status { text-align: center; color: var(--text-sub); font-size: 12px; padding: 14px; }

/* ---------- 通用区块 ---------- */
.m-section { margin-top: 8px; padding: 4px 10px 10px; }
.m-sec-title { font-size: 15px; font-weight: 600; padding: 12px 4px 8px; }
.m-card { background: #fff; border-radius: 10px; overflow: hidden; }

/* 指数两列网格 */
.m-index-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px;
}
.m-idx-card {
  background: #fff; border-radius: 10px; padding: 12px 14px;
}
.m-idx-name { font-size: 12px; color: var(--text-sub); }
.m-idx-price { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-idx-chg { font-size: 12px; font-variant-numeric: tabular-nums; }

/* 热股榜 */
.m-stock-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.m-stock-row:last-child { border-bottom: none; }
.ms-name { font-weight: 600; }
.ms-code { font-size: 11px; color: var(--text-sub); margin-left: 4px; }
.ms-price { font-variant-numeric: tabular-nums; }
.ms-chg {
  min-width: 64px; text-align: center; padding: 3px 0; border-radius: 4px;
  font-size: 12px; color: #fff; font-variant-numeric: tabular-nums;
}

/* 热门话题 */
.m-hot-list { list-style: none; }
.m-hot-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.m-hot-list li:last-child { border-bottom: none; }
.m-hot-rank {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: #e6e8ee; color: #8a8f99; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.m-hot-list li:nth-child(1) .m-hot-rank { background: var(--up); color: #fff; }
.m-hot-list li:nth-child(2) .m-hot-rank { background: #ff8f1f; color: #fff; }
.m-hot-list li:nth-child(3) .m-hot-rank { background: #ffc53d; color: #fff; }
.m-hot-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-hot-heat { font-size: 11px; color: var(--text-sub); }

/* 涨跌色 */
.up   { color: var(--up); }
.down { color: var(--down); }
.ms-chg.up   { background: var(--up); color: #fff; }
.ms-chg.down { background: var(--down); color: #fff; }

/* ---------- 页脚 ---------- */
.m-footer { text-align: center; color: var(--text-sub); font-size: 12px; padding: 20px 16px 24px; line-height: 1.9; }
.m-footer a { color: var(--brand); }

/* ---------- 底部导航 ---------- */
.m-navbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--navbar-h); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--border);
  display: flex;
}
.m-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 10px; color: #8a8f99;
}
.m-nav-item.active { color: var(--brand); }
.m-nav-ico { font-size: 19px; }

/* ---------- Toast ---------- */
.m-toast {
  position: fixed; bottom: calc(var(--navbar-h) + 20px); left: 50%;
  transform: translateX(-50%) translateY(10px);
  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; white-space: nowrap;
}
.m-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
