:root {
  --bg: #0b0e14;
  --bg2: #10141d;
  --panel: #141a26;
  --panel2: #1a2233;
  --line: #232c3f;
  --text: #e8ecf4;
  --muted: #8b96ab;
  --up: #f0524f;      /* 中式:涨红 */
  --down: #2ebd85;    /* 跌绿 */
  --accent: #e8b34b;  /* 筹码金 */
  --accent2: #5b8cff;
  --danger: #ff5d5d;
  --radius: 12px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(91,140,255,.08), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(232,179,75,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: 48px;
}
main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
b { font-weight: 650; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  background: rgba(11,14,20,.85); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-logo { font-size: 22px; }
.brand-name { font-weight: 800; letter-spacing: .06em; font-size: 18px; }
.brand-name i { color: var(--accent); font-style: normal; }
.brand-sub { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; background: #666; display: inline-block; }
.fresh-dot.ok { background: var(--down); box-shadow: 0 0 8px rgba(46,189,133,.8); }
.fresh-dot.stale { background: var(--accent); }
.fresh-text { color: var(--muted); font-size: 12px; }

/* ---------- 市场条 ---------- */
.market-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  border-bottom: 1px solid var(--line); scrollbar-width: none; background: var(--bg2);
}
.market-bar::-webkit-scrollbar { display: none; }
.mchip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; white-space: nowrap;
}
.mchip .mname { color: var(--muted); }
.mchip .mprice { font-weight: 650; font-variant-numeric: tabular-nums; }
.mchip .mst { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.mchip .mst.open { color: var(--down); background: rgba(46,189,133,.12); }
.mchip .mst.pre { color: var(--accent); background: rgba(232,179,75,.12); }
.skeleton { color: var(--muted); }

/* ---------- 今日结论 ---------- */
.verdict {
  max-width: 1180px; margin: 16px auto 0; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(232,179,75,.07), rgba(91,140,255,.05)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
main ~ .verdict, .verdict { margin-left: auto; margin-right: auto; width: calc(100% - 32px); }
.verdict-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.verdict-gate { font-weight: 650; font-size: 16px; }
.verdict-reason { color: var(--muted); font-size: 13px; margin-top: 6px; }
.badge {
  padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: var(--panel2); border: 1px solid var(--line);
}
.badge.risk-on { color: var(--down); border-color: rgba(46,189,133,.4); background: rgba(46,189,133,.1); }
.badge.risk-off { color: var(--danger); border-color: rgba(255,93,93,.4); background: rgba(255,93,93,.1); }
.badge.divergence, .badge.repair { color: var(--accent); border-color: rgba(232,179,75,.4); background: rgba(232,179,75,.1); }
.picks-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pick-chip {
  cursor: pointer; padding: 5px 12px; border-radius: 8px; font-size: 13px;
  background: rgba(46,189,133,.1); border: 1px solid rgba(46,189,133,.35); color: var(--text);
}
.pick-chip:hover { background: rgba(46,189,133,.2); }
.pick-chip .sc { color: var(--down); font-weight: 700; }
.picks-empty { color: var(--muted); font-size: 13px; }
.ai-brief {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.65;
  background: rgba(91,140,255,.07); border: 1px dashed rgba(91,140,255,.35);
}
.ai-brief .ai-tag { color: var(--accent2); font-weight: 700; margin-right: 6px; }

/* ---------- 启动进度 ---------- */
.bootstrap { max-width: 1180px; margin: 12px auto 0; width: calc(100% - 32px); }
.bootstrap-text { font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.bootstrap-track { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.bootstrap-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .6s; }

/* ---------- Tabs ---------- */
.tabs {
  max-width: 1180px; margin: 18px auto 14px; width: calc(100% - 32px);
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: none; color: var(--muted); font-size: 15px; font-weight: 600;
  padding: 10px 18px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

/* ---------- 决策雷达 ---------- */
.board { margin-bottom: 22px; }
.board-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.board-title { font-size: 16px; font-weight: 750; }
.board-desc { color: var(--muted); font-size: 12.5px; }
.board-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 10px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.card:hover { border-color: var(--accent2); transform: translateY(-1px); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.card-mid { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.card-reason { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scorebar { height: 5px; border-radius: 3px; background: var(--panel2); margin-top: 9px; overflow: hidden; }
.scorebar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent2), var(--down)); }
.board-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }

.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.mkt-us { color: #7fb2ff; } .chip.mkt-jp { color: #ff9ecb; }
.chip.mkt-hk { color: #b48bff; } .chip.mkt-cn { color: #ffb36b; }
.chip.risk-low { color: var(--down); } .chip.risk-high { color: var(--danger); } .chip.risk-medium { color: var(--accent); }
.chip.trend-bull { color: var(--up); } .chip.trend-bear { color: var(--down); }
.chip.delayed { color: var(--muted); border-style: dashed; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }

/* ---------- 表格 ---------- */
.filters { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fgroup { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.fbtn { background: none; border: none; color: var(--muted); font-size: 13px; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.fbtn.active { background: var(--panel2); color: var(--text); font-weight: 650; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.table th {
  text-align: right; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap;
}
.table th:first-child, .table td:first-child { text-align: left; }
.table td { text-align: right; padding: 9px 12px; border-bottom: 1px solid rgba(35,44,63,.5); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--panel2); }
.table .tname b { font-size: 13.5px; }
.table .tname .muted { font-size: 11.5px; }

/* ---------- 持仓 ---------- */
.pos-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.pos-stat .lbl { color: var(--muted); font-size: 12px; }
.pos-stat .val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.form-title { display: block; margin-bottom: 10px; font-size: 14.5px; }
.form-grid { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-row { display: flex; gap: 8px; }
input, select {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; min-width: 130px;
}
input:focus, select:focus { outline: none; border-color: var(--accent2); }
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--accent2); }
.btn-primary { background: linear-gradient(135deg, #2f5ed6, #4a7dff); border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: none; }
.btn-mini { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.removed-list { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.removed-chip { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.removed-chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- 抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(820px, 100%);
  background: var(--bg2); border-left: 1px solid var(--line); z-index: 50;
  overflow-y: auto; padding: 18px 20px 40px;
  animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-head b { font-size: 19px; }
.drawer-price { display: flex; align-items: center; gap: 10px; }
.drawer-price b { font-size: 22px; font-variant-numeric: tabular-nums; }
.chip-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kline-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 8px; }
#kline { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.ind-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ind-cell .lbl { color: var(--muted); font-size: 11px; }
.ind-cell .val { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dbl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.dcol { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.dcol ul { margin: 8px 0 0 18px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.pos-t { color: var(--down); } .neg-t { color: var(--accent); }
.d-lines { margin-top: 14px; font-size: 13.5px; line-height: 1.8; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.d-lines .tl { color: var(--accent2); } .d-lines .il { color: var(--danger); }
.d-grid-box { margin-top: 14px; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th, .grid-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid rgba(35,44,63,.5); font-variant-numeric: tabular-nums; }
.grid-table th { color: var(--muted); font-weight: 600; }
.grid-note { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1180px; margin: 30px auto 0; width: calc(100% - 32px);
  color: var(--muted); font-size: 12px; line-height: 1.7;
  border-top: 1px solid var(--line); padding-top: 14px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  :root { font-size: 14px; }
  .brand-sub { display: none; }
  .dbl { grid-template-columns: 1fr; }
  .drawer { padding: 14px 12px 40px; }
  .tabs { gap: 0; }
  .tab { padding: 10px 12px; font-size: 14px; }
}

/* 榜单主题色 */
.board.actionable .board-title { color: var(--down); }
.board.pullback .board-title { color: var(--accent2); }
.board.core .board-title { color: var(--accent); }
.board.highrisk .board-title { color: var(--danger); }
.board.watch .board-title, .board.avoid .board-title { color: var(--muted); }
