/* Self-hosted (privacy + offline PWA). "高端交易终端" — Space Grotesk display +
   IBM Plex Mono figures; CJK body falls through to the system stack. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/space-grotesk-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-mono-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/ibm-plex-mono-700.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* type */
  --display: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  /* spacing + radius */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 28px; --s8: 36px;
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 26px; --r-pill: 999px;
  /* ink / charcoal base */
  --ink: #05070b; --bg: #080b11; --bg-2: #0b0f16;
  --panel: #10151f; --panel-2: #141b27; --panel-3: #19222f; --panel-strong: #141b27;
  --hairline: rgba(255,255,255,.07); --hairline-2: rgba(255,255,255,.12); --hairline-strong: rgba(255,255,255,.18);
  --line: rgba(255,255,255,.07);
  /* text */
  --text: #eef3f7; --text-2: #aebbc8; --muted: #859ab0; --faint: #8390a4;
  /* charged accents */
  --emerald: #2fe39a; --emerald-deep: #11b97b; --emerald-glow: rgba(47,227,154,.55); --emerald-soft: rgba(47,227,154,.12); --emerald-line: rgba(47,227,154,.30);
  --red: #ff5d6c; --red-deep: #e23b4c; --red-glow: rgba(255,93,108,.45); --red-soft: rgba(255,93,108,.12); --red-line: rgba(255,93,108,.28);
  /* financial gain/loss — semantic SIGN colors, swappable by the 涨跌色 pref. Default
     (no data-pref-color / "us") = green up, red down. ONLY profit/loss signs use these;
     semantic success/danger + YES/NO outcome keep --emerald/--red and never flip. */
  --gain: #2fe39a; --gain-deep: #11b97b; --gain-glow: rgba(47,227,154,.55); --gain-soft: rgba(47,227,154,.12); --gain-line: rgba(47,227,154,.30);
  --loss: #ff5d6c; --loss-deep: #e23b4c; --loss-glow: rgba(255,93,108,.45); --loss-soft: rgba(255,93,108,.12); --loss-line: rgba(255,93,108,.28);
  --amber: #ffb444; --amber-deep: #e8920f; --amber-soft: rgba(255,180,68,.13); --amber-line: rgba(255,180,68,.34);
  --focus: rgba(47,227,154,.40);
  /* type scale */
  --t-hero: 54px; --t-xl: 30px; --t-lg: 21px; --t-md: 16px; --t-sm: 13px; --t-xs: 11px; --t-2xs: 10px;
}

/* 红涨绿跌 (China convention) — swap ONLY the financial gain/loss family. Everything
   semantic (success/danger buttons, status banners, error cards, YES/NO market outcome)
   stays on --emerald/--red and is unaffected. Set pre-paint by prefs.js on <html>. */
html[data-pref-color="cn"] {
  --gain: #ff5d6c; --gain-deep: #e23b4c; --gain-glow: rgba(255,93,108,.45); --gain-soft: rgba(255,93,108,.12); --gain-line: rgba(255,93,108,.28);
  --loss: #2fe39a; --loss-deep: #11b97b; --loss-glow: rgba(47,227,154,.55); --loss-soft: rgba(47,227,154,.12); --loss-line: rgba(47,227,154,.30);
}

* {
  box-sizing: border-box;
}

/* hidden attribute must win over component display rules (e.g. .lock-note) */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 18% -6%, #0f1622 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, #0c121b 0%, transparent 55%),
    var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* CJK body via the system face; Latin display/figures via the webfonts */
  font-family:
    "Noto Sans SC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    system-ui,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Hide the native number-input spinner arrows everywhere — they clash with the
   dark custom UI and are redundant (users type the amount; quick-amount chips
   cover stepping). Affects 下注/提现金额 + 设置风控 + 手动下单 inputs. */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 6vw, 24px);
  overflow-x: hidden;
}

.auth-panel {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  padding: clamp(20px, 6vw, 28px);
  /* background / border / radius / shadow come from the dark-theme .auth-panel block below */
}

/* pre-auth language switcher (login / restricted) */
.lang-row { display: flex; justify-content: flex-end; margin-bottom: var(--s2); }
.lang-switch {
  width: auto; min-width: 0; min-height: 36px;
  padding: 6px 28px 6px 10px; font-size: 13px;
  color: var(--text-2); background-color: transparent; border-color: var(--line); border-radius: var(--r-sm);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p,
small {
  color: var(--muted);
}

.primary-action,
.secondary-action,
.google-action,
.ghost-button,
.inline-button {
  min-height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
}

.primary-action {
  width: 100%;
  background: var(--emerald);
  color: var(--ink);
  font-weight: 750;
}

.primary-action:hover {
  background: var(--emerald-deep);
}

.google-action {
  width: 100%;
  background: #ffffff;
  color: #0d121b;
  border-color: var(--line);
  margin-bottom: 4px;
}

.google-action:hover {
  background: #eef1f5;
}

.google-action.disabled,
.google-action[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Sign in with Apple — black button per Apple's guidelines (shares the layout
   rules below via the explicit selector list update). */
.apple-action {
  min-height: 44px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  width: 100%;
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
  margin-bottom: 4px;
}
.apple-action:hover { background: #1a1a1a; }
.apple-action[hidden] { display: none; }

.secondary-action {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.secondary-action:hover,
.ghost-button:hover,
.inline-button:hover {
  background: var(--panel-strong);
}

.button-reset {
  appearance: none;
}

.ghost-button,
.inline-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.inline-button {
  width: max-content;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 22px 0;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.stack-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.status-line {
  min-height: 20px;
  margin-top: 16px;
  font-size: 14px;
}

.status-line.error {
  color: var(--red);
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
/* onboarding has no center nav — 2-col so 退出 stays pinned right, not mid-bar */
body[data-page="onboarding"] .topbar { grid-template-columns: 1fr auto; }

.wordmark {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-strong);
  border-radius: 8px;
  padding: 4px;
}

.topnav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap; /* never break a tab label mid-word */
}
.topnav a:hover { background: var(--panel-2); color: var(--text); }

.topnav a.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.topbar .ghost-button {
  justify-self: end;
}

.page-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* 0-min so children never overflow on long nowrap content */
  gap: 20px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}

.page-heading p {
  margin-top: 8px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  min-height: 124px;
  display: grid;
  gap: 10px;
  align-content: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
}

.metric-card span,
.balance-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong,
.address-box {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  line-height: 1.55;
}

.work-surface {
  display: grid;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
}

.surface-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.surface-header p {
  margin-top: 6px;
}

.state-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.state-pill.danger {
  background: var(--red-soft);
  color: var(--red);
}
/* Neutral / in-progress state (生成中 · 计算中 · 待确认 · 提现中) — not a success,
   shouldn't read green. Green base stays for genuine "ready/done" states. */
.state-pill.pending {
  background: var(--panel-3);
  color: var(--text-2);
}

.danger-action {
  color: var(--red);
  border-color: var(--red-line);
}

.danger-action:hover {
  background: var(--red-soft);
}

.address-box {
  min-height: 58px;
  display: flex;
  align-items: center;
  border: 1px dashed var(--hairline-2);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  padding: 14px;
  color: var(--text);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-row.end {
  justify-content: flex-end;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.balance-row strong {
  font-size: 22px;
}

/* zero-balance nudge under the balance row */
.balance-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--amber);
  background: rgba(255, 180, 68, 0.08);
  border: 1px solid rgba(255, 180, 68, 0.24);
  border-radius: var(--r-sm);
}

/* deposit network/asset warning — the wrong chain or token loses funds */
.deposit-warn {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.deposit-warn b { color: var(--amber); font-weight: 800; }

/* small clarifying note under an account-identity card */
.card-note { font-size: 12px; color: var(--faint); font-weight: 600; line-height: 1.4; }

.deposit-list {
  display: grid;
  gap: 10px;
}

.deposit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--panel-2);
}

.deposit-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.deposit-meta span,
.asset-panel-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.deposit-meta strong {
  overflow-wrap: anywhere;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 13px;
  line-height: 1.45;
}

.deposit-meta small {
  font-size: 12px;
}

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

.asset-panel {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.asset-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-panel-header strong {
  color: var(--muted);
  font-size: 13px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.asset-grid.error {
  color: var(--red);
}

.asset-chip {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel-2);
}

.asset-chip strong {
  font-size: 13px;
  line-height: 1.35;
}

.asset-chip span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.wide-form {
  max-width: 760px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; /* whole row is a <label> — signal it's tappable */
}

.toggle-row span {
  display: grid;
  gap: 4px;
}

/* CSS-only switch(track+thumb):原生 checkbox 拉到 44×24 选中是系统蓝勾、未选近乎隐形,
   和旁边 select 不成体系 → 全站 .toggle-row 统一成 iOS 式开关,on 色用 --gain(随涨跌色偏好)。
   特异性踩点:后文 .section-card label{display:grid} / .section-card input{min-height/padding/
   background/border} 会压过单类选择器 → 行布局用 .section-card label.toggle-row 拉回 flex,
   开关用 input[type="checkbox"] 提一级并把被覆盖的属性全部显式归零。 */
.section-card label.toggle-row {
  display: flex; /* keep text left / switch right inside section cards too */
}
.toggle-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  /* flex:none(非 0 0 44px):手机端媒体查询把 .toggle-row 翻成 column,行向 basis 会变成高度 */
  flex: none;
  margin: 0;
  position: relative;
  border-radius: 999px;
  background: var(--hairline-strong);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.18s ease;
}
.toggle-row input[type="checkbox"]:checked {
  background: var(--gain);
}
.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}
.toggle-row input[type="checkbox"]:focus {
  outline: none;
}
.toggle-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Custom checkbox for confirmation gates (.checkrow = 提现确认 + 设置 go-live 三连勾;
   .bet-gate = 市场下注弹层). Replaces the raw system-blue square so money-action
   gates match the brand. Specificity (.checkrow + [type]) beats .section-card input.
   NOT .toggle-row (those are the iOS switches). */
.checkrow input[type="checkbox"],
.bet-gate input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.checkrow input[type="checkbox"]:checked,
.bet-gate input[type="checkbox"]:checked {
  background: var(--emerald);
  border-color: var(--emerald);
}
.checkrow input[type="checkbox"]:checked::after,
.bet-gate input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkrow input[type="checkbox"]:focus-visible,
.bet-gate input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--emerald-line);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Data tables (leaderboard, positions). Desktop: clean rows; mobile: cards. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table thead th {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table .pos {
  color: var(--gain);
}
.data-table .neg {
  color: var(--loss);
}

/* App-wide profit/loss semantics + tabular money figures. Color belongs to the
   value's sign everywhere, not only inside tables. */
.pos {
  color: var(--gain);
}
.neg {
  color: var(--loss);
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding: 14px;
  }

  .topbar .ghost-button {
    justify-self: stretch;
  }

  /* 5 tabs don't fit 390px — make the bar a single swipeable strip instead of
     wrapping. Tabs keep full size; the row scrolls horizontally. */
  .topnav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    max-width: 100%;
  }
  .topnav::-webkit-scrollbar {
    display: none; /* WebKit/Blink */
  }
  .topnav a {
    flex: 0 0 auto;
  }

  .page-shell {
    padding: 20px 14px 36px;
  }

  .page-heading,
  .surface-header,
  .toggle-row {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two,
  .form-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .deposit-row {
    grid-template-columns: 1fr;
  }

  .deposit-actions {
    justify-content: stretch;
  }

  .deposit-actions .inline-button {
    width: 100%;
  }

  /* finger-friendly touch targets for copy/check beside money addresses */
  .inline-button {
    min-height: 44px;
    font-size: 14px;
  }

  .primary-action,
  .secondary-action,
  .ghost-button {
    width: 100%;
  }

  /* Tables → one card per row. Headers are hidden; each cell shows its own
     label via data-label so a 6-column financial table stays readable at 390px. */
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
    background: var(--panel);
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 9px 14px;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    flex: 0 0 auto;
  }
  /* Action cell (data-label="") and full-width empty/loading rows: no label. */
  .data-table td[data-label=""] {
    justify-content: stretch;
  }
  .data-table td[colspan] {
    justify-content: center;
    text-align: center;
    color: var(--muted);
  }
  .data-table td[data-label=""]::before,
  .data-table td[colspan]::before {
    content: none;
  }
  .data-table td[data-label=""] .ghost-button {
    width: 100%;
  }
}

/* ============================================================================
   Native app shell: bottom tab bar (mobile), touch polish, safe-area insets,
   standalone PWA tweaks. Desktop is unaffected (tab bar hidden ≥761px).
   ========================================================================== */

/* Touch / native feel for all surfaces. */
* {
  -webkit-tap-highlight-color: transparent;
}
html {
  -webkit-text-size-adjust: 100%;
  /* 原生 app 体验:封掉捏合/双击缩放(只留单指平移)。与 viewport 的 user-scalable=no
     双保险——iOS Safari 浏览器标签页会无视 meta(无障碍策略),手势层这条仍然生效;
     PTR(下拉刷新)/横滑导航都是 pan,不受影响。 */
  touch-action: pan-x pan-y;
}
body {
  overscroll-behavior-y: none;
}
a,
button,
.tabbar-item {
  -webkit-touch-callout: none;
}

/* 提示收纳(tips):.tipify 辅助小字默认隐藏(仅 JS 转换过的,渐进增强),点 ⓘ 原位弹气泡。 */
.tipify[data-tipified] { display: none; }
.tipify[data-tipified].open {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--hairline-2);
  border-radius: 9px;
  padding: 8px 11px;
  margin-top: 7px;
}
.tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: none;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
/* The visible "?" stays 17px, but the tappable area is expanded to ~44px (iOS/WCAG
   touch-target floor) via a transparent overlay so it isn't a fiddly fingertip miss. */
.tip-btn::before {
  content: "";
  position: absolute;
  inset: -13px;
}
.tip-btn[aria-expanded="true"] { color: var(--emerald); border-color: var(--emerald); }

/* Pressed feedback (native-like tactile response). */
.primary-action,
.secondary-action,
.ghost-button,
.inline-button {
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.primary-action:active,
.secondary-action:active,
.ghost-button:active,
.inline-button:active {
  transform: scale(0.97);
}

/* Bottom tab bar — injected by app-chrome.js; shown only on mobile. */
.tabbar {
  display: none;
}
.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1 1 0;
  padding: 8px 0 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: color 0.12s ease, transform 0.08s ease;
}
.tabbar-item svg {
  width: 24px;
  height: 24px;
}
.tabbar-item.active {
  color: var(--emerald);
}
.tabbar-item:active {
  transform: scale(0.92);
}

@media (max-width: 760px) {
  /* Compact mobile title bar — kept only on pages that get NO bottom tab bar
     (just onboarding: app-chrome.js skips the bar there). The wordmark is a home
     link and 退出 is the funnel's escape, so the page still has navigation. */
  .topbar .topnav {
    display: none;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    height: 56px;
    padding: 0 16px;
  }
  .topbar .ghost-button {
    justify-self: end;
    width: auto;
    padding: 8px 14px;
  }

  /* Pages WITH the bottom tab bar: the top header just duplicates the tab bar, so
     drop it; 退出 now lives in 设置. The page content then owns the status-bar /
     notch inset the header used to carry. The data-page set is exactly
     app-chrome.js's tab-injection set (has-tabbar) — and it's static HTML, so the
     header never flashes in before a deferred script can hide it. */
  body[data-page="leaderboard"] .topbar,
  body[data-page="markets"] .topbar,
  body[data-page="wallet"] .topbar,
  body[data-page="pnl"] .topbar,
  body[data-page="settings"] .topbar,
  body[data-page="trader"] .topbar,
  body[data-page="trade"] .topbar {
    display: none;
  }
  body[data-page="leaderboard"] .page-shell,
  body[data-page="markets"] .page-shell,
  body[data-page="wallet"] .page-shell,
  body[data-page="pnl"] .page-shell,
  body[data-page="settings"] .page-shell,
  body[data-page="trader"] .page-shell,
  body[data-page="trade"] .page-shell {
    padding-top: calc(20px + env(safe-area-inset-top));
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    /* Fully opaque instead of backdrop-filter blur (blur repaints the bar every
       scroll frame as content passes under it — a major mobile jank source). The
       old 97% mix let bright PnL/usernames bleed ~3% through and clash with the
       tab labels; a solid surface kills the bleed at zero repaint cost. */
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* iOS Safari:聚焦文本输入弹出软键盘时,固定底栏会被键盘顶得乱漂。打字时本就用不到
     底部导航 —— 直接隐藏,从根上避开键盘 vs 固定栏的冲突。(focusin/out 切 body.kb-open) */
  body.kb-open .tabbar { display: none; }

  /* ★ App-shell:整页不滚 → .page-shell 内部滚动 → 固定底栏在「文档滚动」之外。
     iOS 动量滚动只发生在内层容器里,固定底栏(相对视口、文档不动)不再被主线程
     滞后重绘 = 不再「漂」。这是 fixed 底栏滚动漂移的根治法。自定义下拉刷新的 scroller
     已改指向 .page-shell(app-chrome.js)。 */
  body.has-tabbar { overflow: hidden; height: 100dvh; }
  body.has-tabbar .page-shell {
    position: fixed; inset: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
    /* 关掉入场动画(screen-in):它 fill:both 会在滚动容器上残留一个 transform,
       既让 page-shell 成为内部 fixed 后代的包含块(埋雷),又触发 iOS「transform +
       overflow:auto + -webkit-overflow-scrolling」的动量滚动重绘 glitch。滚动容器要干净。 */
    animation: none;
    /* 底栏仍固定在视口底部覆盖内容 → 给内容留出底栏高度,末项不被遮 */
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  /* The sticky 跟单/CTA bar (e.g. trader 详情「跟单 TA」) must sit ABOVE the fixed
     tabbar, not under it — both were bottom:0 so the z-index:40 tabbar covered the
     button on a scrolled page. Anchor it to the tabbar height (~56px content) so it
     stays flush-above and tappable; z-index:41 wins any sub-pixel overlap. Only here
     (≤760px) — on desktop the tabbar is display:none and bottom:0 is correct. */
  body.has-tabbar .follow-bar {
    bottom: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: 12px;
    z-index: 41;
  }
  /* App-shell:.page-shell 成为滚动容器后,它的 padding-bottom(给底栏留的空)会把
     sticky follow-bar 的参考线上移同样的量 → 按钮悬在底栏上方一大段空隙。有 follow-bar
     的详情页本身用 sticky bottom 顶在底栏上方,不需要这段 padding → 清掉,按钮重新贴齐底栏。 */
  body[data-page="trader"].has-tabbar .page-shell {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* No iOS auto-zoom on focus (inputs must be ≥16px). */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* Installed PWA: pad the top bar under the status bar / notch. */
@media (display-mode: standalone) {
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
  }
}

/* ============================================================================
   Native-feel motion: cross-page transitions, content entrance, skeletons,
   pull-to-refresh. All progressive + reduced-motion aware.
   ========================================================================== */

/* Cross-document view transitions: a native cross-fade between pages so the
   multi-page nav doesn't flash. Re-enabled now that pages are lighter (perf pass)
   and static assets are cached (no per-nav re-download), so the snapshot is cheap. */
@view-transition {
  navigation: auto;
}

/* Content entrance on each page (fallback + complement). */
.page-shell {
  animation: screen-in 0.26s ease both;
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton loading placeholders (shimmer). */
.skeleton {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--line) 55%, var(--panel-strong));
  border-radius: 6px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, #fff 60%, transparent),
    transparent
  );
  animation: shimmer 1.25s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}
.skeleton-line {
  height: 12px;
  margin: 9px 0;
}
.skeleton-row td {
  padding: 14px !important;
}
.skeleton-stack {
  display: grid;
  gap: 4px;
  width: 100%;
}
/* Skeleton cells opt out of the mobile card flex/centering so the bars fill. */
@media (max-width: 760px) {
  .data-table tr.skeleton-row td[colspan] {
    display: block;
    text-align: left;
  }
}

/* Pull-to-refresh indicator (mobile; injected by app-chrome.js). */
.ptr-indicator {
  position: fixed;
  top: -46px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  opacity: 0;
  z-index: 50;
  pointer-events: none;
}
.ptr-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--emerald);
}
.ptr-indicator.ready .ptr-spinner {
  border-top-color: var(--emerald);
}
.ptr-indicator.loading .ptr-spinner {
  animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-shell {
    animation: none;
  }
  .skeleton::after,
  .ptr-indicator.loading .ptr-spinner {
    animation: none;
  }
  /* Strong transform/opacity motion the 3 rules above missed — vestibular-disorder
     triggers, and a money app should let users turn off the flashy stuff: settlement
     confetti, the pulsing live/kill rings, the activation spinner, the clock tick.
     Elements stay (just static). JS-driven confetti/countUp also self-gate via matchMedia. */
  .confetti,
  .win-sheet .burst,
  .live-dot::after,
  .killswitch .pulse::after,
  .act-step.active .act-ic::after,
  .ks-uptime .clock .tk {
    animation: none !important;
  }
  @view-transition {
    navigation: none;
  }
}

/* ============================================================
   Copytrade safety state machine + result cards (redesign)
   All colors via tokens so light/dark both work.
   ============================================================ */

/* Persistent status banner — the user always knows sim vs real money. */
.status-banner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-weight: 700;
}
.status-banner .sb-text { display: grid; gap: 2px; }
.status-banner .sb-text small { font-weight: 600; color: var(--muted); }
.status-banner.sim { background: var(--emerald-soft); border-color: transparent; color: var(--emerald); }
.status-banner.live { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.status-banner.paused { background: var(--red-soft); border-color: transparent; color: var(--red); }
.status-banner.sim .sb-text small,
.status-banner.live .sb-text small,
.status-banner.paused .sb-text small { color: inherit; opacity: 0.8; }
.live-dot {
  position: relative; width: 10px; height: 10px; border-radius: 999px; flex: none;
  background: currentColor;
}
/* compositable pulse ring — transform+opacity only (GPU, no per-frame repaint) */
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; will-change: transform, opacity;
  animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: .55; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}

/* ───────────────────────────────────────────────────────────────
   设置页 Binance 风格分组列表（scoped 新类，勿全局复用 .section-card 等）。
   顶层=灰组头 + 行(label 左 / 概览值 + › 右 / 发丝分隔)；点行打开底部抽屉编辑。
   抽屉沿用 .sheet/.sheet-card；抽屉内表单沿用既有 .section-card/.field-help。
   ─────────────────────────────────────────────────────────────── */
/* 账户头：邮箱 + 状态横幅（横幅由 app.js 维护，这里只把它压紧排在右侧） */
.set-acct {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) 2px var(--s4); border-bottom: 1px solid var(--line);
  margin-bottom: 2px; flex-wrap: wrap;
}
.set-acct-em { margin: 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; }
.set-acct .status-banner { padding: var(--s2) var(--s3); flex: 0 0 auto; font-size: 12px; }
.set-acct .status-banner .sb-text small { display: none; } /* 行内紧凑：副标题留给抽屉/执行行 */

/* 灰组头（Binance 分组标签） */
.set-group-h {
  font-size: 12px; color: var(--faint); font-weight: 600;
  letter-spacing: .02em; margin: var(--s5) 2px var(--s2);
}
/* 行容器 */
.set-list {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* overflow:clip(不是 hidden):.page-shell 是 grid,这些 .set-list 是 grid item。overflow:hidden 会让
     grid item 成为「滚动容器」→ 其自动最小尺寸=0 → WebKit(iOS Safari) 把行高算成 0、整组塌成 2px(只剩边框)、
     行被裁不可见也点不到(Blink 不塌、故只在 iOS 复现)。clip 同样按圆角裁切但【不是滚动容器】→ 不塌。
     (Safari<16 不支持 clip 则回退 visible=行照常显示、仅圆角不裁,可接受;绝不再塌。) */
  overflow: clip;
}
/* 单行：button / a / label / section 都可，统一 flex 布局 + 发丝分隔 */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  width: 100%; text-align: left; box-sizing: border-box;
  padding: 14px var(--s4); min-height: 56px;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; cursor: pointer; text-decoration: none;
  -webkit-appearance: none; appearance: none;
}
.set-list > .set-row:last-child { border-bottom: none; }
.set-row:hover { background: var(--panel-2); }
.set-row:active { background: var(--panel-3); }
.set-row:focus-visible { outline: 2px solid var(--emerald); outline-offset: -2px; }
.set-row .srl { display: grid; gap: 3px; font-size: 15px; font-weight: 600; min-width: 0; }
.set-row .srl small,
.set-row .srl .field-help {
  display: block; font-size: 12px; font-weight: 400; color: var(--faint);
  margin: 0; overflow-wrap: anywhere;
}
.set-row .srl strong { font-weight: 600; }
.set-row .srr {
  display: flex; align-items: center; gap: 7px; flex: 0 0 auto;
  color: var(--faint); font-size: 14px;
}
.set-row .srv { color: var(--text-2); font-weight: 500; max-width: 56vw; text-align: right; overflow-wrap: anywhere; }
.set-row .chev { color: var(--faint); font-size: 18px; line-height: 1; }
/* 多行块行（提现保护卡：左文案 + 右按钮，不可点开抽屉） */
.set-row.set-row-block { cursor: default; align-items: center; }
.set-row.set-row-block:hover { background: transparent; }
.set-row.set-row-block .srl { gap: 4px; }
/* 退出登录：红色 */
.set-row-danger .srl, .set-row-danger .srl span { color: var(--red); font-weight: 700; }
.set-row-danger .chev { color: var(--red); }
/* 行内开关行（下单确认 / 自动翻译）：复用 checkbox，渲成 iOS/Binance 式开关 */
.set-row.set-row-tg { cursor: pointer; }
.set-tg {
  -webkit-appearance: none; appearance: none; margin: 0; padding: 0; flex: 0 0 auto;
  width: 44px; min-width: 44px; height: 26px; border-radius: 999px; background: var(--panel-3);
  border: 1px solid var(--line); position: relative; cursor: pointer;
  transition: background .15s; outline: none;
}
.set-tg::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: left .15s;
}
.set-tg:checked { background: var(--gain); border-color: transparent; }
.set-tg:checked::after { left: 20px; }
.set-tg:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
/* tk-group 在安全列表内时去掉自身外边距冲突，并撑满一行 */
.set-list .tk-group { padding: 0 var(--s4) var(--s4); }
.set-list #passkey-card { border-bottom: 1px solid var(--line); }
/* 抽屉内被搬进来的 section-card：去掉重复边框/留白，贴合 sheet-card */
.sheet-card .edit-body {
  border: none; background: transparent; padding: 0; margin: 0;
  border-radius: 0; gap: var(--s4);
}
.sheet-card .edit-body > h2 { margin-top: 0; }

/* Grouped sections with plain-language help. */
.section-card {
  display: grid;
  gap: var(--s4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s5);
}
.section-card > h2 { font-size: 16px; }
.section-card label { display: grid; gap: 6px; font-weight: 650; color: var(--text); }
.section-card input,
.section-card textarea,
.section-card select {
  min-height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  font-weight: 600;
}
.section-card textarea { padding: 10px 12px; min-height: 88px; }
.field-help { font-size: 13px; font-weight: 500; color: var(--faint); overflow-wrap: anywhere; }
.field-help b { color: var(--muted); font-weight: 700; }

/* Locked-while-live fields. */
.section-card.locked input,
.section-card.locked textarea,
.section-card.locked select { opacity: 0.6; cursor: not-allowed; }
.lock-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--amber);
}

/* Execution / real-money zone. */
.exec-card { border-color: var(--amber); }
.btn-block {
  width: 100%; min-height: 52px;
  border-radius: var(--r-md); border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-size: 17px; font-weight: 800;
  cursor: pointer; transition: filter .12s, transform .05s;
}
/* press feedback on the money / go-live CTAs (mobile has no hover) */
.btn-block:not(:disabled):active { transform: scale(0.97); }
.btn-live { background: linear-gradient(160deg, #ffc874, var(--amber-deep)); color: #160f02; font-weight: 800; box-shadow: 0 10px 24px -12px rgba(255,180,68,.6); }
.btn-live:hover { filter: brightness(1.04); }
/* Neutral-affirmative block button (brand green). Use for benign confirms (e.g.
   the filter sheet's 应用) so the amber btn-live stays reserved for real-money /
   go-live actions and isn't overloaded onto harmless taps. --emerald, not --gain,
   so it never flips to red under the 红涨绿跌 preference. */
.btn-primary { background: linear-gradient(160deg, var(--emerald), var(--emerald-deep)); color: var(--ink); font-weight: 800; box-shadow: 0 10px 24px -12px var(--emerald-glow); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-pause { background: var(--red); color: #fff; }
.btn-pause:hover { filter: brightness(0.96); }
.btn-ghost-block {
  width: 100%; min-height: 44px;
  /* center the label — without this, on an <a> (display:block) the text jams into
     the top-left corner of the box (e.g. the pnl empty-state "去完成设置"). */
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-weight: 700; cursor: pointer; text-decoration: none;
}

/* Go-live confirmation sheet (mobile bottom-sheet via <dialog>). */
dialog.sheet {
  border: none; padding: 0; background: transparent;
  width: 100%; max-width: 460px; margin: auto auto 0;
  color: var(--text);
}
dialog.sheet::backdrop { background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.sheet-card {
  background: var(--panel);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 4px solid var(--amber);
  padding: var(--s6) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom));
  display: grid; gap: var(--s4);
  /* short viewports (landscape phone, large system font, zoom): scroll inside the
     sheet instead of clipping the title / confirm button off the top. */
  max-height: 100dvh; overflow-y: auto;
}
@media (min-width: 480px) {
  dialog.sheet { margin: auto; }
  .sheet-card { border-radius: var(--r-lg); max-height: 90dvh; }
}
/* Benign sheets (e.g. the leaderboard filter) drop the amber go-live accent so the
   amber top-bar stays a money/danger signal, not a generic sheet decoration. */
.sheet.sheet-filter .sheet-card { border-top-color: var(--emerald); }
.sheet-card h2 { font-size: 20px; }
.consequence { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.consequence li {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px;
  align-items: start; font-size: 14px; color: var(--text);
}
.consequence li b { color: var(--amber); }
.consequence .ic { color: var(--amber); font-weight: 800; }
.consequence .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.checkrow {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px;
  align-items: start; min-height: 44px; padding: 8px 0;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.checkrow input { width: 22px; height: 22px; margin-top: 1px; }
.sheet-actions { display: grid; gap: 10px; }
.sheet-meta { font-size: 12px; color: var(--faint); text-align: center; }

/* transient in-app toast (replaces alert) — floats above the bottom tab bar */
.ct-toast {
  position: fixed; left: 50%; bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px);
  background: var(--panel-strong); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 16px; font-size: 14px; font-weight: 650; line-height: 1.45;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; z-index: 1000;
  transition: opacity .2s ease, transform .2s ease;
}
.ct-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ct-toast.err { border-color: var(--red-line); color: var(--red); }

/* Human-readable result card (replaces raw JSON dumps). */
.result-card {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--r-sm); padding: var(--s4); display: grid; gap: var(--s2);
}
.result-card.ok { border-left-color: var(--emerald); }
.result-card.err { border-left-color: var(--red); }
.result-card .rc-title { font-weight: 800; font-family: var(--display); }
.result-card.ok .rc-title { color: var(--emerald); }
.result-card.err .rc-title { color: var(--red); }
.result-field { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.result-field .rf-label { color: var(--muted); font-weight: 600; }
.result-field .rf-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
/* withdrawal recipient address fingerprint (anti-mispaste) */
.addr-fp { text-align: left; }
.addr-fp-mono { font-family: var(--mono); font-size: 13px; word-break: break-all; line-height: 1.5; }
.addr-fp-mono .fp-strong { color: var(--text); font-weight: 800; }
.addr-fp-mono .fp-dim { color: var(--faint); font-weight: 500; }
.addr-fp-code { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.addr-fp-code .fp-emo { font-size: 16px; line-height: 1; }
.addr-fp-code .fp-hex { font-family: var(--mono); font-weight: 800; letter-spacing: 1px; font-size: 12px;
  color: var(--emerald); background: var(--emerald-soft); border: 1px solid var(--emerald-line); border-radius: 6px; padding: 1px 7px; }
.addr-fp-code .fp-hint { font-size: var(--t-xs); color: var(--text-2); font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 500; }
.result-card details { margin-top: 4px; }
.result-card details summary { cursor: pointer; color: var(--faint); font-size: 13px; font-weight: 650; }
.result-card details pre {
  margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--panel-strong); color: var(--text);
  border-radius: var(--r-sm); padding: 12px; font-size: 12px; line-height: 1.5;
  font-family: var(--mono);
}


/* Persistent kill-switch on the PnL screen (only shown while live). */
.killbar { display: none; }
.killbar.live {
  display: flex;
  align-items: center;
  gap: var(--s3);
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  font-weight: 750;
}
.killbar .kb-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.killbar .kb-text small { color: inherit; opacity: 0.85; font-weight: 600; }
.killbar .kb-btn {
  width: auto; min-height: 40px; padding: 0 20px;
  border: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: 15px; font-weight: 750;
}

/* ============================================================================
   "高端交易终端" — terminal page components (direction A, ported to real app).
   Uses the :root terminal tokens. Mobile-first single-screen feeds.
   ========================================================================== */
/* min-width:0 — .page-shell is display:grid, so without it this grid item grows to
   its content's min-content width (a long nowrap position title) and overflows the
   viewport, pushing the row's right-hand values off-screen. */
/* width:min() not max-width+margin:auto — auto margins on a GRID item make it
   size to its content (a long nowrap title), overflowing the track. An explicit
   width + justify-self caps it to the column and centers it on wide screens. */
.feed { display: flex; flex-direction: column; gap: 14px; width: min(460px, 100%); justify-self: center; padding: 6px 2px 8px; min-width: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }

/* active bottom-tab glow dot */
.tabbar-item.active { position: relative; }
.tabbar-item.active::before {
  content: ""; position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald-glow);
}

/* ---- HERO PnL ---- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px 22px 18px;
  background:
    radial-gradient(380px 220px at 78% -30%, rgba(47,227,154,.22), transparent 62%),
    linear-gradient(165deg, #16202d 0%, #0e141d 78%);
  border: 1px solid var(--hairline-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 60px -30px rgba(47,227,154,.35), 0 24px 50px -28px rgba(0,0,0,.8);
}
/* loss → red glow (don't show an emerald aura over a negative total) */
.hero.loss {
  background:
    radial-gradient(380px 220px at 78% -30%, rgba(255,93,108,.20), transparent 62%),
    linear-gradient(165deg, #261820 0%, #0e141d 78%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 60px -30px rgba(255,93,108,.30), 0 24px 50px -28px rgba(0,0,0,.8);
}
.hero.loss .label .ti { background: var(--loss); box-shadow: 0 0 8px var(--loss-glow); }
.hero .label-row { display: flex; align-items: center; justify-content: space-between; }
.hero .label { font-size: var(--t-sm); color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.hero .label .ti { width: 6px; height: 6px; border-radius: 50%; background: var(--gain); box-shadow: 0 0 8px var(--gain-glow); }
.chip { font-family: var(--mono); font-size: var(--t-xs); font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--gain-soft); color: var(--gain); border: 1px solid var(--gain-line); display: inline-flex; align-items: center; gap: 5px; }
.chip.down { background: var(--loss-soft); color: var(--loss); border-color: var(--loss-line); }
.hero .big { font-family: var(--mono); font-weight: 700; font-size: var(--t-hero); line-height: 1; letter-spacing: -1px; margin: 14px 0 2px; color: var(--gain); text-shadow: 0 0 36px var(--gain-glow); }
.hero .big.neg { color: var(--loss); text-shadow: 0 0 36px var(--loss-glow); }
/* Exactly-zero total PnL: neutral, no green glow — $0.00 is neither gain nor loss. */
.hero .big.zero { color: var(--text-2); text-shadow: none; }
.hero .big .cur { font-size: 30px; opacity: .72; margin-right: 2px; vertical-align: 7px; }
.hero .big .dec { opacity: .55; }
.hero .sub { font-size: var(--t-sm); color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero .sub b { font-family: var(--mono); color: var(--text-2); font-weight: 600; }
/* equity sparkline (inline SVG, stretches full-width; color = window trend) */
.spark-host { margin-top: 16px; }
svg.spark { display: block; width: 100%; height: 50px; }
.spark .spark-line { fill: none; stroke: var(--gain); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .spark-fill { fill: var(--gain); opacity: .10; }
.spark.down .spark-line { stroke: var(--loss); }
.spark.down .spark-fill { fill: var(--loss); }
.spark .spark-zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke; }
.spark-cap { display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px; font-family: var(--mono); font-size: var(--t-2xs); }
.spark-cap .pos { color: var(--gain); }
.spark-cap .neg { color: var(--loss); }

/* ---- KPI grid (terminal) ---- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.kpis .kpi {
  border-radius: var(--r-md); padding: 14px 15px 13px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.kpis .k-label { font-size: var(--t-xs); color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
/* no color here — .pos/.neg must win for profit/loss; plain values inherit --text */
.kpis .k-val { font-family: var(--mono); font-weight: 700; font-size: clamp(16px, 5.4vw, 21px); letter-spacing: -.6px; line-height: 1.1; overflow-wrap: anywhere; }
.kpis .k-val .cur { font-size: 13px; opacity: .6; margin-right: 1px; }
.kpis .k-val .u { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpis .kpi.accent-green { border-color: var(--gain-line); }
.kpis .kpi.accent-green::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--gain), var(--gain-deep)); opacity: .7; }
.kpis .kpi.accent-red::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--loss), var(--loss-deep)); opacity: .7; }

/* ---- trader detail: historical equity curve + drawdown + risk band ---- */
.tsig { border-radius: var(--r-md); padding: 14px 15px 12px; margin: 12px 0 11px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline); }
.tsig-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tsig-head .h { font-size: var(--t-sm); color: var(--text-2); font-weight: 650; }
.tsig-head .v { font-family: var(--mono); font-weight: 800; font-size: var(--t-md); }
.tsig-head .v.pos { color: var(--gain); }
.tsig-head .v.neg { color: var(--loss); }
.tsig-spark { margin: 10px 0 8px; }
.tsig-spark svg { display: block; }
.tsig-foot { font-size: var(--t-xs); color: var(--muted); font-family: var(--mono); }
.risk-band { border-radius: var(--r-md); padding: 13px 14px; margin: 0 0 11px; border: 1px solid var(--hairline); background: var(--panel-2); }
.risk-band .rb-top { display: flex; align-items: center; gap: 10px; }
.risk-band .rb-chip { flex: 0 0 auto; font-size: 12px; font-weight: 800; letter-spacing: .4px; border-radius: 7px; padding: 3px 9px; }
.risk-band .rb-reason { font-size: var(--t-sm); color: var(--text-2); min-width: 0; }
.risk-band .rb-fit { font-size: var(--t-sm); color: var(--text); margin-top: 9px; line-height: 1.45; }
.risk-band .rb-note { font-size: var(--t-xs); color: var(--faint); margin-top: 7px; }
.risk-band.low { border-color: var(--emerald-line); }
.risk-band.low .rb-chip { color: var(--emerald); background: rgba(47,227,154,.12); border: 1px solid rgba(47,227,154,.3); }
.risk-band.mid { border-color: var(--amber-line); }
.risk-band.mid .rb-chip { color: #f0b53a; background: rgba(240,181,58,.12); border: 1px solid rgba(240,181,58,.3); }
.risk-band.high { border-color: var(--red-line, rgba(255,93,108,.3)); }
.risk-band.high .rb-chip { color: var(--red, #ff5d6c); background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.3); }

/* ---- account-activation stepped progress (wallet.html) ---- */
.act-prog { margin-top: 14px; }
.act-bar { height: 6px; border-radius: 999px; background: var(--panel-strong); overflow: hidden; }
.act-bar i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald-deep), var(--emerald)); transition: width .45s ease; }
.act-steps { display: flex; flex-direction: column; gap: 11px; margin-top: 15px; }
.act-step { display: flex; align-items: center; gap: 11px; font-size: var(--t-sm); color: var(--muted); transition: color .2s; }
.act-step .act-ic { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; border: 1px solid var(--hairline-2); color: var(--muted); background: var(--panel-2); }
.act-step.active { color: var(--text); }
.act-step.active .act-ic { border-color: var(--emerald); background: transparent; }
.act-step.active .act-ic::after { content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--emerald); border-top-color: transparent; animation: act-spin .7s linear infinite; }
.act-step.done { color: var(--text-2); }
.act-step.done .act-ic { background: var(--emerald); border-color: var(--emerald); color: #05070b; }
@keyframes act-spin { to { transform: rotate(360deg); } }

/* ---- kill-switch strip (real money) ---- */
.killswitch {
  border-radius: var(--r-lg); padding: 13px 14px 13px 16px; display: flex; align-items: center; gap: 13px;
  background: radial-gradient(220px 120px at 0% 0%, rgba(255,180,68,.16), transparent 70%), linear-gradient(150deg, #1e1a14, #15110c);
  border: 1px solid var(--amber-line); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 34px -22px rgba(232,146,15,.5);
}
.killswitch .pulse { position: relative; width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; background: var(--amber); }
.killswitch .pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--amber); will-change: transform, opacity; animation: pulse-ring 2.2s ease-out infinite; }
.killswitch .ks-text { flex: 1 1 auto; min-width: 0; }
.killswitch .ks-title { font-size: var(--t-sm); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.killswitch .ks-title .rm { font-family: var(--mono); font-size: var(--t-2xs); font-weight: 700; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); padding: 2px 6px; border-radius: 5px; }
.killswitch .ks-sub { font-size: var(--t-xs); color: var(--text-2); margin-top: 3px; }
.killswitch .ks-sub .num { color: var(--text); }
.ks-btn {
  flex: 0 0 auto; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); width: auto;
  font-family: var(--body, inherit); font-weight: 700; font-size: var(--t-sm); color: #1a1206; border: 1px solid rgba(255,220,150,.5);
  background: linear-gradient(160deg, #ffc766, var(--amber-deep));
  box-shadow: 0 8px 20px -10px rgba(232,146,15,.7), inset 0 1px 0 rgba(255,255,255,.4);
}

/* ---- section head + positions ---- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 0; }
.sec-head .h { font-family: var(--display); font-weight: 700; font-size: var(--t-lg); }
.sec-head .more { font-size: var(--t-sm); color: var(--muted); }
.poslist { display: flex; flex-direction: column; gap: 9px; }
.pos-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md);
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
/* Outcome badge: a fixed 38px box. Long outcome names (team names like "Los Angeles
   Dodgers") wrap to 2 lines + center instead of an uninformative "Los Angel…" clip;
   the fixed height (not min-height) keeps the box bounded so a pathological 3+ line
   outcome can't grow the row and break the list's uniform rhythm (clips instead). */
.pos-row .badge { flex: 0 0 auto; min-width: 38px; max-width: 96px; height: 38px; padding: 4px 8px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; text-align: center; align-self: center;
  line-height: 1.15; overflow: hidden; word-break: break-word;
  font-family: var(--mono); font-weight: 700; font-size: var(--t-xs); border: 1px solid var(--hairline-2); }
.pos-row .badge.yes { color: var(--emerald); background: var(--emerald-soft); border-color: var(--emerald-line); }
.pos-row .badge.no { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
/* trade direction badges (买入/卖出) — buy green, sell red */
.pos-row .badge.buy { color: var(--emerald); background: var(--emerald-soft); border-color: var(--emerald-line); }
.pos-row .badge.sell { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.pos-row .meta { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.pos-row .meta .t { font-size: var(--t-md); font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-row .meta .s { font-size: var(--t-xs); color: var(--muted); margin-top: 3px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-row .val { text-align: right; flex: 0 0 auto; min-width: 0; }
.pos-row .val .pl, .pos-row .val .pct { white-space: nowrap; }
.pos-row .val .pl { font-family: var(--mono); font-weight: 700; font-size: var(--t-md); letter-spacing: -.4px; }
.pos-row .val .pct { font-family: var(--mono); font-size: var(--t-xs); margin-top: 3px; opacity: .85; }

/* ---- 持仓 | 历史 分段切换 + 卡片（2026-06-15，参考 proto-ph 深色卡片风）---- */
/* segmented toggle (pill) */
.seg-toggle { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 4px; margin: 12px 0 14px; }
.seg-toggle button { flex: 1; border: none; background: transparent; color: var(--muted); font-family: var(--display); font-size: var(--t-md); font-weight: 600; padding: 9px 0; border-radius: var(--r-pill); cursor: pointer; transition: background .15s, color .15s; }
.seg-toggle button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.seg-toggle button:focus-visible { outline: 2px solid var(--emerald-line); outline-offset: 2px; }

/* row card (持仓卡 + 历史卡共用 .hist-row) */
.hist-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md);
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04); margin-bottom: 9px; width: 100%; text-align: left; font-family: var(--display); color: var(--text); }
button.hist-row { cursor: default; }
button.hist-row.tappable { cursor: pointer; transition: transform .08s, border-color .15s; }
button.hist-row.tappable:hover { border-color: var(--hairline-2); }
button.hist-row.tappable:active { transform: scale(.99); }
button.hist-row.tappable:focus-visible { outline: 2px solid var(--emerald-line); outline-offset: 2px; }

/* circular icon */
.hist-ic { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; overflow: hidden; background: var(--panel-3); color: var(--text-2); }
.hist-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-ic.coin { background: linear-gradient(150deg, #f7931a, #b8690d); color: #fff; }
.hist-ic.dep { background: var(--emerald-soft); color: var(--emerald); }
.hist-ic.wd { background: var(--amber-soft); color: var(--amber); }
.hist-ic.dep svg, .hist-ic.wd svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* middle (title + sub line) */
.hist-mid { flex: 1 1 auto; min-width: 0; }
.hist-mid .t { font-size: var(--t-md); font-weight: 500; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hist-mid .s { font-size: var(--t-sm); color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist-meta { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); }
.hist-tag { font-size: var(--t-xs); font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.hist-tag.up { background: var(--emerald-soft); color: var(--emerald); }
.hist-tag.dn { background: var(--red-soft); color: var(--red); }
.hist-tag.buy { background: var(--emerald-soft); color: var(--emerald); }
.hist-tag.sell { background: rgba(174,187,200,.12); color: var(--text-2); }

/* right (amount + sub) */
.hist-rt { text-align: right; flex: 0 0 auto; min-width: 0; }
.hist-rt .hist-v { font-family: var(--mono); font-size: var(--t-md); font-weight: 700; letter-spacing: -.4px; white-space: nowrap; }
.hist-rt .hist-v.pos { color: var(--emerald); }
.hist-rt .hist-v.neg { color: var(--red); }
.hist-rt .hist-sub { font-size: var(--t-xs); color: var(--faint); margin-top: 4px; font-family: var(--mono); white-space: nowrap; }

/* section header (今天 / 更早) + retry */
.hist-sec { font-size: var(--t-xs); color: var(--faint); margin: 14px 4px 8px; letter-spacing: .04em; }
.hist-sec:first-child { margin-top: 2px; }
.hist-retry { margin: 4px auto 0; display: block; min-height: 38px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-2); background: var(--panel-2); color: var(--text-2); font-family: var(--display); font-weight: 600; cursor: pointer; }
.hist-retry:hover { color: var(--text); }

/* ===== 持仓/历史 扁平化重做(2026-06-16,参考 proto-i/h/f)：无外框、发丝线分隔。
   新类名 .pf-*（持仓明细）/ .hf-*（历史行）, 不动旧 .hist-row / .pos-row（其它页仍用）。 ===== */

/* segment 头一行:左=持仓|历史 切换,右=「全部平仓」轮廓 chip */
.seg-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg-head-row .seg-toggle { flex: 1 1 auto; }
.close-all-chip { flex: 0 0 auto; font-size: 12px; color: var(--text-2); border: 1px solid var(--hairline-2);
  border-radius: 8px; padding: 7px 12px; background: transparent; font-family: var(--display); font-weight: 600; cursor: pointer;
  transition: color .14s ease, border-color .14s ease; white-space: nowrap; }
.close-all-chip:hover { color: var(--text); border-color: var(--hairline-strong); }
.close-all-chip:active { transform: scale(.97); }
.close-all-chip[hidden] { display: none; }
.close-all-chip:focus-visible { outline: 2px solid var(--amber-line); outline-offset: 2px; }

/* ── 持仓明细(.pf-item):无外框、底部发丝线;头(图标+标题/徽章+盈亏/ROI)+2×2 指标+平仓按钮 ── */
.pf-item { padding: 15px 0; border-bottom: 1px solid var(--hairline); }
.pf-item:last-child { border-bottom: none; }
.pf-item.tappable { cursor: pointer; }
.pf-item.tappable:focus-visible { outline: 2px solid var(--emerald-line); outline-offset: 2px; border-radius: var(--r-sm); }
.pf-head { display: flex; gap: 10px; align-items: flex-start; }
.pf-head .hist-ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: 16px; }
.pf-mid { flex: 1 1 auto; min-width: 0; }
.pf-tt { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-chev { color: var(--faint); font-weight: 400; margin-left: 4px; }
.pf-badges { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pf-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.pf-tag.up { background: var(--emerald-soft); color: var(--emerald); }
.pf-tag.dn { background: var(--red-soft); color: var(--red); }
.pf-tag.sell { background: rgba(174,187,200,.12); color: var(--text-2); }
.pf-tag.copy { background: var(--amber-soft); color: var(--amber); }
.pf-rt { flex: 0 0 auto; text-align: right; }
.pf-pl { font-family: var(--mono); font-size: 19px; font-weight: 600; line-height: 1; letter-spacing: -.4px; white-space: nowrap; }
.pf-pl.pos { color: var(--gain); } .pf-pl.neg { color: var(--loss); } .pf-pl.masked { color: var(--muted); }
.pf-roi { font-family: var(--mono); font-size: 12px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.pf-roi.pos { color: var(--gain); } .pf-roi.neg { color: var(--loss); }
.pf-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; margin-top: 12px; }
.pf-m { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.pf-m-l { color: var(--faint); }
.pf-m-v { font-family: var(--mono); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pf-m-v.masked { color: var(--muted); }
.pf-foot { display: flex; justify-content: flex-end; margin-top: 11px; }
.pf-close { padding: 6px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: transparent; border: 1px solid var(--loss-line); color: var(--loss); cursor: pointer;
  font-family: var(--display); transition: background .12s ease; }
.pf-close:hover { background: var(--loss-soft); }
.pf-close:active { transform: scale(.97); }
.pf-close:focus-visible { outline: 2px solid var(--loss-line); outline-offset: 2px; }
/* 兑付/领取按钮——正向操作，用 gain 色而非 loss 色 */
.pf-redeem { padding: 6px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: transparent; border: 1px solid var(--gain-line); color: var(--gain); cursor: pointer;
  font-family: var(--display); transition: background .12s ease; }
.pf-redeem:hover { background: var(--gain-soft); }
.pf-redeem:active { transform: scale(.97); }
.pf-redeem:focus-visible { outline: 2px solid var(--gain-line); outline-offset: 2px; }
.pf-redeem:disabled { opacity: .45; cursor: not-allowed; }
.pf-settled { font-size: 12px; color: var(--gain); margin-top: 9px; }
.pf-settled.lost { color: var(--muted); }
/* 输仓「清除」按钮——中性弱样式(领的是 $0,只是把已结算输仓清出列表) */
.pf-clear { padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font-family: var(--display); transition: background .12s ease, color .12s ease; }
.pf-clear:hover { background: var(--bg-2); color: var(--text); }
.pf-clear:active { transform: scale(.97); }
.pf-clear:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.pf-clear:disabled { opacity: .45; cursor: not-allowed; }
/* 「领取全部」——紧凑次级按钮(替代过于突兀的整宽 primary-action) */
.redeem-all-btn { display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  font-family: var(--display); cursor: pointer; -webkit-appearance: none; appearance: none;
  background: var(--gain-soft); color: var(--gain); border: 1px solid var(--gain-line);
  transition: background .12s ease, transform .08s ease; }
.redeem-all-btn:hover { background: var(--gain-line); }
.redeem-all-btn:active { transform: scale(.97); }
.redeem-all-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 历史行(.hf-item):无外框、底部发丝线;图标+标题/(徽章+份额@价)+右侧 金额/精确时间 ── */
.hf-item { padding: 13px 0; border-bottom: 1px solid var(--hairline); display: flex; gap: 10px; align-items: flex-start; }
.hf-item:last-child { border-bottom: none; }
.hf-item .hist-ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: 16px; }
.hf-mid { flex: 1 1 auto; min-width: 0; }
.hf-t { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hf-sub { margin-top: 5px; display: flex; gap: 7px; align-items: center; font-size: 11px; color: var(--faint); flex-wrap: wrap; }
.hf-meta { font-family: var(--mono); color: var(--muted); }
.hf-qp { font-family: var(--mono); color: var(--text-2); }
.hf-rt { flex: 0 0 auto; text-align: right; min-width: 0; }
.hf-v { font-family: var(--mono); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: -.4px; white-space: nowrap; }
.hf-v.pos { color: var(--gain); } .hf-v.neg { color: var(--loss); } .hf-v.masked { color: var(--muted); }
.hf-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 5px; white-space: nowrap; }

/* ── 挂单行(.of-item):图标 + 方向·选项/限价·成交进度 + 右侧 状态/撤单 ── */
.of-item { padding: 13px 0; border-bottom: 1px solid var(--hairline); display: flex; gap: 10px; align-items: flex-start; }
.of-item:last-child { border-bottom: none; }
.of-item .coin { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: 16px; }
.of-mid { flex: 1 1 auto; min-width: 0; }
.of-t { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-sub { margin-top: 5px; display: flex; gap: 10px; align-items: center; font-size: 11px; flex-wrap: wrap; }
.of-meta { font-family: var(--mono); color: var(--muted); }
.of-rt { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.of-status { font-size: 11px; color: var(--emerald); white-space: nowrap; }
.of-status.part { color: var(--amber, #ffb444); }
.of-cancel { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--red-line); background: transparent; color: var(--red); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.of-cancel:disabled { opacity: .5; cursor: default; }

/* ---- LEADERBOARD (terminal trader cards) ---- */
.lb-intro { padding: 0 4px 2px; }
.lb-intro .h { font-family: var(--display); font-weight: 700; font-size: var(--t-xl); letter-spacing: -.2px; line-height: 1.1; }
.lb-intro .p { font-size: var(--t-sm); color: var(--muted); margin-top: 7px; line-height: 1.5; }
/* ---- 跟谁页 r2: 紧凑可对比的「排行行」(rank · 头像 · 名字+指标 · 大盈亏 · 迷你走势 · 关注) ----
   一行 = grid 两内容行:行1 名字/盈亏,行2 走势/关注;rank+头像跨两行竖向居中。盈亏右对齐成列
   → 可竖向扫读对比挑人。深度信息(成交额明细/链上可信)移到交易员详情页(点整行进入)。 */
.tcard {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  display: grid;
  grid-template-columns: 20px 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank avatar who   pnl"
    "rank avatar spark follow";
  align-items: center; column-gap: 11px; row-gap: 6px; padding: 11px 13px;
  background: linear-gradient(168deg, var(--panel-2) 0%, var(--panel) 80%);
  border: 1px solid var(--hairline-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 32px -26px rgba(0,0,0,.7);
  cursor: pointer; transition: border-color .15s, transform .05s;
}
.tcard.win::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(220px 120px at 100% -30%, rgba(47,227,154,.12), transparent 60%); }
.tcard.lose::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(220px 120px at 100% -30%, rgba(255,93,108,.10), transparent 60%); }
.tcard:hover { border-color: var(--hairline-strong); }
.tcard:active { transform: scale(.997); }
.tcard:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* base .btn-follow + .tavatar are SHARED with the trader-detail follow-bar — keep intact */
.btn-follow {
  flex: 1 1 auto; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-sm); font-family: var(--display); font-weight: 700; font-size: var(--t-md); letter-spacing: .5px; color: var(--ink);
  background: linear-gradient(160deg, var(--emerald), var(--emerald-deep)); border: 1px solid rgba(160,255,210,.4);
  box-shadow: 0 10px 24px -12px var(--emerald-glow), inset 0 1px 0 rgba(255,255,255,.35); cursor: pointer;
  transition: filter .12s, transform .05s;
}
.btn-follow:not(:disabled):hover { filter: brightness(1.05); }
.btn-follow:not(:disabled):active { transform: scale(0.99); }
.btn-follow svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn-follow.block { width: 100%; justify-content: center; }
.tavatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; line-height: 1; border: 1px solid var(--hairline-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
img.tavatar { object-fit: cover; background: var(--panel-strong); }

/* row pieces */
.tcard .trank { grid-area: rank; align-self: center; text-align: center; font-family: var(--mono); font-weight: 800; font-size: 13px; color: var(--faint); }
.tcard .trank.top { color: var(--emerald); }
.tcard .tavatar { grid-area: avatar; align-self: center; flex: none; width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.tcard .twho { grid-area: who; min-width: 0; align-self: center; }
.tcard .twho .tname { font-family: var(--display); font-weight: 700; font-size: var(--t-md); color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.2; }
.tcard .twho .tname .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .twho .tname .vrf { width: 13px; height: 13px; color: var(--emerald); flex: 0 0 13px; }
/* "精选" = a hand-pinned featured trader (overlay on the official board) */
.tcard .twho .tname .tpin { flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  color: var(--emerald); background: rgba(47,227,154,.12); border: 1px solid rgba(47,227,154,.3); border-radius: 6px; padding: 1px 5px; }
/* scale anchor (volume) + social proof (followers) — facts, not skill claims; applyHistory prepends 最高盈利 */
.tcard .twho .tmeta { display: flex; flex-wrap: wrap; gap: 3px 9px; margin-top: 3px; }
.tcard .twho .tmeta:empty { display: none; }
.tcard .twho .tmeta .tm { font-size: var(--t-2xs); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tcard .twho .tmeta .tm-peak { color: var(--text-2); }
.tcard .thero { grid-area: pnl; align-self: center; text-align: right; }
.tcard .thero .v { font-family: var(--mono); font-weight: 800; font-size: 19px; letter-spacing: -.5px; line-height: 1; white-space: nowrap; }
.tcard .thero .v.pos { color: var(--gain); }
.tcard .thero .v.neg { color: var(--loss); }
.tcard .thero .lab { font-size: var(--t-2xs); color: var(--faint); letter-spacing: .4px; margin-top: 4px; text-transform: uppercase; font-family: var(--mono); }
/* NOTE: no `:empty { display:none }` here — the spark starts empty (filled lazily on
   scroll-in); hiding it would give it 0 area so the IntersectionObserver never fires and
   it stays empty forever. No-history sparks are removed outright by applyHistory instead. */
.tcard .tspark { grid-area: spark; align-self: center; min-width: 0; height: 26px; }
.tcard .tspark svg { display: block; width: 100%; height: 26px; }
.tcard .btn-follow { grid-area: follow; align-self: center; flex: none; min-height: 40px; min-width: 78px; padding: 0 12px; gap: 5px;
  font-family: var(--display); font-size: var(--t-sm); letter-spacing: .3px;
  background: transparent; color: var(--emerald); border: 1px solid var(--emerald-line); box-shadow: none; }
.tcard .btn-follow svg { width: 14px; height: 14px; flex: 0 0 14px; }
.tcard .btn-follow:hover { background: var(--emerald-soft); }
.tcard .btn-follow:disabled { opacity: .6; cursor: default; }
/* very narrow screens: shrink the fixed-width consumers (rank / avatar / gap / follow /
   big P&L) so a 7–8-digit pnl can't squeeze the name + sparkline down to nothing. */
@media (max-width: 360px) {
  .tcard { grid-template-columns: 16px 36px minmax(0, 1fr) auto; column-gap: 8px; padding: 11px 11px; }
  .tcard .thero .v { font-size: 16px; }
  .tcard .btn-follow { min-width: 62px; padding: 0 8px; font-size: var(--t-sm); }
}

/* sort chips — the page's explanation of "how to pick", objective copy only */
.sort-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 4px 2px; }
.sort-chips .chip { min-height: 44px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); font-size: 13px; font-weight: 700; }
.sort-chips .chip:hover { color: var(--text); background: var(--panel-strong); }
.sort-chips .chip[aria-pressed="true"] { border-color: var(--emerald); color: var(--text); background: var(--panel-strong); }

/* leaderboard filter — trigger (opens the bottom sheet) + in-sheet groups.
   与排序 chips 视觉分层(#9):chips=实线胶囊(选项),trigger=虚线圆角矩形(打开弹窗的控件) */
/* 排序 chips + 筛选图标 同一行,筛选靠右 */
.lb-controls { display: flex; align-items: center; gap: 8px; margin: 14px 4px 2px; }
.lb-controls .sort-chips { margin: 0; flex: 0 1 auto; min-width: 0; }
.lb-controls .filter-trigger { margin: 0 0 0 auto; flex: 0 0 auto; }
/* 空/错误榜单时 sort-chips 与 filter 都 hidden → 收起空包裹层,免得它的 16px margin
   留一道多余间隙(:has 不支持的老浏览器退化为现状=有间隙,无害)。 */
.lb-controls:not(:has(> *:not([hidden]))) { display: none; }
/* icon-only 漏斗按钮(原来是占整行的虚线文字按钮) */
.filter-trigger { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px;
  padding: 0; border-radius: 10px; cursor: pointer; border: 1px solid var(--hairline-strong);
  background: transparent; color: var(--text-2); }
.filter-trigger::before { content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor;
  -webkit-mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18l-7 8v6l-4-2v-4z'/%3E%3C/svg%3E");
  mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18l-7 8v6l-4-2v-4z'/%3E%3C/svg%3E"); }
.filter-trigger:hover { color: var(--text); background: var(--panel-strong); }
.filter-trigger.on { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-soft); }
.filter-group { margin: 2px 0 14px; }
.filter-group h3 { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }

/* new-user guide band */
.guide-band { margin: 12px 0 2px; border-radius: var(--r-xl); padding: 15px 16px;
  background: radial-gradient(300px 120px at 90% -30%, rgba(47,227,154,.12), transparent 60%), var(--panel-2);
  border: 1px solid var(--hairline-2); }
.guide-band .gb-h { font-family: var(--display); font-weight: 700; font-size: var(--t-md); color: var(--text); }
.guide-band .gb-steps { font-size: var(--t-sm); color: var(--text-2); margin-top: 9px; letter-spacing: .3px; }
.guide-band .gb-note { font-size: var(--t-sm); color: var(--muted); margin-top: 7px; }

/* already-following → "current follow" card (replaces the dead my-pnl pill) */
.follow-now { display: flex; align-items: center; gap: 12px; margin: 12px 0 2px; border-radius: var(--r-lg, 14px);
  padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--hairline-2); text-decoration: none; }
.follow-now .fn-left { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.follow-now .fn-av { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; border: 1px solid var(--hairline-2); }
.follow-now .fn-txt { font-weight: 650; color: var(--text); font-size: var(--t-sm); }
.follow-now .fn-pnl { font-family: var(--mono); font-weight: 700; color: var(--gain); font-size: var(--t-md); flex: 0 0 auto; }
.follow-now .fn-pnl.neg { color: var(--loss); }
/* 「我的跟单盈亏」微标签(#6):给右侧裸数字补语境;颜色中性,数值保持 fn-pnl 的涨跌色 */
.follow-now .fn-pnl .fn-lab { font-family: inherit; font-size: 10px; font-weight: 600; color: var(--faint); letter-spacing: .3px; text-align: right; margin-bottom: 2px; }
.follow-now .fn-pnl .fn-val { text-align: right; }
/* 跟随卡状态点:实盘=涨色点「实盘跟单中」;有跟随对象但未开/已停=「已暂停」 */
.follow-now .fn-status { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: .3px; margin-top: 2px; }
.follow-now .fn-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.follow-now .fn-status.live { color: var(--gain); }
.follow-now .fn-status.paused { color: var(--faint); }

/* empty state with a human next step */
.lb-empty { text-align: center; padding: 30px 18px; }
.lb-empty .h { font-family: var(--display); font-weight: 700; font-size: var(--t-lg, 18px); color: var(--text); }
.lb-empty .p { font-size: var(--t-sm); color: var(--muted); margin-top: 8px; line-height: 1.5; }
.lb-empty-cta { display: inline-block; margin-top: 14px; color: var(--emerald); font-weight: 700; text-decoration: none; }

/* ---- 充值页 redesign (r1): single-line flow + drawers, one safe address ---- */
.primary-action.block, .secondary-action.block { width: 100%; justify-content: center; }
/* ===================== 「我的钱」合并页（盈亏 + 钱包）===================== */
.money-title { font-family: var(--display); font-weight: 800; font-size: var(--t-xl); letter-spacing: -.6px; margin: 2px 4px 4px; }
/* 固定顶部「今日盈亏」大数字。复用 .hero 全局样式；小字行 .sub 渲染「可用现金 · 持仓」。 */
#money-hero { margin-bottom: 4px; }
#money-hero .sub b { font-family: var(--mono); color: var(--text-2); font-weight: 600; }
#money-hero .sub .dot-sep { color: var(--faint); }
/* 分段标签：今日表现 | 钱包管理 */
.money-tabs { display: flex; gap: 8px; margin: 10px 2px 12px; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 4px; }
.money-tabs .mtab { flex: 1 1 0; min-height: 42px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: var(--t-sm); color: var(--muted); background: transparent;
  transition: color .14s ease, background .14s ease; }
.money-tabs .mtab:hover { color: var(--text-2); }
.money-tabs .mtab[aria-selected="true"] { color: var(--text); background: var(--panel-strong); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 16px -12px rgba(0,0,0,.6); }
.money-tabs .mtab:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
/* 面板：用 [hidden] 整面板切换，钱包面板内子元素的 hidden 仍由 app.js 独立管理 */
.money-panel { display: flex; flex-direction: column; gap: 14px; }
.money-panel[hidden] { display: none; }
.money-panel .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.money-panel .panel-head .muted { font-size: var(--t-sm); }
/* ========= 顶部资产区扁平化重做(2026-06-16,参考审批过的 proto-i/f) =========
   无卡片框:总资产标签+眼睛 → hero+今日盈亏 → 大发光面积曲线(常驻、无折叠)+高/低标注
   +时间标签(1周/1月/1年) → 2×2 指标网格 → 一排 充值/提现/跟单 扁平灰按钮。 */
.money-flat { display: flex; flex-direction: column; gap: 0; }
.money-flat #money-hero { margin: 7px 0 3px; }
/* 持仓/历史区:也扁平(去掉外层 work-surface 方块),仅用一条顶部细线与上方分隔(贴近币安列表) */
.holdings-flat { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
/* 持仓|历史 分段切换:在「我的」页用【扁平文字标签】(去掉 pill 方块底),与整页扁平一致;仅 #holdings-seg 生效,不动通用 .seg-toggle */
#holdings-seg { background: transparent; border: 0; border-radius: 0; padding: 0; margin: 12px 0 8px; gap: 18px; flex: 0 0 auto; }
#holdings-seg button { flex: 0 0 auto; padding: 4px 0; font-size: var(--t-md); }
#holdings-seg button.on { background: transparent; color: var(--text); box-shadow: none; }

/* 顶行:总资产估值标签 + 眼睛(隐藏余额) */
.mt-top { display: flex; align-items: center; justify-content: space-between; }
.mt-lbl { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: var(--t-sm); }
.mt-eye { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; background: transparent; cursor: pointer; }
.mt-eye svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; }
.mt-eye .eye-off { display: none; }
.mt-eye.is-hidden .eye-open { display: none; }
.mt-eye.is-hidden .eye-off { display: block; }
.mt-eye:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* hero:总资产大数字 + USD + 今日盈亏行 */
.mt-hero-l { min-width: 0; }
.mt-hero-l .big { font-family: var(--mono); font-weight: 700; font-size: clamp(34px, 11vw, 44px); line-height: 1.04;
  letter-spacing: -.02em; color: var(--text); }
.mt-hero-l .big .cur { font-size: .62em; opacity: .7; margin-right: 2px; }
.mt-hero-l .big .dec { opacity: .55; }
.mt-hero-l .big .u { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.mt-hero-l .big.zero { color: var(--text-2); }
.mt-hero-l .big.masked { font-family: var(--mono); letter-spacing: .04em; color: var(--muted); }
/* 今日盈亏行(绿涨红跌) */
.mt-today { font-size: 14px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mt-today .k { color: var(--faint); }
.mt-today .v, .mt-today .pct { font-family: var(--mono); color: var(--muted); }
.mt-today.pos .v, .mt-today.pos .pct { color: var(--gain); }
.mt-today.neg .v, .mt-today.neg .pct { color: var(--loss); }
.mt-today .ch { color: var(--faint); font-size: 13px; }

/* 大发光面积曲线(常驻可见、~92px 高、全宽)+ 高/低标注 */
.mt-chart-wrap { position: relative; height: 92px; margin: 12px 0 4px; }
.mt-chart-wrap svg { width: 100%; height: 100%; display: block; }
.mt-hi, .mt-lo { position: absolute; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mt-hi { top: 0; right: 2px; } .mt-lo { bottom: 0; left: 2px; }
/* 时间标签行:1周/1月/1年 */
.mt-tabs { display: flex; align-items: center; gap: 7px; margin: 0 0 16px; }
.mt-tab { font-size: 11px; color: var(--faint); padding: 4px 9px; border-radius: 7px;
  border: none; background: transparent; cursor: pointer; font-family: var(--display); font-weight: 600;
  transition: color .14s ease, background .14s ease; }
.mt-tab:hover { color: var(--text-2); }
.mt-tab.active { background: var(--panel-3); color: var(--text); }
.mt-tab:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* 2×2 指标网格(扁平、无卡片框) — 仅作用于钱包页(#pnl-cards),不动通用 .kpis(交易员页也用) */
#pnl-cards.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; margin: 0 0 16px; }
#pnl-cards.kpis .kpi { background: none; border: none; box-shadow: none; padding: 0; overflow: visible; border-radius: 0; }
#pnl-cards.kpis .kpi::after { display: none; content: none; }   /* 去掉通用 .kpi 的左侧色条 */
#pnl-cards.kpis .k-label { font-size: 11px; color: var(--faint); margin-bottom: 3px; gap: 0; }
#pnl-cards.kpis .k-val { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: -.4px; color: var(--text); }
#pnl-cards.kpis .k-val.pos { color: var(--gain); }
#pnl-cards.kpis .k-val.neg { color: var(--loss); }
#pnl-cards.kpis .k-val.masked { color: var(--muted); }
#pnl-cards.kpis .k-val .cur { font-size: 13px; opacity: .6; margin-right: 1px; }

/* 一排操作按钮:充值 / 提现 / 跟单(扁平同灰矩形,无绿色高亮;整排显隐由 app.js 控) */
.money-actions { display: flex; gap: 9px; }
.money-actions[hidden] { display: none; }
.mt-act { flex: 1 1 0; text-align: center; padding: 11px 0; border-radius: 11px;
  font-size: 14px; font-weight: 600; background: var(--panel-3); color: var(--text);
  border: none; cursor: pointer; text-decoration: none; transition: filter .12s ease, transform .1s ease; }
.mt-act:hover { filter: brightness(1.12); }
.mt-act:active { transform: scale(.97); }
.mt-act:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

.balance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px;
  padding: 16px 16px 14px; border-radius: var(--r-xl); background: var(--panel-2); border: 1px solid var(--hairline-2); }
.balance-head .bh-amt span { font-size: var(--t-xs); color: var(--muted); }
.balance-head .bh-amt strong { display: block; font-family: var(--mono); font-weight: 800; font-size: 30px; letter-spacing: -.8px; color: var(--text); margin-top: 4px; line-height: 1; }
.balance-head .bh-amt .field-help { margin-top: 8px; }
.ready-banner { display: block; margin-bottom: 14px; padding: 14px 16px; border-radius: var(--r-lg, 14px); text-decoration: none;
  font-weight: 700; color: #04140d; background: linear-gradient(150deg, var(--emerald, #2fe39a), #1fae78);
  box-shadow: 0 12px 28px -16px rgba(47,227,154,.7); }

/* the fund-safety band: directly above the address, highest contrast, never folds */
.safety-band { margin: 4px 0 14px; padding: 13px 14px; border-radius: 12px; line-height: 1.55;
  font-size: var(--t-sm); color: #2a1c05; font-weight: 600;
  background: linear-gradient(150deg, #ffd877, #f0b232); border: 1px solid #ffe7a8; }
.safety-band b { font-weight: 850; }

/* one Polygon address: QR (light box for scanning) + hex + full-width copy */
.deposit-single-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.deposit-qr { background: #fff; padding: 11px; border-radius: 14px; box-shadow: 0 8px 22px -12px rgba(0,0,0,.7); }
.deposit-qr.qr-unavailable { background: var(--panel-2); color: var(--muted); font-size: 12px; text-align: center; display: grid; place-items: center; min-height: 96px; box-shadow: none; border: 1px solid var(--hairline); }
.deposit-qr svg { display: block; width: 168px; height: 168px; }
.deposit-net { font-size: var(--t-sm); color: var(--text-2); font-weight: 650; }
.deposit-addr { font-family: var(--mono); font-size: var(--t-sm); color: var(--text); word-break: break-all; text-align: center;
  background: var(--panel-3); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; width: 100%; user-select: all; }
.copy-addr-btn { width: 100%; }
.deposit-addr { cursor: pointer; }
/* key actions shouldn't tuck under the fixed bottom nav on scroll-into-view */
.copy-addr-btn, .btn-follow.block { scroll-margin-bottom: 88px; }
.deposit-copy-status { color: var(--emerald); font-size: var(--t-xs); min-height: 14px; }
.deposit-copy-status.error { color: var(--red); }

/* 桥接备注 / 风险提示(后端透传),充值地址下方 */
.deposit-notes { display: flex; flex-direction: column; gap: 6px; }
.deposit-note-line { font-size: var(--t-xs); color: var(--muted); line-height: 1.5; }

/* ===================== 充值独立页 (deposit.html) ===================== */
body[data-page="deposit"] .feed { gap: 16px; }
.dep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 2px 0; }
.dep-head-main { min-width: 0; }
.dep-title { font-size: 24px; font-weight: 800; font-family: var(--display); color: var(--text); margin: 0; }
.dep-balance { font-size: var(--t-sm); color: var(--muted); margin: 4px 0 0; }
.dep-balance strong { color: var(--text); font-weight: 800; font-family: var(--mono); }
.dep-close { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); background: var(--panel-2); border: 1px solid var(--hairline); text-decoration: none;
  font-size: 16px; line-height: 1; cursor: pointer; }
.dep-close:hover { color: var(--text); background: var(--panel-3); border-color: var(--hairline-2); }

.dep-card { display: flex; flex-direction: column; gap: 14px; }
.dep-field { display: flex; flex-direction: column; gap: 6px; }
.dep-label { font-size: var(--t-xs); font-weight: 700; color: var(--text-2); }
.dep-select { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: var(--t-sm); font-weight: 650;
  color: var(--text); background: var(--panel-3); border: 1px solid var(--hairline-2); border-radius: 10px; padding: 11px 36px 11px 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23859ab0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.dep-select:disabled { opacity: .55; cursor: not-allowed; }
.dep-select:focus-visible { outline: none; border-color: var(--emerald-line); }
.dep-min { margin: -4px 0 0; }

/* 醒目红线安全警告:发错链/币 = 永久丢钱 */
.dep-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red); }
.dep-warn-icon { font-size: 16px; line-height: 1.3; flex: none; }
.dep-warn-body { min-width: 0; }
.dep-warn-body strong { display: block; font-size: var(--t-sm); font-weight: 800; color: var(--red); }
.dep-warn-sub { font-size: var(--t-xs); color: var(--red); opacity: .9; margin-top: 3px; line-height: 1.5; }

.dep-state-pill-row { display: flex; justify-content: center; }

.deposit-steps { margin: 16px 0 2px; padding-left: 0; list-style: none; counter-reset: dstep; }
.deposit-steps li { counter-increment: dstep; position: relative; padding: 7px 0 7px 30px; font-size: var(--t-sm); color: var(--text-2); line-height: 1.5; }
.deposit-steps li::before { content: counter(dstep); position: absolute; left: 0; top: 7px; width: 21px; height: 21px;
  border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 800; font-family: var(--mono);
  color: var(--emerald); background: rgba(47,227,154,.12); border: 1px solid rgba(47,227,154,.28); }
.deposit-steps b { color: var(--text); font-weight: 700; }

/* advanced drawers (native <details>) — collapsed by default */
.drawer { border: 1px solid var(--hairline); border-radius: var(--r-lg, 14px); background: var(--panel); margin-top: 10px; overflow: hidden; }
.drawer > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--text-2);
  display: flex; align-items: center; justify-content: space-between; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::after { content: "▸"; color: var(--faint); transition: transform .15s; }
.drawer[open] > summary::after { transform: rotate(90deg); }
.drawer > summary:hover { color: var(--text); }
.drawer .drawer-body { padding: 2px 16px 16px; border-top: 1px solid var(--hairline); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.danger-row strong { display: block; color: var(--text); }
.danger-row small { display: block; color: var(--muted); font-size: var(--t-xs); margin-top: 3px; }

/* copy-ratio quick presets — turns an abstract number into one-tap choices */
.ratio-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ratio-chip {
  min-height: 44px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.ratio-chip:hover { background: var(--panel-strong); color: var(--text); }
.ratio-chip.active { border-color: var(--emerald); color: var(--text); background: var(--panel-strong); }
/* live-locked: don't glow blue / look clickable while disabled */
.ratio-chip:disabled { opacity: .45; cursor: not-allowed; }
.ratio-chip:disabled.active { border-color: var(--line); color: var(--text-2); background: var(--panel-2); }
.lb-disclaim { text-align: center; font-size: var(--t-2xs); color: var(--faint); padding: 4px 18px 2px; line-height: 1.5; }

/* ---- TRADER DETAIL ---- */
.trader-hero {
  border-radius: var(--r-xl); padding: 18px 18px 16px; position: relative; overflow: hidden;
  background: radial-gradient(360px 200px at 80% -30%, rgba(47,227,154,.16), transparent 62%), linear-gradient(165deg, #16202d 0%, #0e141d 78%);
  border: 1px solid var(--hairline-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 22px 46px -28px rgba(0,0,0,.8);
}
.trader-hero .row1 { display: flex; align-items: center; gap: 10px; }
.trader-hero .addr { font-family: var(--mono); font-weight: 600; font-size: var(--t-md); color: var(--text); display: flex; align-items: center; gap: 7px; }
.trader-hero .addr svg { width: 15px; height: 15px; color: var(--emerald); flex: 0 0 15px; }
.trader-hero .lab { font-size: var(--t-sm); color: var(--text-2); margin: 14px 0 2px; }
/* scale down for big whale P&L (7–8 digits) so it never overflows a 320px hero */
.trader-hero .big { font-family: var(--mono); font-weight: 700; font-size: clamp(24px, 8vw, 40px); line-height: 1.05; letter-spacing: -1.2px; max-width: 100%; overflow-wrap: anywhere; }
.pos-row .badge.neutral { color: var(--text-2); background: var(--panel-3); border-color: var(--hairline-2); font-size: var(--t-2xs); }
.follow-bar {
  position: sticky; bottom: 0; margin-top: 4px;
  padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--bg) 60%, transparent);
}

/* ---- LOGIN (terminal) ---- */
/* OTP step secondary actions: resend (with countdown) + change email. Subtle text
   links, but 44px tap targets so a mistyped email / missing code isn't a dead end. */
.login-verify-actions { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); }
.login-link {
  background: none; border: 0; padding: 0 var(--s1); min-height: 44px;
  display: inline-flex; align-items: center;
  color: var(--muted); font-size: var(--t-sm); font-weight: 600; text-decoration: none;
}
.login-link:disabled { color: var(--faint); cursor: not-allowed; opacity: .7; }
.login-link:not(:disabled):active { color: var(--text-2); }
.auth-panel {
  background: linear-gradient(168deg, var(--panel-2), var(--panel));
  border: 1px solid var(--hairline-2); border-radius: var(--r-xl);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05);
}
/* 登录页参考 Gate:去掉卡片包裹，内容直接铺在页面上、顶部对齐、全宽（restricted 等其它页仍保留卡片）。 */
body[data-page="login"] .auth-shell { align-items: start; padding-top: clamp(28px, 9vh, 72px); }
body[data-page="login"] .auth-panel {
  background: none; border: none; border-radius: 0; box-shadow: none; padding: 0; max-width: 400px;
}
/* iOS Safari 对 font-size<16px 的输入框聚焦时会自动放大页面。登录页所有输入框/下拉统一 16px 根治
   （不加 maximum-scale，保留用户手动缩放的无障碍能力）。 */
body[data-page="login"] input, body[data-page="login"] select { font-size: 16px; }
.brand-mark {
  background: linear-gradient(155deg, #1a2433, #0d121b);
  border: 1px solid var(--hairline-2); color: var(--emerald);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-mark svg { width: 22px; height: 22px; }
.auth-tagline { font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1.18; letter-spacing: -.4px; margin: 2px 0 6px; overflow-wrap: anywhere; }
.auth-tagline em { color: var(--emerald); font-style: normal; }
/* Keep the short Chinese phrase on one line, but let longer locales (en/de) wrap
   instead of being clipped by the fixed-width auth panel (was an inline
   white-space:nowrap hard-coded for every language). */
html[lang^="zh"] .auth-tagline span, html[lang^="zh"] .auth-tagline em { white-space: nowrap; }
.auth-lead { font-size: 14px; color: var(--text-2); margin-bottom: 22px; line-height: 1.5; }
.auth-trust { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; color: var(--muted); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); line-height: 1.5; }
.auth-trust svg { width: 16px; height: 16px; color: var(--emerald); flex: 0 0 16px; margin-top: 1px; }
.divider { color: var(--faint); }

/* 邀请码输入（闭测门禁开启时显示）。默认 hidden，app.js 按 /health.inviteGateEnabled 揭示。 */
.invite-field { position: relative; margin: 0 0 16px; }
.invite-field input {
  width: 100%; box-sizing: border-box;
  background: var(--panel-2); border: 1px solid var(--emerald-line); color: var(--text);
  font: inherit; font-size: 15px; letter-spacing: 1px;
  border-radius: var(--r-md); padding: 13px 44px 13px 15px;
}
.invite-field input::placeholder { color: var(--faint); letter-spacing: .3px; }
.invite-field input:focus { outline: none; border-color: var(--emerald); }
.invite-field.invalid input { border-color: var(--red-line); }
.invite-tick { position: absolute; top: 13px; right: 14px; width: 20px; height: 20px; color: var(--emerald); }
.invite-status { font-size: 12px; margin: 7px 2px 0; color: var(--faint); line-height: 1.4; }
.invite-status.error { color: var(--red); }

/* ---- reusable empty/blocked state screen (geo / no-data) ---- */
.state-screen { text-align: center; padding: 18px 4px 4px; }
.state-screen .ss-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; color: var(--amber); background: rgba(255,180,68,.10);
  border: 1px solid rgba(255,180,68,.28); }
.state-screen h2 { font-family: var(--display); font-weight: 700; font-size: var(--t-lg); letter-spacing: -.2px; }
.state-screen .ss-lead { font-size: 14px; color: var(--text-2); line-height: 1.55; margin: 10px 0 0; }
.state-screen .auth-trust { justify-content: flex-start; text-align: left; }

/* ---- ONBOARDING checklist (guided setup) ---- */
.onb-head { padding: 0 4px; }
.onb-head .h { font-family: var(--display); font-weight: 700; font-size: var(--t-xl); letter-spacing: -.2px; }
.onb-head .p { font-size: var(--t-sm); color: var(--muted); margin-top: 6px; }
.onb-prog { display: flex; align-items: center; gap: 10px; padding: 2px 4px 4px; }
.onb-prog .bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--panel-3); overflow: hidden; }
.onb-prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald-deep), var(--emerald)); border-radius: var(--r-pill); transition: width .4s ease; }
.onb-prog .lab { font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.onb-step {
  display: flex; align-items: center; gap: 13px; padding: 15px 16px; border-radius: var(--r-md);
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.onb-step .num {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: var(--t-sm); color: var(--text-2);
  background: var(--panel-3); border: 1px solid var(--hairline-2);
}
.onb-step .body { flex: 1 1 auto; min-width: 0; }
.onb-step .body .t { font-size: var(--t-md); font-weight: 650; color: var(--text); }
.onb-step .body .s { font-size: var(--t-xs); color: var(--muted); margin-top: 3px; }
.onb-step .cta {
  flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); width: auto;
  font-weight: 700; font-size: var(--t-sm); border: 1px solid var(--hairline-2);
  background: var(--panel-3); color: var(--text); text-decoration: none; display: inline-flex; align-items: center;
}
.onb-step.done { border-color: var(--emerald-line); }
.onb-step.done .num { color: var(--ink); background: linear-gradient(160deg, var(--emerald), var(--emerald-deep)); border-color: transparent; }
.onb-step.current { border-color: var(--emerald-line); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px var(--emerald-line), 0 14px 34px -24px var(--emerald-glow); }
.onb-step.current .num { color: var(--ink); background: linear-gradient(160deg, var(--emerald), var(--emerald-deep)); border-color: transparent; }
.onb-step.current .cta { background: linear-gradient(160deg, var(--emerald), var(--emerald-deep)); color: var(--ink); border-color: rgba(160,255,210,.4); box-shadow: 0 8px 18px -10px var(--emerald-glow); }
.onb-step.locked { opacity: .5; }
.onb-step.locked .cta { display: none; }
/* inline deposit panel under the funding step */
.onb-deposit { margin: -4px 0 4px; padding: 14px 15px; border-radius: var(--r-md);
  background: var(--panel-2); border: 1px solid var(--hairline); }
.onb-deposit .dl { font-size: var(--t-xs); color: var(--muted); }
.onb-deposit .da { font-family: var(--mono); font-size: var(--t-sm); color: var(--text);
  word-break: break-all; margin: 6px 0 10px; line-height: 1.4; }
.onb-deposit .cta { min-height: 38px; padding: 0 16px; border-radius: var(--r-sm); font-weight: 700;
  font-size: var(--t-sm); border: 1px solid var(--hairline-2); background: var(--panel-3); color: var(--text);
  display: inline-flex; align-items: center; cursor: pointer; }
.onb-deposit .dw { font-size: var(--t-xs); color: var(--amber); margin-top: 10px; }
.onb-done-card {
  border-radius: var(--r-lg); padding: 20px; text-align: center;
  background: radial-gradient(280px 160px at 50% -20%, rgba(47,227,154,.18), transparent 62%), linear-gradient(165deg, #16202d, #0e141d);
  border: 1px solid var(--emerald-line);
}
.onb-done-card .t { font-family: var(--display); font-weight: 800; font-size: var(--t-lg); color: var(--emerald); }

/* 「我 vs 交易员」持仓对比(#2 持仓透明)。flex-wrap:比例解释文案较长,窄屏让它整体折行而非溢出 */
.master-line { display: flex; justify-content: space-between; align-items: center; gap: 4px 10px; flex-wrap: wrap;
  padding: 9px 12px; margin: 0 0 11px; background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); font-size: 12px; color: var(--text-2); }
.master-line b { color: var(--text); font-weight: 650; }
.master-line .ratio { color: var(--emerald); font-weight: 700; white-space: nowrap; }
.vs { margin: -2px 0 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--hairline); }
.vs-row { display: flex; align-items: center; gap: 9px; margin: 5px 0; }
.vs-row .who { width: 58px; flex: 0 0 58px; font-size: 11px; color: var(--text-2); }
.vs-row .track { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.vs-row .fill { height: 100%; border-radius: 999px; }
.vs-row.master .fill { background: linear-gradient(90deg, var(--amber), var(--amber-deep)); }
.vs-row.mine .fill { background: linear-gradient(90deg, var(--emerald), var(--emerald-deep)); }
.vs-row .amt { width: 72px; flex: 0 0 72px; text-align: right; font: 600 12px/1 var(--mono); color: var(--text); }
/* 每行「对比交易员」小开关：默认收起对比条，点开才显该笔 .vs（.vs[hidden] 本就不显）。 */
.vs-toggle { display: inline-flex; align-items: center; gap: 3px; margin: 2px 0 9px;
  padding: 2px 0; background: none; border: 0; cursor: pointer;
  font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.vs-toggle:hover { color: var(--text-2); }
.vs-toggle.open { color: var(--text-2); }

/* 一键平仓(#3) */
.btn-close { min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--amber-line);
  background: var(--amber-soft); color: var(--amber); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 13px; white-space: nowrap; }
.btn-close:hover { background: rgba(255,180,68,.2); }
.btn-close:active { transform: scale(0.97); }
.btn-close:focus-visible { outline: 2px solid var(--amber-line); outline-offset: 2px; }
.pos-actions { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.closeall { margin: 14px 0 6px; padding: 12px 14px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(20,27,39,.92), rgba(16,21,31,.98));
  border: 1px solid var(--amber-line); display: flex; align-items: center; gap: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.closeall .ca-txt { flex: 1; }
.closeall .ca-txt .h { font-weight: 700; font-size: 14px; }
.closeall .ca-txt .s { font-size: 11px; color: var(--faint); margin-top: 2px; }
.closeall .btn-close { min-height: 42px; font-size: 14px; }
.close-opt { display: flex; align-items: center; gap: 9px; padding: 11px 12px; margin: 8px 0;
  border: 1px solid var(--hairline-2); border-radius: var(--r-sm); background: var(--panel-2); font-size: 13px; cursor: pointer; }
.close-opt.on { border-color: var(--emerald-line); background: var(--emerald-soft); }
.close-opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--faint); flex: 0 0 18px; }
.close-opt.on .dot { border-color: var(--emerald); background: var(--emerald); box-shadow: inset 0 0 0 3px var(--ink); }
.fee-note { font-size: 11px; color: var(--text-2); background: var(--panel-2); border-radius: var(--r-xs); padding: 8px 10px; margin-top: 6px; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 14px; border-radius: 2px; top: -20px; animation: fall 2.4s linear forwards; }
@keyframes fall { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(112vh) rotate(540deg); opacity: .9; } }
.win-sheet { text-align: center; }
.win-sheet .burst { font-size: 46px; line-height: 1; margin-bottom: 8px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.win-sheet .big-win { font: 800 30px/1 var(--display); color: var(--emerald); text-shadow: 0 0 26px var(--emerald-glow); margin: 6px 0; }
.win-sheet .sub { color: var(--text-2); font-size: 13px; }

/* 实盘运行时长 + 心跳/实时感(#11 / #10) */
.ks-uptime { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; flex-wrap: wrap; }
.ks-uptime .lab { font-size: 11px; color: var(--text-2); }
.ks-uptime .clock { font: 700 16px/1 var(--mono); color: var(--emerald); letter-spacing: .02em;
  text-shadow: 0 0 14px var(--emerald-glow); font-variant-numeric: tabular-nums; }
.ks-uptime .clock .tk { animation: tick 1s steps(1) infinite; }
@keyframes tick { 50% { opacity: .35; } }
.ks-uptime .live-num { font: 700 13px/1 var(--mono); font-variant-numeric: tabular-nums; margin-left: auto; }
.ks-uptime .live-num.up { color: var(--gain); } .ks-uptime .live-num.dn { color: var(--loss); }

/* 交易员关键词搜索(#6) */
.lb-search { display: flex; align-items: center; gap: 9px; padding: 0 13px; height: 44px;
  background: var(--panel-2); border: 1px solid var(--hairline-2); border-radius: var(--r-pill); margin-bottom: 11px; }
.lb-search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--emerald-line); }
.lb-search svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--faint); }
.lb-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); outline: none; font-size: 16px; }
.lb-search input::placeholder { color: var(--faint); }

/* 资金不托管声明(主二:钱在你自己手里) */
.custody { padding: 18px; border-radius: var(--r-lg); background: linear-gradient(165deg, var(--panel), var(--panel-2));
  border: 1px solid var(--emerald-line); text-align: center; margin-bottom: 14px; }
.custody .shield { color: var(--emerald); line-height: 0; }
.custody .shield svg { width: 36px; height: 36px; }
.custody .h { font: 800 18px/1.3 var(--display); margin: 8px 0; }
.custody .p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.custody-faq-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 650; color: var(--emerald); text-decoration: none; }
.custody-faq-link:hover { text-decoration: underline; }
.fact-list { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.fact { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r-sm); text-align: left; }
.fact .ic { flex: 0 0 22px; color: var(--text-2); line-height: 0; margin-top: 1px; }
.fact .ic svg { width: 20px; height: 20px; }
.fact .t { font-weight: 650; font-size: 13px; }
.fact .d { font-size: 11px; color: var(--faint); margin-top: 2px; line-height: 1.5; }

/* 视觉隐藏、读屏可见 —— 删页内 h1 后留给可访问性的标题 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 下注 bottom sheet（共享：market.html 详情 + markets.html 列表，逻辑见 bet-sheet.js）──
   内嵌数字键盘不弹系统输入法；position:fixed + margin:auto 贴屏幕底部（showModal 走 backdrop）。 */
dialog.bet-sheet { position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: 100%; max-width: 480px; margin: 0 auto; border: 0; border-radius: 20px 20px 0 0; background: var(--panel-2); padding: 0; max-height: 95dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -4px 40px rgba(0,0,0,.5); }
dialog.bet-sheet::backdrop { background: rgba(4,7,12,.65); }
.bs-drag { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 10px auto 0; }
.bs-tabs { display: flex; align-items: center; padding: 8px 16px 0; }
.bs-tab { flex: 0 0 auto; padding: 8px 14px 9px; font-size: 15px; font-weight: 700; color: var(--muted); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; }
.bs-tab.on { color: var(--text); border-bottom-color: var(--emerald); }
.bs-mktprice { margin-left: auto; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 3px; }
.bs-mktprice svg { width: 14px; height: 14px; }
/* 市价单/限价单 下拉 */
.bs-ordtype-wrap { margin-left: auto; position: relative; }
.bs-ordtype { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-3); }
.bs-ordtype-caret { font-size: 10px; color: var(--muted); }
.bs-ordtype-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 96px; background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; z-index: 5; }
.bs-ordtype-wrap.open .bs-ordtype-menu { display: block; }
.bs-ordtype-opt { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 7px; }
.bs-ordtype-opt:hover { background: var(--panel-3); color: var(--text); }
.bs-ordtype-opt.on { color: var(--emerald); }
/* 限价单 价格输入行 */
.bs-limit { padding: 0 16px 12px; }
.bs-limit-k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bs-limit-box { display: flex; align-items: center; gap: 10px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.bs-limit-step { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bs-limit-step:active { background: var(--panel); }
.bs-limit-pv { flex: 1; text-align: center; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); }
.bs-limit-od { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bs-tab-line { border-bottom: 1px solid var(--line); margin: 0 0 10px; }
.bs-ctx { display: flex; align-items: center; gap: 9px; padding: 0 16px 10px; }
.bs-ctx-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-3); flex: 0 0 30px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bs-ctx-icon img { width: 100%; height: 100%; object-fit: cover; }
.bs-ctx-icon svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.7; }
.bs-ctx-title { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-yn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 16px 12px; }
/* 胶囊单行：Yes 1.33x（保留 绿/红 语义，选中上色、未选灰） */
.bs-yn { padding: 11px 0; border-radius: 999px; text-align: center; border: 0; cursor: pointer; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px; transition: filter .12s; }
.bs-yn-yes { background: var(--emerald-soft); border: 1.5px solid var(--emerald-line); color: var(--emerald); }
.bs-yn-no  { background: var(--red-soft);     border: 1.5px solid var(--red-line);     color: var(--red); }
.bs-yn-idle { background: var(--panel-3); border: 1.5px solid var(--line); color: var(--muted); }
.bs-yn .bs-yn-l { font-size: 14px; font-weight: 700; }
.bs-yn .bs-yn-m { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.bs-amt-wrap { text-align: center; padding: 2px 16px 8px; }
.bs-amt-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bs-amt-big { font-family: var(--mono); font-size: 46px; font-weight: 300; line-height: 1; display: flex; align-items: baseline; justify-content: center; gap: 3px; }
.bs-amt-curr { font-size: 22px; font-weight: 400; color: var(--text-2); }
.bs-amt-num { color: var(--faint); letter-spacing: -1.5px; }
.bs-amt-num.has { color: var(--text); }
.bs-amt-cursor { display: inline-block; width: 2px; height: 38px; background: var(--emerald); border-radius: 1px; margin-bottom: 2px; animation: bscursor 1s step-end infinite; }
@keyframes bscursor { 0%,100%{opacity:1} 50%{opacity:0} }
.bs-increments { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.bs-increments::-webkit-scrollbar { display: none; }
.bs-inc { flex: 0 0 auto; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-3); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.bs-max { color: var(--emerald); border-color: var(--emerald-line); }
.bs-info { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 3px; }
.bs-info-row { display: flex; justify-content: space-between; font-size: 13px; }
.bs-info-k { color: var(--muted); }
.bs-info-v { font-family: var(--mono); font-weight: 600; color: var(--text); }
.bs-info-row { align-items: center; }
/* 余额 X,XXX.XX USDT ⊕ */
.bs-bal-wrap { display: flex; align-items: center; gap: 8px; }
.bs-bal-v { font-family: var(--mono); font-weight: 600; color: var(--text); }
.bs-bal-plus { width: 18px; height: 18px; border-radius: 50%; border: 1.4px solid var(--emerald); color: var(--emerald); display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; text-decoration: none; flex: 0 0 18px; }
/* 获胜可得 X（数值随选中侧上色）*/
.bs-payout-row .bs-info-k { color: var(--text-2); }
.bs-pay-side.y { color: var(--emerald); font-weight: 700; }
.bs-pay-side.n { color: var(--red); font-weight: 700; }
.bs-payout-v { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.bs-payout-v.y { color: var(--emerald); }
.bs-payout-v.n { color: var(--red); }
.bs-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--hairline); border-top: 1px solid var(--hairline); }
.bs-key { background: var(--panel-2); padding: 16px 0; text-align: center; font-size: 20px; font-weight: 400; color: var(--text); cursor: pointer; border: 0; user-select: none; -webkit-user-select: none; }
.bs-key:active { background: var(--panel-3); }
.bs-key-del { font-size: 16px; color: var(--text-2); }
.bs-key-dot { color: var(--text-2); }
.bs-actions { padding: 10px 16px 14px; background: var(--panel-2); }
.bs-buy-btn { width: 100%; padding: 15px; border-radius: 13px; border: 0; background: var(--emerald); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: -.1px; transition: filter .12s; }
.bs-buy-btn:disabled { background: var(--panel-3); color: var(--faint); cursor: default; }
.bs-result { padding: 22px 16px 28px; text-align: center; }
.bs-result-icon { font-size: 40px; margin-bottom: 8px; }
.bs-result-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.bs-result-title.ok { color: var(--emerald); }
.bs-result-title.err { color: var(--red); }
.bs-result-body { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 14px; }
.bs-receipt { background: var(--panel-3); border-radius: 11px; padding: 11px 14px; margin-bottom: 14px; text-align: left; }
.bs-rr { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.bs-rr .k { color: var(--muted); }
.bs-rr .v { font-family: var(--mono); font-weight: 600; color: var(--text); }
.bs-rr .v.g { color: var(--emerald); }
.bs-done-btn { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
