/* ============================================================
   虚拟投资模拟平台 v2  全站样式（暗色金融风 + 手机自适应）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d1117; --card: #161b22; --line: #30363d; --line2: #21262d;
  --txt: #e6edf3; --txt2: #adbac7; --muted: #768390; --gold: #f0b90b;
  --up: #f85149; --down: #3fb950; --blue: #58a6ff; --green: #238636;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px; line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { color: #f0f6fc; }
code { background: var(--line2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 14px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 80; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
.brand { font-weight: 700; font-size: 16px; color: #f0f6fc; white-space: nowrap; }
.brand span { color: var(--gold); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { padding: 6px 11px; border-radius: 7px; color: var(--txt2); white-space: nowrap; }
.nav a:hover { background: var(--line2); color: #f0f6fc; text-decoration: none; }
.nav a.on { background: var(--line2); color: #f0f6fc; }
.nav a.on.mkt { background: rgba(240,185,11,.14); color: var(--gold); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin-bottom: 12px; color: #f0f6fc; display: flex; align-items: center; gap: 7px; }
.card h2 .more { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line2); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: var(--card); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(88,166,255,.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); font-size: 12px; }
.clickable { cursor: pointer; }

.btn { display: inline-block; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px;
  background: var(--green); color: #fff; cursor: pointer; font-size: 14px; font-family: inherit; }
.btn:hover { background: #2ea043; text-decoration: none; }
.btn.gray { background: var(--line); color: var(--txt); }
.btn.gray:hover { background: #3d444d; }
.btn.red { background: #da3633; }
.btn.red:hover { background: #f85149; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--txt2); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--txt); font-size: 14px; width: 100%; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
label { display: block; margin: 8px 0 5px; color: var(--txt2); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 150px; }

.msg, .flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.msg.ok, .flash.ok { background: #0f2f1a; border: 1px solid #238636; color: #7ee787; }
.msg.err, .flash.err { background: #3d1518; border: 1px solid #da3633; color: #ffb3b8; }

.badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; background: var(--line2); color: var(--txt2); white-space: nowrap; }
.badge.gold { background: rgba(240,185,11,.15); color: var(--gold); }
.badge.blue { background: rgba(88,166,255,.15); color: var(--blue); }

.stat { display: flex; gap: 18px; flex-wrap: wrap; }
.stat .it { flex: 1; min-width: 130px; }
.stat .it div:first-child { color: var(--muted); font-size: 12px; }
.stat .it div:last-child { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

.sect { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sect::-webkit-scrollbar { display: none; }
.sect a { flex: 0 0 auto; padding: 7px 13px; border-radius: 20px; background: var(--line2);
  color: var(--txt2); font-size: 13px; white-space: nowrap; border: 1px solid transparent; }
.sect a:hover { text-decoration: none; color: #f0f6fc; }
.sect a.on { background: rgba(240,185,11,.14); border-color: rgba(240,185,11,.45); color: var(--gold); font-weight: 600; }
.sect .sp { flex: 1 1 auto; }

.idxbar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.idxbar::-webkit-scrollbar { display: none; }
.idxbar a { flex: 0 0 auto; min-width: 132px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px; color: inherit; }
.idxbar a:hover { text-decoration: none; border-color: var(--blue); }
.idxbar .n { font-size: 12px; color: var(--txt2); }
.idxbar .p { font-size: 16px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.idxbar .c { font-size: 12px; font-variant-numeric: tabular-nums; }

.news li { list-style: none; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.news li:last-child { border-bottom: none; }
.news .t { font-size: 14px; font-weight: 600; color: #f0f6fc; line-height: 1.45; }
.news .t:hover { color: var(--blue); }
.news .m { margin-top: 5px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.news .s { margin-top: 5px; font-size: 12.5px; color: var(--txt2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { padding: 1px 7px; border-radius: 4px; background: var(--line2); color: var(--txt2); font-size: 11px; cursor: pointer; }
.tag:hover { color: var(--gold); text-decoration: none; }
.topdot { color: var(--gold); font-size: 11px; }

/* ---------- K线（普通页面） ---------- */
.kline { width: 100%; height: 420px; }

/* ---------- K线弹窗（只改这里，其余完全不动） ---------- */
#lv { position: fixed; inset: 0; background: rgba(13,17,23,.92); z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 16px; }
#lv .box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  width: 100%; max-width: 960px; max-height: 92vh; overflow-y: auto; }
#lv .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
#lv .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }

/* ---------- 手机底部标签栏 ---------- */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(22,27,34,.97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 6px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.tabbar a i { display: block; font-style: normal; font-size: 19px; line-height: 1.3; }
.tabbar a.on { color: var(--gold); }
.snd { cursor: pointer; user-select: none; font-size: 15px; }

@media (max-width: 820px) {
  .wrap { padding: 10px 10px 74px; }
  .topbar .wrap { gap: 8px; }
  .brand { font-size: 15px; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .card { padding: 13px; border-radius: 10px; }
  .card h2 { font-size: 14px; }
  th, td { padding: 8px 6px; font-size: 12.5px; }
  .stat { gap: 8px; }
  .stat .it { min-width: 45%; }
  .stat .it div:last-child { font-size: 17px; }
  .kline { height: 320px; }
  .btn, .btn.sm { padding: 10px 14px; font-size: 15px; }
  input, select, textarea { font-size: 16px; padding: 11px 10px; }
  .row > div { min-width: 100%; }
  .m-hide { display: none !important; }
  .tabbar { display: flex; }
  .idxbar a { min-width: 118px; }
}
@media (min-width: 821px) { .m-only { display: none !important; } }