/* PaperTrade · 纸上交易 —— 手机端 App 风格样式（纯手写，无外链资源） */

:root {
  --bg: #f3f6f4;
  --card: #ffffff;
  --ink: #10201a;
  --ink-2: #35473f;
  --sub: #7d8d86;
  --sub-2: #9aa8a2;
  --line: #eef2f0;
  --green: #0ec48a;
  --green-deep: #09a877;
  --green-soft: #e7faf3;
  --up: #12b76a;
  --down: #f0384b;
  --red-soft: #ffedef;
  --gold: #f0a629;
  --shadow: 0 6px 18px rgba(16, 40, 33, .06);
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #e9efec;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }
h1, h2, h3, p { margin: 0; }
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;            /* 兜底 */
  height: 100dvh;           /* 移动端地址栏收起/展开不裁切 */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(16, 40, 33, .04);
  overflow: hidden;
}

/* 只有中间内容区滚动；头尾参与固定高度 */
.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 16px;
  padding: 0;
}
.page { padding: 10px 14px 6px; }
.tab-disclaimer {
  grid-column: 1 / -1; text-align: center; font-size: 9px; line-height: 1.4;
  color: #98a4a0; padding: 0 8px 4px; letter-spacing: -.1px;
}

.muted { color: var(--sub); font-size: 11px; }
.spacer { flex: 1; }
.chev { color: var(--sub-2); font-size: 16px; }
.tag-up { color: var(--up); }
.tag-down { color: var(--down); }
.red { color: var(--down); }
.green { color: var(--green-deep); }
.sep { color: var(--sub-2); margin: 0 2px; }

/* ---------------------------------------------------------------- 顶栏 */
.page > .topbar {
  position: sticky; top: 0; z-index: 20;
  margin: -10px -14px 8px; padding: 10px 104px 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.page > .trade-top {
  position: sticky; top: 0; z-index: 20;
  margin: -10px -14px 8px; padding: 10px 14px 8px;
  background: var(--card);
  border-radius: 0;
  box-shadow: 0 1px 0 var(--line);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 38px; margin-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #0ec48a, #08b07a);
  color: #fff; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .5px;
  box-shadow: 0 4px 10px rgba(14, 196, 138, .3);
}
.brand b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; font-size: 10.5px; color: var(--sub); margin-top: 1px; }

.page-title { font-size: 20px; font-weight: 800; letter-spacing: .5px; }

.chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-deep);
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.chip.warn { background: #fff4e2; color: #b9770c; }
.chip.sm { height: 19px; padding: 0 7px; font-size: 10px; }

/* ---------------------------------------------------------------- 通用卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-head {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 2px 8px;
}
.section-head b { font-size: 15px; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 196, 138, .16);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.foot-note {
  padding: 12px 4px 4px; color: var(--sub-2);
  font-size: 10.5px; line-height: 1.6; text-align: center;
}
.empty { padding: 26px 14px; text-align: center; color: var(--sub-2); font-size: 12px; }

/* ---------------------------------------------------------------- 行情页 */
.banner {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #10cf92 0%, #08a97a 55%, #079572 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 166, 121, .24);
  position: relative; overflow: hidden;
}
.banner::after {
  content: ""; position: absolute; right: -34px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.banner.tall { padding: 18px 16px; align-items: flex-start; }
.banner-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.banner-txt b { display: block; font-size: 14px; letter-spacing: .2px; }
.banner-txt span { display: block; margin-top: 3px; font-size: 11px; opacity: .88; line-height: 1.4; }
.banner-btn {
  position: relative; z-index: 1;
  height: 29px; padding: 0 12px; border-radius: 999px;
  background: #fff; color: var(--green-deep); font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.banner-emoji { font-size: 30px; position: relative; z-index: 1; }

.hero { margin-top: 10px; padding: 14px 15px 12px; }
.hero-top, .total-top {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--sub); font-size: 11px;
}
.hero-link { color: var(--green-deep); font-weight: 600; }
.hero-num, .total-num {
  font-size: 29px; font-weight: 800; letter-spacing: -.6px;
  margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}
.hero-guest {
  margin: 8px 0 2px; font-size: 13px; font-weight: 600; color: var(--sub);
}
.hero-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-top: 3px; }
.hero-sub .tag-up, .hero-sub .tag-down { font-weight: 700; }

.hero-split, .total-split {
  display: flex; gap: 14px; margin-top: 11px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.hero-split div, .total-split div { flex: 1; min-width: 0; }
.hero-split span, .total-split span { display: block; font-size: 10.5px; color: var(--sub); }
.hero-split b, .total-split b { display: block; margin-top: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.total-split div:last-child b { font-size: 11px; color: var(--sub); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.mini { display: flex; align-items: center; gap: 8px; padding: 11px 11px; }
.mini-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.mini-ico.g1 { background: #fff3e8; }
.mini-ico.g2 { background: #eef6ff; }
.mini-txt { min-width: 0; }
.mini-txt b { display: block; font-size: 12px; }
.mini-txt span { display: block; font-size: 10px; color: var(--sub); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-go { margin-left: auto; color: var(--sub-2); font-size: 15px; }

.list { overflow: hidden; }

/* 行情行 */
.mkt-row {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.mkt-row:last-child { border-bottom: 0; }
.coin {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
  background: var(--c, #0ec48a);
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .12);
}
.coin.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.mkt-name { flex: 1; min-width: 0; }
.mkt-name b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-name span { display: block; font-size: 10.5px; color: var(--sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 下单面板：数据来源 + 休市原因 */
.quote-src { font-size: 10.5px; color: var(--sub-2); margin: 2px 0 6px; }
.quote-src.bad { color: var(--down); font-weight: 600; }
.session-hint {
  font-size: 11px; line-height: 1.45; color: #b25b00; background: #fff6e6;
  border: 1px solid #ffe2b0; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
}
/* 测试开关 PAPERTRADE_ALLOW_AFTER_HOURS=1 提示：蓝色信息态，区别于红色/橙色告警 */
.session-hint.test { color: #0a5fa8; background: #eef6ff; border-color: #cfe6ff; }

/* 交易时段条 */
.session-bar {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 0 2px; padding: 9px 13px; border-radius: 12px;
  background: #f4f6f5; color: #5c6a66; font-size: 11.5px;
}
.session-bar.open { background: var(--green-soft); color: #0a7a55; }
.session-bar .sb-dot { width: 7px; height: 7px; border-radius: 50%; background: #b6c1bd; flex: none; }
.session-bar.open .sb-dot { background: var(--up); box-shadow: 0 0 0 3px rgba(14, 196, 138, .18); }
.code { font-size: 10px; color: var(--sub-2); font-weight: 500; }
.mkt-price { text-align: right; min-width: 62px; }
.mkt-price b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.mkt-price span { display: block; font-size: 9.5px; color: var(--sub-2); margin-top: 1px; }

.pill {
  min-width: 61px; height: 27px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--up);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  flex: none;
}
.pill.down { background: var(--red-soft); color: var(--down); }

.flash-up { animation: flashUp .55s ease; }
.flash-down { animation: flashDown .55s ease; }
@keyframes flashUp { 0% { color: var(--up); } 100% { color: var(--ink); } }
@keyframes flashDown { 0% { color: var(--down); } 100% { color: var(--ink); } }

.foot-note { padding: 12px 4px 4px; }

/* ---------------------------------------------------------------- 交易页 */
.seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: #e8eeeb;
}
.seg button {
  height: 27px; padding: 0 15px; border-radius: 999px;
  font-size: 12px; color: var(--sub); font-weight: 600;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(16, 40, 33, .09); }
.seg button.on.green { color: var(--green-deep); }

.sym-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; cursor: pointer; margin-bottom: 9px;
}
.sym-meta { flex: 1; min-width: 0; }
.sym-meta b { display: block; font-size: 13px; }
.sym-meta span { display: block; font-size: 10px; color: var(--sub); margin-top: 2px; }
.sym-watch { font-size: 10.5px; color: var(--green-deep); background: var(--green-soft); padding: 3px 8px; border-radius: 999px; }

.price-block {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 2px 4px 10px;
}
.price-big {
  font-size: 27px; font-weight: 800; letter-spacing: -.8px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.price-big small { font-size: 10px; font-weight: 600; color: var(--sub); letter-spacing: 0; margin-left: 2px; }
.price-side { text-align: right; flex: none; max-width: 178px; }
.price-chg { font-size: 12px; font-weight: 700; }
.price-hl {
  display: grid; grid-template-columns: auto auto; gap: 2px 10px;
  margin-top: 4px; font-size: 9.5px; color: var(--sub); justify-content: end;
}
.price-hl span { white-space: nowrap; }
.price-hl b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.limit-line {
  margin: -2px 4px 9px; font-size: 9px; color: var(--sub-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.limit-line b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

.trade-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px; align-items: start;
}

.order-panel { padding: 9px 10px 10px; }

.side-seg {
  display: grid; grid-template-columns: 1fr 1fr;
  background: #eff3f1; border-radius: 10px; padding: 3px; margin-bottom: 8px;
}
.side-seg button {
  height: 29px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--sub);
}
.side-seg button.on.buy { background: var(--green); color: #fff; box-shadow: 0 3px 8px rgba(14, 196, 138, .3); }
.side-seg button.on.sell { background: var(--down); color: #fff; box-shadow: 0 3px 8px rgba(240, 56, 75, .28); }

.type-select select {
  width: 100%; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: #fafcfb;
  font-size: 12px; padding: 0 8px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.type-select { margin-bottom: 7px; }

.field {
  position: relative; margin-bottom: 7px;
}
.field input {
  width: 100%; height: 33px; border-radius: 9px;
  border: 1px solid var(--line); background: #fafcfb;
  padding: 0 36px 0 9px; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.field input:focus { border-color: var(--green); background: #fff; }
.field em {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--sub-2); pointer-events: none;
}

.ratio-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 2px 0 8px; }
.ratio-row button {
  height: 24px; border-radius: 7px; background: #f1f5f3;
  font-size: 10.5px; color: var(--ink-2); font-weight: 600;
}
.ratio-row button:active { background: var(--green-soft); color: var(--green-deep); }

.kv {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 2.5px 0; font-size: 10.5px; color: var(--sub);
}
.kv b { font-size: 11px; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.kv.total { margin-top: 5px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.kv.total b { font-size: 14px; }

.submit {
  width: 100%; height: 38px; margin-top: 9px; border-radius: 11px;
  background: linear-gradient(135deg, #12cf93, #08ab7c);
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 6px 14px rgba(11, 170, 124, .26);
}
.submit.red { background: linear-gradient(135deg, #ff5a6b, #e6283c); box-shadow: 0 6px 14px rgba(240, 56, 75, .24); }
.submit:disabled {
  background: linear-gradient(135deg, #cfd6d3, #b6bfbb);
  color: #fff; box-shadow: none; cursor: not-allowed; opacity: 1;
}
.panel-note { margin-top: 7px; font-size: 9.5px; color: var(--sub-2); line-height: 1.5; text-align: center; }

.lev-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
.lev-row button { height: 28px; border-radius: 8px; background: #f1f5f3; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.lev-row button.on { background: var(--green-soft); color: var(--green-deep); box-shadow: inset 0 0 0 1px rgba(14, 196, 138, .45); }
.lev-row button.on.short { background: var(--red-soft); color: var(--down); box-shadow: inset 0 0 0 1px rgba(240, 56, 75, .4); }

.collapse-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px; padding: 7px 0 3px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--ink-2); font-weight: 600; cursor: pointer;
}
.collapse-head span { font-size: 10px; color: var(--sub); font-weight: 400; }
.tpsl { padding-top: 4px; }

/* 订单簿 */
.book { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 0 9px; }
.book-head {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 0 9px 6px; font-size: 9.5px; color: var(--sub-2);
}
.book-head span:last-child { text-align: right; }
.book-rows { display: flex; flex-direction: column; }
.brow {
  position: relative; display: grid; grid-template-columns: 1fr auto;
  gap: 6px; padding: 2.5px 9px; font-size: 10px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.brow span:last-child { color: var(--sub); text-align: right; z-index: 1; }
.brow span:first-child { z-index: 1; }
.brow i {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 0;
  background: rgba(240, 56, 75, .09);
}
.brow.bid i { background: rgba(14, 196, 138, .12); }
.brow.ask span:first-child { color: var(--down); }
.brow.bid span:first-child { color: var(--up); }
.brow:active { background: rgba(16, 40, 33, .04); }

.book-mark {
  display: flex; align-items: baseline; gap: 5px;
  padding: 6px 9px; margin: 3px 0;
  background: #f7faf8; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.book-mark b { font-size: 13px; color: var(--up); font-variant-numeric: tabular-nums; }
.book-mark small { font-size: 9px; color: var(--sub-2); }

.depth-wrap { padding: 7px 9px 0; }
.depth-bar { height: 6px; border-radius: 4px; background: var(--down); overflow: hidden; }
.depth-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px 0 0 4px; transition: width .3s ease; }
.depth-lbl { display: flex; justify-content: space-between; margin-top: 3px; font-size: 9px; font-weight: 700; }
.depth-lbl .b { color: var(--up); }
.depth-lbl .s { color: var(--down); }
.depth-toggle { padding: 6px 9px 2px; font-size: 9.5px; color: var(--green-deep); cursor: pointer; }
.depth-detail { padding: 2px 9px 0; }
.depth-detail div { display: flex; justify-content: space-between; padding: 2px 0; font-size: 9px; color: var(--sub); font-variant-numeric: tabular-nums; }

/* 合约持仓 */
.positions { padding: 2px 12px; }
.pos-card { padding: 11px 0; border-bottom: 1px solid var(--line); }
.pos-card:last-child { border-bottom: 0; }
.pos-head { display: flex; align-items: center; gap: 8px; }
.pos-title { flex: 1; min-width: 0; }
.pos-title b { display: block; font-size: 12.5px; }
.pos-title span { display: block; font-size: 9.5px; color: var(--sub); margin-top: 2px; }
.side-tag {
  display: inline-block; padding: 0 5px; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; vertical-align: 1px;
}
.side-tag.long { background: var(--green-soft); color: var(--up); }
.side-tag.short { background: var(--red-soft); color: var(--down); }
.side-tag.buy { background: var(--green-soft); color: var(--up); }
.side-tag.sell { background: var(--red-soft); color: var(--down); }
.pos-pnl { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-pnl small { font-size: 9px; font-weight: 500; margin-left: 2px; }
.pos-pnl.up { color: var(--up); }
.pos-pnl.down { color: var(--down); }
.pos-meta { display: flex; gap: 12px; margin-top: 6px; font-size: 9.5px; color: var(--sub); }
.pos-meta b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-actions { display: flex; gap: 7px; margin-top: 8px; }
.pos-actions button {
  flex: 1; height: 28px; border-radius: 8px; background: #f1f5f3;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
}
.pos-actions button.danger { background: var(--red-soft); color: var(--down); }

/* ---------------------------------------------------------------- 资产页 */
.ass-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 4px 2px 10px; }
.ass-eyebrow { font-size: 10px; color: var(--sub); letter-spacing: 1px; }
.ass-head h1 { font-size: 24px; letter-spacing: .5px; margin-top: 1px; }
.ass-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 25px; padding: 0 9px;
  border-radius: 999px; background: #fff7e8; color: #9a6a10;
  font-size: 10.5px; font-weight: 600; margin-top: 6px; cursor: pointer;
}

.total-card { padding: 14px 15px 12px; }
.eye-btn {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); background: #f4f7f5;
}
.eye-btn svg { width: 15px; height: 15px; }
.total-num { font-size: 30px; }
.total-num.small { font-size: 22px; }
.total-card.slim { margin-top: 9px; }
.total-sub { display: flex; align-items: center; gap: 5px; font-size: 10.5px; }
.total-sub .tag-up, .total-sub .tag-down { font-weight: 700; font-size: 11.5px; }
.total-sub #posPnl { font-weight: 600; }

.acct-wrap { display: grid; gap: 9px; margin-top: 9px; }
.acct { padding: 12px 13px 11px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.acct-head b { font-size: 13px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.cell span { display: block; font-size: 10px; color: var(--sub); }
.cell b { display: block; margin-top: 1px; font-size: 13px; font-variant-numeric: tabular-nums; }
.identity {
  margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 9.5px; color: var(--sub-2); font-variant-numeric: tabular-nums;
}

.act-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.btn-main {
  height: 42px; border-radius: 12px; background: linear-gradient(135deg, #12cf93, #08ab7c);
  color: #fff; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 7px 16px rgba(11, 170, 124, .25);
}
.btn-ghost {
  height: 42px; border-radius: 12px; background: #fff;
  color: var(--ink-2); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
}
.btn-ghost em { font-size: 11px; color: var(--green-deep); font-weight: 700; }
.btn-ghost.wide, .btn-danger.wide { width: 100%; margin-top: 8px; height: 38px; }
.btn-danger { border-radius: 11px; background: var(--red-soft); color: var(--down); font-size: 12.5px; font-weight: 600; }

.entry-list { margin-top: 9px; padding: 0 13px; }
.entry-row { display: flex; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.entry-row:last-child { border-bottom: 0; }
.entry-ico { width: 26px; height: 26px; border-radius: 8px; background: #f2f6f4; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.entry-row em { margin-left: auto; font-size: 10px; color: var(--sub-2); }
.entry-row .chev { margin-left: 2px; }

.seg-tabs {
  display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: #e8eeeb;
}
.seg-tabs button {
  height: 26px; padding: 0 13px; border-radius: 999px;
  font-size: 12px; color: var(--sub); font-weight: 600;
}
.seg-tabs button em { font-size: 10px; color: var(--sub-2); font-weight: 600; }
.seg-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(16, 40, 33, .08); }
.seg-tabs button.on em { color: var(--green-deep); }
.seg-tabs.wide { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 9px; }

.asset-row, .order-item {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
}
.asset-row:last-child, .order-item:last-child { border-bottom: 0; }
.asset-val { text-align: right; margin-left: auto; }
.asset-val b { display: block; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.asset-val span { display: block; font-size: 10px; margin-top: 2px; color: var(--sub); }

.ledger { padding: 2px 13px; }
.ledger-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-main { flex: 1; min-width: 0; }
.ledger-kind {
  display: inline-block; padding: 0 5px; border-radius: 5px; font-size: 9px;
  background: #f1f5f3; color: var(--sub); margin-right: 5px; vertical-align: 1px;
}
.ledger-kind.k-liquidation { background: var(--red-soft); color: var(--down); }
.ledger-kind.k-task { background: #fff4e2; color: #b9770c; }
.ledger-kind.k-contract_open, .ledger-kind.k-contract_close { background: #eef3ff; color: #3b5bdb; }
.ledger-main b { font-size: 11px; font-weight: 600; }
.ledger-main small { display: block; margin-top: 2px; font-size: 9.5px; color: var(--sub-2); }
.ledger-amt { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }

.ops { margin-top: 12px; padding: 12px 14px 14px; }
.ops .kv { padding: 3px 0; font-size: 11px; }
.ops-note { margin-top: 6px; font-size: 9.5px; color: var(--sub-2); line-height: 1.55; }

/* 委托列表 */
.order-list { display: flex; flex-direction: column; }
.order-main { flex: 1; min-width: 0; }
.order-main b { display: block; font-size: 12px; }
.order-main span { display: block; font-size: 10.5px; color: var(--sub); margin-top: 2px; }
.order-main small { display: block; font-size: 9.5px; color: var(--sub-2); margin-top: 2px; }
.mini-btn {
  height: 28px; padding: 0 11px; border-radius: 8px;
  background: var(--red-soft); color: var(--down); font-size: 11px; font-weight: 600;
  flex: none;
}
.mini-btn.primary { background: var(--green-soft); color: var(--green-deep); }
.mini-btn.done { background: #f1f5f3; color: var(--sub-2); }

/* ---------------------------------------------------------------- 排行页 */
.rank-hero { display: flex; gap: 10px; margin-top: 2px; padding: 14px 15px; }
.rank-hero-l, .rank-hero-r { flex: 1; min-width: 0; }
.rank-hero-r { text-align: right; border-left: 1px dashed var(--line); padding-left: 11px; }
.rank-hero span { display: block; font-size: 10px; color: var(--sub); }
.rank-hero b { display: block; font-size: 22px; font-weight: 800; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.rank-hero small { font-size: 9.5px; color: var(--sub-2); }

.rank-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center; column-gap: 10px;
  min-height: 50px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.top1 { background: linear-gradient(90deg, #fff9ec, #fff); }
.rank-row.top2 { background: linear-gradient(90deg, #f7f9fb, #fff); }
.rank-row.top3 { background: linear-gradient(90deg, #fdf6ee, #fff); }
.rank-row.me { background: var(--green-soft); }
.rank-no { text-align: center; font-size: 13px; font-weight: 700; color: var(--sub); }
.rank-name {
  display: block; min-width: 0;
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-tag {
  font-size: 9px; font-weight: 600; color: var(--green-deep);
  background: #fff; border-radius: 5px; padding: 0 4px; vertical-align: 1px;
}
.rank-val {
  text-align: right; white-space: nowrap;
  font-size: 13.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rank-self-tip {
  padding: 10px 14px 2px; font-size: 10.5px; color: var(--sub);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 活动页 */
#rewardSum { color: var(--green-deep); }
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px; border-bottom: 1px solid var(--line);
}
.task-row:last-child { border-bottom: 0; }
.task-row.done { opacity: .62; }
.task-ico {
  width: 34px; height: 34px; border-radius: 10px; background: #f4f8f6;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.task-txt { flex: 1; min-width: 0; }
.task-txt b { display: block; font-size: 12.5px; }
.task-txt span { display: block; font-size: 10px; color: var(--sub); margin-top: 2px; line-height: 1.4; }
.task-right { text-align: right; flex: none; }
.task-reward { display: block; font-size: 12px; font-weight: 700; color: var(--green-deep); margin-bottom: 4px; }
.task-row.done .task-reward { color: var(--sub); }

.notice-card { margin-top: 10px; padding: 13px 14px; }
.notice-card b { font-size: 12.5px; }
.notice-card p { margin-top: 5px; font-size: 10px; color: var(--sub); line-height: 1.55; }

/* ---------------------------------------------------------------- 弹层 / Toast */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 24, 19, .42);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .18s ease;
}
.overlay.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 430px; max-height: 76vh;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 14px 0 calc(16px + env(safe-area-inset-bottom));
  transform: translateY(14px); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.overlay.show .sheet { transform: translateY(0); }
.sheet-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 10px; border-bottom: 1px solid var(--line);
}
.sheet-title b { font-size: 15px; }
.sheet-title button { font-size: 11.5px; color: var(--sub); padding: 4px 8px; }
.sheet-body { overflow-y: auto; padding: 10px 16px 4px; -webkit-overflow-scrolling: touch; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-list .mkt-row { padding: 10px 0; }
.sheet-empty { padding: 24px 0; text-align: center; color: var(--sub-2); font-size: 12px; }
.sheet-note { margin-top: 10px; font-size: 10px; color: var(--sub-2); line-height: 1.5; }

.rule-table { display: flex; flex-direction: column; }
.rule-table > div {
  display: grid; grid-template-columns: 44px 88px 1fr;
  gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--ink-2);
}
.rule-table > div:first-child { color: var(--sub); font-size: 10px; font-weight: 600; }
.rule-table > div:last-child { border-bottom: 0; }
.rule-table span:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }

.dialog {
  width: calc(100% - 48px); max-width: 340px;
  background: #fff; border-radius: 16px; padding: 18px 16px 14px;
  transform: scale(.96); transition: transform .18s ease;
}
.overlay.show .dialog { transform: scale(1); }
.dialog h3 { font-size: 15px; }
.dialog p { margin-top: 7px; font-size: 11.5px; color: var(--sub); line-height: 1.6; }
.dialog-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.dialog-btns button { height: 38px; border-radius: 10px; background: #f1f5f3; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dialog-btns button.ok { background: var(--green); color: #fff; }
.dialog-btns button.ok.danger { background: var(--down); }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 200;
  transform: translate(-50%, 8px); opacity: 0;
  max-width: 330px; padding: 9px 14px; border-radius: 11px;
  background: rgba(16, 32, 26, .9); color: #fff; font-size: 11.5px;
  line-height: 1.45; text-align: center; pointer-events: none;
  transition: all .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(198, 32, 50, .94); }

/* ---------------------------------------------------------------- 底部 Tab */
.tabbar {
  position: relative; flex: none;
  width: 100%; max-width: 430px; margin: 0 auto; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(16, 40, 33, .05);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 3px 0; color: var(--sub-2); font-size: 10px;
}
.tab-ico { width: 21px; height: 21px; display: block; }
.tab-ico svg { stroke-width: 1.9; }
.tab.on { color: var(--green-deep); }
.tab.on .tab-txt { font-weight: 700; }

/* ---------------------------------------------------------------- 启动 / 错误 / file 提示 */
.boot {
  min-height: 76vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.boot-mark {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(135deg, #0ec48a, #08a97a); color: #fff;
  font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(14, 196, 138, .3);
}
.boot p { font-size: 12px; color: var(--sub); }
.boot-err { margin-top: 6px; text-align: center; }
.boot-err p { max-width: 260px; color: var(--down); font-size: 11.5px; line-height: 1.5; }
.boot-err button {
  margin-top: 10px; height: 34px; padding: 0 18px; border-radius: 10px;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 600;
}
.file-notice {
  position: fixed; inset: 0; z-index: 300; background: rgba(10, 24, 19, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.file-notice-card {
  background: #fff; border-radius: 16px; padding: 18px 16px; max-width: 340px;
}
.file-notice-card b { font-size: 14px; }
.file-notice-card p { margin-top: 8px; font-size: 11.5px; color: var(--sub); line-height: 1.6; }
.file-notice-card code { background: #f2f6f4; border-radius: 4px; padding: 1px 4px; font-size: 10.5px; }

/* ---------------------------------------------------------------- 分组交易页（A股 / 币） */
.up { color: var(--up); }
.down { color: var(--down); }

.trade-top { padding: 10px 12px 8px; }
.group-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 3px; }
.group-seg button {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  height: 32px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.group-seg button em { font-size: 9.5px; font-weight: 600; color: var(--sub-2); }
.group-seg button.on { background: var(--green); color: #fff; box-shadow: 0 4px 10px rgba(14, 196, 138, .28); }
.group-seg button.on em { color: rgba(255, 255, 255, .82); }

.sub-seg { display: flex; gap: 4px; margin-top: 7px; }
.sub-seg button { flex: 1; height: 26px; padding: 0 8px; font-size: 11.5px; }
.seg.mini { display: flex; margin-bottom: 7px; }
.seg.mini button { height: 24px; padding: 0 13px; font-size: 11px; }

.symbol-strip {
  display: flex; gap: 6px; margin-top: 8px; padding-bottom: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.symbol-strip::-webkit-scrollbar { display: none; }
.symbol-strip button {
  flex: none; min-width: 74px; padding: 6px 8px 5px; border-radius: 10px;
  background: #f5f8f6; text-align: left;
}
.symbol-strip button b { display: block; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.symbol-strip button span {
  display: block; margin-top: 1px; font-size: 9.5px; color: var(--sub);
  max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.symbol-strip button i { display: block; margin-top: 1px; font-size: 9.5px; font-weight: 600; }
.symbol-strip button.on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--green); }

.trade-head { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.th-name { flex: 1; min-width: 0; }
.th-name b { display: block; font-size: 14px; }
.th-tag {
  display: inline-block; margin-top: 3px; padding: 0 6px; border-radius: 5px;
  background: #f1f5f3; color: var(--sub); font-size: 9.5px; font-weight: 600;
}
.th-price { text-align: right; flex: none; }
.th-price .price-big { font-size: 22px; line-height: 1.15; }
.th-price .price-big.up { color: var(--up); }
.th-price .price-big.down { color: var(--down); }
.th-chg { margin-top: 2px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.th-chg.up { color: var(--up); }
.th-chg.down { color: var(--down); }
.th-cny { font-size: 9.5px; font-weight: 500; color: var(--sub-2); margin-left: 3px; }

.trade-panel { margin-top: 9px; padding: 10px 12px 12px; }
.trade-extra { margin-top: 9px; padding: 11px 13px 12px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.panel-head b { font-size: 12.5px; }
.panel-head .muted { text-align: right; }

.field > span { display: block; margin-bottom: 3px; font-size: 9.5px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chips button {
  height: 23px; padding: 0 9px; border-radius: 6px;
  background: #f1f5f3; color: var(--ink-2); font-size: 10.5px; font-weight: 600;
}
.chips button:active { background: var(--green-soft); color: var(--green-deep); }

.fees { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--line); }
.fees .kv { font-size: 10.5px; }
.fees .kv b { font-size: 11px; }

.credit-box {
  margin-top: 7px; padding: 9px 10px 8px; border-radius: 11px;
  background: #f8faf9; border: 1px solid var(--line);
}
.credit-box .kv { font-size: 10.5px; }
.bar { position: relative; height: 7px; margin: 7px 0 2px; border-radius: 4px; background: #e8eeeb; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px 0 0 4px; background: linear-gradient(90deg, #12cf93, #08ab7c); transition: width .3s ease; }
.bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--down); }
.tiny { margin-top: 5px; font-size: 9.5px; color: var(--sub-2); line-height: 1.5; }

.rule-note {
  margin-top: 8px; padding: 6px 8px; border-radius: 8px;
  background: #f7faf8; color: var(--sub); font-size: 9.5px; line-height: 1.55;
}
.submit-reason { margin-top: 6px; text-align: center; font-size: 10px; color: #b25b00; }

.session-hint.ok { color: #0a7a55; background: var(--green-soft); border-color: #c3efe0; }

.formula {
  margin-top: 9px; padding-top: 7px; border-top: 1px dashed var(--line);
  font-size: 10px; color: var(--sub-2); line-height: 1.55; word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.fx-line {
  margin-top: 10px; text-align: center; font-size: 10.5px;
  color: var(--sub); font-variant-numeric: tabular-nums;
}
.fx-line.warn { color: #b25b00; }
.disclaimer-line { margin-top: 6px; text-align: center; font-size: 9.5px; color: var(--sub-2); line-height: 1.5; }
.mkt-src.cny { color: var(--green-deep) !important; }

.ledger-kind.k-margin_short, .ledger-kind.k-margin_cover { background: #fff1f2; color: #c2263a; }
.ledger-kind.k-margin_interest { background: #fff4e2; color: #b9770c; }
.ledger-kind.k-margin_liquidation { background: var(--down); color: #fff; }
.ledger-kind.k-spot_buy, .ledger-kind.k-spot_sell, .ledger-kind.k-spot_order { background: #eef3ff; color: #3b5bdb; }

/* ---------------- 账号页 ---------------- */
.auth-page { max-width: 420px; margin: 0 auto; padding: 28px 16px 40px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-logo { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 10px;
  background: var(--up); color: #fff; font-weight: 800; font-size: 20px; line-height: 52px; letter-spacing: 1px; }
.auth-head h1 { font-size: 20px; margin: 0 0 4px; }
.auth-sub { margin: 0; font-size: 12px; color: var(--sub-2); line-height: 1.6; }
.auth-form { background: var(--card); border-radius: 14px; padding: 18px 16px; box-shadow: var(--shadow); }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.auth-field input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); outline: none; }
.auth-field input:focus { border-color: var(--up); }
.auth-submit { width: 100%; height: 46px; border: 0; border-radius: 12px; background: var(--up); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }
.auth-submit.ghost { background: transparent; color: var(--up); border: 1px solid var(--up); margin-top: 10px; }
.auth-err { color: var(--down); font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.auth-banner { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.auth-banner.ok { background: #e8f8f0; color: #0a7a54; }
.auth-links { display: flex; justify-content: space-between; margin: 14px 4px 0; font-size: 13px; }
.auth-links a { color: var(--sub); text-decoration: none; }
.auth-note { font-size: 11px; color: var(--sub-2); line-height: 1.6; margin: 12px 4px 0; }
.auth-pending { margin-top: 16px; background: var(--card); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.auth-pending b { font-size: 14px; }
.auth-pending p { font-size: 12px; color: var(--sub); line-height: 1.6; margin: 6px 0 0; word-break: break-all; }

/* ---------------------------------------------------------------- 数字等宽 */
.price-big, .th-chg, .kv b, .total-num, .rank-val, .quote-stats b, .ob-row span,
.kline-legend, .kline-ma b, .ma, .num, .user-name, .trade-panel input { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------------------------------------------------------------- 昵称胶囊 */
.topbar { padding-right: 104px; }
.user-chip {
  position: fixed; top: 12px; right: max(12px, calc((100vw - 430px) / 2 + 12px));
  z-index: 80; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px 0 5px; border-radius: 999px;
  background: #eef2f0; color: var(--ink); font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 40, 33, .08); max-width: 148px;
}
.user-ava {
  width: 24px; height: 24px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.user-ava.lg { width: 46px; height: 46px; font-size: 18px; }
.user-ava.guest { background: #d7e0dc; color: #6b7d78; font-size: 13px; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-guest { padding: 0 2px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 登录面板 */
.auth-overlay { align-items: flex-end; }
.auth-sheet { max-height: 88vh; }
.auth-seg { margin: 10px 0 12px; }
.seg { display: flex; background: #f3f6f4; border-radius: 12px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; height: 32px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--sub);
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(16, 40, 33, .08); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field > span { font-size: 11px; color: var(--sub); }
.auth-field input {
  height: 42px; border-radius: 11px; border: 1px solid #e3e9e6; background: #fbfcfb;
  padding: 0 12px; font-size: 13.5px; outline: none;
}
.auth-field input:focus { border-color: var(--green); background: #fff; }
.auth-hint { font-size: 10.5px; color: var(--down); }
.auth-check { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--sub); }
.auth-prompt {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 10px;
  background: #eaf3ff; color: #1b5fb8; font-size: 12px; font-weight: 600; text-align: center;
}
.auth-err {
  margin: 0; padding: 8px 10px; border-radius: 9px; background: var(--red-soft);
  color: #c0262d; font-size: 11.5px; line-height: 1.5;
}
.auth-submit {
  height: 44px; border-radius: 12px; background: var(--green); color: #fff;
  font-size: 14px; font-weight: 700;
}
.auth-submit:disabled { opacity: .55; }
.auth-submit.ghost { background: #f3f6f4; color: var(--ink-2); }
.auth-submit.danger { background: #fff; color: var(--down); border: 1px solid #ffd6da; }
.auth-note { margin-top: 10px; font-size: 10.5px; color: var(--sub-2); line-height: 1.6; }
.auth-link { display: block; width: 100%; margin-top: 8px; text-align: center; font-size: 12px; color: var(--sub); }
.auth-notice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 4px; text-align: center; }
.auth-notice-ico {
  width: 52px; height: 52px; border-radius: 50%; background: var(--green-soft);
  color: var(--green-deep); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.auth-notice b { font-size: 16px; }
.auth-notice-line { font-size: 13px; color: var(--ink-2); }
.auth-notice-sub { font-size: 11px; color: var(--sub); line-height: 1.6; max-width: 300px; }

/* 账号浮层 */
.profile-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 14px; }
.profile-head b { display: block; font-size: 16px; }
.profile-head span { font-size: 10.5px; color: var(--sub); }
.profile-sheet .kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.profile-sheet .kv span { color: var(--sub); }
.profile-sheet .auth-submit { margin-top: 16px; }

/* ---------------------------------------------------------------- 休市提示 */
.session-banner {
  margin: 4px 14px 8px; padding: 7px 12px; border-radius: 10px;
  background: #fff8e8; color: #9a6a09; font-size: 11px; font-weight: 600; text-align: center;
}

/* ---------------------------------------------------------------- 游客锁 */
.guest-lock {
  margin-top: 18vh; padding: 32px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center;
}
.guest-ico { width: 54px; height: 54px; color: var(--sub-2); }
.guest-lock b { font-size: 16px; }
.guest-lock p { font-size: 11.5px; color: var(--sub); line-height: 1.6; }
.guest-lock .auth-submit { width: 100%; margin-top: 6px; }
.guest-link { font-size: 11.5px; color: var(--sub); text-decoration: underline; }
.empty-activity { margin-top: 14vh; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-activity svg { opacity: .85; }
.empty-activity b { font-size: 16px; }
.empty-activity p { font-size: 11.5px; color: var(--sub); }

/* ---------------------------------------------------------------- 交易页两栏（左 K 线 / 右下单） */
.trade-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.trade-panel { padding: 12px 10px; min-width: 0; }
.trade-kline { padding: 10px 10px 8px; min-width: 0; }
.tk-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; }
.tk-head b { font-size: 13px; }
.tk-periods { margin-left: auto; }
.tk-periods button { height: 24px; min-width: 56px; flex: 1; padding: 0 9px; font-size: 11px; white-space: nowrap; }
.trade-kline-wrap { height: 380px; }
.trade-extra { margin-top: 8px; }
.submit { position: sticky; bottom: 8px; z-index: 5; }
.quote-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.quote-stats > div { display: flex; flex-direction: column; gap: 1px; }
.quote-stats span { font-size: 9.5px; color: var(--sub-2); }
.quote-stats b { font-size: 11px; font-weight: 600; }
.th-sub { display: block; font-size: 9.5px; color: var(--sub-2); margin-top: 2px; }
.kline-btn { position: absolute; right: 14px; bottom: 10px; }
.trade-head { position: relative; }
.chips.pct { gap: 6px; flex-wrap: nowrap; }
.chips.pct button { min-width: 0; flex: 1 1 0; padding: 0 4px; white-space: nowrap; }
.chips.pct button:disabled { opacity: .45; }
.pct-note { margin-top: 4px; font-size: 10px; line-height: 1.35; color: var(--sub-2); }

/* 订单簿 */
.ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ob-head b { font-size: 12px; }
.ob-head span { font-size: 9.5px; color: var(--sub-2); }
.ob-list { display: flex; flex-direction: column; gap: 1px; }
.ob-row {
  position: relative; display: flex; justify-content: space-between;
  height: 18px; align-items: center; padding: 0 4px; border-radius: 4px;
  font-size: 10px; overflow: hidden;
}
.ob-row i { position: absolute; left: 0; top: 0; bottom: 0; opacity: .12; }
.ob-row.ask { color: #c0262d; }
.ob-row.ask i { background: #f0384b; }
.ob-row.bid { color: #0a9d6e; }
.ob-row.bid i { background: #0ec48a; }
.ob-row span { position: relative; z-index: 1; }
.ob-mid { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; margin: 3px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ob-mid b { font-size: 15px; }
.ob-mid span { font-size: 9.5px; color: var(--sub-2); }
.ob-depth { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 9.5px; }
.ob-depth .buy { color: #0a9d6e; }
.ob-depth .sell { color: #c0262d; }
.ob-bar { flex: 1; height: 4px; border-radius: 2px; background: #eef1f5; overflow: hidden; }
.ob-bar i { display: block; height: 100%; background: linear-gradient(90deg, #0ec48a, #9be7cd); }
.ob-details { margin-top: 6px; font-size: 10px; color: var(--sub); }
.ob-details summary { cursor: pointer; padding: 4px 0; color: var(--sub-2); }
.ob-cum > div { display: flex; justify-content: space-between; padding: 2px 0; }
.ob-cum .sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------------------------------------------------------------- K 线页 */
.page-kline { padding-bottom: 12px; }
.kline-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.kline-seg { flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kline-seg button { flex: 1; min-width: 44px; font-size: 11px; padding: 0 8px; }
.kline-side { display: flex; gap: 5px; }
.kline-card { padding: 10px 8px 6px; }
.kline-wrap { position: relative; height: 320px; }
.kline-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.kline-tip {
  position: absolute; z-index: 4; max-width: 240px; padding: 5px 7px; border-radius: 7px;
  background: rgba(16, 32, 26, .9); color: #fff; font-size: 9.5px; line-height: 1.4;
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.kline-legend { font-size: 10px; color: var(--sub); padding: 2px 2px 6px; }
.kline-legend.bad { color: #c0262d; }
.kline-ma { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 6px 2px 2px; font-size: 10px; color: var(--sub); }
.kline-ma i { display: inline-block; width: 8px; height: 2px; margin-left: 3px; vertical-align: middle; }
.kline-ma b { color: var(--ink-2); font-weight: 600; }
.page-activity .topbar { padding-right: 104px; }

/* ---------------------------------------------------------------- 窄屏：交易页纵向堆叠（先 K 线后下单） */
@media (max-width: 899px) {
  .trade-kline-wrap { height: 240px; }
}

/* ---------------------------------------------------------------- 宽屏：交易页放宽，K 线在左、下单在右 */
@media (min-width: 900px) {
  #app.wide { max-width: 960px; }
  #app.wide .tabbar { max-width: 960px; }
  #app.wide .page > .topbar, #app.wide .page > .trade-top { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  #app.wide .page > .topbar { padding-right: 104px; }
  #app.wide .trade-grid { grid-template-columns: minmax(0, 1.32fr) minmax(300px, .68fr); }
  #app.wide .trade-kline-wrap { height: 430px; }
}
