/* One Strategy — Liquid Glass (light).
   Glass ONLY on nav, filter chips, sticky docks, floating status chips.
   Operate content (tables, sparklines, metrics, cards) stays opaque white. */
@font-face {
  font-family: Inter;
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f2f2f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #8e8e93;
  --faint: #aeaeb2;
  --hairline: rgba(20, 20, 40, 0.08);
  --accent: #007aff;
  --accent-soft: #e8f2ff;
  --pos: #1fa971;
  --pos-line: #34c759;
  --neg: #ff3b30;
  --danger: #ff3b30;
  --danger-line: rgba(255, 59, 48, 0.55);
  --orange: #ff9f0a;
  --peach: #fff1e0;
  --shadow: 0 10px 40px rgba(31, 41, 68, 0.08), 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 0 0 1px rgba(20, 20, 40, 0.04);
  --glass: rgba(255, 255, 255, 0.52);
  --glass-line: rgba(255, 255, 255, 0.8);
  --chip: #ffffff;
  --track: rgba(20, 20, 40, 0.05);
  --input: rgba(20, 20, 40, 0.045);
  --hover: #fafafc;
  --grid: #ececf1;
  --ok-bg: #eefbf3;
  --warn-bg: #fff6e8;
  color-scheme: light;
  --page: 1120px;
  --nav: 1160px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { min-height: 100%; background: var(--ground); }
body {
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.45 var(--font);
  background:
    radial-gradient(980px 560px at -8% -12%, rgba(186, 214, 255, 0.95), transparent 62%),
    radial-gradient(860px 520px at 108% -8%, rgba(255, 210, 176, 0.92), transparent 58%),
    radial-gradient(760px 520px at 50% 118%, rgba(214, 206, 255, 0.7), transparent 55%),
    var(--ground);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
body.has-dock { padding-bottom: 96px; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.zh { font-size: 22px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.lead { margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 640px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.strong { font-weight: 650; }
.icon { display: block; flex: none; }
.grow { flex: 1; }

/* ---- glass chrome (nav, chips, docks, status) ---- */
.glass {
  background: rgba(255, 255, 255, 0.64);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.topbar { position: sticky; top: 0; z-index: 40; padding: 16px 20px 8px; }
.nav-bar {
  max-width: var(--nav);
  margin: 0 auto;
  height: 64px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 15px; flex: none; }
.logo-mark {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  flex: none;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.28);
}
.logo-num { display: block; }
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.operate {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 6px;
}
.tabs {
  display: flex;
  background: var(--track);
  border-radius: 999px;
  padding: 3px;
  flex: none;
}
.tab {
  text-decoration: none;
  color: var(--muted);
  font-weight: 550;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--chip); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.search {
  flex: 1;
  min-width: 140px;
  max-width: 280px;
  height: 38px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--input);
  color: var(--muted);
}
.search input {
  all: unset;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
}
.search input::placeholder { color: var(--faint); }
kbd {
  font: 550 11px/1 var(--font);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--chip);
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 5px;
}
.binance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  height: 38px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  background: var(--warn-bg);
  border: 1px solid rgba(255, 159, 10, 0.22);
  flex: none;
}
.binance-chip.ok { background: var(--ok-bg); border-color: rgba(52, 199, 89, 0.28); }
.binance-chip .name { font-weight: 650; font-size: 13px; }
.binance-chip .sub { color: var(--muted); font-size: 13px; font-weight: 450; }
.binance-chip .icon { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.16); }
.dot.ok { background: var(--pos-line); box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18); }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
details.account:not([open]) .menu { display: none; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c1c1e;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 20, 40, 0.12);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.menu a, .menu button {
  all: unset;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu-head { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px; font-size: 13px; }

/* After a pinch zoom-out the visible area is wider than the layout viewport. viewport.ts writes
 * --vv-w / --vv-x; without visualViewport they stay unset and these fall back to the old sizes. */
html, body { min-width: var(--vv-w, 0px); }
.page { max-width: var(--page); margin: 0 auto; padding: 18px 8px 48px; }

/* ---- opaque content cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
}
.card + .card { margin-top: 16px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; }
.chip-bar { display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 550;
  font-size: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.chip .count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(20, 20, 40, 0.06);
  font-size: 11px;
  font-weight: 650;
  display: inline-grid;
  place-items: center;
}
.chip.active { background: var(--accent); color: #fff; }
.chip.active .count { background: rgba(255, 255, 255, 0.28); color: #fff; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.pill-btn, .sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 550;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.pill-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.sort-pill select { all: unset; cursor: pointer; font-weight: 650; color: var(--ink); }

/* ---- strategies table (opaque) ---- */
.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 12px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.table td { padding: 16px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--hover); }
.col-check { width: 44px; padding-left: 18px !important; }
.col-eq { width: 168px; }
.col-num { width: 92px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.table th.col-metric { white-space: nowrap; letter-spacing: 0; line-height: 1.35; }
.table th.col-spark { white-space: normal; letter-spacing: 0.04em; line-height: 1.35; }
.th-sub { display: block; margin-top: 2px; font-size: 10px; font-weight: 550; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover, .table th a.sort-on { color: var(--ink); }
.table th a.sort-on::after { content: " ↓"; }
.col-act { width: 1%; text-align: right; padding-right: 18px !important; }
.check {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 6px;
  border: 1.5px solid var(--faint);
  background: var(--surface);
  display: grid;
  cursor: pointer;
}
.check:checked, .check:indeterminate {
  background-color: var(--accent);
  border-color: var(--accent);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.check:checked { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.2 8.2 6.3 11.4 12.8 4.6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.check:indeterminate { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8h8' stroke='white' stroke-width='2' stroke-linecap='round'/></svg>"); }
.check:disabled { opacity: 0.35; cursor: not-allowed; }
.strat { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.strat-name { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.strat-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--track);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.mark {
  display: inline-grid;
  place-items: center;
  background: var(--peach);
  color: #f0a024;
  flex: none;
}
.mark-sm { width: 32px; height: 32px; border-radius: 10px; }
.mark-md { width: 40px; height: 40px; border-radius: 12px; }
.mark-lg { width: 56px; height: 56px; border-radius: 16px; }
.mark-blend { background: #eef4ff; color: var(--accent); }
.follow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.follow:hover { background: #dcebff; }
.follow:disabled { opacity: 0.6; cursor: progress; }
.table-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px 14px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--hairline);
}
.load-more { display: flex; justify-content: center; padding: 14px 18px; border-top: 1px solid var(--hairline); }
.load-more[hidden] { display: none; }
.table-foot a { color: var(--accent); text-decoration: none; font-weight: 600; }
.disclaimer { margin: 14px 4px 0; color: var(--faint); font-size: 12px; line-height: 1.45; max-width: 920px; }
.spark { display: block; }

/* ---- docks ---- */
.compose-dock[hidden] { display: none; }
.compose-dock {
  position: fixed;
  z-index: 45;
  left: calc(var(--vv-x, 0px) + var(--vv-w, 100%) / 2);
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(var(--vv-w, 100vw) - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  border-radius: 999px;
}
.dock-marks { display: flex; }
.dock-marks .mark { margin-right: -8px; box-shadow: 0 0 0 2px var(--surface); }
.dock-copy { min-width: 0; }
.dock-copy strong { display: block; font-size: 14px; }
.dock-sub { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 40, 0.08);
  background: var(--chip);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(0, 122, 255, 0.28); }
.btn-primary:hover { background: #0071eb; }
.btn-lg { height: 48px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-quiet { background: var(--chip); }

.publish-dock {
  position: fixed;
  z-index: 45;
  left: calc(var(--vv-x, 0px) + var(--vv-w, 100%) / 2);
  bottom: 16px;
  transform: translateX(-50%);
  width: min(var(--page), calc(var(--vv-w, 100vw) - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-radius: 22px;
}
.dock-state { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.dock-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.dock-ico.ready { background: #e9f9ef; color: var(--pos); }
.dock-ico.under { background: #fff4e5; color: #e08a00; }
.dock-ico.over { background: #ffeceb; color: var(--neg); }
.dock-state strong { display: block; font-size: 14px; }
.dock-state span { color: var(--muted); font-size: 12px; }
.mini-bar { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 120px; }
.mini-track { flex: 1; height: 8px; border-radius: 999px; background: #ececf1; display: flex; overflow: hidden; }
.mini-track i { display: block; height: 100%; }
.mini-track i.c0 { background: var(--accent); }
.mini-track i.c1 { background: var(--orange); }
.mini-track i.c2 { background: #af52de; }
.mini-pct { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; min-width: 42px; }
.mini-pct.ok { color: var(--pos); }
.mini-pct.warn { color: #e08a00; }
.mini-pct.bad { color: var(--neg); }
.publish-dock .btn-primary .icon { color: #fff; }
/* over-100% state (Design 04 dock-states) */
.publish-dock.is-over { background: rgba(255, 236, 235, 0.82); border-color: rgba(255, 59, 48, 0.32); box-shadow: 0 10px 30px rgba(255, 59, 48, 0.18); }
.publish-dock.is-over .dock-state strong { color: var(--neg); }
.publish-dock.is-over .mini-track { background: #ffd9d6; }
.publish-dock.is-over .mini-track i, .is-over .alloc-track i { background: var(--neg) !important; }
.publish-dock.is-over .mini-track i + i, .is-over .alloc-track i + i { background: #ff8a80 !important; }
.mini-pct.bad { background: #ffeceb; border-radius: 999px; padding: 3px 8px; text-align: center; }
.publish-dock.is-over .mini-pct.bad { background: var(--neg); color: #fff; }
.is-over .total-pct.bad { background: var(--neg); color: #fff; border-radius: 999px; padding: 3px 8px; }

/* ---- login ---- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; padding: 22px 28px 18px; }
.login-bar { display: flex; align-items: center; justify-content: space-between; }
.login-tools { display: flex; align-items: center; gap: 10px; }
.lang {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: 0 6px 18px rgba(31, 41, 68, 0.06);
}
.lang button {
  border: 0;
  background: transparent;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--chip); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.login-main { flex: 1; display: grid; place-items: center; padding: 24px 0; }
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 28px;
  padding: 32px 32px 22px;
  box-shadow: 0 24px 60px rgba(40, 56, 90, 0.08), 0 0 0 1px rgba(20, 20, 40, 0.04);
  text-align: left;
}
.auth-card .logo-mark { margin-bottom: 18px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.03em; }
.auth-card .lead { margin: 8px 0 22px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.auth-card .btn { width: 100%; margin-bottom: 10px; }
.btn-wechat {
  background: var(--track);
  border-color: transparent;
  color: var(--muted);
  justify-content: center;
  position: relative;
  cursor: not-allowed;
}
.soon-chip {
  margin-left: 8px;
  background: var(--track);
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
}
.auth-rule { border: 0; border-top: 1px solid var(--hairline); margin: 8px 0 16px; }
.feature { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.feature-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
}
.feature-ico.blue { background: var(--accent-soft); color: var(--accent); }
.feature-ico.green { background: #e8f8ee; color: var(--pos); }
.feature strong { display: block; font-size: 14px; margin-bottom: 2px; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.4; }
.legal { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.legal a, .text-link { color: var(--ink-2); text-decoration: none; }
.legal a:hover, .text-link:hover { text-decoration: underline; }
.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 12px;
  padding-top: 8px;
}
.login-foot nav { display: flex; gap: 16px; }
.login-foot a { color: var(--muted); text-decoration: none; }

/* ---- detail ---- */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--accent); }
.detail-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 18px; }
.detail-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.detail-id h1 { font-size: 32px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-summary { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.detail-summary b { color: var(--ink-2); font-weight: 650; }
.detail-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.detail-actions .row { display: flex; gap: 8px; }
.hint { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-main .card + .card { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 0; }
.stat { padding: 14px 18px; }
.stat + .stat { box-shadow: inset 1px 0 0 var(--hairline); }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
/* Sub-lines wrap (long Chinese reasons) instead of widening their column. */
.stat-sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.chart-card { padding: 16px 16px 8px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px 4px; }
.chart-head h2 { font-size: 15px; }
.chart-head .sub { color: var(--muted); font-size: 12px; font-weight: 450; margin-left: 8px; }
.ranges { display: flex; background: var(--track); border-radius: 999px; padding: 3px; }
.ranges button {
  border: 0;
  background: transparent;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.ranges button[aria-pressed="true"] { background: var(--chip); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.ranges button:disabled { opacity: 0.35; cursor: not-allowed; }
.equity { width: 100%; height: auto; display: block; }
.eq-seg { visibility: hidden; }
.eq-seg.on { visibility: visible; }
.trades-card { padding: 16px 16px 8px; }
.trades-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px 4px; }
.trades-head h2 { font-size: 15px; }
.trades-head .sub { color: var(--muted); font-size: 12px; font-weight: 450; margin-left: 8px; }
.trades-actions { display: flex; align-items: center; gap: 10px; }
.trades-summary { color: var(--ink-2); font-size: 13px; margin: 2px 4px 8px; }
.trades-table-wrap { overflow-x: auto; }
.trades-table th, .trades-table td { padding: 10px 12px; font-size: 13px; }
.trades-table th.num, .trades-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.trades-table td.num { white-space: nowrap; }
.trades-table .nowrap { white-space: nowrap; }
.trades-table .ts { white-space: nowrap; }
.dir-tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.dir-long { color: #15803d; background: #ecfdf3; }
.dir-short { color: #dc2626; background: #fef2f2; }
.dir-hedge-open { color: #0369a1; background: #e0f2fe; }
.dir-hedge-close { color: #6d28d9; background: #f3e8ff; }
.dir-hedge { color: #475569; background: #f1f5f9; }
/* Opening action: filled soft background. Closing action: outline only, same colour as the chart mark. */
.dir-pair { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dir-arrow { color: var(--muted); font-size: 12px; }
.dir-tag.dir-close { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.dir-tag.dir-empty { color: var(--faint, #94a3b8); background: transparent; box-shadow: none; border: 1px dashed var(--line-2, #cbd5e1); font-weight: 500; padding: 1px 12px; }
.dir-sub { display: block; color: var(--muted); font-size: 11px; font-weight: 450; white-space: nowrap; }
/* Direction switch of the gold / silver grid (detail page top and the follow dialog). */
.mode-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 4px 0 12px; border-radius: 999px; background: var(--track, var(--chip)); border: 1px solid var(--hairline); max-width: 100%; box-sizing: border-box; }
.mode-seg button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mode-seg button[aria-checked="true"] { background: var(--surface, #fff); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2, var(--hairline)); }
.mode-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.trades-table td.sym, .tc-head .sym { font-weight: 650; }
.trade-cards { display: none; }
.trade-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.tc-ret { font-size: 14px; font-weight: 700; }
.tc-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; flex-wrap: wrap; }
.tc-line .dir-tag { min-width: 52px; text-align: center; box-sizing: border-box; }
.tc-time { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; }
.tc-px { margin-left: auto; font-variant-numeric: tabular-nums; }
.eq-legend-hint .hint-tap { display: none; }
@media (hover: none) {
  .eq-legend-hint .hint-hover { display: none; }
  .eq-legend-hint .hint-tap { display: inline; }
}
@media (max-width: 720px) {
  .trades-table-wrap { display: none; }
  .trade-cards { display: block; margin-top: 4px; }
}
/* iPad / tablet + desktop-beside-sidebar: above the 720px phone-card breakpoint
   the trade list stays a real table. Fixed layout shares the available width
   across columns so the 9-column multi-symbol list never overflows its wrapper —
   in English at 768 and in the ~856px main column left when the 320px sidebar
   sits beside the list on the 1256px page. Headers and date/times wrap; signed %
   values stay on one line with enough room for −100.00% / +100.00%. */
@media (min-width: 721px) {
  .trades-table { table-layout: fixed; }
  .trades-table th, .trades-table td { padding: 8px 8px; font-size: 12px; }
  .trades-table th { white-space: normal; letter-spacing: 0.02em; line-height: 1.3; }
  .trades-table th .sort-dir { white-space: nowrap; }
  .trades-table th .dir-sub { white-space: normal; }
  .trades-table td.ts { white-space: normal; }
  .trades-table td.num { white-space: nowrap; }
  .trades-table td.nowrap { white-space: nowrap; }
  .trades-table .ts-d, .trades-table .ts-t { white-space: nowrap; }
  .trades-table .dir-pair { flex-wrap: wrap; white-space: normal; }
  .trades-table .dir-tag { padding: 2px 6px; }
  .trades-table th.pct, .trades-table td.pct { width: 7.5em; }
}

/* Stack the detail sidebar below the table at tablet widths so the 320px aside
   no longer squeezes the trade list (iPad landscape through iPad Pro portrait). */
@media (min-width: 721px) and (max-width: 1200px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.trade-row { cursor: default; }
.trade-adj td { background: var(--track); }
.trades-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 4px 4px; }
.trades-foot .page-ind { color: var(--muted); font-size: 12.5px; }
.trades-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 4px 10px; }
.daily-card { padding: 10px 18px; }
.daily-card summary { cursor: pointer; font-size: 14px; font-weight: 650; padding: 8px 0; }
.daily-table-wrap { overflow-x: auto; margin-top: 4px; }
.daily-table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.thesis-card { padding: 22px 24px 8px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.thesis-card h2 { font-size: 26px; margin: 8px 0 10px; letter-spacing: -0.03em; }
.thesis-card .body { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; max-width: 720px; }
.params { padding: 18px 18px 8px; }
.params-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.params-head h2 { font-size: 16px; }
.managed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--track);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.p-group { padding: 10px 0 4px; }
.p-kicker { font-size: 11px; font-weight: 750; letter-spacing: 0.08em; }
.p-kicker.blue { color: var(--accent); }
.p-kicker.red { color: var(--neg); }
.p-kicker span { color: var(--ink); letter-spacing: 0; font-weight: 650; margin-left: 6px; font-size: 13px; }
.p-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.p-row dt { color: var(--muted); flex: none; white-space: nowrap; }
/* Values wrap (long data-source lines); labels stay on one line. */
.p-row dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
/* Metric rows (近90天…): the date sits on its own line under the label; the
   number stays on one line with tabular digits. */
.p-row-sub { align-items: center; }
.p-row .p-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-row dd.p-num { flex: none; white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.custody { display: flex; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 12px; padding: 0 4px; }
.custody .icon { margin-top: 2px; }

/* ---- compose ---- */
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr); gap: 16px; align-items: start; }
.compose-main { display: flex; flex-direction: column; gap: 16px; }
.compose-main .card + .card { margin-top: 0; }
.name-card, .weights, .preview { padding: 18px 20px 16px; }
.name-label { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.name-input {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 1.5px solid var(--hairline);
  padding: 0 14px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  background: var(--surface);
  color: var(--ink);
}
.name-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16); outline: none; }
.name-help { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.name-ok { color: var(--pos); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.weights-head, .preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.weights-head p, .when p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.w-table { margin-top: 12px; }
.w-head, .w-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 116px 116px 150px 28px;
  gap: 8px;
  align-items: center;
}
.w-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); padding: 8px 0; }
.w-row { padding: 12px 0; border-top: 1px solid var(--hairline); }
.w-head > span { white-space: nowrap; }
.w-row > .strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.w-name { display: flex; gap: 10px; align-items: center; min-width: 0; }
.w-name > div { min-width: 0; }
.w-name .strat-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.stepper { display: flex; flex-direction: column; gap: 6px; }
.stepper-row { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  padding: 0;
}
.w-input {
  width: 42px;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  text-align: right;
  padding: 0;
}
.w-input:focus { outline: none; }
.w-suffix { font-weight: 700; }
.w-bar { height: 4px; border-radius: 999px; background: #ececf1; overflow: hidden; }
.w-bar i { display: block; height: 100%; border-radius: 999px; }
.w-bar i.c0 { background: var(--accent); }
.w-bar i.c1 { background: var(--orange); }
.icon-x { all: unset; cursor: pointer; color: var(--faint); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.icon-x:hover { background: #f5f5f7; color: var(--ink); }
.total-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.total-label { font-size: 13px; color: var(--muted); width: 110px; flex: none; }
.alloc-track { flex: 1; height: 8px; border-radius: 999px; background: #ececf1; display: flex; overflow: hidden; }
.alloc-track i { display: block; height: 100%; }
.alloc-track i.c0 { background: var(--accent); }
.alloc-track i.c1 { background: var(--orange); }
.total-pct { font-weight: 700; color: var(--pos); display: inline-flex; align-items: center; gap: 4px; min-width: 72px; justify-content: flex-end; }
.total-pct.warn { color: #e08a00; }
.total-pct.bad { color: var(--neg); }
.weights-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pos);
  font-size: 12px;
  font-weight: 650;
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos-line); display: block; }
.preview-top { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin: 8px 0 12px; }
.donut { width: 116px; height: 116px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sw.c0 { background: var(--accent); }
.sw.c1 { background: var(--orange); }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 650; text-align: right; }
.when { margin-top: 8px; }
.when h3 { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.donut text, .equity text { font-family: var(--font); }
.equity text.eq-mark-letter {
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: 9px;
  font-weight: 700;
}
.when li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 13px; margin: 8px 0; list-style: none; }
.when ul { margin: 0; padding: 0; }
.when .icon { color: var(--accent); margin-top: 1px; }
.draft { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* ---- AI stub ---- */
.stub-switch { display: flex; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 3px; box-shadow: 0 6px 18px rgba(31, 41, 68, 0.05); }
.stub-switch a, .stub-switch span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}
.stub-switch .on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.soon-mini { font-size: 10px; letter-spacing: 0.06em; background: #ececf1; color: var(--muted); border-radius: 999px; padding: 2px 6px; font-weight: 700; }
.stub {
  margin-top: 18px;
  border: 1.5px dashed #d2d2d8;
  border-radius: 28px;
  background: var(--glass);
  min-height: 520px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 24px;
}
.stub-inner { max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stub-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.na {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--track);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.stub h2 { font-size: 32px; margin-top: 6px; }
.stub .zh { display: block; margin: 2px 0 8px; font-size: 16px; }
.stub .lead { text-align: center; }
.stub-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---- connect ---- */
.connect-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.8fr); gap: 16px; margin-top: 18px; align-items: start; }
.scopes-card { padding: 8px 8px 4px; }
.scopes-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 12px 14px 8px; }
.scope {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--hairline);
}
.scope-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.scope.off .scope-ico { background: var(--track); color: var(--muted); }
.scope-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.scope p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.locked {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--track);
  border-radius: 999px;
  padding: 2px 6px;
}
.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: #e5e5ea;
  position: relative;
  padding: 0;
  cursor: default;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.switch.on { background: var(--accent); }
.switch.on i { left: 21px; }
.scope-note { display: flex; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 12px 14px 14px; }
.trusts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; padding: 0 6px; }
.trusts h3 { font-size: 14px; margin: 6px 0 4px; }
.trusts p { color: var(--muted); font-size: 13px; line-height: 1.4; }
.trust-ico { width: 28px; height: 28px; color: var(--ink-2); }
.vault { padding: 20px; }
.vault h2 { font-size: 18px; margin-top: 8px; }
.vault .lead { margin: 4px 0 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.step-n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--track);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.steps strong { display: block; font-size: 14px; }
.steps p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.callout {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--ok-bg);
  color: var(--pos);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 16px 0;
  font-weight: 550;
}
.vault .btn { width: 100%; margin-top: 8px; }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; line-height: 1.4; }
.connected-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--pos); font-weight: 650; font-size: 13px; }

/* ---- following ---- */
.follow-dialog select, .ex-modal select {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}
.connection-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.follow-stats { display: flex; gap: 28px; text-align: right; }
.follow-stats span { display: block; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.follow-stats strong { font-size: 20px; font-weight: 700; }
.empty-card { padding: 42px 28px 18px; text-align: center; }
.empty-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.empty-card h2 { font-size: 26px; }
.empty-card .lead { margin: 8px auto 18px; max-width: 520px; text-align: center; }
.empty-actions { display: flex; gap: 10px; justify-content: center; }
.starter-head {
  display: flex;
  justify-content: space-between;
  margin: 28px 8px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
}
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.starter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  text-decoration: none;
  background: var(--hover);
}
.starter:hover { background: var(--surface); }
.starter .meta { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.starter .meta b { display: block; color: var(--ink); font-size: 13px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 22px; padding: 0 8px; }
.how-n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--track);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.how h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.how p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tag-warn {
  font-size: 11px;
  font-weight: 700;
  color: #c87d12;
  background: var(--warn-bg);
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0;
}
.tag-ok { font-size: 11px; font-weight: 700; color: var(--pos); background: var(--ok-bg); border-radius: 999px; padding: 2px 7px; }
.follow-list { margin-top: 16px; }
.follow-list td { font-size: 14px; }

.toast {
  position: fixed;
  left: calc(var(--vv-x, 0px) + var(--vv-w, 100%) / 2);
  bottom: 28px;
  transform: translateX(-50%);
  background: #1c1c1e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 70;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.toast.err { background: var(--neg); }
body.has-dock .toast { bottom: 96px; }

.metric-label { display: none; }
.table-strip[hidden], .table-foot[hidden], .market-table[hidden], .disclaimer[hidden], .search-empty[hidden] { display: none; }
.search-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 20px; }
.search-empty h2 { font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.search-empty p { font-size: 13.5px; color: var(--muted); }
.search-empty .btn { margin-top: 6px; }
.empty-inline { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 980px) {
  .detail-grid, .compose-grid, .connect-grid, .stats, .trusts, .how, .starters { grid-template-columns: 1fr; }
  .stat + .stat { box-shadow: none; border-top: 1px solid var(--hairline); }
  .nav-bar { border-radius: 22px; height: auto; flex-wrap: wrap; padding: 10px; }
  .search { order: 5; max-width: none; flex: 1 1 100%; }
  .detail-head, .page-head, .filters { flex-direction: column; align-items: flex-start; }
  .w-head { display: none; }
  .w-row { grid-template-columns: 1fr auto; }
  .kbd { display: none; }
  h1 { font-size: 28px; }
}

/* frosted glass polish (Design nit 4) */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--track);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  backdrop-filter: blur(40px) saturate(200%);
  border-color: var(--glass-line);
}
.publish-dock, .compose-dock {
  background: var(--glass);
  -webkit-backdrop-filter: blur(44px) saturate(210%);
  backdrop-filter: blur(44px) saturate(210%);
}
.publish-dock.is-over { background: rgba(255, 236, 235, 0.7); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .publish-dock, .compose-dock { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---- Profile > Exchanges. Cards stay opaque; glass stays on the shell. ---- */
.ex-wrap { display: flex; flex-direction: column; gap: 16px; }
.ex-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ex-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.ex-h1 { font-size: 40px; letter-spacing: -0.035em; }
.ex-h1 .zh { font-size: 22px; }
.ex-lead { margin-top: 8px; max-width: 640px; color: var(--muted); }
.ex-stats { display: flex; gap: 28px; margin: 0; }
.ex-stats div { display: flex; flex-direction: column; gap: 4px; }
.ex-stats dt { font-size: 11px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.ex-stats dd { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ex-stats dd.dry { color: #d97706; }
.ex-stats dd.live { color: var(--pos); }
.ex-banner { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; border: 1px solid; }
.ex-banner.dry { color: #9a6700; background: var(--warn-bg); border-color: #f3d7a1; }
.ex-banner.off { color: var(--ink-2); background: var(--surface); border-color: var(--hairline); }
.ex-dry-pill { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid #f3d7a1; border-radius: 999px; padding: 6px 10px; }
.ex-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; }
.ex-who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.ex-nav { display: flex; flex-direction: column; gap: 4px; }
.ex-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.ex-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.ex-nav-item.is-disabled { color: var(--faint); }
.ex-nav-count { margin-left: auto; font-size: 12px; border-radius: 999px; padding: 2px 7px; background: var(--surface); border: 1px solid var(--hairline); }
.ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ex-card { background: var(--surface); border: 1px solid rgba(20, 20, 40, 0.06); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.ex-card-head { display: flex; align-items: center; gap: 12px; }
.ex-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; font-size: 16px; color: #1e2329; flex: none; }
.ex-logo.okx { font-size: 11px; background: #111; color: #fff; }
.ex-logo.binance { background: #f0b90b; }
.ex-logo.bybit { background: #f7a600; }
.ex-logo.bitget { background: #1ee0ac; color: #06281f; }
.ex-title { flex: 1; min-width: 0; }
.ex-title h2 { font-size: 17px; }
.ex-title p { margin-top: 1px; color: var(--muted); font-size: 13px; }
.ex-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; border-radius: 999px; padding: 4px 10px; }
.ex-badge.ok { color: #15803d; background: #ecfdf3; }
.ex-badge.err { color: #dc2626; background: #fef2f2; }
.ex-badge.accent { color: var(--accent); background: var(--accent-soft); }
.ex-empty-note, .ex-wl, .ex-pass-note, .ex-note { color: var(--muted); font-size: 13px; }
.ex-keyline { display: flex; justify-content: space-between; gap: 12px; background: var(--track); border-radius: 14px; padding: 12px 14px; }
.ex-keyline strong { display: block; margin-top: 4px; font-size: 16px; letter-spacing: 0.04em; }
.ex-keyline-end { text-align: right; }
.ex-k { display: block; font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.ex-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ex-chips li { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; }
.ex-chips li.chip-on { color: var(--pos); background: var(--ok-bg); }
.ex-chips li.chip-off { color: var(--ink-2); background: var(--track); }
.ex-chips li.chip-unknown { color: var(--muted); background: var(--track); }
.ex-alert .ex-zh { display: block; margin-top: 4px; }
.ex-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ex-checks li { display: flex; align-items: center; gap: 8px; }
.ex-tick { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: #15803d; }
.ex-tick .icon { width: 12px; height: 12px; }
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-form .field { margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.ex-form .field-label, .ex-form .field-label-row { font-size: 13px; font-weight: 650; }
.ex-form .field-label-row { display: flex; justify-content: space-between; gap: 8px; }
.ex-hint { color: var(--faint); font-weight: 500; font-size: 12px; }
.ex-form .input-affix { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(20, 20, 40, 0.1); background: var(--surface); }
.ex-form .input-affix input { all: unset; flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ex-form .input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18); }
.ex-help, .ex-note { display: flex; gap: 8px; align-items: flex-start; }
.ex-help { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ex-ip { display: flex; align-items: center; gap: 8px; border-radius: 999px; padding: 4px 4px 4px 12px; margin-bottom: 12px; background: var(--accent-soft); font-size: 13px; }
.ex-ip span { flex: 1; }
.ex-alert { border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.ex-alert p { display: flex; gap: 8px; color: #b91c1c; font-size: 13px; font-weight: 600; }
.ex-verifying { display: flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 650; margin-bottom: 10px; }
.ex-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 122, 255, 0.25); border-top-color: var(--accent); animation: ex-spin 0.8s linear infinite; }
@keyframes ex-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ex-spinner { animation: none; } }
.ex-foot { color: var(--muted); font-size: 12px; max-width: 820px; }
.ex-card .btn-accent, .ex-form .btn-accent, .ex-modal .btn-danger {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.ex-card .btn-accent:hover { background: #0071eb; }
.btn-danger-line { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
.ex-modal .btn-danger, .btn-danger { background: #ff3b30; border-color: #ff3b30; color: #fff; }
.ex-skel { min-height: 120px; }
.skel-row { display: flex; gap: 12px; align-items: center; }
.skel-logo, .skel-line { display: block; border-radius: 10px; background: #eef0f3; }
.skel-logo { width: 40px; height: 40px; }
.skel-line { height: 14px; width: 70%; }
.skel-line.short { width: 40%; }
.ex-modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, 0.28); }
.ex-modal { width: min(420px, 100%); background: var(--surface); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.ex-modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #e11d2e; background: #fef2f2; }
.ex-modal-key { display: flex; align-items: center; gap: 10px; border: 1px solid var(--hairline); border-radius: 12px; padding: 8px 10px; }
.ex-modal-key .muted { margin-left: auto; font-size: 12px; }
.ex-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.avatar.lg { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #111; color: #fff; font-weight: 700; }
@media (max-width: 900px) {
  .ex-body, .ex-grid { grid-template-columns: 1fr; }
  .ex-head-row { flex-direction: column; align-items: flex-start; }
}

/* ---- marketplace: risk categories, data status, disabled 跟单 ---- */
.category-filters { margin-top: -4px; justify-content: flex-start; flex-wrap: wrap; }
.chip { white-space: nowrap; }
.strat-name { flex-wrap: wrap; }
.strat-name .badge { letter-spacing: 0.02em; font-size: 11px; }
/* Colours mix with --ink so the same rule reads in light and dark. */
.cat-robust { color: color-mix(in srgb, var(--pos) 80%, var(--ink)); background: color-mix(in srgb, var(--pos) 14%, transparent); }
.cat-balanced { color: color-mix(in srgb, var(--orange) 72%, var(--ink)); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.cat-volatile { color: color-mix(in srgb, var(--neg) 80%, var(--ink)); background: color-mix(in srgb, var(--neg) 13%, transparent); }
.status-badge { color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1px var(--faint); }
.follow.follow-off,
.follow.follow-off:hover { background: var(--track); color: var(--faint); cursor: not-allowed; opacity: 1; }
.row-off .strat-title { color: var(--ink-2); }
/* Detail page: the disabled 跟单 uses the same neutral grey as the list (never a pale primary), at button height. */
.detail-actions .follow { height: 40px; padding: 0 16px; }
.row-off .mark { opacity: 0.55; }
@media (max-width: 720px) {
  .table .col-wide { display: none; }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .table th { white-space: normal; letter-spacing: 0.02em; }
  .col-check { padding-left: 12px !important; width: 32px; }
  .col-num { width: auto; }
  .strat { min-width: 0; gap: 8px; }
  .strat .mark { display: none; }
  .follow { padding: 0 10px; }
  .table .col-narrow { display: none; }
  .chip-bar { max-width: 100%; overflow-x: auto; }
  .chip { padding: 7px 10px; }
  .compose-dock .dock-marks, .compose-dock .dock-sub { display: none; }
  .compose-dock .dock-copy strong { white-space: nowrap; }
}

/* ---- Mobile (≤720px): stacked list rows, no desktop-only chrome ----
   Desktop keeps the table untouched. Below 720px each <tr> becomes a two-line
   card row: [check | name + badges + sub] over [return | drawdown | 跟单]. */
@media (max-width: 980px) {
  kbd { display: none; }
}
@media (max-width: 720px) {
  .topbar { position: static; padding: 10px 10px 4px; }
  .nav-bar { gap: 10px; }
  .page { padding: 12px 10px 32px; }
  body.has-dock { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .compose-dock { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: calc(var(--vv-w, 100vw) - 20px); }
  body.has-dock .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 26px; }
  .lead { font-size: 14px; }

  /* filter chips scroll sideways inside their own bar instead of widening the page */
  .filters { align-items: stretch; margin: 14px 0 10px; }
  .chip-bar { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .chip-bar::-webkit-scrollbar { display: none; }
  .chip { flex: none; min-height: 36px; }
  .filter-actions { flex-wrap: nowrap; gap: 6px; }
  .filter-actions .sort-pill, .filter-actions .pill-btn { padding-left: 10px; padding-right: 10px; font-size: 13px; white-space: nowrap; }
  .sort-pill, .pill-btn { min-height: 40px; }

  .table-card:has(.market-table) { overflow: visible; }
  .market-table, .market-table tbody { display: block; }
  .market-table[hidden] { display: none; }
  .market-table thead { display: none; }
  .market-table tr[data-row] {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas: "check strat strat strat" "check ret dd act";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    padding: 12px 10px 12px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .market-table tr[data-row][hidden] { display: none; }
  .market-table tbody tr:last-child { border-bottom: 0; }
  .market-table td:not(.col-wide) { display: block; padding: 0; border: 0; min-width: 0; width: auto; }
  .market-table tr.clickable:hover td { background: transparent; }
  .market-table td.col-check { grid-area: check; display: grid; place-items: center; align-self: stretch; padding: 0 !important; width: auto; }
  .market-table td.col-strat { grid-area: strat; }
  .market-table td.col-wide { display: none; }
  .market-table td.col-metric:nth-of-type(4) { grid-area: ret; }
  .market-table td.col-metric:nth-of-type(5) { grid-area: dd; }
  .market-table td.col-act { grid-area: act; padding: 0 !important; width: auto; }
  .market-table td.col-metric {
    font-size: 14px;
    line-height: 1.25;
    white-space: normal;
    min-width: 0;
    align-self: start;
    font-variant-numeric: tabular-nums;
  }
  .market-table td.col-metric .metric-label {
    display: block;
    font-family: var(--font);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: break-word;
    margin-bottom: 2px;
  }
  .market-table td.col-metric .metric-val {
    display: inline-block;
    white-space: nowrap;
  }
  .market-table td.col-metric .fee-row-tag {
    display: block;
    width: fit-content;
    margin: 2px 0 0;
    padding: 1px 5px;
    font-size: 10px;
    line-height: 1.25;
  }
  .market-table td.col-metric .fee-row-seed {
    font-size: 10.5px;
    line-height: 1.25;
    margin-top: 1px;
  }
  .col-check .check { position: relative; width: 22px; height: 22px; }
  .col-check .check::after { content: ""; position: absolute; inset: -11px; }
  .strat { min-width: 0; }
  .strat-title { font-size: 16px; line-height: 1.3; overflow-wrap: break-word; word-break: normal; }
  .strat-name { gap: 6px; }
  .strat-sub { font-size: 13px; line-height: 1.35; overflow-wrap: break-word; word-break: normal; }
  .follow { min-height: 44px; padding: 0 11px; gap: 4px; }

  /* detail: trade table scrolls sideways inside its wrapper; nothing in it wraps per glyph */
  .trades-table th, .trades-table td { white-space: nowrap; }
  .trades-head { flex-wrap: wrap; }
  .trades-head .sub, .trades-actions { white-space: nowrap; }

  /* detail: chart head stacks; range chips share one row and never wrap */
  .chart-head { flex-direction: column; align-items: stretch; }
  .ranges { width: 100%; }
  .ranges button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 0 4px; height: 32px; }
  .table-foot { flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
}

/* =====================================================================
   E · 纯黑 + 青柠 (Design canvas "One Strategy · 策略市场重设计").
   Pure-black ground, lime #BCFF2F accent, hairline borders instead of
   shadows / glass, Space Grotesk display, JetBrains Mono numbers & kickers,
   Noto Sans SC body. Dark is the default; the toggle keeps a light variant.
   Everything below overrides the earlier Liquid Glass layer.
   ===================================================================== */
:root[data-theme="dark"],
:root:not([data-theme]) {
  color-scheme: dark;
  --ground: #000000;
  --surface: #0a0a0a;
  --surface-2: #121212;
  --ink: #ffffff;
  --ink-2: #e0e0e0;
  --muted: #969696;
  --faint: #737373;
  --hairline: #1e1e1e;
  --line: #262626;
  --line-2: #2a2a2a;
  --line-3: #383838;
  --accent: #bcff2f;
  --accent-ink: #000000;
  --accent-text: #bcff2f;
  --accent-soft: rgba(188, 255, 47, 0.1);
  --accent-line: rgba(188, 255, 47, 0.35);
  --pos: #9aed2c;
  --pos-line: #9aed2c;
  --neg: #ff5a5f;
  --neg-soft: #ff8a8e;
  --danger: #ff5a5f;
  --danger-line: rgba(255, 90, 95, 0.55);
  --orange: #f5b83d;
  --peach: #141414;
  --shadow: none;
  --glass: rgba(0, 0, 0, 0.9);
  --glass-line: #1e1e1e;
  --chip: #1e1e1e;
  --track: #121212;
  --input: #121212;
  --hover: #111111;
  --grid: #1e1e1e;
  --ok-bg: rgba(154, 237, 44, 0.1);
  --warn-bg: #2a230e;
  --binance: #f0b90b;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f5f6f1;
  --surface: #ffffff;
  --surface-2: #f0f1ec;
  --ink: #0a0a0a;
  --ink-2: #2b2b2b;
  --muted: #5f6368;
  --faint: #6f747a;
  --hairline: #e3e4de;
  --line: #dcddd6;
  --line-2: #d4d5ce;
  --line-3: #c4c5be;
  --accent: #bcff2f;
  --accent-ink: #000000;
  --accent-text: #3f6b00;
  --accent-soft: rgba(120, 180, 0, 0.12);
  --accent-line: rgba(90, 140, 0, 0.4);
  --pos: #2f7d00;
  --pos-line: #4c9a00;
  --neg: #d92d33;
  --neg-soft: #c2373c;
  --danger: #d92d33;
  --danger-line: rgba(217, 45, 51, 0.5);
  --orange: #b7791f;
  --peach: #f0f1ec;
  --shadow: none;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-line: #e3e4de;
  --chip: #ebece6;
  --track: #f0f1ec;
  --input: #f0f1ec;
  --hover: #f7f8f4;
  --grid: #e3e4de;
  --ok-bg: rgba(76, 154, 0, 0.1);
  --warn-bg: #fbf1dc;
  --binance: #c99700;
}
:root {
  --font: "Noto Sans SC", "Space Grotesk", Inter, system-ui, -apple-system, "PingFang SC", sans-serif;
  --display: "Space Grotesk", "Noto Sans SC", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --page: 1256px;
  --nav: 1320px;
}

html[data-theme] { background: var(--ground); }
html[data-theme] body { background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 14px; }
html[data-theme] h1 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
html[data-theme] h2, html[data-theme] h3 { font-family: var(--display); }
html[data-theme] :focus-visible { outline-color: var(--accent); }
html[data-theme] .pos { color: var(--pos); }
html[data-theme] .neg { color: var(--neg); }
html[data-theme] .lead { color: var(--muted); line-height: 1.6; }
html[data-theme] .mono, html[data-theme] .num, html[data-theme] .col-num { font-family: var(--mono); }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; color: var(--accent-text); }

/* no glass anywhere: flat surfaces with hairlines */
html[data-theme] .glass,
html[data-theme] .publish-dock,
html[data-theme] .compose-dock {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

/* ---- top bar: full-width strip, bottom hairline ---- */
html[data-theme] .topbar {
  padding: 0;
  background: var(--glass);
  border-bottom: 1px solid var(--hairline);
}
html[data-theme] .nav-bar {
  max-width: var(--nav);
  height: auto;
  min-height: 68px;
  padding: 14px 32px;
  border-radius: 0;
  border: 0;
  background: transparent;
  gap: 20px;
}
html[data-theme] .brand { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; gap: 10px; color: var(--ink); }
html[data-theme] .logo-mark { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
html[data-theme] .operate {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent-text);
  background: transparent;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 3px 6px;
}
html[data-theme] .tabs { background: transparent; padding: 0; gap: 4px; margin-left: 12px; }
html[data-theme] .tab { color: var(--muted); font-weight: 500; padding: 10px 14px; }
html[data-theme] .tab:hover { color: var(--ink); }
html[data-theme] .tab.active { background: var(--chip); color: var(--ink); box-shadow: none; }
html[data-theme] .search {
  height: 40px;
  max-width: 320px;
  min-width: 200px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
}
html[data-theme] .search input::placeholder { color: var(--faint); }
html[data-theme] kbd { font-family: var(--mono); font-weight: 400; background: transparent; border: 1px solid var(--line-3); border-radius: 4px; color: var(--muted); padding: 2px 6px; }
html[data-theme] .theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
}
html[data-theme] .binance-chip,
html[data-theme] .binance-chip.ok {
  height: 40px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
html[data-theme] .binance-chip .name { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; }
html[data-theme] .binance-chip .sub { font-size: 12px; }
html[data-theme] .dot { width: 7px; height: 7px; background: var(--orange); box-shadow: none; }
html[data-theme] .dot.ok { background: var(--binance); box-shadow: none; }
html[data-theme] .avatar { width: 40px; height: 40px; background: var(--surface-2); border: 1px solid var(--line-3); color: var(--ink); font-family: var(--display); font-weight: 600; }
html[data-theme] .menu { background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); border-radius: 12px; }
html[data-theme] .menu a:hover, html[data-theme] .menu button:hover { background: var(--chip); }

html[data-theme] .page { padding: 40px 32px 48px; }

/* ---- cards & buttons ---- */
html[data-theme] .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
html[data-theme] .btn {
  height: 40px;
  border: 1px solid var(--line-3);
  background: var(--chip);
  color: var(--ink);
  font-weight: 500;
  box-shadow: none;
}
html[data-theme] .btn:hover { background: var(--line-2); }
html[data-theme] .btn-primary,
html[data-theme] .ex-card .btn-accent,
html[data-theme] .ex-form .btn-accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: none;
}
html[data-theme] .btn-primary:hover, html[data-theme] .ex-card .btn-accent:hover { background: #d0ff6a; }
html[data-theme] .btn-primary .icon, html[data-theme] .publish-dock .btn-primary .icon { color: var(--accent-ink); }
html[data-theme] .btn-lg { height: 52px; font-size: 15px; }
html[data-theme] .btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
html[data-theme] .btn-quiet:hover { color: var(--ink); background: transparent; }
html[data-theme] .btn-danger, html[data-theme] .ex-modal .btn-danger { background: var(--neg); border-color: var(--neg); color: #000; }
html[data-theme] .btn-danger-line { background: transparent; }

/* ---- marketplace head ---- */
.market-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.market-head .head-copy { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
html[data-theme] .market-head h1 { font-size: 40px; line-height: 1.1; }
html[data-theme] .market-head .lead { margin: 0; font-size: 15px; }
.head-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 420px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.head-stats > div { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.head-stats > div + div { border-left: 1px solid var(--line); }
.head-stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.head-stats dd { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 500; line-height: 1.5; }
.head-stats dd.big { font-size: 22px; font-weight: 600; line-height: 1.2; }

/* ---- filters ---- */
html[data-theme] .filters { margin: 28px 0 0; flex-wrap: wrap; }
html[data-theme] .chip-bar { padding: 3px; gap: 0; background: var(--surface-2); border: 1px solid var(--line-2); }
html[data-theme] .chip { color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 8px 14px; gap: 8px; }
html[data-theme] .chip .count { all: unset; font-family: var(--mono); font-size: 11px; color: var(--muted); }
html[data-theme] .chip.active { background: var(--ink); color: var(--ground); font-weight: 600; }
html[data-theme] .chip.active .count { color: inherit; opacity: 0.7; background: none; }
/* risk chips: separate outlined pills with a coloured dot */
html[data-theme] .category-filters { margin-top: 12px; gap: 12px; }
html[data-theme] .risk-bar { display: flex; flex-wrap: wrap; gap: 8px; }
html[data-theme] .risk-bar .chip { border: 1px solid var(--line-2); font-size: 13px; padding: 7px 12px; }
html[data-theme] .risk-bar .chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 500; }
html[data-theme] .risk-bar .chip.active .count { color: var(--muted); opacity: 1; }
.risk-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.risk-dot.robust { background: var(--pos); }
.risk-dot.balanced { background: var(--orange); }
.risk-dot.volatile { background: var(--neg); }
html[data-theme] .pill-btn,
html[data-theme] .sort-pill {
  height: 40px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13px;
}
html[data-theme] .sort-pill select { font-weight: 500; color: var(--ink); }
html[data-theme] .sort-pill select option { background: var(--surface); color: var(--ink); }
html[data-theme] .pill-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* ---- table ---- */
html[data-theme] .table-card { margin-top: 20px; }
.table-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.table-strip > span { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); }
html[data-theme] .table th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--muted);
  border-bottom: 0;
}
html[data-theme] .table th a.sort-on { color: var(--ink); }
html[data-theme] .table td { border-bottom: 0; border-top: 1px solid var(--hairline); }
html[data-theme] .table tr.clickable:hover td { background: var(--hover); }
html[data-theme] .market-table tr.row-off { opacity: 0.6; }
html[data-theme] .strat-title { font-weight: 600; font-size: 15px; }
html[data-theme] .strat-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
html[data-theme] .badge {
  height: auto;
  padding: 2px 6px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--line-3);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
}
html[data-theme] .strat-name .badge { font-size: 10px; }
html[data-theme] .cat-badge { font-family: var(--font); font-size: 11px; letter-spacing: 0; border-radius: 999px; padding: 1px 7px; background: transparent; }
html[data-theme] .cat-robust { color: var(--pos); border-color: var(--pos); }
html[data-theme] .cat-balanced { color: var(--orange); border-color: var(--orange); }
html[data-theme] .cat-volatile { color: var(--neg); border-color: var(--neg); }
html[data-theme] .status-badge { box-shadow: none; border: 0; font-family: var(--font); font-size: 11px; color: var(--orange); background: var(--warn-bg); letter-spacing: 0; }
html[data-theme] .status-failed { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); }
html[data-theme] .mark,
html[data-theme] .mark-blend {
  background: var(--peach);
  border: 1px solid var(--line-2);
  color: var(--binance);
}
html[data-theme] .mark-hedge { color: var(--accent-text); }
html[data-theme] .mark-blend { color: #67e8f9; }
html[data-theme] .mark-md { width: 36px; height: 36px; border-radius: 999px; }
html[data-theme] .mark-sm { width: 30px; height: 30px; border-radius: 7px; }
html[data-theme] .mark-lg { border-radius: 14px; }
html[data-theme] .market-table .col-metric { font-family: var(--mono); font-size: 15px; font-weight: 600; text-align: right; }
html[data-theme] .market-table td.col-metric.neg:nth-of-type(5) { color: var(--neg-soft); font-size: 14px; font-weight: 400; }
html[data-theme] .market-table th.col-metric,
html[data-theme] .market-table th.col-num,
html[data-theme] .market-table td.col-num { text-align: right; }
html[data-theme] .market-table td.col-num { font-family: var(--mono); font-weight: 400; }
html[data-theme] .market-table td.col-num:not(.pos):not(.neg) { color: var(--muted); }
html[data-theme] .market-table td.col-metric.ink { color: var(--ink); }
html[data-theme] .follow {
  height: 36px;
  padding: 0 14px;
  gap: 6px;
  border: 1px solid var(--line-3);
  background: var(--chip);
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
}
html[data-theme] .follow:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html[data-theme] .follow.follow-off,
html[data-theme] .follow.follow-off:hover { background: transparent; border-color: var(--line-2); color: var(--faint); }
html[data-theme] a.follow[href="/following"] { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
html[data-theme] .check { border: 1.5px solid var(--line-3); background-color: transparent; border-radius: 4px; width: 16px; height: 16px; }
html[data-theme] .check:checked,
html[data-theme] .check:indeterminate { background-color: var(--accent); border-color: var(--accent); }
html[data-theme] .check:checked { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.2 8.2 6.3 11.4 12.8 4.6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
html[data-theme] .check:indeterminate { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8h8' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>"); }
html[data-theme] .table-foot,
html[data-theme] .load-more { border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; }
html[data-theme] .table-foot > span:last-child { font-family: var(--font); }
html[data-theme] .table-foot a { color: var(--accent-text); }
html[data-theme] .disclaimer { color: var(--faint); line-height: 1.7; margin-top: 20px; max-width: none; }

/* ---- docks ---- */
html[data-theme] .compose-dock {
  bottom: 24px;
  padding: 12px 12px 12px 16px;
  gap: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-3);
  background: color-mix(in srgb, var(--surface-2) 96%, transparent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
html[data-theme] .dock-marks .mark { box-shadow: none; margin-right: -8px; }
html[data-theme] .dock-sub { color: var(--muted); }
html[data-theme] .compose-dock .btn-primary { height: 44px; padding: 0 18px; }
html[data-theme] .publish-dock { border: 1px solid var(--line-3); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 96%, transparent); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
html[data-theme] .publish-dock.is-over { background: color-mix(in srgb, var(--neg) 14%, var(--surface-2)); border-color: var(--danger-line); }
html[data-theme] .mini-track, html[data-theme] .alloc-track, html[data-theme] .w-bar { background: var(--line-2); }
html[data-theme] .mini-track i.c0, html[data-theme] .alloc-track i.c0, html[data-theme] .w-bar i.c0, html[data-theme] .sw.c0 { background: var(--accent); }
html[data-theme] .mini-track i.c1, html[data-theme] .alloc-track i.c1, html[data-theme] .w-bar i.c1, html[data-theme] .sw.c1 { background: #67e8f9; }
html[data-theme] .mini-track i.c2 { background: #c4b5fd; }
html[data-theme] .dock-ico.ready { background: var(--ok-bg); }
html[data-theme] .dock-ico.under { background: var(--warn-bg); color: var(--orange); }
html[data-theme] .dock-ico.over { background: color-mix(in srgb, var(--neg) 14%, transparent); }
html[data-theme] .toast { background: var(--ink); color: var(--ground); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
html[data-theme] .toast.err { background: var(--neg); color: #000; }

/* ---- other screens: retint the blue accents ---- */
html[data-theme] .crumbs a:hover { color: var(--accent-text); }
html[data-theme] .ranges, html[data-theme] .stub-switch { background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: none; }
html[data-theme] .ranges button[aria-pressed="true"], html[data-theme] .stub-switch .on { background: var(--chip); color: var(--ink); box-shadow: none; }
html[data-theme] .stat-label, html[data-theme] .eyebrow, html[data-theme] .p-kicker, html[data-theme] .name-label, html[data-theme] .w-head, html[data-theme] .follow-stats span, html[data-theme] .starter-head, html[data-theme] .ex-kicker { font-family: var(--mono); font-weight: 500; }
html[data-theme] .stat-value, html[data-theme] .follow-stats strong, html[data-theme] .ex-stats dd { font-family: var(--mono); letter-spacing: -0.01em; }
html[data-theme] .p-kicker.blue, html[data-theme] .when .icon, html[data-theme] .ex-verifying { color: var(--accent-text); }
html[data-theme] .stat + .stat { box-shadow: inset 1px 0 0 var(--line); }
html[data-theme] .name-input { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme] .name-input:focus, html[data-theme] .ex-form .input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
html[data-theme] .stepper button { background: var(--surface-2); border-color: var(--line-3); }
html[data-theme] .icon-x:hover { background: var(--chip); }
html[data-theme] .stub { background: var(--surface); border-color: var(--line-2); }
html[data-theme] .stub-ico, html[data-theme] .empty-ico, html[data-theme] .scope-ico, html[data-theme] .feature-ico.blue, html[data-theme] .feature-ico.green { background: var(--accent-soft); color: var(--accent-text); }
html[data-theme] .switch { background: var(--line-3); }
html[data-theme] .switch.on { background: var(--accent); }
html[data-theme] .switch.on i { background: #000; }
html[data-theme] .starter { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme] .starter:hover { border-color: var(--line-3); background: var(--surface); }
html[data-theme] .ex-card { background: var(--surface); border-color: var(--line); box-shadow: none; border-radius: 16px; }
html[data-theme] .ex-nav-item.active, html[data-theme] .ex-badge.accent, html[data-theme] .ex-help, html[data-theme] .ex-ip { background: var(--accent-soft); color: var(--accent-text); }
html[data-theme] .ex-help { color: var(--ink-2); }
html[data-theme] .ex-spinner { border-color: var(--accent-soft); border-top-color: var(--accent); }
html[data-theme] .ex-modal-backdrop { background: rgba(0, 0, 0, 0.6); }
html[data-theme] .ex-modal { background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
html[data-theme] .follow-dialog select, html[data-theme] .ex-modal select { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme] .dir-long { color: var(--pos); background: var(--ok-bg); }
html[data-theme] .dir-short { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); }
html[data-theme] .dir-hedge-open { color: #0284c7; background: color-mix(in srgb, #0284c7 14%, transparent); }
html[data-theme] .dir-hedge-close { color: #7c3aed; background: color-mix(in srgb, #7c3aed 14%, transparent); }
html[data-theme] .dir-hedge { color: var(--ink-2); background: var(--track); }
:root[data-theme="dark"] .dir-hedge-open, :root:not([data-theme]) .dir-hedge-open { color: #38bdf8; }
:root[data-theme="dark"] .dir-hedge-close, :root:not([data-theme]) .dir-hedge-close { color: #c4b5fd; }

/* ---- login (Design: 登录) ---- */
html[data-theme] .login-page { padding: 0; }
html[data-theme] .login-bar { padding: 16px 32px; gap: 16px; }
html[data-theme] .login-bar .brand { color: var(--ink); text-decoration: none; }
html[data-theme] .lang { background: transparent; border: 1px solid var(--line-2); box-shadow: none; }
html[data-theme] .lang button { height: auto; padding: 8px 12px; font-size: 12px; font-weight: 400; color: var(--muted); }
html[data-theme] .lang button[aria-pressed="true"] { background: var(--chip); color: var(--ink); box-shadow: none; }
html[data-theme] .login-tools .theme-toggle { width: 44px; height: 44px; }

/* ---- language control (login, home, signed-in shell): one control, one preference ----
   Three segmented buttons everywhere; on phones (≤560px) the shell and the home swap them for one
   compact button + menu (the login page has room for the three buttons and keeps them). */
.lang-switch { display: flex; align-items: center; flex: none; }
html[data-theme] .lang button:hover:not([aria-pressed="true"]) { color: var(--ink); }
html[data-theme] .lang button { white-space: nowrap; line-height: 1.3; }
.lang-compact { position: relative; display: none; flex: none; }
.lang-compact > button {
  height: 40px;
  padding: 0 12px 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-compact[data-open="true"] > button { border-color: var(--accent-line); color: var(--ink); }
.lang-compact .menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 168px;
  padding: 6px;
  z-index: 30;
}
.lang-compact[data-open="true"] .menu { display: flex; }
.lang-compact .menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.lang-compact .menu button[aria-checked="true"] { color: var(--ink); }
.lang-compact .menu button .icon { color: var(--accent-text); visibility: hidden; }
.lang-compact .menu button[aria-checked="true"] .icon { visibility: visible; }
@media (max-width: 560px) {
  .lang-switch .lang { display: none; }
  .lang-switch .lang-compact { display: block; }
}

/* The signed-in bar gained the language control; the search field gives up some width (it still flexes up to 320px). */
html[data-theme] .nav-bar .search { min-width: 140px; }

/* Below ~1200px the English bar (longest labels) no longer fits on one line: wrap the search to its own row, as the tablet layout does. */
@media (max-width: 1200px) {
  html[data-theme] .nav-bar { flex-wrap: wrap; }
  html[data-theme] .nav-bar .search { order: 8; flex: 1 1 100%; max-width: none; min-width: 0; margin-left: 0; }
}

/* ---- per-language font stacks (<html lang> is zh-Hans / zh-Hant / en) ---- */
html[lang="zh-Hans"] {
  --font: "Noto Sans SC", "Noto Sans CJK SC", "Space Grotesk", Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Space Grotesk", "Noto Sans SC", "Noto Sans CJK SC", Inter, system-ui, sans-serif;
}
html[lang="zh-Hant"] {
  --font: "Noto Sans TC", "Noto Sans CJK TC", "Space Grotesk", Inter, system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --display: "Space Grotesk", "Noto Sans TC", "Noto Sans CJK TC", Inter, system-ui, sans-serif;
}
html[lang="en"] {
  --font: "Space Grotesk", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
}
html[data-theme] .login-main { padding: 40px 20px; }
html[data-theme] .auth-card {
  width: min(440px, 100%);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-head { display: flex; flex-direction: column; gap: 12px; }
.auth-head .kicker { font-size: 11px; letter-spacing: 0.14em; }
html[data-theme] .auth-card h1 { font-size: 30px; letter-spacing: -0.01em; }
html[data-theme] .auth-card .lead { margin: 0; font-size: 15px; line-height: 1.7; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; }
html[data-theme] .auth-card .btn { width: 100%; margin: 0; height: 52px; gap: 10px; }
html[data-theme] .auth-card .btn-primary .google-g path { fill: #000; }
html[data-theme] .btn-wechat { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--faint); font-weight: 400; }
html[data-theme] .soon-chip { background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 0; }
html[data-theme] .auth-rule { margin: 0; border-top-color: var(--hairline); }
.auth-features { display: flex; flex-direction: column; gap: 16px; }
html[data-theme] .feature { margin: 0; gap: 14px; }
html[data-theme] .feature-ico { border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
html[data-theme] .feature strong { font-weight: 600; margin-bottom: 4px; }
html[data-theme] .feature p { color: var(--muted); line-height: 1.6; }
html[data-theme] .legal { margin: 0; color: var(--muted); }
html[data-theme] .legal a { color: var(--accent-text); }
html[data-theme] .login-foot { padding: 20px 32px; color: var(--muted); flex-wrap: wrap; }
html[data-theme] .login-foot a { color: var(--muted); }

/* ---- home (Design: 首页) ---- */
.home { display: flex; flex-direction: column; align-items: center; font-size: 15px; }
.home a { color: inherit; }
.home-wrap { width: 100%; max-width: 1280px; box-sizing: border-box; padding: 0 32px; }
.home-nav { width: 100%; border-bottom: 1px solid var(--hairline); display: flex; justify-content: center; }
.home-nav .home-wrap { padding-top: 14px; padding-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.home-nav .brand { font-size: 17px; }
.home-links { display: flex; flex-wrap: wrap; gap: 4px; }
.home-links a { text-decoration: none; color: var(--muted); padding: 10px 14px; }
.home-links a:hover { color: var(--ink); }
.home-nav-end { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 999px; text-decoration: none; font-weight: 500; background: var(--chip); color: var(--ink); white-space: nowrap; }
.home a.pill { color: var(--ink); }
.home a.pill-accent, .pill-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill-accent .icon { color: var(--accent-ink); }
.pill-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.pill:hover { filter: brightness(1.12); }

.hero { padding-top: 96px; padding-bottom: 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-tag { align-self: flex-start; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 6px 12px; border-radius: 999px; }
.hero h1 { margin: 0; font-family: var(--display); font-size: 84px; line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; }
.hero h1 .line { display: block; }
.hero h1 .typed { display: flex; align-items: center; min-height: 1.1em; color: var(--accent-text); white-space: pre; }
.caret { display: inline-block; width: 0.08em; height: 0.85em; margin-left: 0.06em; background: var(--accent); border-radius: 2px; animation: caretBlink 1s steps(1) infinite; }
.caret-text { color: var(--accent-text); animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret, .caret-text { animation: none; } }
.hero-lead { margin: 0; max-width: 540px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.console { flex: 1 1 480px; min-width: 0; border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); overflow: hidden; }
.console-head, .console-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.console-head { border-bottom: 1px solid var(--hairline); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.console-head > span { display: inline-flex; align-items: center; gap: 8px; }
.console-head .live-dot { background: var(--accent); }
.console-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.code-mark { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 600; }
.code-mark.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 12px; }
.console-row .who { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.console-row .who strong { font-weight: 600; font-size: 15px; }
.console-row .who span, .console-foot { font-size: 12px; color: var(--muted); }
.console-foot { font-size: 13px; }
.console-foot a { text-decoration: none; color: var(--accent-text); font-weight: 500; }
.console-lock { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface); }
.facts > div { padding: 24px 28px; display: flex; flex-direction: column; gap: 8px; }
.facts > div + div { border-left: 1px solid var(--hairline); }
.facts strong { font-family: var(--display); font-size: 32px; font-weight: 700; }
.facts strong small { font-size: 18px; color: var(--muted); font-weight: 700; }
.facts span { font-size: 13px; color: var(--muted); }

.home-section { padding-top: 120px; display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.home h2 { margin: 0; font-family: var(--display); font-size: 44px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.way { border: 1px solid var(--hairline); border-radius: 24px; background: var(--surface); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.way.ai { border-color: var(--accent-line); }
.way-top { display: flex; align-items: center; justify-content: space-between; }
.way-top .kicker { font-size: 13px; letter-spacing: 0; }
.way-tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.way-tag.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.way h3 { margin: 0 0 10px; font-family: var(--font); font-size: 26px; font-weight: 700; }
.way p { margin: 0; color: var(--muted); line-height: 1.7; }
.way-demo { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.step-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--chip); border: 1px solid var(--line-3); font-family: var(--mono); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-dot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step div { display: flex; flex-direction: column; gap: 2px; }
.step strong { font-size: 14px; font-weight: 600; }
.step span { font-size: 12px; color: var(--muted); }
.demo-box { margin-top: auto; border-radius: 16px; background: var(--surface-2); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.alloc { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.alloc i { display: block; }
.w-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.w-line .name { flex: 1; }
.w-line .val { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-3); border-radius: 10px; background: var(--surface); padding: 0 10px; height: 36px; font-family: var(--mono); font-size: 14px; }
.w-line .val span { color: var(--muted); font-size: 13px; }
.w-total { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--hairline); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.w-total b { color: var(--accent-text); font-weight: 500; }
.ai-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.ai-prompt { background: var(--surface); border: 1px solid var(--line-3); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.6; }
.ai-steps { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ai-steps span { display: flex; gap: 8px; }
.ai-steps .ok { color: var(--accent-text); }
.ai-steps .now { color: var(--ink); }
.way .pill { width: 100%; height: 48px; padding: 0; }
.risk-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.risk-legend span { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; }
.basics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.basic { border: 1px solid var(--hairline); border-radius: 20px; background: var(--surface); padding: 28px; display: flex; flex-direction: column; gap: 14px; min-height: 200px; }
.basic h3 { margin: 0; font-family: var(--font); font-size: 20px; font-weight: 600; }
.basic p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.safety { border: 1px solid var(--hairline); border-radius: 24px; background: var(--surface); padding: 56px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.safety > div { flex: 1 1 420px; display: flex; flex-direction: column; }
.safety-copy { gap: 16px; }
.safety-copy h2 { font-size: 40px; line-height: 1.2; }
.safety-copy p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 16px; }
.safety-list { gap: 12px; }
.safety-item { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: 16px; background: var(--surface-2); color: var(--accent-text); }
.safety-item div { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.safety-item strong { font-weight: 600; }
.safety-item span { color: var(--muted); font-size: 14px; line-height: 1.6; }
.home-cta { padding-top: 120px; padding-bottom: 120px; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.home-cta h2 { font-size: 52px; line-height: 1.1; }
.home-cta p { margin: 0; color: var(--muted); font-size: 17px; }
.home-foot { width: 100%; border-top: 1px solid var(--hairline); display: flex; justify-content: center; }
.home-foot .home-wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.home-foot nav { display: flex; gap: 20px; }
.home-foot a { color: var(--muted); text-decoration: none; }

@media (max-width: 1100px) {
  .head-stats { min-width: 0; width: 100%; }
  .ways, .basics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; }
  .facts > div:nth-child(n + 3) { border-top: 1px solid var(--hairline); }
}
@media (max-width: 980px) {
  html[data-theme] .nav-bar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; border-radius: 0; }
  html[data-theme] .tabs { margin-left: 0; }
  html[data-theme] .search { max-width: none; min-width: 0; }
  html[data-theme] .page { padding: 28px 16px 40px; }
  .hero h1 { font-size: 60px; }
}
@media (max-width: 720px) {
  html[data-theme] .topbar { position: static; }
  html[data-theme] .market-head h1 { font-size: 30px; }
  /* Phone: compact header so the first strategy row clears the compose dock. */
  html[data-theme] .page { padding-top: 16px; }
  html[data-theme] .market-head { gap: 10px; }
  html[data-theme] .market-head .lead { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html[data-theme] .market-head .kicker { display: none; }
  .head-stats { display: none; }
  html[data-theme] .filters { margin-top: 14px; }
  html[data-theme] .category-filters { margin-top: 8px; gap: 8px; }
  html[data-theme] .table-card { margin-top: 12px; }
  html[data-theme] .market-table tr[data-row] { border-bottom: 0; border-top: 1px solid var(--hairline); }
  html[data-theme] .market-table td { border-top: 0; }
  html[data-theme] .market-table tr.clickable:hover td { background: transparent; }
  html[data-theme] .market-table td.col-metric { font-size: 14px; text-align: left; }
  html[data-theme] .market-table .follow { padding: 0 11px; gap: 4px; font-size: 12.5px; }
  html[data-theme] .compose-dock { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: calc(var(--vv-w, 100vw) - 20px); }
  .account .menu { max-width: calc(var(--vv-w, 100vw) - 24px); }
  .publish-dock {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(var(--vv-w, 100vw) - 20px);
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px;
  }
  .publish-dock .dock-state { min-width: 0; flex: 1 1 100%; }
  .publish-dock .mini-bar { display: none; }
  .publish-dock .btn { flex: 1 1 auto; }
  body.has-dock:has(.publish-dock) { padding-bottom: calc(156px + env(safe-area-inset-bottom, 0px)); }
  .table-strip > span:last-child { display: none; }
  .home-wrap { padding: 0 16px; }
  .home-links { display: none; }
  .home-nav-end .pill { height: 44px; padding: 0 16px; }
  .hero { padding-top: 56px; padding-bottom: 48px; gap: 40px; }
  .hero h1 { font-size: 46px; }
  .hero-lead { font-size: 16px; }
  .console-row svg { display: none; }
  .ways, .basics, .facts { grid-template-columns: 1fr; }
  .facts > div + div { border-left: 0; border-top: 1px solid var(--hairline); }
  .home h2 { font-size: 32px; }
  .home-section { padding-top: 80px; }
  .safety { padding: 28px 20px; gap: 28px; }
  .safety > div { flex-basis: 100%; }
  .safety-copy h2 { font-size: 30px; }
  .home-cta { padding-top: 80px; padding-bottom: 80px; }
  .home-cta h2 { font-size: 36px; }
  html[data-theme] .auth-card { padding: 28px 22px; }
  html[data-theme] .login-bar, html[data-theme] .login-foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 640px) {
  .account .menu { left: 0; right: auto; }
}

/* Exchange permission chips: keep on / off / unknown distinct (the E layer must not flatten them). */
html[data-theme] .ex-chips li { background: var(--accent-soft); color: var(--accent-text); }
html[data-theme] .ex-chips li.chip-on { color: var(--pos); background: var(--ok-bg); }
html[data-theme] .ex-chips li.chip-off { color: var(--ink-2); background: var(--track); border: 1px solid var(--line-2); }
html[data-theme] .ex-chips li.chip-unknown { color: var(--muted); background: transparent; border: 1px dashed var(--line-3); }

/* Dark-mode status colors for the exchange pages (previously in the removed legacy dark block). */
:root[data-theme="dark"] .ex-banner.dry, :root[data-theme="dark"] .tag-warn { background: var(--warn-bg); color: #f5d78a; border-color: #6b5316; }
:root[data-theme="dark"] .ex-alert, :root[data-theme="dark"] .ex-badge.err, :root[data-theme="dark"] .ex-modal-icon { background: #2a1416; border-color: #5c2a32; color: #fca5a5; }
:root[data-theme="dark"] .ex-alert p { color: #fca5a5; }
:root[data-theme="dark"] .ex-badge.ok, :root[data-theme="dark"] .ex-tick { background: var(--ok-bg); color: var(--pos); }
:root[data-theme="dark"] .ex-keyline, :root[data-theme="dark"] .skel-logo, :root[data-theme="dark"] .skel-line, :root[data-theme="dark"] .ex-form .input-affix { background: var(--surface-2); border-color: var(--line-2); }
:root[data-theme="dark"] .avatar.lg, :root[data-theme="dark"] .ex-logo.okx { background: #f4f5f7; color: #111; }

/* 成分: pie of each leg's published weight, in the 策略逻辑 card. */
.constituents { display: flex; align-items: center; gap: 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.constituents h3 { font-size: 14px; margin-bottom: 8px; }
.constituents .pie { display: block; color: var(--ink, #fff); }
.constituents .legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 200px; flex: 1; }
.constituents .legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.constituents .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.constituents .leg-name { flex: 1; }
.constituents .leg-pct { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---- Detail equity curve: K-line hover, mobile readout bar, legend, newest-first trades ---- */
.eq-stage {
  position: relative;
  touch-action: pan-y pinch-zoom;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}
.eq-hover[hidden] { display: none; }
.eq-xhair-v, .eq-xhair-h {
  stroke: var(--line-3, #666);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  pointer-events: none;
}
.eq-halo { fill: var(--accent); opacity: 0.22; pointer-events: none; }
.eq-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.eq-ylab-bg { fill: var(--accent); }
.eq-ylab-txt {
  fill: var(--accent-ink, #000);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}
.eq-xlab-bg { fill: var(--surface-2, #121212); stroke: var(--line-3, #383838); stroke-width: 1; }
.eq-xlab-txt {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.eq-tip[hidden], .eq-readout[hidden] { display: none; }
.eq-tip {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  min-width: 196px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2, #121212);
  border: 1px solid var(--line-3, #383838);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] .eq-tip {
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.eq-tip-head, .eq-ro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.eq-tip-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}
.eq-tip-date, .eq-ro-date {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.eq-tip-cal, .eq-ro-cal {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2, #2a2a2a);
  background: var(--surface, #0a0a0a);
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
}
:root[data-theme="light"] .eq-tip-cal,
:root[data-theme="light"] .eq-ro-cal {
  background: var(--surface-2);
}
.eq-tip-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eq-tip-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
}
.eq-tip-rows dt { color: var(--muted); }
.eq-tip-rows dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.eq-tip-rows dd.pos, .eq-ro-vals .pos { color: var(--pos); }
.eq-tip-rows dd.neg, .eq-ro-vals .neg { color: var(--neg); }

.eq-readout {
  margin: 6px 0 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2, #121212);
  border: 1px solid var(--line-2, #2a2a2a);
}
.eq-ro-vals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 12.5px;
}
.eq-ro-k { color: var(--muted); margin-right: 2px; }
.eq-ro-vals b { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }

.eq-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 4px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-2);
}
.eq-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.eq-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ls-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  box-sizing: border-box;
  border-radius: 2.5px;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  flex: none;
}
.ls-swatch.s { background: #ff5a5f; color: #fff; }
.ls-swatch.l { background: #9aed2c; color: #111; }
.ls-swatch.ho { background: #0284c7; color: #fff; font-family: var(--font); font-size: 9px; }
.ls-swatch.hc { background: #7c3aed; color: #fff; font-family: var(--font); font-size: 9px; }
.eq-leg-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--line-2, var(--hairline));
}
.eq-leg-latest { color: var(--muted); }
.eq-leg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pos-line);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--pos-line) 55%, transparent);
}
.eq-legend-hint {
  color: var(--faint);
  font-size: 12px;
}

.trades-table th .sort-dir {
  color: var(--accent-text, var(--accent));
  font-weight: 700;
}

@media (max-width: 720px) {
  .eq-tip { display: none !important; }
  .eq-xhair-h { display: none; }
  .eq-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ---- 现货比特币对比 (detail overlay) ---- */
:root { --btc-line: #fa660f; }
.chart-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.btc-cap-slot { display: inline-flex; }
.btc-cap {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
  border: 1px solid var(--hairline); color: var(--muted);
}
.btc-cap.pos { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 45%, transparent); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.btc-cap.neg { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, transparent); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.stat-kpi { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.stat-kpi .stat-value { font-size: 22px; }
.btc-none .stat-value { color: var(--muted); }
.eq-dot-btc { fill: var(--btc-line); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.eq-leg-line { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--btc-line); border-radius: 2px; }
.eq-leg-line.dashed { border-top-style: dashed; }
.eq-tip-btc { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hairline); }
.btc-k { color: var(--btc-line) !important; }
.eq-tip-none, .eq-ro-none { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 12px; }
.eq-ro-btc { margin-top: 4px; }
.eq-tip-rows dd.pos { color: var(--pos); }
.eq-tip-rows dd.neg { color: var(--neg); }
.eq-ro-vals .pos { color: var(--pos); }
.eq-ro-vals .neg { color: var(--neg); }

/* ---- 策略对比 ---- */
.cmp-pick {
  display: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--line-3, #666); background: transparent; position: relative;
}
.cmp-pick::after { content: ""; position: absolute; inset: -10px; }
.cmp-pick.is-on { border-color: var(--pick, var(--accent)); background: var(--pick, var(--accent)); box-shadow: inset 0 0 0 3px var(--surface); }
.cmp-pick:disabled { opacity: 0.3; cursor: not-allowed; }
.cmp-mode .col-check .check, .cmp-mode [data-select-all] { display: none; }
.cmp-mode .col-check .cmp-pick, .cmp-mode .cmp-cell .cmp-pick { display: inline-block; }
/* The dot and the short column header sit in the checkbox's box. A wider
   column would wrap title + tags that previously fit on one line. */
.check-slot { display: contents; }
.cmp-col-head { display: none; }
@media (min-width: 721px) {
  .table .check-slot { display: inline-block; position: relative; width: 16px; height: 16px; vertical-align: middle; }
  .table .check-slot > .check { position: absolute; left: 0; top: 0; }
  .cmp-mode .table .check-slot > .cmp-pick { position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
  .cmp-mode .table .cmp-col-head {
    display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    white-space: nowrap; letter-spacing: 0; line-height: 1; pointer-events: none;
  }
}
.cmp-cell { display: none; }
.cmp-mode .cmp-cell { display: table-cell; }
.cmp-toggle[aria-pressed="true"] { color: var(--accent-text, var(--accent)); border-color: var(--accent-line, var(--accent)); }
.cmp-bar { margin: 0 0 10px; }
.cmp-mode tr.row-off .cmp-pick { opacity: 0.3; }
.cmp-dock[hidden] { display: none; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.cmp-chip, .cmp-add select {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2, var(--hairline)); background: var(--surface-2, var(--chip)); color: var(--ink); font-size: 13px;
}
.cmp-add select { padding: 0 12px; cursor: pointer; }
.cmp-add.is-off select { opacity: 0.45; cursor: not-allowed; }
.cmp-chip-x { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.cmp-chip-x:disabled { opacity: 0.3; cursor: not-allowed; }
.cmp-dot-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cmp-note { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.cmp-ro-rows, .cmp-ro-rows > div { margin: 0; }
.cmp-ro-rows > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 2px 0; }
.cmp-ro-rows dt { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.cmp-ro-rows dd { margin: 0; font-weight: 650; }
.cmp-ro-rows dd.pos, .eq-tip-rows dd.pos { color: var(--pos); }
.cmp-ro-rows dd.neg { color: var(--neg); }
.eq-tip-rows dt { display: inline-flex; align-items: center; gap: 6px; }
.cmp-table-card { margin-top: 14px; padding: 6px 4px; overflow-x: auto; }
.cmp-table td.pos, .cmp-table td.neg { font-weight: 650; }
.cmp-table td.pos { color: var(--pos); }
.cmp-table td.neg { color: var(--neg); }
.cmp-hover[hidden] { display: none; }
@media (max-width: 720px) {
  .cmp-hover .eq-xhair-v { display: block; }
  .cmp-dock {
    width: calc(var(--vv-w, 100vw) - 20px);
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
    align-items: stretch;
    row-gap: 8px;
    column-gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }
  html[data-theme] .cmp-dock { padding: 10px; gap: 8px; }
  .cmp-dock .dock-sub, .cmp-dock .grow { display: none; }
  .cmp-dock .dock-copy { flex: 1 1 100%; min-width: 0; }
  .cmp-dock .dock-copy strong { overflow: hidden; text-overflow: ellipsis; }
  html[data-theme] .cmp-dock .btn, .cmp-dock .btn {
    flex: 1 1 calc(50% - 4px);
    max-width: calc(50% - 4px);
    height: 40px;
    padding: 0 10px;
  }
  .cmp-dock [data-cmp-start] { flex: 1 1 100%; max-width: none; min-width: 100%; }
  /* The wrapped bar is three rows. The shared has-dock padding is sized for one row. */
  body.has-dock:has(.cmp-dock:not([hidden])) { padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Profile > Fees (手续费) + personalized-fee disclosure ---- */
.ex-nav-zh { margin-left: 2px; font-size: 11px; font-weight: 500; color: var(--muted); }
.fee-card { gap: 14px; }
.fee-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fee-card-head h2 { font-size: 17px; }
.fee-card-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.fee-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 650; border-radius: 999px; padding: 4px 10px; color: var(--accent-text, var(--accent)); background: var(--accent-soft); }
.fee-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fee-badge.bn { color: #b8860b; background: var(--warn-bg); }
.fee-badge.cu { color: color-mix(in srgb, var(--orange) 80%, var(--ink)); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.fee-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fee-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--track); color: var(--ink); font: inherit; cursor: pointer; }
.fee-opt b { font-size: 15px; }
.fee-opt span:last-child { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.fee-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.fee-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-text, var(--accent)); }
.fee-tag.bnb { color: #f0b90b; }
.fee-tag.cu { color: var(--orange); }
.fee-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fee-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fee-field label { font-size: 13px; font-weight: 650; }
.fee-unit { color: var(--faint); font-weight: 500; }
.fee-input { display: flex; align-items: center; gap: 6px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--track); padding: 0 12px; }
.fee-input:focus-within { border-color: var(--accent); }
.fee-input input { flex: 1; min-width: 0; height: 42px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; }
.fee-input.chg { border-color: var(--orange); }
.fee-input.err { border-color: var(--neg); background: color-mix(in srgb, var(--neg) 8%, var(--track)); }
.fee-pct { color: var(--muted); }
.fee-def { margin: 0; font-size: 12px; color: var(--muted); }
.fee-def.diff { color: var(--orange); }
.fee-msg { margin: 0; font-size: 12px; font-weight: 600; color: var(--neg); }
.fee-reserved { margin: 0; font-size: 11px; color: var(--faint); }
.fee-rt, .fee-fixed { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.fee-rt b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fee-alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; font-size: 14px; border: 1px solid color-mix(in srgb, var(--neg) 45%, transparent); background: color-mix(in srgb, var(--neg) 8%, transparent); color: var(--ink); }
.fee-alert[hidden] { display: none; }
.fee-alert-ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--neg); color: #fff; }
.fee-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.fee-actions .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.fee-hint { color: var(--muted); font-size: 13px; }
/* Detail page: whose fees these numbers use. */
.fee-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--accent-soft); font-size: 13.5px; line-height: 1.5; }
.fee-notice.quiet { background: var(--track); }
.fee-notice p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fee-notice-ico { flex: none; margin-top: 2px; color: var(--accent-text, var(--accent)); }
.fee-notice a { text-decoration: underline; }
/* List rows: 「按你的费率」 + the official rate value. */
.fee-row-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; color: var(--accent-text, var(--accent)); background: var(--accent-soft); vertical-align: middle; }
.fee-row-seed { display: block; font-size: 11px; font-weight: 450; color: var(--muted); white-space: nowrap; }

/* ---- Topbar explicit 3-row mobile layout (desktop stays a single bar) ---- */
.nav-row-1,
.nav-row-2,
.nav-row-2-end { display: contents; }
.nav-bar .brand { order: 1; }
.nav-bar .tabs { order: 2; }
.nav-bar .search { order: 3; }
.nav-bar .theme-toggle { order: 4; }
.nav-bar.no-search .theme-toggle { margin-left: auto; }
.nav-bar .lang-switch { order: 5; }
.nav-bar .binance-chip { order: 6; }
.nav-bar .account { order: 7; }

@media (max-width: 980px) {
  html[data-theme] .nav-bar,
  .nav-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 0;
  }
  .nav-bar .brand,
  .nav-bar .tabs,
  .nav-bar .search,
  .nav-bar .theme-toggle,
  .nav-bar .lang-switch,
  .nav-bar .binance-chip,
  .nav-bar .account { order: 0; }
  .nav-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .nav-row-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    flex-wrap: nowrap;
  }
  .nav-row-2-end {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    margin-left: auto;
  }
  html[data-theme] .nav-bar .brand { font-size: 15.5px; gap: 8px; white-space: nowrap; }
  html[data-theme] .nav-bar .theme-toggle { width: 34px; height: 34px; margin-left: auto; }
  html[data-theme] .nav-bar .lang-compact > button { height: 34px; padding: 0 10px 0 9px; }
  html[data-theme] .nav-bar .tabs { display: inline-flex; align-items: center; gap: 2px; margin-left: 0; flex: none; }
  html[data-theme] .nav-bar .tab { font-size: 13px; padding: 6px 10px; white-space: nowrap; line-height: 1.2; }
  html[data-theme] .nav-bar .binance-chip,
  html[data-theme] .nav-bar .binance-chip.ok { height: 32px; padding: 0 9px; gap: 6px; white-space: nowrap; }
  html[data-theme] .nav-bar .binance-chip .name { font-family: var(--font); font-weight: 500; font-size: 11.5px; letter-spacing: 0.01em; }
  html[data-theme] .nav-bar .avatar { width: 32px; height: 32px; font-size: 11.5px; }
  html[data-theme] .nav-bar .search { width: 100%; max-width: none; min-width: 0; height: 38px; margin-left: 0; flex: none; }
}
@media (max-width: 375px) {
  html[data-theme] .nav-bar,
  .nav-bar { padding: 10px 10px; }
  html[data-theme] .nav-bar .tab { padding: 6px 8px; font-size: 12.5px; }
  html[data-theme] .nav-bar .binance-chip,
  html[data-theme] .nav-bar .binance-chip.ok { padding: 0 8px; }
  .nav-row-2-end { gap: 5px; }
}

/* ---- Profile stats grid (Fees & Security) + Profile nav polish ---- */
.ex-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 300px;
  border: 1px solid var(--line, var(--hairline));
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  margin: 0;
  flex: none;
}
.ex-stats-grid > div {
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ex-stats-grid > div.col-r { border-left: 1px solid var(--hairline); }
.ex-stats-grid > div.span-2 { grid-column: 1 / -1; border-top: 1px solid var(--hairline); }
.ex-stats-grid dt {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ex-stats-grid dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}
.ex-stats-grid dd.nowrap { white-space: nowrap; }
.ex-stats-grid dd.source-val {
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  word-break: keep-all;
}

.ex-nav-item { border: 1px solid transparent; }
.ex-nav-item.is-placeholder { color: var(--faint); cursor: default; }
.ex-nav-item.is-placeholder .ex-nav-zh { color: var(--faint); opacity: 0.85; }
html[data-theme] .ex-nav-item.active { border-color: var(--accent-line); }
html[data-theme] .ex-nav-item.active .ex-nav-zh { color: var(--accent-text); opacity: 0.9; }

/* ---- Profile > Security ---- */
.sec-card-head { display: flex; align-items: center; gap: 12px; }
.sec-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2, var(--track));
  border: 1px solid var(--line-2, var(--hairline));
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent-text, var(--accent));
}
.sec-title { flex: 1; min-width: 0; }
.sec-title h2 { font-size: 16.5px; }
.sec-title p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ok-bg);
  color: var(--pos);
  white-space: nowrap;
}
html[data-theme] .sec-badge .dot,
.sec-badge .dot { width: 6px; height: 6px; background: var(--pos); box-shadow: none; }
html[data-theme] .btn-danger-line { color: var(--danger); border-color: var(--danger-line); background: transparent; }
html[data-theme] .btn-danger-line:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.sec-dl { margin: 0; display: flex; flex-direction: column; }
.sec-dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 13.5px;
}
.sec-dl > div:first-child { border-top: 0; padding-top: 2px; }
.sec-dl dt { color: var(--muted); white-space: nowrap; }
.sec-dl dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.sec-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2, var(--track));
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.sec-note .icon { margin-top: 2px; color: var(--accent-text, var(--accent)); }
.sec-body-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.sec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-btn-full { width: 100%; }

/* ---- Strategy detail: vernacular intro, fact chips, single-row actions ---- */
.detail-id-copy { min-width: 0; flex: 1; }
.detail-summary { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin-top: 8px; max-width: 720px; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fact-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2, var(--track));
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
}
.fact-chip.mono { font-family: var(--mono); font-size: 11px; }
.detail-actions .row { display: flex; flex-wrap: nowrap; gap: 8px; }
.detail-actions .row .btn,
.detail-actions .row .follow { white-space: nowrap; }
.hint-entry { margin: 0; font-size: 12.5px; line-height: 1.4; }
.hint-entry a { color: var(--muted); text-decoration: none; font-weight: 500; }
.hint-entry a:hover { color: var(--ink-2); }

@media (max-width: 980px) {
  .detail-head { align-items: stretch; }
  .detail-actions { width: 100%; align-items: stretch; }
  .detail-actions .row { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .detail-actions .row .btn,
  .detail-actions .row .follow { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13px; white-space: nowrap; }
  .detail-actions .row .btn-primary { flex: 1.15 1 0; }
}
@media (max-width: 900px) {
  .fee-seg { grid-template-columns: 1fr; }
  .ex-stats-grid { min-width: 0; width: 100%; }
  .ex-head-row { align-items: stretch; gap: 14px; }
}
/* Mobile: same fields stacked; the profile nav is a bar of four equal tabs. */
@media (max-width: 720px) {
  .ex-h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
  .ex-lead { font-size: 14px; line-height: 1.6; }
  .fee-fields { grid-template-columns: 1fr; }
  .fee-card-head { flex-direction: column; align-items: flex-start; }
  .ex-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line, var(--hairline));
    border-radius: 14px;
  }
  .ex-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 9px 2px;
    border-radius: 10px;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .ex-nav-item .ex-nav-zh { display: block; margin: 0; font-size: 10px; }
  .ex-nav-count { margin-left: 0; }
  .ex-who { margin-bottom: 8px; }
  .fee-actions .btn { flex: 1 1 auto; }
  .fee-hint { flex: 1 1 100%; }
}

/* New components for 事件驱动. Tokens only (var(--…)); no new colours, no new fonts. */
html[data-theme] .paper-badge { color: var(--accent-text, var(--accent)); border-color: var(--accent-line, var(--line-3)); font-family: var(--font); font-size: 11px; letter-spacing: 0; border-radius: 999px; padding: 1px 7px; }
html[data-theme] .strat-name .paper-badge { font-size: 11px; }
.fl { font-size: 11px; }

/* 快讯与判断 */
.news-card { padding: 18px 20px 14px; }
.news-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.news-head h2 { font-size: 15px; margin: 0; }
.news-head .sub { color: var(--muted); font-size: 12px; font-weight: 450; margin-left: 8px; }
.news-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 4px 11px; border-radius: 999px; background: var(--track); box-shadow: inset 0 0 0 1px var(--hairline); white-space: nowrap; }
.news-status.warn { color: var(--orange); background: var(--warn-bg); box-shadow: none; white-space: normal; }
.news-status.warn .live-dot { background: var(--orange); }
.news-hint { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.news-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--track); color: var(--ink-2); font-size: 12.5px; }
.news-list { list-style: none; margin: 12px 0 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 18px; padding: 16px 0; border-top: 1px solid var(--hairline); }
.news-time { color: var(--muted); font-size: 12.5px; line-height: 1.5; padding-top: 1px; }
.news-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.news-meta .dotsep { color: var(--faint); }
.coin-tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface-2, var(--track)); color: var(--ink-2); font-family: var(--mono); font-size: 11px; line-height: 1.4; }
.news-src { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.call-head { display: flex; align-items: center; gap: 8px; }
.call-k, .fill-k { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; min-width: 28px; }
.verdict { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1.5px currentColor; }
.verdict.v-long { color: var(--pos); }
.verdict.v-short { color: var(--neg); }
.verdict.v-none { color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-3); }
.verdict.v-wait { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-3); font-weight: 600; }
.spin { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--muted); display: inline-block; }
.probbar { display: flex; gap: 2px; height: 6px; margin-top: 9px; border-radius: 999px; overflow: hidden; }
.probbar i { display: block; min-width: 3px; }
.probbar .l { background: var(--pos-line); }
.probbar .s { background: var(--neg); }
.probbar .n { background: var(--line-3); }
.probbar-wait { background: var(--track); box-shadow: inset 0 0 0 1px var(--hairline); }
.prob-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.prob-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.prob-legend .d { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.prob-legend .d.l { background: var(--pos-line); }
.prob-legend .d.s { background: var(--neg); }
.prob-legend .d.n { background: var(--line-3); }
.fill-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 12.5px; }
.fill-one { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.news-foot { border-top: 1px solid var(--hairline); padding-top: 10px; color: var(--muted); font-size: 12.5px; }
.news-empty { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 26px 0 18px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--hairline); margin-top: 12px; }
.news-empty strong { color: var(--ink); font-size: 14px; }

/* 判断 × 当前持仓 */
.mx-wrap { margin: 14px 0 18px; overflow-x: auto; }
.mx { border-collapse: collapse; width: 100%; max-width: 720px; font-size: 13px; }
.mx th, .mx td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.mx thead th { color: var(--muted); font-size: 12px; font-weight: 500; border-bottom-color: var(--line-3); white-space: nowrap; }
.mx-two { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mx-hold { color: var(--muted); }
.mx-none { color: var(--ink-2); }

@media (max-width: 900px) {
  .news-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .news-time { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
}
@media (max-width: 720px) {
  .news-card { padding: 16px 14px 12px; }
  .news-head .sub { display: block; margin: 4px 0 0; }
  .mx th, .mx td { padding: 9px 8px; }
  .mx-two { flex-wrap: wrap; white-space: normal; }
}

/* open-position return: the "unrealized" tag sits under the number so the column stays narrow */
.event-trades-table .fl, .tc-ret .fl { display: block; line-height: 1.2; }
.tc-ret { text-align: right; }
.mx { min-width: 470px; }
.mx th, .mx td { white-space: nowrap; }
/* 事件驱动 paper fills (9 columns): scoped to .event-trades-table, never the shared .trades-table */
.event-trades-table th, .event-trades-table td { padding-left: 6px; padding-right: 6px; }
.event-trades-table .dir-sub { white-space: nowrap; }
.event-trades-table th { white-space: normal; }

/* ───── v2: two-step judgment, several books ───── */
.chan { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--track); box-shadow: inset 0 0 0 1px var(--hairline); white-space: nowrap; }
.chan.tradfi { color: var(--accent-text, var(--accent)); box-shadow: inset 0 0 0 1px var(--accent-line, var(--line-3)); background: transparent; }
.news-time .t { display: block; }
.coin-tag.stock { font-family: var(--font); font-weight: 600; }
.coin-tag.stock::after { content: attr(data-k); margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.judge { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--track); box-shadow: inset 0 0 0 1px var(--hairline); display: grid; gap: 10px; }
.jstep { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.step-n { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-3); flex: none; }
.step-k { font-weight: 650; color: var(--ink); }
.step-d { color: var(--muted); font-size: 12.5px; }
.step-r { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 2px; }
.jstep.is-wait .step-k, .step.is-wait .step-d { color: var(--muted); }
.step-none { color: var(--ink-2); font-size: 12.5px; }
.names { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.name-row { display: grid; grid-template-columns: minmax(150px, 190px) minmax(210px, 1fr) minmax(240px, 1.1fr); gap: 8px 18px; align-items: start; padding: 11px 0; border-top: 1px dashed var(--hairline); }
.name-row:first-child { border-top: 0; padding-top: 2px; }
.nm { display: grid; gap: 5px; justify-items: start; }
.nm-sub { color: var(--muted); font-size: 12px; line-height: 1.35; }
.nm-sub b { font-weight: 600; color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.nm-p .prob-legend { margin-top: 6px; }
.nm-p .probbar { margin-top: 7px; }
.nm-act { display: grid; gap: 6px; align-content: start; font-size: 12.5px; }
.act-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.act-line .plus { color: var(--muted); }
.act-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.act-skip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.act-skip i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint, var(--line-3)); display: inline-block; }
.probbar.n-a { opacity: 0.5; }
.name-row.is-skip .nm-p { color: var(--muted); font-size: 12.5px; padding-top: 3px; }
.unavail-note { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--track); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; box-shadow: inset 0 0 0 1px var(--line-3); }
.verdict.v-off { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-3); font-weight: 600; font-size: 12.5px; padding: 1px 10px; }
.verdict.sm { font-size: 12.5px; padding: 1px 10px; }

/* 持仓与账本 */
.books-card { padding: 18px 20px 14px; }
.books-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.books-head h2 { font-size: 15px; margin: 0; }
.books-head .sub { color: var(--muted); font-size: 12px; font-weight: 450; margin-left: 8px; }
.book-list { margin-top: 10px; display: grid; }
.book-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) 92px minmax(96px, 1fr) minmax(96px, 1fr) minmax(104px, 1fr) minmax(96px, 0.9fr); gap: 6px 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--hairline); font-size: 13px; font-variant-numeric: tabular-nums; }
.book-row.book-h { border-top: 0; padding: 4px 0 6px; color: var(--muted); font-size: 12px; }
.book-row .bk { display: grid; gap: 2px; }
.book-row .bk b { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.book-row .bk span { color: var(--muted); font-size: 12px; }
.book-row .r { text-align: right; }
.book-row .lab { display: none; }
.book-row.free { grid-template-columns: minmax(0, 1fr) auto; background: transparent; }
.book-row.free .fv { font-weight: 650; }
.books-note { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.stat-sub .dotsep { margin: 0 4px; }

@media (max-width: 720px) {
  .name-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0; }
  .judge { padding: 11px 12px; }
  .books-card { padding: 16px 14px 12px; }
  .book-row.book-h { display: none; }
  .book-row { grid-template-columns: 1fr 1fr; padding: 12px 0; gap: 8px 12px; }
  .book-row .bk { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: baseline; }
  .book-row .r { text-align: left; }
  .book-row .lab { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 1px; }
  .book-row.free { grid-template-columns: 1fr auto; }
}

/* v2 tweaks: 9-column event trade table (adds 标的), tighter judgment steps.
   721-1023px: the table keeps a min-width and scrolls sideways inside .trades-table-wrap, so cells never overlap.
   1024px and up: fixed column widths for the 9 columns. */
@media (min-width: 721px) {
  .event-trades-table td.nowrap { white-space: nowrap; }
}
@media (min-width: 721px) and (max-width: 1023px) {
  .event-trades-table { min-width: 880px; }
}
@media (min-width: 1024px) {
  .event-trades-table th:nth-child(1), .event-trades-table td:nth-child(1) { width: 92px; }
  .event-trades-table th:nth-child(4), .event-trades-table td:nth-child(4) { width: 150px; }
  .event-trades-table th:nth-child(7), .event-trades-table td:nth-child(7) { width: 56px; }
  .event-trades-table .dir-pair { flex-wrap: nowrap; }
}
.judge { gap: 8px; }
.jstep { min-height: 0; line-height: 1.3; }
.step-r { margin-left: 2px; }

/* ───── v3: 1/4 equity, 5×, ±2% TP / SL, at most 4 open ───── */
/* 持仓与账本: one more column (止盈 / 止损价) and a sub line under 占用资金 */
.book-row:not(.free) { grid-template-columns: minmax(118px, 1.15fr) 78px minmax(74px, 0.85fr) minmax(74px, 0.85fr) minmax(104px, 1.05fr) minmax(84px, 0.9fr) minmax(72px, 0.8fr); gap: 6px 10px; }
.book-row .sub2 { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; margin-top: 1px; }
.book-row .tpsl { display: grid; gap: 1px; }
.book-row .tpsl .tp { color: var(--pos); }
.book-row .tpsl .sl { color: var(--neg); }
.book-row .tpsl .k { color: var(--muted); font-size: 11px; margin-right: 4px; }
.slot-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 3px 11px; border-radius: 999px; background: var(--track); box-shadow: inset 0 0 0 1px var(--hairline); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot-pill b { color: var(--ink); font-weight: 650; }
.slot-pill.full { color: var(--orange); background: var(--warn-bg); box-shadow: none; }
.slot-pill.full b { color: var(--orange); }
.books-head { align-items: center; }
.books-note { display: grid; gap: 4px; }
.books-note p { margin: 0; }

/* 快讯里的名字：本条交易 / 这个不开 / 4 笔已满 */
.pick { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 650; color: var(--accent-text, var(--accent)); box-shadow: inset 0 0 0 1px var(--accent-line, var(--line-3)); }
.name-row.is-notpicked .nm-p { opacity: 0.78; }
.act-full { display: inline-flex; align-items: center; gap: 6px; color: var(--orange); font-weight: 650; }
.act-full i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); display: inline-block; }
.act-left { color: var(--ink-2); }

/* 平仓原因: sits under the close time, keeps the 9 columns */
.exit-why { display: inline-flex; align-items: center; margin-top: 3px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 650; line-height: 1.5; white-space: nowrap; box-shadow: inset 0 0 0 1px currentColor; }
.exit-why.tp { color: var(--pos); }
.exit-why.sl { color: var(--neg); }
.exit-why.rev { color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-3); }
.event-trades-table td.ts .exit-why { display: flex; width: max-content; }
.tc-line .exit-why { margin: 0 0 0 8px; }

/* 策略逻辑: short rule list under the table */
.rule-list { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.rule-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.rule-list li b { color: var(--ink); font-weight: 650; }
.rule-list li + li { padding-top: 8px; border-top: 1px dashed var(--hairline); }

@media (max-width: 900px) {
  .book-row:not(.free) { grid-template-columns: minmax(110px, 1.1fr) 74px repeat(2, minmax(64px, 0.8fr)) minmax(96px, 1fr) minmax(78px, 0.9fr) minmax(64px, 0.7fr); gap: 6px 8px; }
}
@media (max-width: 720px) {
  .book-row:not(.free) { grid-template-columns: 1fr 1fr; padding: 12px 0; gap: 8px 12px; }
  .rule-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .slot-pill { white-space: normal; }
}
