:root {
  --bg: #0c1118;
  --panel: #141b25;
  --panel2: #10161f;
  --line: #26303e;
  --text: #e9eff7;
  --muted: #8fa0b5;
  --red: #ef5350;
  --green: #2fb8a4;
  --gold: #f0c453;
  --blue: #5b9dff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.layout { display: flex; gap: 16px; max-width: 1600px; margin: 0 auto; padding: 16px; align-items: flex-start; }

.sidebar {
  flex: 0 0 300px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.brand { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.addbar { display: flex; gap: 6px; }
.addbar input {
  flex: 1;
  min-width: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}
.addbar input:focus { border-color: var(--blue); }
button {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 7px 11px;
  cursor: pointer;
}
button.primary { background: #234d83; border-color: #3c73b8; white-space: nowrap; }
button:hover { border-color: #53647c; }
button:disabled { opacity: .55; cursor: wait; }
.side-tools { display: flex; gap: 6px; margin: 8px 0 4px; }
.side-tools button { flex: 1; font-size: 12px; }
.msg { min-height: 18px; font-size: 12px; color: var(--muted); margin: 5px 0; }
.msg.err { color: #ff9d8a; }
.stock-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: var(--panel2);
}
.stock-item:hover { border-color: #52667f; }
.stock-item.active { border-color: var(--blue); background: #18283d; }
.stock-item .si-main { flex: 1; min-width: 0; }
.stock-item .code { font-size: 13px; font-weight: 600; }
.stock-item .nm { color: var(--muted); font-size: 12px; }
.stock-item .rm {
  background: transparent; border: 0; color: var(--muted); font-size: 14px;
  padding: 0 3px; cursor: pointer;
}
.stock-item .rm:hover { color: #ff9d8a; }
.stock-item .alert {
  background: transparent; border: 0; color: var(--muted); font-size: 16px;
  padding: 0 3px; cursor: pointer; line-height: 1;
}
.stock-item .alert:hover { color: var(--gold); }
.stock-item .alert.on { color: var(--gold); text-shadow: 0 0 7px rgba(240, 196, 83, .65); }
.stock-item .st { color: var(--muted); font-size: 11px; }
.stock-item.busy { opacity: .65; }

.main { flex: 1; min-width: 0; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 90px 20px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 14px;
  line-height: 2;
}
.muted { color: var(--muted); }

.stock-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.stock-head h2 { margin: 0; font-size: 22px; }
.stock-head .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.stock-head .price { font-size: 26px; font-weight: 600; }

.modebar { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-btn {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.mode-btn.active { background: #2a415f; border-color: #4b7fc1; color: #fff; }

.realtime-panel .status-bar {
  color: var(--muted); font-size: 13px; margin-bottom: 10px;
  padding: 8px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
}
.realtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.rt-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.rt-card .k { color: var(--muted); font-size: 11px; }
.rt-card .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
.rt-card.buy { border-color: #477a5a; }
.rt-card.sell { border-color: #7a4b4d; }
.rt-card.buy .v { color: var(--red); }
.rt-card.sell .v { color: var(--green); }
.realtime-signals { margin-top: 10px; }
.signal-table-wrap { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.realtime-signals table { width: 100%; border-collapse: collapse; font-size: 13px; }
.realtime-signals th, .realtime-signals td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.realtime-signals th {
  color: var(--muted); font-weight: 400;
  position: sticky; top: 0; background: var(--panel); z-index: 1;
}

.fund-sec { margin: 14px 0; overflow-x: auto; }
.fund-sec h4 {
  margin: 14px 0 6px;
  font-size: 14px;
  border-left: 3px solid var(--blue);
  padding-left: 8px;
}
.fund-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12.5px; }
.fund-table th, .fund-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fund-table th { color: var(--muted); font-weight: 400; }
.empty-hint { color: var(--muted); padding: 18px 0; }

.zhen-panel .zhen-block {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 2;
}
.zhen-panel .zhen-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--gold);
}
.zhen-panel .zhen-quote {
  background: #1d1720;
  border: 1px solid #51395a;
  border-radius: 10px;
  padding: 12px 14px;
  color: #e5d8ec;
}
.zhen-panel .tag-line { color: var(--muted); font-size: 12px; margin-top: 8px; }
.zhen-panel .risk-note { color: var(--muted); font-size: 12px; margin-top: 12px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.sec-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  border-left: 4px solid var(--blue);
  padding-left: 10px;
}

.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.stat .k { color: var(--muted); font-size: 11px; }
.stat .v { font-size: 15px; font-weight: 600; }
.up { color: var(--red); }
.down { color: var(--green); }

.chips { margin: 10px 0 4px; }
.chip {
  display: inline-block;
  background: #223349;
  color: #bcd7ff;
  border: 1px solid #39557d;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  margin: 2px 6px 2px 0;
}
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 8px; }
.chart-tabs button { font-size: 12px; border-radius: 999px; padding: 5px 12px; }
.chart-tabs button.active { background: #2a415f; border-color: #4b7fc1; }
.chart { overflow-x: auto; }
.chart svg { display: block; min-width: 880px; width: 100%; height: auto; }
.levels { margin-top: 8px; overflow-x: auto; }
.levels table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.levels th, .levels td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.levels th { color: var(--muted); font-weight: 400; }
.report-conc {
  background: #182233;
  border: 1px solid #38506f;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.report-conc .lead { color: var(--gold); font-size: 12px; letter-spacing: 2px; }
.report h4 {
  font-size: 14px; margin: 18px 0 8px; font-weight: 600;
  border-left: 3px solid var(--gold); padding-left: 8px;
}
.report-fig {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 4px;
  margin: 10px 0;
  overflow-x: auto;
}
.report-fig .cap { color: var(--muted); font-size: 12px; margin: 3px 4px 6px; }
.report-fig svg { display: block; min-width: 720px; width: 100%; height: auto; }
.report-fig img { display: block; width: 100%; border-radius: 8px; }
.report p { margin: 8px 0; color: #d9e3ee; }
.report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th, .report td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.report th { color: var(--muted); font-weight: 400; }
.report .macd-table { min-width: 560px; }
.report ul { margin: 6px 0; padding-left: 18px; }
.report li { margin: 3px 0; }
.warn {
  border: 1px solid #8a5a2b;
  background: #241a12;
  border-radius: 9px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 13px;
}
code { background: #0a0f16; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: #bcd7ff; }
.foot { color: #5d6d82; font-size: 12px; text-align: center; margin: 16px 0 0; }
.empty-inner { color: var(--muted); padding: 40px 0; text-align: center; }

/* PushPlus 微信推送设置弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  margin-bottom: 8px;
}
.modal-head button {
  background: transparent;
  border: 0;
  font-size: 20px;
  color: var(--muted);
  padding: 0 6px;
}
.push-intro { margin: 4px 0 12px; }
.push-field {
  display: block;
  margin: 8px 0 10px;
}
.push-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.push-field input {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  font-size: 13px;
}
.push-field textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.7;
}
.push-field input:focus { border-color: var(--blue); }
.push-field textarea:focus { border-color: var(--blue); }
.push-field .small { margin-top: 4px; }
.push-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  cursor: pointer;
}
.push-codes { font-size: 12px; margin: 6px 0; }
.push-codes b { color: var(--text); font-weight: 500; }
.push-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
}
.push-help {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
}
.push-help .help-title { color: var(--gold); margin-bottom: 6px; }
.push-help ol { margin: 0; padding-left: 18px; }
.push-help li { margin: 3px 0; }
.push-help a { color: var(--blue); }
.cmd-line {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  background: #0a0f16;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #bcd7ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  overflow-x: auto;
  white-space: nowrap;
}
.small { font-size: 12px; margin-top: 8px; }

.beian-foot {
  text-align: center;
  color: #5d6d82;
  font-size: 12px;
  padding: 10px 16px 18px;
  line-height: 1.9;
}
.beian-foot a { color: #6f8299; text-decoration: none; }
.beian-foot a:hover { color: #bcd7ff; text-decoration: underline; }
.beian-sep { margin: 0 6px; color: #3d4a5b; }

@media (max-width: 900px) {
  .layout { flex-direction: column; align-items: stretch; }
  .sidebar { position: static; max-height: none; flex: none; width: 100%; }
  .main { flex: none; width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
  #content, #content > .panel { max-width: 100%; min-width: 0; }
  .panel { overflow-x: hidden; }
  .stock-list { flex-direction: row; flex-wrap: wrap; }
  .stock-item { min-width: 220px; }
}

@media (max-width: 700px) {
  html, body { font-size: 13px; }
  .layout { padding: 8px; gap: 10px; }
  .sidebar { padding: 10px; border-radius: 12px; }
  .brand { font-size: 17px; margin-bottom: 8px; }
  .addbar { flex-wrap: nowrap; }
  .addbar input { font-size: 14px; padding: 8px 8px; }
  .side-tools { flex-wrap: wrap; }
  .msg { font-size: 11px; }

  .stock-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .stock-item { flex: 0 0 auto; min-width: 142px; }
  .stock-item .st { display: none; }
  .stock-item .nm {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stock-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
  }
  .stock-head h2 { font-size: 18px; }
  .stock-head .price { font-size: 21px; }

  .modebar { margin-bottom: 10px; }
  .modebar { overflow-x: auto; }
  .mode-btn { flex: 1; padding: 8px 8px; font-size: 13px; white-space: nowrap; }
  .panel { padding: 12px; border-radius: 12px; }
  .sec-title { font-size: 15px; }

  .quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 6px 8px; }
  .stat .k { font-size: 10px; }
  .stat .v { font-size: 13px; }

  .chip { font-size: 11px; padding: 2px 8px; }
  .chart svg { min-width: 0; }
  .chart { margin: 0 -4px; padding: 6px 4px; }
  .chart-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .chart-tabs button { flex: 0 0 auto; }

  .realtime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .rt-card { padding: 7px 9px; }
  .rt-card .v { font-size: 15px; }
  .realtime-panel .status-bar { font-size: 11px; }
  .report-fig { padding: 5px 5px 2px; }
  .report-fig svg { min-width: 0; }

  .levels, .realtime-signals { overflow-x: auto; }
  .levels table, .realtime-signals table { min-width: 0; }
  .signal-table-wrap { max-height: 60vh; }
  .report table { min-width: 0; }
  .report h4 { font-size: 13px; }
}

@media (max-width: 380px) {
  .sidebar { padding: 8px; }
  .stock-item { min-width: 128px; }
  .quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-btn { font-size: 12px; padding: 7px 4px; }
  .chart svg { min-width: 0; }
  .report-fig svg { min-width: 0; }
}
