/* 阿汪选股 · 深色看盘风 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --border: #2a3140;
  --text: #e6e8eb;
  --text2: #8b949e;
  --up: #f5455c;      /* 涨-红 */
  --down: #2ea043;    /* 跌-绿 */
  --accent: #e8b339;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; padding-bottom: 62px;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-card { width: 82%; max-width: 340px; text-align: center; }
.login-logo { font-size: 44px; }
.login-title { font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-sub { color: var(--text2); font-size: 12px; margin: 6px 0 26px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); font-size: 16px; outline: none; text-align: center;
}
.login-card button {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--accent); color: #111; font-size: 16px; font-weight: 700;
}
.login-err { color: var(--up); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- 顶部搜索 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.searchbox input {
  width: 100%; padding: 9px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); font-size: 14px; outline: none;
}
.search-results {
  position: absolute; left: 12px; right: 12px; top: 52px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  max-height: 300px; overflow-y: auto;
}
.search-item { padding: 11px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.search-item:last-child { border-bottom: 0; }
.search-item .si-name { font-weight: 600; }
.search-item .si-code { color: var(--text2); font-size: 12px; margin-left: 8px; }

/* ---------- Tab ---------- */
.tab { display: none; padding: 10px 12px; }
.tab.active { display: block; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text2);
  font-size: 13px;
}
.chip.active { background: rgba(232,179,57,.15); border-color: var(--accent); color: var(--accent); }

/* ---------- 股票列表 ---------- */
.list-head {
  display: flex; color: var(--text2); font-size: 11px;
  padding: 8px 4px 6px; border-bottom: 1px solid var(--border);
}
.stock-list { }
.row {
  display: flex; align-items: center;
  padding: 11px 4px; border-bottom: 1px solid rgba(42,49,64,.5);
}
.c-name { flex: 1.5; min-width: 0; }
.c-price { flex: 1; text-align: right; }
.c-pct { flex: 1; text-align: right; }
.c-extra { flex: 1; text-align: right; color: var(--text2); font-size: 12px; }

.stock-item .st-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-item .st-code { color: var(--text2); font-size: 11px; margin-top: 2px; }
.stock-item .st-price { font-variant-numeric: tabular-nums; }
.stock-item .st-pct {
  font-variant-numeric: tabular-nums; font-weight: 700;
  display: inline-block; min-width: 64px; text-align: center;
  padding: 3px 0; border-radius: 6px;
}
.pct-up { color: var(--up); background: rgba(245,69,92,.12); }
.pct-down { color: var(--down); background: rgba(46,160,67,.12); }
.pct-flat { color: var(--text2); background: var(--panel2); }

.update-hint { color: var(--text2); font-size: 11px; text-align: center; padding: 12px 0; }

/* ---------- 选股 ---------- */
.screen-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.screen-bar button {
  padding: 8px 18px; border-radius: 18px; border: 0;
  background: var(--accent); color: #111; font-weight: 700; font-size: 13px;
}
#screenMeta { color: var(--text2); font-size: 12px; }
.strategy-note { color: var(--text2); font-size: 11px; line-height: 1.9; padding: 14px 2px; }

/* ---------- 自选 ---------- */
.watch-empty { text-align: center; color: var(--text2); padding: 60px 0; line-height: 2; }
.watch-empty-icon { font-size: 40px; }
.del-btn {
  color: var(--text2); font-size: 12px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: none;
}

/* ---------- 热点 ---------- */
.hot-block { margin-bottom: 22px; }
.hot-block h3 { font-size: 15px; margin: 8px 0 10px; border-left: 3px solid var(--accent); padding-left: 8px; }
.board-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.board-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
}
.board-card .b-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .b-pct { font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.board-card .b-sub { color: var(--text2); font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-list { }
.news-item { padding: 10px 2px; border-bottom: 1px solid rgba(42,49,64,.5); }
.news-time { color: var(--accent); font-size: 11px; }
.news-title { margin-top: 4px; line-height: 1.5; font-size: 13px; }

/* ---------- 底部导航 ---------- */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; background: var(--panel); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; border: 0; color: var(--text2);
  padding: 8px 0 7px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn.active { color: var(--accent); }
.nav-ico { font-size: 20px; }

/* ---------- 详情弹层 ---------- */
.detail-mask {
  position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.detail-panel {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 16px 16px 0 0;
  padding: 16px 14px 26px;
}
.detail-head { display: flex; align-items: flex-start; }
.detail-name { font-size: 19px; font-weight: 700; }
.detail-code { color: var(--text2); font-size: 12px; margin-top: 3px; }
.detail-price-box { margin-left: auto; text-align: right; margin-right: 10px; }
.detail-price { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-pct { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-close {
  background: none; border: 0; color: var(--text2); font-size: 18px; padding: 4px 6px;
}
.detail-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 10px;
}
.dm-item { background: var(--panel); border-radius: 8px; padding: 8px 6px; text-align: center; }
.dm-label { color: var(--text2); font-size: 10px; }
.dm-val { font-size: 13px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.chart-box { width: 100%; height: 320px; }
.watch-btn {
  width: 100%; margin-top: 14px; padding: 12px; border-radius: 10px; border: 0;
  background: var(--panel2); color: var(--accent); font-size: 15px; font-weight: 700;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff; padding: 10px 20px;
  border-radius: 20px; font-size: 13px; z-index: 300;
}
