/* ==========================================================================
   Ulink Web — design system
   Palette / typography / sprites extracted from Ulink.apk
   (io.bilian.ukwfe.ulink, v3.0.7)
     brand gold  #F0B90B   (hyp_tiny_saas_main_theme)
     up          #0BBA99   (hyp_tiny_saas_rise)
     down        #EE3E57   (hyp_tiny_saas_fall)
     light bg    #F5F5F5 / #F7F8FA / #FFFFFF
     dark  bg    #14161B / #181B21 / #041323
   ========================================================================== */

@font-face {
  font-family: 'DIN Pro';
  src: url('../font/dinpro-bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../font/dinpro-medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../font/dinpro_regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --brand: #f0b90b;
  --brand-600: #d9a400;
  --brand-soft: rgba(240, 185, 11, 0.14);
  --brand-ink: #181a20;

  --up: #0bba99;
  --down: #ee3e57;

  --bg: #f5f5f5;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #eaecef;
  --line-2: #dfe3e8;

  --text: #191b27;
  --text-2: #707a8a;
  --text-3: #9aa3ad;

  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow-1: 0 1px 2px rgba(2, 10, 20, 0.04), 0 4px 16px rgba(2, 10, 20, 0.06);
  --shadow-2: 0 12px 36px rgba(2, 10, 20, 0.12);

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

  --nav-h: 60px;
  --tabbar-h: 58px;
  --wrap: 1200px;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', Roboto, Helvetica, Arial, sans-serif;
  --num-font: 'DIN Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme='dark'] {
  --brand-soft: rgba(240, 185, 11, 0.18);

  --bg: #14161b;
  --bg-alt: #181b21;
  --surface: #181b21;
  --surface-2: #1e2128;
  --line: #2a2d36;
  --line-2: #343842;

  --text: #eaedf1;
  --text-2: #888c95;
  --text-3: #6b7079;

  --header-bg: rgba(20, 22, 27, 0.88);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.22s ease, color 0.22s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.num { font-family: var(--num-font); font-feature-settings: 'tnum' 1; letter-spacing: 0.01em; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.fw { flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.items-start { align-items: start; }
/* Grid children default to min-width:auto, which lets wide tables blow the
   track out; force them to shrink so inner .table-wrap can scroll instead. */
.grid > *, .split > *, .trade-layout > *, .trade-layout-3 > * { min-width: 0; }
.split { grid-template-columns: 1.35fr 1fr; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; }

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 26px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s, background-color 0.15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--brand); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }
.lang-btn { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700; }

/* Icon shows the mode you switch to. */
[data-theme='light'] .icon-sun { display: none; }
[data-theme='dark'] .icon-moon { display: none; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, filter 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-up { background: var(--up); color: #fff; }
.btn-down { background: var(--down); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ----------------------------------------------------------------- cards -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 16px; }
.card-body { padding: 16px 20px; }
.soft { background: var(--surface-2); }

.section { padding: 64px 0; }
.section-tight { padding: 36px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.02em; }
.section-head p { color: var(--text-2); margin-top: 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-600);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
[data-theme='dark'] .eyebrow { color: var(--brand); }

/* ------------------------------------------------------------------ hero -- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 60px;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(240, 185, 11, 0.22), transparent 62%),
    radial-gradient(700px 380px at 8% 12%, rgba(11, 186, 153, 0.12), transparent 60%),
    var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 48px; letter-spacing: -0.03em; }
.hero h1 .hl { color: var(--brand); }
.hero .lead { margin-top: 18px; color: var(--text-2); font-size: 16px; max-width: 46ch; }
.hero-cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  margin-top: 34px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; padding-top: 22px; border-top: 1px solid var(--line);
}
.hero-stats b { display: block; font-size: 24px; font-family: var(--num-font); }
.hero-stats span { color: var(--text-2); font-size: 12.5px; }

.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art .glow {
  position: absolute; inset: 12% 6% 6% 12%;
  background: radial-gradient(circle, rgba(240, 185, 11, 0.4), transparent 68%);
  filter: blur(38px); z-index: 0;
}

/* Phone mock built from APK sprites. */
.phone {
  position: relative; z-index: 1;
  width: 320px; margin: 0 auto;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2d36, #101318);
  box-shadow: var(--shadow-2);
}
.phone-screen {
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface);
  height: 620px;
  display: flex; flex-direction: column;
}
.phone-status {
  height: 26px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-size: 11px; color: var(--text-2);
}
.phone-body { flex: 1; overflow: hidden; padding: 0 14px; }
.phone-tabbar {
  height: 54px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.phone-tabbar .tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; color: var(--text-2);
}
.phone-tabbar img { width: 22px; height: 22px; object-fit: contain; }

/* --------------------------------------------------------------- sprites -- */

.ico { width: 22px; height: 22px; object-fit: contain; flex: none; }
.ico-28 { width: 28px; height: 28px; object-fit: contain; flex: none; }
.ico-18 { width: 18px; height: 18px; object-fit: contain; flex: none; }
.ico-16 { width: 16px; height: 16px; object-fit: contain; flex: none; }
[data-theme='dark'] img[data-night] { content: attr(data-night-src); }

.coin-ico {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: contain; background: var(--surface-2); flex: none;
}
.coin-ico-lg { width: 38px; height: 38px; border-radius: 50%; object-fit: contain; flex: none; }

.avatar-fallback {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-600);
  font-weight: 700; font-size: 12px; flex: none;
}

/* Feature tiles use the APK's own background art. */
.feature-tile {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--line);
  overflow: hidden;
  min-height: 168px;
  padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--surface);
  transition: transform 0.18s, box-shadow 0.18s;
}
.feature-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.feature-tile .art {
  position: absolute; right: -10px; bottom: -14px;
  width: 148px; opacity: 0.95; pointer-events: none;
}
.feature-tile h3 { font-size: 17px; position: relative; }
.feature-tile p { color: var(--text-2); font-size: 13px; margin-top: 6px; position: relative; max-width: 62%; }
.feature-tile a { position: relative; font-size: 13px; font-weight: 700; color: var(--brand-600); }

/* ---------------------------------------------------------------- tables -- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: right; font-weight: 600; color: var(--text-2);
  font-size: 12.5px; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl td {
  text-align: right; padding: 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl tbody tr { transition: background-color 0.12s; cursor: pointer; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted::after { content: ' ▾'; color: var(--brand); }
th.sorted.asc::after { content: ' ▴'; }

.sym { display: flex; align-items: center; gap: 10px; }
.sym b { font-weight: 700; }
.sym span { color: var(--text-3); font-size: 12px; }
.sym .co-name { display: block; font-size: 11.5px; color: var(--text-2); }

.poster {
  width: 148px; max-height: 190px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--line);
}

.spark { width: 92px; height: 30px; display: block; }
.pair-price { font-family: var(--num-font); font-weight: 700; }
.pct-pill {
  display: inline-block; min-width: 68px; text-align: center;
  padding: 3px 8px; border-radius: var(--r-xs);
  font-family: var(--num-font); font-weight: 700; color: #fff;
}
.pct-pill.up { background: var(--up); }
.pct-pill.down { background: var(--down); }
.pct-pill.flat { background: var(--text-3); }

/* ----------------------------------------------------------------- forms -- */

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.field label.row-b { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--text-3); }
.input-lg { height: 52px; font-size: 16px; }
.input.num { font-family: var(--num-font); }

.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; }
.input-group .btn { flex: none; height: auto; }

.field-err { color: var(--down); font-size: 12px; margin-top: 6px; min-height: 16px; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check a { color: var(--brand-600); font-weight: 600; }
[data-theme='dark'] .check a { color: var(--brand); }

.switch {
  position: relative; width: 44px; height: 24px; flex: none;
  border-radius: 999px; background: var(--line-2); cursor: pointer;
  border: none; padding: 0; transition: background-color 0.18s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch[aria-checked='true'] { background: var(--brand); }
.switch[aria-checked='true']::after { transform: translateX(20px); }

/* ------------------------------------------------------------------ tabs -- */

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 8px 14px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--brand-ink); background: var(--brand); font-weight: 700; }
.tabs-underline { gap: 0; border-bottom: 1px solid var(--line); }
.tabs-underline .tab {
  border-radius: 0; border-bottom: 2px solid transparent;
  padding: 10px 14px; background: transparent;
}
.tabs-underline .tab.active {
  color: var(--text); background: transparent; border-bottom-color: var(--brand);
}

.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--line); }
.seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 16px; border-radius: var(--r-xs); font-weight: 600;
  color: var(--text-2); font-size: 13px;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg.seg-up button.active { background: var(--up); color: #fff; }
.seg.seg-down button.active { background: var(--down); color: #fff; }

/* ------------------------------------------------------------- list rows -- */

.list { border-radius: var(--r); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.list-row:last-child { border-bottom: none; }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: var(--surface-2); }
.list-row .t { font-weight: 600; }
.list-row .s { color: var(--text-2); font-size: 12.5px; }
.chev { margin-left: auto; color: var(--text-3); width: 16px; height: 16px; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2);
}
.badge-gold { background: var(--brand-soft); color: var(--brand-600); }
[data-theme='dark'] .badge-gold { color: var(--brand); }
.badge-up { background: rgba(11, 186, 153, 0.14); color: var(--up); }
.badge-down { background: rgba(238, 62, 87, 0.14); color: var(--down); }

/* ------------------------------------------------------------- panels ----- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.panel-head h4 { font-size: 14px; }
.panel-body { padding: 12px 14px; }

.book { font-size: 12.5px; }
.book-row {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 14px;
  font-family: var(--num-font);
  cursor: pointer;
}
.book-row .depth {
  position: absolute; top: 0; bottom: 0; right: 0;
  background: rgba(238, 62, 87, 0.12);
  pointer-events: none;
}
.book-row.bid .depth { background: rgba(11, 186, 153, 0.12); }
.book-row span { position: relative; }
.book-mid {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

.kline-box { position: relative; width: 100%; border-radius: var(--r-sm); overflow: hidden; }
.kline-box canvas { width: 100%; display: block; }
.kline-legend {
  position: absolute; top: 8px; left: 10px;
  display: flex; gap: 12px; font-size: 11.5px;
  font-family: var(--num-font); color: var(--text-2);
  pointer-events: none;
}

.stat-card { padding: 16px; }
.stat-card .k { color: var(--text-2); font-size: 12.5px; }
.stat-card .v { font-size: 22px; font-weight: 700; font-family: var(--num-font); margin-top: 6px; }

.ticker-strip {
  display: flex; gap: 26px; overflow-x: auto;
  padding: 12px 0; scrollbar-width: none;
}
.ticker-strip::-webkit-scrollbar { display: none; }
.ticker {
  flex: none; display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; white-space: nowrap;
}
.ticker b { font-family: var(--num-font); }

/* ---------------------------------------------------- notices / footer ---- */

.notice-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: var(--surface-2); }
.notice-item .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  flex: none;
}
.notice-item time { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-family: var(--num-font); }

.prose { max-width: 78ch; }
.prose h2 { font-size: 20px; margin: 30px 0 10px; }
.prose h3 { font-size: 16px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text-2); margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.prose strong { color: var(--text); }

.acc { border-bottom: 1px solid var(--line); }
.acc summary {
  cursor: pointer; padding: 16px 0; font-weight: 600;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; color: var(--text-3); font-size: 18px; }
.acc[open] summary::after { content: '−'; }
.acc p { color: var(--text-2); padding-bottom: 16px; }

.site-footer {
  margin-top: 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: 48px 0 28px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer-grid h4 { font-size: 14px; margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--text-2); font-size: 13px; padding: 5px 0; }
.footer-grid a:hover { color: var(--brand-600); }
.footer-bottom {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 12.5px;
}

/* ------------------------------------------------------------ bottom nav -- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: none;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; color: var(--text-2); font-weight: 600;
}
.tabbar a img { width: 23px; height: 23px; object-fit: contain; }
.tabbar a.active { color: var(--brand); }

/* ---------------------------------------------------------------- toast --- */

.toast-host {
  position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(24, 26, 32, 0.94); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-2); animation: toast-in 0.2s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ app pages --- */

.app-page { padding: 22px 0 46px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-title h1 { font-size: 24px; }
.page-title p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

.balance-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #1b1e26 0%, #0b0e13 60%, #201d10 100%);
}
.balance-card::after {
  content: ''; position: absolute; right: -60px; top: -70px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 185, 11, 0.35), transparent 70%);
}
.balance-card .label { color: rgba(255, 255, 255, 0.62); font-size: 12.5px; }
.balance-card .amount { font-size: 34px; font-weight: 700; font-family: var(--num-font); margin-top: 6px; }
.balance-card .actions { display: flex; gap: 10px; margin-top: 20px; position: relative; }
.balance-card .actions .btn { background: rgba(255, 255, 255, 0.14); color: #fff; backdrop-filter: blur(4px); }
.balance-card .actions .btn.primary { background: var(--brand); color: var(--brand-ink); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
}
.quick:hover { border-color: var(--brand); color: var(--text); }

.profile-head {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 20px;
  background: linear-gradient(120deg, rgba(240, 185, 11, 0.18), transparent 55%), var(--surface);
  border: 1px solid var(--line);
}
.profile-head .who { display: flex; align-items: center; gap: 14px; }
.profile-head .ava {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--brand-soft); display: grid; place-items: center;
  font-weight: 700; font-size: 20px; color: var(--brand-600);
}
[data-theme='dark'] .profile-head .ava { color: var(--brand); }
.profile-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 18px;
}
.profile-metrics div { text-align: center; }
.profile-metrics b { display: block; font-family: var(--num-font); font-size: 17px; }
.profile-metrics span { color: var(--text-2); font-size: 11.5px; }

.trade-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.trade-layout-3 { display: grid; grid-template-columns: 250px 1fr 300px; gap: 16px; }
.side-pairs { max-height: 560px; overflow-y: auto; }
.side-pairs .prow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; cursor: pointer; font-size: 13px;
}
.side-pairs .prow:hover, .side-pairs .prow.active { background: var(--surface-2); }
.side-pairs .prow.active { box-shadow: inset 2px 0 0 var(--brand); }

.agree-note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--text-2);
}

.stepper { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.stepper .dot-n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-600); font-weight: 700; font-size: 11.5px;
}
.stepper .line { flex: 1; height: 1px; background: var(--line-2); }

.alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--brand-soft); font-size: 12.5px; color: var(--text-2);
}
.alert.warn { background: rgba(238, 62, 87, 0.1); }

.qr-box {
  width: 168px; height: 168px; border-radius: var(--r);
  background: #fff; padding: 10px; border: 1px solid var(--line);
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%; animation: sk 1.2s linear infinite;
  border-radius: var(--r-xs); color: transparent;
}
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-layout-3 { grid-template-columns: 210px 1fr; }
  .trade-layout-3 .col-right { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .hero h1 { font-size: 38px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .tabbar { display: flex; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-layout, .trade-layout-3 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .side-pairs { max-height: none; }
  .section { padding: 40px 0; }
  .hero { padding: 36px 0 34px; }
  .hero h1 { font-size: 30px; }
  .hero-stats b { font-size: 19px; }
  .wrap { padding: 0 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-title { flex-direction: column; align-items: flex-start; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .balance-card .amount { font-size: 27px; }
  .desk-only { display: none !important; }
}

@media (max-width: 560px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .feature-tile p { max-width: 70%; }
  .hero-cta .btn { flex: 1; }
  .profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .card-pad { padding: 16px; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 10px 8px; }
  .spark { width: 64px; }
  .phone { width: 252px; padding: 8px; border-radius: 32px; }
  .phone-screen { height: 512px; border-radius: 26px; }
  .phone-body { padding: 0 11px; }
  .hero-stats { gap: 12px; }
}

@media print { .site-header, .tabbar, .site-footer { display: none; } }
