:root {
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --up: #e74c3c;
  --down: #2ecc71;
  --border: #e0e0e0;
  --hover: #f0f7ff;
  --active: #dbeafe;
  --focus: #3b82f6;
  --chart-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-color: #2c3e50;
  --btn-border: #d1d5db;
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #c1c1c1;
}

body.dark {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #cbd5e1;
  --up: #ff6b6b;
  --down: #51cf66;
  --border: #0f172a;
  --hover: #1e293b;
  --active: #334155;
  --focus: #60a5fa;
  --chart-bg: #1e293b;
  --btn-bg: #1e293b;
  --btn-color: #cbd5e1;
  --btn-border: #475569;
  --scrollbar-track: #1e293b;
  --scrollbar-thumb: #475569;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
}


.sidebar {
  width: 320px;
  flex-shrink: 0; /* 左侧股票列表固定宽，窗口缩小时压缩图表区而不是压缩列表 */
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.search-box {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.search-box input:focus {
  border-color: var(--focus);
}

.search-box .theme-btn {
  padding: 8px 12px;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-color);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
.search-box .theme-btn:hover {
  border-color: var(--focus);
}

.search-box .clear-btn {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: none;
  width: 20px;
  height: 20px;
  justify-content: center;
  align-items: center;
}

.search-box .clear-btn.visible {
  display: flex;
}

.search-hint {
  padding: 4px 12px 10px;
  font-size: 12px;
  color: #94a3b8;
}

.stock-table-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.stock-table-wrap::-webkit-scrollbar {
  width: 8px;
}

.stock-table-wrap::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.stock-table-wrap::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stock-table th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  z-index: 1;
}

.stock-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.stock-table tr:hover td {
  background: var(--hover);
}

.stock-table tr.active td {
  background: var(--active) !important;
}

.price {
  font-weight: 600;
}

.main {
  flex: 1;
  min-width: 0; /* 嵌套 flex 链关键：body(flex) > .main > .main-content > .chart-container 每一层都要放行，否则窗口缩小时整条链卡在旧宽度，右侧栏被挤出屏幕 */
  display: flex;
  flex-direction: column;
}

.chart-header {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  min-height: 52px;
  box-sizing: border-box;
}

.chart-header h2 {
  font-size: 18px;
  margin: 0;
}

#chartTitle {
  /* v1.0.466：标题定宽占位（按最长标题「平安银行 (000001) 2026-09-23 实时行情」≈345px 取 360px）——
     占位「请选择股票」阶段就占住最终宽度，价格区/按钮组的起点全程不动（修价格区跳来跳去） */
  min-width: 360px;
  white-space: nowrap;
}

.price-info {
  font-size: 14px;
  color: #2c3e50;
  white-space: nowrap; /* v1.0.465：价格文字加载时不内部折行 */
  /* v1.0.466：定宽占位——空态阶段就预留「最新价 11.71 ｜ 涨跌幅 -0.17%」的宽度（实测≈192px），
     行情加载填充时按钮组起点不位移 */
  min-width: 200px;
}

.indicator-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  visibility: hidden;
  /* v1.0.466【用户定版】：按钮组不再钉最右，改为**紧跟价格区靠左排列**（在「涨跌幅」后面）。
     稳定性由 #chartTitle / .price-info 的 min-width 定宽占位保证：标题/价格加载变宽时
     占位宽度不变 → 按钮组起点全程不动。flex:0 0 auto 防自身被压缩。 */
  flex: 0 0 auto;
}
.indicator-btns.visible {
  visibility: visible;
}

.ind-btn,
.theme-btn,
.ma-set-btn {
  padding: 4px 12px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.ind-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.period-toggle {
  display: flex;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.period-btn {
  padding: 4px 12px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.period-btn.active {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.ma-set-btn {
  margin-left: 6px;
  font-size: 14px;
}

.chart-container {
  flex: 1;
  min-width: 0; /* 关键：允许容器随窗口收缩，否则 ECharts 固定 px 画布会把右侧栏挤出屏幕 */
  background: var(--chart-bg);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal {
  position: relative; /* v1.0.294：modal-close 绝对定位锚点 */
  background: var(--card-bg);
  color: var(--text);
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  min-width: 300px;
}

/* v1.0.294：弹窗右上角 × 关闭按钮（此前只在 settings.html 定义，首页裸排在左上角） */
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; line-height: 26px; padding: 0; margin: 0;
  font-size: 22px; color: #666; background: transparent;
  border: 0; border-radius: 50%; cursor: pointer; font-weight: 300;
}
.modal-close:hover { background: rgba(128,128,128,0.18); }
body.dark .modal-close { color: #a8b2bf; }
body.dark .modal-close:hover { background: rgba(255,255,255,0.12); }

.modal input {
  width: 100%;
  padding: 8px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 6px 12px;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-color);
}

/* ===== v1.0.700 券商同步选择面板 ===== */
.broker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}
.broker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.broker-item:hover { border-color: var(--focus); background: var(--hover); }
.broker-item input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--focus);
  cursor: pointer;
  flex-shrink: 0;
}
.broker-name { flex: 1; font-size: 14px; font-weight: 500; }
.broker-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.6;
  background: rgba(96, 165, 250, .15);
  color: var(--focus);
  border: 1px solid rgba(96, 165, 250, .3);
  white-space: nowrap;
}
.broker-tag.tag-independent {
  background: rgba(251, 191, 36, .15);
  color: #d97706;
  border-color: rgba(251, 191, 36, .35);
}
.broker-tag.tag-common {
  background: rgba(148, 163, 184, .18);
  color: #64748b;
  border-color: rgba(148, 163, 184, .35);
}
.broker-tag.tag-tonghuashun {
  background: rgba(16, 185, 129, .15);
  color: #059669;
  border-color: rgba(16, 185, 129, .35);
}
.broker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}
.broker-all { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.broker-all input { width: 16px; height: 16px; accent-color: var(--focus); }
.broker-count { font-size: 12px; opacity: .8; }
.modal-actions .broker-start {
  background: #1e3c72;
  color: #fff;
  border: 1px solid #1e3c72;
  border-radius: 4px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
}
.modal-actions .broker-start:hover { background: #274b8f; }
body.dark .modal-actions .broker-start { background: #2563eb; border-color: #2563eb; }
body.dark .modal-actions .broker-start:hover { background: #1d4ed8; }

/* ===== 持仓工具栏主按钮（一键同步 / 账户管理） ===== */
#hdSyncBtn:hover { background: #274b8f; border-color: #274b8f; }
#hdAccountBtn:hover { background: #115e59; border-color: #115e59; }

/* ===== 账户管理面板（v1.0.7xx） ===== */
.acct-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.acct-input {
  flex: 0 1 30%;
  min-width: 110px;
  padding: 7px 10px;
  border: 1px solid var(--btn-border, #cbd5e1);
  border-radius: 5px;
  background: var(--input-bg, #fff);
  color: var(--text, #1f2937);
  font-size: 13px;
}
.acct-input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .18);
}
.acct-add-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid #0f766e;
  border-radius: 5px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.acct-add-btn:hover { background: #115e59; }
.acct-edit-hint {
  font-size: 12px;
  color: var(--text);
  opacity: .8;
  margin: -4px 0 10px;
  padding: 6px 10px;
  background: rgba(15, 118, 110, .1);
  border: 1px dashed rgba(15, 118, 110, .4);
  border-radius: 5px;
}
.acct-cancel-btn {
  margin-left: 8px;
  padding: 2px 10px;
  border: 1px solid var(--btn-border, #cbd5e1);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.acct-list-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  opacity: .7;
  margin: 4px 0 8px;
  border-bottom: 1px solid var(--btn-border, #e2e8f0);
  padding-bottom: 5px;
}
.acct-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--btn-border, #e2e8f0);
  border-radius: 6px;
  background: var(--input-bg, #fff);
}

/* 拖动排序 */
.acct-drag {
  cursor: grab;
  color: var(--text, #334155);
  opacity: .45;
  font-size: 14px;
  margin-right: 8px;
  user-select: none;
  flex: none;
}
.acct-row[draggable="true"] { cursor: grab; }
.acct-row.acct-dragging { opacity: .35; }
.acct-row.acct-drag-over { border-top: 2px solid #0f766e; }
.acct-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.acct-info { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; justify-content: flex-start; }
.acct-broker {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(15, 118, 110, .12);
  white-space: nowrap;
}
.acct-user {
  font-size: 13px;
  color: var(--text);
  opacity: .85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-ops { display: flex; gap: 4px; flex: 0 0 auto; }
/* v1.0.665：聚合账户标签（同花顺等聚合账号行） */
.acct-agg-tag {
  flex: 0 0 auto;
  font-size: 11px;
  color: #5b6b8c;
  border: 1px solid #5b6b8c;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
/* v1.0.669：聚合成员勾选行样式全部内联在 JS 里生成（此前 class 选择器与 id 不匹配导致外部 CSS 失效） */
/* v1.0.661：总资产/可用资金（账户管理行右侧，同步自券商APP） */
.acct-asset {
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 10px;
  text-align: right;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text, #334155);
  opacity: .72;
  white-space: nowrap;
}
.acct-ops button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--btn-border, #e2e8f0);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.acct-ops .acct-edit:hover { background: rgba(15, 118, 110, .14); border-color: #0f766e; }
.acct-ops .acct-del:hover { background: rgba(231, 76, 60, .12); border-color: #e74c3c; color: #e74c3c; }
.acct-empty {
  font-size: 12px;
  color: var(--text);
  opacity: .5;
  text-align: center;
  padding: 14px 0;
}
body.dark .acct-broker { background: rgba(45, 212, 191, .18); color: #5eead4; }
body.dark .acct-input { background: #0d1117; border-color: #30363d; }
body.dark .acct-row { background: #0d1117; border-color: #30363d; }
body.dark .acct-list-head { border-color: #30363d; }

/* ===== 图表设置弹窗（K线均线 / 成交量均线 / 分时图样式） ===== */
.ma-chip {
  padding: 5px 11px; font-size: 12px; cursor: pointer;
  background: var(--hover); color: var(--text);
  border: 1px solid transparent; border-radius: 16px;
}
.ma-chip:hover { border-color: var(--focus); }
.style-card {
  position: relative; cursor: pointer; border: 1.5px solid var(--border);
  border-radius: 9px; padding: 11px 12px; background: var(--bg);
  transition: border-color .15s, background .15s;
}
.style-card:hover { border-color: var(--focus); }
.style-card.active { border-color: var(--focus); background: var(--active); }
.style-card .sc-name { font-size: 13px; font-weight: 600; }
.style-card .sc-tag { font-size: 11px; color: #8a94a6; margin-top: 3px; }
.style-card .sc-swatch { height: 22px; border-radius: 4px; margin-top: 9px; display: flex; align-items: flex-end; gap: 2px; overflow: hidden; }
.style-card .sc-check {
  position: absolute; top: 8px; right: 9px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--focus); color: #fff; font-size: 12px;
  display: none; align-items: center; justify-content: center;
}
.style-card.active .sc-check { display: flex; }

.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.view-btn {
  padding: 6px 16px;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 12px;
}

.view-btn.active {
  background: var(--focus);
  color: #fff;
  border-color: var(--focus);
}

.ind-select {
  padding: 6px 12px;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.ind-select:focus {
  border-color: var(--focus);
}
.ind-select option {
  background: var(--card-bg);
  color: var(--text);
}

.view-switch-btn {
  padding: 5px 14px;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.view-switch-btn:hover {
  border-color: var(--focus);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.indicator-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.indicator-btns.hidden { display: none; }

.main-content {
  flex: 1;
  min-width: 0; /* 同上：flex 链逐层放行 */
  display: flex;
  overflow: hidden;
}

.realtime-left {
  flex: 1;
  min-width: 0; /* 同上：允许收缩，防止把右侧栏挤出屏幕 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.sub-chart-container {
  flex: 1;
  background: var(--chart-bg);
  border-radius: 8px;
  min-height: 200px;
}

.realtime-right {
  width: 280px;
  flex-shrink: 0; /* 右侧盘口栏固定宽，空间不足时压缩图表区而不是压缩盘口 */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.stock-info-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: #2c3e50;
  font-size: 13px;
}

.info-row .value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.info-row .price-value {
  font-size: 18px;
  font-weight: 600;
}

/* 详情弹窗盘口面板：现价/涨跌 + 双列紧凑网格 */
.ob-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.ob-price-label {
  font-size: 12px;
  color: #2c3e50;
  white-space: nowrap;
}
.ob-price {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.ob-chg {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
}
.ob-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1px 0;
}
.ob-cell-strong .ob-val {
  font-weight: 600;
}
.ob-label {
  color: #2c3e50;
  font-size: 11px;
  white-space: nowrap;
}
.ob-val {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ob-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.order-book {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

.order-book-header {
  padding: 8px 12px;
  background: var(--bg);
  font-size: 12px;
  color: #2c3e50;
  border-bottom: 1px solid var(--border);
}

.sell-orders,
.buy-orders {
  padding: 4px 8px;
}

.order-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  gap: 6px 12px;
  align-items: center;
  padding: 4px 8px;
  font-size: 12px;
}

.order-row.active {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 4px;
  font-weight: 500;
}

.order-label {
  font-size: 12px;
  color: #2c3e50;
  text-align: left;
  white-space: nowrap;
}

.sell-orders .order-price {
  color: var(--up);
  text-align: right;
}

.buy-orders .order-price {
  color: var(--down);
  text-align: right;
}

.order-vol {
  color: #2c3e50;
  text-align: right;
  min-width: 36px;
}

.order-divider {
  height: 3px;
  width: 100%;
  background: linear-gradient(to right, var(--up) 0 48%, transparent 48% 52%, var(--down) 52% 100%);
  margin: 2px 0;
  border-radius: 2px;
}

.minute-deals {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.deals-header {
  padding: 8px 12px;
  background: var(--bg);
  font-size: 12px;
  color: #2c3e50;
  border-bottom: 1px solid var(--border);
}

.deals-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.deal-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 11px;
}

.deal-row.header {
  font-weight: 600;
  background: var(--bg);
  color: #2c3e50;
}

.deal-row span {
  flex: 1;
  text-align: center;
}

.deal-row span:first-child {
  text-align: left;
}

.deal-row span:last-child {
  text-align: right;
}

.deal-row.up {
  color: var(--up);
}

.deal-row.down {
  color: var(--down);
}

.indicator-btns.hidden {
  display: none;
}

/* === 自选 Tab 样式 === */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--card-bg);
}
.tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--focus);
  font-weight: 600;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--focus);
  border-radius: 2px 2px 0 0;
}
.star-cell {
  transition: transform 0.15s, color 0.15s;
  user-select: none;
}
.star-cell:hover {
  transform: scale(1.3);
}


/* v1.0.131：分析工具条 4 按钮重设计 —— 统一尺寸 + 低饱和柔色描边风（替代原高饱和实色渐变） */
/* v1.0.182：宽度 140→112px（-20%） */
/* v1.0.187：配色整套换成参考图糖果三色 —— AI 分析=紫 / 免费资源=蓝 / 查看报告=绿
   底/边/字三色均取自参考图实测像素（底色取众数、边框取按钮外缘核心行、文字取笔画最暗像素中位）：
   紫 #dcd6fc / #ae9fe0 / #4c2389　蓝 #bedbfd / #82acdd / #223a82　绿 #bbf7d1 / #7ad29a / #15543a */
/* v1.0.188：「免费资源」与「查看报告」互换配色 —— 免费资源=绿 / 查看报告=蓝（紫不变） */
.analysis-btn {
  width: 112px;
  height: 32px;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1px solid #ae9fe0;
  background: #dcd6fc;
  color: #4c2389;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  margin-left: 6px;
}
.analysis-btn:hover { background: #cac0f1; box-shadow: 0 2px 10px rgba(174,159,224,0.45); }
.analysis-btn:active { transform: translateY(1px); }
.analysis-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* 🆓 AI 分析 —— 紫（与基类同色，显式声明便于日后单独调整） */
.free-analysis-btn { border-color: #ae9fe0; background: #dcd6fc; color: #4c2389; }
.free-analysis-btn:hover { background: #cac0f1; box-shadow: 0 2px 10px rgba(174,159,224,0.45); }
/* 📚 免费资源 —— 绿（v1.0.188：与「查看报告」互换配色） */
.resource-btn { border-color: #7ad29a; background: #bbf7d1; color: #15543a; }
.resource-btn:hover { background: #a1e8bb; box-shadow: 0 2px 10px rgba(122,210,154,0.45); }
/* 📋 查看报告 —— 蓝（v1.0.188：与「免费资源」互换配色） */
.report-btn { border-color: #82acdd; background: #bedbfd; color: #223a82; }
.report-btn:hover { background: #a6c8f0; box-shadow: 0 2px 10px rgba(130,172,221,0.45); }
/* ===== v1.0.761：图表头部强制单行（保留完整内容，只压缩尺寸） =====
   字号完全固定为 v1.0.738 原值：标题18/价格14/下拉13/周期12/设置14/彩色按钮13px、按钮高29px。
   权威规则在 app.js 的 injectAdaptiveHeader 运行时注入（仅间距分档自适应，绕开扩展缓存）；
   index.html 内联样式与此处均为静态兜底，间距取中间档（gap9/px10/bpx7）；保留强行与 11.5px 上下留白；min-height 52px。 */
.btn-short { display: none; }
.chart-header {
  flex-wrap: nowrap; gap: 13px; padding: 11.5px 10px; min-height: 52px; overflow: hidden;
}
#chartTitle {
  min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: 18px;
}
#chartTitle .hdr-suffix { font-size: 16px; }
.price-info { min-width: 0; flex: 0 0 auto; font-size: 14px; }
.indicator-btns { gap: 9px; }
.ind-select { padding: 3px 4px; font-size: 13px; width: 150px; height: 25px; box-sizing: border-box; }
.period-toggle { gap: 2px; padding-left: 0; border-left: none; }
.period-btn { height: 25px; box-sizing: border-box; padding: 3px 5px; font-size: 12px; }
.ma-set-btn { height: 25px; box-sizing: border-box; padding: 3px 4px; margin-left: 0; font-size: 14px; }
.analysis-btn {
  width: auto; height: 25px; min-width: 0; padding: 0 7px; margin-left: 0; font-size: 13px;
}
.btn-short { display: none; }
.btn-full { display: inline; }

/* 深色主题：保持同色系（暗底 + 亮字），文字亮度上调以维持对比 */
body.dark .analysis-btn,
body.dark .free-analysis-btn { background: rgba(174,159,224,0.16); border-color: rgba(174,159,224,0.55); color: #d3c8f5; }
body.dark .analysis-btn:hover,
body.dark .free-analysis-btn:hover { background: rgba(174,159,224,0.30); box-shadow: 0 2px 12px rgba(174,159,224,0.35); }
body.dark .resource-btn { background: rgba(122,210,154,0.16); border-color: rgba(122,210,154,0.55); color: #9fe8bd; }
body.dark .resource-btn:hover { background: rgba(122,210,154,0.28); box-shadow: 0 2px 12px rgba(122,210,154,0.32); }
body.dark .report-btn { background: rgba(130,172,221,0.16); border-color: rgba(130,172,221,0.55); color: #a8cdf5; }
body.dark .report-btn:hover { background: rgba(130,172,221,0.28); box-shadow: 0 2px 12px rgba(130,172,221,0.32); }

/* ===== 免费AI资源侧边栏 ===== */
.resource-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.resource-panel {
  width: min(480px, 96vw);
  background: var(--card-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(0,0,0,0.25);
  animation: slideInRight 0.28s ease;
}
.resource-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 14px 18px;
  flex-shrink: 0;
}
.resource-panel-title {
  font-size: 15px;
  font-weight: 600;
}
.resource-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
  padding: 0 4px;
}
.resource-close-btn:hover { opacity: 1; }
.resource-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.resource-panel-body::-webkit-scrollbar { width: 6px; }
.resource-panel-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.resource-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.resource-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.resource-link {
  display: block;
  padding: 9px 14px;
  background: var(--hover-bg, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #4f46e5;
  text-decoration: none;
  font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s;
}
.resource-link:hover {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #3730a3;
}
.resource-panel-tip {
  background: #fefce8;
  border-top: 1px solid #fde68a;
  padding: 11px 18px;
  font-size: 12.5px;
  color: #92400e;
  flex-shrink: 0;
  line-height: 1.6;
}

.analysis-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.analysis-panel {
  /* v1.0.129：回到固定宽度模式（v1.0.126 前为固定 680px），按用户要求固定 710px */
  width: 710px;
  background: var(--card-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(0,0,0,0.25);
  animation: slideInRight 0.28s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
/* v1.0.123：深度基本面报告（表格密集）在右侧面板内打开时加宽；v1.0.129：统一为固定 710px */
.analysis-panel-wide { width: 710px; }
.analysis-panel-body.fr-iframe-body { padding: 0; overflow: hidden; }
.fr-frame { display: block; width: 100%; height: 100%; border: 0; background: #f7fafc; }

.analysis-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}
.analysis-panel-header h3 { font-size: 16px; font-weight: 600; }
.analysis-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
}
.analysis-close-btn:hover { opacity: 1; }
.analysis-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  line-height: 1.8;
  font-size: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.analysis-panel-body::-webkit-scrollbar { width: 6px; }
.analysis-panel-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 16px;
  color: #94a3b8;
}
.analysis-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Markdown 渲染样式 */
.md-body h1 { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--text); border-bottom: 2px solid #6366f1; padding-bottom: 6px; }
.md-body h2 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; color: var(--text); }
.md-body h3 { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.md-body p { margin-bottom: 10px; }
.md-body blockquote { border-left: 3px solid #6366f1; padding: 6px 14px; background: rgba(99,102,241,0.07); border-radius: 4px; margin: 8px 0; color: #2c3e50; font-size: 13px; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
/* 投资结论横幅（v1.0.117）：巴菲神谕报告「结论」高亮 */
.md-body .md-verdict {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 14px 0; padding: 13px 20px;
  border-radius: 10px; color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.md-body .md-verdict-label {
  font-size: 13px; font-weight: 600; opacity: 0.92; letter-spacing: 2px;
  border: 1px solid rgba(255,255,255,0.55); padding: 3px 12px;
  border-radius: 999px; white-space: nowrap;
}
.md-body .md-verdict-text { font-size: 24px; font-weight: 800; letter-spacing: 6px; }
.md-body .md-verdict-buy  { background: linear-gradient(135deg, #ef4444, #b91c1c); }  /* 买入=红 */
.md-body .md-verdict-sell { background: linear-gradient(135deg, #10b981, #047857); }  /* 卖出=绿 */
.md-body .md-verdict-hold { background: linear-gradient(135deg, #f59e0b, #b45309); }  /* 观望=琥珀 */
.md-body table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 16px; }
.md-body table th { background: rgba(99,102,241,0.12); padding: 8px 12px; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.md-body table td { padding: 7px 12px; border: 1px solid var(--border); }
.md-body table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
.md-body ul { padding-left: 20px; margin-bottom: 10px; }
.md-body li { margin-bottom: 5px; }
.md-body strong { font-weight: 700; }
.md-body code { background: rgba(99,102,241,0.1); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
body.dark .md-body table tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
body.dark .md-body blockquote { background: rgba(99,102,241,0.12); }
.md-body a { color: #0c63b7; text-decoration: underline; }
body.dark .md-body a { color: #60a5fa; }

/* ===== v1.0.716：AI 分析报告彩色增强（仅 .md-body.ai-report，其它 Markdown 报告不受影响；下载 HTML/打印注入本文件自动带色）===== */
.md-body.ai-report h1 {
  background: linear-gradient(135deg, #eef2ff 0%, #f3efff 55%, #fdf2f8 100%);
  color: #4338ca; border-bottom: none; border-radius: 10px;
  padding: 13px 18px; margin-bottom: 16px;
  border: 1px solid #e0e7ff;
}
.md-body.ai-report h2 {
  padding: 7px 14px; border-radius: 8px;
  margin: 22px 0 12px; font-size: 15px;
  border-left: 4px solid transparent;
}
.md-body.ai-report h2:nth-of-type(1) { background: linear-gradient(90deg, rgba(99,102,241,.14), rgba(99,102,241,.03)); color: #4338ca; border-left-color: #818cf8; } /* 一、趋势判断 */
.md-body.ai-report h2:nth-of-type(2) { background: linear-gradient(90deg, rgba(6,182,212,.13), rgba(6,182,212,.03)); color: #0e7490; border-left-color: #22d3ee; } /* 二、支撑压力位 */
.md-body.ai-report h2:nth-of-type(3) { background: linear-gradient(90deg, rgba(239,68,68,.11), rgba(239,68,68,.03)); color: #b91c1c; border-left-color: #f87171; } /* 三、风险提示 */
.md-body.ai-report h2:nth-of-type(4) { background: linear-gradient(90deg, rgba(16,185,129,.12), rgba(16,185,129,.03)); color: #047857; border-left-color: #34d399; } /* 四、操作建议 */
.md-body.ai-report h2:nth-of-type(5) { background: linear-gradient(90deg, rgba(168,85,247,.12), rgba(168,85,247,.03)); color: #6d28d9; border-left-color: #c084fc; } /* 总结 */
.md-body.ai-report h3 {
  color: #4338ca; border-left: 4px solid #8b5cf6;
  background: linear-gradient(90deg, rgba(139,92,246,.13), rgba(139,92,246,0));
  padding: 6px 12px; border-radius: 0 7px 7px 0; margin: 14px 0 8px;
}
.md-body.ai-report h3.md-plan-aggressive { color: #b91c1c; border-left-color: #ef4444; background: linear-gradient(90deg, rgba(239,68,68,.15), rgba(239,68,68,0)); }
.md-body.ai-report h3.md-plan-steady { color: #b45309; border-left-color: #f59e0b; background: linear-gradient(90deg, rgba(245,158,11,.16), rgba(245,158,11,0)); }
.md-body.ai-report h3.md-plan-conservative { color: #047857; border-left-color: #10b981; background: linear-gradient(90deg, rgba(16,185,129,.15), rgba(16,185,129,0)); }
.md-body.ai-report h3.md-rating { color: #6d28d9; border-left-color: #a855f7; background: linear-gradient(90deg, rgba(168,85,247,.18), rgba(168,85,247,0)); }
/* 彩色标题/高亮条内的加粗继承容器色，避免撞色 */
.md-body.ai-report h1 strong, .md-body.ai-report h2 strong, .md-body.ai-report h3 strong,
.md-body.ai-report blockquote strong { color: inherit; }
/* 五种高亮条分色 */
.md-body.ai-report blockquote { border-left-width: 4px; border-radius: 8px; padding: 9px 14px; font-weight: 500; }
.md-body.ai-report blockquote.md-quote-base { border-left-color: #6366f1; background: linear-gradient(90deg, rgba(99,102,241,.14), rgba(168,85,247,.04)); color: #3730a3; }
.md-body.ai-report blockquote.md-quote-trend { border-left-color: #8b5cf6; background: linear-gradient(90deg, rgba(139,92,246,.15), rgba(139,92,246,.03)); color: #5b21b6; }
.md-body.ai-report blockquote.md-quote-core { border-left-color: #f59e0b; background: linear-gradient(90deg, rgba(245,158,11,.18), rgba(245,158,11,.04)); color: #92400e; }
.md-body.ai-report blockquote.md-quote-rebound { border-left-color: #0891b2; background: linear-gradient(90deg, rgba(8,145,178,.15), rgba(8,145,178,.03)); color: #155e75; }
.md-body.ai-report blockquote.md-quote-summary { border-left-color: #059669; background: linear-gradient(90deg, rgba(5,150,105,.15), rgba(5,150,105,.03)); color: #065f46; }
/* 表格：渐变表头 + 柔和斑马纹 */
.md-body.ai-report table { border: 1px solid #e0e7ff; border-radius: 9px; overflow: hidden; box-shadow: 0 2px 10px rgba(79,70,229,.08); }
.md-body.ai-report table th { background: rgba(99,102,241,.15); color: #4338ca; border-color: #e0e7ff; font-weight: 700; }
.md-body.ai-report table td { border-color: #e5e7ff; }
.md-body.ai-report table tr:nth-child(even) td { background: #f7f6ff; }
/* 关键结论 / 五星评级 / 风险等级徽章 */
.md-body.ai-report p strong, .md-body.ai-report li strong { color: #4338ca; }
.md-body.ai-report .md-stars { color: #f59e0b; font-size: 1.15em; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(245,158,11,.35); }
.md-body.ai-report .md-risk-high { color: #dc2626; font-weight: 700; }
.md-body.ai-report .md-risk-midhigh { color: #ea580c; font-weight: 700; }
.md-body.ai-report .md-risk-mid { color: #d97706; font-weight: 700; }
.md-body.ai-report .md-risk-low { color: #059669; font-weight: 700; }
.md-body.ai-report .md-risk-note { color: #64748b; font-weight: 600; }
/* 列表彩色圆点 */
.md-body.ai-report ul { list-style: none; padding-left: 8px; }
.md-body.ai-report li { position: relative; padding-left: 18px; }
.md-body.ai-report li::before { content: '▸'; position: absolute; left: 1px; color: #8b5cf6; font-weight: 700; }
.md-body.ai-report p em { color: #64748b; }
/* 深色模式适配 */
body.dark .md-body.ai-report h1 { background: linear-gradient(135deg, #312e81 0%, #4c1d95 55%, #831843 100%); color: #fff; border-color: #4338ca; }
body.dark .md-body.ai-report h2 { color: #e0e7ff; border-left-color: #818cf8; }
body.dark .md-body.ai-report table, body.dark .md-body.ai-report table td { border-color: #4338ca; }
body.dark .md-body.ai-report table th { background: rgba(99,102,241,.25); color: #c7d2fe; border-color: #6366f1; }
body.dark .md-body.ai-report table tr:nth-child(even) td { background: rgba(99,102,241,.08); }
body.dark .md-body.ai-report blockquote { color: #e2e8f0; }
body.dark .md-body.ai-report blockquote.md-quote-base { color: #c7d2fe; }
body.dark .md-body.ai-report blockquote.md-quote-trend { color: #ddd6fe; }
body.dark .md-body.ai-report blockquote.md-quote-core { color: #fde68a; }
body.dark .md-body.ai-report blockquote.md-quote-rebound { color: #a5f3fc; }
body.dark .md-body.ai-report blockquote.md-quote-summary { color: #a7f3d0; }
body.dark .md-body.ai-report p strong, body.dark .md-body.ai-report li strong { color: #a5b4fc; }

.analysis-panel-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.analysis-refresh-btn {
  padding: 7px 18px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.analysis-refresh-btn:hover { background: #4f46e5; }
/* v1.0.698：报告下载按钮（HTML=蓝） */
/* v1.0.699：打印报告按钮（琥珀色，与下载 HTML、重新生成区分） */
.analysis-print-btn { background: #d97706; }
.analysis-print-btn:hover { background: #b45309; }
.analysis-export-html-btn { background: #2563eb; }
.analysis-export-html-btn:hover { background: #1d4ed8; }
/* v1.0.700：已移除「下载PDF」按钮（.analysis-export-pdf-btn 保留仅为旧样式兼容，无元素使用） */

/* ===== 副图指标下拉选择器（覆盖在 ECharts 标题右侧） ===== */
.sub-panel-selector-overlay {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 60;
}
.sub-panel-selector {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: 3px;
  pointer-events: auto;
  transition: background 0.15s;
}
.sub-panel-selector:hover { background: rgba(128,128,128,0.18); }
.sub-panel-selector .caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.65;
}
.sub-panel-selector:hover .caret { opacity: 1; }
.sub-panel-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 110px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 200;
  padding: 4px 0;
  display: none;
  /* v1.0.258：指标项增多后菜单超屏看不见底部——固定最大高度+滚动 */
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* v1.0.258：菜单滚动条样式（浅灰细条，悬停加深） */
.sub-panel-dropdown::-webkit-scrollbar { width: 8px; }
.sub-panel-dropdown::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.35); border-radius: 4px; }
.sub-panel-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.55); }
body.dark .sub-panel-dropdown::-webkit-scrollbar-thumb { background: rgba(203,213,225,0.3); }
body.dark .sub-panel-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(203,213,225,0.5); }
body.dark .sub-panel-dropdown { background: #1e293b; border-color: #475569; }
.sub-panel-dropdown.show { display: block; }
.sub-panel-dropdown.upward {
  top: auto;
  bottom: 100%;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

/* v1.0.517：副图指标名称右键命中区（铺在 canvas 标题文字上的透明层） */
.sub-panel-title-hit { position: absolute; z-index: 3; cursor: default; pointer-events: auto; } /* v1.0.518：父层 pointer-events:none，命中区必须显式 auto，否则右键穿透到 canvas 弹浏览器原生菜单 */

/* v1.0.516：副图右键菜单（通达信风格）+ 指标参数小窗 */
.kline-ctx-menu {
  position: fixed;
  z-index: 4000;
  min-width: 132px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  padding: 3px 0;
}
.kline-ctx-item {
  padding: 6px 16px;
  font-size: 13px;
  color: #2c3e50;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.kline-ctx-item:hover { background: #e6f1fb; color: #185fa5; }
body.dark .kline-ctx-menu { background: #1e293b; border-color: #475569; }
body.dark .kline-ctx-item { color: #cbd5e1; }
body.dark .kline-ctx-item:hover { background: #16314e; color: #7cb0ff; }

#klineParamOverlay {
  position: fixed;
  inset: 0;
  z-index: 4001;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kline-param-box {
  width: 360px;
  max-width: 92vw;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  padding: 14px 18px 14px;
}
.kline-param-hd { font-size: 14px; font-weight: 500; color: #2c3e50; display: flex; align-items: center; gap: 8px; }
.kline-param-name { font-size: 12px; font-weight: 400; color: #64748b; }
.kline-param-close { margin-left: auto; border: 0; background: none; font-size: 18px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0 2px; }
.kline-param-close:hover { color: #e0352f; }
.kline-param-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.kline-param-row label { font-size: 13px; color: #2c3e50; flex: 0 0 auto; }
.kline-param-row input { width: 90px; height: 30px; text-align: center; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; }
.kline-param-range { font-size: 12px; color: #94a3b8; }
.kline-param-hint { font-size: 12px; color: #94a3b8; margin-bottom: 14px; }
.kline-param-btns { display: flex; gap: 10px; justify-content: flex-end; }
.kline-param-btns button {
  height: 30px; padding: 0 14px; border-radius: 6px; font-size: 13px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; color: #2c3e50;
}
.kline-param-btns button.primary { background: #185fa5; border-color: #185fa5; color: #fff; }
.kline-param-btns button.primary:hover { background: #124a82; }
body.dark .kline-param-box { background: #1e293b; }
body.dark .kline-param-hd { color: #e2e8f0; }
body.dark .kline-param-name, body.dark .kline-param-range, body.dark .kline-param-hint { color: #7c8ba1; }
body.dark .kline-param-row label { color: #cbd5e1; }
body.dark .kline-param-row input { background: #0f172a; border-color: #475569; color: #e2e8f0; }
body.dark .kline-param-btns button { background: #0f172a; border-color: #475569; color: #cbd5e1; }
body.dark .kline-param-btns button.primary { background: #185fa5; border-color: #185fa5; color: #fff; }
.sub-panel-dropdown-item {
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
}
.sub-panel-dropdown-item:hover { background: #eff6ff; color: #1e3c72; }
body.dark .sub-panel-dropdown-item { color: #cbd5e1; }
body.dark .sub-panel-dropdown-item:hover { background: #334155; color: #fff; }
.sub-panel-dropdown-item.current {
  font-weight: 600;
  color: #1e3c72;
  background: #e0f2fe;
}
body.dark .sub-panel-dropdown-item.current { color: #60a5fa; background: #1e3a5f; }
/* v1.0.193：下拉菜单顶部的「📖 指标说明」入口 */
.sub-panel-dropdown-item.sub-panel-dropdown-doc { color: #1e3c72; font-weight: 600; }
body.dark .sub-panel-dropdown-item.sub-panel-dropdown-doc { color: #93c5fd; }

/* ===== 指标使用说明卡（v1.0.193：副图标题悬浮 / 公式管理「📖 说明」共用） ===== */
.ind-doc-card {
  position: fixed;
  z-index: 10050;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ind-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid #eef1f5;
  background: linear-gradient(180deg, #f8fbff, #eef4fd);
}
.ind-doc-title { font-size: 13px; font-weight: 700; color: #1e3c72; }
.ind-doc-close {
  flex: none; width: 22px; height: 22px; line-height: 1; padding: 0;
  border: 0; background: transparent; color: #8895a3; font-size: 17px; cursor: pointer; border-radius: 4px;
}
.ind-doc-close:hover { background: rgba(128,128,128,.18); color: #e74c3c; }
.ind-doc-body {
  padding: 9px 12px 11px;
  overflow-y: auto;
  max-height: min(58vh, 460px);
  font-size: 12px;
  line-height: 1.72;
  color: #374151;
}
.ind-doc-foot {
  padding: 5px 12px 6px;
  border-top: 1px solid #eef1f5;
  background: #fafcff;
  font-size: 11px;
  color: #8895a3;
}
.ind-doc-h1 { font-size: 13.5px; font-weight: 700; color: #1e3c72; margin-bottom: 5px; }
.ind-doc-h2 {
  margin: 9px 0 4px;
  font-weight: 600;
  color: #1e3c72;
  border-left: 3px solid #82acdd;
  padding-left: 6px;
  line-height: 1.5;
}
.ind-doc-p { margin: 2px 0; }
.ind-doc-li { position: relative; padding-left: 13px; margin: 1px 0; }
.ind-doc-li::before { content: '·'; position: absolute; left: 3px; color: #94a3b8; font-weight: 700; }
.ind-doc-pre {
  font-family: Menlo, Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 1px 0;
}
.ind-doc-warn {
  margin: 6px 0;
  padding: 5px 8px;
  background: #fff7ed;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #92400e;
}
.ind-doc-gap { height: 5px; }
body.dark .ind-doc-card { background: #1e293b; border-color: #475569; }
body.dark .ind-doc-head { background: linear-gradient(180deg, #24344b, #1e293b); border-bottom-color: #334155; }
body.dark .ind-doc-title { color: #93c5fd; }
body.dark .ind-doc-body { color: #cbd5e1; }
body.dark .ind-doc-foot { background: #172033; border-top-color: #334155; color: #94a3b8; }
body.dark .ind-doc-h1 { color: #93c5fd; }
body.dark .ind-doc-h2 { color: #bfdbfe; border-left-color: #3b82f6; }
body.dark .ind-doc-pre { color: #94a3b8; }
body.dark .ind-doc-warn { background: #3b2f1a; color: #fcd34d; border-left-color: #d97706; }
/* 设置页的说明弹窗版本（复用卡片内部排版） */
.ind-doc-modal-body {
  padding: 10px 14px 14px;
  overflow-y: auto;
  max-height: 62vh;
  font-size: 12.5px;
  line-height: 1.75;
  color: #374151;
}

/* ===== 副图指标「用法说明」悬浮气泡（v1.0.195：替代原来一行字的原生提示） ===== */
.ind-tip {
  position: fixed;
  z-index: 10060;
  width: 430px;
  max-width: calc(100vw - 16px);
  max-height: 320px;
  overflow-y: auto;
  padding: 7px 10px 8px;
  background: #ffffe1;
  color: #2f2f2f;
  border: 1px solid #c9c9a3;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .18);
  font-size: 12px;
  line-height: 1.68;
}
.ind-tip-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e3c72;
  margin: 0 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(120, 120, 70, .28);
}
.ind-tip .ind-doc-h1 { font-size: 13px; font-weight: 700; color: #1e3c72; margin: 0 0 4px; }
.ind-tip .ind-doc-h2 {
  margin: 7px 0 3px;
  font-weight: 600;
  color: #1e3c72;
  border-left: 3px solid #c9a227;
  padding-left: 6px;
  line-height: 1.5;
}
.ind-tip .ind-doc-p { margin: 1px 0; }
.ind-tip .ind-doc-li { position: relative; padding-left: 13px; margin: 1px 0; }
.ind-tip .ind-doc-li::before { content: '·'; position: absolute; left: 3px; color: #8a8a5c; font-weight: 700; }
.ind-tip .ind-doc-pre {
  font-family: Menlo, Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  color: #4b4b2f;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 1px 0;
}
.ind-tip .ind-doc-warn {
  margin: 5px 0;
  padding: 4px 7px;
  background: #fff3d6;
  border-left: 3px solid #d9a300;
  border-radius: 3px;
  color: #7a5200;
}
.ind-tip .ind-doc-gap { height: 4px; }
body.dark .ind-tip { background: #33331f; color: #ececcf; border-color: #6a6a45; }
body.dark .ind-tip-title { color: #ffe08a; border-bottom-color: rgba(200, 200, 140, .3); }
body.dark .ind-tip .ind-doc-h1, body.dark .ind-tip .ind-doc-h2 { color: #ffe08a; }
body.dark .ind-tip .ind-doc-h2 { border-left-color: #c9a227; }
body.dark .ind-tip .ind-doc-pre { color: #d8d8b0; }
body.dark .ind-tip .ind-doc-li::before { color: #b9b98a; }
body.dark .ind-tip .ind-doc-warn { background: #3d3416; color: #ffd777; border-left-color: #c9a227; }

/* ===== 报告中心弹窗（查看报告） ===== */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 10001;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.18s ease;
}
.report-modal {
  /* v1.0.136：宽度 560px → 40vw、高度上限 86vh → 70vh（用户指定）；v1.0.733：宽度 40vw → 50vw */
  width: 50vw;
  min-width: 480px; /* 极窄窗口防挤压，正常桌面不触发 */
  max-height: 70vh;
  background: var(--card-bg, #fff);
  color: var(--text, #1f2937);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: reportPop 0.22s ease;
}
@keyframes reportPop {
  from { transform: translateY(14px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  flex-shrink: 0;
}
.report-modal-title { margin: 0; font-size: 16px; font-weight: 700; }
.report-modal-sub { font-size: 12.5px; opacity: 0.92; margin-left: 10px; }
.report-modal-sub b { font-weight: 700; }
.report-modal-close {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}
.report-modal-close:hover { background: rgba(255,255,255,0.3); }
.report-modal-body {
  /* v1.0.136：报告卡片改 2 行 2 列网格布局（原单列 flex） */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr); /* 两行等高，撑满可用空间 */
  gap: 12px;
  padding: 16px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.report-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--hover-bg, #f9fafb);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.report-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 18px rgba(99,102,241,0.18);
  transform: translateY(-1px);
}
.report-card-disabled { opacity: 0.55; cursor: not-allowed; }
.report-card-disabled:hover { border-color: var(--border, #e5e7eb); box-shadow: none; transform: none; }
.report-card-icon { font-size: 26px; flex-shrink: 0; }
.report-card-info { flex: 1; min-width: 0; }
.report-card-name { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-card-tag {
  font-size: 11px;
  font-weight: 600;
  color: #6d28d9;
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 999px;
}
.report-tag-tbd { color: #92400e; background: #fef3c7; }
.report-card-desc { font-size: 12.5px; color: var(--text-secondary, #6b7280); line-height: 1.6; }
/* v1.0.734：深度基本面卡片结论预览行（取报告头部判定语，7 天缓存有报告才显示） */
.report-card-verdict {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #f6e05e;
  border-radius: 8px;
  padding: 6px 10px;
  word-break: break-word;
}
body.dark .report-card-verdict { color: #fde68a; background: #3a2f0b; border-color: #8a6d1a; }
.report-card-arrow { font-size: 22px; color: #a5b4fc; flex-shrink: 0; font-weight: 700; }
body.dark .report-card-tag { color: #c4b5fd; background: #2e1065; }
body.dark .report-tag-tbd { color: #fcd34d; background: #451a03; }

/* 查看报告按钮：v1.0.131 起样式并入上方 .analysis-btn 统一定义（琥珀系描边风） */

/* ============================================================
   回测页活泼化改版（v1.0.141）：英雄横幅 + 糖果分组卡片
   注：此前 .bt-* 一直无样式定义（浏览器默认裸奔），本次整套补齐
   ============================================================ */
#backtestView.sg-view { overflow-y: auto; scrollbar-gutter: stable; } /* sg-view 默认 overflow:hidden，回测结果需纵向滚动；v1.0.471 预留滚动条槽位——出结果时滚动条不再抢 15px 布局宽，工具栏四卡点前点后可用宽完全一致，「点前单行 ⇒ 点后单行」恒成立（掉行类抖动的根治） */

/* —— 英雄横幅 —— */
.bt-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(115deg, #6366f1, #a855f7 55%, #ec4899);
  color: #fff; border-radius: 16px; padding: 13px 18px; margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.28);
}
.bt-hero-emoji { font-size: 32px; line-height: 1; animation: bt-bounce 2.6s ease-in-out infinite; }
.bt-hero-title { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }
.bt-hero-en { font-size: 11px; font-weight: 700; letter-spacing: 2.5px; opacity: 0.72; margin-left: 8px; }
.bt-hero-sub { font-size: 12px; opacity: 0.9; margin-top: 3px; }
.bt-hero-sub.bt-hero-sub-long { line-height: 1.65; }
.bt-hero-bubble { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.16); pointer-events: none; }
.bt-hero-bubble.b1 { width: 64px; height: 64px; right: 96px; top: -18px; }
.bt-hero-bubble.b2 { width: 26px; height: 26px; right: 44px; bottom: -6px; background: rgba(255,255,255,0.24); animation: bt-float 4.5s ease-in-out infinite; }
.bt-hero-bubble.b3 { width: 14px; height: 14px; right: 168px; bottom: 12px; animation: bt-float 5.5s ease-in-out 0.8s infinite; }
@keyframes bt-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bt-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* —— 分组卡片工具栏 —— */
.bt-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.bt-card {
  background: #fff; border: 1.5px solid #eee9ff; border-radius: 14px;
  padding: 10px 14px 12px; box-shadow: 0 3px 10px rgba(99, 102, 241, 0.08);
}
.bt-card-title { font-size: 13px; font-weight: 800; color: #7c3aed; margin-bottom: 8px; letter-spacing: 0.3px; }
/* v1.0.462：「🔬 防过拟合实验室」标题行 flex 化——「⬇️ 导出参数」按钮挂标题行最右（margin-left:auto），
   #btAdvStatus 状态胶囊紧跟标题文字；min-height 29px 与同行「风控护栏」卡标题行对齐。 */
.bt-card-title.bt-lab-title { display: flex; align-items: center; gap: 8px; min-height: 29px; }
.bt-card-title.bt-lab-title > .bt-run { margin-left: auto; flex: 0 0 auto; }
/* v1.0.339：卡片标题行可放靠右控件（风控护栏卡右上角「按信号触发价成交」） */
.bt-card-title.with-check { display: flex; align-items: center; gap: 10px; }
.bt-card-title.with-check > span { flex: 0 0 auto; }
.bt-card-title.with-check > .bt-field { font-weight: 400; letter-spacing: 0; margin-left: auto; white-space: nowrap; }

/* v1.0.345：标题行右侧挂状态胶囊（模拟盘「出发！」卡的 #ppScanStatus）。
   与 .with-check 分开写，避免影响回测风控卡那条规则；nowrap 保证胶囊文字不折行。 */
.bt-card-title.with-status { display: flex; align-items: center; gap: 10px; }
/* v1.0.360：回测「🎯 想测谁？」标题行右侧的时间范围选择器。
   与 .with-check 分开写，避免影响回测风控卡那条规则；nowrap 保证按钮文字不折行。 */
.bt-card-title.with-range { display: flex; align-items: center; gap: 10px; }
.bt-card-title.with-range > span { flex: 0 0 auto; }
.bt-card-title.with-range > .bt-field { font-weight: 400; letter-spacing: 0; margin-left: auto; white-space: nowrap; }
/* v1.0.461：「拉取5年历史」挂在「想测谁？」标题行最右——时间 label 的 margin-left:auto 把
   「时间 + 勾选框」整组推到右侧，勾选框自身不再吃自由空间（margin-left:0），
   视觉效果 = 勾选框贴右缘、时间选择紧挨其左（比原先左移一个勾选框的宽度）。 */
.bt-card-title.with-range > .bt-field.bt-histcheck { margin-left: 0; }
.bt-card-title.with-status > .bt-status { margin-left: auto; font-weight: 400; letter-spacing: 0; white-space: nowrap; flex: 0 0 auto; }
/* v1.0.365：回测工具栏里「💰 本钱设定」「🛡️ 风控护栏」两卡的标题行只有 17px（纯文字/勾选项），
   而「🎯 想测谁？」的标题行是 29px —— 它右侧挂了带内边距的「时间」选择按钮。
   12px 的高度差会让两卡的正文行整体上浮 12px，与想测谁卡的正文行错位。
   这里把这两张卡的标题行补齐到同一高度并垂直居中，三卡正文行即对齐。
   作用域限定 #backtestView（.bt-card 同时被信号中心、模拟盘复用）；
   排除 .with-range（它就是基准高度）与 .with-status（「🎬 出发！」卡），不动未点名的卡片。 */
#backtestView .bt-toolbar > .bt-card > .bt-card-title:not(.with-range):not(.with-status) {
  display: flex; align-items: center; min-height: 29px;
}

/* v1.0.383：模拟盘「💰 账户设定」卡标题行补齐到 29px（与「📝 建仓下单」卡带日期选择器的标题行同高，
   正文行底部即与之平齐）。381/382 把初始资金改成标题行纯文字 span 后，该卡标题行只剩 ~17px，
   比建仓下单卡矮 12px；.bt-toolbar 是 align-items:stretch，卡片被拉到同高，正文行整体上浮、底部留白。
   与 v1.0.365 回测页同款问题同款修法；只作用这张卡，不影响 with-status 的「出发！」卡。 */
#paperView #ppAcctCard .bt-card-title { display: flex; align-items: center; min-height: 29px; }
/* v1.0.392：账户设定第二行也要与「建仓下单」表单行对齐——正文行纯文本自然高仅 ~16px，
   而建仓下单表单行（含下拉/输入框）高 30.2px，卡片虽被拉伸到等高但底部差 14px。
   给正文行同高 min-height（.bt-card-body 本就 align-items:center，文字自动垂直居中），两行底部即齐平。 */
#paperView #ppAcctCard .bt-card-body { min-height: 30.2px; }

/* v1.0.367：修复「点运行回测后 🎬 出发！卡掉到第二行」。单股回测结果区（策略对比+明细+风控建议）比批量结果长，
   会撑出 #backtestView 的内部纵向滚动条（Windows 上占 15px），工具栏可用宽随之变小，
   四卡总需求一旦超过「有滚动条」宽度，出发卡即被挤到第二行。
   这里把回测页四卡的间距与卡片左右内边距收一点，使「无滚动条」与「有滚动条」两种宽度下都放得下。
   仅限 #backtestView：.bt-toolbar / .bt-card 同时被信号中心、模拟盘共用，不可全局改。
   v1.0.471：367 之后新增的「📸 存为快照」「实验室三钮」「⬇️ 导出参数」「5年勾选框」把余量再次吃光
   （实测四卡需求 1870px，出结果滚动条占 15px → 窗口稍窄即掉行）。两手修：
   ① #backtestView 加 scrollbar-gutter:stable（见上）——点前点后可用宽一致，掉行失去物理条件；
   ② gap 8→4、卡左右内边距 10→8（需求 1870→1842），给 1902~1917 视口段再留出 ~13px 余量。 */
#backtestView .bt-toolbar { gap: 4px; }
#backtestView .bt-toolbar > .bt-card { padding-left: 8px; padding-right: 8px; }

/* v1.0.473：批量回测模式下出发卡仍掉第二行（v1.0.471 只修了单股场景）。
   探针实测（1904 视口）：勾选组后「🌈 批量回测 · N组M只」按钮(185px)一出现，
   出发卡变 448px，四卡总需求 1866px > 工具栏可用内容宽 ~1849px——勾选那一刻就掉行，与点不点无关。
   预算差 ~17px。修法（不动三张固定卡、不动按钮文字/配色/圆角，只收药丸横向内边距与行内间距）：
   ① .bt-run 横向 padding 20→14（ghost 15→12），运行/批量/存为快照 + 实验室 4 钮共省 ~54px；
   ② 出发卡按钮行 gap 10→8；
   ③ .bt-status 兜底帽 480→300（超长截断，防极端文案把标题行撑宽）。
   修后四卡需求 ≈1806px，1904 视口余量 ~43px、1920 全屏 ~59px。 */
#backtestView .bt-toolbar .bt-run { padding-left: 14px; padding-right: 14px; }
#backtestView .bt-toolbar .bt-run.ghost { padding-left: 12px; padding-right: 12px; }
#backtestView .bt-toolbar .bt-card-body { gap: 8px; }
#backtestView .bt-toolbar .bt-status { max-width: 300px; overflow: hidden; }

.bt-card-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-or { font-size: 12px; color: #334155; font-weight: 600; }
.bt-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748b; white-space: nowrap; }
.bt-field input[type="number"], .bt-field input[type="text"], .bt-field select {
  border: 1.5px solid #e6e2fa; border-radius: 10px; padding: 5px 9px; font-size: 13px;
  color: #334155; background: #fbfaff; outline: none; line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bt-field input:focus, .bt-field select:focus {
  border-color: #a78bfa; background: #fff; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.bt-field input[type="checkbox"] { width: 15px; height: 15px; accent-color: #a855f7; cursor: pointer; }
/* v1.0.330：回测实验室顶部 6 个控件宽度减半（用户指定）——数值框 188→94px、股票下拉 204→102px */
/* v1.0.336：股票下拉再 +50%（102→153px，完整显示「招商银行 (000001)」这类长名称） */
/* v1.0.351：股票下拉再 +10%（153→168px）；模拟盘 #ppStockSelect 同步同宽 */
/* v1.0.357：本钱设定三框统一 70px（原 初始资金/手续费 94px、仓位% 84px 默认） */
/* v1.0.368：初始资金单独 70 → 80px（70px 时 number spinner 的 8px 预留会把 6 位数末位挤掉）；仓位%/手续费 仍 70px */
/* v1.0.462：「💰 本钱设定」卡整体删除，#btCapital/#btPos/#btFee 的宽度规则随之移除 */
/* v1.0.337：止损%/止盈%/移动止损 三个框再 -40%（94→56px）；初始资金/手续费仍 94px */
/* v1.0.363：风控三框 56 → 80px（用户指定）；v1.0.364：80 → 75px；v1.0.366：75 → 70px（与「本钱设定」三框同宽） */
.bt-field input#btStopLoss, .bt-field input#btTakeProfit, .bt-field input#btTrailing { width: 70px; }
.bt-field select#btStockSelect { width: 168px; }
/* v1.0.337：策略指标下拉 -20%（min-width 189→151px；弹出面板仍 189px，保证选项名不截断） */
/* v1.0.356：策略指标下拉再按用户指定定宽 120px */
#btStrategyBtn { width: 130px; min-width: 130px; }
/* v1.0.341：模拟盘「股票」下拉——宽度对齐回测 .bt-field select#btStockSelect */
/* v1.0.351：与回测同步 +10%（153→168px） */
.bt-field select#ppStockSelect { width: 168px; }

/* —— 糖果胶囊按钮 —— */
.bt-run {
  border: 0; cursor: pointer; border-radius: 999px; padding: 9px 20px;
  font-size: 13.5px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
  background: linear-gradient(120deg, #fb7185, #ec4899 60%, #a855f7);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.bt-run:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 7px 16px rgba(236, 72, 153, 0.38); }
.bt-run:active { transform: translateY(0) scale(0.97); }
.bt-run.batch {
  background: linear-gradient(120deg, #34d399, #06b6d4 60%, #3b82f6);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}
.bt-run.batch:hover { box-shadow: 0 7px 16px rgba(6, 182, 212, 0.36); }
.bt-run.ghost {
  background: #fff; color: #7c3aed; border: 1.5px dashed #c4b5fd;
  box-shadow: none; padding: 7.5px 15px; font-size: 12.5px;
}
.bt-run.ghost:hover { background: #f5f3ff; transform: translateY(-2px); }
/* v1.0.463【用户定版】：防过拟合实验室 4 个按钮重新配色——去虚线改实线、四色低饱和软填充，
   只动「背景色 + 文字色 + 边框（虚线→实线）」，尺寸/圆角/字号/悬停上浮均不动。
   用 ID 精准覆盖，不影响信号页/快照区共用的 .bt-run.ghost。 */
#btIsosBtn      { background: #eef4ff; color: #1d4ed8; border: 1.5px solid #c7dbff; }
#btIsosBtn:hover { background: #dfeaff; }
#btPerturbBtn   { background: #f3f0ff; color: #6d28d9; border: 1.5px solid #ddd0ff; }
#btPerturbBtn:hover { background: #e9e3ff; }
#btRegimeBtn    { background: #ecfdf7; color: #0f766e; border: 1.5px solid #b5ebdd; }
#btRegimeBtn:hover { background: #d9f9ef; }
#btExportCsvBtn { background: #fff5e8; color: #b45309; border: 1.5px solid #f5d9a8; }
#btExportCsvBtn:hover { background: #ffedd3; }
/* 暗色主题：同四色相的深底亮字 */
body.dark #btIsosBtn      { background: #1e2a45; color: #93c5fd; border-color: #2f4a75; }
body.dark #btIsosBtn:hover { background: #243352; }
body.dark #btPerturbBtn   { background: #292345; color: #c4b5fd; border-color: #4c3f8f; }
body.dark #btPerturbBtn:hover { background: #322a55; }
body.dark #btRegimeBtn    { background: #11332e; color: #5eead4; border-color: #1f5f54; }
body.dark #btRegimeBtn:hover { background: #16453e; }
body.dark #btExportCsvBtn { background: #3a2a14; color: #fcd34d; border-color: #7a5a1e; }
body.dark #btExportCsvBtn:hover { background: #4a351a; }

/* —— 状态胶囊 —— */
.bt-status {
  display: inline-flex; align-items: center; font-size: 12.5px;
  color: #7c3aed; background: #f5f3ff; border: 1.5px solid #ede9fe;
  border-radius: 999px; padding: 5px 14px; max-width: 480px;
}
.bt-status:empty { display: none; }

/* —— 💡 提示气泡（回测页 / 模拟盘共用） —— */
.bt-hint {
  position: relative; background: #fffbeb; border: 1.5px dashed #fcd34d; border-radius: 12px;
  padding: 10px 14px 10px 40px; font-size: 12.5px; color: #a16207; line-height: 1.7; margin-bottom: 12px;
}
.bt-hint::before { content: '\1F4A1'; position: absolute; left: 12px; top: 9px; font-size: 16px; }

/* —— 结果区小节标题 —— */
.bt-sec-title { font-size: 14px; font-weight: 800; color: #6d28d9; margin: 4px 0 10px; letter-spacing: 0.3px; }

/* —— 指标小卡（单股成绩单 / 模拟盘汇总共用 .bt-metrics） —— */
.bt-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.bt-metric {
  background: #fff; border: 1.5px solid #f0edff; border-radius: 14px;
  padding: 12px 6px; text-align: center;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.07);
  transition: transform 0.15s, box-shadow 0.15s;
}
.bt-metric:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(99, 102, 241, 0.12); }
.bt-metric .label { font-size: 11.5px; color: #94a3b8; margin-bottom: 5px; }
.bt-metric .value { font-size: 17px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; }
/* 涨红跌绿（中式配色，沿用全局变量） */
.bt-metric .value.up { color: var(--up, #e74c3c); }
.bt-metric .value.down { color: var(--down, #2ecc71); }

/* —— 权益曲线 / 风控卡片 / 结果表 —— */
.bt-equity {
  background: #fff; border: 1.5px solid #f0edff; border-radius: 14px;
  padding: 6px; height: 300px; margin: 0 0 12px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.07);
}
.bt-risk-card {
  background: #fff; border: 1.5px solid #fef08a; border-radius: 14px;
  padding: 12px 16px; margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(234, 179, 8, 0.08);
}
.bt-table-wrap {
  border: 1.5px solid #ece9ff; border-radius: 14px; overflow: auto;
  background: #fff; margin-bottom: 12px; max-height: 340px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.06);
}
#backtestView .bt-table-wrap .sg-table thead th { background: #f8f7ff; color: #6d28d9; }
/* v1.0.373：「🏆 自选股批量排行」容器上限按用户要求调至 69vh（v1.0.372 70vh，v1.0.371 由 640px 改 68vh，v1.0.369 340→600，v1.0.370 用户定 640）
   策略对比 / 单股回测明细 / 策略快照 / 快照对比 / 模拟盘 的同名容器仍 340px；信号中心仍是 flex 撑满（max-height:none） */
#btBatchResult > .bt-table-wrap { max-height: 69vh; }

/* —— 深色主题 —— */
body.dark .bt-hero { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
body.dark .bt-card { background: #243247; border-color: #3b4a63; box-shadow: none; }
body.dark .bt-card-title { color: #c4b5fd; }
body.dark .bt-or { color: #cbd5e1; }
body.dark .bt-field { color: #9fb0c9; }
body.dark .bt-field input[type="number"], body.dark .bt-field input[type="text"], body.dark .bt-field select {
  background: #1b2637; border-color: #465571; color: #dbe4f0;
}
body.dark .bt-field input:focus, body.dark .bt-field select:focus {
  border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
body.dark .bt-run.ghost { background: #243247; color: #c4b5fd; border-color: #6d5ae0; }
body.dark .bt-run.ghost:hover { background: #2c3b54; }
body.dark .bt-status { background: #312e81; color: #c4b5fd; border-color: #4338ca; }
body.dark .bt-hint { background: rgba(250, 204, 21, 0.07); border-color: #a16207; color: #fde68a; }
body.dark .bt-sec-title { color: #c4b5fd; }
body.dark .bt-metric { background: #243247; border-color: #3b4a63; box-shadow: none; }
body.dark .bt-metric .value { color: #e2e8f0; }
body.dark .bt-equity { background: #243247; border-color: #3b4a63; box-shadow: none; }
body.dark .bt-risk-card { background: #243247; border-color: #854d0e; box-shadow: none; }
body.dark .bt-table-wrap { background: #243247; border-color: #3b4a63; box-shadow: none; }
body.dark #backtestView .bt-table-wrap .sg-table thead th { background: #1b2637; color: #c4b5fd; }

/* —— v1.0.143：模拟盘页活泼化（复用回测页整套 .bt-* 样式） —— */
#paperView.sg-view { overflow-y: auto; } /* sg-view 默认 overflow:hidden，模拟盘内容需纵向滚动 */
.bt-hero.paper {
  background: linear-gradient(115deg, #0ea5e9, #6366f1 55%, #a855f7);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}
/* 模拟盘汇总卡用的类名是 bt-metric-label/bt-metric-value（历史命名），与回测页 label/value 等效 */
.bt-metric .bt-metric-label { font-size: 11.5px; color: #94a3b8; margin-bottom: 5px; }
.bt-metric .bt-metric-value { font-size: 17px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; }
/* 空持仓友好提示行 */
.pp-empty { text-align: center; color: #94a3b8; padding: 20px 0 22px; font-size: 13px; }
.pp-empty .pp-empty-emoji { font-size: 26px; display: block; margin-bottom: 6px; }
body.dark .bt-metric .bt-metric-value { color: #e2e8f0; }
body.dark .pp-empty { color: #7c8ba1; }

/* —— v1.0.376：模拟盘 加仓/减仓（部分买卖） —— */
/* 操作列四个紧凑按钮（加仓/减仓/平仓/删除）；放不下时在格内换行，不横向溢出 */
#ppBody .sg-btn { padding: 2px 8px; font-size: 12px; line-height: 18px; }
#ppBody td.pp-act { white-space: normal; }
/* A 股习惯配色：买（加仓）红、卖（减仓）绿 */
#ppBody .pp-add { background: #fdecec; color: #c0392b; border-color: #f2c4c4; }
#ppBody .pp-add:hover { background: #f9d6d6; border-color: #e6a3a3; }
#ppBody .pp-reduce { background: #e7f5ec; color: #15803d; border-color: #bfe3cd; }
#ppBody .pp-reduce:hover { background: #d7edde; border-color: #9fd3b1; }
body.dark #ppBody .pp-add { background: #3a2426; color: #f19999; border-color: #5c3436; }
body.dark #ppBody .pp-add:hover { background: #4a2c2f; }
body.dark #ppBody .pp-reduce { background: #1d3328; color: #82d8a4; border-color: #2c5240; }
body.dark #ppBody .pp-reduce:hover { background: #24423266; }
/* v1.0.562：操作列「智能条件单」按钮（蓝色系，同条件单主题） */
#ppBody .pp-cond { background: #eaf2fe; color: #1d6ae5; border-color: #c4d9fa; }
#ppBody .pp-cond:hover { background: #d8e7fd; border-color: #9cc2f5; }
body.dark #ppBody .pp-cond { background: #1c2c46; color: #7aa7f5; border-color: #2f4a75; }
body.dark #ppBody .pp-cond:hover { background: #243755; }
/* 模拟盘表格内容全部居中：覆盖全局 sg-table 首列的 18px 左内边距（仅限模拟盘视图） */
#paperView .sg-table thead th:first-child,
#paperView .sg-table tbody td:first-child { padding-left: 10px; padding-right: 10px; text-align: center; }
/* v1.0.495：持仓表「股票/代码」名称链接（点开弹 K 线详情，同股票分组/信号中心） */
#ppBody .pp-name-link { cursor: pointer; text-decoration: none; display: inline-block; max-width: 100%; }
#ppBody .pp-name-link .sg-name,
#ppBody .pp-name-link .sg-code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ppBody .pp-name-link:hover .sg-name { text-decoration: underline; color: #2563eb; }
body.dark #ppBody .pp-name-link:hover .sg-name { color: #7cb0ff; }
/* v1.0.497：模拟盘「成交明细」按钮 + 明细弹窗（建仓下单标题行按钮、成交明细表、买/卖/盈亏配色） */
.pp-tradelog-btn { margin-left: 10px; padding: 4px 12px; font-size: 12px; }
/* v1.0.500：成交明细表全部居中（覆盖 sg-table 默认左对齐与 sg-right 右对齐） */
.pp-log-table th, .pp-log-table td { text-align: center !important; }
#ppTradeLogBody .pp-name-link { cursor: pointer; text-decoration: none; display: inline-block; max-width: 100%; }
#ppTradeLogBody .pp-name-link .sg-name,
#ppTradeLogBody .pp-name-link .sg-code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ppTradeLogBody .pp-name-link:hover .sg-name { text-decoration: underline; color: #2563eb; }
body.dark #ppTradeLogBody .pp-name-link:hover .sg-name { color: #7cb0ff; }
.pp-log-table th, .pp-log-table td { padding: 6px 8px; white-space: nowrap; }
.pp-log-table .sg-right { text-align: right; }
.pp-buy { color: #e0352f; }   /* 买入 / 盈利 = 红（A股惯例） */

/* v1.0.504：模拟盘「网格交易」入口（操作列蓝色按钮 + 持仓「网格 ×N」徽章） */
#ppBody .pp-grid { background: #e6f1fb; color: #185fa5; border-color: #b5d4f4; }
#ppBody .pp-grid:hover { background: #d4e6fb; border-color: #85b7eb; }
#ppBody .pp-grid.on { background: #185fa5; color: #fff; border-color: #185fa5; }
#ppBody .pp-grid-stop { background: #fdecec; color: #c0392b; border-color: #f2c4c4; }
#ppBody .pp-grid-stop:hover { background: #f9d6d6; border-color: #e6a3a3; }
body.dark #ppBody .pp-grid { background: #16314e; color: #7cb0ff; border-color: #1f4a73; }
body.dark #ppBody .pp-grid:hover { background: #1d3e60; }
body.dark #ppBody .pp-grid.on { background: #185fa5; color: #fff; }
body.dark #ppBody .pp-grid-stop { background: #3a2426; color: #f19999; border-color: #5c3436; }
.pp-grid-badge { display: inline-block; padding: 2px 8px; margin-right: 6px; font-size: 12px; line-height: 18px; color: #185fa5; background: #e6f1fb; border: 0.5px solid #b5d4f4; border-radius: 6px; }
body.dark .pp-grid-badge { color: #7cb0ff; background: #16314e; border-color: #1f4a73; }
/* v1.0.533：「网格 ×N」徽章可点击；名称/代码旁「条件单」标识（券商APP样式：白底蓝框蓝字） */
.pp-grid-badge.pp-grid-badge-link { cursor: pointer; }
.pp-grid-badge.pp-grid-badge-link:hover { background: #d3e6f9; }
body.dark .pp-grid-badge.pp-grid-badge-link:hover { background: #1d4066; }
/* v1.0.551：条件单标识高度减 10%（line-height 16→14px，总高 20→18px） */
.pp-cond-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; line-height: 14px; vertical-align: 1px; color: #2b7de1; background: #fff; border: 1px solid #e86a6a; border-radius: 4px; white-space: nowrap; cursor: pointer; } /* v1.0.564：外框线蓝→红，字体颜色不变 */
.pp-cond-tag:hover { background: #e8f1fc; }
body.dark .pp-cond-tag { color: #7cb0ff; background: transparent; border-color: #8a4a4a; } /* v1.0.564：dark 外框同步转红 */
body.dark .pp-cond-tag:hover { background: #16314e; }
/* v1.0.533：名称第一行 = 名称 + 条件单标识同行（.sg-name 在行容器内改回 inline） */
#ppBody .pp-name-link .pp-name-line, #ppTradeLogBody .pp-name-link .pp-name-line { display: block; }
#ppBody .pp-name-link .pp-name-line .sg-name, #ppTradeLogBody .pp-name-link .pp-name-line .sg-name { display: inline; }
/* v1.0.533：条件单面板弹窗（仿券商APP：分组 + 双列磁贴 + 查询条） */
.pp-cond-modal { position: relative; width: 400px; min-width: 300px; max-width: 92vw; max-height: 80vh; overflow-y: auto; border-radius: 14px; padding: 18px 18px 14px; }
.pp-cond-title { text-align: center; font-size: 16px; font-weight: 600; }
.pp-cond-stock { text-align: center; font-size: 12px; color: var(--color-text-tertiary); margin: 4px 0 6px; }
.pp-cond-sec { font-size: 13px; font-weight: 600; margin: 12px 0 8px; }
.pp-cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-cond-item { display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: #f5f6f8; border: 0; border-radius: 10px; font-size: 13px; color: var(--color-text-primary); cursor: pointer; text-align: left; }
.pp-cond-item:hover { background: #eceef1; }
.pp-cond-item svg { flex: 0 0 auto; color: var(--color-text-secondary); }
body.dark .pp-cond-item { background: #23272e; color: #d6d9dd; }
body.dark .pp-cond-item:hover { background: #2b3038; }
.pp-cond-query { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 14px; padding: 10px 0; background: #e8f1fc; color: #2b7de1; border: 0; border-radius: 10px; font-size: 13px; cursor: pointer; }
.pp-cond-query:hover { background: #d9e8fa; }
body.dark .pp-cond-query { background: #16314e; color: #7cb0ff; }
body.dark .pp-cond-query:hover { background: #1d4066; }
/* v1.0.535：条件单表单弹窗（定价买入/反弹买入/定期定投，蓝色头部 + 分节行式表单） */
/* v1.0.580：7 个条件单表单窗口统一——宽固定 400px、高=浏览器高 86%，超出时中间内容区滚动（头部/确定按钮固定） */
.pp-cf-modal { position: relative; width: 400px; min-width: 300px; max-width: 94vw; height: 86vh; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; padding: 0 0 14px; }
.pp-cf-modal .pp-cf-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.pp-cf-back { position: absolute; top: 10px; left: 10px; z-index: 2; width: 30px; height: 30px; line-height: 26px; padding: 0; font-size: 22px; color: #fff; background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-weight: 300; }
/* v1.0.536：表单弹窗右上角「×」直接关闭（不下单） */
/* v1.0.539：表单弹窗右上角「×」——标题栏是白底，白色看不见，改深灰 */
.pp-cf-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; line-height: 26px; padding: 0; font-size: 20px; color: #555; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.pp-cf-close:hover { color: #111; background: #f0f2f5; }
body.dark .pp-cf-close { color: #c3ccd8; }
body.dark .pp-cf-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
/* v1.0.537：定价买入「委托价」券商APP式交互——类型按钮 + 限价标签/限价类型 + 底部选单 */
.pp-cf-mode-btn { padding: 4px 10px; font-size: 13px; color: #333; background: #f4f6f9; border: 0.5px solid #dfe4ec; border-radius: 6px; cursor: pointer; white-space: nowrap; }
/* v1.0.542：委托价这行按券商APP的比例排布——左「委托价」标签+委托方式，右侧放限价类型（最右箭头）/自定义输入框 */
.pp-cf-prow .pp-cf-mode-btn { flex: 0 0 auto; }
.pp-cf-limwrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pp-cf-limwrap .pp-cf-lim-btn { margin-right: 0; }
.pp-cf-pcustom { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pp-cf-lim-btn { padding: 4px 10px; margin-right: 6px; font-size: 13px; font-weight: 600; color: #1a1a1a; background: transparent; border: 0; cursor: pointer; white-space: nowrap; }
.pp-sheet-mask { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.45); }
.pp-sheet { width: 100%; max-width: 520px; background: #fff; border-radius: 14px 14px 0 0; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); }
.pp-sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 0.5px solid #f0f0f0; }
.pp-sheet-tt { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.pp-sheet-no { font-size: 14px; color: #333; background: transparent; border: 0; cursor: pointer; }
.pp-sheet-ok { font-size: 14px; color: #2b7de1; background: transparent; border: 0; cursor: pointer; }
.pp-sheet-item { display: block; width: 100%; padding: 14px 0; font-size: 15px; color: #333; text-align: center; background: #fff; border: 0; border-bottom: 0.5px solid #f5f5f5; cursor: pointer; }
.pp-sheet-item:hover { background: #f7f9fc; }
.pp-sheet-item.pp-sheet-cur { color: #111; font-weight: 700; }
.pp-sheet-item.pp-sheet-cancel { margin-top: 6px; border-top: 6px solid #f5f6f8; border-bottom: 0; }
/* v1.0.541：限价类型列表可上下滚动（卖五~买五共 11 档） */
.pp-sheet-list { max-height: 288px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pp-sheet-list .pp-sheet-item:last-child { border-bottom: 0; }
/* v1.0.538：委托价类型下拉框（锚定按钮下方的小面板，非底部弹层） */
.pp-drop { position: fixed; z-index: 10001; display: none; width: 150px; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.22); overflow: hidden; }
.pp-drop .pp-sheet-item { padding: 12px 0; font-size: 14px; border-bottom: 0.5px solid #f2f2f2; }
.pp-drop .pp-sheet-item.pp-sheet-cancel { margin-top: 0; border-top: 0.5px solid #f2f2f2; }
body.dark .pp-drop { background: #1c232e; box-shadow: 0 8px 28px rgba(0,0,0,0.55); }
body.dark .pp-drop .pp-sheet-item { background: #1c232e; border-bottom-color: #262f3c; }
body.dark .pp-cf-mode-btn { color: #d5dce6; background: #232a35; border-color: #333c4a; }
body.dark .pp-cf-lim-btn { color: #e8edf4; }
body.dark .pp-sheet { background: #1c232e; }
body.dark .pp-sheet-tt { color: #e8edf4; }
body.dark .pp-sheet-no { color: #c3ccd8; }
body.dark .pp-sheet-item { color: #c9d2de; background: #1c232e; border-bottom-color: #262f3c; }
body.dark .pp-sheet-item:hover { background: #232c39; }
body.dark .pp-sheet-item.pp-sheet-cur { color: #fff; }
body.dark .pp-sheet-item.pp-sheet-cancel { border-top-color: #262f3c; }
.pp-cf-hd { text-align: center; font-size: 15px; font-weight: 600; padding: 12px 0 10px; }
.pp-cf-quote { background: linear-gradient(180deg, #3f8bfb, #2b6fe3); color: #fff; padding: 14px 16px 16px; text-align: center; }
.pp-cf-stock { font-size: 19px; font-weight: 600; }
.pp-cf-stock .cd { font-size: 13px; opacity: 0.85; font-weight: 400; }
.pp-cf-quote-row { display: flex; justify-content: center; gap: 28px; margin-top: 10px; font-size: 12.5px; opacity: 0.95; }
.pp-cf-body { padding: 4px 16px 0; }
.pp-cf-sec { font-size: 13px; font-weight: 600; margin: 14px 0 4px; padding-left: 7px; border-left: 3px solid #2b7de1; line-height: 15px; }
.pp-cf-sub { font-size: 11px; font-weight: 400; color: var(--color-text-tertiary); }
.pp-cf-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--color-border, #eee); }
.pp-cf-lbl { flex: 0 0 auto; font-size: 13.5px; }
.pp-cf-row input[type="number"] { flex: 1 1 auto; min-width: 60px; border: 0; outline: none; background: transparent; text-align: center; font-size: 14px; color: var(--color-text-primary); }
.pp-cf-op { color: #2b7de1; font-weight: 600; }
.pp-cf-qie { color: #2b7de1; font-weight: 600; margin-right: 2px; }
.pp-cf-step { flex: 0 0 auto; width: 26px; height: 26px; line-height: 22px; padding: 0; font-size: 16px; color: #2b7de1; background: transparent; border: 1px solid #cfe0f5; border-radius: 50%; cursor: pointer; }
.pp-cf-step:hover { background: #e8f1fc; }
.pp-cf-sel { border: 0; background: transparent; color: var(--color-text-primary); font-size: 12.5px; outline: none; cursor: pointer; }
.pp-cf-sel.grow { flex: 1 1 auto; text-align: right; }
.pp-cf-radios { display: flex; justify-content: flex-end; gap: 16px; padding: 8px 0 2px; font-size: 12.5px; color: var(--color-text-secondary); }
.pp-cf-radios label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.pp-cf-fig { display: block; width: 100%; margin: 8px 0 2px; }
.pp-cf-fracs { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 2px; }
.pp-cf-fracs button { flex: 1 1 auto; min-width: 52px; padding: 7px 0; font-size: 12.5px; color: var(--color-text-secondary); background: #f5f6f8; border: 0; border-radius: 16px; cursor: pointer; }
.pp-cf-fracs button:hover { background: #e8ecf1; }
body.dark .pp-cf-fracs button { background: #23272e; color: #c9cdd3; }
body.dark .pp-cf-fracs button:hover { background: #2b3038; }
.pp-cf-note { font-size: 11.5px; color: var(--color-text-tertiary); padding: 6px 0 0; }
.pp-cf-info { display: flex; justify-content: space-between; font-size: 12px; color: #c87d2a; background: #fdf6ec; margin: 10px -16px 0; padding: 8px 16px; }
body.dark .pp-cf-info { background: #33291c; color: #e0a35c; }
.pp-cf-exprow { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; font-size: 13.5px; }
.pp-cf-exprow .pp-cf-sub { margin-right: auto; }
.pp-cf-exprow input[type="date"] { border: 0; background: transparent; color: var(--color-text-primary); font-size: 13px; outline: none; }
.pp-cf-eod { font-size: 12.5px; color: var(--color-text-secondary); white-space: nowrap; }
.pp-cf-adv { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 12px 0 0; font-size: 13px; color: #2b7de1; cursor: pointer; }
.pp-cf-advbox { font-size: 12px; color: var(--color-text-tertiary); padding: 8px 0 0; }
.pp-cf-acct { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 14px 0 2px; border-top: 1px solid var(--color-border, #eee); margin-top: 12px; }
.pp-cf-link { font-size: 12.5px; color: #2b7de1; cursor: pointer; }
.pp-cf-ok { display: block; width: calc(100% - 32px); margin: 16px auto 0; padding: 12px 0; font-size: 15px; letter-spacing: 6px; color: #fff; background: #2b7de1; border: 0; border-radius: 24px; cursor: pointer; }
.pp-cf-ok:hover { background: #256cc7; }
body.dark .pp-cf-body { color: #d6d9dd; }
body.dark .pp-cf-row { border-bottom-color: #2c313a; }
body.dark .pp-cf-step { border-color: #2c5d92; }
body.dark .pp-cf-exprow input[type="date"] { color-scheme: dark; }

/* v1.0.543/544：三个条件单表单整页对齐券商APP参考图（布局 + 字号），.pp-cf-page 为这三页专属 */
.pp-cf-page .pp-cf-hd { font-size: 16px; padding: 13px 0 11px; }
/* v1.0.547：出现竖滚动条时，信息条那种 -16px 满宽元素会挤出横向滚动条，这里挡掉 */
.pp-cf-page { overflow-x: hidden; }
.pp-cf-page .pp-cf-quote { padding: 16px 16px 18px; }
.pp-cf-page .pp-cf-stock { font-size: 20px; }
.pp-cf-page .pp-cf-stock span[id$="Code"] { font-size: 14px; font-weight: 400; opacity: 0.9; }
.pp-cf-page .pp-cf-quote-row { font-size: 13px; gap: 44px; margin-top: 12px; }
.pp-cf-page .pp-cf-body { padding: 4px 16px 0; }
.pp-cf-page .pp-cf-sec { font-size: 14.5px; margin: 16px 0 2px; line-height: 17px; }
.pp-cf-page .pp-cf-sub { font-size: 11.5px; }
.pp-cf-page .pp-cf-row { padding: 12px 0; }
.pp-cf-page .pp-cf-lbl { font-size: 15px; }
.pp-cf-page .pp-cf-row input[type="number"] { font-size: 15px; flex: 0 0 auto; width: 150px; }
.pp-cf-page .pp-cf-row > button.pp-cf-step { flex: 0 0 auto; width: 28px; height: 28px; line-height: 26px; padding: 0; font-size: 20px; font-weight: 300; color: #b6bcc4; background: transparent; border: 0; border-radius: 0; }
.pp-cf-page .pp-cf-row > button.pp-cf-step:first-of-type { margin-left: auto; }
.pp-cf-page .pp-cf-row > button.pp-cf-step:last-of-type { color: #3a3f46; }
.pp-cf-page .pp-cf-row > button.pp-cf-step:hover { background: transparent; color: #2b7de1; }
.pp-cf-page .pp-cf-mode-btn { padding: 3px 9px; font-size: 12px; color: #9aa0a8; background: #f2f3f5; border: 0; border-radius: 6px; }
.pp-cf-page .pp-cf-limwrap { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; margin-left: 0; }
.pp-cf-page .pp-cf-lim-btn { display: flex; align-items: center; padding: 0; margin: 0; font-size: 15.5px; font-weight: 500; color: #1a1a1a; background: transparent; border: 0; cursor: pointer; }
.pp-cf-page .pp-cf-lim-caret { margin-left: 50px; font-size: 17px; line-height: 1; color: #6f757d; }
/* v1.0.581：min-width:0——弹性输入框默认不能缩到内容宽以下，会把 400px 窗口撑出横向滚动条（7 个表单共用） */
.pp-cf-page .pp-cf-pcustom { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.pp-cf-page .pp-cf-pcustom input[type="number"] { flex: 1 1 auto; width: auto; min-width: 0; }
.pp-cf-page .pp-cf-fracs { gap: 8px; padding: 10px 0 2px; }
.pp-cf-page .pp-cf-fracs button { padding: 8px 0; font-size: 13.5px; color: #333; border-radius: 18px; }
.pp-cf-page .pp-cf-note { font-size: 12px; color: #b4b9c0; padding: 8px 0 0; }
.pp-cf-page .pp-cf-info { font-size: 13.5px; padding: 12px 16px; }
.pp-cf-page .pp-cf-exprow { font-size: 15.5px; padding: 14px 0 4px; }
/* v1.0.545：截止时间行对齐参考图——日期显示为点分格式（原生日期框透明覆盖在上面，点它照旧弹日历），收盘前后是最右灰箭头 */
.pp-cf-page .pp-cf-expwrap { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; margin-left: 0; }
.pp-cf-page .pp-cf-exptext { font-size: 15px; color: #1a1a1a; }
.pp-cf-page .pp-cf-expin { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.pp-cf-page .pp-cf-eod { margin-left: 10px; font-size: 13.5px; color: #333; }
.pp-cf-page .pp-cf-expcaret { margin-left: 22px; font-size: 16px; color: #6f757d; }
.pp-cf-page .pp-cf-ok { font-size: 16.5px; padding: 13px 0; }
.pp-cf-page .pp-cf-ok:disabled { color: #b9bcc1; background: #e9eaec; cursor: default; }
body.dark .pp-cf-page .pp-cf-lim-txt { color: #e8edf4; }
body.dark .pp-cf-page .pp-cf-mode-btn { color: #9aa0a8; background: #232a35; border: 0; }
body.dark .pp-cf-page .pp-cf-row > button.pp-cf-step { color: #6b727c; border: 0; }
body.dark .pp-cf-page .pp-cf-row > button.pp-cf-step:last-of-type { color: #d5dce6; }
body.dark .pp-cf-page .pp-cf-fracs button { color: #c9cdd3; }
body.dark .pp-cf-page .pp-cf-note { color: #79828e; }
body.dark .pp-cf-page .pp-cf-eod { color: #c3ccd8; }
body.dark .pp-cf-page .pp-cf-exptext { color: #e8edf4; }
body.dark .pp-cf-page .pp-cf-ok:disabled { color: #616a76; background: #2a303a; }

/* v1.0.544：委托价「限价/市价」芯片 + 右侧取值 + 行最右箭头（原生 select 去掉控件外观，视觉对齐参考图） */
.pp-cf-page .pp-cf-chipwrap { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; }
.pp-cf-page .pp-cf-chipwrap select { -webkit-appearance: none; appearance: none; padding: 3px 20px 3px 9px; font-size: 12px; color: #9aa0a8; background: #f2f3f5; border: 0; border-radius: 6px; outline: none; cursor: pointer; }
.pp-cf-page .pp-cf-chipcaret { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #9aa0a8; pointer-events: none; }
.pp-cf-page .pp-cf-valwrap { position: relative; flex: 1 1 auto; display: flex; justify-content: flex-end; margin-left: 0; }
.pp-cf-page .pp-cf-valwrap select { -webkit-appearance: none; appearance: none; width: 100%; padding: 0 50px 0 0; font-size: 15.5px; font-weight: 500; color: #1a1a1a; text-align: right; background: transparent; border: 0; outline: none; cursor: pointer; }
.pp-cf-page .pp-cf-valcaret { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 17px; line-height: 1; color: #6f757d; pointer-events: none; }
/* 周期/委托时间等「请选择…」下拉：文字靠右、未选时灰色、箭头在行最右 */
.pp-cf-page .pp-cf-selrow { position: relative; display: flex; flex: 1 1 auto; align-items: center; }
.pp-cf-page .pp-cf-selrow select { -webkit-appearance: none; appearance: none; width: 100%; padding: 0 34px 0 0; font-size: 15px; color: #1a1a1a; text-align: right; background: transparent; border: 0; outline: none; cursor: pointer; }
.pp-cf-page .pp-cf-selrow select:has(option[value=""]:checked) { color: #b4b9c0; }
.pp-cf-page .pp-cf-selcaret { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 16px; color: #8a9099; pointer-events: none; }
/* 按百分比/按差价：选中项蓝色（与参考图一致） */
.pp-cf-page .pp-cf-radios { font-size: 13px; padding: 10px 0 0; gap: 18px; }
.pp-cf-page .pp-cf-radios input { accent-color: #2b7de1; width: 14px; height: 14px; }
.pp-cf-page .pp-cf-radios label:has(input:checked) { color: #2b7de1; }
/* 定期定投：预计至…结束 靠右显示在期数输入框下方 */
.pp-cf-page#ppCfAutoOverlay .pp-cf-note { text-align: right; }
body.dark .pp-cf-page .pp-cf-chipwrap select { color: #9aa0a8; background: #232a35; }
body.dark .pp-cf-page .pp-cf-valwrap select { color: #e8edf4; }
body.dark .pp-cf-page .pp-cf-selrow select { color: #e8edf4; }
/* v1.0.546：高级设置折叠箭头也放大（参考图里三角都较明显） */
.pp-cf-page .pp-cf-caret { font-size: 16px; line-height: 1; }
/* 委托方式芯片里的三角小一号（芯片本身只有 12px 字） */
.pp-cf-page .pp-cf-mode-btn .pp-cf-caret { font-size: 12px; }
/* 深色模式下三角别太暗 */
body.dark .pp-cf-page .pp-cf-valcaret, body.dark .pp-cf-page .pp-cf-expcaret, body.dark .pp-cf-page .pp-cf-lim-caret { color: #9aa0a8; }
body.dark .pp-cf-page .pp-cf-selcaret, body.dark .pp-cf-page .pp-cf-chipcaret { color: #79828e; }
body.dark .pp-cf-page .pp-cf-selrow select:has(option[value=""]:checked) { color: #79828e; }

/* v1.0.504：网格交易设置弹窗（复用 .modal-overlay / .modal 外壳） */
/* v1.0.505：窗口 60% 宽 × 80% 高，头部/创建按钮固定，中间滚动；整体行距压缩 */
/* v1.0.568：网格弹窗不再垂直居中（center 会随内容高度上下漂——按百分比/按价差切换时顶部空白忽大忽小），
   固定 top 对齐：顶部留 80px（导航栏下方），弹窗超高时内部 .pp-grid-body 自己滚 */
.pp-grid-overlay { z-index: 60; align-items: flex-start; padding-top: 80px; }
.pp-grid-modal { width: 40vw; min-width: 520px; max-width: 94vw; height: auto; max-height: calc(100vh - 92px); padding: 11px 28px 9px; display: flex; flex-direction: column; overflow: hidden; overflow-x: hidden; } /* v1.0.574：左右内边距 22→28px（祥风要看效果） */
.pp-grid-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.pp-grid-hd { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; padding-bottom: 6px; border-bottom: 0.5px solid var(--color-border-tertiary); flex: 0 0 auto; }
.pp-grid-hd .code { font-size: 13px; color: var(--color-text-secondary); }
.pp-grid-hd .px { font-size: 14px; font-weight: 500; margin-left: auto; }
.pp-grid-hint { margin: 6px 0 1px; padding: 3px 8px; background: #e6f1fb; border-radius: 8px; font-size: 11.5px; color: #185fa5; display: flex; justify-content: space-between; align-items: center; }
body.dark .pp-grid-hint { background: #16314e; color: #7cb0ff; }
.pp-grid-sec-title { font-size: 12.5px; font-weight: 500; margin: 5px 0 1px; display: flex; align-items: center; justify-content: space-between; }
.pp-grid-fig { border: 0.5px solid var(--color-border-tertiary); border-radius: 8px; padding: 2px 8px; background: var(--color-background-secondary); margin-bottom: 1px; }
.pp-grid-fig svg { max-height: 92px; margin: 0 auto; }
.pp-grid-row { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; padding: 3px 0; border-bottom: 0.5px solid var(--color-border-tertiary); }
.pp-grid-row .lbl { font-size: 12.5px; width: 100px; flex: 0 0 auto; white-space: nowrap; } /* v1.0.566：82→100px 固定宽 + 不换行——「每上涨 元 卖出」等长文案（按差价模式）不再折到第二行 */
/* v1.0.506：步进输入组与有效期日期框统一 30% 宽 */
.pp-grid-step { display: inline-flex; align-items: center; flex: 0 0 22%; min-width: 118px; max-width: 22%; }
.pp-grid-step button { width: 28px; height: 26px; background: #fff; border: 1px solid #cbd5e1; color: #c0392b; font-size: 15px; cursor: pointer; }
.pp-grid-step button:first-child { border-radius: 8px 0 0 8px; }
.pp-grid-step button:last-child { border-radius: 0 8px 8px 0; }
.pp-grid-step input { flex: 1; min-width: 0; height: 26px; text-align: center; border: 1px solid #cbd5e1; border-left: 0; border-right: 0; font-size: 13.5px; }
.pp-grid-mini { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; height: 26px; padding: 0 8px; font-size: 12.5px; flex: 0 0 30%; max-width: 30%; width: 30%; }
.pp-grid-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--color-text-secondary); margin-left: 2px; cursor: pointer; white-space: nowrap; }
.pp-grid-toggle input { width: 13px; height: 13px; }
/* v1.0.519：回落卖出/反弹买入右侧的默认值提示（暂时纯样式，未接逻辑） */
.pp-grid-def-hint { flex: 0 1 auto; min-width: 60px; text-align: center; padding: 1px 6px; font-size: 11.5px; overflow: hidden; color: var(--color-text-tertiary); background: var(--color-background-secondary); border: 0.5px solid var(--color-border-tertiary); border-radius: 8px; white-space: nowrap; }
/* v1.0.521：默认值提示右侧改为「真实 ATR + 可编辑 M 倍数（默认 1）」内联组 */
.pp-grid-def-atr { flex: 0 1 auto; min-width: 0; margin-left: 6px; font-size: 11.5px; color: var(--color-text-secondary); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pp-grid-def-atr input { width: 46px; height: 22px; text-align: center; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 11.5px; }
body.dark .pp-grid-def-atr input { border-color: #3a4a5e; background: var(--color-background-secondary); color: var(--color-text-primary); }
/* v1.0.563：初始基准价行右侧「M= [输入框] [设置]」——统一设置卖/买两侧 M 倍数
   v1.0.565：display:contents 让 label/input/button 直接成为 .pp-grid-row 的弹性项，
   输入框才能像步进组一样按行宽 22% 取宽（挂在 span 里百分比会解析到 auto 宽容器上失效） */
.pp-grid-mset { display: contents; }
.pp-grid-mset-lbl { margin-left: auto; font-size: 11.5px; color: var(--color-text-secondary); white-space: nowrap; }
.pp-grid-mset input { flex: 0 0 22%; width: 22%; height: 22px; box-sizing: border-box; text-align: center; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 11.5px; }
.pp-grid-mset button { height: 22px; padding: 0 10px; font-size: 11.5px; border: 1px solid #c4d9fa; background: #eaf2fe; color: #1d6ae5; border-radius: 6px; cursor: pointer; }
.pp-grid-mset button:hover { background: #d8e7fd; border-color: #9cc2f5; }
body.dark .pp-grid-mset input { border-color: #3a4a5e; background: var(--color-background-secondary); color: var(--color-text-primary); }
body.dark .pp-grid-mset button { background: #1c2c46; color: #7aa7f5; border-color: #2f4a75; }
body.dark .pp-grid-mset button:hover { background: #243755; }
.pp-grid-radios label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; margin-right: 18px; white-space: nowrap; }
.pp-grid-unit { flex: 0 0 20%; max-width: 20%; width: 20%; height: 26px; text-align: center; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12.5px; }
.pp-grid-exp { display: flex; gap: 6px; margin-top: 4px; }
.pp-grid-exp button { flex: 1; height: 24px; font-size: 11.5px; cursor: pointer; }
.pp-grid-exp button.on { background: #185fa5; color: #fff; border-color: #185fa5; }
.pp-grid-preview { border: 0.5px solid var(--color-border-tertiary); border-radius: 8px; padding: 3px 8px; background: var(--color-background-secondary); margin: 4px 0 4px; font-size: 11.5px; }
.pp-grid-preview table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pp-grid-preview th, .pp-grid-preview td { padding: 1px 4px; text-align: center; white-space: nowrap; line-height: 1.35; }
.pp-grid-preview .buy { color: #e0352f; } .pp-grid-preview .sell { color: #185fa5; }
.pp-grid-risk { font-size: 12px; color: #c0392b; margin-bottom: 6px; }
#ppGridCreate { width: 100%; height: 34px; border-radius: 8px; background: #e0352f; color: #fff; font-size: 14.5px; font-weight: 500; cursor: pointer; border: 0; flex: 0 0 auto; margin-top: 6px; }
body.dark #ppGridCreate { background: #c0392b; }
/* v1.0.553：编辑已有策略时，底部并排给一个「＋ 新建一条」（不会覆盖当前这条） */
.pp-grid-foot { display: flex; gap: 8px; flex: 0 0 auto; margin-top: 8px; }
.pp-grid-foot #ppGridCreate { margin-top: 0; }
#ppGridCreateNew { width: 132px; height: 38px; flex: 0 0 auto; font-size: 14px; color: #2b7de1; background: #eaf3fd; border: 0; border-radius: 8px; cursor: pointer; }
#ppGridCreateNew:hover { background: #d9e9fb; }
body.dark #ppGridCreateNew { color: #7cb0ff; background: #16314e; }
/* ===== v1.0.582：网格弹窗配色重设计（布局与文字不动，只换颜色气质） ===== */
/* 头部：蓝色渐变横幅，白字 */
.pp-grid-hd { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); border-radius: 10px; padding: 8px 12px; border-bottom: 0; box-shadow: 0 2px 10px rgba(47, 111, 224, 0.28); }
.pp-grid-hd > span { color: #fff; }
.pp-grid-hd .code { color: rgba(255, 255, 255, 0.82); }
.pp-grid-hd .pp-grid-modehint { color: rgba(255, 255, 255, 0.88); }
/* 提示条：浅蓝渐变 + 左侧蓝条 */
.pp-grid-hint { background: linear-gradient(90deg, #eaf3ff, #f5f9ff); border-left: 3px solid #2f6fe0; color: #2b6ad0; }
body.dark .pp-grid-hint { background: #16314e; }
/* 分节标题：左侧蓝色小竖条 */
.pp-grid-sec-title { color: #33415c; padding-left: 8px; border-left: 3px solid #2f6fe0; }
/* 示意图：淡蓝渐变底 */
.pp-grid-fig { background: linear-gradient(180deg, #f8fbff, #eef4fd); border-color: #dfe8f7; }
/* 行分隔线更淡 */
.pp-grid-row { border-bottom-color: #eef2f8; }
/* 步进组：蓝色按钮 + 淡蓝输入底 */
.pp-grid-step button { background: #f4f7fc; border-color: #d8e2f2; color: #2f6fe0; }
.pp-grid-step button:hover { background: #e8f0fc; }
.pp-grid-step input, .pp-grid-mini, .pp-grid-unit, .pp-grid-mset input, .pp-grid-def-atr input { background: #fbfdff; border-color: #d8e2f2; }
.pp-grid-step input:focus, .pp-grid-mini:focus, .pp-grid-unit:focus, .pp-grid-mset input:focus { border-color: #2f6fe0; outline: none; }
/* 默认值提示：淡蓝胶囊 */
.pp-grid-def-hint { background: #f2f6fd; border-color: #e2eaf6; color: #5a7db0; }
/* M 设置按钮：蓝渐变白字 */
.pp-grid-mset button { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); color: #fff; border: 0; }
.pp-grid-mset button:hover { filter: brightness(1.08); }
/* 单选/复选蓝色 */
.pp-grid-radios input, .pp-grid-toggle input { accent-color: #2f6fe0; }
/* 有效期快捷按钮：浅灰芯片，选中蓝渐变 */
.pp-grid-exp button { background: #f2f5fa; border: 1px solid #e4eaf4; color: #5a6b85; border-radius: 8px; }
.pp-grid-exp button:hover { border-color: #b9cdf0; color: #2f6fe0; }
.pp-grid-exp button.on { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(47, 111, 224, 0.35); }
/* 预览表：淡蓝底 + 表头蓝灰 + A股红涨绿跌 */
.pp-grid-preview { background: #f8fafe; border-color: #e3ebf7; }
.pp-grid-preview th { color: #5a6b85; border-bottom: 1px solid #e0e8f5; }
.pp-grid-preview .buy { color: #e0352f; }
.pp-grid-preview .sell { color: #16a34a; }
/* 创建策略按钮：蓝渐变 + 投影 */
#ppGridCreate { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); box-shadow: 0 4px 12px rgba(47, 111, 224, 0.35); border-radius: 10px; }
#ppGridCreate:hover { filter: brightness(1.06); }
body.dark #ppGridCreate { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); }
/* 深色模式适配 */
body.dark .pp-grid-hd { background: linear-gradient(135deg, #1e3f7e, #2f5cae); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
body.dark .pp-grid-sec-title { color: #c9d4e6; }
body.dark .pp-grid-fig { background: linear-gradient(180deg, #1b2740, #182238); border-color: #2c3a56; }
body.dark .pp-grid-row { border-bottom-color: #24304a; }
body.dark .pp-grid-step button { background: #202c44; border-color: #31415f; color: #7aa7f5; }
body.dark .pp-grid-step input, body.dark .pp-grid-mini, body.dark .pp-grid-unit, body.dark .pp-grid-mset input, body.dark .pp-grid-def-atr input { background: #1a2536; border-color: #31415f; color: var(--color-text-primary); }
body.dark .pp-grid-def-hint { background: #1c2c46; border-color: #2f4a75; color: #7aa7f5; }
body.dark .pp-grid-exp button { background: #1c2740; border-color: #2c3a56; color: #9fb0cc; }
body.dark .pp-grid-exp button.on { background: linear-gradient(135deg, #2f6fe0, #5a8ff0); color: #fff; }
body.dark .pp-grid-preview { background: #1b2740; border-color: #2c3a56; }
body.dark .pp-grid-preview th { color: #9fb0cc; border-bottom-color: #2c3a56; }
/* v1.0.583：× 收进蓝色标题横幅内——白色半透明圆底，不再悬在白底上发灰 */
.pp-grid-modal .modal-close { top: 16px; right: 38px; width: 24px; height: 24px; line-height: 22px; font-size: 17px; color: #fff; background: rgba(255, 255, 255, 0.22); }
.pp-grid-modal .modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.4); }
body.dark .pp-grid-modal .modal-close { color: #fff; }
body.dark .pp-grid-modal .modal-close:hover { background: rgba(255, 255, 255, 0.35); }
/* 标题行微调：主标题加重、行内垂直居中更稳 */
.pp-grid-hd { align-items: center; padding-top: 9px; padding-bottom: 9px; }
.pp-grid-hd > span:first-child { font-weight: 600; letter-spacing: 0.5px; }
.pp-sell { color: #1ba784; }  /* 卖出 / 亏损 = 绿 */
/* 加仓/减仓弹窗 */
.pp-trade-info { font-size: 12px; color: #475569; line-height: 1.9; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; }
.pp-trade-info b { color: #1e3c72; }
.pp-trade-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.pp-trade-quick button { padding: 4px 10px; font-size: 12px; border: 1px solid #c5d3e8; background: #f0f4fa; color: #1e3c72; border-radius: 4px; cursor: pointer; }
.pp-trade-quick button:hover { background: #d4e0f3; }
body.dark .pp-trade-info { background: #1b2637; border-color: #2b3a52; color: #a8b2bf; }
body.dark .pp-trade-info b { color: #c4b5fd; }
body.dark .pp-trade-quick button { background: #1b2637; color: #c4b5fd; border-color: #2b3a52; }
body.dark .pp-trade-quick button:hover { background: #26344c; }

/* —— v1.0.144：信号中心活泼化（复用回测页整套 .bt-* 样式，青绿雷达配色） —— */
/* v1.0.299：signalsView 改 flex 纵向布局——视图本身不再滚动（消除右侧滚动条），信号表格弹性占满剩余高度、行在表格内部滚动 */
/* v1.0.300：滚动条回归——视图保持弹性不整体滚动（无多余右侧滚动条），但信号表格内部常显滚动条 + 表头吸顶，保证下方信号始终可滚到 */
#signalsView.sg-view { overflow-y: auto; display: flex; flex-direction: column; }
#signalsView.sg-view > * { flex-shrink: 0; }
#signalsView.sg-view > .bt-table-wrap { flex: 1 1 0%; min-height: 220px; max-height: none; overflow-y: scroll; overflow-x: hidden; }
/* 表头吸顶：滚动时列名始终可见 */
#signalsView .bt-table-wrap thead th { position: sticky; top: 0; z-index: 2; }
/* 滚动条美化（常显，细条圆角） */
#signalsView .bt-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
#signalsView .bt-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
#signalsView .bt-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: padding-box; }
#signalsView .bt-table-wrap::-webkit-scrollbar-track { background: #f1f5f9; }
body.dark #signalsView .bt-table-wrap::-webkit-scrollbar-thumb { background: #475569; border: 2px solid transparent; background-clip: padding-box; }
body.dark #signalsView .bt-table-wrap::-webkit-scrollbar-thumb:hover { background: #64748b; border: 2px solid transparent; background-clip: padding-box; }
body.dark #signalsView .bt-table-wrap::-webkit-scrollbar-track { background: #1b2637; }
.bt-hero.signals {
  background: linear-gradient(115deg, #10b981, #14b8a6 45%, #06b6d4);
  box-shadow: 0 6px 16px rgba(20, 184, 166, 0.3);
}
#signalsView .bt-card-title { color: #0d9488; }
#signalsView .bt-run { background: linear-gradient(135deg, #14b8a6, #06b6d4); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3); }
#signalsView .bt-run:hover { box-shadow: 0 7px 16px rgba(6, 182, 212, 0.38); }
#signalsView .bt-field select:focus { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
#signalsView .bt-table-wrap .sg-table thead th { background: #ecfdf5; color: #047857; }
/* v1.0.303：信号清单「股票/代码」列（第2列，吃不到 td:first-child 规则）——名称在上、代码在下两行显示 */
#signalsView .sg-name-link { display: inline-block; max-width: 100%; }
#signalsView .sg-name-link .sg-name,
#signalsView .sg-name-link .sg-code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#signalsView .sg-name-link .sg-code { margin-top: 1px; }
/* v1.0.304：信号清单行高压矮——收紧行内边距/行距，股票两行改小字号紧凑排 */
#signalsView .bt-table-wrap .sg-table tbody td { padding: 2px 8px; line-height: 1.25; }
#signalsView .bt-table-wrap .sg-table thead th { padding: 5px 8px; }
#signalsView .sg-name-link .sg-name { font-size: 12px; line-height: 1.3; }
#signalsView .sg-name-link .sg-code { font-size: 10.5px; line-height: 1.2; margin-top: 0; }
#signalsView .sig-badge { padding: 1px 8px; line-height: 1.35; }
/* 信号行彩色徽章：方向（涨红跌绿）/ 强弱 / 状态 */
.sig-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.5; letter-spacing: 0.5px;
}
.sig-badge.buy { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }
.sig-badge.sell { color: #16a34a; background: rgba(22, 163, 74, 0.1); }
.sig-badge.strong { color: #d97706; background: rgba(245, 158, 11, 0.14); }
.sig-badge.weak { color: #94a3b8; background: rgba(148, 163, 184, 0.14); }
.sig-badge.live { color: #0d9488; background: rgba(20, 184, 166, 0.12); border: 1px dashed #14b8a6; }
.sig-badge.confirmed { color: #2563eb; background: rgba(59, 130, 246, 0.1); }
/* 深色主题适配 */
body.dark .bt-hero.signals { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
body.dark #signalsView .bt-card-title { color: #5eead4; }
body.dark #signalsView .bt-run.ghost { background: #243247; color: #5eead4; border-color: #0d9488; }
body.dark #signalsView .bt-table-wrap .sg-table thead th { background: #1b2637; color: #5eead4; }
body.dark .sig-badge.buy { background: rgba(231, 76, 60, 0.16); }
body.dark .sig-badge.sell { background: rgba(34, 197, 94, 0.16); }
body.dark .sig-badge.strong { background: rgba(245, 158, 11, 0.16); }
body.dark .sig-badge.weak { color: #8394ab; background: rgba(148, 163, 184, 0.16); }
body.dark .sig-badge.live { background: rgba(20, 184, 166, 0.16); }
body.dark .sig-badge.confirmed { background: rgba(59, 130, 246, 0.16); }

/* —— v1.0.411：行动卡只调颜色+字体颜色（版式保持上一版；embed-test 参考页不生效，留旧样式对比） —— */
/* 主按钮：青绿渐变整体加深一档（14b8a6→0d9488、06b6d4→0891b2），白字不变，降刺眼感 */
body:not(.embed-test) #signalsView .bt-run {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.26);
}
body:not(.embed-test) #signalsView .bt-run:hover { box-shadow: 0 7px 16px rgba(8, 145, 178, 0.34); }
/* v1.0.413：主/次按钮高度统一 36px（主按钮原 padding9px+13.5px 字，次按钮 7.5px+12.5px 字矮一截），
   改用固定高度 + 弹性居中，字号差异照旧保留；embed-test 参考页不受影响 */
body:not(.embed-test) #signalsView .bt-run {
  height: 36px; padding: 0 18px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
}
body:not(.embed-test) #signalsView .bt-run.ghost { height: 36px; padding: 0 16px; box-sizing: border-box; }

/* v1.0.412：次按钮与主按钮同款绿色填充、取消虚线外圈（白字，仅正式页；参考页保持旧样式对比） */
body:not(.embed-test) #signalsView .bt-run.ghost {
  background: linear-gradient(135deg, #0d9488, #0891b2); color: #ffffff;
  border: 0; box-shadow: 0 2px 6px rgba(13, 148, 136, 0.2);
}
body:not(.embed-test) #signalsView .bt-run.ghost:hover {
  background: linear-gradient(135deg, #0f766e, #0369a1);
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.3);
}
/* 暗色主题：次按钮文字由荧光青改为柔灰白，描边换中性灰 */
body.dark:not(.embed-test) #signalsView .bt-run { background: linear-gradient(135deg, #0d9488, #0891b2); }
body.dark:not(.embed-test) #signalsView .bt-run.ghost {
  background: linear-gradient(135deg, #0d9488, #0891b2); color: #ffffff; border: 0;
}
body.dark:not(.embed-test) #signalsView .bt-run.ghost:hover { background: linear-gradient(135deg, #0f766e, #0369a1); }

/* —— v1.0.145：信号提醒页内弹卡（右上角，替代被系统锁死在右下角的桌面通知） —— */
.sig-toast {
  position: fixed; top: 14px; right: 16px; z-index: 9999;
  width: 348px; max-height: 62vh; display: flex; flex-direction: column;
  background: #fff; border: 1.5px solid #ece9ff; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  animation: sig-toast-in 0.25s ease;
}
@keyframes sig-toast-in { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
.sig-toast-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: linear-gradient(115deg, #10b981, #14b8a6 45%, #06b6d4); color: #fff;
}
.sig-toast-title { font-size: 13.5px; font-weight: 800; letter-spacing: 0.3px; }
.sig-toast-close {
  border: none; background: rgba(255, 255, 255, 0.22); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1;
  cursor: pointer; transition: background 0.15s;
}
.sig-toast-close:hover { background: rgba(255, 255, 255, 0.4); }
.sig-toast-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.sig-toast-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; background: #f8fafc; border: 1px solid #eef2f7;
  cursor: pointer; transition: background 0.15s;
}
.sig-toast-item:hover { background: #ecfdf5; }
.sig-toast-more {
  cursor: default; justify-content: center; color: #64748b; font-size: 12px;
  background: transparent; border: 1px dashed #e2e8f0;
}
.sig-toast-more:hover { background: transparent; }
.sig-toast-name { font-weight: 700; font-size: 13px; color: #1e293b; }
.sig-toast-code { font-size: 11.5px; color: #94a3b8; }
.sig-toast-meta { margin-left: auto; font-size: 11.5px; color: #64748b; font-variant-numeric: tabular-nums; }
body.dark .sig-toast { background: #243247; border-color: #3b4a63; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
body.dark .sig-toast-item { background: #1b2637; border-color: #31405a; }
body.dark .sig-toast-item:hover { background: #1e3a35; }
body.dark .sig-toast-more { background: transparent; border-color: #3b4a63; color: #8394ab; }
body.dark .sig-toast-name { color: #e2e8f0; }
body.dark .sig-toast-code { color: #8394ab; }
body.dark .sig-toast-meta { color: #9fb0c9; }



/* v1.0.276：信号中心「理由」列悬停明细气泡 */
.sg-reason { cursor: help; text-decoration: underline dotted rgba(120,120,120,.55); text-underline-offset: 3px; }
.sig-votes-tip { position: fixed; z-index: 10030; display: none; max-width: 340px; padding: 8px 10px; background: #fffbe8; color: #333; border: 1px solid #d9c87a; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 12px; line-height: 1.5; pointer-events: none; }
.svt-head { font-weight: 700; color: #8a6d1a; margin-bottom: 4px; }
.svt-row { display: flex; gap: 6px; margin: 2px 0; align-items: baseline; }
.svt-row b { white-space: nowrap; }
.svt-row b.bull { color: #c2410c; }
.svt-row b.bear { color: #15803d; }
.svt-row span { color: #6b6b52; }
body.dark .sig-votes-tip { background: #33331f; color: #ececcf; border-color: #6a6a45; }
body.dark .svt-head { color: #ffe08a; }
body.dark .svt-row b.bull { color: #ff9d6b; }
body.dark .svt-row b.bear { color: #6fce8f; }
body.dark .svt-row span { color: #bdbc9d; }

/* v1.0.291：信号清单「买入设置」列徽章 */
.sig-at-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; cursor: pointer; border: 1px solid #cbd5e1; color: #475569; background: #f1f5f9; white-space: nowrap; }
.sig-at-badge:hover { filter: brightness(0.95); }
.sig-at-badge.sig-at-on { border-color: #f59e0b; color: #b45309; background: #fef3c7; }
.sig-at-badge.sig-at-off { border-color: #cbd5e1; color: #94a3b8; background: #f8fafc; }
/* v1.0.298：执行指标与信号指标不匹配（不会被自动执行） */
.sig-at-badge.sig-at-mute { border-color: #cbd5e1; color: #64748b; background: #f1f5f9; }
body.dark .sig-at-badge { border-color: #4b5563; color: #cbd5e1; background: #374151; }
body.dark .sig-at-badge.sig-at-on { border-color: #d97706; color: #fcd34d; background: rgba(245,158,11,0.15); }
body.dark .sig-at-badge.sig-at-off { border-color: #4b5563; color: #9ca3af; background: #1f2937; }
body.dark .sig-at-badge.sig-at-mute { border-color: #4b5563; color: #9ca3af; background: #1f2937; }

/* v1.0.293：自动交易设置弹窗（信号中心「买入设置」）排版
   ⚠ 全部带 .modal 前缀：styles.css 的全局 .modal input(width:100%/padding/margin) 会压过单类名规则，
   导致复选框被撑满、文字竖排一字一行（v1.0.293 翻车原因） */
.modal .sigat-form { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.modal .sigat-card { display:flex; align-items:center; gap:10px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; cursor:default; }
.modal label.sigat-card { cursor:pointer; }
.modal .sigat-ck { width:16px; height:16px; flex:none; margin:0; padding:0; accent-color:#2563eb; cursor:pointer; }
.modal .sigat-lb { width:62px; flex:none; font-weight:600; font-size:13px; }
.modal .sigat-el { flex:1; min-width:0; width:auto; padding:6px 10px; margin:0; border:1px solid #cbd5e1; border-radius:8px; font-size:13px; background:#fff; color:inherit; }
.modal .sigat-num { flex:none; width:74px; text-align:center; }
.modal .sigat-hint { flex:none; font-size:11px; color:#64748b; line-height:1.5; }
.modal .sigat-txt { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; text-align:left; }
.modal .sigat-txt b { font-size:13px; }
.modal .sigat-txt i { font-style:normal; font-size:11px; color:#64748b; }
.modal .sigat-btns { display:flex; gap:8px; align-items:center; }
.modal .sigat-danger { color:#dc2626; }
body.dark .modal .sigat-card { background:#1c222d; border-color:#2c3442; }
body.dark .modal .sigat-el { background:#141922; border-color:#3a4353; color:#e5e7eb; }
body.dark .modal .sigat-hint, body.dark .modal .sigat-txt i { color:#94a3b8; }
body.dark .modal .sigat-danger { color:#f87171; }

/* —— 回测双月日历区间选择器（v1.0.309） —— */
.bt-range-wrap { position: relative; display: inline-block; }
.bt-range-btn {
  display: inline-block; min-width: 150px; text-align: center; cursor: pointer; white-space: nowrap;
  border: 1.5px solid #e6e2fa; border-radius: 10px; padding: 5px 10px; font-size: 13px;
  color: #334155; background: #fbfaff; transition: border-color 0.15s, box-shadow 0.15s;
}
.bt-range-btn:hover { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }
.bt-range-btn.is-empty { color: #94a3b8; }
.bt-range-panel {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 3000;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); padding: 12px 14px 10px;
  flex-direction: column; gap: 10px; cursor: default;
}
.rg-main { display: flex; gap: 18px; }
.rg-month { width: 252px; }
.rg-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.rg-title { font-size: 13.5px; font-weight: 700; color: #334155; }
.rg-nav { width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 6px; cursor: pointer; color: #64748b; font-size: 14px; user-select: none; }
.rg-nav:hover { background: #f1f5f9; color: #0e9f6e; }
.rg-week { display: grid; grid-template-columns: repeat(7, 36px); margin-bottom: 2px; }
.rg-week span { text-align: center; font-size: 12px; color: #94a3b8; padding: 4px 0; }
.rg-grid { display: grid; grid-template-columns: repeat(7, 36px); grid-auto-rows: 32px; }
.rg-day { display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: #334155; border-radius: 8px; cursor: pointer; user-select: none; position: relative; }
.rg-day:hover { background: #f3fdf8; }
.rg-day.rg-out { color: #cbd5e1; }
.rg-day.rg-mid { background: #e6f6ee; border-radius: 0; }
.rg-day.rg-mid.rg-out { color: #a7d7bd; }
.rg-day.rg-edge { background: #0e9f6e; color: #fff; font-weight: 700; border-radius: 8px; }
.rg-day.rg-today:not(.rg-edge)::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #0e9f6e; }
.rg-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.rg-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.rg-quick span, .rg-actions span { border: 1px solid #e5e7eb; border-radius: 6px; padding: 3px 10px; font-size: 12px; color: #475569; cursor: pointer; user-select: none; }
.rg-quick span:hover { border-color: #0e9f6e; color: #0e9f6e; }
.rg-actions { display: flex; gap: 6px; }
.rg-actions span[data-a="clear"] { border: none; color: #94a3b8; }
.rg-actions span[data-a="clear"]:hover { color: #ef4444; }
.rg-actions span[data-a="ok"] { border-color: #0e9f6e; color: #0e9f6e; font-weight: 700; }
.rg-actions span[data-a="ok"]:hover { background: #0e9f6e; color: #fff; }
body.dark .bt-range-panel { background: #243247; border-color: #3b4a63; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
body.dark .rg-title { color: #e5e7eb; }
body.dark .rg-nav { color: #9fb0c9; }
body.dark .rg-nav:hover { background: #2f4058; color: #34d399; }
body.dark .rg-week span { color: #64748b; }
body.dark .rg-day { color: #e5e7eb; }
body.dark .rg-day:hover { background: #2f4058; }
body.dark .rg-day.rg-out { color: #4b5b74; }
body.dark .rg-day.rg-mid { background: rgba(14, 159, 110, 0.28); }
body.dark .rg-day.rg-mid.rg-out { color: #4e7a66; }
body.dark .rg-foot { border-top-color: #3b4a63; }
body.dark .rg-quick span, body.dark .rg-actions span { border-color: #3b4a63; color: #cbd5e1; }
body.dark .rg-quick span:hover { border-color: #34d399; color: #34d399; }
body.dark .rg-actions span[data-a="clear"] { border: none; color: #64748b; }
body.dark .rg-actions span[data-a="ok"] { border-color: #34d399; color: #34d399; }
body.dark .rg-actions span[data-a="ok"]:hover { background: #34d399; color: #0f172a; }

/* —— 模拟盘：台账制时账户设定卡置灰（v1.0.313） —— */
.bt-card.is-dim { opacity: 0.55; filter: grayscale(0.7); }
.bt-card.is-dim input { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* —— 回测策略自定义下拉 + 「自」徽章（v1.0.321） —— */
.bt-dd-wrap { position: relative; display: inline-block; }
.bt-dd-btn {
  display: inline-flex; align-items: center; min-width: 189px; height: 32px; padding: 0 26px 0 10px;
  border: 1.5px solid #e6e2fa; border-radius: 10px; background: #fbfaff; font-size: 13px; color: #334155;
  cursor: pointer; position: relative; box-sizing: border-box; white-space: nowrap; user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bt-dd-btn:hover { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }
.bt-dd-btn::after { content: ''; position: absolute; right: 9px; top: 50%; transform: translateY(-30%); border: 4px solid transparent; border-top-color: #7c6cf0; }
.bt-dd-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 3000; min-width: 189px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16); padding: 4px; display: none;
}
.bt-dd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; font-size: 13px; color: #334155; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.bt-dd-item:hover { background: #f3fdf8; }
.bt-dd-item.is-active { background: #eef9f3; color: #0e9f6e; font-weight: 700; }
.bt-dd-badge {
  flex: none; width: 17px; height: 17px; line-height: 17px; text-align: center;
  font-size: 11px; font-weight: 700; border-radius: 4px; background: #e5f6ec; color: #0e9f6e;
}
body.dark .bt-dd-btn { background: #243247; border-color: #3b4a63; color: #e5e7eb; }
body.dark .bt-dd-btn::after { border-top-color: #8fa3c8; }
body.dark .bt-dd-panel { background: #243247; border-color: #3b4a63; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); }
body.dark .bt-dd-item { color: #e5e7eb; }
body.dark .bt-dd-item:hover { background: #2f4058; }
body.dark .bt-dd-item.is-active { background: #24423a; color: #34d399; }
body.dark .bt-dd-badge { background: rgba(52, 211, 153, 0.18); color: #34d399; }

/* —— 回测策略多选 + 策略对比表（v1.0.326） —— */
.bt-dd-btn.is-multi { border-color: #a78bfa; background: #f6f4ff; color: #5b21b6; font-weight: 600; }
.bt-dd-btn.is-multi b { color: #6d28d9; }
.bt-dd-tick {
  flex: none; width: 14px; height: 14px; border: 1.5px solid #cbd5e1; border-radius: 4px;
  background: #fff; position: relative; box-sizing: border-box;
}
.bt-dd-item.is-sel .bt-dd-tick { background: #0e9f6e; border-color: #0e9f6e; }
.bt-dd-item.is-sel .bt-dd-tick::after {
  content: ''; position: absolute; left: 3.5px; top: 0.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg);
}
.bt-dd-name { flex: 1; margin-left: 1px; }
.bt-dd-item.is-sel { background: #eef9f3; color: #0b7a55; font-weight: 600; }
.bt-dd-item.is-active { box-shadow: inset 0 0 0 1px #b6e6cd; }
.bt-dd-foot {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  border-top: 1px solid #f1f5f9; margin-top: 4px; padding: 6px 4px 2px;
}
.bt-dd-foot span {
  border: 1px solid #e5e7eb; border-radius: 6px; padding: 3px 10px;
  font-size: 12px; color: #475569; cursor: pointer; user-select: none;
}
.bt-dd-foot span:hover { border-color: #0e9f6e; color: #0e9f6e; }
.bt-dd-foot span.is-primary { border-color: #0e9f6e; background: #0e9f6e; color: #fff; font-weight: 700; }
.bt-dd-foot span.is-primary:hover { background: #0b7a55; border-color: #0b7a55; color: #fff; }
.bt-cmp-tip { font-size: 12px; font-weight: 400; color: #94a3b8; margin-left: 8px; }
.bt-cmp-row { cursor: pointer; }
.bt-cmp-row:hover td { background: #f7fdfa; }
.bt-cmp-row.is-active td { background: #eef9f3; font-weight: 700; }
.bt-cmp-row.is-active td:first-child { box-shadow: inset 3px 0 0 #0e9f6e; }
body.dark .bt-dd-btn.is-multi { background: #2b2a4a; border-color: #6d5fd0; color: #c7bdf5; }
body.dark .bt-dd-btn.is-multi b { color: #a99cf0; }
body.dark .bt-dd-tick { border-color: #4b5b74; background: #243247; }
body.dark .bt-dd-item.is-sel { background: #24423a; color: #34d399; }
body.dark .bt-dd-item.is-sel .bt-dd-tick { background: #34d399; border-color: #34d399; }
body.dark .bt-dd-item.is-active { box-shadow: inset 0 0 0 1px #2f6b52; }
body.dark .bt-dd-foot { border-top-color: #3b4a63; }
body.dark .bt-dd-foot span { border-color: #3b4a63; color: #cbd5e1; }
body.dark .bt-dd-foot span:hover { border-color: #34d399; color: #34d399; }
body.dark .bt-dd-foot span.is-primary { border-color: #34d399; background: #34d399; color: #0f172a; }
body.dark .bt-cmp-row:hover td { background: #2a3b52; }
body.dark .bt-cmp-row.is-active td { background: #24423a; }

/* ===== v1.0.449：回测「股票」下拉改分组折叠（默认只显示分组名，点分组名才展开组内股票） ===== */
/* 复用 .bt-dd-wrap / .bt-dd-btn / .bt-dd-panel / .bt-dd-item 基础样式，只补「分组行 + 折叠容器」 */
.bt-stk-btn { min-width: 170px; max-width: 236px; overflow: hidden; text-overflow: ellipsis; }
/* v1.0.486：信号中心「分组」筛选的触发器——宽度与回测「股票」触发器对齐（用户要求一样宽） */
.sig-grp-btn { min-width: 170px; max-width: 236px; }
/* v1.0.486：信号中心「🔎 筛一筛」卡标题行只有纯文字 ~17px，比回测「想测谁」标题行（挂了时间选择按钮）29px 矮 12px，
   正文筛选行整体上浮。补齐到同高并垂直居中（与 v1.0.365 回测页、v1.0.383 模拟盘同款问题同款修法），
   两页正文行位置即一致。只作用「筛一筛」这张卡；「🎬 行动」卡是 .with-status 本就是 flex，排除。 */
#signalsView .bt-toolbar > .bt-card > .bt-card-title:not(.with-status) {
  display: flex; align-items: center; min-height: 29px;
}
.bt-stk-panel { min-width: 210px; max-height: 442px; overflow-y: auto; padding: 5px; } /* v1.0.491：min-width 244 → 210（祥风要求减窄）；v1.0.489：max-height 340 → 442（+30%） */
.bt-stk-grp {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600; color: #334155;
}
.bt-stk-grp:hover { background: #f3fdf8; }
.bt-stk-caret {
  flex: none; width: 0; height: 0;
  border: 4.5px solid transparent; border-left-color: #7c6cf0;
  margin-left: 1px; transition: transform 0.15s;
}
.bt-stk-grp.is-open .bt-stk-caret { transform: rotate(90deg); }
.bt-stk-gname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-stk-gcount {
  flex: none; font-size: 11px; font-weight: 700; color: #0e9f6e;
  background: #e5f6ec; border-radius: 9px; padding: 1px 7px;
}
.bt-stk-items { display: none; margin: 1px 0 3px 10px; padding-left: 6px; border-left: 1px dashed #dbe2ea; }
.bt-stk-items.is-open { display: block; }
.bt-stk-item { padding: 6px 9px; }
.bt-stk-code { flex: none; font-size: 11px; color: #94a3b8; margin-left: 6px; }
.bt-stk-item.is-active .bt-stk-code { color: #0b7a55; }
.bt-stk-empty { padding: 10px; font-size: 12px; color: #94a3b8; text-align: center; }
/* v1.0.482：回测「想测谁」面板的域分节标题（股票分组 之后接 ETF分组），与原生 optgroup 的视觉层级对齐 */
/* v1.0.483：字号 11px → 13px（用户要求再加大点）+ 内边距同步放大 */
.bt-stk-sect {
  margin: 7px 2px 3px; padding: 5px 9px 4px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  color: #7c6cf0; border-top: 1px solid #e6e9f0;
}
body.dark .bt-stk-sect { color: #a99cff; border-top-color: #3b4a63; }
/* v1.0.452：顶部「---请选择分组股票---」占位项（默认态，弱化色；选中时走 .is-active 绿色高亮） */
.bt-stk-placeholder { color: #94a3b8; }
body.dark .bt-stk-placeholder { color: #8fa3c8; }
body.dark .bt-stk-grp { color: #e5e7eb; }
body.dark .bt-stk-grp:hover { background: #2f4058; }
body.dark .bt-stk-caret { border-left-color: #8fa3c8; }
body.dark .bt-stk-gcount { background: rgba(52, 211, 153, 0.18); color: #34d399; }
body.dark .bt-stk-items { border-left-color: #3b4a63; }
body.dark .bt-stk-code { color: #8fa3c8; }
body.dark .bt-stk-item.is-active .bt-stk-code { color: #34d399; }
body.dark .bt-stk-empty { color: #8fa3c8; }
/* v1.0.457：分组行「勾选整组」框——勾选后批量回测只跑该组成员；勾中行淡紫态一眼可辨 */
.bt-stk-sel { flex: none; display: inline-flex; align-items: center; cursor: pointer; margin-right: 1px; }
.bt-stk-chk { width: 14px; height: 14px; margin: 0; accent-color: #7c6cf0; cursor: pointer; flex: none; }
.bt-stk-grp:has(.bt-stk-chk:checked) { background: #f6f4ff; }
.bt-stk-grp:has(.bt-stk-chk:checked) .bt-stk-gname { color: #5b21b6; }
.bt-stk-grp:has(.bt-stk-chk:checked) .bt-stk-gcount { background: #ede9fe; color: #6d28d9; }
body.dark .bt-stk-grp:has(.bt-stk-chk:checked) { background: #2b2a4a; }
body.dark .bt-stk-grp:has(.bt-stk-chk:checked) .bt-stk-gname { color: #c7bdf5; }
body.dark .bt-stk-grp:has(.bt-stk-chk:checked) .bt-stk-gcount { background: rgba(139, 124, 246, 0.22); color: #a99cf0; }
/* 批量按钮：v1.0.458 按用户要求勾选态不再变色，恒用默认彩虹渐变样式（文字仍实时显示「N组M只」） */

/* ===== v1.0.484：三大「-参考」页（signalsTest / backtestTest / paperTest，iframe 嵌入实例）整体删除 =====
       原「隐藏顶部工具栏 / 视图占满 / .embed-hide 隐藏」等 body.embed-test 规则随之删除；
       主页面样式的 body:not(.embed-test) 选择器仍然成立（body 不再会有该 class），保持不变。 ===== */
/* 旧「按信号触发价成交」勾选框已由「成交价」下拉替代（原仅嵌入参考页可见，现一律隐藏） */
#btFillSignalLegacy { display: none !important; }
.embed-hide-mark { color: #f59e0b; font-weight: 700; margin-left: 1px; }
#btAdvWrap .bt-adv-card, #sigStatsWrap .bt-adv-card {
  margin: 14px 16px 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 16px;
}
#btAdvWrap .bt-adv-warn { color: #dc2626; font-weight: 600; }
#btAdvWrap .bt-adv-ok { color: #16a34a; font-weight: 600; }
body.dark #btAdvWrap .bt-adv-card, body.dark #sigStatsWrap .bt-adv-card { background: #1e293b; border-color: #334155; }
body.dark #btAdvWrap .bt-adv-warn { color: #f87171; }
body.dark #btAdvWrap .bt-adv-ok { color: #4ade80; }

/* ===== v1.0.418：K线十字光标跨面板联动 ===== */
/* 鼠标落在副图（成交量/CCI/新布林极限等）内时，十字线照常显示并联动到所有面板，
   但把提示框的「内容框」透明化——保留 v1.0.283「副图内不弹提示框」的降噪意图。
   .kline-axis-tip 由 klineChart.js 的 tooltip.className 挂上；容器类 kline-sub-hover 由
   attachSubTipSuppress 在「跨进/跨出主图」时切换。ECharts 用行内 cssText 写提示框样式，故须 !important。 */
.kline-sub-hover .kline-axis-tip { opacity: 0 !important; pointer-events: none !important; }

/* v1.0.548：我的条件单窗口（仿券商APP「我的条件单」：搜索框 + 今日已触发卡 + 实时监控卡 + 条件单明细） */
.pp-cl-overlay { z-index: 80; }
.pp-cl-modal { width: 400px; min-width: 300px; max-width: 94vw; height: 80vh; max-height: 88vh; padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 14px; background: #f4f5f7; }
.pp-cl-nav { position: relative; flex: 0 0 auto; display: flex; align-items: center; padding: 12px 14px 10px; background: #fff; }
.pp-cl-back { width: 26px; height: 26px; padding: 0; font-size: 22px; line-height: 22px; color: #333; background: transparent; border: 0; cursor: pointer; }
.pp-cl-title { flex: 1 1 auto; text-align: center; font-size: 16px; font-weight: 600; color: #1a1a1a; }
.pp-cl-hist { width: 56px; text-align: right; font-size: 13.5px; color: #2b7de1; background: transparent; border: 0; cursor: pointer; }
.pp-cl-search { flex: 0 0 auto; position: relative; display: flex; align-items: center; padding: 0 14px 12px; background: #fff; }
.pp-cl-sicon { position: absolute; left: 26px; color: #b4b9c0; pointer-events: none; display: inline-flex; }
.pp-cl-search input { width: 100%; padding: 9px 34px 9px 36px; font-size: 14px; color: #1a1a1a; background: #f2f3f5; border: 0; border-radius: 18px; outline: none; }
.pp-cl-clear { position: absolute; right: 24px; width: 22px; height: 22px; padding: 0; font-size: 13px; color: #b4b9c0; background: transparent; border: 0; cursor: pointer; }
.pp-cl-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 16px; }
.pp-cl-card { background: #fff; border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.pp-cl-cardhd { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 12px; font-size: 15.5px; font-weight: 600; color: #1a1a1a; }
.pp-cl-cardhd b { color: #f08a24; font-weight: 700; margin: 0 2px; }
.pp-cl-ico { font-size: 15px; }
.pp-cl-ico.trig { color: #f08a24; }
.pp-cl-ico.mon { color: #2b7de1; }
.pp-cl-empty { padding: 16px 12px 26px; text-align: center; font-size: 13.5px; color: #b4b9c0; border-top: 1px solid #f2f3f5; }
.pp-cl-filters { display: flex; align-items: center; gap: 14px; padding: 0 14px 8px; border-top: 1px solid #f2f3f5; padding-top: 10px; }
.pp-cl-fwrap { position: relative; display: inline-flex; align-items: center; }
.pp-cl-fsel { -webkit-appearance: none; appearance: none; padding: 0 15px 0 0; font-size: 13.5px; font-weight: 600; color: #2b7de1; background: transparent; border: 0; outline: none; cursor: pointer; }
.pp-cl-fcaret { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 12px; color: #2b7de1; pointer-events: none; }
.pp-cl-manage { margin-left: auto; font-size: 13.5px; color: #2b7de1; background: transparent; border: 0; cursor: pointer; }
.pp-cl-list { padding: 0 14px 12px; }
.pp-cl-item { padding: 12px 0 4px; border-top: 1px solid #f2f3f5; }
.pp-cl-item:first-child { border-top: 0; }
.pp-cl-itemhd { display: flex; align-items: baseline; gap: 6px; }
.pp-cl-name { font-size: 15.5px; font-weight: 600; color: #1a1a1a; }
.pp-cl-code { font-size: 12.5px; color: #98a2ae; }
.pp-cl-state { margin-left: auto; font-size: 13px; color: #2b7de1; }
.pp-cl-sub { margin: 3px 0 2px; font-size: 12.5px; color: #98a2ae; }
.pp-cl-del { margin-left: 8px; padding: 2px 10px; font-size: 12.5px; color: #e24b4a; background: #fdecec; border: 0; border-radius: 5px; cursor: pointer; }
.pp-cl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 14px; color: #8a94a0; border-bottom: 1px solid #f7f8fa; }
.pp-cl-row:last-child { border-bottom: 0; }
.pp-cl-row b { font-weight: 500; color: #1a1a1a; text-align: right; line-height: 1.5; }
.pp-cl-row > span:first-child { flex: 0 0 auto; }
.pp-cl-row > b { flex: 1 1 auto; }
.pp-cl-more { padding: 12px 0 4px; text-align: center; font-size: 13px; color: #b4b9c0; border-top: 1px solid #f2f3f5; }
body.dark .pp-cl-modal { background: #171c24; }
body.dark .pp-cl-nav, body.dark .pp-cl-search { background: #1c232e; }
body.dark .pp-cl-title, body.dark .pp-cl-name, body.dark .pp-cl-row b, body.dark .pp-cl-cardhd { color: #e8edf4; }
body.dark .pp-cl-back { color: #c3ccd8; }
body.dark .pp-cl-search input { color: #e8edf4; background: #232a35; }
body.dark .pp-cl-card { background: #1c232e; }
body.dark .pp-cl-row { border-bottom-color: #232b36; }
body.dark .pp-cl-item, body.dark .pp-cl-filters, body.dark .pp-cl-more, body.dark .pp-cl-empty { border-top-color: #232b36; }
body.dark .pp-cl-del { color: #ff8d8b; background: #3a2224; }
body.dark .pp-cl-sub { color: #8a94a0; }

/* v1.0.552：网格支持「每持仓多条」——弹窗头部提示与「＋ 新建一条」入口、我的条件单明细可点进编辑 */
.pp-grid-modehint { font-size: 11.5px; color: var(--color-text-tertiary); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-grid-newlink { margin-left: auto; padding: 2px 8px; font-size: 12.5px; color: #2b7de1; background: #eaf3fd; border: 0; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.pp-grid-newlink:hover { background: #d9e9fb; }
.pp-cl-open { cursor: pointer; border-radius: 8px; }
.pp-cl-open:hover { background: #fafbfd; }
body.dark .pp-grid-newlink { color: #7cb0ff; background: #16314e; }
body.dark .pp-grid-newlink:hover { background: #1d4066; }
body.dark .pp-cl-open:hover { background: #202733; }

/* v1.0.557：条件单修改页「成交明细」（仿券商APP：买入/卖出委托切换 + 每笔四行） */
.pp-grid-fills { margin-top: 10px; border-top: 0.5px solid var(--color-border-tertiary); padding-top: 8px; }
.pp-gf-hd { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; cursor: pointer; padding: 2px 0 6px; }
.pp-gf-caret { color: var(--color-text-tertiary); font-size: 13px; }
.pp-grid-fills.collapsed .pp-gf-tabs, .pp-grid-fills.collapsed .pp-gf-list { display: none; }
.pp-gf-tabs { display: flex; gap: 0; border-bottom: 0.5px solid var(--color-border-tertiary); margin-bottom: 6px; }
.pp-gf-tabs button { flex: 1 1 0; padding: 7px 0; font-size: 13px; color: var(--color-text-secondary); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.pp-gf-tabs button b { font-weight: 600; margin-left: 2px; }
.pp-gf-tabs button.on { color: #e0352f; border-bottom-color: #e0352f; font-weight: 600; }
.pp-gf-tabs button[data-t="sell"].on { color: #2b7de1; border-bottom-color: #2b7de1; }
.pp-gf-list { max-height: 176px; overflow-y: auto; }
.pp-gf-item { padding: 10px 0 6px; border-bottom: 0.5px solid var(--color-border-tertiary); }
.pp-gf-item:last-child { border-bottom: 0; }
.pp-gf-itemhd { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; }
.pp-gf-itemhd .buy { font-size: 14px; font-weight: 600; color: #e0352f; }
.pp-gf-itemhd .sell { font-size: 14px; font-weight: 600; color: #2b7de1; }
.pp-gf-state { font-size: 12.5px; color: var(--color-text-tertiary); }
.pp-gf-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12.5px; color: var(--color-text-secondary); }
.pp-gf-row b { font-weight: 500; color: var(--color-text-primary); }
.pp-gf-empty { padding: 14px 0; text-align: center; font-size: 12.5px; color: var(--color-text-tertiary); }

/* ===== v1.0.585：ETF 平台「估值分位计」卡片（宽基 PE 3/5年分位红绿条） ===== */
.etf-pe-gauge { margin: 0 0 8px; border: 1px solid var(--color-border-tertiary); border-radius: 10px; background: var(--color-background-secondary); overflow: hidden; }
.etf-pe-gauge .epg-head { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; user-select: none; }
.etf-pe-gauge .epg-title { font-size: 13px; font-weight: 500; color: var(--color-text-primary); }
.etf-pe-gauge .epg-sub { font-size: 11.5px; color: var(--color-text-tertiary); flex: 1 1 auto; text-align: right; }
.etf-pe-gauge .epg-caret { font-size: 12px; color: var(--color-text-tertiary); transition: transform 0.15s; }
.etf-pe-gauge.collapsed .epg-caret { transform: rotate(180deg); }
.etf-pe-gauge.collapsed .epg-body { display: none; }
.etf-pe-gauge .epg-body { padding: 2px 12px 8px; }
.etf-pe-gauge .epg-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 0.5px solid var(--color-border-tertiary); }
.etf-pe-gauge .epg-row:first-child { border-top: 0; }
.etf-pe-gauge .epg-name { width: 200px; flex: 0 0 auto; font-size: 12.5px; color: var(--color-text-primary); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etf-pe-gauge .epg-name:hover { color: #2b7de1; }
.etf-pe-gauge .epg-code { font-size: 11px; color: var(--color-text-tertiary); }
.etf-pe-gauge .epg-bar { position: relative; flex: 1 1 auto; height: 10px; border-radius: 5px; overflow: hidden; display: flex; }
.etf-pe-gauge .epg-z { height: 100%; }
.etf-pe-gauge .epg-z.z-g { width: 30%; background: #4fae7f; }
.etf-pe-gauge .epg-z.z-a { width: 40%; background: #e8c064; }
.etf-pe-gauge .epg-z.z-r { width: 30%; background: #d97066; }
.etf-pe-gauge .epg-mk { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--color-text-primary); border-radius: 1px; }
.etf-pe-gauge .epg-vals { width: 220px; flex: 0 0 auto; font-size: 11.5px; color: var(--color-text-secondary); white-space: nowrap; }
.etf-pe-gauge .epg-sep { color: var(--color-text-tertiary); }
.etf-pe-gauge .epg-band { width: 44px; flex: 0 0 auto; text-align: center; font-size: 11.5px; padding: 1px 0; border-radius: 8px; }
.etf-pe-gauge .epg-band.lo { background: #e2f4ea; color: #177a4c; }
.etf-pe-gauge .epg-band.lomid { background: #eaf6ee; color: #3f9463; }
.etf-pe-gauge .epg-band.mid { background: #fdf3dc; color: #a1730e; }
.etf-pe-gauge .epg-band.himid { background: #fbeae2; color: #b56538; }
.etf-pe-gauge .epg-band.hi { background: #f9e3e1; color: #b04036; }
.etf-pe-gauge .epg-band.none { background: var(--color-background-tertiary); color: var(--color-text-tertiary); }
.etf-pe-gauge .epg-empty { padding: 10px 0; font-size: 12px; color: var(--color-text-tertiary); }
body.dark .etf-pe-gauge .epg-z.z-g { background: #2f6b52; }
body.dark .etf-pe-gauge .epg-z.z-a { background: #8a6b23; }
body.dark .etf-pe-gauge .epg-z.z-r { background: #8a4740; }
body.dark .etf-pe-gauge .epg-mk { background: #e8ecf3; }
body.dark .etf-pe-gauge .epg-band.lo { background: #17342a; color: #6fd3a2; }
body.dark .etf-pe-gauge .epg-band.lomid { background: #1c3a2e; color: #8fceae; }
body.dark .etf-pe-gauge .epg-band.mid { background: #3a2f16; color: #e0b45f; }
body.dark .etf-pe-gauge .epg-band.himid { background: #3d251a; color: #e09263; }
body.dark .etf-pe-gauge .epg-band.hi { background: #40201e; color: #ef9a90; }

/* ===== v1.0.587：批量排行「交易」明细弹窗 ===== */
.bt-trade-link { color: #2b7de1; cursor: pointer; text-decoration: none; font-weight: 500; }
.bt-trade-link:hover { text-decoration: underline; }
/* v1.0.591：交易列整格可点（数字+空白位），格子加手型光标 */
.bt-trade-td { cursor: pointer; }
.bt-trade-td:hover .bt-trade-link { text-decoration: underline; }
/* v1.0.588：宽 80vw、高 70vh（祥风口径）——flex 纵向布局，标题/指标行固定，明细表区占满剩余高度内部滚动 */
.btd-modal { width: 80vw; max-width: 94vw; height: 70vh; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.btd-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 6px; padding-right: 32px; flex: 0 0 auto; }
/* v1.0.589：汇总指标行改用 .bt-metric 指标卡（同布朗V5），容器改网格排布 */
.btd-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; flex: 0 0 auto; margin-bottom: 10px; }
.btd-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid var(--color-border-tertiary); border-radius: 8px; }
.btd-table { font-size: 12px; }
.btd-table th, .btd-table td { padding: 4px 8px; white-space: nowrap; }
body.dark .btd-title { color: var(--color-text-primary); }
