:root {
  --bg: #0a0d12;
  --panel: #111722;
  --panel-2: #0d121c;
  --border: #232b38;
  --border-soft: #1a2130;
  --text: #e8edf5;
  --muted: #8b97a8;
  --accent: #ff7043;
  --accent-blue: #4ea1ff;
  --ok: #5cff8d;
  --ok-bg: rgba(92, 255, 141, 0.1);
  --warn: #ffb703;
  --warn-bg: rgba(255, 183, 3, 0.1);
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.1);
  --info: #8ec8ff;
  --info-bg: rgba(142, 200, 255, 0.1);
  --match-hdr: #ff7043;
  /* Glassmorphism / 科技风新增变量 */
  --gradient-primary: linear-gradient(135deg, #4ea1ff 0%, #7b61ff 55%, #4ea1ff 100%);
  --gradient-accent: linear-gradient(135deg, #ff7043 0%, #ff3b5c 100%);
  --gradient-success: linear-gradient(135deg, #00e676 0%, #5cff8d 100%);
  --glow-blue: 0 0 18px rgba(78, 161, 255, 0.38), 0 0 46px rgba(78, 161, 255, 0.14);
  --glow-orange: 0 0 18px rgba(255, 112, 67, 0.4), 0 0 46px rgba(255, 112, 67, 0.16);
  --glow-green: 0 0 18px rgba(92, 255, 141, 0.4), 0 0 46px rgba(92, 255, 141, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: "Microsoft YaHei UI", "Segoe UI", Arial, sans-serif;
  /* 多层叠加背景：底层渐变 + 光晕 + 右下橙微光 + 顶层网格纹理 */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(78, 161, 255, 0.03) 0px,
      rgba(78, 161, 255, 0.03) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(78, 161, 255, 0.03) 0px,
      rgba(78, 161, 255, 0.03) 1px,
      transparent 1px,
      transparent 40px
    ),
    radial-gradient(circle at 10% 0%, rgba(78, 161, 255, 0.12) 0%, rgba(78, 161, 255, 0) 52%),
    radial-gradient(circle at 92% 92%, rgba(255, 112, 67, 0.06) 0%, rgba(255, 112, 67, 0) 46%),
    linear-gradient(180deg, #0a0d12 0%, #0d1118 50%, #0a0d12 100%);
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.top {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  background: transparent;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 24px rgba(78, 161, 255, 0.18);
}

.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.brand-title {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.brand-line-sep { color: #5f6d82; font-weight: 500; margin: 0 6px; }
.brand-line-en,
.en {
  font-weight: 700;
  background: linear-gradient(135deg, #8eb8ff 0%, #4ea1ff 40%, #7b61ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.account-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(78, 161, 255, 0.18) 0%, rgba(123, 97, 255, 0.14) 60%, rgba(78, 161, 255, 0.18) 100%);
  border: 1px solid rgba(78, 161, 255, 0.35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 14px 40px rgba(0, 0, 0, 0.22),
    var(--glow-blue);
  font-size: 12px;
  color: #c8d4e8;
}

.account-summary-bar.hidden { display: none !important; }

.account-summary-item strong { color: #f0f4fa; font-weight: 700; }

.account-summary-sep { color: #4a5668; }

.account-summary-item .pnl-pos,
strong.pnl-pos { color: var(--ok); }

.account-summary-item .pnl-neg,
strong.pnl-neg { color: var(--danger); }

#btnEngineToggle.engine-running {
  box-shadow: 0 0 0 1px rgba(255, 112, 67, 0.45), 0 4px 16px rgba(255, 112, 67, 0.2), var(--glow-orange);
  animation: enginePulseOrange 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.top, .panel, .source-card, .module-card, .stat-card, .modal {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes enginePulseOrange {
  0% {
    box-shadow: 0 0 0 1px rgba(255, 112, 67, 0.35), 0 4px 16px rgba(255, 112, 67, 0.18), var(--glow-orange);
    filter: saturate(1.05);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 112, 67, 0.7), 0 12px 34px rgba(255, 112, 67, 0.28), 0 0 0 4px rgba(255, 112, 67, 0.06), var(--glow-orange);
    filter: saturate(1.2);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(255, 112, 67, 0.35), 0 4px 16px rgba(255, 112, 67, 0.18), var(--glow-orange);
    filter: saturate(1.05);
  }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel,
.source-card,
.module-card,
.stat-card,
.data-card {
  animation: cardEnter 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.panel:nth-child(1),
.source-card:nth-child(1),
.module-card:nth-child(1),
.stat-card:nth-child(1) { animation-delay: 0.02s; }
.panel:nth-child(2),
.source-card:nth-child(2),
.module-card:nth-child(2),
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.panel:nth-child(3),
.source-card:nth-child(3),
.module-card:nth-child(3),
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4),
.source-card:nth-child(4),
.module-card:nth-child(4),
.stat-card:nth-child(4) { animation-delay: 0.14s; }
.panel:nth-child(5),
.source-card:nth-child(5),
.module-card:nth-child(5),
.stat-card:nth-child(5) { animation-delay: 0.18s; }
.panel:nth-child(n+6),
.source-card:nth-child(n+6),
.module-card:nth-child(n+6),
.stat-card:nth-child(n+6) { animation-delay: 0.22s; }

.runtime-log-panel { margin-bottom: 0; }

.runtime-log-body {
  max-height: 62vh;
  overflow: auto;
  background: rgba(8, 12, 20, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.runtime-log-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(35, 43, 56, 0.55);
}

.runtime-log-line:last-child { border-bottom: none; }

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #b3bdcc;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5f6d82;
  animation: pillPulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.pill.ok {
  border-color: rgba(92, 255, 141, 0.45);
  background: rgba(92, 255, 141, 0.08);
  color: var(--ok);
  box-shadow: var(--glow-green);
}
.pill.ok::before { background: #5cff8d; }
.pill.warn {
  border-color: rgba(255, 183, 3, 0.45);
  background: rgba(255, 183, 3, 0.08);
  color: var(--warn);
  box-shadow: 0 0 18px rgba(255, 183, 3, 0.22), 0 0 46px rgba(255, 183, 3, 0.08);
}
.pill.warn::before { background: #ffb703; }
.pill.danger {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.08);
  color: var(--danger);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.24), 0 0 46px rgba(255, 107, 107, 0.08);
}
.pill.danger::before { background: #ff6b6b; }
.pill.active {
  border-color: rgba(255, 112, 67, 0.55);
  background: rgba(255, 112, 67, 0.12);
  color: #ffb38a;
  box-shadow: var(--glow-orange);
}
.pill.active::before { background: var(--accent); }

@keyframes pillPulse {
  0% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0.35; transform: scale(1); }
}

.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}

.tab {
  padding: 10px 16px;
  cursor: pointer;
  color: #b3bdcc;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transition: color 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  color: #d6deeb;
  background: rgba(78, 161, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(78, 161, 255, 0.12);
}

.tab:active {
  transform: scale(0.97);
  background: rgba(78, 161, 255, 0.12);
}

.tab.active {
  color: #fff;
  background: rgba(17, 23, 34, 0.72);
  border-top-color: transparent;
  border-bottom-color: var(--accent);
  text-shadow: 0 0 14px rgba(255, 112, 67, 0.28);
  box-shadow: inset 0 -2px 0 rgba(255, 112, 67, 0.55), 0 0 22px rgba(255, 112, 67, 0.14);
}

.content { padding: 14px 18px; flex: 1; }

.panel {
  position: relative;
  overflow: hidden;
  background: rgba(17, 23, 34, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.panel:not(.hidden) {
  animation: panelFadeIn 140ms ease-out;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  pointer-events: none;
  opacity: 0.9;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.section-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #f0f4fa;
  letter-spacing: 0.02em;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  align-items: center;
}

input, textarea, button, select {
  background: rgba(13, 17, 24, 0.62);
  color: var(--text);
  border: 1px solid rgba(50, 59, 74, 0.72);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

input, textarea, select { flex: 1; min-width: 120px; }
textarea { min-height: 72px; }
button {
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), filter 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

button:active:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(1px) scale(0.97);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.primary {
  background: var(--gradient-primary);
  border-color: rgba(78, 161, 255, 0.65);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(78, 161, 255, 0.2) inset, var(--glow-blue);
}
button.primary:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(78, 161, 255, 0.35) inset, 0 14px 40px rgba(78, 161, 255, 0.22), var(--glow-blue);
}
button.accent {
  background: var(--gradient-accent);
  border-color: rgba(255, 112, 67, 0.7);
  color: #ffffff;
  box-shadow: var(--glow-orange);
}
button.accent:hover:not(:disabled) {
  box-shadow: 0 14px 40px rgba(255, 112, 67, 0.24), var(--glow-orange);
}
button.danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #d63b3b 100%);
  border-color: rgba(255, 107, 107, 0.7);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.26), 0 0 46px rgba(255, 107, 107, 0.08);
}
button.danger:hover:not(:disabled) {
  box-shadow: 0 14px 40px rgba(255, 107, 107, 0.28), 0 0 24px rgba(255, 107, 107, 0.2);
}

.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.hidden { display: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #9fb0c8;
  font-weight: 600;
  font-size: 12px;
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

tbody tr {
  transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody tr:hover td {
  background: rgba(78, 161, 255, 0.06);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(42, 51, 66, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #d6deeb;
  border: 1px solid rgba(70, 90, 120, 0.28);
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(92, 255, 141, 0.35);
  box-shadow: 0 0 12px rgba(92, 255, 141, 0.18), 0 0 28px rgba(92, 255, 141, 0.06);
}
.badge.off {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.35);
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.16), 0 0 28px rgba(255, 107, 107, 0.06);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(255, 183, 3, 0.35);
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.16), 0 0 28px rgba(255, 183, 3, 0.06);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid var(--border-soft);
}

.statebar { color: #d7deea; font-size: 13px; line-height: 1.5; }

.signal-hint-active {
  color: var(--info) !important;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--info-bg);
  border: 1px solid rgba(142, 200, 255, 0.2);
}

/* ── 信号雷达表格（对齐桌面端配色） ── */
.signal-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 23, 34, 0.52);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 44px rgba(0, 0, 0, 0.18);
  min-height: 220px;
}

.signal-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

.signal-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(21, 28, 40, 0.58);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #9fb0c8;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  white-space: nowrap;
  text-align: left;
  vertical-align: middle;
}

.signal-table thead th.col-match,
.signal-table thead th.col-exec,
.signal-table thead th.col-source {
  color: var(--match-hdr);
}

.signal-table col.col-match { width: 88px; }
.signal-table col.col-exec { width: 200px; }
.signal-table col.col-source { width: 72px; }
.signal-table col.col-time { width: 136px; }
/* col-content 不设宽度，在 table-layout:fixed 下自动占满剩余空间 */

.signal-table tbody tr.signal-row {
  transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.signal-table tbody tr.signal-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.008);
}

.signal-table tbody tr.signal-row:hover {
  background: rgba(142, 200, 255, 0.06);
}

.signal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden;
}

.signal-table td.cell-match,
.signal-table td.cell-exec,
.signal-table td.cell-source,
.signal-table td.cell-time {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-table td.cell-exec .signal-chip,
.signal-table td.cell-match .signal-chip,
.signal-table td.cell-source .signal-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.signal-table td.cell-time .signal-time {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.signal-table td.cell-content {
  overflow: hidden;
}

.signal-table td.cell-content .signal-content {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 当前持仓桌面表格视觉增强 */
#tab-position .module-table tbody td.pos-symbol {
  font-weight: 700;
  color: #e9f1ff;
}

#tab-position .module-table .pos-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

#tab-position .module-table .pos-side.long {
  color: #59d48b;
  background: rgba(89, 212, 139, 0.12);
  border-color: rgba(89, 212, 139, 0.35);
}

#tab-position .module-table .pos-side.short {
  color: #ff8f7a;
  background: rgba(255, 143, 122, 0.14);
  border-color: rgba(255, 143, 122, 0.38);
}

#tab-position .module-table .pos-side.neutral {
  color: #b8c4d8;
  background: rgba(184, 196, 216, 0.08);
  border-color: rgba(184, 196, 216, 0.2);
}

#tab-position .module-table td.pos-pnl.pos,
#tab-position .module-table td.pos-rate.pos {
  color: #4be08a;
  font-weight: 700;
}

#tab-position .module-table td.pos-pnl.neg,
#tab-position .module-table td.pos-rate.neg {
  color: #ff7d73;
  font-weight: 700;
}

#tab-position .module-table td.pos-pnl.flat,
#tab-position .module-table td.pos-rate.flat {
  color: #9fb0c8;
  font-weight: 600;
}

#tab-position .module-table td.pos-liq {
  color: #d6c18f;
  font-weight: 600;
}

#tab-position .module-table .pos-tpsl .tp.warn,
#tab-position .module-table .pos-tpsl .sl.warn {
  color: #ffb86b;
  font-weight: 700;
}

#tab-position .module-table .pos-tpsl .tp.ok,
#tab-position .module-table .pos-tpsl .sl.ok {
  color: #cfe1ff;
}

#tab-position .module-table .pos-tpsl .sep {
  color: #7f90ab;
}

.signal-table th.col-foldable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.signal-table th.col-foldable:hover { color: #c5d4ec; }

.signal-table th.col-foldable::after {
  content: " ◂";
  font-size: 10px;
  opacity: 0.45;
}

.signal-table.fold-match th.col-match,
.signal-table.fold-match td.cell-match,
.signal-table.fold-exec th.col-exec,
.signal-table.fold-exec td.cell-exec,
.signal-table.fold-source th.col-source,
.signal-table.fold-source td.cell-source,
.signal-table.fold-content th.col-content,
.signal-table.fold-content td.cell-content,
.signal-table.fold-time th.col-time,
.signal-table.fold-time td.cell-time {
  width: 34px !important;
  max-width: 34px !important;
  min-width: 34px !important;
  padding: 6px 2px !important;
  overflow: hidden;
}

.signal-table.fold-match td.cell-match .signal-chip,
.signal-table.fold-exec td.cell-exec .signal-chip,
.signal-table.fold-source td.cell-source .signal-chip,
.signal-table.fold-content td.cell-content .signal-content,
.signal-table.fold-time td.cell-time {
  display: none;
}

/* 折叠同步到卡片视图（手机模式/卡片展示） */
.signal-feed-panel.fold-time .signal-card-time-row { display: none; }
.signal-feed-panel.fold-content .signal-card-content { display: none; }

.signal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
  text-align: left;
}

.signal-chip.match-matched { color: #5cff8d; background: rgba(92, 255, 141, 0.12); border-color: rgba(92, 255, 141, 0.35); }
.signal-chip.match-receiving { color: #8ec8ff; background: rgba(142, 200, 255, 0.12); border-color: rgba(142, 200, 255, 0.35); }
.signal-chip.match-ignored { color: #ffb703; background: rgba(255, 183, 3, 0.12); border-color: rgba(255, 183, 3, 0.35); }
.signal-chip.match-scan { color: #9aa7b4; background: rgba(154, 167, 180, 0.1); border-color: rgba(154, 167, 180, 0.28); }
.signal-chip.match-unparseable { color: #7a7f88; background: rgba(102, 102, 102, 0.12); border-color: rgba(102, 102, 102, 0.28); }
.signal-chip.match-neutral { color: #b3bdcc; background: rgba(179, 189, 204, 0.08); border-color: rgba(179, 189, 204, 0.2); }

.signal-chip.exec-success { color: #5cff8d; background: rgba(92, 255, 141, 0.12); border-color: rgba(92, 255, 141, 0.35); }
.signal-chip.exec-processing,
.signal-chip.exec-pending { color: #8ec8ff; background: rgba(142, 200, 255, 0.12); border-color: rgba(142, 200, 255, 0.35); }
.signal-chip.exec-skipped,
.signal-chip.exec-void { color: #ffb703; background: rgba(255, 183, 3, 0.12); border-color: rgba(255, 183, 3, 0.35); }
.signal-chip.exec-failed { color: #ff6b6b; background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.35); }
.signal-chip.exec-idle { color: #9aa7b4; background: rgba(154, 167, 180, 0.08); border-color: rgba(154, 167, 180, 0.22); }
.signal-chip.exec-neutral { color: #c8d4e8; background: rgba(200, 212, 232, 0.08); border-color: rgba(200, 212, 232, 0.18); }

.signal-chip.source-aq { color: #ffb38a; background: rgba(255, 112, 67, 0.14); border-color: rgba(255, 112, 67, 0.42); }
.signal-chip.source-tv { color: #8ec8ff; background: rgba(78, 161, 255, 0.14); border-color: rgba(78, 161, 255, 0.38); }
.signal-chip.source-other { color: #b3bdcc; background: rgba(179, 189, 204, 0.08); border-color: rgba(179, 189, 204, 0.2); }

.signal-time {
  color: #8b97a8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Consolas, "SF Mono", monospace;
}

.signal-content {
  color: #dbe3f0;
  font-family: ui-monospace, Consolas, "SF Mono", "Microsoft YaHei UI", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-empty-row td {
  padding: 28px 14px;
  text-align: left;
  border-bottom: none;
}

.signal-empty {
  color: #8b97a8;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ── 信号来源双卡片 ── */
.signal-source-panel { padding-bottom: 18px; }

.signal-source-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.source-card {
  position: relative;
  overflow: hidden;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 14px;
  padding: 16px;
  min-height: 188px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.source-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  opacity: 0.9;
  pointer-events: none;
}

.source-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.source-card.active {
  border-color: rgba(255, 112, 67, 0.55);
  box-shadow: var(--glow-orange), 0 20px 56px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.source-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.source-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.source-card-icon.aq {
  color: #ffb38a;
  background: rgba(255, 112, 67, 0.16);
  border: 1px solid rgba(255, 112, 67, 0.35);
}

.source-card-icon.tv {
  color: #8ec8ff;
  background: rgba(78, 161, 255, 0.14);
  border: 1px solid rgba(78, 161, 255, 0.35);
}

.source-card-meta { flex: 1; min-width: 0; }

.source-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #f2f6fc;
  margin-bottom: 4px;
}

.source-card-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.source-card-desc {
  margin: 0;
  font-size: 12px;
  color: #aeb9ca;
  line-height: 1.6;
}

.source-card-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.source-card-status.off {
  color: var(--muted);
  background: rgba(139, 151, 168, 0.08);
  border: 1px solid rgba(139, 151, 168, 0.15);
}

.source-card-status.receive {
  color: #8ec8ff;
  background: rgba(78, 161, 255, 0.1);
  border: 1px solid rgba(78, 161, 255, 0.28);
}

.source-card-status.trade {
  color: #5cff8d;
  background: rgba(92, 255, 141, 0.1);
  border: 1px solid rgba(92, 255, 141, 0.28);
}

.source-toggle {
  flex: 0 0 auto;
  min-width: 76px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #3a4558;
  background: #151c29;
  color: #9aa7b4;
  font-size: 12px;
  font-weight: 600;
}

.source-toggle.on {
  border-color: rgba(92, 255, 141, 0.45);
  background: rgba(92, 255, 141, 0.12);
  color: #5cff8d;
}

.source-toggle.source-toggle-loading {
  border-color: #3a4558;
  background: #151c29;
  color: #8b97a8;
  cursor: wait;
  opacity: 0.85;
}

.signal-sources-pending .source-card {
  opacity: 0.92;
}

.webhook-box {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(142, 200, 255, 0.18);
}

.webhook-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #9fb0c8;
}

.webhook-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.webhook-copy-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.source-save-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.signal-feed-panel { margin-top: 0; }

.signal-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.signal-feed-meta {
  font-size: 12px;
  color: var(--muted);
}

.signal-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.signal-page-info {
  font-size: 12px;
  color: #9fb0c8;
  min-width: 160px;
  text-align: center;
}

@media (max-width: 900px) {
  .source-card-grid { grid-template-columns: 1fr; }
}

.alertbar {
  margin: 10px 18px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #4a2b2b;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  display: none;
  line-height: 1.5;
}

.alertbar.warn { border-color: #5a4a1f; background: var(--warn-bg); color: var(--warn); }
.alertbar.ok { border-color: #1f4a2f; background: var(--ok-bg); color: var(--ok); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.field-label { min-width: 88px; color: #b3bdcc; font-size: 12px; }
.rule-editor { border: 1px dashed #3a4558; border-radius: 8px; padding: 12px; margin-top: 8px; }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-list label { font-size: 12px; color: #b3bdcc; }
details summary { cursor: pointer; color: #9fb0c8; margin-bottom: 8px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.stat-card {
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  opacity: 0.9;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-card .label { font-weight: 700; margin-bottom: 6px; color: #d6deeb; }

.site-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(70, 90, 120, 0.3);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(10, 13, 18, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.exchange-card {
  background: rgba(17, 23, 34, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), filter 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.exchange-card:hover:not(.disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.exchange-card:active:not(.disabled) {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.95);
}

.exchange-card.active {
  border-color: rgba(255, 112, 67, 0.55);
  box-shadow: var(--glow-orange), 0 16px 44px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.exchange-card.disabled { opacity: 0.72; }

.exchange-name { font-weight: 700; margin-bottom: 8px; }

.exchange-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #2a3342;
  color: #b3bdcc;
}

.exchange-tag.ok { background: var(--ok-bg); color: var(--ok); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-backdrop.show { display: flex; }

.modal {
  width: min(420px, 100%);
  background: rgba(17, 23, 34, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  animation: modalIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  pointer-events: none;
  opacity: 0.9;
}

.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 14px; color: #b3bdcc; font-size: 13px; line-height: 1.6; }
.modal-wide { width: min(560px, 100%); max-height: min(82vh, 720px); overflow: auto; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }

.btn-link-inline {
  display: inline;
  padding: 0;
  margin: 0 0 0 6px;
  border: none;
  background: none;
  color: #8ec8ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link-inline:hover { color: #b8dcff; }

.tv-help-body { font-size: 13px; color: #b3bdcc; line-height: 1.65; }
.tv-help-body ol { margin: 0 0 12px; padding-left: 20px; }
.tv-help-body li { margin-bottom: 6px; }
.tv-help-body p { margin: 0 0 10px; }
.tv-help-code {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0d1118;
  border: 1px solid var(--border);
  color: #9cffba;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

button.btn-ghost {
  background: transparent;
  border-color: #3a4558;
  color: #b3bdcc;
}

.api-field-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.api-field-label {
  font-size: 12px;
  color: #9fb0c8;
  margin-bottom: 6px;
  font-weight: 600;
}

.secret-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.secret-input-wrap input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
}

.btn-mini {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 12px;
  background: rgba(21, 28, 41, 0.7);
  border-color: rgba(58, 69, 88, 0.8);
  color: #c8d4e8;
  white-space: nowrap;
}
  padding: 8px 10px;
  min-width: 40px;
}

.member-status-panel { margin-top: 12px; background: rgba(8, 12, 22, 0.55); }

.vip-card {
  background: linear-gradient(135deg, rgba(20, 28, 42, 0.95) 0%, rgba(12, 18, 30, 0.98) 100%);
  border: 1px solid rgba(255, 183, 3, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.vip-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.vip-badge {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  min-width: 72px;
}

.vip-badge.inactive {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid rgba(255, 183, 3, 0.35);
}

.vip-badge.active {
  color: var(--ok);
  background: linear-gradient(135deg, rgba(92, 255, 141, 0.18) 0%, rgba(40, 120, 80, 0.12) 100%);
  border: 1px solid rgba(92, 255, 141, 0.4);
  box-shadow: 0 0 20px rgba(92, 255, 141, 0.12);
}

.vip-meta { flex: 1; min-width: 0; }

.vip-account {
  font-size: 15px;
  font-weight: 600;
  color: #f0f4fa;
  margin-bottom: 4px;
}

.vip-status-line { margin: 0; }

.vip-expires { margin-top: 4px; color: #9fb0c8; }

.vip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vip-actions-secondary { margin-bottom: 6px; }

.vip-footnote { margin: 0; font-size: 11px; }

.gate-action-row { margin-top: 4px; }

.btn-gate-login { min-width: 96px; }

.status-hint {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.status-hint.status-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: rgba(92, 255, 141, 0.28);
}

.status-hint.status-error {
  color: #ffb4b4;
  background: var(--danger-bg);
  border-color: rgba(255, 107, 107, 0.28);
}

.status-hint.status-pending {
  color: var(--info);
  background: var(--info-bg);
  border-color: rgba(142, 200, 255, 0.28);
}

.announcement-body { line-height: 1.8; white-space: pre-wrap; }

.feedback-panel input,
.feedback-panel textarea { width: 100%; margin-bottom: 8px; }

.secret-input-wrap input:-webkit-autofill,
.secret-input-wrap input:-webkit-autofill:hover,
.secret-input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px #0d1118 inset !important;
  transition: background-color 99999s ease-out;
}

@media (max-width: 720px) {
  .brand-title { font-size: 15px; }
  .top-right { width: 100%; justify-content: space-between; }
  .top-actions:not(.top-actions-minimal) { width: 100%; }
  .top-actions:not(.top-actions-minimal) button { flex: 1; }
  .module-card-grid { grid-template-columns: 1fr; }
  .position-stat-grid { grid-template-columns: 1fr; }
}

/* ── 模块化卡片（策略 / 仓位） ── */
.hidden { display: none !important; }

.module-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.module-card {
  position: relative;
  overflow: hidden;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.module-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  opacity: 0.9;
  pointer-events: none;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.module-card-wide { grid-column: 1 / -1; }

.module-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.module-card-head .source-toggle { margin-left: auto; }

.module-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
  color: #c8d4e8;
  background: rgba(78, 161, 255, 0.12);
  border: 1px solid rgba(78, 161, 255, 0.28);
}

.module-card-icon.strategy { color: #ffb38a; background: rgba(255, 112, 67, 0.14); border-color: rgba(255, 112, 67, 0.32); }
.module-card-icon.rules { color: #9cffba; background: var(--ok-bg); border-color: rgba(92, 255, 141, 0.32); }
.module-card-icon.aq { color: #ffb38a; background: rgba(255, 112, 67, 0.14); border-color: rgba(255, 112, 67, 0.32); }
.module-card-icon.tv { color: #8ec8ff; background: rgba(78, 161, 255, 0.14); border-color: rgba(78, 161, 255, 0.32); }
.module-card-icon.filter { color: #ffd166; background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.3); }
.module-card-icon.global { color: #b8a4ff; background: rgba(184, 164, 255, 0.12); border-color: rgba(184, 164, 255, 0.3); }
.module-card-icon.runtime { color: #9cffba; background: var(--ok-bg); border-color: rgba(92, 255, 141, 0.32); }
.module-card-icon.pending { color: #8ec8ff; background: rgba(78, 161, 255, 0.14); border-color: rgba(78, 161, 255, 0.32); }
.module-card-icon.position { color: #ffb38a; background: rgba(255, 112, 67, 0.14); border-color: rgba(255, 112, 67, 0.32); }

.module-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #f2f6fc;
  margin-bottom: 3px;
}

.module-card-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.module-card-body { gap: 10px; }

.module-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.module-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  background: #0d1118;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.module-table-wrap { margin-top: 4px; }

.module-fields-off { opacity: 0.55; pointer-events: none; }

.module-save-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.position-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.position-stat-card {
  flex-direction: row;
  align-items: flex-start;
  min-height: 0;
  overflow: visible;
}

.module-card.position-stat-card {
  overflow: visible;
}

.position-stat-body {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.position-stat-value {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #8eb8ff 0%, #4ea1ff 45%, #6eb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 14px rgba(78, 161, 255, 0.28));
  margin: 6px 0 4px;
  line-height: 1.3;
  white-space: nowrap;
  word-break: keep-all;
  overflow: visible;
}

.rule-editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

/* ── Phase 3: 响应式 / 底栏 / 卡片 / 策略 Step ── */
.data-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.data-card {
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.data-card.empty-card {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.data-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f2f6fc;
  margin-bottom: 8px;
  line-height: 1.35;
}

.data-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #c8d4e8;
  margin-bottom: 5px;
}

.data-card-row span:first-child { color: var(--muted); flex: 0 0 auto; }
.data-card-row span:last-child { text-align: right; word-break: break-all; }

.data-card-content {
  margin-top: 8px;
  font-size: 12px;
  color: #b8c4d8;
  line-height: 1.5;
  word-break: break-word;
}

.data-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.signal-data-card .data-card-title { font-size: 13px; }

.btn-mobile-preview.active {
  color: #ffb38a;
  border-color: rgba(255, 112, 67, 0.45);
  background: rgba(255, 112, 67, 0.12);
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 13, 18, 0.82);
  border-top: 1px solid rgba(70, 90, 120, 0.38);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  gap: 0;
  justify-content: space-between;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: manipulation;
}

.bottom-nav::-webkit-scrollbar { display: none; }

.bottom-nav-item {
  flex: 1 0 52px;
  min-width: 52px;
  max-width: 72px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-family: inherit;
  padding: 6px 2px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.12s ease, filter 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  will-change: transform;
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.82;
}

.bottom-nav-icon svg {
  width: 20px;
  height: 20px;
}

.bottom-nav-label {
  line-height: 1.1;
  white-space: nowrap;
}

.bottom-nav-item:hover { color: #d6deeb; background: rgba(255, 255, 255, 0.04); }

.bottom-nav-item.active {
  color: #ffb38a;
  background: rgba(255, 112, 67, 0.1);
  font-weight: 700;
}

.bottom-nav-item.active .bottom-nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 112, 67, 0.35));
}

.bottom-nav-item:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .panel:not(.hidden) { animation: none; }
  .bottom-nav-item { transition: none; }
}

.strategy-step { margin-bottom: 16px; }

.strategy-step-title {
  font-size: 13px;
  font-weight: 700;
  color: #d6deeb;
  margin-bottom: 10px;
}

.strategy-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.strategy-mode-card {
  text-align: left;
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 14px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.strategy-mode-card:hover {
  border-color: rgba(78, 161, 255, 0.45);
  background: rgba(21, 28, 41, 0.72);
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.strategy-mode-card.active {
  border-color: rgba(255, 112, 67, 0.55);
  box-shadow: var(--glow-orange), 0 14px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: rgba(255, 112, 67, 0.1);
}

.strategy-mode-name {
  font-size: 14px;
  font-weight: 700;
  color: #f2f6fc;
  margin-bottom: 6px;
}

.strategy-mode-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.strategy-step-collapsible {
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(15, 20, 31, 0.5);
}

.strategy-step-collapsible summary {
  cursor: pointer;
  font-weight: 700;
  color: #d6deeb;
  user-select: none;
}

.strategy-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-top: 16px;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(10, 13, 18, 0) 0%, rgba(10, 13, 18, 0.92) 28%, var(--bg) 100%);
  border-top: 1px solid var(--border-soft);
}

.strategy-save-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.strategy-advanced-json { margin-top: 12px; }

.strategy-page { padding-bottom: 8px; }

/* 真手机：顶部导航随页面滚动，整块 chrome 吸顶，避免 fixed 遮挡内容 */
@media (max-width: 768px) {
  .app-mobile-chrome {
    position: sticky;
    top: 0;
    z-index: 120;
    background: rgba(10, 13, 18, 0.97);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .top {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    flex-wrap: nowrap;
    border-bottom: none;
    box-shadow: none;
    justify-content: unset;
  }

  .top .brand-lockup {
    grid-column: 1;
    grid-row: 1;
    flex: unset;
    min-width: 0;
    max-width: none;
    gap: 8px;
    align-items: center;
  }

  .top .brand-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .app-mobile-chrome .top-actions {
    grid-column: 2;
    grid-row: 1;
    flex: unset;
    width: auto;
    margin-left: 0;
    justify-self: end;
    align-self: center;
  }

  .brand-title,
  .brand-title-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    font-size: inherit;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }

  .brand-line-cn {
    font-size: 11px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-line-sep { display: none !important; }

  .brand-line-en {
    font-size: 10px;
    line-height: 1.15;
  }

  .module-card.position-stat-card.position-stat-compact {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 10px 6px;
    gap: 6px;
    overflow: visible;
  }

  .position-stat-card .module-card-icon {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .position-stat-body {
    width: 100%;
    min-width: 0;
    overflow: visible;
    text-align: center;
  }

  .position-stat-value,
  .position-stat-compact .position-stat-value {
    font-size: 13px;
    margin: 2px 0;
    line-height: 1.2;
    white-space: normal;
    word-break: keep-all;
    overflow: visible;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #6eb8ff;
    -webkit-text-fill-color: currentColor;
    filter: none;
    text-shadow: 0 0 10px rgba(78, 161, 255, 0.2);
    font-weight: 700;
  }

  .position-stat-compact .module-card-title {
    font-size: 9px;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.2;
    margin-bottom: 2px;
    overflow: visible;
    text-overflow: clip;
  }

  .pec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 10px;
  }

  .pec-cell strong {
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .app-mobile-chrome .top-actions button {
    flex: none;
  }

  .position-stat-grid {
    gap: 8px;
  }

  .btn-top-logout {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .btn-top-logout {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 手机端：顶部标签隐藏，改由底部导航切换 */
  .app-mobile-chrome .tabs {
    display: none !important;
  }

  .bottom-nav {
    display: flex;
  }

  /* 落地页/登录注册页 header：sticky 代替 fixed，避免盖住首屏文案 */
  .landing-header,
  .landing-header.auth-page-header {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 120;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    background: rgba(10, 14, 22, 0.92);
  }

  .tabs {
    display: flex;
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 6px;
    border-bottom: none;
    background: transparent;
  }

  .global-status-bar {
    border-bottom: none;
  }

  .alertbar {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .bottom-nav {
    display: flex;
  }

  .content {
    padding: 12px;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer {
    margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .desktop-table-wrap,
  .signal-feed-panel .signal-table-wrap { display: none !important; }
  .data-card-list { display: flex; }
  .strategy-mode-grid { grid-template-columns: 1fr; }
  .account-summary-bar {
    width: 100%;
    font-size: 11px;
  }
  .top-actions .btn-mobile-preview { display: none; }
}

/* 登录/注册页：header 已改 sticky，不再需要额外顶部占位 */
@media (max-width: 768px) {
  body.landing-body.auth-page .viewport-shell {
    padding-top: 0;
  }
}

html.mobile-preview .content,
body.mobile-preview .content {
  max-width: 420px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .top { padding: 8px 10px; }
  .brand-title { font-size: 12px; }
  .status-pills { width: 100%; }
}

/* 真手机/触屏设备：隐藏“手机模式”预览按钮（本来就是手机） */
@media (hover: none) and (pointer: coarse) {
  [data-mobile-preview-btn] { display: none !important; }
}

/* ── UX Batch 20260708i ── */
.top-actions-minimal { margin-left: auto; }

/* 落地页 header 品牌名在窄屏允许换行，避免只剩图标 */
@media (max-width: 768px) {
  .landing-header .brand-lockup {
    flex: 1 1 auto;
    min-width: 0;
  }

  .landing-header .brand-title {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
}

.global-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  background: rgba(17, 23, 34, 0.65);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  min-height: 52px;
}

.global-status-bar.status-bar-locked {
  visibility: visible !important;
  opacity: 1 !important;
}

.global-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.global-status-bar .account-summary-bar {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.global-status-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

#btnEngineToggle.engine-paused {
  box-shadow: 0 0 0 1px rgba(255, 183, 3, 0.35);
  color: #ffd166;
}

.section-head-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.section-head-static { cursor: default; margin-bottom: 10px; }

.collapsible-head .collapse-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.collapsible-head.collapsed .collapse-chevron { transform: rotate(-90deg); }

.section-title-inline {
  font-size: 15px;
  font-weight: 700;
  color: #f2f6fc;
  border-left: 3px solid var(--match-hdr);
  padding-left: 10px;
  line-height: 1.3;
}

.section-hint-inline {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
  min-width: 180px;
}

.form-toast {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.form-toast.toast-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(92, 255, 141, 0.28);
}

.form-toast.toast-error {
  color: #ffb4b4;
  background: var(--danger-bg);
  border: 1px solid rgba(255, 107, 107, 0.28);
}

.form-toast.toast-warn {
  color: #ffd166;
  background: var(--warn-bg);
  border: 1px solid rgba(255, 183, 3, 0.28);
}

.exchange-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.exchange-grid-compact .exchange-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 0;
}

.exchange-grid-strip .exchange-card {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 6px;
  padding: 10px 6px;
  min-height: 92px;
}

.exchange-grid-strip .exchange-card-text {
  min-width: 0;
  width: 100%;
}

.exchange-grid-strip .exchange-name {
  font-size: 11px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.exchange-grid-strip .exchange-tag {
  font-size: 10px;
  padding: 2px 6px;
}

.exchange-grid-strip .exchange-logo-img {
  width: 32px;
  height: 32px;
}

.exchange-card.inactive {
  opacity: 0.42;
  filter: grayscale(0.35);
  border-color: var(--border);
  box-shadow: none;
}

.exchange-card.active {
  opacity: 1;
  filter: none;
}

.exchange-logo-img {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  box-sizing: border-box;
}

.exchange-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.exchange-logo.gate { background: rgba(255, 112, 67, 0.15); color: #ffb38a; border: 1px solid rgba(255, 112, 67, 0.35); }
.exchange-logo.okx { background: rgba(78, 161, 255, 0.12); color: #8ec8ff; border: 1px solid rgba(78, 161, 255, 0.28); }
.exchange-logo.binance { background: rgba(255, 209, 102, 0.12); color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.28); }

.exchange-card-text { min-width: 0; }
.exchange-card-text .exchange-name { font-size: 13px; font-weight: 700; }
.exchange-card-text .exchange-tag { font-size: 11px; margin-top: 2px; }

.gate-panel-wrap { margin-bottom: 12px; }
.gate-panel-body { padding-top: 4px; }

/* 滚动条美化（仅 WebKit/Chromium） */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: rgba(13, 17, 24, 0.35);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(78, 161, 255, 0.22);
  border-radius: 10px;
  border: 2px solid rgba(13, 17, 24, 0.35);
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 161, 255, 0.34);
}

html.mobile-preview,
html.mobile-preview body {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .section-head-row:not(.section-head-static) {
    flex-direction: column;
    align-items: flex-start;
  }
  #signalSourcePanel .section-hint-inline { display: none; }
  .section-hint-inline { min-width: 0; width: 100%; }
  .global-status-bar { flex-direction: column; align-items: stretch; }
  .global-status-actions { margin-left: 0; width: 100%; }
  .global-status-actions button { flex: 1; }
  .source-card-grid { grid-template-columns: 1fr !important; }
  .source-card { min-height: 0; }
  .exchange-grid-compact { grid-template-columns: 1fr; }
  .exchange-grid-strip,
  .exchange-grid-compact.exchange-grid-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .landing-signal-table-wrap { display: none !important; }
  .landing-signal-cards { display: flex !important; }
}

html.mobile-preview .section-head-row:not(.section-head-static) {
  flex-direction: column;
  align-items: flex-start;
}
html.mobile-preview #signalSourcePanel .section-hint-inline { display: none; }
html.mobile-preview .section-hint-inline { min-width: 0; width: 100%; }
html.mobile-preview .global-status-bar { flex-direction: column; align-items: stretch; }
html.mobile-preview .global-status-actions { margin-left: 0; width: 100%; }
html.mobile-preview .global-status-actions button { flex: 1; }
html.mobile-preview .source-card-grid { grid-template-columns: 1fr !important; }
html.mobile-preview .source-card { min-height: 0; }
html.mobile-preview .exchange-grid-compact { grid-template-columns: 1fr; }
html.mobile-preview .exchange-grid-strip,
html.mobile-preview .exchange-grid-compact.exchange-grid-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
html.mobile-preview .landing-signal-table-wrap { display: none !important; }
html.mobile-preview .landing-signal-cards { display: flex !important; }

/* 桌面端手机预览：与真手机一致的 sticky chrome 布局 */
html.mobile-preview .app-mobile-chrome {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(10, 13, 18, 0.97);
  border-bottom: 1px solid var(--border);
}

html.mobile-preview .top {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  justify-content: unset;
}

html.mobile-preview .top .brand-lockup {
  grid-column: 1;
  grid-row: 1;
  flex: unset;
  min-width: 0;
  max-width: none;
  gap: 8px;
}

html.mobile-preview .app-mobile-chrome .top-actions {
  grid-column: 2;
  grid-row: 1;
  flex: unset;
  width: auto;
  margin-left: 0;
  justify-self: end;
}

html.mobile-preview .brand-title,
html.mobile-preview .brand-title-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

html.mobile-preview .brand-line-cn {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.mobile-preview .brand-line-sep { display: none; }

html.mobile-preview .brand-line-en {
  font-size: 10px;
  line-height: 1.15;
}

html.mobile-preview .app-mobile-chrome .top-actions {
  flex: 0 0 auto;
  width: auto;
  margin-left: 6px;
}

html.mobile-preview .app-mobile-chrome .top-actions button {
  flex: none;
}

html.mobile-preview .position-stat-value,
html.mobile-preview .position-stat-compact .position-stat-value {
  font-size: 13px;
  color: #6eb8ff;
  -webkit-text-fill-color: currentColor;
  white-space: normal;
  word-break: keep-all;
  text-shadow: none;
}

html.mobile-preview .module-card.position-stat-card.position-stat-compact {
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: visible;
}

html.mobile-preview .position-stat-card .module-card-icon {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

html.mobile-preview .position-stat-compact .module-card-title {
  white-space: normal;
  word-break: keep-all;
  font-size: 9px;
}

html.mobile-preview .tabs {
  display: flex;
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  background: transparent;
  border-bottom: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}

html.mobile-preview .app-mobile-chrome .tabs {
  display: none !important;
}

html.mobile-preview .bottom-nav {
  display: flex;
}

html.mobile-preview .content {
  padding-top: 12px;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
html.mobile-preview .site-footer {
  margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
html.mobile-preview .desktop-table-wrap,
html.mobile-preview .signal-feed-panel .signal-table-wrap {
  display: none !important;
}
html.mobile-preview .data-card-list { display: flex; }
html.mobile-preview .strategy-mode-grid { grid-template-columns: 1fr; }
html.mobile-preview .account-summary-bar {
  width: 100%;
  font-size: 11px;
}
html.mobile-preview .tab {
  font-weight: 800;
  font-size: 13px;
  color: rgba(230, 238, 255, 0.84);
}
html.mobile-preview .tab.active {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(255, 112, 67, 0.35);
  border-bottom-color: var(--accent);
  box-shadow:
    inset 0 -1px 0 rgba(255, 112, 67, 0.25),
    0 0 22px rgba(255, 112, 67, 0.18);
}

.landing-signal-cards { display: none; }
.landing-signal-pagination { margin-top: 10px; }

/* ── iPhone 15 Pro Max 预览机框 · 20260708j ── */
html.mobile-preview {
  background: #12151c;
  min-height: 100%;
}

html.mobile-preview body {
  background: transparent;
}

.phone-preview-chrome {
  display: none;
  pointer-events: none;
}

html.mobile-preview .phone-preview-chrome {
  display: block;
}

.phone-preview-notch {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(126px, calc(var(--mobile-preview-width, 430px) * 0.29));
  height: 30px;
  background: #0a0e17;
  border-radius: 0 0 16px 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  z-index: 10001;
}

.phone-preview-label {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

html.mobile-preview .viewport-shell {
  width: var(--mobile-preview-width, 430px);
  max-width: calc(100vw - 20px);
  margin: 20px auto 48px;
  min-height: calc(100vh - 68px);
  border-radius: 44px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 28px 90px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden auto;
  position: relative;
  background: var(--bg, #0a0e17);
  -webkit-overflow-scrolling: touch;
}

html.mobile-preview .landing-body .viewport-shell {
  background: #0a0e17;
}

body.mobile-preview .content {
  max-width: none;
  margin: 0;
}

@media (max-width: 900px) {
  .global-status-bar .account-summary-bar {
    font-size: 11px;
    order: 3;
    width: 100%;
  }
}

.signal-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.signal-data-card .data-card-content {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.module-card-head-inline {
  align-items: center;
}

.module-card-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.module-card-sub-inline {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.position-stat-compact {
  padding: 12px 14px;
}

.position-stat-compact .module-card-title {
  font-size: 12px;
  margin-bottom: 4px;
}

.position-stat-compact .position-stat-value {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #8eb8ff 0%, #4ea1ff 45%, #6eb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(78, 161, 255, 0.28));
}

.exchange-logo-img,
.exchange-strip-logo {
  background: #f4f6fb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.exchange-strip-logo {
  padding: 6px;
  box-sizing: border-box;
}

/* ── S级视觉精修：纯视觉覆盖，不改结构/逻辑 ── */

/* 1) 卡片层级区分 */
.signal-table-wrap,
.position-stat-card,
#tab-position .module-card.module-card-wide {
  background: rgba(17, 23, 34, 0.72);
  border-color: rgba(92, 116, 154, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.34),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.toolbar {
  background: rgba(17, 23, 34, 0.44);
  border-color: rgba(56, 68, 89, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.status-hint:not(.status-ok):not(.status-error):not(.status-pending) {
  background: rgba(17, 23, 34, 0.44);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.form-toast:not(.toast-ok):not(.toast-error):not(.toast-warn) {
  background: rgba(17, 23, 34, 0.44);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pill:not(.ok):not(.warn):not(.danger):not(.active) {
  background: rgba(17, 23, 34, 0.44);
  border-color: rgba(70, 90, 120, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pill.ok {
  box-shadow: 0 0 12px rgba(92, 255, 141, 0.16), 0 0 30px rgba(92, 255, 141, 0.06);
}

.pill.warn {
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.14), 0 0 30px rgba(255, 183, 3, 0.05);
}

.pill.danger {
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.16), 0 0 30px rgba(255, 107, 107, 0.05);
}

.pill.active {
  box-shadow: 0 0 14px rgba(255, 112, 67, 0.16), 0 0 32px rgba(255, 112, 67, 0.06);
}

/* 2) 表格行左侧微高光 */
.signal-table tbody tr.signal-row {
  transition:
    background 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.signal-table tbody tr.signal-row td {
  transition:
    background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.signal-table tbody tr.signal-row td:first-child {
  position: relative;
}

.signal-table tbody tr.signal-row td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, rgba(255, 146, 97, 0.96) 0%, rgba(255, 112, 67, 0.92) 100%);
  box-shadow: 0 0 14px rgba(255, 112, 67, 0.26);
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.2;
  pointer-events: none;
}

.signal-table tbody tr.signal-row:hover {
  background: rgba(142, 200, 255, 0.12);
}

.signal-table tbody tr.signal-row:hover td:first-child::before {
  width: 3px;
  opacity: 1;
}

/* 3) 关键数字强化（桌面端） */
@media (min-width: 769px) {
  .position-stat-value,
  .position-stat-compact .position-stat-value {
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #a8ccff 0%, #4ea1ff 42%, #7b61ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 18px rgba(78, 161, 255, 0.28);
    filter: drop-shadow(0 0 20px rgba(78, 161, 255, 0.32));
  }
}

.account-summary-item strong {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.account-summary-item .pnl-pos,
strong.pnl-pos {
  text-shadow: 0 0 12px rgba(92, 255, 141, 0.2);
}

.account-summary-item .pnl-neg,
strong.pnl-neg {
  text-shadow: 0 0 12px rgba(255, 107, 107, 0.2);
}

.signal-table td,
.signal-time,
.data-card-row span:last-child,
.runtime-log-line,
.position-stat-value,
.account-summary-item strong {
  font-variant-numeric: tabular-nums;
}

/* 4) Button ripple */
@keyframes btnRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

button:not(.btn-link-inline) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

button:not(.btn-link-inline)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

button:not(.btn-link-inline):active:not(:disabled)::after {
  animation: btnRipple 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-tab {
  overflow: visible;
}

/* 5) 输入框 focus 发光补全 */
input,
textarea,
select {
  transition:
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(78, 161, 255, 0.6);
  box-shadow:
    0 0 0 3px rgba(78, 161, 255, 0.12),
    0 0 16px rgba(78, 161, 255, 0.15);
}

/* 6) 空状态美化 */
.signal-empty-row td {
  text-align: center;
}

.signal-empty {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 12px 10px;
  color: #9eb0c8;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-align: center;
}

.signal-empty::before {
  content: "";
  width: min(220px, 56%);
  height: 1px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.42) 35%, rgba(255, 112, 67, 0.32) 65%, rgba(255, 112, 67, 0) 100%);
  opacity: 0.9;
}

.data-card.empty-card,
#positionsCards .empty-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 14px 16px;
  color: #9eb0c8;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-align: center;
}

.data-card.empty-card::before,
#positionsCards .empty-card::before {
  content: "";
  width: min(200px, 52%);
  height: 1px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.38) 50%, rgba(78, 161, 255, 0) 100%);
  opacity: 0.85;
}

/* ── A级视觉优化 Phase2 ── */

/* Count-up 数字：稳定宽度 + 性能 hint（JS 失效时仍静态显示） */
.account-summary-item strong,
#pendingCountLabel,
#positionCountLabel {
  font-variant-numeric: tabular-nums;
}

/* 新信号入场：扫光 + 背景淡出（表格行 + 手机卡片） */
@keyframes signalSlideIn {
  0% { transform: translateX(-100%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(200%); opacity: 0; }
}

@keyframes signalBgFade {
  0% { background-color: rgba(92, 255, 141, 0.16); }
  60% { background-color: rgba(92, 255, 141, 0.08); }
  100% { background-color: transparent; }
}

.signal-row.signal-new {
  position: relative;
  animation: signalBgFade 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0s 1 both;
}

.signal-row.signal-new::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(
    90deg,
    rgba(92, 255, 141, 0) 0%,
    rgba(92, 255, 141, 0.22) 35%,
    rgba(92, 255, 141, 0.16) 60%,
    rgba(92, 255, 141, 0) 100%
  );
  filter: blur(0.2px);
  pointer-events: none;
  animation: signalSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0s 1 both;
}

.data-card.signal-data-card.signal-new {
  position: relative;
  overflow: hidden;
  animation: signalBgFade 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0s 1 both;
}

.data-card.signal-data-card.signal-new::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  background: linear-gradient(
    90deg,
    rgba(92, 255, 141, 0) 0%,
    rgba(92, 255, 141, 0.18) 40%,
    rgba(92, 255, 141, 0.12) 65%,
    rgba(92, 255, 141, 0) 100%
  );
  pointer-events: none;
  animation: signalSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0s 1 both;
}

/* Sparkline：超小曲线图 */
.account-summary-bar {
  position: relative;
}

.account-sparkline-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-sparkline {
  width: 120px;
  height: 32px;
  border-radius: 10px;
  background: rgba(13, 17, 24, 0.24);
  border: 1px solid rgba(78, 161, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

@media (max-width: 520px) {
  .account-sparkline-wrap { display: none; }
}

/* ── Phase3 轻量精修：chips / 标题 / 资产条细节提亮 ── */
.signal-chip {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.section-title-inline,
.module-card-title,
.data-card-title {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.03);
}

.account-summary-bar {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 14px 40px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(78, 161, 255, 0.08);
}

/* 注册页：算术验证码（视觉保持与表单一致） */
#captchaRow {
  margin-top: 6px;
}

.captcha-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#captchaQuestionLabel {
  font-size: 13px;
  color: #d6deeb;
}

/* ── 手机端仓位卡片（交易所风格） ── */
.position-exchange-card {
  animation: none;
  border: 1px solid rgba(70, 90, 120, 0.38);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  background: linear-gradient(165deg, rgba(18, 24, 38, 0.96) 0%, rgba(12, 16, 26, 0.98) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.pec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pec-symbol {
  font-size: 17px;
  font-weight: 800;
  color: #f2f6fc;
  letter-spacing: 0.02em;
}

.pec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pec-side,
.pec-lev {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.pec-side.long {
  color: #5cff8d;
  background: rgba(92, 255, 141, 0.12);
  border: 1px solid rgba(92, 255, 141, 0.28);
}

.pec-side.short {
  color: #ff8a8a;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.28);
}

.pec-side.neutral {
  color: #aeb9ca;
  background: rgba(174, 185, 202, 0.08);
  border: 1px solid rgba(174, 185, 202, 0.18);
}

.pec-lev {
  color: #8ec8ff;
  background: rgba(78, 161, 255, 0.1);
  border: 1px solid rgba(78, 161, 255, 0.22);
}

.pec-pnl-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
}

.pec-label {
  font-size: 11px;
  color: #8b97a8;
  margin-bottom: 4px;
}

.pec-pnl,
.pec-rate {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.pec-pnl.pos,
.pec-rate.pos {
  color: #ff6b7a;
  text-shadow: 0 0 16px rgba(255, 107, 122, 0.22);
}

.pec-pnl.neg,
.pec-rate.neg {
  color: #2fd889;
  text-shadow: 0 0 16px rgba(47, 216, 137, 0.18);
}

.pec-pnl.flat,
.pec-rate.flat {
  color: #d6deeb;
}

.pec-roe {
  text-align: right;
}

.pec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}

.pec-cell span {
  display: block;
  font-size: 10px;
  color: #8b97a8;
  margin-bottom: 3px;
}

.pec-cell strong {
  display: block;
  font-size: 12px;
  color: #e8edf5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.pec-liq {
  color: #ffb38a !important;
}

#positionsCards.data-card-list {
  flex-direction: column;
  gap: 0;
}

#positionsCards .empty-card {
  animation: none;
}

#captchaRefreshLink {
  font-size: 12px;
  color: rgba(139, 151, 168, 0.95);
  text-decoration: none;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#captchaRefreshLink:hover {
  color: var(--accent-blue);
}

/* 公告页：公告 / 帮助 / 日志 折叠区块 */
.hub-collapsible {
  margin-bottom: 12px;
  border: 1px solid rgba(70, 90, 120, 0.35);
  border-radius: 12px;
  background: rgba(17, 23, 34, 0.55);
  overflow: hidden;
}

.hub-collapsible-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #eef4ff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.hub-collapsible-summary::-webkit-details-marker {
  display: none;
}

.hub-collapsible-summary::after {
  content: "▼";
  margin-left: auto;
  font-size: 10px;
  color: #8b97a8;
  transition: transform 0.2s ease;
}

.hub-collapsible[open] > .hub-collapsible-summary::after {
  transform: rotate(180deg);
}

.hub-collapsible-body {
  padding: 0 14px 14px;
}

.hub-collapsible-body .hint:first-child {
  margin-top: 0;
}

#btnEngineToggle.engine-gate-off {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.15);
}

/* 账户页：会员状态在上，交易所/API 在下 */
.account-tab-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 220px);
}

.account-section-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-section-primary {
  flex: 0 0 auto;
}

.account-section-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #d6deeb;
  margin-bottom: 8px;
}

.account-onboarding {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(78, 161, 255, 0.28);
  background: rgba(78, 161, 255, 0.08);
}

.account-onboarding-title {
  font-size: 13px;
  font-weight: 700;
  color: #eef4ff;
  margin-bottom: 8px;
}

.account-onboarding-steps {
  margin: 0;
  padding-left: 18px;
  color: #b3bdcc;
  font-size: 12px;
  line-height: 1.65;
}

.account-onboarding-steps li {
  margin-bottom: 4px;
}

.account-badges {
  flex-wrap: wrap;
  gap: 6px;
}

.account-exchange-hint {
  margin: 0 0 8px;
  color: #ffb38a;
}

body.account-tab-active .global-status-bar,
body.account-tab-active #alertBar {
  display: none !important;
}

.safety-patrol-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #b8c8de;
  background: rgba(78, 161, 255, 0.08);
  border: 1px solid rgba(78, 161, 255, 0.18);
  word-break: break-word;
}

.safety-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
  color: #c8d4e8;
}

.safety-inline.ok {
  border-color: rgba(92, 255, 141, 0.35);
  background: rgba(92, 255, 141, 0.08);
  color: #9cffba;
}

.safety-inline.warn {
  border-color: rgba(255, 183, 3, 0.35);
  background: rgba(255, 183, 3, 0.08);
  color: #ffcf6e;
}

#tab-position .module-card-sub-inline {
  color: #8ec8ff;
  font-weight: 700;
}
