:root {
  --bg: #0f1419; --panel: #171d26; --card: #1e2632; --line: #2a3441;
  --text: #e6edf3; --muted: #8b98a9; --accent: #4f9cf9; --green: #3fb950;
  --red: #f85149; --amber: #d29922;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
header h1 { font-size: 18px; margin: 0; }
.meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; }
button {
  background: var(--accent); color: #fff; border: 0; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
button:hover { opacity: .9; }
nav#tabs { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--panel); }
.tab {
  background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 8px 14px;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
main { padding: 20px; }
.panel { display: none; }
.panel.active { display: block; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; min-width: 150px; flex: 1;
}
.card .label { color: var(--muted); font-size: 12px; }
.card .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.chart-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.chart-box h3, .panel > h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.chart-box canvas { max-height: 300px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--card); }
tr:hover td { background: #222c3a; }
.reports { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reports button { background: #283242; }
.report-view pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5;
}
.empty { color: var(--muted); padding: 16px; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge.sim { background: #1f6feb33; color: #6cb6ff; }
.badge.manual { background: #d2992233; color: #e3b341; }
.badge.pending { background: #d2992233; color: #e3b341; }
.badge.done { background: #23863633; color: #3fb950; }
.badge.no_trade { background: #484f5833; color: #8b98a9; }
.badge.empty { background: #484f5833; color: #8b98a9; }

.ops-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px;
}
.ops-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.ops-head h4 { margin: 0; font-size: 15px; flex: 1; min-width: 200px; }
.ops-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.ops-summary { font-size: 13px; margin-bottom: 12px; padding: 8px 12px; background: #0f1419; border-radius: 6px; }
.panel-desc { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.side-buy { color: var(--red); font-weight: 600; }
.side-sell { color: var(--green); font-weight: 600; }
.ops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .ops-grid { grid-template-columns: 1fr; } }
.ops-grid h5 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.lvl-CRIT { color: var(--red); } .lvl-WARN { color: var(--amber); } .lvl-INFO { color: var(--muted); }

.indices-strip .card { min-width: 130px; cursor: pointer; }
td.clickable { color: var(--accent); cursor: pointer; }
td.clickable:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 30px 12px; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  width: min(900px, 96vw); padding: 18px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#sm-title { font-size: 17px; font-weight: 600; }
#sm-close { background: #283242; }
.sm-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.sm-meta .big { font-size: 22px; font-weight: 600; }
.sm-controls { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; color: var(--muted); }
.klt-btn { background: #283242; padding: 4px 10px; }
.klt-btn.active { background: var(--accent); }

/* -------- 舆情跟踪 -------- */
.btn-secondary { background: #283242; }
.sent-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  align-items: flex-start; margin-bottom: 16px;
}
.sent-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.sent-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sent-updated { color: var(--muted); font-size: 12px; }
.sent-progress {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 14px;
}
.sent-progress.hidden { display: none; }
.sent-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 13px;
}
#sent-progress-label { font-weight: 600; }
#sent-progress-pct { color: var(--accent); font-variant-numeric: tabular-nums; }
.sent-progress-track {
  height: 8px; background: #0f1419; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
}
.sent-progress-bar {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: 999px; transition: width .35s ease;
}
.sent-progress-msg {
  margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sent-progress.done .sent-progress-bar { background: var(--green); }
.sent-progress.error .sent-progress-bar { background: var(--red); }
.sent-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start;
}
@media (max-width: 900px) { .sent-layout { grid-template-columns: 1fr; } }
.sent-side {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; position: sticky; top: 12px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
}
.sent-side-head {
  padding: 12px 14px; color: var(--muted); font-size: 12px;
  border-bottom: 1px solid var(--line); letter-spacing: .04em; text-transform: uppercase;
}
.sent-lookup {
  display: flex; gap: 6px; padding: 10px 10px 6px; border-bottom: 1px solid var(--line);
}
.sent-lookup input {
  flex: 1; min-width: 0; background: #0f1419; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 13px;
}
.sent-lookup input:focus { outline: none; border-color: var(--accent); }
.sent-lookup button { background: var(--accent); padding: 7px 12px; white-space: nowrap; }
.sent-list { overflow-y: auto; padding: 6px; }
.sent-item {
  display: block; width: 100%; text-align: left; background: transparent;
  color: var(--text); border: 0; border-radius: 8px; padding: 10px 12px; margin-bottom: 4px;
}
.sent-item:hover { background: #222c3a; }
.sent-item.active { background: #1f6feb22; outline: 1px solid #4f9cf955; }
.sent-item .code { font-weight: 600; font-size: 13px; }
.sent-item .name { color: var(--muted); font-size: 12px; margin-left: 6px; }
.sent-item .snip { color: var(--muted); font-size: 12px; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sent-item .pill {
  display: inline-block; margin-top: 6px; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; background: #484f5833; color: var(--muted);
}
.sent-item .pill.positive { background: #23863633; color: var(--green); }
.sent-item .pill.negative { background: #f8514933; color: var(--red); }
.sent-item .pill.mixed { background: #d2992233; color: var(--amber); }
.sent-main { min-width: 0; }
.sent-hero {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 12px;
}
.sent-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.sent-name { font-size: 20px; font-weight: 600; }
.sent-headline { color: var(--muted); margin-top: 6px; font-size: 14px; line-height: 1.5; max-width: 52rem; }
.sent-score-box {
  min-width: 110px; text-align: right; padding: 8px 12px;
  background: #0f1419; border-radius: 8px;
}
.sent-score-box .value { font-size: 28px; font-weight: 700; margin-top: 2px; }
.sent-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sent-tags .tag {
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: #f8514922; color: #ff7b72; border: 1px solid #f8514944;
}
.sent-chart-box canvas { max-height: 260px; height: 240px !important; }
.sent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .sent-grid { grid-template-columns: 1fr; } }
.sent-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.sent-block h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 500; }
.sent-summary { margin: 0 0 16px; line-height: 1.7; font-size: 14px; white-space: pre-wrap; }
.sent-ul { margin: 0; padding-left: 18px; color: var(--text); line-height: 1.7; }
.sent-ul li { margin-bottom: 4px; }
.sent-meta { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.impact-利多 { color: var(--red); }
.impact-利空 { color: var(--green); }
.hidden { display: none !important; }
.badge.peak { background: #d2992233; color: #e3b341; }
.badge.offpeak { background: #1f6feb33; color: #6cb6ff; }
.badge.demo { background: #484f5844; color: #8b98a9; border: 1px solid #484f58; }

/* -------- 短线猎手 -------- */
.muted-tag { color: var(--muted); font-size: 12px; font-weight: 400; }
.swing-grid {
  display: grid; grid-template-columns: 1fr min(420px, 40vw); gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .swing-grid { grid-template-columns: 1fr; } }

/* 日报 / 评测文档 */
.swing-doc-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; max-height: 520px; overflow-y: auto;
}
.swing-eval-wrap { max-height: 640px; }
.swing-report-meta { margin-bottom: 10px; }
.swing-meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.swing-doc-head { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.swing-doc-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.swing-doc-sub { color: var(--muted); font-size: 12px; line-height: 1.5; }
.swing-section { margin-bottom: 16px; }
.swing-section:last-child { margin-bottom: 0; }
.swing-section-title {
  margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.swing-summary-chips { display: flex; gap: 10px; margin-bottom: 8px; }
.swing-sum-chip {
  flex: 1; text-align: center; padding: 10px 8px; border-radius: 8px;
  background: #0f1419; border: 1px solid var(--line);
}
.swing-sum-chip .n { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; }
.swing-sum-chip .l { font-size: 11px; color: var(--muted); }
.swing-sum-chip.predict .n { color: var(--green); }
.swing-sum-chip.watch .n { color: var(--amber); }
.swing-sum-chip.reject .n { color: var(--muted); }

.swing-gate-panel {
  background: #0f1419; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px;
}
.swing-gate-panel.flat { margin-bottom: 0; }
.swing-gate-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.swing-gate-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.swing-gate-line { font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.swing-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: #283242; color: var(--text); border: 1px solid var(--line);
}
.swing-chip.applied { background: #1f6feb22; border-color: #4f9cf955; color: #6cb6ff; }
.swing-chip.warn { background: #d2992233; color: #e3b341; border-color: #d2992255; }
.swing-chip.muted { background: transparent; color: var(--muted); border-color: #2a3441; }

.swing-pick-grid { display: flex; flex-direction: column; gap: 10px; }
.swing-pick-grid.compact .swing-pick-card { padding: 10px 12px; }
.swing-pick-card {
  background: #0f1419; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; transition: border-color .15s;
}
.swing-pick-card:hover { border-color: #4f9cf955; }
.swing-pick-card.action-predict { border-left: 3px solid var(--green); }
.swing-pick-card.action-watch { border-left: 3px solid var(--amber); }
.swing-pick-card.action-reject { border-left: 3px solid #484f58; }
.swing-pick-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 8px;
}
.swing-pick-ident { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.swing-pick-code { font-weight: 700; font-size: 14px; color: var(--accent); }
.swing-pick-name { font-size: 13px; color: var(--text); }
.swing-pick-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swing-pick-score {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.swing-pick-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.swing-pick-tagline { font-size: 12px; margin-bottom: 4px; line-height: 1.45; }
.swing-pick-tagline.pos-tag { color: #ff7b72; }
.swing-pick-tagline.risk-tag { color: var(--amber); }
.swing-pick-reasons {
  margin: 6px 0 0; padding-left: 16px; font-size: 13px; line-height: 1.55;
  color: var(--text);
}
.swing-pick-reasons li { margin-bottom: 3px; }
.swing-pick-materials {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
}
.swing-mat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.swing-mat-item {
  font-size: 11px; color: var(--muted); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swing-table-wrap { margin: 0; border: 0; background: transparent; }
.swing-table-wrap table { font-size: 12px; }
.swing-table-wrap th { font-size: 11px; }
.swing-table-wrap .sw-reason-cell,
.swing-table-wrap td.sw-reason-cell {
  text-align: left; white-space: normal; max-width: 140px;
  line-height: 1.4; font-size: 11px;
}
.swing-eval-summary {
  margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.6; color: var(--muted);
}
.swing-eval-summary li { margin-bottom: 4px; }
.sw-code {
  background: #283242; padding: 1px 5px; border-radius: 4px; font-size: 11px;
}

.swing-md pre {
  max-height: 420px; overflow-y: auto; margin: 0;
}
.swing-md h1, .swing-md h2, .swing-md h3 { margin: 12px 0 8px; font-size: 14px; }
.swing-md p, .swing-md li { font-size: 13px; line-height: 1.55; color: var(--text); }
.swing-detail-box { width: min(760px, 96vw); }
.sw-detail-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.55;
}
.delta-card { border-bottom: 1px solid var(--line); padding: 8px 0; }
.delta-card:last-child { border-bottom: 0; }
.delta-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.delta-date { color: var(--muted); font-size: 12px; }
.truncate-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.sent-select {
  background: #283242; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
