/* ============ A股复盘助手 主题 ============ */
:root {
  --bg: #0b0f17;
  --panel: #131a26;
  --panel2: #0f1622;
  --border: #1e2a3c;
  --text: #e6edf3;
  --muted: #8b98a9;
  --up: #f0483e;      /* A股红涨 */
  --down: #00b578;    /* 绿跌 */
  --gold: #f0b90b;
  --blue: #3b82f6;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 10% -10%, rgba(240,185,11,.08), transparent 60%),
    radial-gradient(700px 400px at 90% 10%, rgba(59,130,246,.07), transparent 60%);
}

/* ---- 顶栏 ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: rgba(15,22,34,.6); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #e07b00);
  color: #1a1205; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(240,185,11,.25);
}
.brand h1 { font-size: 20px; letter-spacing: 1px; }
.brand p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ths { background: rgba(0,181,120,.15); color: #37e0a5; border: 1px solid rgba(0,181,120,.35); }
.badge-demo { background: rgba(240,185,11,.12); color: var(--gold); border: 1px solid rgba(240,185,11,.35); }
.badge-loading { background: rgba(139,152,169,.12); color: var(--muted); border: 1px solid var(--border); }

/* ---- 布局 ---- */
.container { max-width: 1380px; margin: 0 auto; padding: 24px 28px 60px; }
.section { margin-bottom: 44px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; }
.idx {
  background: linear-gradient(135deg, var(--gold), #e07b00); color: #1a1205;
  font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 8px;
}
.tips { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.panel-title { font-weight: 600; margin-bottom: 14px; color: #cdd8e4; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.chart { width: 100%; height: 300px; }
.chart-lg { height: 520px; }

/* ---- KPI 卡片 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi .k-label { color: var(--muted); font-size: 12px; }
.kpi .k-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.up { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
.tbl td.num { font-variant-numeric: tabular-nums; }
.loading-td { text-align: center !important; color: var(--muted); padding: 24px !important; }

/* ---- 预测列表 ---- */
.pred-list { display: flex; flex-direction: column; gap: 10px; }
.pred-item {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 14px;
}
.pred-rank { width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
  background: rgba(59,130,246,.15); color: var(--blue); }
.pred-rank.top1 { background: rgba(240,185,11,.18); color: var(--gold); }
.pred-main { flex: 1; min-width: 0; }
.pred-name { font-weight: 700; font-size: 15px; }
.pred-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pred-score { text-align: right; flex: none; }
.pred-score b { font-size: 20px; font-weight: 800; }
.pred-score .st { font-size: 12px; color: var(--gold); display: block; }
.scorebar { height: 5px; background: var(--border); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.scorebar i { display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #f0b90b, #f0483e); }

/* ---- 买点类型 ---- */
.bp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .bp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .bp-grid { grid-template-columns: 1fr; } }
.bp-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all .15s ease; position: relative;
}
.bp-card:hover { border-color: #33445c; transform: translateY(-2px); }
.bp-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(240,185,11,.08); }
.bp-card .bp-tag { position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; background: rgba(59,130,246,.15); color: var(--blue); }
.bp-card h3 { font-size: 16px; margin-bottom: 6px; }
.bp-card p { font-size: 12.5px; color: var(--muted); }

.screen-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.param-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.param-item { display: flex; flex-direction: column; gap: 6px; }
.param-item label { font-size: 12px; color: var(--muted); }
.param-item input[type=range] { width: 150px; accent-color: var(--gold); }
.param-item select {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 150px;
}
.param-val { font-size: 12px; color: var(--gold); font-weight: 600; }

/* ---- 按钮 ---- */
.btn {
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  border-radius: 9px; padding: 9px 18px; font-size: 14px; cursor: pointer; transition: all .15s;
  font-weight: 600;
}
.btn:hover { border-color: #33445c; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--gold), #e07b00); color: #1a1205; border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-buy { background: rgba(0,181,120,.15); color: #37e0a5; border: 1px solid rgba(0,181,120,.35); }
.btn-buy:hover { background: rgba(0,181,120,.25); }

/* ---- 选股结果 ---- */
#screenResult { margin-top: 18px; }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.result-head .badge { font-weight: 600; }
.match-cell { text-align: left !important; max-width: 340px; font-size: 12.5px; color: #b8c4d0; }
.match-cell b { color: var(--gold); }
.pick-col { text-align: center !important; }
.pick-col input { transform: scale(1.2); accent-color: var(--gold); cursor: pointer; }

/* ---- 计划卡片 ---- */
.plan-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.plan-head h3 { font-size: 17px; }
.plan-head .plan-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-cell { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.plan-cell .t { font-size: 11.5px; color: var(--muted); }
.plan-cell .v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.plan-cell .v span { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .plan-cols { grid-template-columns: 1fr; } }
.plan-col-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.step-list { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.step:last-child { border-bottom: none; }
.step .s-stage { flex: none; width: 110px; font-weight: 700; color: var(--gold); font-size: 13px; }
.step .s-action { font-size: 13px; color: #c3cfdb; }
.check-list li, .risk-list li { margin: 6px 0 6px 18px; font-size: 13px; color: #c3cfdb; }
.risk-list { list-style: none; margin-left: 0 !important; }
.risk-list li::before { content: "⚠ "; color: var(--gold); margin-left: -18px; }

/* ---- 空态 / 骨架 ---- */
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; border: 1px dashed var(--border); border-radius: var(--radius); }
.skeleton { background: linear-gradient(90deg, var(--panel) 25%, #1b2536 50%, var(--panel) 75%); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: 10px; height: 84px; }
@keyframes sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- 周期切换 ---- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; vertical-align: middle; margin: 0 8px; }
.seg-btn { background: transparent; border: none; color: var(--muted); padding: 3px 10px; font-size: 12px; cursor: pointer; border-right: 1px solid var(--border); transition: all .15s; }
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--gold); color: #1a1205; font-weight: 600; }
.seg-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }

/* ---- 个股分析 ---- */
.stock-search { display: flex; gap: 12px; margin-bottom: 16px; }
.stock-search input { flex: 1; background: #0d1522; border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 12px 16px; font-size: 14.5px; outline: none; }
.stock-search input:focus { border-color: var(--gold); }
.wait { color: #f0b90b; }

/* ---- 弹窗 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(5,8,14,.75); z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-mask.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: min(900px, 100%); padding: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stock-basic {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 12.5px;
}
.stock-basic .sb-item { color: var(--muted); }
.stock-basic .sb-item b { color: var(--text); font-weight: 600; margin-right: 6px; }
.stock-basic .sb-src { margin-left: auto; color: #56637a; font-size: 11px; }

/* ---- 大盘指数涨跌预测 ---- */
.ip-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.ip-main { display: flex; flex-direction: column; gap: 6px; }
.ip-title { font-size: 13px; color: var(--muted); }
.ip-quote { display: flex; align-items: center; gap: 10px; }
.ip-quote b { font-size: 28px; color: var(--text); letter-spacing: .5px; }
.ip-badge { padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.ip-signals { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ip-sig { font-size: 12px; background: var(--panel2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 8px; color: var(--text); }
.ip-sig b { color: var(--gold); font-weight: 600; }
.pred-days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.pred-day-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pd-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.pd-week { color: #56637a; }
.pd-cls { font-size: 15px; font-weight: 700; padding: 7px 0; text-align: center; border-radius: 8px; }
.pd-prob { font-size: 12px; color: var(--muted); text-align: center; }
.pd-prob b { color: var(--text); }
.pd-rule { font-size: 12px; line-height: 1.65; color: var(--text); }
.hd-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0 14px; }
.hd-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.hd-label { width: 64px; font-weight: 600; }
.hd-bar { flex: 1; height: 8px; background: var(--panel2); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.hd-fill { height: 100%; border-radius: 5px; }
.hd-val { width: 44px; text-align: right; color: var(--muted); }

.footer { border-top: 1px solid var(--border); padding: 20px 28px; color: var(--muted); font-size: 12.5px; }
.footer b { color: #c3cfdb; }

/* ---- 提示 ---- */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1b2536; border: 1px solid var(--gold); color: var(--text);
  padding: 10px 22px; border-radius: 10px; z-index: 99; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); display: none; }

/* ---- 板块资金实时监控 ---- */
.modal-lg { width: min(1080px, 100%); }
.chart-xl { height: 62vh; min-height: 340px; }
.sf-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sf-select {
  background: #0d1522; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 6px 10px; font-size: 13px; outline: none; max-width: 300px;
}
.sf-select:focus { border-color: var(--gold); }
.sf-orient-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; display: none; }
@media (max-width: 640px) {
  .sf-orient-hint { display: block; }
  .chart-xl { height: 56vh; }
}
:fullscreen .modal-lg { width: 100%; height: 100%; border-radius: 0; }
:-webkit-full-screen .modal-lg { width: 100%; height: 100%; border-radius: 0; }
