@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg:       #101828;
  --surface:  #152040;
  --surface2: #1c2d54;
  --border:   #1e3558;
  --accent:   #4a7cf7;
  --accent2:  #64b5f6;
  --text:     #e8f0fe;
  --text2:    #6e90b8;
  --green:    #34d399;
  --yellow:   #fbbf24;
  --red:      #f87171;
  --orange:   #fb923c;
  --grey:     #94a3b8;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Gotham', 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.header {
  background: linear-gradient(90deg, #0e1c30 0%, #152840 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.header-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}
.header-title span { color: var(--accent); }
.header-stats { display: flex; gap: 32px; align-items: center; }
.stat-item { text-align: center; }
.stat-label { font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 15px; font-weight: 700; margin-top: 1px; }
.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }
.stat-value.neutral { color: var(--text); }
.stat-value.yellow { color: var(--yellow); }
.logout-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.logout-btn:hover { color: var(--text); border-color: var(--text2); }

/* ── Layout ── */
.layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 224px;
  background: #070d1c;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px;
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }
.sidebar-heading {
  padding: 6px 0 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin-top: 4px;
}

/* sidebar tree nodes as rounded buttons */
.tree-node {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  color: var(--text2);
  transition: all 0.15s;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
}
.tree-node:hover { background: var(--surface2); color: var(--text); }
.tree-node.active { background: var(--accent); color: #fff; }
.tree-node { border: 1px solid transparent; position: relative; }
#nodeAll:not(.active) { background: var(--surface2); color: var(--text); border-color: var(--border); }
.tree-node.active .node-count { background: rgba(255,255,255,0.2); color: #fff; }

.tree-node.level-1 { padding-left: 24px; font-size: 12px; }
.tree-node.level-2 { padding-left: 36px; font-size: 11px; }
.tree-node.level-3 { padding-left: 48px; font-size: 11px; }

.tree-arrow {
  font-size: 9px;
  transition: transform 0.2s, background 0.15s;
  flex-shrink: 0;
  opacity: 0.6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -6px -2px -6px -8px;
  border-radius: 6px;
  cursor: pointer;
}
.tree-arrow:hover { background: rgba(127,127,127,0.22); opacity: 1; }
.tree-node.open > .tree-arrow { transform: rotate(90deg); }
.tree-arrow-spacer { width: 22px; margin: -6px -2px -6px -8px; flex-shrink: 0; }
.tree-children { display: none; }
.tree-children.open { display: block; }
.node-count {
  margin-left: auto;
  background: var(--surface2);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text2);
  flex-shrink: 0;
}
.node-add {
  width: 15px; height: 15px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}
.node-actions {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 4px; align-items: center;
  padding-left: 8px; border-radius: 5px;
  background: var(--surface2);
  opacity: 0; pointer-events: none;
}
.tree-node:hover .node-actions { opacity: 1; pointer-events: auto; }
.tree-node.active .node-actions { background: var(--accent); }
.node-add:hover { background: var(--surface2); color: var(--text); }
.tree-node.active .node-add { border-color: rgba(255,255,255,0.45); color: rgba(255,255,255,0.85); }
.tree-node.active .node-add:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.7); }

.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }
.sidebar-btn {
  margin: 0;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  transition: background 0.15s;
}
.sidebar-btn:hover { background: #3a6be0; }

/* ── Main ── */
.main { flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: none; }
.main::-webkit-scrollbar { display: none; }

/* ── Summary area ── */
.summary-area {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  margin-bottom: 20px;
  align-items: stretch;
}
/* 网格项默认 min-width:auto(=内容最小宽度), 会被 canvas 的像素宽度撑住, 导致窗口缩小时
   曲线卡缩不回去(只放大不缩小). min-width:0 让 1fr 轨道能收缩到比 canvas 更窄. */
.summary-area > * { min-width: 0; }
.summary-stats-col { display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.summary-card-label { font-size: 11px; font-weight: 600; color: #8aabcc; text-transform: uppercase; letter-spacing: 0.6px; }
.summary-card-value { font-size: 21px; font-weight: 700; margin-top: 5px; }
.summary-card-sub { font-size: 10px; color: var(--text2); margin-top: 3px; }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.status-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 11px; background: var(--surface);
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* portfolio curve card */
.curve-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.curve-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.curve-card-title { font-size: 11px; font-weight: 600; color: #8aabcc; text-transform: uppercase; letter-spacing: 0.6px; }
.curve-card-perf { font-size: 14px; font-weight: 700; }
.curve-canvas-wrap { flex: 1; position: relative; min-height: 175px; min-width: 0; }
.curve-canvas-wrap > canvas { position: absolute; top: 0; left: 0; }

/* ── Section header ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 15px; font-weight: 700; }
.section-subtitle { font-size: 11px; color: var(--text2); margin-top: 2px; }
.filter-row { display: flex; gap: 6px; align-items: center; }
.filter-btn {
  padding: 4px 10px; border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text2);
  cursor: pointer; font-size: 11px; transition: all 0.15s;
}
.filter-count { font-size: 10px; font-weight: 700; opacity: 0.5; margin-left: 4px; }
.filter-btn.active .filter-count { opacity: 0.85; }
.filter-btn:hover, .filter-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ── Strategy grid ── */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
}

/* ── Strategy card ── */
.strategy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.strategy-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(74,124,247,0.15);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.card-meta { font-size: 10px; color: var(--text2); margin-top: 2px; }
.status-badge {
  padding: 2px 7px; border-radius: 9px;
  font-size: 10px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.status-运行中    { background: rgba(52,211,153,0.14);  color: var(--green); }
.status-风控干预   { background: rgba(248,113,113,0.12); color: var(--red); }
.status-测试中    { background: rgba(251,146,60,0.12);  color: var(--orange); }
.status-下线观察中 { background: rgba(251,191,36,0.14); color: var(--yellow); }
.status-已下线    { background: rgba(148,163,184,0.1);  color: var(--grey); }

.mini-chart-wrap {
  height: 92px; margin: 8px 0 0;
  border-radius: 5px; overflow: hidden; background: var(--surface2);
}
.mini-chart-wrap canvas { width: 100% !important; height: 92px !important; }
.no-chart {
  height: 92px; margin: 8px 0 0; display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 11px; background: var(--surface2); border-radius: 5px;
}
.card-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px;
}
.metric-label { font-size: 9px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; }
.metric-value { font-size: 13px; font-weight: 600; margin-top: 1px; }
.metric-value.green  { color: var(--green); }
.metric-value.red    { color: var(--red); }
.metric-value.yellow { color: var(--yellow); }
.metric-value.dim    { color: var(--text2); }

.sharpe-compare {
  margin-top: 8px; padding: 7px 9px;
  background: var(--surface2); border-radius: 6px;
  display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.sharpe-label { font-size: 9px; color: var(--text2); }
.sharpe-val { font-weight: 700; }
.sharpe-arrow { color: var(--text2); font-size: 10px; flex: 1; text-align: center; }
.deviation-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.deviation-dot.green  { background: var(--green); }
.deviation-dot.yellow { background: var(--yellow); }
.deviation-dot.red    { background: var(--red); }
.deviation-dot.dim    { background: var(--text2); }

/* ── Detail Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,16,36,0.8);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.open { display: flex; }

/* detail modal is wide */
.modal-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-detail-header {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.modal-detail-title { font-size: 16px; font-weight: 700; }
.modal-detail-meta { font-size: 11px; color: var(--text2); margin-top: 3px; }
.modal-detail-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.modal-detail-body::-webkit-scrollbar { display: none; }

/* combined chart */
.combined-chart-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px;
  margin-bottom: 18px;
}
.chart-legend {
  display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap;
}
.legend-item {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2);
}
.legend-line {
  width: 24px; height: 2px; border-radius: 1px; flex-shrink: 0;
}
.legend-line.dashed {
  background: repeating-linear-gradient(90deg, var(--accent2) 0 4px, transparent 4px 8px);
}
.chart-canvas-box { position: relative; width: 100%; height: 200px; }
.detail-chart-canvas { display: block; }
.status-dropdown { position: relative; }
.status-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); transition: all .15s; user-select: none;
}
.status-trigger:hover { filter: brightness(1.15); }
.status-trigger .st-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-trigger .st-chev { font-size: 9px; opacity: .65; margin-left: 1px; }
.status-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 5px; min-width: 156px; box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  display: none; flex-direction: column; gap: 2px;
}
.status-menu.open { display: flex; }
.status-opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .12s;
}
.status-opt:hover { background: var(--surface2); }
.status-opt .st-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-opt .st-check { margin-left: auto; font-size: 11px; }

.chart-toolbar { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:10px; }
.chart-nav { width:26px; height:26px; border-radius:7px; border:1px solid var(--border); background:var(--surface); color:var(--text2); cursor:pointer; font-size:16px; line-height:1; display:inline-flex; align-items:center; justify-content:center; transition:all .15s; }
.chart-nav:hover { color:var(--text); border-color:var(--accent); background:var(--surface2); }
.chart-mode-label { font-size:12px; font-weight:600; color:var(--text); min-width:40px; text-align:center; user-select:none; }
.chart-empty { display:none; align-items:center; justify-content:center; height:200px; color:var(--text2); font-size:12px; }


/* detail metrics grid */
.detail-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px;
  grid-template-rows: auto auto;
}
.detail-metric {
  background: var(--surface2); border-radius: 8px; padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.detail-metric-label { font-size: 9px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-metric-value { font-size: 17px; font-weight: 700; }

/* gate badges */
.gates-row { display: flex; gap: 6px; flex-wrap: wrap; }
.gate-badge {
  padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.2);
}
.gate-badge.pending {
  background: rgba(148,163,184,0.08); color: var(--grey); border-color: var(--border);
}

/* register modal */
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; width: 520px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  padding: 16px 20px 13px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text2);
  cursor: pointer; font-size: 17px; border-radius: 6px;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; flex-shrink: 0;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

/* 充提修正表单: 金额/备注占位符、日期文字、日历图标 统一为次级灰 */
#flowAmount::placeholder, #flowNote::placeholder { color: var(--text2); opacity: 1; }
#flowDate { color: var(--text2); }
#flowDate::-webkit-calendar-picker-indicator { filter: invert(0.55); opacity: 0.55; cursor: pointer; }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; }
.modal-tab {
  padding: 9px 13px; border: none; background: none;
  color: var(--text2); cursor: pointer; font-size: 12px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 11px; }
.form-row.full { grid-template-columns: 1fr; }
.form-group label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 7px 10px; font-size: 12px;
  outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-group select option { background: var(--surface2); }
.cascading-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.cascading-item { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
.cascading-item label { font-size: 11px; color: var(--text2); }

.checkbox-group { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; cursor: pointer; }
.checkbox-group input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); }
.checkbox-group label { font-size: 12px; color: var(--text); cursor: pointer; margin: 0; }
.gate-title {
  font-size: 10px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 9px; padding-bottom: 5px; border-bottom: 1px solid var(--border);
}

.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.btn { padding: 7px 16px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: background 0.15s; }
.btn-secondary { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a6be0; }

/* mini modal */
.mini-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; width: 300px; padding: 20px;
}
.mini-modal h3 { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.mini-modal input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 7px 10px; font-size: 12px;
  outline: none; margin-bottom: 12px;
}
.mini-modal input:focus { border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px; font-size: 12px;
  opacity: 0; transform: translateY(6px); transition: all 0.2s;
  z-index: 3000; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ── Performance table ── */
.perf-table-wrap { overflow-x: auto; }
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.perf-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.perf-table th:hover { color: var(--text); }
.perf-table th .sort-arrow { margin-left: 4px; opacity: 0.4; font-size: 9px; }
.perf-table th.sorted .sort-arrow { opacity: 1; color: var(--accent); }
.perf-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(37,58,102,0.5);
  white-space: nowrap;
  vertical-align: middle;
}
.perf-table tr:hover td { background: rgba(74,124,247,0.04); }
.perf-table tr:last-child td { border-bottom: none; }
.td-name { font-weight: 600; color: var(--text); }
.td-type { color: var(--text2); font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.sharpe-pill {
  display: inline-block;
  padding: 2px 8px; border-radius: 10px;
  font-weight: 700; font-size: 11px;
}
.sharpe-pill.good   { background: rgba(52,211,153,0.12); color: var(--green); }
.sharpe-pill.warn   { background: rgba(251,191,36,0.12);  color: var(--yellow); }
.sharpe-pill.bad    { background: rgba(248,113,113,0.12); color: var(--red); }
.sharpe-pill.none   { background: transparent; color: var(--text2); }
.return-val.pos { color: var(--green); font-weight: 600; }
.return-val.neg { color: var(--red);   font-weight: 600; }
.return-val.dim { color: var(--text2); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.curve-stats-box {
  display: flex;
  align-items: stretch;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
}
#curveMetrics { display: flex; align-items: stretch; }
.curve-sep {
  width: 1px;
  background: var(--border);
  align-self: center;
  height: 50%;
  flex-shrink: 0;
}
.curve-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  gap: 4px;
}
.curve-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.curve-stat-val {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* 敏感金额: 默认模糊, hover 显示真实值 */
.blur-sensitive {
  filter: blur(7px);
  transition: filter 0.18s ease;
  cursor: default;
  user-select: none;
}
.blur-sensitive:hover { filter: none; user-select: text; }

/* 敏感金额: 圆点遮罩与真实值叠放, hover 渐隐渐现(交叉淡入淡出)+blur 聚焦, ease-out */
.money-row {
  display: inline-flex; align-items: center; cursor: default;
  padding: 7px 14px; margin: -7px -14px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.money-reveal { display: inline-grid; }
.money-reveal > span { grid-area: 1 / 1; transition: opacity .4s ease-out, filter .4s ease-out; }
.money-reveal .mm-real { opacity: 0; filter: blur(8px); }
.money-row:hover .mm-mask { opacity: 0; filter: blur(6px); }
.money-row:hover .mm-real { opacity: 1; filter: blur(0); }

/* ── 预警通知栏(右下角, 可展开/收起) ── */
.alert-panel { position: fixed; right: 20px; bottom: 20px; z-index: 300; }
.alert-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(248,113,113,0.16); color: var(--red);
  border: 1px solid rgba(248,113,113,0.45); border-radius: 22px;
  padding: 9px 15px; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,0.45);
  transition: background .15s, transform .15s;
}
.alert-pill:hover { background: rgba(248,113,113,0.24); transform: translateY(-1px); }
.alert-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
}
.alert-badge { background: var(--red); color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.alert-box {
  width: 306px; max-height: 62vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.55); overflow: hidden;
  display: flex; flex-direction: column;
}
.alert-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text);
  transition: background .18s ease;
}
.alert-head:hover { background: var(--surface2); }
.alert-head .chev { display: inline-flex; color: var(--text2); }
.alert-list { overflow-y: auto; padding: 6px; }
/* 统一 hover 动效: 背景/透明度/位移平滑过渡 */
.alert-item {
  display: flex; align-items: stretch; gap: 6px;
  padding: 8px 8px 8px 11px; border-radius: 9px;
  transition: background .18s ease, opacity .18s ease, transform .18s ease;
}
.alert-item:hover { background: var(--surface2); }   /* 背景渐隐渐现, 不位移(避免 hover 偏移) */
.alert-item + .alert-item { margin-top: 2px; }
.alert-item-main { flex: 1; min-width: 0; cursor: pointer; }
.alert-item.read { opacity: 0.38; }             /* 已读: 视觉弱化, 不消失 */
.alert-item.read:hover { opacity: 0.62; }
.alert-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.alert-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.alert-sharpe { font-size: 11px; font-weight: 700; color: var(--red); white-space: nowrap; }
.alert-path { font-size: 10px; color: var(--text2); margin-top: 3px; }
.alert-suggest { font-size: 10.5px; margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.alert-suggest-text { color: var(--text2); }
.alert-read-btn {
  align-self: center; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  border-radius: 7px; padding: 4px 9px; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.alert-read-btn:hover { background: var(--surface); color: var(--text); border-color: var(--text2); }
/* 收起态: 纯数字圆形徽标 */
.alert-pill-num {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  justify-content: center; font-size: 15px; font-weight: 800; gap: 0;
}
/* 收起态(全部已读): 中性文字 pill */
.alert-pill-text {
  background: var(--surface); color: var(--text2);
  border-color: var(--border); font-weight: 600;
}
.alert-pill-text:hover { background: var(--surface2); color: var(--text); }

/* ── 组合净值曲线 区间选择 ─────────────────────────────────────── */
.pf-handle {
  position: absolute;
  width: 14px;
  cursor: ew-resize;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.pf-grip {
  width: 4px;
  height: 30px;
  border-radius: 2px;
  background: rgba(138, 171, 204, 0.28);
  transition: background 0.15s, height 0.15s;
}
.pf-handle:hover .pf-grip,
.pf-handle.dragging .pf-grip { background: rgba(255, 255, 255, 0.9); height: 44px; }
#pfRangeChip {
  display: none;
  position: absolute;
  top: -27px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.6;
  white-space: nowrap;
}
.pf-chip-x { cursor: pointer; opacity: 0.7; }
.pf-chip-x:hover { opacity: 1; }
.pf-guide {
  position: absolute;
  width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 0 4px, transparent 4px 7px);
  z-index: 7;
  pointer-events: none;
}
.pf-guide-tag {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  transform: translateX(-50%);
  background: #1c2d54;
  border: 1px solid #253a66;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  color: #7b9cc4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.pf-shade {
  position: absolute;
  background: rgba(5, 10, 25, 0.55);
  z-index: 5;
  pointer-events: none;
}
