:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-2: #f2f5fb;
  --field: #eef2f8;
  --line: #e4e9f2;
  --line-2: #d2dae6;
  --text: #172033;
  --muted: #667085;
  --up: #d92d3a;
  --down: #0f9f6e;
  --accent: #2f6fed;
  --amber: #b7791f;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 24px 60px -24px rgba(16, 24, 40, 0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 15% -10%, rgba(47, 111, 237, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(217, 45, 58, 0.05), transparent 55%), var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 600; }

/* ================= 顶栏 ================= */
.topbar {
  position: static;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: 0.4px; white-space: nowrap; }
.logo { color: var(--accent); font-size: 18px; }
.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.28);
}
.search { display: flex; flex: 1; max-width: 520px; gap: 8px; }
.search input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--mono);
  outline: none;
  transition: 0.16s;
}
.search input:focus { border-color: rgba(79, 140, 255, 0.55); background: var(--panel-2); }
.search button {
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.search button:hover { filter: brightness(1.08); }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 0; }
#statusText { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--down); box-shadow: 0 0 0 4px rgba(20, 201, 140, 0.13); animation: blink 2s infinite; }
.dot.err { background: var(--up); }
.clock { font-family: var(--mono); color: var(--muted); }

/* ================= 标签 ================= */
.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 12px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.quick { margin-left: auto; display: flex; gap: 6px; padding-bottom: 8px; }
.quick button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.quick button:hover { color: var(--text); border-color: var(--line-2); }

/* ================= 主区 ================= */
main { padding: 16px 20px 40px; flex: 1 0 auto; }
.pane { display: none; }
.pane.active { display: block; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.main-col { min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; }
.muted { color: var(--muted); font-size: 11.5px; }

/* 报价头 */
.quote-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 4px 2px 14px;
}
.qh-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qh-name h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; }
.code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pill {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 99px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.qh-price { display: flex; align-items: baseline; gap: 12px; font-family: var(--mono); }
.qh-price .price { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.qh-price .chg { font-size: 14px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.qh-time { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* 图表 */
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 8px;
}
.chart-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 10px; }
.seg { display: inline-flex; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: #ffffff; color: var(--text); font-weight: 600; }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); font-family: var(--mono); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 4px; }

.chart-wrap { position: relative; height: clamp(320px, 46vh, 540px); }
.chart-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.tip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-family: var(--mono);
  line-height: 1.7;
  color: var(--text);
  box-shadow: 0 16px 40px -20px rgba(16, 24, 40, 0.3);
  white-space: nowrap;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* 指标 */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.metric {
  flex: 1 1 112px;
  max-width: 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.metric span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.metric b { font-family: var(--mono); font-size: 13.5px; font-weight: 600; white-space: nowrap; }

/* 自选 */
.watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.watch li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.14s;
}
.watch li:hover { background: #f3f6fb; }
.watch li.active { background: rgba(79, 140, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.25); }
.watch .w-name { flex: 1; min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch .w-code { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.watch .w-px { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.watch .w-pct { width: 54px; text-align: right; font-family: var(--mono); font-size: 11.5px; }
.watch .w-del { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.watch li:hover .w-del { opacity: 1; }
.mini {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.mini:hover { color: var(--text); border-color: var(--line-2); }

/* 盘口 */
.book { font-family: var(--mono); font-size: 11.5px; }
.book-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; position: relative; }
.book-row .lbl { width: 26px; color: var(--muted); font-size: 10.5px; }
.book-row .px { width: 66px; text-align: right; }
.book-row .vol { flex: 1; text-align: right; color: var(--muted); }
.book-row .bar {
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  opacity: 0.12;
}
.book-row.ask .bar { background: var(--up); }
.book-row.bid .bar { background: var(--down); }
.book-mid {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  margin: 4px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
}

.note p { font-size: 11px; line-height: 1.7; color: var(--muted); }
.note p + p { margin-top: 4px; }

/* ================= 彩票 ================= */
.lottery-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.lottery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lottery-grid .wide { grid-column: 1 / -1; }
.latest { display: flex; flex-direction: column; gap: 12px; grid-column: 1 / -1; }
.latest .issue { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.latest .issue b { font-size: 18px; font-family: var(--mono); }
.balls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ball {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  background: #25141a;
  color: #ff8494;
  border: 1px solid rgba(255, 77, 94, 0.35);
}
.ball.blue { background: #e8f0ff; color: #2f6fed; border-color: rgba(79, 140, 255, 0.4); }
.ball.small { width: 26px; height: 26px; font-size: 11px; }

.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.heat .cell {
  border-radius: 7px;
  padding: 6px 3px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--field);
  font-family: var(--mono);
}
.heat .cell .n { font-size: 13px; font-weight: 600; }
.heat .cell .f { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.heat .cell .o { font-size: 9px; color: #5c6677; }
.heat .cell.hot { border-color: rgba(255, 77, 94, 0.45); }
.heat.blue .cell.hot { border-color: rgba(79, 140, 255, 0.5); }

.sum-wrap { height: 200px; }
.sum-wrap canvas { width: 100%; height: 100%; display: block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 11px; }
td { font-family: var(--mono); }
tbody tr:hover { background: #f7f9fc; }
td .balls { gap: 4px; }

.disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 181, 71, 0.25);
  background: rgba(255, 181, 71, 0.06);
  color: #c9b28d;
  font-size: 11.5px;
  line-height: 1.75;
}
.disclaimer strong { color: #ffcf85; }

:root[data-up="green"] {
  --up: #14c98c;
  --down: #ff4d5e;
}

/* ================= 副图 / 提醒 / 对比 / 财报 ================= */
.mono { font-family: var(--mono); }
.tiny { font-size: 10.5px; line-height: 1.55; margin-top: 8px; }
.warn { color: var(--amber); }
.color-toggle { flex: 0 0 auto; }

.sub-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px 6px;
  border-top: 1px dashed var(--line);
  margin-top: 6px;
}
.seg-sm button { font-size: 11px; padding: 4px 9px; }
.sub-wrap { height: 112px; position: relative; }
.sub-wrap canvas { width: 100%; height: 100%; display: block; }

.alert-form { display: flex; gap: 6px; }
.alert-form input {
  width: 0;
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--text);
  font-size: 11.5px;
  font-family: var(--mono);
  outline: none;
}
.alert-form input:focus { border-color: rgba(79, 140, 255, 0.5); }
.alert-form input::-webkit-outer-spin-button,
.alert-form input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.alert-form button { flex: 0 0 auto; }
.alerts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.alerts li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f9fc;
  border: 1px solid var(--line);
}
.alerts li.empty { background: none; border: 0; color: var(--muted); padding: 2px 0; }
.alerts .a-main { flex: 1; min-width: 0; }
.alerts .a-code { font-family: var(--mono); color: var(--muted); font-size: 10px; display: block; margin-top: 2px; }
.alerts .a-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.alerts .a-del:hover { color: var(--up); }

.compare-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.compare-form { display: flex; gap: 6px; flex: 1; min-width: 260px; max-width: 460px; }
.compare-form input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
  outline: none;
}
.compare-form input:focus { border-color: rgba(79, 140, 255, 0.5); }
.compare-form button {
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.compare-card { padding: 14px; }
.compare-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.compare-legend .cl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.compare-legend .cl i { width: 10px; height: 2px; display: inline-block; }
.compare-legend .cl b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.compare-legend .cl .rm { border: 0; background: none; color: #5c6677; cursor: pointer; font-size: 13px; padding: 0 2px; }
.compare-legend .cl .rm:hover { color: var(--up); }
.compare-wrap { height: clamp(340px, 48vh, 560px); position: relative; }
.compare-wrap canvas { width: 100%; height: 100%; display: block; }

.earn-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.earn-top input[type="date"] {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  color-scheme: light;
}
.earn-card { padding: 4px 8px; }
.earn-card td .co { color: var(--text); }
.earn-card td .sym { color: var(--accent); font-weight: 600; }
.earn-card td.time-pre { color: var(--amber); }
.earn-card td.time-after { color: var(--accent); }
.earn-empty { padding: 44px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 99;
  transform: translate(-50%, 12px);
  max-width: 86vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.95);
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.paper-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.paper-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
  font-size: 11.5px;
  color: var(--muted);
}
.paper-plan b { color: var(--text); }
.paper-plan .warn { color: var(--amber); }
.paper-plan .ok { color: #7ee2b8; }
.paper-plan .progress { width: 160px; margin: 0; }
.paper-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.paper-stat span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.paper-stat b { font-family: var(--mono); font-size: 15px; font-weight: 600; }
#paperHoldings th, #paperHoldings td,
#paperSignals th, #paperSignals td,
#paperTrades th, #paperTrades td { padding: 7px 8px; font-size: 11px; }
td.buy { color: var(--up); }
td.sell { color: var(--down); }
.factor-bias {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.7;
  background: rgba(255, 181, 71, 0.07);
  border: 1px solid rgba(255, 181, 71, 0.25);
  color: #d9bd8a;
}
.factor-controls { padding: 14px; margin-bottom: 14px; }
.fc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 12px; }
.fc-item { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.fc-item input[type="range"] { width: 100%; accent-color: var(--accent); }
.fc-item b { font-family: var(--mono); color: var(--text); font-size: 12px; }
.fc-bottom { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.fc-check { display: flex; align-items: center; gap: 6px; }
.fc-num input {
  width: 52px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 6px;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  margin-left: 4px;
}
.mini {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  padding: 7px 12px;
  cursor: pointer;
}
.mini.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.oos-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 10px; }
.oos-item { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.oos-item span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.oos-item b { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.oos-verdict { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin: 6px 0 12px; }
.oos-verdict.neg { color: #ffb3b8; }
.oos-verdict.ok { color: #7ee2b8; }
#labTable th, #labTable td { padding: 7px 8px; font-size: 11px; }
#walkTable th, #walkTable td { padding: 7px 8px; font-size: 11px; }
.factor-status p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.progress { height: 6px; background: var(--field); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.3s; }
.factor-alert {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.75;
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.3);
  color: #e6c896;
}
.factor-alert.neg { background: rgba(255, 77, 94, 0.08); border-color: rgba(255, 77, 94, 0.3); color: #ffb3b8; }
.factor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.ic-list, .q-list { display: flex; flex-direction: column; gap: 8px; }
.ic-row { display: grid; grid-template-columns: 72px 1fr 58px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.ic-row .bar { height: 6px; background: var(--field); border-radius: 99px; overflow: hidden; }
.ic-row .bar i { display: block; height: 100%; background: var(--up); }
.ic-row .bar i.neg { background: var(--down); }
.ic-row b { font-family: var(--mono); text-align: right; color: var(--text); font-weight: 500; }
.q-row { display: grid; grid-template-columns: 26px 1fr 56px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.q-row .bar { height: 8px; background: var(--field); border-radius: 99px; overflow: hidden; }
.q-row .bar i { display: block; height: 100%; background: var(--accent); }
.q-row b { text-align: right; font-family: var(--mono); color: var(--text); font-weight: 500; }
#factorTable th, #factorTable td { padding: 7px 8px; font-size: 11px; }

@media (max-width: 900px) {
  .factor-grid { grid-template-columns: 1fr; }
  .fc-grid { grid-template-columns: repeat(2, 1fr); }
  .oos-grid { grid-template-columns: repeat(3, 1fr); }
  .paper-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .oos-grid { grid-template-columns: repeat(2, 1fr); }
  .paper-stats { grid-template-columns: repeat(2, 1fr); }
}

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 18px 20px 28px;
  border-top: 1px solid var(--line);
  color: #5f6a7c;
  font-size: 11px;
  line-height: 1.6;
}

/* ================= 信号雷达 / AI / 入门 ================= */
.signal-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.signal-intro h2 { font-size: 22px; letter-spacing: 0.2px; }
.signal-intro p { font-size: 12px; margin-top: 5px; max-width: 720px; line-height: 1.65; }
.ai-btn {
  border: 1px solid rgba(160, 107, 255, 0.45);
  background: rgba(160, 107, 255, 0.13);
  color: #dcc7ff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ai-btn:hover { background: rgba(160, 107, 255, 0.22); }
.intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.signal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.signal-table-card { padding: 14px; }
#signalTable th, #signalTable td { padding: 8px; font-size: 11.5px; }
#signalTable td.name { color: var(--text); font-family: var(--sans); font-size: 12px; }
#signalTable tr.pick { background: rgba(79, 140, 255, 0.07); }
#signalTable tr.pick td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

.picks { display: flex; flex-direction: column; gap: 8px; }
.pick {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f7f9fc;
}
.pick .pname { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.pick .pname small { font-family: var(--mono); color: var(--muted); font-size: 10px; font-weight: 400; }
.pick .pmeta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.pick .pwhy { font-size: 11px; color: #9aa4b6; margin-top: 6px; line-height: 1.55; }
.pick-note { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.65; }

.bt-card { margin-top: 14px; }
.bt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bt-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.bt-stat span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.bt-stat b { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.bt-wrap { height: 300px; }
.bt-wrap canvas { width: 100%; height: 100%; display: block; }

.ai-card { margin-top: 14px; }
.ai-log {
  max-height: 330px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 10px;
}
.ai-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.bot { align-self: flex-start; background: #f7f9fc; border: 1px solid var(--line); }
.ai-msg.me { align-self: flex-end; background: rgba(79, 140, 255, 0.15); border: 1px solid rgba(79, 140, 255, 0.3); }
.ai-msg.err { align-self: flex-start; background: rgba(255, 77, 94, 0.1); border-color: rgba(255, 77, 94, 0.3); color: #ffb3b8; }
.ai-msg .who { display: block; font-size: 9px; color: var(--muted); margin-bottom: 4px; }
.ai-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-quick button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.ai-quick button:hover { color: var(--text); border-color: var(--line-2); }
.ai-form { display: flex; gap: 6px; }
.ai-form input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.ai-form input:focus { border-color: rgba(79, 140, 255, 0.5); }
.ai-form button {
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
}
.ai-form button:disabled { filter: grayscale(0.5); cursor: wait; }

.basics-head { margin-bottom: 14px; }
.basics-head h2 { font-size: 22px; }
.basics-head p { font-size: 12.5px; margin-top: 5px; }
.basics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; align-items: start; }
.basic { padding: 0; overflow: hidden; }
.basic summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.basic summary::-webkit-details-marker { display: none; }
.basic summary::before { content: '+'; color: var(--muted); width: 14px; }
.basic[open] summary::before { content: '−'; }
.basic-body { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.basic-body p { font-size: 12.5px; line-height: 1.8; color: #475467; margin-bottom: 8px; }
.basic-body p:last-child { margin-bottom: 0; }
.basic-body b { color: var(--text); }
.glossary p { font-size: 12px; }

@media (max-width: 1000px) {
  .signal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .basics-grid { grid-template-columns: 1fr; }
  .ai-log { max-height: 280px; }
  .signal-intro h2 { font-size: 20px; }
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { flex-direction: row; flex-wrap: wrap; }
  .side-col .card { flex: 1 1 280px; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .status { margin-left: auto; }
  .tabs { padding: 8px 14px 0; }
  .quick { display: none; }
  main { padding: 12px 14px 30px; }
  .qh-price .price { font-size: 26px; }
  .qh-time { display: none; }
  .lottery-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: clamp(280px, 42vh, 420px); }
  .legend { display: none; }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ================= 浅色主题修正 ================= */
.card { background: var(--panel); }
.seg { background: var(--field); }
.seg button.active { background: #ffffff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.search input, .composer input, .ai-form input, .alert-form input, .compare-form input, .fc-num input, .earn-top input[type="date"] {
  background: #ffffff;
  color: var(--text);
}
.search input::placeholder, .composer input::placeholder, .ai-form input::placeholder { color: #98a2b3; }
.basic-body p { color: #475467; }
.basic-body b { color: var(--text); }
.factor-bias { color: #8a5a00; }
.factor-alert { color: #8a5a00; background: #fff8e8; border-color: #f0d39c; }
.factor-alert.neg { color: #b42318; background: #fff1f0; border-color: #f5c2be; }
.disclaimer { background: #fff8e8; border-color: #f0d39c; color: #8a5a00; }
.toast { box-shadow: 0 20px 50px -20px rgba(16, 24, 40, 0.25); }
.site-foot { color: #98a2b3; }
.chart-empty, .earn-empty, .pick .pwhy { color: var(--muted); }
.alert-row .muted, .tip .muted { color: var(--muted); }
.modal-card, .sheet-inner { background: #ffffff; }
.modal, .sheet { background: rgba(16, 24, 40, 0.35); }

/* 浅色主题：按钮与状态对比度 */
.ai-btn { border-color: #c4b5fd; background: #f5f3ff; color: #6d28d9; }
.ai-btn:hover { background: #ede9fe; }
.paper-plan .ok { color: #0f9f6e; }
.paper-plan .warn { color: #b7791f; }

/* 防止 flex 压缩页眉和页签 */
.topbar, .tabs, .site-foot { flex-shrink: 0; }
.tabs { min-height: 52px; }

/* ================= 基本面 / 风险 / 决策日志 ================= */
.fund-filters { padding: 14px; }
.fund-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; align-items: end; }
.fund-grid label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.fund-grid label > span { display: flex; align-items: center; gap: 4px; }
.fund-grid input[type="number"] {
  width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 8px; color: var(--text);
  font-family: var(--mono); font-size: 11.5px; outline: none;
}
.fund-grid .fc-check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 7px; }
#fundTable th, #fundTable td { padding: 7px 8px; font-size: 11px; }
#fundTable td .code { color: var(--muted); font-size: 10px; }

.risk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.risk-list li {
  font-size: 11.5px; line-height: 1.6; color: var(--muted);
  padding: 8px 10px; border-radius: 8px; background: #f7f9fc;
  border-left: 3px solid var(--line-2);
}
.risk-list li.bad { border-left-color: var(--up); color: #8a1c24; background: #fff5f5; }
.risk-list li.warn { border-left-color: var(--amber); color: #7a4b00; background: #fffaf0; }
.risk-list li.ok { border-left-color: var(--down); color: #0b6b4c; background: #f2fbf7; }
.risk-bars { display: flex; flex-direction: column; gap: 7px; }
.risk-bar { display: grid; grid-template-columns: 90px 1fr 48px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.risk-bar .track { height: 8px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.risk-bar .track i { display: block; height: 100%; background: var(--accent); }
.risk-bar b { text-align: right; font-family: var(--mono); color: var(--text); font-weight: 500; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 10px; align-items: end; }
.calc-grid label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.calc-grid input {
  width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 7px; padding: 8px; color: var(--text);
  font-family: var(--mono); font-size: 12px; outline: none;
}
.calc-result { margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.calc-result b { color: var(--text); font-family: var(--mono); }

.journal-form { padding: 14px; margin-bottom: 14px; }
.jf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin-bottom: 10px; }
.jf-grid label, .jf-full { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.jf-full { margin-bottom: 10px; }
.jf-grid input, .jf-grid select, .jf-full textarea {
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  padding: 8px; color: var(--text); font: inherit; font-size: 12px; outline: none;
}
.jf-full textarea { resize: vertical; line-height: 1.6; }
.jf-actions { display: flex; gap: 8px; }
#journalTable th, #journalTable td { padding: 8px; font-size: 11px; }
.journal-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .fund-grid { grid-template-columns: repeat(2, 1fr); }
  .cf-grid, .jf-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 资金流 / 公告 / 全站 AI ================= */
.flow-row { display: grid; grid-template-columns: 52px 1fr 64px; gap: 8px; align-items: center; font-size: 10.5px; color: var(--muted); margin-bottom: 7px; }
.flow-row .track { height: 7px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.flow-row .track i { display: block; height: 100%; }
.flow-row b { text-align: right; font-family: var(--mono); font-size: 10.5px; font-weight: 500; }
.ann-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; max-height: 240px; overflow-y: auto; }
.ann-list li { font-size: 11px; line-height: 1.55; }
.ann-list a { color: var(--text); text-decoration: none; }
.ann-list a:hover { color: var(--accent); }
.ann-list .date { color: var(--muted); font-size: 10px; margin-top: 2px; }
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  border: 0; border-radius: 999px; background: var(--grad);
  color: #fff; padding: 12px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 14px 30px -10px rgba(47, 111, 237, 0.55); cursor: pointer;
}
.ai-fab:hover { filter: brightness(1.05); }
.ai-drawer {
  position: fixed; right: 22px; bottom: 80px; width: 380px;
  max-width: calc(100vw - 24px); max-height: 72vh; z-index: 60;
  display: flex; flex-direction: column; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(16, 24, 40, 0.35);
}
.ai-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-drawer-head b { font-size: 14px; }
.ai-drawer-head .muted { font-size: 10px; margin-left: 6px; }
.ai-drawer .ai-log { flex: 1; max-height: 300px; }
@media (max-width: 600px) {
  .ai-fab { right: 12px; bottom: 12px; }
  .ai-drawer { right: 0; left: 0; bottom: 0; width: auto; max-height: 84vh; border-radius: 16px 16px 0 0; }
}

/* 吸顶页签里的品牌与 AI 入口 */
.tab-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-right: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.tab-brand i {
  font-style: normal;
  color: #ff5f8f;
  font-size: 14px;
}
.tab-ai {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab-ai:hover { background: #ede9fe; }
@media (max-width: 700px) {
  .tab-brand { margin-right: 4px; padding-right: 8px; font-size: 11.5px; }
  .tab-ai { padding: 5px 8px; font-size: 10.5px; }
}

/* 品牌只在滚动后出现在吸顶栏，避免与顶栏重复 */
.tab-brand { display: none; }
body.scrolled .tab-brand { display: inline-flex; }
.ai-fab { display: none; }

/* ================= 学习系统 ================= */
.learn-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.learn-head h2 { font-size: 22px; }
.learn-head p { font-size: 12px; margin-top: 4px; }
.learn-progress { min-width: 180px; font-size: 11px; color: var(--muted); }
.learn-progress b { color: var(--text); font-family: var(--mono); font-size: 14px; }
.learn-progress .progress { margin-top: 6px; }
.learn-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.learn-map { padding: 12px; position: sticky; top: 64px; max-height: calc(100vh - 90px); overflow-y: auto; }
.learn-module { margin-bottom: 14px; }
.learn-module h4 { font-size: 11px; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.04em; }
.learn-lesson {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 11.5px;
  line-height: 1.45;
  cursor: pointer;
  margin-bottom: 2px;
}
.learn-lesson:hover { background: #f4f7fb; }
.learn-lesson.active { background: #eef4ff; border-color: #cfe0ff; }
.learn-lesson .tick { color: #0f9f6e; font-family: var(--mono); flex: 0 0 auto; }
.learn-lesson .idx { color: var(--muted); font-family: var(--mono); flex: 0 0 auto; }
.learn-main { padding: 20px 22px; min-height: 500px; }
.lesson-kicker { font-size: 10.5px; color: var(--accent); font-family: var(--mono); letter-spacing: 0.05em; }
.lesson-title { font-size: 22px; margin: 6px 0 8px; letter-spacing: 0.2px; }
.lesson-lead { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.lesson-box { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.lesson-box h4 { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.lesson-box ul { margin: 0; padding-left: 18px; }
.lesson-box li { font-size: 12px; line-height: 1.8; color: #475467; }
.lesson-section { margin: 16px 0; }
.lesson-section h3 { font-size: 14px; margin: 0 0 6px; }
.lesson-section p { font-size: 13px; line-height: 1.85; color: #344054; margin: 0 0 8px; }
.lesson-example { border-left: 3px solid var(--accent); background: #f0f6ff; padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.75; color: #344054; }
.quiz-q { font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  margin-bottom: 6px;
}
.quiz-option:hover { background: #f7f9fc; }
.quiz-option.selected { border-color: var(--accent); background: #eef4ff; }
.quiz-option.correct { border-color: #0f9f6e; background: #effaf5; }
.quiz-option.wrong { border-color: var(--up); background: #fff1f0; }
.quiz-explain { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 4px 0 10px; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.lesson-notes { width: 100%; min-height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: 12.5px; line-height: 1.7; resize: vertical; }
.lesson-complete { font-size: 11px; color: #0f9f6e; margin-left: 6px; }
@media (max-width: 900px) {
  .learn-layout { grid-template-columns: 1fr; }
  .learn-map { position: static; max-height: none; }
  .learn-main { padding: 16px; }
}

.learn-plan {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}
.learn-plan b { color: var(--text); white-space: nowrap; }
