/* =============================================================
   乾坤谦 Q.DAO — H5 Design System
   美学方向：东方天文仪轨 × 精密金融仪表（Orbit / Minimal-Precision）
   ============================================================= */

/* ---------- 1. Design Tokens ----------
   色调参考币安（Binance）：深石墨底 + 币安黄主色 + 中性冷灰
   ── 画布   #1E2329 / #181A20   深石墨，卡面比底色略亮一档
   ── 主色   #F0B90B / #FCD535   币安黄：主按钮、核心数值、激活态
   ── 中性   #EAECEF → #5E6673   冷灰文字阶，不带任何暖调
   ── 语义   #0ECB81 涨 / #F6465D 跌（国际习惯；中文版另行反转）        */
:root {
  color-scheme: dark;

  /* 画布层：三级石墨，越深越往外 */
  --canvas:       oklch(21.8% 0.012 270.8);   /* #181A20 页面底色 */
  --canvas-2:     oklch(16.2% 0.008 248.3);   /* #0B0E11 页头渐隐 / 最深压边 */
  --canvas-3:     oklch(20.2% 0.011 262);     /* Tab 栏，比画布略沉，靠描边界定 */

  /* 纸面：卡面比底色亮一档，靠明度分层而非发丝线 */
  --paper:        oklch(20.8% 0.011 262);     /* 二级页整页：与卡片同属一级，比画布亮 */
  --paper-sunk:   oklch(24.4% 0.013 260);     /* 下沉区（seg 底、calc 底） */
  --surface:      oklch(25.4% 0.014 253.1);   /* #1E2329 卡片 */
  --surface-2:    oklch(31.1% 0.017 255.6);   /* #2B3139 浮起 / 选中 */
  --line:         oklch(30.0% 0.016 255);
  --line-soft:    oklch(26.2% 0.014 255);
  --line-strong:  oklch(37.5% 0.018 258);

  /* 文字：币安四级灰 */
  --ink:          oklch(94.2% 0.005 258.3);   /* #EAECEF 主文字 */
  --ink-2:        oklch(79.6% 0.014 258.4);   /* #B7BDC6 次文字 */
  --ink-3:        oklch(64.3% 0.024 256.8);   /* #848E9C 辅助文字 */
  --ink-4:        oklch(50.8% 0.023 260.1);   /* #5E6673 极弱 */
  --ink-inv:      oklch(21.8% 0.012 271);     /* 黄底上的深字 */

  /* 画布上的文字（与纸面文字同阶，保证一致性） */
  --on-canvas:    oklch(94.2% 0.005 258.3);
  --on-canvas-2:  oklch(79.6% 0.014 258.4);

  /* 币安黄 —— 主色：主按钮、核心数值、激活态、仪轨环 */
  --binance:      oklch(81.3% 0.165 86.7);    /* #F0B90B */
  --binance-600:  oklch(73.7% 0.151 89.8);    /* #CFA400 按下态 */
  --binance-soft: oklch(30.0% 0.048 85);      /* 黄底浅衬（暗色下是深橄榄） */
  --binance-line: oklch(40.0% 0.080 86);
  --binance-ink:  oklch(86.5% 0.160 90);      /* 深底上的黄字（比原色更亮一点） */

  /* 语义别名：沿用既有组件职责，避免全站重写
     --navy 系 → 中性结构灰 / --red 系 → 跌色 / --gold 系 → 币安黄 */
  --navy:         oklch(31.1% 0.017 255.6);
  --navy-600:     oklch(25.4% 0.014 253.1);
  --navy-soft:    oklch(26.4% 0.014 255);
  --navy-line:    oklch(36.0% 0.018 256);
  --navy-ink:     oklch(88.5% 0.012 258);

  --red:          oklch(65.4% 0.211 18.2);    /* #F6465D 跌 / 警示 */
  --red-600:      oklch(58.0% 0.195 18.2);
  --red-soft:     oklch(30.0% 0.070 16);
  --red-line:     oklch(42.0% 0.110 16);
  --red-ink:      oklch(72.0% 0.170 18);      /* 跌色文字档 */

  --gold:         oklch(81.3% 0.165 86.7);    /* = 币安黄，装饰与高光 */
  --gold-bright:  oklch(88.1% 0.168 94.2);    /* #FCD535 hover 亮黄 */
  --gold-soft:    oklch(30.0% 0.048 85);
  --gold-line:    oklch(40.0% 0.080 86);
  --gold-ink:     oklch(86.5% 0.160 90);

  --indigo:       var(--binance);
  --indigo-600:   var(--binance-600);
  --indigo-soft:  var(--binance-soft);
  --indigo-line:  var(--binance-line);
  --teal:         oklch(72% 0.020 256);
  --teal-soft:    oklch(27% 0.014 256);

  /* 语义：涨绿跌红（国际惯例）；中文版由 [data-updown=cn] 反转 */
  --up:           oklch(74.3% 0.171 158.1);   /* #0ECB81 */
  --up-soft:      oklch(30.0% 0.060 158);
  --down:         oklch(65.4% 0.211 18.2);    /* #F6465D */
  --down-soft:    oklch(30.0% 0.070 16);
  --warn:         oklch(81.3% 0.165 86.7);
  --warn-soft:    oklch(30.0% 0.048 85);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num:  "SF Pro Display", "Helvetica Neue", -apple-system, "Segoe UI", Arial, sans-serif;

  /* 字阶（流体） */
  --fs-11: clamp(10px, 2.7vw, 11px);
  --fs-12: clamp(11px, 3.0vw, 12px);
  --fs-13: clamp(12px, 3.2vw, 13px);
  --fs-14: clamp(13px, 3.4vw, 14px);
  --fs-16: clamp(15px, 3.9vw, 16px);
  --fs-18: clamp(16px, 4.4vw, 18px);
  --fs-22: clamp(19px, 5.4vw, 22px);
  --fs-28: clamp(23px, 6.9vw, 28px);
  --fs-34: clamp(28px, 8.6vw, 34px);

  /* 间距（4px 基准） */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* 圆角：分级而非统一 */
  --r-xs: 5px; --r-sm: 8px; --r-md: 13px; --r-lg: 18px; --r-pill: 999px;

  /* 阴影：极淡，靠线而非靠影 */
  --sh-1: 0 1px 2px oklch(21% 0.03 262 / .05);
  --sh-2: 0 2px 10px -4px oklch(21% 0.03 262 / .12), 0 1px 2px oklch(21% 0.03 262 / .04);
  --sh-pop: 0 -8px 40px -12px oklch(21% 0.03 262 / .22);

  /* 动效 */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --d-1: 160ms; --d-2: 300ms; --d-3: 520ms;
}

/* —— 浅色版（币安浅色模式）——
   白底 + 极浅灰卡 + 同一枚币安黄；黄在白底上写不动字，所以文字走深石墨 */
[data-theme="light"] {
  color-scheme: light;

  --canvas:       oklch(98.5% 0.002 250);   /* #FAFAFA 页面底 */
  --canvas-2:     oklch(95.5% 0.003 250);   /* #F5F5F5 页头渐隐 */
  --canvas-3:     oklch(99.4% 0.001 250);   /* Tab 栏（白） */

  --paper:        oklch(99.4% 0.001 250);
  --paper-sunk:   oklch(95.8% 0.003 250);   /* #F5F5F5 下沉区 */
  --surface:      oklch(99.6% 0.001 250);   /* 白卡 */
  --surface-2:    oklch(95.2% 0.004 250);   /* 浮起 / 选中 */
  --line:         oklch(91.0% 0.004 255);   /* #E6E8EA */
  --line-soft:    oklch(94.0% 0.003 255);
  --line-strong:  oklch(85.0% 0.006 255);

  --ink:          oklch(24.0% 0.010 258);   /* #1C1F24 主文字 */
  --ink-2:        oklch(41.0% 0.012 258);   /* #464B51 */
  --ink-3:        oklch(52.0% 0.014 258);   /* #646971（白底 5.5，原 #848E9C 仅 3.3 不及格） */
  --ink-4:        oklch(64.0% 0.010 258);
  --ink-inv:      oklch(21.8% 0.012 271);   /* 黄底上的深字 */

  --on-canvas:    oklch(24.0% 0.010 258);
  --on-canvas-2:  oklch(41.0% 0.012 258);

  /* 黄在白底上对比度只有 1.9，不能当文字色：
     实色底照用币安黄（配深石墨字），文字档压深到 #9C7400（白 4.28 / 纸 4.10 / 沉底 3.92） */
  --binance:      oklch(81.3% 0.165 86.7);   /* #F0B90B 实色块 */
  --binance-600:  oklch(73.7% 0.151 89.8);   /* #CFA400 按下 */
  --binance-soft: oklch(97.6% 0.028 92);
  --binance-line: oklch(91.0% 0.062 90);
  --binance-ink:  oklch(58.5% 0.115 84.2);   /* #9C7400 白底上的黄字 */

  --navy:         oklch(25.4% 0.014 253.1);
  --navy-600:     oklch(21.8% 0.012 271);
  --navy-soft:    oklch(95.0% 0.004 255);
  --navy-line:    oklch(88.0% 0.006 255);
  --navy-ink:     oklch(30.0% 0.012 256);

  --red:          oklch(55.0% 0.185 18.2);   /* #C22B41 白底 5.65 */
  --red-600:      oklch(48.0% 0.175 18.2);
  --red-soft:     oklch(96.0% 0.022 18);
  --red-line:     oklch(90.0% 0.055 18);
  --red-ink:      var(--red);

  --gold:         oklch(81.3% 0.165 86.7);
  --gold-bright:  oklch(88.1% 0.168 94.2);
  --gold-soft:    oklch(97.6% 0.028 92);
  --gold-line:    oklch(91.0% 0.062 90);
  --gold-ink:     oklch(58.5% 0.115 84.2);

  --indigo:       var(--binance-ink);
  --indigo-600:   var(--binance-600);
  --indigo-soft:  var(--binance-soft);
  --indigo-line:  var(--binance-line);
  --teal:         oklch(41.0% 0.014 256);
  --teal-soft:    oklch(95.5% 0.004 256);

  --up:           oklch(52.0% 0.135 152);    /* #1A7A3C 白底/沉底 双过 AA */
  --up-soft:      oklch(96.0% 0.030 158);
  --down:         oklch(55.0% 0.185 18.2);
  --down-soft:    oklch(96.0% 0.022 18);
  --warn:         oklch(58.5% 0.115 84.2);
  --warn-soft:    oklch(97.6% 0.028 92);

  --sh-1: 0 1px 2px oklch(24% 0.010 258 / .06);
  --sh-2: 0 2px 10px -4px oklch(24% 0.010 258 / .12), 0 1px 2px oklch(24% 0.010 258 / .05);
  --sh-pop: 0 -8px 40px -12px oklch(24% 0.010 258 / .22);
}

/* —— 涨跌色反转（中文习惯）：涨红跌绿 —— */
[data-updown="cn"] {
  --up:   var(--red);
  --down: oklch(74.3% 0.171 158.1);
}
[data-theme="light"][data-updown="cn"] {
  --up:   var(--red);
  --down: oklch(56.0% 0.155 158.1);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 数字：仪表面必须对齐 */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
  letter-spacing: -.01em;
}

/* ---------- 3. Shell ---------- */
/* 设备壳 = 石墨底；纸面（卡片 / 二级页 / 弹层）亮一档浮在它之上 */
.device {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--canvas);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 760px) {
  body { display: grid; place-items: center; padding: 28px; background:
      radial-gradient(120% 90% at 15% 0%, oklch(30% 0.016 256) 0%, oklch(23% 0.013 265) 58%, oklch(16% 0.009 250) 100%); }
  .device {
    height: min(880px, calc(100vh - 56px));
    border-radius: 30px;
    overflow-y: auto; overflow-x: hidden;
    box-shadow: 0 30px 70px -30px oklch(0% 0 0 / .70), 0 0 0 1px oklch(100% 0 0 / .06);
  }
  .device::-webkit-scrollbar { width: 0; }
}

/* 顶部仪轨光晕：石墨底上一束币安黄微光 + 同心刻度环，冷静不吵闹 */
.orb-bg {
  position: absolute; inset: 0 0 auto 0; height: 340px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(70% 105% at 50% -14%, color-mix(in oklab, var(--binance) 13%, transparent) 0%, transparent 72%),
    radial-gradient(54% 80% at 88% 2%, color-mix(in oklab, var(--binance) 7%, transparent) 0%, transparent 70%),
    repeating-radial-gradient(circle at 50% -6%, transparent 0 46px,
      color-mix(in oklab, var(--ink) 5%, transparent) 46px 46.7px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
  opacity: .95;
}

/* 顶栏：与画布同色的半透明浮层，吸顶时下沿透出币安黄 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s-3);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--s-4) 10px;
  background: color-mix(in oklab, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent;
  color: var(--on-canvas);
  transition: border-color var(--d-2) var(--ease), background var(--d-2) var(--ease);
}
.topbar.is-stuck {
  border-bottom-color: color-mix(in oklab, var(--binance) 40%, transparent);
  background: color-mix(in oklab, var(--canvas) 93%, transparent);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .brand-mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  overflow: hidden;
  /* 石墨底衬托：深橄榄光环，币安黄细描边 —— 让八卦圆盘从暗底里浮出来 */
  padding: 2px;
  background: oklch(96% 0.030 92);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--binance) 85%, transparent), 0 1px 3px oklch(0% 0 0 / .45);
}
.topbar .brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
[data-theme="light"] .topbar .brand-mark {
  background: oklch(98% 0.012 92);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--binance) 90%, transparent), 0 1px 3px oklch(24% 0.01 258 / .12);
}

/* 币种圆标使用真实 LOGO 时的统一外壳（浅底衬托） */
.coin--logo {
  background: var(--gold-soft);
  padding: 2px;
  box-shadow: 0 0 0 1px var(--gold-line);
  overflow: hidden;
}
.coin--logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
[data-theme="light"] .coin--logo {
  background: oklch(98% 0.012 92);
  box-shadow: 0 0 0 1px var(--binance-line);
}
.topbar .brand-name { font-size: var(--fs-13); font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
/* 当前主菜单标题：居中 */
.topbar-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: var(--fs-14); font-weight: 620; letter-spacing: .02em;
  color: var(--on-canvas); pointer-events: none; white-space: nowrap;
}
@media (max-width: 374px) { .topbar-title { display: none; } }

/* ---------- 语言切换栏（右上角常驻，含国旗） ---------- */
.lang-bar { display: flex; align-items: center; gap: 4px; flex: none; }
.lang-pick {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 7px;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  border-radius: var(--r-sm);
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  color: var(--on-canvas);
  transition: border-color var(--d-1) var(--ease), background var(--d-1) var(--ease), color var(--d-1) var(--ease);
}
.lang-pick:active { background: color-mix(in oklab, var(--ink) 14%, transparent); }
.lang-pick[aria-expanded="true"] {
  border-color: color-mix(in oklab, var(--binance) 85%, transparent);
  background: color-mix(in oklab, var(--binance) 14%, transparent);
  color: var(--binance-ink);
}
.lang-pick .caret { opacity: .7; transition: transform var(--d-1) var(--ease); }
.lang-pick[aria-expanded="true"] .caret { transform: rotate(180deg); }
.lang-code { font-size: var(--fs-11); font-weight: 700; letter-spacing: .06em; }

/* 国旗统一圆角描边，避免白旗融进底色 */
.flag {
  border-radius: 2.5px; flex: none;
  box-shadow: 0 0 0 1px oklch(21% 0.03 262 / .18);
}

.lang-menu {
  position: absolute; z-index: 45;
  top: calc(env(safe-area-inset-top, 0px) + 54px); right: var(--s-4);
  width: 198px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  box-shadow: 0 12px 32px -12px oklch(21% 0.04 262 / .28), 0 1px 2px oklch(21% 0.03 262 / .06);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--d-1) var(--ease), transform var(--d-1) var(--ease);
}
.lang-menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu-h {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 8px 7px;
  font-size: var(--fs-11); font-weight: 700; letter-spacing: .08em; color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft); margin-bottom: 4px;
}
.lang-menu-h .sub { font-weight: 500; letter-spacing: .02em; opacity: .7; }
.lang-opt {
  display: grid; grid-template-columns: 24px 1fr auto 15px; align-items: center;
  gap: 9px; width: 100%;
  min-height: 40px; padding: 0 8px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background var(--d-1) var(--ease);
}
.lang-opt:hover, .lang-opt:focus-visible { background: var(--paper-sunk); }
.lang-opt .ln { font-size: var(--fs-13); color: var(--ink); }
.lang-opt .lc {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3);
  padding: 1px 4px; border-radius: 3px; background: var(--paper-sunk);
}
.lang-opt .ok { color: var(--indigo); opacity: 0; transition: opacity var(--d-1) var(--ease); }
.lang-opt[aria-selected="true"] { background: var(--indigo-soft); }
.lang-opt[aria-selected="true"] .ln { color: var(--indigo); font-weight: 600; }
.lang-opt[aria-selected="true"] .ok { opacity: 1; }
.lang-opt[aria-selected="true"] .lc { background: transparent; color: var(--indigo); }

.wallet-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--fs-12); color: var(--ink-2);
  min-height: 30px;
}
.wallet-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--down); box-shadow: 0 0 0 3px color-mix(in oklab, var(--down) 22%, transparent);
}
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm); color: inherit;
  transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease);
}
.topbar .icon-btn { color: var(--on-canvas); }
.topbar .icon-btn:active { background: color-mix(in oklab, var(--ink) 10%, transparent); }
.icon-btn:active { background: var(--paper-sunk); color: var(--ink); }

/* 主内容区：默认文字为红底上的暖白；卡片内部自行覆盖为墨色 */
.main {
  position: relative; z-index: 1;
  padding: 0 var(--s-4) calc(84px + env(safe-area-inset-bottom, 0px));
  color: var(--on-canvas);
}
.screen { display: none; animation: screenIn var(--d-2) var(--ease); }
.screen.is-active { display: block; }
/* 关键帧只定义 from、不含 opacity：动画被禁/时钟不推进时页面依然完全可见 */
@keyframes screenIn {
  from { transform: translateY(6px); }
}

/* ---------- 4. 排版组件 ---------- */
.sec { margin-top: var(--s-6); }
.sec + .sec { margin-top: var(--s-7, 28px); }
.sec-head {
  display: flex; align-items: baseline; gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.sec-title {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-14); font-weight: 600; letter-spacing: .01em; margin: 0;
  color: var(--on-canvas);
}
/* 卦象方位点：品牌性三点刻度装饰（石墨底上点亮币安黄，透明度递减形成层次） */
.ticks { display: inline-flex; gap: 2.5px; }
.ticks i { width: 2.5px; height: 2.5px; border-radius: 50%; background: var(--binance); opacity: .95; }
.ticks i:nth-child(2) { opacity: .62; }
.ticks i:nth-child(3) { opacity: .36; }
.sec-more { margin-left: auto; font-size: var(--fs-12); color: var(--on-canvas-2); }

.h1 { font-size: var(--fs-22); font-weight: 650; letter-spacing: -.01em; margin: 0; }
.h2 { font-size: var(--fs-18); font-weight: 620; letter-spacing: -.005em; margin: 0; }
.sub { font-size: var(--fs-12); color: var(--ink-3); margin: 0; }
.label { font-size: var(--fs-11); color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
/* 画布上的辅助文字（标题下方说明、金额单位、环心标签） */
.main > .screen > .sub,
.orbit-center .label,
.orbit-center .k { color: var(--on-canvas-2); }

/* ---------- 5. 卡片 / 面板：比画布亮一档的浮层卡片 ---------- */
/* 纸面容器统一「自己负责自己的墨色」，避免继承画布层的浅字 */
.panel, .list, .stat-grid, .stat-tri, .stat, .plan, .seg, .calc, .note,
.quick, .table, .invite-code, .field {
  color: var(--ink);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
}
.panel--flat { background: none; border: 0; padding: 0; color: inherit; }
.panel--sunk { background: var(--paper-sunk); border-color: transparent; }

/* 推广卡：邀请码 + 分享链接 */
.invite { position: relative; overflow: hidden; isolation: isolate; }
.invite::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 88px; z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--gold-soft) 0%, transparent 100%); opacity: .7;
}
.invite > * { position: relative; z-index: 1; }
.invite-code-wrap { position: relative; }
.invite-code {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  margin-top: 6px; padding: 10px var(--s-3) 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px dashed var(--gold-line);
}
.invite-code .num {
  font-size: var(--fs-18); font-weight: 660; letter-spacing: .16em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.invite-code .icon-btn { color: var(--binance-ink); width: 30px; height: 30px; }
.hr { height: 1px; background: var(--line); border: 0; margin: var(--s-4) 0; }
.hr--dash { background: none; border-top: 1px dashed var(--line-strong); }

/* 仪轨环（核心记忆点）：环心数值直接在画布上 → 用币安黄高亮，成为视觉锚点 */
.orbit {
  position: relative;
  display: grid; place-items: center;
  padding: var(--s-2) 0;
}
.orbit svg { overflow: visible; }
.orbit-center {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center; gap: 2px;
}
.orbit-center .v { font-size: var(--fs-28); font-weight: 700; letter-spacing: -.02em; color: var(--binance-ink); }
.orbit-center .k { font-size: var(--fs-11); letter-spacing: .06em; }
.ring-track { stroke: color-mix(in oklab, var(--on-canvas) 24%, transparent); }
/* 仪轨环：暖金主环 + 暖白当前段，在红底上双色咬合 */
.ring-fill { stroke: var(--binance); stroke-linecap: round; transition: stroke-dashoffset var(--d-3) var(--ease); }
.ring-fill--gold { stroke: var(--ink-3); }
.ring-tick { stroke: color-mix(in oklab, var(--on-canvas) 42%, transparent); }

/* ---------- 7. 数据单元：纸面内的数值用正红 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  color: var(--ink);
}
.stat {
  background: var(--surface); padding: var(--s-3) var(--s-4);
  display: grid; gap: 3px;
}
.stat .k { font-size: var(--fs-11); color: var(--ink-3); }
/* 数据格数值：币安黄承担「信息主体」——全站唯一高饱和色，其余都是石墨灰阶 */
.stat .v { font-size: var(--fs-16); font-weight: 700; color: var(--binance-ink); }

/* 三格数据（我的页概览）：单行三段，等分对齐 */
.stat-tri {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  align-items: stretch;
}
.stat-tri > .stat { background: var(--surface); padding: var(--s-3); gap: 3px; align-content: space-between; }
.stat-tri > .stat .k { line-height: 1.4; }
/* 数值贴底：即使标签折行（日/越），三格的数值基线仍对齐 */
.stat-tri > .stat .v { align-self: end; font-size: var(--fs-15, 15px); }
@media (max-width: 359px) { .stat-tri > .stat .v { font-size: var(--fs-13); } }
.delta { font-size: var(--fs-12); font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }

/* 币对行情行 */
.tape {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-3);
  align-items: center; padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}
.tape:last-child { border-bottom: 0; }
.tape .pair { display: flex; align-items: center; gap: 9px; }
.coin {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink-inv);
}
.coin--q { background: linear-gradient(145deg, oklch(38% 0.100 258), oklch(24% 0.090 258)); }
.coin--b { background: linear-gradient(145deg, oklch(56% 0.195 22), oklch(42% 0.180 22)); }
.coin--u { background: linear-gradient(145deg, oklch(66% 0.11 165), oklch(52% 0.10 165)); }
/* BFC 子币 LOGO：金色徽章，浅色底衬托以免在深色主题下糊成一团 */
.coin.coin--cream { background: oklch(97% 0.02 85); padding: 1px; overflow: hidden; }
.tape .name { font-size: var(--fs-13); font-weight: 600; }
.coin.coin--cream img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.tape .meta { font-size: var(--fs-11); color: var(--ink-3); }
.tape .right { text-align: right; display: grid; gap: 2px; }
.spark { width: 62px; height: 22px; }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 0 var(--s-5);
  border-radius: var(--r-sm);
  font-size: var(--fs-14); font-weight: 600;
  transition: transform var(--d-1) var(--ease), background var(--d-1) var(--ease),
              box-shadow var(--d-1) var(--ease), opacity var(--d-1) var(--ease);
}
.btn:active { transform: scale(.985); }
.btn--primary {
  background: var(--binance); color: var(--ink-inv);
  font-weight: 700;
  box-shadow: 0 1px 0 color-mix(in oklab, #fff 26%, transparent) inset;
}
.btn--primary:active { background: var(--binance-600); }
.btn--gold { background: var(--binance); color: var(--ink-inv); font-weight: 700; }
.btn--outline { background: none; color: var(--binance-ink); border: 1px solid var(--binance); }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn--quiet { background: var(--paper-sunk); color: var(--ink-2); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

/* 快捷入口：不是方块图标堆，而是带刻度的横条 */
.quick {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
}
.quick-item {
  display: grid; justify-items: center; gap: 7px;
  padding: var(--s-3) 2px;
  border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--d-1) var(--ease), transform var(--d-1) var(--ease);
}
.quick-item:active { transform: translateY(1px); border-color: var(--indigo-line); }
.quick-item .qi {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; color: var(--indigo); background: var(--indigo-soft);
}
.quick-item .qt { font-size: var(--fs-11); color: var(--ink-2); }

/* ---------- 9. 标签 / 徽章 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-11); font-weight: 600;
  background: var(--paper-sunk); color: var(--ink-2);
  border: 1px solid transparent;
}
.chip--indigo { background: var(--navy-soft); color: var(--navy-ink); border-color: var(--navy-line); }
.chip--gold   { background: var(--binance-soft); color: var(--binance-ink); border-color: var(--binance-line); }
.chip--teal   { background: var(--teal-soft); color: var(--teal); }
/* 涨跌 chip 与 [data-updown] 联动：暗色底上字色用亮档，浅色底上压深以免"粉" */
.chip--up     { background: var(--up-soft); color: var(--up); }
.chip--down   { background: var(--down-soft); color: var(--down); }
[data-theme="light"] .chip--up   { color: oklch(52.0% 0.135 152); }
[data-theme="light"] .chip--down { color: oklch(55.0% 0.185 18.2); }
.rank {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 22px; padding: 0 7px;
  border-radius: var(--r-xs);
  font-size: var(--fs-11); font-weight: 700; letter-spacing: .04em;
  background: var(--navy-soft); color: var(--navy-ink);
  border: 1px solid var(--navy-line);
}
.rank--gold { background: var(--binance-soft); color: var(--binance-ink); border-color: var(--binance-line); }

/* ---------- 10. 列表 ---------- */
.list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line-soft);
  min-height: 56px;
}
.row:last-child { border-bottom: 0; }
.row--tap { transition: background var(--d-1) var(--ease); }
.row--tap:active { background: var(--paper-sunk); }
.row .lead { flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .body .t, .row .trail .t { display: block; font-size: var(--fs-14); font-weight: 560; }
.row .body .d, .row .trail .d { display: block; font-size: var(--fs-11); color: var(--ink-3); margin-top: 2px; }
.row .trail { text-align: right; flex: none; }
/* 右侧数值（余额 / 金额 / 业绩）：正红承担信息主体 */
.row .trail .t { font-weight: 700; color: var(--binance-ink); }
/* 成员行：右侧三行「自购业绩 / 分享业绩 / 社区业绩」
   用 display:contents 让三行共用父级网格列，标签左对齐、数值右对齐且严格成列 */
.row--member { align-items: center; }
.row--member .trail--kv {
  display: grid; grid-template-columns: auto auto;
  column-gap: var(--s-3); row-gap: 2px;
}
.row--member .kv { display: contents; }
.row--member .kv .k { font-size: var(--fs-11); color: var(--ink-3); text-align: left; white-space: nowrap; line-height: 1.5; }
.row--member .kv .v { font-size: var(--fs-13); font-weight: 660; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.5; }
.chev { color: var(--ink-3); flex: none; }

/* ---------- 11. 计量条 ---------- */
.meter { display: grid; gap: 7px; }
.meter-head { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--fs-12); }
.meter-head .r { margin-left: auto; color: var(--binance-ink); font-weight: 660; }
.bar { height: 6px; border-radius: var(--r-pill); background: var(--paper-sunk); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--binance); transition: width var(--d-3) var(--ease); }
.bar--gold > i { background: var(--binance); }
/* 三段式释放轨（18 个月 = 3 阶段） */
.bar--seg { display: grid; grid-template-columns: 20% 30% 50%; gap: 3px; background: none; height: 8px; }
.bar--seg > span { background: var(--paper-sunk); border-radius: 2px; overflow: hidden; }
.bar--seg > span > i { display: block; height: 100%; background: var(--binance); transition: width var(--d-3) var(--ease); }
.bar--seg > span.is-idle > i { background: var(--ink-3); opacity: .35; }

/* ---------- 12. 表单 ---------- */
.field { display: grid; gap: 7px; }
.field .lab { font-size: var(--fs-12); color: var(--ink-2); }
.input-wrap {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color var(--d-1) var(--ease), box-shadow var(--d-1) var(--ease);
}
.input-wrap:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.input-wrap input {
  flex: 1; min-width: 0; height: 50px;
  border: 0; background: none; outline: none;
  font-size: var(--fs-18); font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.input-wrap .suffix { font-size: var(--fs-13); color: var(--ink-3); flex: none; }
.input-wrap .max { font-size: var(--fs-11); color: var(--indigo); font-weight: 700; padding: 4px 6px; }
.hint { font-size: var(--fs-11); color: var(--ink-3); }
.calc { display: grid; gap: 8px; padding: var(--s-3); border-radius: var(--r-sm); background: var(--paper-sunk); }
.calc .l { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-12); }
.calc .l span:first-child { color: var(--ink-3); }
.calc .l span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 档位选择 */
.plan {
  display: grid; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--d-1) var(--ease), background var(--d-1) var(--ease);
}
.plan[aria-pressed="true"] { border-color: var(--indigo); background: var(--indigo-soft); }
.plan-top { display: flex; align-items: center; gap: var(--s-2); }
.plan-top .fee { font-size: var(--fs-16); font-weight: 700; }
.plan-top .tag { margin-left: auto; }
/* 提现档位：到帳方式紧贴选中点左侧，费率块靠最右，
   中间由 .fee-wrap 的 margin-left:auto 撑开；费率下注「母币手续费」 */
.plan--slim .plan-top .tag { margin-left: 0; }
.plan--slim .plan-top .radio { margin-right: 2px; }
.plan--slim .fee-wrap {
  margin-left: auto; padding-left: var(--s-3);
  display: grid; gap: 1px; justify-items: end; text-align: right;
}
.plan--slim .fee-note { font-size: var(--fs-10, 10px); color: var(--ink-3); line-height: 1.25; white-space: nowrap; }
.plan-sub { font-size: var(--fs-11); color: var(--ink-3); }
/* 单行档位（无子说明）：收紧垂直留白，让一行内容居中 */
.plan--slim { gap: 0; padding-top: var(--s-3); padding-bottom: var(--s-3); min-height: 54px; align-content: center; }
.radio {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
}
.plan[aria-pressed="true"] .radio { border-color: var(--indigo); }
.plan[aria-pressed="true"] .radio::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--indigo);
}

/* 分段切换 */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 2px; padding: 3px;
  background: var(--paper-sunk); border-radius: var(--r-sm);
  color: var(--ink);
}
.seg button {
  min-height: 34px; border-radius: 6px;
  font-size: var(--fs-12); font-weight: 600; color: var(--ink-3);
  transition: background var(--d-1) var(--ease), color var(--d-1) var(--ease);
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- 13. 表格（等级 / 分红） ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-12); table-layout: fixed; }
.table th {
  font-weight: 600; font-size: var(--fs-11); color: var(--ink-3);
  text-align: right; padding: 0 0 8px; letter-spacing: .04em;
}
.table th:first-child, .table td:first-child { text-align: left; }
.table td { padding: 10px 0; text-align: right; border-top: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.table tr.is-me td { color: var(--navy-ink); font-weight: 650; }
/* 等级表列宽：等级 / 自购业绩 / 分享业绩 / 奖励
   数值列收窄并右对齐到自身列宽，整组比原先更靠左，长表头不挤压 */
.table--rank { table-layout: fixed; }
.table--rank th:nth-child(1), .table--rank td:nth-child(1) { width: 22%; }
.table--rank th:nth-child(2), .table--rank td:nth-child(2) { width: 24%; }
.table--rank th:nth-child(3), .table--rank td:nth-child(3) { width: 26%; }
.table--rank th:nth-child(4), .table--rank td:nth-child(4) { width: 28%; }
.table--rank th, .table--rank td { padding-right: 10px; }
.table--rank th:last-child, .table--rank td:last-child { padding-right: 0; }
.donut-legend { display: grid; gap: 8px; margin-top: var(--s-3); }
.donut-legend .l { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 9px; align-items: center; font-size: var(--fs-12); }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .p { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.donut-legend .v { font-weight: 620; font-variant-numeric: tabular-nums; }

/* ---------- 14. 二级页（滑入） ---------- */
/* 二级页 = 一整张浮起的暖白纸，站在红底上；页头用纸面色，不做红底通栏 */
.page {
  position: fixed; inset: 0; z-index: 60;
  display: none;
  background: var(--paper);
  color: var(--ink);
  max-width: 480px; margin: 0 auto;
  overflow-y: auto; overscroll-behavior: contain;
  animation: pageIn var(--d-2) var(--ease);
}
@media (min-width: 760px) {
  .page { inset: 28px auto 28px 50%; transform: translateX(-50%); height: min(880px, calc(100vh - 56px)); border-radius: 30px; }
}
.page.is-open { display: block; }
@keyframes pageIn { from { transform: translateX(16px); } }
@media (min-width: 760px) { @keyframes pageIn { from { opacity: 1; } } }
.page-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s-2);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--s-4) 10px;
  background: color-mix(in oklab, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.page-head .t { font-size: var(--fs-16); font-weight: 620; }
.page-body { padding: var(--s-4) var(--s-4) calc(var(--s-10) + env(safe-area-inset-bottom, 0px)); }
.page-foot {
  position: sticky; bottom: 0;
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

/* ---------- 15. 底部弹窗 ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 55;
  background: oklch(15% 0.02 262 / .42);
  opacity: 0; pointer-events: none; transition: opacity var(--d-2) var(--ease);
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 80; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-pop);
  transform: translateY(102%);
  transition: transform var(--d-2) var(--ease);
  padding: var(--s-3) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 760px) {
  .sheet { left: 50%; transform: translate(-50%, 102%); bottom: 28px; border-radius: var(--r-lg); }
  .sheet.is-open { transform: translate(-50%, 0); }
}
.sheet.is-open { transform: translateY(0); }
.sheet-grip { width: 36px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 0 auto var(--s-3); }
.sheet-title { font-size: var(--fs-16); font-weight: 620; margin: 0 0 var(--s-2); }

/* ---------- 16. Toast ---------- */
.toast-wrap {
  position: fixed; z-index: 100; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 12px);
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
}
/* Toast 用最深的酒红做底、暖白做字，在红底/白卡上都能立住 */
.toast {
  max-width: 88vw;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-pill);
  background: oklch(15% 0.055 18 / .95);
  color: oklch(97% 0.012 60);
  font-size: var(--fs-13); font-weight: 560;
  box-shadow: var(--sh-2);
  animation: toastIn var(--d-2) var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
.toast.is-out { animation: toastOut var(--d-1) var(--ease-io) both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- 17. 底部 Tab：比画布更沉的一级石墨，激活态点亮币安黄 ---------- */
.tabbar {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in oklab, var(--canvas-3) 96%, transparent);
  backdrop-filter: saturate(1.2) blur(16px);
  border-top: 1px solid var(--line);
  color: var(--on-canvas-2);
}
@media (min-width: 760px) {
  .tabbar { left: 50%; transform: translateX(-50%); bottom: 28px;
    border-radius: 0 0 30px 30px; border-top: 1px solid var(--line); }
}
.tab {
  display: grid; justify-items: center; gap: 3px;
  padding: 8px 0 7px; min-height: 52px;
  color: var(--on-canvas-2);
  transition: color var(--d-1) var(--ease);
}
.tab svg { transition: transform var(--d-2) var(--ease); }
.tab .tl { font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.tab.is-on { color: var(--binance); }
.tab.is-on svg { transform: translateY(-1px); }
.tab.is-on .tl::after {
  content: ""; display: block; width: 3px; height: 3px; margin: 2px auto 0;
  border-radius: 50%; background: var(--binance);
}

/* ---------- 18. 空状态 / 说明条 ---------- */
.note {
  display: flex; gap: 9px; align-items: flex-start;
  padding: var(--s-3); border-radius: var(--r-sm);
  background: var(--paper-sunk);
  font-size: var(--fs-12); color: var(--ink-2); line-height: 1.6;
}
.note svg { flex: none; margin-top: 2px; color: var(--gold-ink); }

/* ---------- 19. 无障碍 / 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
