/* 涨停次日接力观察池 · 响应式样式（浅底研报风，支持明暗主题） */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --text: #17202e;
  --text-2: #5b6676;
  --text-3: #8b95a5;
  --border: #e3e8ef;
  --border-2: #d3dae4;
  --accent: #1f4e79;
  --accent-soft: #e8f0f8;
  --up: #d92b2b;
  --up-soft: #fdecec;
  --down: #128a54;
  --down-soft: #e7f5ee;
  --warn: #b7791f;
  --warn-soft: #fdf5e4;
  --shadow: 0 1px 2px rgba(23, 32, 46, .04), 0 8px 24px rgba(23, 32, 46, .05);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0f1218;
  --surface: #191e27;
  --surface-2: #1f2530;
  --surface-3: #262d3a;
  --text: #e9edf4;
  --text-2: #aab4c3;
  --text-3: #7e899a;
  --border: #2b3340;
  --border-2: #374151;
  --accent: #7db3e8;
  --accent-soft: #1d3247;
  --up: #f16464;
  --up-soft: #3a1f22;
  --down: #45bd85;
  --down-soft: #173329;
  --warn: #e0b25c;
  --warn-soft: #332b1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px; line-height: 1.6;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: .01em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--up), #f08b5b);
  color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; letter-spacing: .04em;
}
.brand-text h1 { font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand-text p { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.date-picker { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.date-picker select, .input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; outline: none;
  max-width: 100%;
}
.date-picker select:focus, .input:focus { border-color: var(--accent); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 16px; line-height: 1;
  display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

.banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid var(--border); padding: 9px 20px;
  font-size: 12.5px; text-align: center; font-weight: 600;
}
.container { max-width: 1440px; margin: 0 auto; padding: 18px 20px 40px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.source-bar {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  color: var(--text-3); font-size: 11.5px; padding: 0 4px 12px;
}
/* 长来源描述在窄屏可换行，避免撑出横向滚动 */
.source-bar span { min-width: 0; overflow-wrap: anywhere; }
.source-bar .tag {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; font-size: 11px;
}
.source-bar .tag.live { color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, var(--border)); }

.tldr { padding: 18px 20px; margin-bottom: 14px; border-left: 4px solid var(--up); }
.tldr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.tldr h2 { font-size: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 3px 11px; font-size: 11.5px; font-weight: 700;
  background: var(--up-soft); color: var(--up);
}
.badge.calm { background: var(--down-soft); color: var(--down); }
.badge.neutral { background: var(--surface-3); color: var(--text-2); }
.tldr p { color: var(--text-2); font-size: 13px; }
.tldr .tldr-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--text-3); }
.tldr .tldr-meta span { min-width: 0; overflow-wrap: anywhere; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 14px; box-shadow: var(--shadow); min-width: 0;
}
.kpi .k-label { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.kpi .k-value { font-size: 23px; font-weight: 720; line-height: 1.35; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: var(--up); } .neg { color: var(--down); } .muted { color: var(--text-3); }

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; padding: 10px 16px; font-size: 13.5px;
  color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.pool-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 14px; align-items: start; }
.side { padding: 16px; position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; }
.side::-webkit-scrollbar { width: 5px; }
.side::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.side-head h2 { font-size: 14px; }
.side-head .hint { font-size: 10.5px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 11.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.filter-block { margin-bottom: 14px; }
.fl { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.fl b { color: var(--accent); font-variant-numeric: tabular-nums; }
.input { width: 100%; }
.range { width: 100%; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 7px; padding: 4px 9px; font-size: 11.5px; color: var(--text-2);
}
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.weight-block { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.weight-row { margin-bottom: 10px; }
.weight-row .wr-top { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 2px; }
.weight-row .wr-top b { color: var(--accent); font-variant-numeric: tabular-nums; }
.weight-row input { width: 100%; height: 4px; accent-color: var(--accent); }
.weight-note { font-size: 10.5px; color: var(--text-3); line-height: 1.55; margin-top: 8px; }

.list-card { overflow: hidden; }
.list-head { padding: 15px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--border); }
.list-head .count { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.ghost-btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: right; padding: 10px 12px; color: var(--text-3); font-weight: 600;
  font-size: 11.5px; white-space: nowrap; background: var(--surface-2);
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.data-table th:nth-child(2), .data-table th:nth-child(5), .data-table th:last-child { text-align: left; }
.data-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td:nth-child(2), .data-table td:nth-child(5), .data-table td:last-child { text-align: left; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.stock-name { font-weight: 650; }
.stock-code { font-size: 10.5px; color: var(--text-3); margin-left: 5px; font-variant-numeric: tabular-nums; }
.score-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.score-bar { width: 62px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f0a35b, var(--up)); }
.grade-tag { display: inline-block; min-width: 20px; text-align: center; border-radius: 5px; padding: 1px 5px; font-size: 11px; font-weight: 700; }
.grade-A { background: var(--up-soft); color: var(--up); }
.grade-B { background: var(--accent-soft); color: var(--accent); }
.grade-C { background: var(--surface-3); color: var(--text-2); }
.grade-D { background: var(--down-soft); color: var(--down); }
.mini-tag { display: inline-block; font-size: 10px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; margin-right: 4px; color: var(--text-2); }
.mini-tag.risk { color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, var(--border)); }
.mobile-cards { display: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.table-foot { font-size: 11px; color: var(--text-3); padding: 10px 4px 0; line-height: 1.6; }

.section-card { padding: 18px; margin-bottom: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-area { width: 100%; min-height: 220px; margin-top: 8px; }
.switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.switch-btn { border: 0; background: var(--surface-2); padding: 5px 12px; font-size: 11.5px; color: var(--text-2); }
.switch-btn.active { background: var(--accent); color: #fff; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin-top: 10px; }
.note-item { font-size: 12.5px; color: var(--text-2); padding-left: 14px; position: relative; line-height: 1.65; }
.note-item::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.note-item b { color: var(--text); }
.simple-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
.simple-table th, .simple-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.simple-table th { color: var(--text-3); font-weight: 600; font-size: 11.5px; background: var(--surface-2); }
.simple-table th:first-child, .simple-table td:first-child { text-align: left; }
.simple-table td { font-variant-numeric: tabular-nums; }
.simple-table tbody tr:hover { background: var(--surface-2); }
.scroll-x { overflow-x: auto; }

.mask { position: fixed; inset: 0; background: rgba(10, 15, 24, .45); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); z-index: 50; box-shadow: -12px 0 40px rgba(0, 0, 0, .16);
  display: flex; flex-direction: column; animation: slide .24s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-body { padding: 18px 20px 36px; overflow-y: auto; }
.d-section { margin-bottom: 22px; }
.d-section h3 { font-size: 13px; margin-bottom: 9px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.d-section h3::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }
.d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.d-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; }
.d-cell .l { font-size: 10.5px; color: var(--text-3); }
.d-cell .v { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.d-list { font-size: 12.5px; color: var(--text-2); }
.d-list li { margin: 0 0 6px 18px; line-height: 1.6; }
.penalty-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.penalty-row span:last-child { color: var(--down); font-weight: 650; white-space: nowrap; }
.factor-row { display: grid; grid-template-columns: 82px 1fr 38px; gap: 8px; align-items: center; font-size: 11.5px; margin-bottom: 6px; }
.factor-track { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.factor-track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.plan-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.75; color: var(--text-2); }
.plan-box b { color: var(--text); }
.src-note { font-size: 10.5px; color: var(--text-3); line-height: 1.6; margin-top: 8px; }
.chart-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.chart-box svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.tooltip {
  position: fixed; z-index: 70; pointer-events: none; background: var(--text);
  color: var(--surface); font-size: 11.5px; padding: 6px 9px; border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); white-space: nowrap; max-width: 260px;
}
.footer { margin-top: 24px; padding: 16px 4px 0; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); line-height: 1.8; }
.footer b { color: var(--text-2); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pool-layout { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .two-col, .notes { grid-template-columns: 1fr; }
  .pool-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; display: none; }
  .side.open { display: block; }
  .mobile-only { display: inline-block; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 14px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; font-size: 12px; }
  .brand-text h1 { font-size: 14.5px; }
  .brand-text p { display: none; }
  .date-picker span { display: none; }
  .container { padding: 14px 12px 32px; }
  .source-bar { font-size: 11px; gap: 6px 10px; }
  .source-bar .sb-source { flex-basis: 100%; line-height: 1.5; }
  .tab { padding: 10px 11px; font-size: 12.5px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi .k-value { font-size: 20px; }
  .tldr { padding: 15px; }
  .tldr h2 { font-size: 16px; }
  .table-wrap { display: none; }
  .mobile-cards { display: block; padding: 8px; }
  .m-card { border: 1px solid var(--border); border-radius: 11px; padding: 12px; margin-bottom: 9px; background: var(--surface); }
  .m-card:active { background: var(--surface-2); }
  .m-row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .m-row1 .nm { font-weight: 700; font-size: 14px; }
  .m-row1 .nm small { font-size: 10.5px; color: var(--text-3); font-weight: 400; margin-left: 5px; }
  .m-score { font-size: 20px; font-weight: 750; color: var(--up); line-height: 1; font-variant-numeric: tabular-nums; }
  .m-meta { font-size: 11.5px; color: var(--text-2); margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .m-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
  .m-tags { margin-top: 7px; }
  .section-card { padding: 14px; }
  .drawer { width: 100%; }
  .d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
