* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #1f2329;
  line-height: 1.5;
}
.app { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }

header { text-align: center; margin: 16px 0 24px; }
header h1 { font-size: 26px; color: #c0392b; }
.subtitle { color: #6b7280; font-size: 14px; margin-top: 6px; }

.card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* 顶部导航 */
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 4px; background: #fff; border-radius: 12px;
  padding: 6px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
}
.nav-item {
  flex: 1; white-space: nowrap; border: none; background: transparent;
  color: #6b7280; font-size: 14px; font-weight: 600; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; transition: all .15s;
}
.nav-item:hover { background: #f5f6fa; }
.nav-item.on { background: #c0392b; color: #fff; }
.q-group { margin-bottom: 22px; }
.q-label { display: block; font-weight: 600; margin-bottom: 10px; font-size: 15px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.option {
  border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 12px;
  cursor: pointer; transition: all .15s; background: #fafafa;
}
.option:hover { border-color: #f0a8a0; }
.option.active { border-color: #c0392b; background: #fdeeec; }
.option .o-label { font-weight: 600; font-size: 14px; }
.option .o-desc { font-size: 12px; color: #6b7280; margin-top: 4px; }

input[type="range"] { width: 70%; vertical-align: middle; accent-color: #c0392b; }
#count-val { font-weight: 600; margin-left: 8px; }

button.primary {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: #c0392b; color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; margin-top: 4px;
}
button.primary:disabled { background: #d9a39d; cursor: not-allowed; }
.hint { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 12px; }

.status { text-align: center; padding: 24px; color: #6b7280; }
.hidden { display: none; }

#results { margin-top: 20px; }
.summary { font-size: 14px; color: #374151; margin-bottom: 10px; padding: 0 4px; }
.weights {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 0 4px;
}
.weight-tag {
  font-size: 12px; background: #eef2ff; color: #4338ca;
  padding: 4px 10px; border-radius: 20px;
}

.stock {
  background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer; transition: box-shadow .15s;
}
.stock:hover { box-shadow: 0 2px 12px rgba(192, 57, 43, 0.18); }
.stock-head { display: flex; justify-content: space-between; align-items: baseline; }
.stock-name { font-weight: 700; font-size: 16px; }
.stock-code { color: #9ca3af; font-size: 12px; margin-left: 6px; }
.stock-score {
  font-weight: 700; color: #c0392b; font-size: 18px;
}
.stock-meta { font-size: 12px; color: #6b7280; margin: 6px 0; }
.ind-tag { background: #f3f4f6; color: #4b5563; padding: 1px 7px; border-radius: 8px; }
.ind-tag.hot { background: #fdeaea; color: #c0392b; font-weight: 600; }
.stock-reason { font-size: 13px; color: #374151; }
.bars { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bar { flex: 1; min-width: 56px; }
.bar .b-label { font-size: 10px; color: #9ca3af; }
.bar .b-track { height: 6px; background: #eef0f3; border-radius: 4px; overflow: hidden; margin-top: 2px; }
.bar .b-fill { height: 100%; background: #f59e0b; }
.up { color: #d93025; }
.down { color: #137333; }

/* 搜索框 */
.search-row { display: flex; gap: 8px; margin-top: 14px; }
.search-row input {
  flex: 1; padding: 11px 12px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px;
}
.search-row input:focus { outline: none; border-color: #c0392b; }
button.ghost {
  padding: 11px 16px; border: 1.5px solid #c0392b; border-radius: 10px;
  background: #fff; color: #c0392b; font-weight: 600; cursor: pointer; white-space: nowrap;
}
button.ghost:hover { background: #fdeeec; }
button.ghost.wide { width: 100%; margin-top: 10px; }

/* 下单台 */
.td-warn { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin: 8px 0 12px; }
.td-texec { margin: 8px 0; }
.tx-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tx-lab { font-size: 12px; color: #6b7280; }
.tx-chip { font-size: 12px; padding: 4px 12px; border-radius: 14px; background: #f3f4f6; color: #4b5563; cursor: pointer; }
.tx-chip.on { background: #c0392b; color: #fff; }
.tx-tip { font-size: 11px; color: #9ca3af; margin-top: 5px; }
.tx-ratio-inp { width: 56px; padding: 4px 6px; border: 1.5px solid #e5e7eb; border-radius: 6px; font-size: 13px; }
.tp-ratio { font-size: 12.5px; color: #374151; margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tx-pending { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.tx-ptitle { font-weight: 700; font-size: 12px; color: #b45309; margin-bottom: 5px; }
.tx-prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.tx-prow em { font-style: normal; color: #9ca3af; }
.tx-pbtns { display: flex; gap: 5px; flex: none; }
.td-set-link { margin-left: auto; font-size: 13px; color: #c0392b; text-decoration: none; }
.set-links { display: flex; flex-direction: column; gap: 8px; }
.set-links a { color: #c0392b; text-decoration: none; font-size: 13px; }
.td-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.td-modebadge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.td-modebadge.paper { background: #f0f1f3; color: #6b7280; }
.td-modebadge.live { background: #fde8e8; color: #cf1322; }
.td-modetip { font-size: 11px; color: #9ca3af; }
.td-tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.td-tab { flex: 1; text-align: center; padding: 8px; border-radius: 8px; background: #f3f4f6;
  color: #6b7280; font-size: 13px; font-weight: 600; cursor: pointer; }
.td-tab.on { background: #c0392b; color: #fff; }
.td-sl { display: flex; gap: 10px; align-items: center; }
.td-sl label { flex: 1; }
.td-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #6b7280; }
.td-add input { width: 80px; padding: 6px 8px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 13px; }
.td-add input#td-pcode { width: 90px; }
.td-order.td-hot { border-color: #fca5a5; background: #fff7f7; }
.td-btns { display: flex; flex-direction: column; gap: 5px; flex: none; }
.tp-signal { display: inline-block; font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 16px; }
.tp-signal.up { background: #fdeaea; color: #d93025; }
.tp-signal.down { background: #e7f5ec; color: #137333; }
.tp-signal.mid { background: #f0f1f3; color: #6b7280; }
.tp-band { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f9fafb; border-radius: 10px; padding: 10px; margin: 8px 0; }
.tp-lvl { text-align: center; flex: 1; }
.tp-lvl span { font-size: 11px; color: #6b7280; display: block; }
.tp-lvl b { font-size: 17px; }
.tp-lvl.down b { color: #137333; }
.tp-lvl.up b { color: #d93025; }
.tp-now { text-align: center; flex: 1; font-size: 13px; font-weight: 600; }
.tp-now small { color: #9ca3af; font-weight: 400; }
.td-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.td-form label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #374151; }
.td-form input[type="number"] { width: 55%; padding: 8px 10px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 14px; }
.td-src { display: flex; gap: 16px; font-size: 13px; color: #374151; }
.td-src label { justify-content: flex-start; gap: 5px; }
.td-sum { font-size: 13px; font-weight: 600; color: #1f2329; margin: 10px 0; }
.td-order { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid #eef0f3; border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.td-o-main { font-size: 13px; }
.td-code { color: #9ca3af; font-size: 11px; }
.td-detail { color: #6b7280; font-size: 12px; margin-top: 3px; }
.td-order .ghost.small.done { background: #e7f5ec; color: #137333; border-color: #137333; }
.td-skip { font-size: 12px; color: #9ca3af; margin-top: 10px; line-height: 1.7;
  background: #f9fafb; border-radius: 8px; padding: 8px 10px; }
.td-note { font-size: 11.5px; color: #9ca3af; margin-top: 10px; }
.td-note a { color: #c0392b; }
.td-log { display: flex; flex-direction: column; gap: 4px; }
.td-logrow { font-size: 12px; color: #374151; padding: 6px 4px; border-bottom: 1px solid #f3f4f6; }
.td-logrow span { color: #9ca3af; }
.td-logrow em { font-style: normal; color: #b45309; }

/* 行业景气榜 */
.ind-list { display: flex; flex-direction: column; gap: 8px; }
.ind-row { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f3f4f6; }
.ind-rank { flex: none; width: 24px; height: 24px; line-height: 24px; text-align: center;
  border-radius: 6px; background: #f0f1f3; color: #6b7280; font-weight: 700; font-size: 13px; }
.ind-rank.top { background: #c0392b; color: #fff; }
.ind-main { flex: 1; min-width: 0; }
.ind-name { font-weight: 700; font-size: 14px; }
.ind-score { font-weight: 400; font-size: 11px; color: #fff; background: #f59e0b;
  padding: 1px 7px; border-radius: 10px; margin-left: 6px; }
.ind-metrics { font-size: 12px; color: #6b7280; margin: 3px 0; }
.ind-leaders { font-size: 12px; color: #9ca3af; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow-y: auto; z-index: 50;
}
/* 双类选择器优先级更高，确保 .hidden 时弹窗真正隐藏、不挡住下方界面 */
.modal.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px;
  padding: 22px 20px 18px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute; top: 10px; right: 14px; border: none; background: none;
  font-size: 26px; color: #9ca3af; cursor: pointer; line-height: 1;
}
.a-loading, .a-err { text-align: center; padding: 30px 10px; color: #6b7280; }
.a-err { color: #c0392b; }
.a-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.a-name { font-size: 20px; font-weight: 700; }
.a-code { color: #9ca3af; font-size: 13px; }
.a-price { margin-left: auto; font-size: 16px; }
.a-sub { color: #6b7280; font-size: 13px; margin: 4px 0 10px; }
.a-sec { border-top: 1px solid #f0f1f3; padding: 12px 0; }
.a-sec h4 { font-size: 14px; color: #c0392b; margin-bottom: 8px; }
.a-trend { display: inline-block; background: #fdeeec; color: #c0392b;
  font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 16px; }
.a-summary { font-size: 13px; color: #374151; margin-top: 8px; }
.a-grid { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #374151; margin-top: 6px; }

/* 支撑/压力 */
.sr { display: flex; flex-direction: column; gap: 6px; }
.sr-col { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sr-now { font-weight: 700; text-align: center; color: #1f2329; padding: 2px 0; }
.sr-tag { font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.sr-col.res .sr-tag { background: #fdeaea; color: #d93025; }
.sr-col.sup .sr-tag { background: #e7f5ec; color: #137333; }
.lvl { font-size: 12px; background: #f6f7f9; padding: 3px 8px; border-radius: 8px; }
.lvl b { font-size: 13px; }
.lvl i { color: #9ca3af; font-style: normal; }
.lvl em { font-style: normal; color: #6b7280; }

/* 强势同行 */
.leaders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.leader { font-size: 12px; background: #eef2ff; color: #3730a3;
  padding: 4px 10px; border-radius: 14px; cursor: pointer; }
.leader:hover { background: #e0e7ff; }
.leader em { font-style: normal; margin-left: 2px; }
.a-disclaimer { font-size: 11px; color: #9ca3af; text-align: center; margin-top: 12px; }

/* 自选股 */
.wl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wl-head h3 { font-size: 16px; color: #1f2329; }
#wl-count { color: #9ca3af; font-size: 13px; font-weight: 400; }
button.ghost.small { padding: 5px 12px; font-size: 12px; }
.wl-list { display: flex; flex-direction: column; gap: 6px; }
.wl-loading { color: #9ca3af; font-size: 13px; padding: 6px; }
.wl-empty { color: #9ca3af; font-size: 13px; padding: 10px 4px; line-height: 1.6; }
.wl-empty b { color: #f1a722; }
.wl-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border: 1px solid #eef0f3; border-radius: 10px; cursor: pointer;
}
.wl-item:hover { border-color: #f0a8a0; background: #fffafa; }
.wl-main { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.wl-name { font-weight: 600; font-size: 14px; }
.wl-code { color: #9ca3af; font-size: 11px; }
.wl-ind { color: #6b7280; font-size: 11px; background: #f3f4f6; padding: 1px 7px; border-radius: 10px; }
.wl-right { display: flex; align-items: center; gap: 10px; }
.wl-price { font-weight: 600; font-size: 14px; }
.wl-chg { font-size: 13px; min-width: 56px; text-align: right; }
.wl-del { border: none; background: none; color: #c0c4cc; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.wl-del:hover { color: #d93025; }

/* 星标按钮 */
.star { border: none; background: none; cursor: pointer; font-size: 17px; color: #d0d3d9;
  padding: 0 4px 0 0; line-height: 1; vertical-align: middle; }
.star.on { color: #f1a722; }

/* 事件提醒 */
.ev-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ev-head h3 { font-size: 16px; }
#ev-stat { color: #9ca3af; font-size: 11px; font-weight: 400; margin-left: 6px; }
.ev-loading { color: #9ca3af; font-size: 13px; padding: 10px 4px; }
.ev-macro-link { display: block; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
  padding: 8px 10px; margin-bottom: 10px; text-decoration: none; color: #1f2329; font-size: 12px; }
.ev-macro-link b { color: #c2410c; }
.ev-macro-link span { display: block; color: #6b7280; margin-top: 2px; }
/* 盘中做T盯价 */
.ta-strip:empty { display: none; }
.ta-idle { font-size: 12px; color: #9ca3af; padding: 6px 2px; }
.ta-hot { background: #fff1f0; border: 1px solid #ffa39e; border-radius: 10px; padding: 10px 12px;
  margin-bottom: 10px; cursor: pointer; }
.ta-title { font-weight: 700; color: #cf1322; font-size: 13px; margin-bottom: 6px; }
.ta-row { font-size: 12.5px; color: #1f2329; padding: 3px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ta-tip { font-size: 11px; color: #cf1322; margin-top: 6px; }

/* 自选股相关专区 */
.ev-watch-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; }
.ev-watch-title { font-weight: 700; font-size: 13px; color: #b45309; margin-bottom: 6px; }
.ev-watch-empty { font-size: 12px; color: #9ca3af; }
.ev-witem { padding: 7px 0; border-top: 1px dashed #fde68a; }
.ev-witem:first-of-type { border-top: none; }
.ev-wrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }

.ev-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ev-chip { font-size: 12px; padding: 4px 10px; border-radius: 16px; background: #f3f4f6;
  color: #4b5563; cursor: pointer; }
.ev-chip.on { background: #c0392b; color: #fff; }
.ev-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.ev-item { border: 1px solid #eef0f3; border-radius: 10px; padding: 9px 11px; }
.ev-row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.ev-imp { font-size: 10px; font-weight: 700; color: #fff; background: #d93025; padding: 1px 6px; border-radius: 4px; }
.ev-cat { font-size: 11px; color: #4338ca; background: #eef2ff; padding: 1px 7px; border-radius: 8px; }
.ev-dir { font-size: 11px; padding: 1px 7px; border-radius: 8px; font-weight: 600; }
.ev-dir.up { background: #fdeaea; color: #d93025; }
.ev-dir.down { background: #e7f5ec; color: #137333; }
.ev-dir.mid { background: #f0f1f3; color: #6b7280; }
.ev-scope { font-size: 11px; color: #9ca3af; }
.ev-time { font-size: 11px; color: #c0c4cc; margin-left: auto; }
.ev-title { display: block; font-size: 13.5px; color: #1f2329; text-decoration: none; line-height: 1.45; }
.ev-title:hover { color: #c0392b; }
.ev-impact { font-size: 12px; color: #6b7280; margin-top: 4px; }
.ev-rels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.ev-rel { font-size: 11px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  padding: 1px 8px; border-radius: 10px; cursor: pointer; }

/* 消息面 */
.news-stat { font-size: 11px; color: #9ca3af; font-weight: 400; margin-left: 6px; }
.news-list { display: flex; flex-direction: column; gap: 2px; }
.news-item {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 4px;
  border-bottom: 1px solid #f3f4f6; text-decoration: none; color: inherit;
}
.news-item:hover { background: #fafafa; }
.news-tag {
  flex: none; font-size: 11px; padding: 1px 6px; border-radius: 6px; font-weight: 600;
}
.news-tag.up { background: #fdeaea; color: #d93025; }
.news-tag.down { background: #e7f5ec; color: #137333; }
.news-tag.mid { background: #f0f1f3; color: #6b7280; }
.news-title { flex: 1; font-size: 13px; color: #1f2329; line-height: 1.4; }
.news-meta { flex: none; font-size: 11px; color: #9ca3af; white-space: nowrap; }
.news-note { font-size: 11px; color: #9ca3af; margin-top: 6px; }

/* K线图 */
.kchart { width: 100%; display: block; }
.k-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; margin-top: 4px; }
.k-legend span { font-weight: 600; }
