/* Strategy One — 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);
}
.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; }
.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; }

.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; }
.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);
}
.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 {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(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: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(var(--page), calc(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(4, 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; }
.stat-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.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; }
.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; }
.thesis-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.thesis-cols h3 { font-size: 14px; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.thesis-cols p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.thesis-cols .pos { color: var(--pos); }
.thesis-cols .neg { color: var(--neg); }
.thesis-cols .blue { color: var(--accent); }
.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); }
.p-row dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.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) 78px 72px 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-name { display: flex; gap: 10px; align-items: center; 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); }
.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: 50%;
  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; }

.empty-inline { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 980px) {
  .detail-grid, .compose-grid, .connect-grid, .stats, .thesis-cols, .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; }
}

/* Dark theme: system preference, unless the toggle stored light. An explicit data-theme wins. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0c0e12;
  --surface: #171a21;
  --ink: #f4f5f7;
  --ink-2: #c9ced6;
  --muted: #9aa1ad;
  --faint: #6e7684;
  --hairline: rgba(255, 255, 255, 0.08);
  --accent-soft: #152033;
  --peach: #2a2110;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --glass: rgba(22, 24, 28, 0.78);
  --glass-line: rgba(255, 255, 255, 0.08);
  --chip: #2a2e36;
  --track: rgba(255, 255, 255, 0.06);
  --input: rgba(255, 255, 255, 0.06);
  --hover: #22262e;
  --grid: rgba(255, 255, 255, 0.12);
  --ok-bg: #102a1d;
  --warn-bg: #2a2110;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0c0e12;
    --surface: #171a21;
    --ink: #f4f5f7;
    --ink-2: #c9ced6;
    --muted: #9aa1ad;
    --faint: #6e7684;
    --hairline: rgba(255, 255, 255, 0.08);
    --accent-soft: #152033;
    --peach: #2a2110;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --glass: rgba(22, 24, 28, 0.78);
    --glass-line: rgba(255, 255, 255, 0.08);
    --chip: #2a2e36;
    --track: rgba(255, 255, 255, 0.06);
    --input: rgba(255, 255, 255, 0.06);
    --hover: #22262e;
    --grid: rgba(255, 255, 255, 0.12);
    --ok-bg: #102a1d;
    --warn-bg: #2a2110;
  }
}
:root[data-theme="dark"] body {
  background: radial-gradient(800px 420px at 90% -10%, rgba(80, 50, 10, 0.45), transparent 55%), var(--ground);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background: radial-gradient(800px 420px at 90% -10%, rgba(80, 50, 10, 0.45), transparent 55%), var(--ground);
  }
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .ex-card,
:root[data-theme="dark"] .menu { border-color: #2a2e38; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card,
  :root:not([data-theme="light"]) .ex-card,
  :root:not([data-theme="light"]) .menu { border-color: #2a2e38; }
}
:root[data-theme="dark"] .table td { border-bottom-color: rgba(255, 255, 255, 0.06); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .table td { border-bottom-color: rgba(255, 255, 255, 0.06); }
}
:root[data-theme="dark"] .table tr.clickable:hover td,
:root[data-theme="dark"] .menu a:hover,
:root[data-theme="dark"] .menu button:hover { background: var(--hover); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .table tr.clickable:hover td,
  :root:not([data-theme="light"]) .menu a:hover,
  :root:not([data-theme="light"]) .menu button:hover { background: var(--hover); }
}
:root[data-theme="dark"] .ex-keyline,
:root[data-theme="dark"] .skel-logo,
:root[data-theme="dark"] .skel-line { background: #12141a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-keyline,
  :root:not([data-theme="light"]) .skel-logo,
  :root:not([data-theme="light"]) .skel-line { background: #12141a; }
}
:root[data-theme="dark"] .ex-banner.dry { background: #3a2f10; color: #f5d78a; border-color: #6b5316; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-banner.dry { background: #3a2f10; 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; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-alert,
  :root:not([data-theme="light"]) .ex-badge.err,
  :root:not([data-theme="light"]) .ex-modal-icon { background: #2a1416; border-color: #5c2a32; color: #fca5a5; }
}
:root[data-theme="dark"] .ex-badge.ok,
:root[data-theme="dark"] .ex-tick { background: #102a1d; color: #4ade80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-badge.ok,
  :root:not([data-theme="light"]) .ex-tick { background: #102a1d; color: #4ade80; }
}
:root[data-theme="dark"] .ex-form .input-affix { background: #12141a; border-color: #2a2e38; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-form .input-affix { background: #12141a; border-color: #2a2e38; }
}
:root[data-theme="dark"] .avatar.lg { background: #f4f5f7; color: #111; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar.lg { background: #f4f5f7; color: #111; }
}
:root[data-theme="dark"] .dock-marks .mark { box-shadow: 0 0 0 2px #171a21; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dock-marks .mark { box-shadow: 0 0 0 2px #171a21; }
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .chip.active,
:root[data-theme="dark"] .btn-accent,
:root[data-theme="dark"] .btn-danger { color: #fff; }
:root[data-theme="dark"] .tag-warn,
:root[data-theme="dark"] .ex-banner.dry { color: #f5d78a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .chip.active,
  :root:not([data-theme="light"]) .btn-accent,
  :root:not([data-theme="light"]) .btn-danger { color: #fff; }
  :root:not([data-theme="light"]) .tag-warn,
  :root:not([data-theme="light"]) .ex-banner.dry { color: #f5d78a; }
}
:root[data-theme="dark"] .ex-logo.okx { background: #f4f5f7; color: #111; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ex-logo.okx { background: #f4f5f7; color: #111; }
}
