:root {
  --bg: #0f141b;
  --bg-soft: #141b25;
  --card: #1a2330;
  --card-2: #202b3a;
  --border: #2a3747;
  --text: #e7ebf0;
  --text-dim: #93a0b0;
  --gold: #e3b341;
  --gold-soft: #f0cd7a;
  --up: #ef5350;
  --down: #26a69a;
  --bull: #ef5350;
  --bear: #26a69a;
  --neutral: #8b95a5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1b2735 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 27, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #1a1405;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border-radius: 12px;
}
.topbar h1 { font-size: 19px; letter-spacing: 1px; }
.sub { color: var(--text-dim); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.update-time { color: var(--text-dim); font-size: 12px; }

.btn {
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  padding: 9px 18px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #1a1405; font-weight: 700; border: none;
}
.btn-ghost { background: transparent; }

.container { max-width: 1280px; margin: 0 auto; padding: 26px 28px 60px; }
.section-title { font-size: 16px; margin: 26px 0 14px; letter-spacing: .5px; }

/* ---------- 卡片通用 ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.card-label { color: var(--text-dim); font-size: 13px; }

/* ---------- 核心信号 ---------- */
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px;
}
.signal-card { display: flex; flex-direction: column; gap: 14px; }
.gauge { text-align: center; padding: 6px 0; }
.gauge-num {
  font-size: 52px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gauge-signal {
  display: inline-block; margin-top: 4px; padding: 4px 18px;
  border-radius: 999px; font-weight: 700; font-size: 14px;
}
.conf-row { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.conf-bar { flex: 1; height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
#confBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .5s; }

.price-card { display: flex; flex-direction: column; gap: 10px; }
.price-head { display: flex; align-items: baseline; justify-content: space-between; }
.unit { color: var(--text-dim); font-size: 12px; }
.price-now { font-size: 34px; font-weight: 700; }
.price-chg { font-size: 14px; font-weight: 600; }

/* ---------- 因子 ---------- */
.factor-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.factor-card { padding: 16px; }
.factor-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.factor-name { font-weight: 700; font-size: 13.5px; }
.factor-weight { color: var(--gold); font-size: 12px; border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.factor-score { font-size: 30px; font-weight: 800; margin: 10px 0 8px; }
.factor-bar { height: 7px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.factor-bar > div { height: 100%; border-radius: 999px; transition: width .5s; }
.factor-desc { color: var(--text-dim); font-size: 11.5px; margin-top: 10px; line-height: 1.5; }

/* ---------- 目标价 ---------- */
.target-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.target-card h3 { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.target-block { margin-bottom: 12px; }
.target-block:last-child { margin-bottom: 0; }
.target-line { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.target-line .tgt { font-weight: 700; color: var(--gold-soft); }
.range-bar { position: relative; height: 6px; background: var(--card-2); border-radius: 999px; }
.range-fill { position: absolute; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 999px; opacity: .85; }
.range-base { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text); }

/* ---------- 图表 ---------- */
.chart-card { padding: 20px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; }
.chart-head .section-title { margin: 0; }
.chart-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: 8px; }
.tab {
  border: 1px solid var(--border); background: var(--card-2); color: var(--text-dim);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
}
.tab.active { color: #1a1405; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); border-color: transparent; font-weight: 700; }
.chart { width: 100%; height: 380px; margin-top: 16px; }

/* ---------- 准确率 ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.acc-card { text-align: center; }
.acc-horizon { color: var(--text-dim); font-size: 13px; }
.acc-rate { font-size: 38px; font-weight: 800; margin: 8px 0; color: var(--gold-soft); }
.acc-meta { color: var(--text-dim); font-size: 12px; line-height: 1.8; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin-top: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-dim); font-weight: 600; position: sticky; top: 0; }
.data-table tbody tr:hover { background: rgba(227, 179, 65, 0.06); }
.tag { padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.tag.bull, .tag.bullish { background: rgba(239,83,80,.16); color: var(--bull); }
.tag.bear, .tag.bearish { background: rgba(38,166,154,.16); color: var(--bear); }
.tag.neutral { background: rgba(139,149,165,.16); color: var(--neutral); }
.hit-yes { color: var(--up); font-weight: 700; }
.hit-no { color: var(--down); font-weight: 700; }
.hit-pending { color: var(--text-dim); }

/* ---------- 权重 ---------- */
.hint { color: var(--text-dim); font-size: 12.5px; margin-bottom: 16px; }
.weight-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 26px; }
.weight-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.weight-row label { flex: 1; font-size: 13.5px; }
.weight-row input {
  width: 130px; background: var(--card-2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: 8px; font-size: 13px;
}
.weight-row input:focus { outline: none; border-color: var(--gold); }
.weight-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.weight-total { color: var(--text-dim); font-size: 13px; margin-right: auto; }
.weight-total.ok { color: var(--gold-soft); }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--text-dim); font-size: 12px; padding: 24px; border-top: 1px solid var(--border); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .signal-card { grid-column: 1 / -1; }
  .factor-grid { grid-template-columns: repeat(3, 1fr); }
  .target-grid, .acc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .container { padding: 18px; }
  .hero-grid, .factor-grid, .weight-form { grid-template-columns: 1fr; }
  .topbar { padding: 14px 18px; }
  .top-actions .update-time { display: none; }
  .price-now { font-size: 28px; }
}
