/* ===== CSS Variables ===== */
:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --primary-bg: #e8eaf6;
  --red: #c62828;
  --green: #2e7d32;
  --orange: #e65100;
  --purple: #6a1b9a;
  --bg: #f0f1f4;
  --bg-secondary: #f7f8fa;
  --card-bg: #fff;
  --border: #e2e4e8;
  --border-light: #ecedf0;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --sidebar-w: 180px;
  --topbar-h: 48px;
  --statusbar-h: 32px;
}

/* ===== Reset ===== */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  overflow: hidden;
}

/* ===== App Layout ===== */
.app { display: flex; height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
}
.sidebar-logo {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
  user-select: none;
}
.nav-item:hover { background: var(--bg-secondary); color: var(--text); }
.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.nav-item.active .nav-dot { background: var(--primary); }
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Status Dot ===== */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ===== Main Area ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.main-topbar h1 { font-size: 16px; font-weight: 600; }
.clock { font-size: 13px; color: var(--text-muted); }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* ===== Status Bar ===== */
.status-bar {
  height: var(--statusbar-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Pages ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Data Strip ===== */
.data-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.strip-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.chip-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.chip-value { display: block; font-size: 20px; font-weight: 700; }
.chip-value.up { color: var(--red); }
.chip-value.down { color: var(--green); }

/* ===== Card Row ===== */
.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.card-row.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-hint { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 12px 16px; font-size: 13px; }

/* ===== Mini Button ===== */
.mini-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all .15s;
}
.mini-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini-btn.primary:hover { background: var(--primary-light); }

/* ===== Calculator Grid ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}
.calc-tile {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
}
.calc-tile:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
}
.tile-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.tile-desc { font-size: 12px; color: var(--text-muted); }

/* ===== Dashboard Actions ===== */
.dash-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
  background: var(--card-bg);
  color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-light); }
.btn.outline { background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); }
.btn.outline:hover { background: var(--primary-bg); }
.btn.success { background: var(--green); color: #fff; }
.btn.success:hover { background: #1b5e20; }
.btn.ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--bg-secondary); }
.btn.lg { padding: 10px 28px; font-size: 15px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Scraper ===== */
.page-header { margin-bottom: 16px; }
.page-header h2 { font-size: 18px; color: var(--text); margin-bottom: 4px; }
.hint { color: var(--text-muted); font-size: 13px; }
.scraper-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.status-bar-msg {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: none;
  font-size: 13px;
}
.status-bar-msg.show { display: block; }
.status-bar-msg.info { background: var(--primary-bg); color: var(--primary); }
.status-bar-msg.success { background: #e8f5e9; color: var(--green); }
.status-bar-msg.error { background: #ffebee; color: var(--red); }
.scraper-actions { display: flex; gap: 10px; }

.card-body table { width: 100%; border-collapse: collapse; }
.card-body td { padding: 4px 6px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.card-body td:first-child { color: var(--text-secondary); }
.card-body td:last-child { font-weight: 600; text-align: right; }
.card-body tr:last-child td { border-bottom: none; }
.card-body .up { color: var(--red); }
.card-body .down { color: var(--green); }

/* ===== Calc Sub-tabs ===== */
.calc-subtabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
}
.subtab-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.subtab-btn:hover { background: var(--primary-bg); }
.subtab-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.calc-content { max-width: 820px; }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

.card .card { border: none; }
.calc-content .card { padding: 0; }
.calc-content .card > .sub-section,
.calc-content .card > .form-grid,
.calc-content .card > .btn-row,
.calc-content .card > .result-grid,
.calc-content .card > .result-item,
.calc-content .card > .calc-note,
.calc-content .card > .calc-divider,
.calc-content .card > .kelly-title,
.calc-content .card > .table-wrap,
.calc-content .card > h4,
.calc-content .card > .hint,
.calc-content .card > p {
  margin-left: 20px;
  margin-right: 20px;
}
.calc-content .card > *:first-child { margin-top: 20px; }
.calc-content .card > *:last-child { margin-bottom: 20px; }
.calc-content .card h4 { font-size: 15px; color: var(--primary); margin-top: 0; margin-bottom: 14px; }
.mode-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mode-switch select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.form-item input, .form-item select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.form-item input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,35,126,.1); }

.btn-row { display: flex; gap: 8px; margin-bottom: 14px; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 8px; }
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.result-item .rl { font-size: 13px; color: var(--text-secondary); }
.result-item .rv { font-size: 16px; font-weight: 700; color: var(--primary); }
.result-item .rv.red { color: var(--red); }
.result-item .rv.green { color: var(--green); }
.result-item .rv.kelly { color: var(--purple); }

.calc-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.calc-note.green { color: var(--green); }
.calc-note.red { color: var(--red); }
.calc-note.orange { color: var(--orange); }
.calc-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.kelly-title { font-size: 14px; font-weight: 700; color: var(--purple); margin-bottom: 12px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin-bottom: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fafafa; }
.data-table th { background: var(--primary); color: #fff; padding: 8px 10px; text-align: center; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--border-light); }
.data-table td[contenteditable] { cursor: text; background: #fff; }
.data-table td[contenteditable]:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.data-table td.ro { color: var(--text-muted); }
.data-table .up { color: var(--red); font-weight: 600; }
.data-table .down { color: var(--green); font-weight: 600; }

/* ===== Report ===== */
.screener-wrap { height: calc(100vh - var(--topbar-h) - var(--statusbar-h) - 48px); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #0d1117; }
.screener-iframe { width: 100%; height: 100%; border: none; display: block; }
.report-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: calc(100vh - var(--topbar-h) - var(--statusbar-h) - 48px); }
.report-form-side { display: flex; flex-direction: column; overflow: hidden; }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.report-header h2 { font-size: 16px; color: var(--text); }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-search { margin-bottom: 12px; }
.search-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
.report-forms { flex: 1; overflow-y: auto; padding-right: 6px; }
.report-forms::-webkit-scrollbar { width: 5px; }
.report-forms::-webkit-scrollbar-track { background: var(--bg); }
.report-forms::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 3px; }
.form-section { margin-bottom: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.form-section-header { padding: 10px 16px; background: var(--primary-bg); color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.form-section-header:hover { background: #dfe1f0; }
.form-section-header .arrow { transition: transform .2s; }
.form-section.collapsed .arrow { transform: rotate(-90deg); }
.form-section.collapsed .form-section-body { display: none; }
.form-section-body { padding: 12px 16px; }
.form-section-body .form-grid { gap: 10px; }
.form-section-body textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; outline: none; resize: vertical; }
.form-section-body textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,35,126,.1); }

.report-preview-side { display: flex; flex-direction: column; overflow: hidden; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.preview-header h2 { font-size: 16px; color: var(--text); }
.preview-actions { display: flex; gap: 8px; }
.preview-wrap { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.preview-iframe { width: 100%; height: 100%; border: none; }

/* ===== Misc ===== */
.placeholder { color: var(--text-muted); text-align: center; padding: 20px 0; font-size: 13px; }
.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Index Grid (8 cards) ===== */
.index-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.idx-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  border-top: 3px solid var(--border);
  transition: border-color .3s;
}
.idx-card.up { border-top-color: var(--red); }
.idx-card.down { border-top-color: var(--green); }
.idx-card.placeholder-card { text-align: center; color: var(--text-muted); }
.idx-name { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.idx-price { font-size: 22px; font-weight: 700; line-height: 1.3; }
.idx-change { font-size: 16px; font-weight: 700; margin-top: 2px; }
.idx-card.up .idx-change, .idx-card.up .idx-price { color: var(--red); }
.idx-card.down .idx-change, .idx-card.down .idx-price { color: var(--green); }
.idx-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== Rank Row ===== */
.rank-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ===== Rank Sub-tabs ===== */
.rank-subtabs { display: flex; gap: 4px; }
.rank-tab {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all .15s;
  font-family: inherit;
}
.rank-tab:hover { background: var(--bg-secondary); }
.rank-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Realtime Table ===== */
.rt-scroll { max-height: 420px; overflow-y: auto; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rt-table th {
  background: var(--primary);
  color: #fff;
  padding: 7px 6px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.rt-table td {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.rt-table .stock-name { font-weight: 600; text-align: left; }
.rt-table .up { color: var(--red); font-weight: 600; }
.rt-table .down { color: var(--green); font-weight: 600; }
.rt-table tbody tr:hover { background: var(--bg-secondary); }

/* ===== 指数估值表格美化 ===== */
.valuation-card {
  padding: 0;
  box-shadow: 0 1px 3px rgba(26, 35, 126, 0.06);
}
.valuation-card .card-header {
  background: linear-gradient(180deg, #fafbff 0%, #f4f5fb 100%);
  padding: 14px 20px;
}
.valuation-card .card-header h3 {
  font-size: 16px;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.val-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.val-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.val-table thead {
  background: var(--primary);
}
.val-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  line-height: 1.4;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.val-table th:last-child { border-right: none; }
.val-table th small {
  font-weight: 400;
  opacity: 0.85;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.val-table td {
  padding: 9px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text);
}
.val-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}
.val-table td:nth-child(2) {
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
}
.val-table tbody tr:nth-child(even) {
  background: #fafbff;
}
.val-table tbody tr:hover {
  background: #eef0fb;
}
.val-table tbody tr:last-child td {
  border-bottom: none;
}
.val-table .pct-low {
  color: var(--green);
  font-weight: 700;
  background: rgba(46, 125, 50, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  min-width: 50px;
}
.val-table .pct-mid {
  color: var(--text);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  min-width: 50px;
}
.val-table .pct-high {
  color: var(--red);
  font-weight: 700;
  background: rgba(198, 40, 40, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  min-width: 50px;
}
.val-table .pct-warn {
  color: var(--orange);
  font-weight: 700;
  background: rgba(230, 81, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  min-width: 50px;
}
.val-table .pct-na {
  color: var(--text-muted);
}
.valuation-source {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text-muted);
  background: #fafbff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.valuation-source span {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* ===== 估值观察室 ===== */
.val-block { padding: 14px 20px 6px; }
.val-block + .val-block { border-top: 1px dashed var(--border-light); margin-top: 8px; }
.val-sub-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.val-sub-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.val-svg { width: 100%; height: auto; display: block; }
#val-star-svg { max-width: 620px; margin: 0 auto; }
.val-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }

.val-legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding: 8px 4px 6px; font-size: 12px; color: var(--text-muted);
}
.val-legend .vl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.val-legend-zone { color: var(--text-muted); font-size: 11px; }

/* 温度计 */
.val-thermo-head, .val-thermo-row {
  display: grid; grid-template-columns: 120px 1fr 1fr 90px;
  gap: 12px; align-items: center; padding: 6px 4px;
}
.val-thermo-head {
  font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}
.val-thermo-row { border-bottom: 1px solid var(--border-light); }
.val-thermo-row:hover { background: #f7f9fc; }
.vt-name { font-size: 13px; font-weight: 500; }
.vt-cell { display: flex; flex-direction: column; gap: 3px; }
.vt-track {
  position: relative; height: 10px; border-radius: 5px; overflow: visible;
  background: linear-gradient(90deg,
    rgba(46,125,50,0.22) 0 30%, rgba(249,168,37,0.22) 30% 70%,
    rgba(239,108,0,0.22) 70% 90%, rgba(198,40,40,0.22) 90% 100%);
}
.vt-marker {
  position: absolute; top: -3px; width: 16px; height: 16px; border-radius: 50%;
  transform: translateX(-50%); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.vt-val { font-size: 11.5px; color: var(--text-muted); }
.vt-val b { font-size: 12px; }
.vt-delta { font-size: 11px; margin-left: 4px; }
.vt-delta.up { color: #c62828; }      /* 分位上升 = 估值变贵 = 红 */
.vt-delta.down { color: #2e7d32; }    /* 分位下降 = 估值变便宜 = 绿 */
.vt-delta.flat { color: #aaa; }
.vt-dv { font-size: 12px; text-align: right; color: var(--text); }

/* 周更新弹窗 */
.val-date-input {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; margin-left: 6px;
}
.val-update-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.val-update-table th {
  padding: 8px 6px; text-align: center; font-weight: 600;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.val-update-table td {
  padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--border-light); white-space: nowrap;
}
.val-update-table td:first-child { text-align: left; font-weight: 500; }
.vu-input {
  width: 72px; padding: 5px 6px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; text-align: center;
}
.vu-input:focus { outline: none; border-color: var(--primary); }

@media (max-width: 900px) {
  .val-thermo-head, .val-thermo-row { grid-template-columns: 90px 1fr 1fr 60px; gap: 8px; }
  .vt-name { font-size: 12px; }
}

/* ===== 移动端底部导航（桌面隐藏） ===== */
.bottom-nav { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-row { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .card-row, .card-row.three { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; height: auto; }
  .report-preview-side { height: 400px; }
  .screener-wrap { height: calc(100vh - var(--topbar-h) - 48px); }
  .form-grid { grid-template-columns: 1fr; }

  /* --- 底部导航 --- */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    z-index: 200;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bottom-nav .nav-item {
    flex: 1 1 0;
    min-width: 46px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px 9px;
    font-size: 10px;
    border-left: none;
    border-top: 2px solid transparent;
    border-radius: 0;
    white-space: nowrap;
  }
  .bottom-nav .nav-item .bn-icon { font-size: 18px; line-height: 1; }
  .bottom-nav .nav-item:hover { background: transparent; }
  .bottom-nav .nav-item.active {
    background: transparent;
    border-top-color: var(--primary);
  }

  /* --- 顶部与内容区适配 --- */
  .main-topbar { padding: 0 14px; }
  .main-topbar h1 { font-size: 15px; }
  .clock { display: none; }
  .status-bar { display: none; }
  .main-content {
    padding: 12px 12px calc(64px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .dash-refresh-bar { flex-wrap: wrap; gap: 8px !important; }
  .rt-toolbar { gap: 8px; }
  .rt-toolbar .search-input { min-width: 140px; }
  .card-row { gap: 10px; }
}

/* ===== 复盘表页面 ===== */
.rt-page-header {
  margin-bottom: 12px;
}
.rt-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rt-toolbar .search-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.rt-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.rt-select:focus {
  border-color: var(--primary);
}

/* ===== 列筛选多选面板 ===== */
.rt-col-filter-wrap { position: relative; }
#rt-filter-toggle { white-space: nowrap; }
.rt-filter-count {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.rt-filter-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 8px 0;
  min-width: 200px;
}
.rt-filter-panel.open { display: block; }
.rt-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 8px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  gap: 6px;
}
.rt-filter-header .btn { padding: 2px 8px; font-size: 11px; }
.rt-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s;
}
.rt-filter-item:hover { background: rgba(var(--rgb-primary),.06); }
.rt-filter-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px; height: 15px;
  cursor: pointer;
}
.rt-year-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  min-width: 90px;
}
.rt-year-select:focus { border-color: var(--primary); }
.rt-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 18px;
}
.rt-status.info { color: var(--primary); }
.rt-status.success { color: var(--green); }
.rt-status.error { color: var(--red); }

.rt-table-card {
  padding: 0;
  overflow: hidden;
}

/* 复盘表专用表格样式 */
.review-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
}
/* ---- 表头冻结（sticky）---- */
.review-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}
/* 表头第一列（日期）同时冻结左侧 */
.review-table thead th:first-child {
  left: 0;
  z-index: 11;
  box-shadow: 1px 0 0 var(--border);
}
/* 冻结列阴影提示 */
.review-table td:first-child {
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.review-table th {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background .15s;
  padding: 7px 6px;
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.review-table th:hover {
  background: #d0d4f0;
}
.review-table th .sort-arrow::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  border: 4px solid transparent;
}
.review-table th.sort-asc .sort-arrow::after {
  border-bottom-color: #fff;
  margin-bottom: 3px;
  opacity: 1;
}
.review-table th.sort-desc .sort-arrow::after {
  border-top-color: #fff;
  margin-top: 3px;
  opacity: 1;
}

/* 复盘表数据行 */
.review-table td {
  padding: 5px 6px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #d0d0d8;
  text-align: center;
}
.review-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  font-weight: 600;
  color: var(--primary);
  background: rgba(26, 35, 126, 0.03);
}
.review-table tbody tr:nth-child(even) td {
  background: #fafbff;
}
.review-table tbody tr:hover td {
  background: #eef0fb;
}

/* 周末/汇总行特殊标记 */
.review-table tr[data-weekend] td {
  background: #f0f0f7 !important;
  font-weight: 600;
}
.review-table tr[data-weekend] td:first-child {
  background: #e8eaf6 !important;
}

/* 周间分隔空行 */
/* 周间分隔行 —— 压到0高度，只留红线，无空行间隙 */
.review-table tr.rt-separator td {
  height: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
  border-top: 2px solid var(--primary) !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: none !important;
  box-shadow: none !important;
}
.review-table tr.rt-separator:hover td {
  background: transparent !important;
}

/* 可编辑行：悬停提示双击 */
.review-table tr.rt-editable-row {
  cursor: pointer;
  transition: background-color 0.15s;
}
.review-table tr.rt-editable-row:hover td {
  background-color: rgba(var(--primary-rgb, 33,150,243), 0.06) !important;
}

/* 区域分隔线（概念涨停 ↔ 期货商品） */
.review-table th.rt-section-divider,
.review-table td.rt-section-divider {
  border-left: 3px solid var(--primary) !important;
}

/* ===== 复盘表骨架屏 ===== */
.rt-skeleton {
  padding: 16px;
}
.rt-skeleton .rt-sk-header {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #f5f6fa;
  border-radius: 4px;
}
.rt-skeleton .rt-sk-row {
  display: flex;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #eee;
}
.rt-skeleton .rt-sk-header span,
.rt-skeleton .rt-sk-row span {
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: rt-sk-shimmer 1.5s infinite;
  flex: 1;
}
.rt-skeleton .rt-sk-header span { height: 13px; background: #d8dce8; }
.rt-skeleton .rt-sk-header span:nth-child(1) { flex: 0.7; }
.rt-skeleton .rt-sk-header span:nth-child(2) { flex: 0.8; }
.rt-skeleton .rt-sk-header span:nth-child(3) { flex: 0.6; }
.rt-skeleton .rt-sk-header span:nth-child(4) { flex: 1.2; }
.rt-skeleton .rt-sk-header span:nth-child(5) { flex: 0.6; }
.rt-skeleton .rt-sk-header span:nth-child(6) { flex: 0.8; }
.rt-skeleton .rt-sk-header span:nth-child(7) { flex: 1; }
.rt-skeleton .rt-sk-header span:nth-child(8) { flex: 0.9; }

.rt-skeleton .rt-sk-hint {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 20px;
  animation: rt-sk-pulse 2s infinite;
}

@keyframes rt-sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes rt-sk-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 涨跌幅数值高亮 */
.review-table .up {
  color: var(--red);
  font-weight: 700;
}
.review-table .down {
  color: var(--green);
  font-weight: 700;
}

/* 板块名称 + 百分比 组合显示 */
.review-table td[title] {
  cursor: help;
}

.rt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 新增今日弹窗 ===== */
.rt-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rt-modal {
  width: 860px; max-width: 95vw;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}
.rt-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.rt-modal-header h3 { margin: 0; font-size: 16px; }
.rt-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: var(--radius-sm);
}
.rt-modal-close:hover { background: var(--bg-secondary); color: var(--text); }
.rt-modal-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  background: #f7f8fc;
  border-bottom: 1px solid var(--border-light);
}
.rt-fetch-hint { font-size: 12px; color: var(--text-muted); }
.rt-fetch-status { margin-left: auto; font-size: 12px; }
.rt-fetch-status.ok { color: var(--green); font-weight: 600; }
.rt-fetch-status.err { color: var(--red); font-weight: 600; }
.rt-modal-body {
  overflow-y: auto; padding: 16px 20px;
  flex: 1;
}
.rt-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* 填写表单分组 */
.rt-form-section { margin-bottom: 18px; }
.rt-form-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 2px solid var(--primary-bg);
  display: flex; align-items: center; gap: 6px;
}
.rt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px 12px;
}
.rt-form-group {
  display: flex; flex-direction: column; gap: 3px;
}

/* TOP3 排行专用紧凑行 */
.rt-form-section[data-layout="rank3"] .rank-row,
.rt-form-section[data-layout="rank3-amt"] .rank-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px 12px;
  align-items: end;
  margin-bottom: 8px;
  position: relative;
  padding-right: 42px; /* 给"自动/手动"标签留空间 */
}
.rt-form-section[data-layout="rank3-amt"] .rank-row {
  grid-template-columns: 2fr 1fr 1fr;
}
.rt-form-section[data-layout="rank3"] .rank-row:last-child,
.rt-form-section[data-layout="rank3-amt"] .rank-row:last-child {
  margin-bottom: 0;
}
.rank-row .rt-form-group {
  margin-bottom: 0;
}
.rank-row .auto-tag.row {
  position: absolute;
  top: 0;
  right: 0;
}
.rt-form-group label {
  font-size: 11.5px; color: var(--text-muted); font-weight: 500;
}
.rt-form-group input, .rt-form-group textarea, .rt-form-group select {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s;
}
.rt-form-group input:focus, .rt-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,35,126,0.1);
}
.rt-form-group textarea { min-height: 50px; resize: vertical; }
.rt-form-group input.filled { background: #f0f4ff; border-color: var(--primary); }

/* 自动抓取标记 */
.rt-form-group .auto-tag {
  font-size: 10px; color: #fff; background: var(--primary);
  padding: 1px 5px; border-radius: 3px; position: absolute; top: -8px; right: 0;
}
.rt-form-group .auto-tag.manual {
  background: #999;
}

/* ===== 编辑权限 ===== */
#rt-auth-btn.authed {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
#rt-auth-btn.authed::after {
  content: ' ✓';
}
.rt-auth-dialog {
  max-width: 380px;
}
.rt-auth-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.rt-auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.12);
}
/* 未登录时隐藏编辑按钮 */
.rt-locked #rt-add-today-btn { display: none !important; }
.rt-locked .rt-editable-row { cursor: default; }
.rt-locked .rt-editable-row:hover td { background: transparent !important; }

/* ===== 日历效应（季节性） ===== */
.sea-metric-switch { display: flex; gap: 8px; margin: 8px 0 10px; }
.sea-month-wrap { overflow-x: auto; }
.sea-month-table { width: max-content; }
.sea-month-table td { text-align: center; font-size: 12px; padding: 7px 1px; min-width: 26px; line-height: 1.45; }
.sea-month-table td:nth-child(n+3), .sea-month-table th:nth-child(n+3) { width: 84px; min-width: 84px; padding-left: 0; padding-right: 0; }
.sea-month-table th:first-child, .sea-month-table td:first-child { white-space: nowrap; padding-right: 14px; }
.sea-month-table th:nth-child(2), .sea-month-table td:nth-child(2) { white-space: nowrap; padding-right: 10px; }
.sea-month-table td i { font-style: normal; font-size: 11px; opacity: .9; display: block; }
.sea-month-table th { font-size: 12px; padding: 5px 1px; }
.sea-heat-scroll { overflow-x: auto; padding-bottom: 6px; }
.sea-heatmap { display: grid; grid-template-columns: 46px repeat(31, 42px); gap: 3px; min-width: max-content; }
.sea-cell { height: 36px; border-radius: 4px; font-size: 13px; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.sea-cell:hover { outline: 1.5px solid #1a237e; }
.sea-dayhead { font-size: 11px; color: var(--text-muted); cursor: default; height: 18px; }
.sea-dayhead:hover { outline: none; }
.sea-mlabel { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.sea-empty { background: #eceff1; cursor: default; }
.sea-empty:hover { outline: none; }
.sea-today { outline: 2px solid #1a237e; outline-offset: -2px; }
.sea-selected { outline: 2px solid #1a237e; outline-offset: -2px; }
.sea-legend { margin-top: 10px; }
.sea-day-detail { margin-top: 10px; padding: 10px 14px; background: var(--bg-secondary, #f5f7fa); border-radius: 8px; font-size: 13px; color: var(--text-secondary); }
.sea-day-detail .red { color: var(--red); font-weight: 600; }
.sea-day-detail .green { color: var(--green); font-weight: 600; }
/* 经典效应（通达信大数据效应·自绘版） */
.sea-effect-card { margin-top: 16px; }
.sea-effect-card .card-hint { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sea-effect-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.sea-effect-list { display: flex; flex-direction: column; gap: 6px; }
.sea-effect-loading { padding: 18px 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.sea-effect-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.sea-effect-item:hover { border-color: var(--primary-light); background: var(--bg-secondary); }
.sea-effect-item.open { border-color: var(--primary-light); }
.sea-effect-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sea-effect-name { font-weight: 600; font-size: 13px; }
.sea-effect-during, .sea-effect-cat {
  font-size: 11px; padding: 1px 6px; border-radius: 10px; line-height: 1.5;
  background: var(--primary-bg); color: var(--primary);
}
.sea-effect-cat { background: var(--bg-secondary); color: var(--text-secondary); }
.sea-effect-status { font-size: 11px; padding: 1px 6px; border-radius: 10px; line-height: 1.5; }
.sea-effect-status.live { background: #fdecea; color: var(--red); font-weight: 600; }
.sea-effect-status.soon { background: #e3f2fd; color: #1565c0; }
.sea-effect-status.past { background: var(--bg-secondary); color: var(--text-muted); }
.sea-effect-dates { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.sea-effect-detail { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-light); }
.sea-effect-item.open .sea-effect-detail { display: block; }
.sea-stat-head { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.sea-stat-head span:nth-child(1) { width: 64px; }
.sea-stat-head span:nth-child(2) { flex: 1; }
.sea-stat-head span:nth-child(3) { width: 64px; text-align: right; }
.sea-stat-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.sea-stat-name { width: 64px; font-size: 12px; color: var(--text-secondary); }
.sea-stat-barwrap { flex: 1; height: 13px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.sea-stat-bar { height: 100%; border-radius: 3px; }
.sea-stat-win { width: 52px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text); }
.sea-stat-avg { width: 64px; text-align: right; font-size: 12px; font-weight: 600; }
@media (max-width: 768px) {
  .sea-effect-card .card-hint { display: none; }
  .sea-effect-dates { margin-left: 0; }
  .sea-effect-status.past { display: none; }
}

/* ===== 中报全景（zhongbao）===== */
.zb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.zb-stat { background: #fff; border: 1px solid var(--border-light, #e8eaee); border-radius: 10px; padding: 14px 16px; }
.zb-stat-k { font-size: 12px; color: #8a8f99; margin-bottom: 6px; }
.zb-stat-v { font-size: 24px; font-weight: 700; }
.zb-stat-v.up { color: var(--red, #c9302c); }
.zb-stat-v.down { color: var(--green, #1e7e34); }
.zb-stat-note { font-size: 11px; color: #a0a5af; margin-top: 5px; }

.zb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .zb-two-col { grid-template-columns: 1fr; } }

.zb-bar-list { display: flex; flex-direction: column; gap: 4px; }
.zb-bar-row { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 6px; font-size: 12px; }
.zb-bar-name { text-align: right; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zb-bar-track { background: #f0f2f5; border-radius: 3px; height: 15px; position: relative; overflow: hidden; }
.zb-bar-fill { height: 100%; border-radius: 3px; }
.zb-bar-fill.pos { background: var(--red, #c9302c); }
.zb-bar-fill.neg { background: var(--green, #1e7e34); }
.zb-bar-val { font-weight: 600; white-space: nowrap; }
.zb-bar-val.pos { color: var(--red, #c9302c); }
.zb-bar-val.neg { color: var(--green, #1e7e34); }

#zb-tbl th { position: sticky; top: 0; z-index: 1; }
#zb-tbl td { white-space: nowrap; }
.zb-tag { display: inline-block; font-size: 10px; background: #fff3f3; color: #c9302c; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.zb-na { color: #b8bcc4; }

/* ===== 选股池 ===== */
.sp-banner {
  background: #fff8e6;
  border: 1px solid #f0d48a;
  color: #7a5b00;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.sp-input {
  width: 100%;
  margin: 6px 0 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.sp-add-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sp-msg { min-height: 18px; font-size: 13px; color: var(--green); margin-top: 8px; }
.sp-msg.err { color: var(--red); }
.sp-list { display: flex; flex-direction: column; gap: 14px; }
.sp-day-card.sp-current { border: 2px solid var(--primary-light); }
.sp-stats { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.sp-stat b { font-size: 15px; }
.sp-up { color: var(--red); }
.sp-down { color: var(--green); }
.sp-muted { color: var(--text-muted); }
.sp-day-note {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-light);
  padding: 6px 12px;
  font-size: 13px;
  margin-bottom: 8px;
  border-radius: 0 4px 4px 0;
  color: var(--text-secondary);
}
.sp-tbl-wrap { overflow-x: auto; }
.sp-tbl { min-width: 640px; }
.sp-tbl td, .sp-tbl th { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
.sp-code { font-family: Consolas, monospace; color: var(--text-muted); }
.sp-reason { white-space: normal !important; min-width: 160px; color: var(--text-secondary); }
.sp-added { color: var(--text-muted); font-size: 12px; }
.sp-del-btn {
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px;
}
.sp-del-btn:hover { color: var(--red); background: #fdecea; }
.sp-del-cell { text-align: center; width: 40px; }
.sp-day-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 6px; font-size: 12px; flex-wrap: wrap;
}

/* ===== 选股池 · 短线/长期双池 ===== */
.sp-pool-switch {
  display: inline-flex;
  gap: 8px;
  margin: 2px 0 10px;
}
.sp-switch-btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
}
.sp-switch-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.sp-switch-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.sp-sec { margin: 10px 0 4px; }
.sp-sec + .sp-sec { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sp-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.sp-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
}
.sp-badge-short { background: #e65100; }   /* 短线：橙红 */
.sp-badge-long { background: #1a237e; }    /* 长期：数据蓝 */
