/* =============================================================================
   PTC · 熊猫币模拟合约终端
   设计基调：夜里的行情台。只有一块屏是亮的，其余都是黑。
   - 单一主色：熊猫币徽章的冰蓝边缘光（--accent）
   - 多空语义：偏冷的薄荷 / 偏暖的珊瑚（与常见交易所的荧光绿红拉开距离）
   - 不用 webfont（0 字节字体请求），靠字阶、字距、发丝线与留白立住质感
   ========================================================================== */

/* ---------------------------------------------------------------- 变量 */
:root {
  --bg:         oklch(0.148 0.012 265);
  --bg-deep:    oklch(0.118 0.011 265);
  --panel:      oklch(0.183 0.013 265);
  --panel-2:    oklch(0.216 0.014 265);
  --panel-hi:   oklch(0.245 0.015 265);

  --line:       oklch(1 0 0 / 0.075);
  --line-2:     oklch(1 0 0 / 0.13);
  --line-3:     oklch(1 0 0 / 0.20);

  --ink:        oklch(0.972 0.004 265);
  --ink-2:      oklch(0.812 0.010 265);
  --muted:      oklch(0.668 0.013 265);

  --accent:     oklch(0.80 0.125 234);
  --accent-ink: oklch(0.86 0.11 234);
  --long:       oklch(0.855 0.150 168);
  --short:      oklch(0.712 0.170 22);
  --warn:       oklch(0.815 0.130 78);

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quick: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 20;
  --z-bar:    40;
  --z-mask:   50;
  --z-sheet:  60;
  --z-menu:   70;
  --z-toast:  80;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --num: ui-sans-serif, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------------------------------------------------------------- 基础 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, dl, dd, dt, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input { font: inherit; color: inherit; }

/* hidden 必须赢过 class 里的 display，否则自定义 display 会让 [hidden] 失效 */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 70%, white 10%);
  outline-offset: 2px;
  border-radius: 4px;
}

.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.005em; }
.ta-r { text-align: right; }
.muted { color: var(--muted); }
.is-up { color: var(--long); }
.is-down { color: var(--short); }

.noscript {
  padding: 14px 20px;
  background: color-mix(in oklab, var(--warn) 18%, var(--bg));
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

/* 滚动条：细、低对比，不抢戏 */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =============================================================================
   顶栏
   ========================================================================== */
.app-body { overflow: hidden; height: 100dvh; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 50% -20%, oklch(0.24 0.03 240 / 0.30), transparent 60%),
    var(--bg);
}

.topbar {
  flex: 0 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  background: color-mix(in oklab, var(--bg-deep) 82%, transparent);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: var(--z-sticky);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand__mark { width: 36px; height: 36px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.brand__text i {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* 价格 */
.ticker { display: flex; align-items: baseline; gap: 10px; flex: 0 0 auto; }
.ticker__price {
  font-size: clamp(1.55rem, 2.1vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  transition: color 0.5s var(--ease);
  position: relative;
}
.ticker__price[data-dir="1"] { color: var(--long); }
.ticker__price[data-dir="-1"] { color: var(--short); }
.ticker__price[data-dir="0"] { color: var(--ink); }

.ticker__price::after {
  content: "";
  position: absolute;
  inset: -6px -8px;
  border-radius: 8px;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
}
.ticker__price.is-flash::after { animation: flash 0.65s var(--ease-quick); }
@keyframes flash {
  0%   { opacity: 0.14; }
  100% { opacity: 0; }
}

.ticker__chg {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 24H 统计 */
.ticker__stats {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
  padding-left: 8px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.ticker__stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticker__stats dt {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ticker__stats dd { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.badge-sim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent);
  border-radius: 99px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: color-mix(in oklab, var(--warn) 88%, white 12%);
  background: color-mix(in oklab, var(--warn) 10%, transparent);
  white-space: nowrap;
}
.badge-sim i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 20%, transparent);
}

.acct {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklab, var(--panel) 60%, transparent);
}
.acct em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.acct b { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }

.usermenu { position: relative; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: grid; place-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.avatar:hover { border-color: var(--line-3); color: var(--ink); }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 188px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: 0 18px 40px -18px oklch(0 0 0 / 0.8);
  z-index: var(--z-menu);
  animation: menu-in 0.18s var(--ease-quick);
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.menu__head {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.menu__head b { font-size: 13px; }
.menu__head span { font-size: 11px; color: var(--muted); }
.menu__item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.menu__item:hover { background: var(--panel-2); color: var(--ink); }
.menu__item--danger { color: color-mix(in oklab, var(--short) 86%, white 14%); }
.menu__item--danger:hover { background: color-mix(in oklab, var(--short) 14%, transparent); }

/* =============================================================================
   工作区
   ========================================================================== */
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(318px, 26.5vw, 380px);
}
.col-chart {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 250px;
  min-height: 0;
  min-width: 0;
}

/* ---------------------------------------------------------------- 图表 */
.chart {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.chart__bar {
  flex: 0 0 auto;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
}
.tf { display: flex; gap: 2px; }
.tf button {
  height: 26px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.tf button:hover { color: var(--ink-2); background: var(--panel-2); }
.tf button.is-active { color: var(--ink); background: var(--panel-hi); }

.chart__right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.chart__legend {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}
.chart__legend b { font-weight: 500; color: var(--ink-2); margin-right: 8px; }
.chart__legend b.up { color: var(--long); }
.chart__legend b.down { color: var(--short); }

.iconbtn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
}
.iconbtn:hover { color: var(--ink); background: var(--panel-2); }

.chart__stage { position: relative; flex: 1 1 auto; min-height: 0; }
#chart {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}
#chart:focus-visible { outline-offset: -3px; }

.chart__hint {
  position: absolute;
  left: 14px; bottom: 10px;
  font-size: 10.5px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.chart__stage:hover .chart__hint { opacity: 0.7; }

.chart__latest {
  position: absolute;
  right: 14px; bottom: 12px;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 11.5px;
  color: var(--ink);
  background: color-mix(in oklab, var(--accent) 22%, var(--panel));
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  animation: menu-in 0.2s var(--ease-quick);
}
.chart__empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12px; color: var(--muted);
}

.chart__foot {
  flex: 0 0 auto;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}
.chart__foot #footPrice { color: var(--ink-2); font-size: 12px; }
.sep { width: 1px; height: 10px; background: var(--line-2); flex: 0 0 auto; }

/* ---------------------------------------------------------------- 底部面板 */
.dock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-deep) 40%, transparent);
}
.dock__tabs {
  flex: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}
.dock__tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.18s;
}
.dock__tabs button::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.dock__tabs button:hover { color: var(--ink-2); }
.dock__tabs button.is-active { color: var(--ink); }
.dock__tabs button.is-active::after { transform: scaleX(1); }

.pill {
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--panel-hi);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  color: var(--ink-2);
}

.dock__panes { position: relative; flex: 1 1 auto; min-height: 0; }
.pane {
  position: absolute;
  inset: 0;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-quick);
}
.pane.is-active { opacity: 1; visibility: visible; }

/* 表格 */
.ptable { min-width: 100%; }
.ptable__head, .prow {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.9fr 0.9fr 0.9fr 0.85fr 0.95fr 1.05fr 128px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}
.ptable__head--hist, .prow--hist {
  grid-template-columns: 1fr 1.15fr 1fr 1fr 1fr 1.15fr;
}
.ptable__head--ord, .prow--ord {
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr 96px;
}
.ptable__head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 30px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ptable__body { display: block; }
.prow {
  min-height: 40px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  animation: row-in 0.3s var(--ease-quick);
  transition: background 0.15s;
}
.prow:hover { background: color-mix(in oklab, var(--panel) 55%, transparent); }
@keyframes row-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}
.prow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .num { color: var(--ink-2); }
.prow .strong { color: var(--ink); }

/* 盈亏 + 收益率两行 */
.prow__pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  overflow: visible;
}
.prow__pnl b { font-weight: 600; font-size: 12px; letter-spacing: -0.01em; }
.prow__pnl i { font-style: normal; font-size: 10.5px; opacity: 0.82; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag--long { color: var(--long); background: color-mix(in oklab, var(--long) 14%, transparent); }
.tag--short { color: var(--short); background: color-mix(in oklab, var(--short) 14%, transparent); }
.tag--liq { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, transparent); }

.btn {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--panel);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line-3); }
.btn--sm { height: 24px; padding: 0 9px; font-size: 11px; }
.btn--danger { color: color-mix(in oklab, var(--short) 85%, white 15%); border-color: color-mix(in oklab, var(--short) 32%, transparent); }
.btn--danger:hover { background: color-mix(in oklab, var(--short) 16%, transparent); border-color: color-mix(in oklab, var(--short) 50%, transparent); }
.btn--primary { background: color-mix(in oklab, var(--accent) 20%, var(--panel)); border-color: color-mix(in oklab, var(--accent) 42%, transparent); color: var(--ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--accent) 30%, var(--panel)); }

.prow__act { display: flex; justify-content: flex-end; gap: 4px; }
.prow__act .btn { padding: 0 7px; }

/* 止盈 / 止损 两行小字 */
.prow__tpsl { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; font-size: 11px; }
.prow__tpsl .tp { color: var(--long); }
.prow__tpsl .sl { color: var(--short); }
.prow__tpsl .none { color: var(--muted); }

.empty {
  padding: 26px 18px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.empty b { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 3px; font-size: 12.5px; }

/* 排行榜 */
.rank { padding: 8px 14px 18px; max-width: 660px; }
.rank__head, .rankrow {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 104px 88px;
  align-items: center;
  gap: 10px;
}
.rank__head {
  padding: 0 4px 6px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
}
.rank__list { display: flex; flex-direction: column; }
.rankrow {
  padding: 7px 4px;
  font-size: 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  animation: row-in 0.3s var(--ease-quick);
}
.rankrow__i { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rankrow:nth-child(-n+3) .rankrow__i { color: var(--accent-ink); font-weight: 600; }
.rankrow__n { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.02em; }
.rankrow__p { text-align: right; font-variant-numeric: tabular-nums; }
.rankrow__r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rankrow.is-me { background: color-mix(in oklab, var(--accent) 8%, transparent); border-radius: var(--r-sm); }
.rank__me {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  gap: 12px;
  align-items: center;
}
.rank__me b { color: var(--ink); }
.rank__note { margin-top: 12px; font-size: 11px; color: var(--muted); }

/* 规则 */
.pane--prose { padding: 0; }
.rules {
  max-width: 78ch;
  padding: 16px 18px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 26px;
}
.rules__item h3 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  margin-bottom: 5px;
}
.rules__item p { font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.rules__item b { color: var(--ink-2); font-weight: 600; }

/* =============================================================================
   右侧：下单 + 账户
   ========================================================================== */
.rail {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-deep) 55%, transparent);
  position: relative;
}
.rail__grip { display: none; }

.order, .acctpanel { padding: 16px 16px 18px; }
.order { display: flex; flex-direction: column; gap: 15px; }
.order__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order__head h2, .acctpanel h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

/* 分段控件 */
.otype {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.otype button {
  height: 22px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
}
.otype button:hover { color: var(--ink-2); }
.otype button.is-active { color: var(--ink); background: var(--panel-hi); }

.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  width: 132px;
  --segcolor: var(--long);
}
.seg--side { width: 100%; }
.seg--side button { height: 32px; font-size: 13px; }
.seg[data-side="1"]  { --segcolor: var(--long); }
.seg[data-side="-1"] { --segcolor: var(--short); }
.seg button {
  position: relative;
  z-index: 1;
  height: 26px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.22s var(--ease-quick);
  border-radius: 6px;
}
.seg button.is-active { color: var(--segcolor); font-weight: 600; }
.seg__thumb {
  position: absolute;
  top: 3px; left: 3px; bottom: 3px;
  width: calc(50% - 3px);
  border-radius: 6px;
  background: color-mix(in oklab, var(--segcolor) 16%, transparent);
  transition: transform 0.28s var(--ease), background-color 0.28s;
  pointer-events: none;
}
.seg[data-side="-1"] .seg__thumb { transform: translateX(100%); }

/* 字段 */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.field__label b { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.field__label small { font-size: 11px; color: var(--muted); }
.field__label small b { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }

/* 杠杆滑杆 */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right,
    color-mix(in oklab, var(--accent) 80%, transparent) 0 var(--p, 13%),
    var(--line-2) var(--p, 13%) 100%);
}
.range::-moz-range-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right,
    color-mix(in oklab, var(--accent) 80%, transparent) 0 var(--p, 13%),
    var(--line-2) var(--p, 13%) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid color-mix(in oklab, var(--accent) 85%, white 15%);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
  transition: box-shadow 0.2s;
}
.range::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid color-mix(in oklab, var(--accent) 85%, white 15%);
}
.range:active::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 22%, transparent); }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button {
  flex: 1 1 auto;
  min-width: 44px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: color-mix(in oklab, var(--panel) 60%, transparent);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  font-variant-numeric: tabular-nums;
}
.chips button:hover { color: var(--ink-2); border-color: var(--line-2); }
.chips button.is-active {
  color: var(--accent-ink);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}

/* 输入 */
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  transition: border-color 0.18s, background 0.18s;
}
.input:focus-within { border-color: color-mix(in oklab, var(--accent) 55%, transparent); background: var(--panel-2); }
.input input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  outline: none;
  -moz-appearance: textfield;
}
.input input::-webkit-outer-spin-button,
.input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input__suffix { font-size: 11px; color: var(--muted); flex: 0 0 auto; }

/* 计算结果 */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  padding: 12px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-deep) 55%, transparent);
  border: 1px solid var(--line);
}
.calc > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.calc dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.calc dd { font-size: 12px; color: var(--ink-2); }

.submit {
  height: 44px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: oklch(0.16 0.02 265);
  background: var(--long);
  transition: filter 0.18s, transform 0.12s var(--ease-quick), background-color 0.25s;
  will-change: transform;
}
.submit:hover { filter: brightness(1.06); }
.submit:active { transform: scale(0.994); }
.submit[data-side="-1"] { background: var(--short); }
.submit:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.submit.is-busy { color: transparent; position: relative; }
.submit.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid oklch(0.16 0.02 265 / 0.35);
  border-top-color: oklch(0.16 0.02 265);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.risk {
  font-size: 11px;
  color: var(--warn);
  line-height: 1.6;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.risk::before { content: "!"; flex: 0 0 auto; font-weight: 700; }

/* 账户 */
.acctpanel { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }.acctpanel dl { display: flex; flex-direction: column; gap: 7px; }
.acctpanel dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.acctpanel dt { font-size: 11.5px; color: var(--muted); }
.acctpanel dd { font-size: 12.5px; color: var(--ink-2); }
.acctpanel dl > div:first-child dd { font-size: 15px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }

.rail__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* =============================================================================
   事件合约
   ========================================================================== */
.ev {
  display: grid;
  grid-template-columns: 248px 208px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 16px 16px;
  align-items: start;
}
.ev__col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ev__dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ev__dir {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ev__dir span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ev__dir small { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.ev__dir:hover { border-color: var(--line-3); }
.ev__dir--up.is-active {
  border-color: color-mix(in oklab, var(--long) 55%, transparent);
  background: color-mix(in oklab, var(--long) 12%, transparent);
}
.ev__dir--up.is-active span { color: var(--long); }
.ev__dir--down.is-active {
  border-color: color-mix(in oklab, var(--short) 55%, transparent);
  background: color-mix(in oklab, var(--short) 12%, transparent);
}
.ev__dir--down.is-active span { color: var(--short); }
.ev__row { display: flex; flex-direction: column; gap: 5px; }
.ev__note { font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.submit--ev { height: 36px; font-size: 12.5px; }
.submit--ev[data-dir="-1"] { background: var(--short); }

.ev__list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ev__listhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ev__listhead h3 { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; }
.ghostbtn--xs { height: 24px; padding: 0 9px; font-size: 11px; }

.evcard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel) 50%, transparent);
}
.evcard--done { opacity: 0.72; }
.evcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.evcard__timer { font-size: 11.5px; color: var(--ink-2); }
.evcard__mid { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.evcard__mid b { color: var(--ink-2); font-size: 12px; margin-left: 3px; }
.evcard__bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.evcard__bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear; }
.evcard__res { font-size: 11px; color: var(--muted); }
.evcard__res b { font-weight: 600; }

/* =============================================================================
   弹窗
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: grid;
  place-items: center;
  padding: 20px;
  background: oklch(0 0 0 / 0.55);
  animation: mask-in 0.2s var(--ease-quick);
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(380px, 100%);
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px -30px oklch(0 0 0 / 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: menu-in 0.2s var(--ease-quick);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal__head h3 { font-size: 14px; font-weight: 600; }
.modal__sub { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.modal__actions .btn { height: 32px; padding: 0 16px; }

/* 止盈止损弹窗：现价实时条 + 触发时预计盈亏 */
.tpsl__live {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: -2px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.tpsl__live-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--panel-2);
}
.tpsl__live-cell span {
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}
.tpsl__live-cell b {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.16s var(--ease-quick);
}
.tpsl__live-cell b.is-up { color: var(--long); }
.tpsl__live-cell b.is-down { color: var(--short); }
.tpsl__est {
  margin: 6px 1px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 16px;
  transition: color 0.16s var(--ease-quick);
}
.tpsl__est.is-up { color: var(--long); }
.tpsl__est.is-down { color: var(--short); }
.tpsl__est.is-bad { color: var(--short); opacity: 0.92; }

/* =============================================================================
   手机端操作条 / 抽屉
   ========================================================================== */
.mobilebar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-bar);
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--bg-deep) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.mb {
  flex: 1 1 0;
  height: 44px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: oklch(0.16 0.02 265);
}
.mb--long { background: var(--long); }
.mb--short { background: var(--short); }

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-mask);
  background: oklch(0 0 0 / 0.55);
  opacity: 0;
  transition: opacity 0.3s var(--ease-quick);
}
.sheet-mask.is-on { opacity: 1; }

/* =============================================================================
   Toast
   ========================================================================== */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  min-width: 200px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--panel-hi);
  border: 1px solid var(--line-2);
  box-shadow: 0 16px 36px -18px oklch(0 0 0 / 0.85);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  animation: toast-in 0.28s var(--ease);
  transition: opacity 0.3s, transform 0.3s var(--ease-quick);
}
.toast b { display: block; font-weight: 600; margin-bottom: 1px; }
.toast small { color: var(--muted); font-size: 11.5px; }
.toast--ok b { color: var(--long); }
.toast--bad b { color: var(--short); }
.toast--info b { color: var(--accent-ink); }
.toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* =============================================================================
   登录页
   ========================================================================== */
.auth-body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 70% at 22% 8%, oklch(0.30 0.055 240 / 0.35), transparent 58%),
    radial-gradient(70% 60% at 88% 100%, oklch(0.26 0.04 200 / 0.22), transparent 60%),
    var(--bg);
}

.auth {
  flex: 1 1 auto;
  width: min(1140px, 100% - 48px);
  margin: 0 auto;
  padding: clamp(28px, 5vh, 64px) 0 clamp(20px, 4vh, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.auth__brand { display: flex; flex-direction: column; gap: 22px; max-width: 520px; }
.auth__logo {
  width: clamp(96px, 13vw, 148px);
  height: auto;
  filter: drop-shadow(0 18px 40px oklch(0.5 0.12 240 / 0.30));
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.auth__title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}
.auth__title span {
  color: var(--accent-ink);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.auth__lede {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
  text-wrap: pretty;
}

.auth__ticker {
  position: relative;
  padding: 14px 16px 10px;
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--panel) 62%, transparent);
  border: 1px solid var(--line);
}
.auth__row { display: flex; align-items: baseline; gap: 10px; }
.auth__px { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.auth__chg { font-size: 13px; font-weight: 500; }
.auth__spark { width: 100%; height: 62px; display: block; margin-top: 8px; }
.auth__live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em;
}
.auth__live i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--long);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--long) 60%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--long) 45%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in oklab, var(--long) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--long) 0%, transparent); }
}

.auth__facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 0 clamp(20px, 4vw, 44px);
}
.auth__facts > div { display: flex; flex-direction: column; gap: 1px; }
.auth__facts dd { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.auth__facts dt { font-size: 11px; color: var(--muted); }

.auth__panel {
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(oklch(1 0 0 / 0.022), oklch(1 0 0 / 0)) , var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 90px -50px oklch(0 0 0 / 0.9);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.seg--auth { width: 100%; --segcolor: var(--accent-ink); }
.seg--auth .seg__thumb { width: calc(50% - 3px); }
.seg--auth[data-tab="register"] .seg__thumb { transform: translateX(100%); }

.authform { display: flex; flex-direction: column; gap: 14px; }
.authform .field__label { font-size: 11.5px; }
.authform .input { height: 44px; }
.authform .input input { font-size: 16px; letter-spacing: 0; }
.formerr {
  min-height: 17px;
  font-size: 12px;
  color: color-mix(in oklab, var(--short) 88%, white 12%);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s, transform 0.2s;
}
.formerr.is-on { opacity: 1; transform: none; }
.submit--auth { margin-top: 2px; }
.auth__hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; text-align: center; }

.auth__foot {
  flex: 0 0 auto;
  padding: 0 24px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.meme { margin: 0; width: min(376px, 100%); }
.meme img {
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 425;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--line);
  opacity: 0.9;
  filter: saturate(0.94) contrast(1.02);
  transition: opacity 0.35s var(--ease-quick), filter 0.35s;
}
.meme:hover img { opacity: 1; filter: none; }

.meme__lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.meme__lines span:last-child { color: var(--muted); }

.auth__disclaimer {
  max-width: 620px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.auth__disclaimer b { color: var(--ink-2); font-weight: 600; }
.auth__disclaimer span { display: inline-block; margin-left: 6px; opacity: 0.7; }

/* =============================================================================
   管理后台
   ========================================================================== */
.admin-body {
  min-height: 100dvh;
  background:
    radial-gradient(80% 60% at 50% -10%, oklch(0.24 0.03 240 / 0.25), transparent 60%),
    var(--bg);
}
.adminbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: color-mix(in oklab, var(--bg-deep) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.adminbar__px { display: flex; align-items: baseline; gap: 8px; }
.adminbar__px span { font-size: 11px; }
.adminbar__px b { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.adminbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ghostbtn {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.ghostbtn:hover { background: var(--panel-2); color: var(--ink); }

.admin {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 22px 0 60px;
  display: grid;
  gap: 16px;
}
.panel {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel) 55%, transparent);
  overflow: hidden;
}
.panel__head {
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.panel__head h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.panel__sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.panel__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }

.ctrlrow { display: flex; align-items: flex-end; gap: 10px; }
.ctrlrow--wrap { flex-wrap: wrap; align-items: center; }
.field--inline { flex-direction: column; gap: 6px; min-width: 180px; }
.input--sm { height: 34px; }
.input--sm input { font-size: 13px; }
.chips--wide button { flex: 0 0 auto; min-width: 58px; height: 28px; font-size: 11.5px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.stats > div { display: flex; flex-direction: column; gap: 3px; }
.stats dt { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.stats dd { font-size: 13px; color: var(--ink-2); }

.filter { display: flex; gap: 8px; }
.filter input {
  flex: 1 1 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-size: 13px;
  outline: none;
}
.filter input:focus { border-color: color-mix(in oklab, var(--accent) 55%, transparent); }

.utable { overflow-x: auto; }
.utable__head, .urow {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 96px 96px 56px 96px 92px 132px;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  min-width: 660px;
}
.utable__head {
  height: 28px;
  font-size: 10.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.urow {
  min-height: 38px;
  font-size: 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
}
.urow:hover { background: color-mix(in oklab, var(--panel) 60%, transparent); }
.urow .nm { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .num { color: var(--ink-2); }
.urow__act { display: flex; gap: 5px; justify-content: flex-end; }
.utm {
  display: inline-flex; align-items: center; gap: 9px;
}
.utag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.skeleton-row {
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.evlog { display: flex; flex-direction: column; gap: 0; }
.evlog li {
  display: grid;
  grid-template-columns: 128px 62px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  font-size: 11.5px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
  color: var(--muted);
}
.evlog li b { color: var(--ink-2); font-weight: 500; }
.evlog .kind { font-size: 10.5px; }

/* ------------------------------------------------ 控制台口令页 */
.gate-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 0%, oklch(0.30 0.05 240 / 0.30), transparent 60%),
    var(--bg);
}
.gate {
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: 0 40px 90px -50px oklch(0 0 0 / 0.9);
}
.gate__logo { width: 54px; height: 54px; }
.gate h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.gate div p { margin-top: 6px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.gate form { display: flex; flex-direction: column; gap: 13px; }
.gate .input { height: 42px; }
.gate .input input { font-size: 16px; letter-spacing: 0; }
.gate .submit { height: 44px; }
.gate__warn { font-size: 11px; line-height: 1.75; color: var(--muted); }
.gate__warn code {
  display: block;
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: normal;
}
.lockform { display: inline; }

.urow__act .gi {
  width: 74px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.urow__act .gi:focus { border-color: color-mix(in oklab, var(--accent) 55%, transparent); }

/* 断线时价格变灰，避免误导 */
body.is-offline .ticker__price { opacity: 0.5; }

/* =============================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) {
  .ticker__stats > div:nth-child(4) { display: none; }
}

@media (max-width: 1080px) {
  .ticker__stats { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .col-chart { grid-template-rows: minmax(0, 1fr) 230px; }
}

@media (max-width: 900px) {
  /* 手机 / 小屏：整屏 flex，底栏落在流里，不留死区；下单改底部抽屉 */
  .app-body { overflow: hidden; height: 100dvh; }
  .app { height: 100dvh; min-height: 0; padding-bottom: 0; }

  .topbar { height: 52px; gap: 12px; padding: 0 12px; position: sticky; top: 0; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__text b { font-size: 13px; }
  .brand__text i { display: none; }
  .ticker__price { font-size: 1.4rem; }
  .ticker__chg { font-size: 12px; }
  .acct { padding: 4px 9px; }
  .acct em { display: none; }
  .acct b { font-size: 12.5px; }
  .topbar__right { gap: 8px; }
  .badge-sim { display: none; }

  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .col-chart { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .chart { flex: 0 0 auto; height: clamp(270px, 43vh, 400px); }
  .chart__bar { height: 40px; gap: 8px; padding: 0 10px; overflow-x: auto; }
  .chart__legend { display: none; }
  .tf button { padding: 0 8px; }
  .chart__foot { font-size: 10.5px; gap: 9px; }
  .chart__foot #footLaunch { display: none; }

  .dock {
    flex: 1 1 auto;
    min-height: 180px;
    margin-bottom: 0;
    overflow: hidden;
  }
  .dock__panes { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .pane { position: static; display: none; overflow: visible; }
  .pane.is-active { display: block; }

  /* 持仓 → 卡片 */
  .ptable__head { display: none; }
  .prow {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 14px;
    font-size: 12.5px;
  }
  .prow > span[data-label] {
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: normal;
  }
  .prow > span[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.02em;
  }
  .prow__side { grid-column: 1 / -1; justify-content: space-between; }
  .prow__pnl { align-items: flex-start; }
  .prow__pnl b { font-size: 14px; }
  .prow__act { grid-column: 1 / -1; }
  .prow__act .btn { width: 100%; height: 32px; }

  .rules { grid-template-columns: 1fr; }
  .rank { padding: 8px 12px 18px; }
  .rank__head, .rankrow { grid-template-columns: 24px minmax(0, 1fr) 92px 78px; gap: 8px; }

  /* 事件合约：单列 */
  .ev { grid-template-columns: 1fr; gap: 14px; padding: 12px 14px 20px; }
  .dock__tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 右栏 → 底部抽屉 */
  .rail {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: var(--z-sheet);
    max-height: 90dvh;
    overflow-y: auto;
    border-left: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 16px 16px 0 0;
    background: var(--bg);
    box-shadow: 0 -30px 60px -30px oklch(0 0 0 / 0.9);
    transform: translateY(102%);
    transition: transform 0.42s var(--ease);
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .rail.is-open { transform: none; }
  .rail__grip {
    display: grid;
    place-items: center;
    height: 22px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1;
  }
  .rail__grip span { width: 38px; height: 4px; border-radius: 99px; background: var(--line-3); }
  .order { padding: 8px 16px 18px; gap: 14px; }
  .acctpanel { padding-bottom: 26px; }
  .rail__foot { display: none; }

  /* 底栏回到文档流，永远贴着视口底部 */
  .mobilebar {
    display: flex;
    position: static;
    flex: 0 0 auto;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: none;
  }

  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; width: min(460px, 100% - 36px); padding: 26px 0 18px; gap: 24px; }
  .auth__brand { align-items: center; text-align: center; max-width: none; gap: 16px; }
  .auth__logo { width: 84px; }
  .auth__title { font-size: 1.7rem; }
  .auth__lede { font-size: 13.5px; }
  .auth__facts { justify-content: center; gap: 0 26px; }
  .auth__panel { padding: 20px; }
  .auth__foot { padding: 0 18px calc(18px + env(safe-area-inset-bottom)); }
  .meme { width: min(360px, 100%); }
}

@media (max-width: 560px) {
  .ticker__price { font-size: 1.3rem; }
  .chart { height: clamp(280px, 42vh, 360px); }
  .dock__tabs { overflow-x: auto; gap: 0; }
  .dock__tabs button { padding: 0 9px; font-size: 11.5px; }
  .calc { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth__title { font-size: 1.55rem; }
}

/* 横屏小高屏（比如手机横放）：把图表压扁但保留 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .chart { height: 62vh; }
}

/* ---------------------------------------------------------------- 无动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .auth__logo { animation: none; }
  .auth__live i { animation: none; }
}
