/* AegisPulse 全局样式：浅灰数据中控风格 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #eef2f6;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------------- 登录页 ---------------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(61, 109, 242, 0.08), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(151, 179, 230, 0.08), transparent 60%),
    #eef2f6;
}
.login-card {
  width: 360px; background: #ffffff; border: 1px solid #d9e1eb;
  border-radius: 10px; padding: 22px 24px 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.login-brand { display: flex; align-items: center; gap: 8px; }
.login-brand .brand-mark { width: 24px; height: 24px; }
.login-brand .brand-name { font-size: 18px; font-weight: 600; color: #111827; letter-spacing: 1px; }
.login-title { font-size: 18px; margin: 16px 0 14px; color: #1f2937; font-weight: 600; }
.login-form .field { display: block; margin-bottom: 10px; }
.login-form .field span { display: block; color: #667085; font-size: 12px; margin-bottom: 4px; }
.login-form .field input,
.login-form .field select {
  width: 100%; background: #f8fafc; color: #1f2937;
  border: 1px solid #d9e1eb; border-radius: 4px;
  padding: 8px 10px; font-size: 13px;
}
.login-form .field input:focus,
.login-form .field select:focus { outline: none; border-color: #3d6df2; background: #ffffff; }
.btn.primary { background: #3d6df2; color: #ffffff; border: 1px solid #3d6df2; }
.btn.primary:hover { background: #315ed8; }
.btn.block { width: 100%; padding: 9px 0; border-radius: 5px; font-weight: 600; }
.login-msg { color: #ff6b6b; font-size: 12px; min-height: 18px; margin-top: 8px; }
.login-msg.ok { color: #4ade80; }
.login-foot { color: #667085; font-size: 11px; margin-top: 12px; text-align: center; }

/* ---------------- Home 布局 ---------------- */
.home { min-height: 100vh; margin-left: 128px; }
.home.sider-collapsed { margin-left: 56px; }

/* ---------------- 左侧 sider ---------------- */
.sider {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 128px; background: #f6f8fb; border-right: 1px solid #d9e1eb;
  display: flex; flex-direction: column; z-index: 10;
  transition: width 0.15s ease;
}
.sider.collapsed { width: 56px; }
.sider-brand {
  height: 52px; display: flex; align-items: center; gap: 4px;
  padding: 0 12px; color: #111827; border-bottom: 1px solid #d9e1eb;
  cursor: pointer; user-select: none; overflow: hidden;
}
.brand-mark {
  width: 22px; height: 22px;
  display: inline-block;
  flex: 0 0 auto;
}
.brand-text { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; transition: opacity 0.15s; color: #111827; white-space: nowrap; }
.sider.collapsed .brand-text { opacity: 0; }
.sider-menu { flex: 1; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.sider-foot { padding: 6px; border-top: 1px solid #d9e1eb; }
.sider-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px; border-radius: 6px;
  color: #667085; font-size: 12px; cursor: pointer;
  overflow: hidden; white-space: nowrap;
}
.sider-item:hover { background: #eaf0fb; color: #1f2937; }
.sider-item:hover .ico { opacity: 1; }
.sider-item.active { background: #e8f0ff; color: #3d6df2; }
.sider-item.active .ico { opacity: 1; }
.sider-item .ico {
  width: 18px; height: 18px;
  display: inline-block; vertical-align: middle;
  opacity: 0.78;
  filter: invert(39%) sepia(11%) saturate(724%) hue-rotate(184deg) brightness(92%) contrast(89%);
  transition: filter 0.15s, opacity 0.15s;
  flex: 0 0 auto;
}
/* 侧边栏字体图标（Remix Icon）：线性字形直接由字色控制，不需要 filter 调色 */
.sider-item i.ico {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  filter: none;
  color: #667085;
  transition: color 0.15s, opacity 0.15s;
}
.sider-item:hover i.ico { color: #1f2937; }
.sider-item.active i.ico { color: #3d6df2; }
.sider-item .lbl { white-space: nowrap; transition: opacity 0.15s; }
.sider.collapsed .sider-item .lbl { opacity: 0; }

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 22px;
  background: #ffffff; border-bottom: 1px solid #d9e1eb;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.page-title { font-size: 16px; font-weight: 600; color: #1f2937; }
.page-sub { color: #667085; font-size: 12px; }
.topbar-hexagrams {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}
.topbar-hexagram {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.topbar-hexagram + .topbar-hexagram::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 1px;
  height: 22px;
  background: #d9e1eb;
  transform: translateY(-50%);
}
.topbar-hexagram-svg {
  width: 36px;
  height: 32px;
  display: block;
  stroke: #e9bd43;
  stroke-width: 4.5;
  stroke-linecap: round;
  fill: none;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-name { color: #475467; font-size: 13px; }

/* ---------------- Route host ---------------- */
.route-host { padding: 14px 22px 22px; }

/* ---------------- Filterbar ---------------- */
.filterbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0 12px;
  flex-wrap: wrap;
}
.filter-label { color: #667085; font-size: 12px; }
.filterbar select {
  background: #ffffff; color: #1f2937;
  border: 1px solid #d9e1eb; border-radius: 4px;
  padding: 4px 8px; font-size: 12px;
  min-width: 90px;
}
.filterbar select:disabled { opacity: 0.5; }
.filter-spacer { flex: 1; }
.btn {
  background: #ffffff; color: #475467; border: 1px solid #d9e1eb;
  border-radius: 4px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn:hover:not(:disabled) { background: #eef4ff; color: #1f2937; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.danger {
  background: rgba(220, 38, 38, 0.06);
  color: #b42318;
  border-color: rgba(220, 38, 38, 0.18);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
  color: #912018;
}
.btn.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn-ico {
  width: 12px; height: 12px; display: inline-block; vertical-align: middle;
  filter: invert(39%) sepia(11%) saturate(724%) hue-rotate(184deg) brightness(92%) contrast(89%);
}

/* ---------------- Alert Banner ---------------- */
.alert-banner {
  border-radius: 6px; padding: 10px 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; font-size: 13px;
}
.alert-banner.error { background: rgba(255, 107, 107, 0.12); border: 1px solid #ff6b6b; }
.alert-banner.warn  { background: rgba(251, 191, 36, 0.10); border: 1px solid #fbbf24; }
.alert-banner.info  { background: rgba(61, 109, 242, 0.10); border: 1px solid #3d6df2; }
.alert-banner .tag {
  padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #ffffff;
}
.alert-banner.error .tag { background: #ff6b6b; }
.alert-banner.warn  .tag { background: #fbbf24; }
.alert-banner.info  .tag { background: #3d6df2; }
.alert-banner .detail { color: #667085; font-size: 12px; }
.alert-banner .spacer { flex: 1; }
.alert-banner .t { color: #667085; font-size: 12px; }

/* ---------------- KPI ---------------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  margin-bottom: 12px;
}
.kpi {
  background: #ffffff; border: 1px solid #d9e1eb; border-radius: 8px;
  padding: 12px 14px;
}
.kpi .label { color: #667085; font-size: 12px; margin-bottom: 4px; }
.kpi .value {
  font-size: 20px; font-weight: 600; color: #1f2937;
  display: flex; align-items: baseline; gap: 6px;
}
.kpi .value .unit { font-size: 12px; color: #667085; font-weight: normal; }
.kpi .delta { font-size: 12px; margin-top: 3px; color: #667085; }
.kpi .delta.pos { color: #4ade80; }
.kpi .delta.neg { color: #ff6b6b; }
.kpi .value.pos { color: #4ade80; }
.kpi .value.neg { color: #ff6b6b; }
.kpi .value .ok { color: #4ade80; }
.kpi .value .bad { color: #ff6b6b; }
.kpi .value .sep { color: #667085; margin: 0 4px; }

/* ---------------- Row / Card ---------------- */
.row { display: grid; gap: 12px; margin-bottom: 12px; }
.row.two-thirds { grid-template-columns: 2fr 1fr; }

.card {
  background: #ffffff; border: 1px solid #d9e1eb; border-radius: 8px;
  padding: 12px 14px;
}
.card-title {
  font-size: 13px; color: #475467; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.chart-area { width: 100%; height: 320px; }
.chart-area.tall { height: 360px; }

/* ---------------- Alerts list ---------------- */
.alerts-list { list-style: none; margin: 0; padding: 0; }
.alerts-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid #e6ebf2; font-size: 13px;
}
.alerts-list li:first-child { border-top: none; }
.alerts-list .lv { width: 48px; font-size: 11px; font-weight: 600; }
.alerts-list .lv.error { color: #ff6b6b; }
.alerts-list .lv.warn  { color: #fbbf24; }
.alerts-list .lv.info  { color: #7ad6ff; }
.alerts-list .title { flex: 1; }
.alerts-list .src { color: #667085; font-size: 12px; }
.alerts-list .handled {
  font-size: 11px; padding: 1px 6px; border-radius: 3px;
}
.alerts-list .handled.no  { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.alerts-list .handled.yes { background: #eef2f6; color: #667085; }
.alerts-list .t { color: #667085; font-size: 12px; width: 130px; text-align: right; }

/* ---------------- Attribution ---------------- */
.attribution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-title { color: #667085; font-size: 12px; margin-bottom: 6px; }
.attr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 12px;
}
.attr-row .name { width: 96px; color: #1f2937; }
.attr-row .bar-wrap { flex: 1; background: #edf1f6; height: 6px; border-radius: 3px; overflow: hidden; }
.attr-row .bar { height: 100%; }
.attr-row .bar.pos { background: #4ade80; }
.attr-row .bar.neg { background: #ff6b6b; }
.attr-row .v { width: 72px; text-align: right; }
.attr-row .v.pos { color: #4ade80; }
.attr-row .v.neg { color: #ff6b6b; }

.attribution-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #1d2330;
  font-size: 12px;
}
.attribution-stats .stat-label { color: #667085; }
.attribution-stats .stat-value { font-size: 16px; color: #1f2937; margin-top: 2px; }

/* ---------------- Strategy table ---------------- */
.strategy-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.strategy-table th {
  text-align: left; color: #667085; font-weight: normal;
  padding: 6px 4px; border-bottom: 1px solid #e1e8f0;
}
.strategy-table th.num, .strategy-table td.num { text-align: right; }
.strategy-table td { padding: 8px 4px; border-top: 1px solid #e9eff5; }
.strategy-table .group { color: #667085; }
.strategy-table .st.running { color: #4ade80; }
.strategy-table .st.stopped { color: #8a92a6; }
.strategy-table .st.error   { color: #ff6b6b; }
.strategy-table .pos { color: #4ade80; }
.strategy-table .neg { color: #ff6b6b; }
.strategy-table .heartbeat { color: #667085; }
.strategy-table .pos-long  { color: #4ade80; }
.strategy-table .pos-short { color: #ff6b6b; }
.strategy-table .pos-flat  { color: #8a92a6; }

/* ---------------- Generic list page ---------------- */
.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th, .simple-table td {
  padding: 8px 10px; border-bottom: 1px solid #e1e8f0; text-align: left;
}
.simple-table th { color: #667085; font-weight: normal; }
.simple-table td.num, .simple-table th.num { text-align: right; }
.simple-table tbody tr:hover { background: #f8fbfd; }
.status-pill {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 11px;
}
.status-pill.running { background: rgba(74, 222, 128, 0.16); color: #4ade80; }
.status-pill.stopped { background: rgba(102, 112, 133, 0.12); color: #667085; }
.status-pill.error   { background: rgba(255, 107, 107, 0.18); color: #ff6b6b; }
.status-pill.draft   { background: rgba(102, 112, 133, 0.12); color: #667085; }
.status-pill.published { background: rgba(74, 222, 128, 0.16); color: #4ade80; }
.status-pill.rolled_back { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }

/* ---------------- Page foot ---------------- */
.page-foot { text-align: right; color: #667085; font-size: 12px; padding: 8px 0 0; }
.empty-tip { color: #667085; font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------------- 币本位大盘 ---------------- */
.cb-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.cb-table-card {
  padding: 0; overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.cb-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid #d9e1eb;
}
.cb-table thead th {
  text-align: center; color: #475467; font-weight: 600;
  padding: 11px 12px; border-bottom: 1px solid #dfe6ef; background: #f6f8fb;
  border-right: 1px solid #e7edf4;
}
.cb-table thead th:last-child { border-right: 0; }
.cb-table tbody td {
  padding: 12px; border-bottom: 1px solid #e9eff5; vertical-align: middle;
  border-right: 1px solid #eef3f8;
  text-align: center;
  background: #ffffff;
  white-space: nowrap;
}
.cb-table tbody td:last-child { border-right: 0; }
.cb-table tbody tr:last-child td { border-bottom: 0; }  /* 最后一行不重复底边 */
.cb-table tbody tr:hover td { background: #f8fbfd; }
/* 账户名链接：淡紫 + 常驻下划线，一眼可辨又不抢戏（点击打开净值曲线） */
.cb-name {
  color: #a78bfa; font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.cb-name:hover { color: #8b5cf6; }
.cb-total-wrap {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.cb-mark {
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.cb-big { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: #1f2937; }
.cb-sub { color: #667085; font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cb-total { letter-spacing: 0.2px; }

/* ---------------- U 本位大盘 ---------------- */
.ub-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.ub-table-card {
  padding: 0; overflow: hidden; background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.ub-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid #d9e1eb;
}
.ub-table thead th {
  text-align: center; color: #475467; font-weight: 600;
  padding: 14px 16px; border-bottom: 1px solid #dfe6ef; background: #f6f8fb;
  border-right: 1px solid #e7edf4;
  white-space: nowrap;
}
.ub-table thead th:last-child { border-right: 0; }
.ub-table thead th.num,
.ub-table tbody td.num { text-align: center; }
.ub-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid #e9eff5; border-right: 1px solid #eef3f8;
  vertical-align: top; color: #1f2937; font-variant-numeric: tabular-nums;
  text-align: center;
  background: #ffffff;
  white-space: nowrap;
}
.ub-table tbody td:last-child { border-right: 0; }
.ub-table tbody tr:hover td { background: #f8fbfd; }
/* 账户名链接：与币本位大盘统一为淡紫下划线（点击打开净值曲线）
   注意：需带上 .ub-table tbody 前缀，否则会被上方 td 的默认字色盖住 */
.ub-table tbody td.ub-name {
  color: #a78bfa; font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.ub-table tbody td.ub-name:hover { color: #8b5cf6; }
.ub-total-wrap {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.ub-total { color: inherit; }
.ub-big { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: #2f3948; }
.ub-sub { color: #667085; font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* 账户净值弹窗：位置偏上 + 宽度放大
   注意：这里必须用双类选择器（.cn-modal.ub-eq-modal），
   否则会被文件后方的通用 .cn-modal（单类，权重相同但靠后）覆盖掉宽度。 */
.cn-modal-backdrop.ub-eq-backdrop { align-items: flex-start; padding-top: 48px; }
.cn-modal.ub-eq-modal { width: 40vw; }
.ub-eq-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ub-eq-btn {
  padding: 4px 14px; border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #5f6b7a; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.ub-eq-btn:hover { border-color: #4c6ef5; color: #4c6ef5; }
.ub-eq-btn.active { background: #4c6ef5; border-color: #4c6ef5; color: #ffffff; }
/* 最大回撤展示：右对齐到工具条末尾 */
.ub-eq-mdd { margin-left: auto; color: #5f6b7a; font-size: 12px; font-weight: 600; }
.ub-eq-mdd b { color: #dc2626; font-variant-numeric: tabular-nums; }

/* ---------------- U 合约入网 ---------------- */
.ucn-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0;
}
.ucn-table-card {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.ucn-table-card .card-title {
  margin-bottom: 0;
  padding: 12px 16px 10px;
}
.ucn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid #d9e1eb;
}
.ucn-table thead th {
  padding: 11px 12px;
  text-align: center;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  background: #f6f8fb;
  border-bottom: 1px solid #dfe6ef;
  border-right: 1px solid #e7edf4;
  white-space: nowrap;
}
.ucn-table thead th:last-child {
  border-right: 0;
}
.ucn-table tbody td {
  padding: 11px 12px;
  text-align: center;
  border-bottom: 1px solid #e9eff5;
  border-right: 1px solid #eef3f8;
  background: #ffffff;
  color: #2b3442;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ucn-table tbody tr:hover td {
  background: #f8fbfd;
}
.ucn-table tbody tr:last-child td {
  border-bottom: 0;
}
.ucn-table tbody td:last-child {
  border-right: 0;
}
.ucn-count {
  color: #667085;
  font-weight: 400;
}
.ucn-trade-cell {
  white-space: nowrap;
}
.ucn-trade-inline {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.ucn-account-cell {
  min-width: 190px;
}
.ucn-account-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.ucn-account-name {
  color: #66ab18;
  font-size: 15px;
  font-weight: 600;
}
.ucn-account-area {
  color: #667085;
  font-size: 12px;
}
.ucn-base {
  color: #2f3948;
  font-size: 14px;
  font-weight: 600;
}
.ucn-balance {
  color: #0b5ec9;
  font-size: 15px;
  font-weight: 700;
}
.ucn-bet {
  color: #3182f6;
  font-size: 15px;
  font-weight: 500;
}
.ucn-bet-prefix {
  margin-right: 4px;
  font-size: 13px;
  font-weight: 700;
}
.ucn-amount {
  font-size: 14px;
  font-weight: 700;
}
.ucn-multiple {
  color: #707b8d;
  font-size: 12px;
  line-height: 1;
}
.ucn-op-cell {
  min-width: 88px;
  text-align: center;
}
.ucn-edit-btn {
  min-width: 56px;
  height: 30px;
  padding: 0 12px;
  color: #5b6880;
  border-color: #cfd7e3;
  background: #ffffff;
}
.ucn-edit-btn:hover {
  color: #355ea7;
  border-color: #b8c5d8;
  background: #ffffff;
}

/* ---------------- 全局注册表 ---------------- */
.gs-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0;
}
.gs-card {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.gs-card .card-title {
  margin-bottom: 0;
  padding: 12px 16px 10px;
}
.gs-count {
  color: #667085;
  font-weight: 400;
}
.gs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid #d9e1eb;
}
.gs-table thead th {
  padding: 11px 12px;
  text-align: left;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  background: #f6f8fb;
  border-bottom: 1px solid #dfe6ef;
  border-right: 1px solid #e7edf4;
  white-space: nowrap;
}
.gs-table thead th:last-child {
  border-right: 0;
}
.gs-table tbody td {
  padding: 12px;
  vertical-align: top;
  border-bottom: 1px solid #e9eff5;
  border-right: 1px solid #eef3f8;
  background: #ffffff;
  color: #2b3442;
}
.gs-table tbody tr:hover td {
  background: #f8fbfd;
}
.gs-table tbody tr:last-child td {
  border-bottom: 0;
}
.gs-table tbody td:last-child {
  border-right: 0;
}
.gs-namespace-cell {
  min-width: 160px;
  color: #475467;
  font-weight: 500;
  white-space: nowrap;
}
.gs-key-cell {
  min-width: 180px;
  color: #2f3948;
  white-space: nowrap;
}
.gs-type-cell {
  width: 88px;
  min-width: 88px;
  color: #667085;
  text-transform: lowercase;
  white-space: nowrap;
}
.gs-value-cell {
  min-width: 520px;
}
.gs-value-box {
  padding: 8px 10px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #f8fafc;
  color: #394150;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- 币择时持仓 ---------------- */
.ctp-wrap {
  width: 100%;
  max-width: 1500px;
}
.ctp-card {
  padding: 0;
  overflow: hidden;
}
.ctp-card .card-title {
  margin-bottom: 0;
  padding: 12px 16px 10px;
}
.ctp-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ctp-advanced-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #3d6df2;
  font-size: 12px;
  cursor: pointer;
}
.ctp-advanced-link:hover {
  color: #315ed8;
  text-decoration: underline;
}
.ctp-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #eef3f8;
  border-bottom: 1px solid #eef3f8;
  background: #fbfcfe;
}
.ctp-toolbar[hidden] {
  display: none;
}
.ctp-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0;
}
.ctp-filter span {
  color: #667085;
  font-size: 12px;
}
.ctp-filter input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9e1eb;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
}
.ctp-filter input:focus {
  outline: none;
  border-color: #3d6df2;
  box-shadow: 0 0 0 3px rgba(61, 109, 242, 0.12);
}
.ctp-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}
.ctp-table {
  margin-top: 0;
}
.ctp-margin-cell {
  padding-right: 2px !important;
  white-space: nowrap;
}
.ctp-contracts-head {
  text-align: left !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.ctp-open-price-head {
  text-align: left !important;
  padding-right: 20px !important;
}
.ctp-margin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
}
.ctp-margin-pill-btc {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.ctp-margin-pill-eth {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}
.ctp-margin-pill-sol {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.ctp-margin-pill-bnb {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}
.ctp-margin-pill-default {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}
.ctp-open-price-cell {
  text-align: left !important;
  padding-left: 4px !important;
  padding-right: 20px !important;
}
.ctp-contracts-cell {
  padding-left: 0 !important;
  padding-right: 2px !important;
  text-align: left !important;
}
.ctp-contracts-positive {
  color: #16a34a;
  font-weight: 600;
}
.ctp-contracts-negative {
  color: #dc2626;
  font-weight: 600;
}
.ctp-strategy-head {
  padding-left: 10px !important;
}
.ctp-strategy-cell {
  padding-left: 10px !important;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
}
.ctp-page-meta {
  color: #667085;
  font-size: 12px;
}
.ctp-page-actions {
  display: flex;
  gap: 8px;
}
.ctp-close-modal {
  width: min(100%, 560px);
}
.ctp-flatten-modal {
  width: min(100%, 560px);
}
.ctp-close-warning {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #f8fbfe;
  color: #526175;
  font-size: 13px;
  line-height: 1.6;
}
.ctp-close-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.ctp-close-item {
  padding: 10px 12px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}
.ctp-close-label {
  display: block;
  margin-bottom: 6px;
  color: #8a99ae;
  font-size: 12px;
  font-weight: 600;
}
.ctp-close-value {
  display: block;
  color: #243041;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}
.ctp-flatten-field {
  margin-top: 14px;
}

/* ---------------- 择时策略 ---------------- */
.ts-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0;
}
.ts-card {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.ts-card .card-title {
  margin-bottom: 0;
  padding: 12px 16px 10px;
}
.ts-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ts-advanced-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #3d6df2;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.ts-advanced-link:hover {
  color: #315ed8;
  text-decoration: underline;
}
.ts-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #e7edf4;
  flex-wrap: wrap;
}
.ts-toolbar[hidden] {
  display: none;
}
.ts-search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-search-field span {
  color: #667085;
  font-size: 12px;
}
.ts-search-field input {
  width: 180px;
  height: 34px;
  border: 1px solid #d9e1eb;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #1f2937;
}
.ts-search-field input:focus {
  outline: none;
  border-color: #98b2ff;
  box-shadow: 0 0 0 3px rgba(61, 109, 242, 0.10);
}
.ts-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-count {
  color: #667085;
  font-weight: 400;
}
.ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid #d9e1eb;
}
.ts-table thead th {
  padding: 11px 12px;
  text-align: left;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  background: #f6f8fb;
  border-bottom: 1px solid #dfe6ef;
  border-right: 1px solid #e7edf4;
  white-space: nowrap;
}
.ts-table thead th:last-child {
  border-right: 0;
}
.ts-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #e9eff5;
  border-right: 1px solid #eef3f8;
  background: #ffffff;
  color: #2b3442;
  vertical-align: middle;
}
.ts-table tbody tr:hover td {
  background: #f8fbfd;
}
.ts-table tbody tr:last-child td {
  border-bottom: 0;
}
.ts-table tbody td:last-child {
  border-right: 0;
}
.ts-id-cell {
  min-width: 160px;
  max-width: 260px;
  color: #344054;
}
.ts-id-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.ts-id-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
/* ID 可点击查看 K 线图 */
/* 策略 ID 链接：淡紫 + 常驻下划线，一眼可辨又不抢戏（点击打开 K 线图） */
.ts-id-link {
  color: #a78bfa; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.ts-id-link:hover { color: #8b5cf6; }
/* 择时策略 K 线弹窗：顶部不高于 topbar（高 52px），内容超高时整体可滚动
   注意：必须用双类选择器，否则会被文件后方的通用 .cn-modal 覆盖宽度 */
.cn-modal-backdrop.ts-chart-backdrop {
  align-items: flex-start;
  padding: 68px 20px 40px;
  overflow-y: auto;
}
.cn-modal.ts-chart-modal { width: 65vw; }
.ts-chart-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ts-chart-btn {
  padding: 4px 14px; border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #5f6b7a; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.ts-chart-btn:hover { border-color: #4c6ef5; color: #4c6ef5; }
.ts-chart-btn.active { background: #4c6ef5; border-color: #4c6ef5; color: #ffffff; }
.ts-chart-tip { margin-left: auto; color: #8a99ae; font-size: 12px; }
/* 持仓状态 / 核心参数 可点击，弹窗查看原始字段（rt_space / signal_params） */
.ts-dict-link { cursor: pointer; }
.ts-dict-link-text:hover { color: #4c6ef5; text-decoration: underline; }
.ts-chip.ts-dict-link:hover { box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.22); }
/* 原始字段弹窗：键值对逐行，嵌套 dict 缩进展开
   注意：必须用双类选择器，否则会被文件后方的通用 .cn-modal 覆盖宽度 */
.cn-modal-backdrop.ts-dict-backdrop {
  align-items: flex-start;
  padding: 68px 20px 40px;
  overflow-y: auto;
}
.cn-modal.ts-dict-modal { width: 22vw; }
/* 关闭策略确认弹窗：与原始字段弹窗保持一致的偏上位置 */
.cn-modal-backdrop.ts-close-backdrop {
  align-items: flex-start;
  padding: 68px 20px 40px;
}
.ts-dict-list {
  max-height: 58vh;
  padding-bottom: 12px;
  overflow-y: auto;
}
.ts-dict-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 2px;
  border-bottom: 1px dashed #eef2f7;
  font-size: 12px;
}
.ts-dict-row:last-child { border-bottom: 0; }
.ts-dict-row-sub { padding-left: 20px; border-bottom: 0; }
.ts-dict-key,
.ts-dict-val {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}
.ts-dict-key { flex: 0 0 42%; color: #667085; }
.ts-dict-val { flex: 1 1 auto; color: #2f3948; font-weight: 600; text-align: right; }
.ts-dict-row-sub .ts-dict-key { color: #98a2b3; }
.ts-dict-val-nested { color: #8a99ae; font-weight: 500; }
.ts-dict-empty { padding: 16px 2px; color: #8a99ae; font-size: 12px; }
.ts-inline-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f6fa;
  border: 1px solid #dde5ef;
  color: #475467;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  flex: 0 0 auto;
}
.ts-inline-tag-area {
  background: rgba(61, 109, 242, 0.08);
  border-color: rgba(61, 109, 242, 0.16);
  color: #315ecf;
}
.ts-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  border-top: 1px solid #e7edf4;
  background: #fff;
}
.ts-page-meta {
  color: #667085;
  font-size: 12px;
}
.ts-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ap-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ap-page-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d9e1eb;
  border-radius: 6px;
  background: #ffffff;
  color: #475467;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.ap-page-btn:hover:not(:disabled) {
  background: #eef4ff;
  border-color: #cddcff;
  color: #315ed8;
}
.ap-page-btn.active,
.ap-page-btn:disabled.active {
  background: #e8f0ff;
  border-color: #cddcff;
  color: #315ed8;
  cursor: default;
}
.ap-page-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ap-page-btn.ap-page-nav {
  min-width: auto;
}
.ap-page-ellipsis {
  padding: 0 2px;
  color: #98a2b3;
  font-size: 12px;
}
.ts-core-cell {
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}
.ts-chip,
.ts-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.ts-chip-long,
.ts-direction-long {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
.ts-chip-short,
.ts-direction-short {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}
.ts-chip-flat,
.ts-direction-both {
  background: rgba(71, 84, 103, 0.10);
  color: #475467;
}
.sr-json-cell {
  min-width: 520px;
}
.sr-param-list,
.sr-modal-params {
  display: block;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  white-space: normal;
  word-break: break-word;
}
.sr-param-list {
  max-height: 160px;
  overflow: auto;
}
.sr-modal-params {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
}
.sr-param-empty {
  color: #94a3b8;
}
.sr-action-cell {
  white-space: nowrap;
}
.sr-action-cell .btn + .btn {
  margin-left: 8px;
}
.sr-confirm-modal {
  width: min(100%, 760px);
}
.ctp-close-item-full {
  grid-column: 1 / -1;
}

/* ---------------- 币合约配置 ---------------- */
.cn-wrap {
  width: 100%;
  max-width: none;
}
.cn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.cn-config-card {
  min-height: 455px;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 4px;
  padding: 12px 14px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.cn-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
}
.cn-head-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.cn-card-name {
  color: #667085;
  font-size: 15px;
  font-weight: 600;
}
.cn-coin-name {
  color: #8ea3c2;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cn-lev-inline {
  color: #7c8fb0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cn-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cn-area-code {
  color: #90a0b7;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cn-edit-btn {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
}
.cn-edit-btn:hover { opacity: 1; }
.cn-edit-icon {
  width: 14px;
  height: 14px;
  display: block;
}
.cn-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}
.cn-meta-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cn-meta-grid-one {
  grid-template-columns: 1fr;
  padding-bottom: 10px;
}
.cn-meta-item {
  background: #fafcff;
  border: 1px solid #eaf0f7;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 54px;
}
.cn-meta-label {
  display: block;
  color: #9aa8bc;
  font-size: 12px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.cn-meta-value {
  display: block;
  color: #667085;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.cn-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #98a2b3;
  font-size: 13px;
  font-weight: 600;
  margin: 2px 0 12px;
}
.cn-section-count {
  color: #7f8ea7;
  font-size: 12px;
  font-weight: 600;
}
.cn-section-title::before,
.cn-section-title::after {
  content: "";
  height: 1px;
  background: #dde4ec;
  flex: 1;
}
.cn-strategy-list {
  color: #98a2b3;
  font-size: 13px;
  line-height: 1.6;
  max-height: calc(20 * 34px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.cn-strategy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #edf2f7;
  font-variant-numeric: tabular-nums;
}
.cn-strategy-item:last-child {
  border-bottom: 0;
}
.cn-strategy-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: #8f9bad;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cn-strategy-rate {
  color: #7f8ea7;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
.cn-strategy-empty {
  color: #b7c1ce;
  padding-top: 4px;
}
.ncn-config-card {
  min-height: 390px;
}
.ncn-card-name {
  color: #5b6472;
}
.ncn-edit-btn {
  min-width: 52px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 24px;
}
.ncn-strategy-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.ncn-pos-rule-default {
  color: #9aa8bc;
}
.ncn-modal {
  width: min(calc(100vw - 24px), 1120px);
}
.ncn-modal .cn-modal-head {
  padding: 18px 22px 12px;
}
.ncn-modal .cn-modal-title {
  font-size: 20px;
}
.ncn-json-input {
  min-height: 620px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre;
  overflow: auto;
}
.cn-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
}
.cn-modal {
  width: min(100%, 420px);
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}
/* U择时持仓的关闭弹窗：整体上移，避免视觉重心偏下 */
#utp-close-backdrop {
  align-items: flex-start;
  padding-top: 10vh;
}
.cn-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid #e8eef5;
}
.cn-modal-title {
  color: #243041;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.cn-modal-subtitle {
  margin-top: 4px;
  color: #8a99ae;
  font-size: 12px;
  font-weight: 600;
}
.cn-modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.cn-modal-close:hover {
  color: #475569;
}
.cn-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
}
.cn-modal-body {
  padding: 16px 18px 0;
}
.cn-field {
  display: block;
}
.cn-field + .cn-field {
  margin-top: 14px;
}
.cn-field-label {
  display: block;
  margin-bottom: 6px;
  color: #7b8aa0;
  font-size: 12px;
  font-weight: 600;
}
.cn-field-input {
  width: 100%;
  height: 38px;
  border: 1px solid #d8e1ec;
  border-radius: 6px;
  background: #ffffff;
  color: #243041;
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.cn-field-input:focus {
  border-color: #7c8fb0;
  box-shadow: 0 0 0 3px rgba(124, 143, 176, 0.12);
}
.cn-form-error {
  display: none;
  margin-top: 12px;
  min-height: 20px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.5;
}
/* ---------------- 顶部网络进度条 ---------------- */
/* 慢网络下点击后需要等待，用顶部细条给出"正在加载"的反馈（由 AP.progress 驱动） */
.ap-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.ap-progress.is-active {
  opacity: 1;
}
.ap-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e9bd43, #f2d27a);
  box-shadow: 0 0 6px rgba(233, 189, 67, 0.55);
}

.ap-toast {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 1600;
  min-width: 180px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.ap-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.ap-toast-success {
  color: #166534;
  background: linear-gradient(180deg, #ecfdf3 0%, #dcfce7 100%);
  border: 1px solid #86efac;
}

/* ---------------- 市场观察 ---------------- */
.mw-wrap { width: 100%; max-width: 1500px; }
.mw-mock-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(233, 189, 67, 0.16);
  border: 1px solid rgba(233, 189, 67, 0.42);
  color: #8a6b12;
  font-size: 11px;
  font-weight: 600;
}

/* 分位条 */
.mw-bar {
  height: 5px; margin-top: 9px;
  border-radius: 999px; background: #eef2f7; overflow: hidden;
}
.mw-bar > span { display: block; height: 100%; border-radius: 999px; background: #9fb3d1; }
.mw-bar > span.hot { background: #e0a92b; }
.mw-bar > span.cold { background: #7c93b8; }
.mw-bar-label { margin-top: 5px; color: #98a2b3; font-size: 11px; }

/* 分区 */
.mw-section { margin-bottom: 20px; }
.mw-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.mw-section-title { color: #2f3948; font-size: 14px; font-weight: 700; }
.mw-section-sub { color: #98a2b3; font-size: 12px; }
.mw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* 指标卡片 */
.mw-card {
  display: flex; flex-direction: column;
  padding: 12px 14px 14px;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.mw-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mw-card-title { color: #475467; font-size: 12px; }
.mw-main {
  color: #2f3948; font-size: 19px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* 主值区间配色：< 100 淡蓝 / 100~180 灰 / 180~250 橙 / >= 250 红 */
.mw-main.low { color: #6f96d6; }
.mw-main.mid { color: #667085; }
.mw-main.warn { color: #b45309; }
.mw-main.danger { color: #b91c1c; }
.mw-main em {
  margin-left: 4px; color: #98a2b3;
  font-size: 11px; font-style: normal; font-weight: 500;
}
.mw-spark { width: 100%; height: 44px; margin: 8px 0 2px; }
/* 已归一化的指数卡片不展示分位条，把腾出的高度补给缩略图 */
.mw-card-nobar .mw-spark { height: 76px; }
.mw-card-main { display: inline-flex; align-items: center; gap: 8px; }
/* 卡片右上角展开入口 */
.mw-expand {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid #d9e1eb; border-radius: 6px;
  background: #f8fafc; color: #8a99ae;
  cursor: pointer;
}
.mw-expand:hover { border-color: #4c6ef5; color: #4c6ef5; }
.mw-metrics { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.mw-metric {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; font-size: 12px;
}
.mw-metric-l { color: #8a99ae; }
.mw-metric-v { color: #2f3948; font-weight: 600; font-variant-numeric: tabular-nums; }
.mw-metric-v.up { color: #15803d; }
.mw-metric-v.down { color: #b91c1c; }
.mw-hint {
  margin: auto 0 0; padding-top: 9px;
  border-top: 1px dashed #eef2f7;
  color: #667085; font-size: 12px; line-height: 1.5;
}

/* 大卡片：每张内含两个模块横向并排，
   每个模块约占两个 L0 小卡的宽度，与上方 4 列网格在视觉上对齐 */
.mw-big-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px; padding: 14px 16px 16px;
  background: #ffffff;
  border: 1px solid #d9e1eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
/* min-width:0 防止表格长策略名把网格撑破 */
.mw-table-block { min-width: 0; display: flex; flex-direction: column; }
/* 交易记录列更多、内容更长，让它多占一点宽度（约 13:10）。
   gap 置 0，改由两侧等宽内边距 + 中间一条竖线来分隔，分区更明确 */
.mw-big-card.mw-big-card-asym { grid-template-columns: 1.3fr 1fr; gap: 0; }
.mw-big-card-asym > .mw-table-block:first-child { padding-right: 20px; }
.mw-big-card-asym > .mw-table-block + .mw-table-block {
  padding-left: 20px;
  border-left: 1px solid #d9e1eb;
}
.mw-table-scroll { overflow-x: auto; }
.mw-table-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
/* 表头右侧：策略 ID 查询输入框 + 查询按钮 + 总条数 */
.mw-table-tools { display: flex; align-items: center; gap: 6px; }
.mw-search-input {
  width: 150px; min-width: 0; padding: 4px 8px;
  border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #1f2937; font-size: 12px;
}
.mw-search-input:focus { outline: none; border-color: #3d6df2; background: #ffffff; }
.mw-search-btn {
  flex: 0 0 auto; padding: 4px 12px;
  border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #5f6b7a;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.mw-search-btn:hover { border-color: #4c6ef5; color: #4c6ef5; }
.mw-table-title { color: #2f3948; font-size: 13px; font-weight: 700; }
.mw-table-meta { color: #8a99ae; font-size: 12px; }
.mw-table { width: 100%; border-collapse: collapse; }
.mw-table th {
  padding: 8px 12px; text-align: left; white-space: nowrap;
  background: #f8fafc; color: #667085;
  font-size: 12px; font-weight: 600;
  border-bottom: 1px solid #e6ebf2;
}
.mw-table td {
  padding: 8px 12px; white-space: nowrap;
  color: #2f3948; font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.mw-table tbody tr:hover { background: #f8fafc; }
.mw-table th.num, .mw-table td.num { text-align: right; }
.mw-table td.num .mw-open-tag { margin-left: 6px; }
.mw-cell-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
/* 策略 ID 链接：与择时策略 ID 保持同一链接观感（点击打开 K 线弹窗） */
.mw-id-link {
  color: #a78bfa; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.mw-id-link:hover { color: #8b5cf6; }
.mw-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.mw-pct.up { color: #15803d; }
.mw-pct.down { color: #b91c1c; }
.mw-pct.flat { color: #98a2b3; }
.mw-dir {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.mw-dir.long { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.mw-dir.short { background: rgba(220, 38, 38, 0.10); color: #b91c1c; }
.mw-open-tag {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(233, 189, 67, 0.16);
  border: 1px solid rgba(233, 189, 67, 0.42);
  color: #8a6b12; font-size: 11px; font-weight: 600;
}
/* 信号动作：「在 771 平多」——价格深色 + 动作按方向着色 */
.mw-act-price { color: #2f3948; font-weight: 600; font-variant-numeric: tabular-nums; }
.mw-act { font-weight: 600; }
.mw-act.up { color: #15803d; }
.mw-act.down { color: #b91c1c; }
.mw-act.flat { color: #98a2b3; }
.mw-act-sep { margin: 0 4px; color: #c7d2e0; }
.mw-table-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.mw-page-meta { color: #8a99ae; font-size: 12px; }
.mw-empty { padding: 22px 0; text-align: center; color: #98a2b3; font-size: 12px; }

/* 详情大图弹窗：位置偏上，宽度介于净值弹窗与 K 线弹窗之间
   注意：必须用双类选择器，否则会被通用 .cn-modal 覆盖宽度 */
.cn-modal-backdrop.mw-chart-backdrop {
  align-items: flex-start;
  padding: 68px 20px 40px;
  overflow-y: auto;
}
.cn-modal.mw-chart-modal { width: 55vw; }
.mw-chart-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mw-chart-btn {
  padding: 4px 14px; border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #5f6b7a; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.mw-chart-btn:hover { border-color: #4c6ef5; color: #4c6ef5; }
.mw-chart-btn.active { background: #4c6ef5; border-color: #4c6ef5; color: #ffffff; }
.mw-chart-tip { margin-left: auto; color: #8a99ae; font-size: 12px; }

@media (max-width: 1280px) {
  .mw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 窄屏下两个模块改为纵向堆叠，避免表格被压得过挤 */
  .mw-big-card,
  .mw-big-card.mw-big-card-asym { grid-template-columns: 1fr; }
  /* 堆叠后分割线由竖线转为横线 */
  .mw-big-card-asym > .mw-table-block:first-child { padding-right: 0; padding-bottom: 14px; }
  .mw-big-card-asym > .mw-table-block + .mw-table-block {
    padding-left: 0; padding-top: 14px;
    border-left: none; border-top: 1px solid #d9e1eb;
  }
  .cn-modal.mw-chart-modal { width: 72vw; }
}
@media (max-width: 760px) {
  .mw-grid, .mw-regime { grid-template-columns: 1fr; }
  .cn-modal.mw-chart-modal { width: 92vw; }
}

/* ---------------- 顶栏用户区（头像 + 下拉） ---------------- */
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px 3px 3px;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  cursor: pointer;
}
.user-trigger:hover { background: #f2f6fc; border-color: #e2e9f3; }
.user-avatar {
  width: 26px; height: 26px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: #e8eefc; color: #3d6df2;
  font-size: 12px; font-weight: 700; user-select: none;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.user-caret {
  width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #98a2b3;
}
.user-menu .user-name {
  color: #475467; font-size: 13px;
  max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 900;
  min-width: 220px; padding: 8px;
  background: #ffffff; border: 1px solid #d9e1eb; border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}
.user-dropdown[hidden] { display: none; }
.user-dropdown-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 10px; margin-bottom: 6px;
  border-bottom: 1px solid #eef2f7;
}
.user-dropdown-meta { min-width: 0; }
.user-dropdown-name { color: #1f2937; font-size: 13px; font-weight: 600; }
.user-dropdown-role {
  margin-top: 2px; color: #8a99ae; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-item {
  display: flex; align-items: center; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; color: #475467; font-size: 12px; text-align: left;
  cursor: pointer;
}
.user-dropdown-item:hover { background: #f2f6fc; color: #1f2937; }
.user-dropdown-item.danger { color: #b42318; }
.user-dropdown-item.danger:hover { background: rgba(220, 38, 38, 0.08); }

/* 修改密码弹窗 */
.cn-modal-backdrop.user-pwd-backdrop { align-items: flex-start; padding: 90px 20px 40px; }
/* 二次验证弹窗：写权限过期后由 app.js 动态创建，与改密弹窗同宽 */
.cn-modal.ap-elevate-modal { width: 380px; }
.cn-modal.user-pwd-modal { width: 380px; }

/* 错误提示 toast（与 .ap-toast-success 成对） */
.ap-toast-error {
  color: #991b1b;
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
}

/* ---------------- 人员管理 ---------------- */
.um-wrap { width: 100%; max-width: 1400px; }
.um-card { padding: 14px 16px 16px; }
.um-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.um-toolbar-left { display: flex; align-items: baseline; gap: 10px; }
.um-title { color: #2f3948; font-size: 14px; font-weight: 700; }
.um-sub { color: #8a99ae; font-size: 12px; }
.um-toolbar-right { display: flex; align-items: center; gap: 8px; }
.um-search {
  width: 200px; height: 28px; padding: 0 10px;
  border: 1px solid #d9e1eb; border-radius: 4px;
  background: #f8fafc; color: #1f2937; font-size: 12px;
}
.um-search:focus { outline: none; border-color: #3d6df2; background: #ffffff; }

.um-table { width: 100%; border-collapse: collapse; }
.um-table th {
  padding: 9px 12px; text-align: left; white-space: nowrap;
  background: #f8fafc; color: #667085; font-size: 12px; font-weight: 600;
  border-bottom: 1px solid #e6ebf2;
}
.um-table td {
  padding: 10px 12px; color: #2f3948; font-size: 12px;
  border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
.um-table tbody tr:hover { background: #f8fafc; }
.um-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: #5f6b7a;
}
.um-empty { padding: 26px 0; text-align: center; color: #98a2b3; font-size: 12px; }

.um-user { display: flex; align-items: center; gap: 10px; }
.um-user .user-avatar { width: 30px; height: 30px; font-size: 13px; }
.um-user-meta { min-width: 0; }
.um-user-name {
  display: flex; align-items: center; gap: 6px;
  color: #1f2937; font-size: 13px; font-weight: 600;
}
.um-user-id {
  margin-top: 2px; color: #8a99ae; font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.um-tag {
  display: inline-flex; align-items: center; padding: 1px 6px;
  border-radius: 999px; font-size: 10px; font-weight: 600;
}
.um-tag-self { background: #eef4ff; color: #3d6df2; border: 1px solid #cddcff; }
.um-tag-lock {
  margin-left: 6px;
  background: rgba(233, 189, 67, 0.16); color: #8a6b12;
  border: 1px solid rgba(233, 189, 67, 0.42);
}

.um-role {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.um-role-super { background: rgba(233, 189, 67, 0.18); color: #8a6b12; }
.um-role-admin { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.um-role-viewer { background: #f1f5f9; color: #64748b; }

.um-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.um-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.um-status-on { color: #15803d; }
.um-status-off { color: #b42318; }

.um-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.um-op {
  padding: 3px 8px; border: 1px solid #d9e1eb; border-radius: 4px;
  background: #ffffff; color: #475467; font-size: 11px; cursor: pointer;
}
.um-op:hover:not(:disabled) { border-color: #8b5cf6; color: #6d28d9; }
.um-op.danger { color: #b42318; border-color: rgba(220, 38, 38, 0.2); }
.um-op.danger:hover:not(:disabled) { background: rgba(220, 38, 38, 0.06); }
.um-op:disabled { opacity: 0.45; cursor: not-allowed; }

.um-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.um-page-meta { color: #8a99ae; font-size: 12px; }

.cn-modal.um-edit-modal { width: 420px; }
.cn-modal.um-confirm-modal { width: 380px; }
.um-check {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  color: #475467; font-size: 12px; cursor: pointer;
}
.um-check input { width: 14px; height: 14px; }
.um-confirm-msg { color: #475467; font-size: 13px; line-height: 1.7; }

@media (max-width: 900px) {
  .um-toolbar { align-items: flex-start; flex-direction: column; }
  .cn-modal.um-edit-modal, .cn-modal.um-confirm-modal, .cn-modal.user-pwd-modal { width: 92vw; }
}
