/* =====================================================================
   Astra R15 · Design tokens
   One source of truth for colour, status, type, space, radius, size, motion.
   Shared by every page; page CSS lives in css/pages/*.css.
   ===================================================================== */
:root{
  /* ---------- Field (page background) & glass surfaces ---------- */
  --field:            #F8FAFF;   /* luminous ice field behind everything */
  --field-pool-cyan:  #F0F8FF;   /* light pool, top right */
  --field-pool-blue:  #EAF2FF;   /* light pool, left */
  --glass:            rgba(255,255,255,.74);
  --glass-strong:     rgba(255,255,255,.90);
  --glass-solid:      #FFFFFF;   /* fallback when backdrop-filter is unavailable */
  --glass-edge:       rgba(255,255,255,.95);  /* 1px inner top highlight */
  --hairline:         rgba(17,48,110,.09);
  --hairline-strong:  rgba(17,48,110,.15);
  --scrim:            rgba(8,22,48,.32);
  --shadow-1: 0 1px 2px rgba(16,42,94,.05), 0 10px 26px -14px rgba(16,42,94,.20);
  --shadow-2: 0 2px 6px rgba(16,42,94,.06), 0 22px 44px -18px rgba(16,42,94,.28);
  --shadow-dock: 0 14px 34px -10px rgba(13,40,95,.30), 0 2px 8px rgba(13,40,95,.08);

  /* ---------- Shared surfaces ---------- */
  --surface:#FFFFFF;
  --surface-blue:#F0F5FF;
  --surface-token:#EEF9FC;
  --surface-ai:#F3F0FB;
  --surface-total:linear-gradient(125deg,#FFFFFF 30%,#EFF5FF);
  --token-ink:#0A718B;
  --ai-ink:#6547A8;
  --line:#DCE5F0;

  /* ---------- Ink ---------- */
  --ink:   #10213B;   /* titles, primary numbers */
  --ink-2: #35455D;   /* body text */
  --ink-3: #4A5970;   /* captions, labels (5.6:1 on white) */
  --ink-4: #5B6781;   /* readable placeholders; disabled controls use opacity */
  --on-accent: #FFFFFF;

  /* ---------- Brand ---------- */
  --blue:        #0E6AE8;   /* Logo 蓝深一档：按钮、链接、选中文字（白字 4.95:1） */
  --blue-press:  #0B57CB;
  --blue-ink:    #0B5ED7;   /* 浅蓝底上的蓝字（5.0:1） */
  --blue-soft:   #EAF3FF;
  --blue-line:   rgba(22,122,250,.28);
  --blue-accent: #167AFA;   /* Logo 蓝：选中描边、指示条 */
  --seg-track:   #EEF3FB;   /* 分段开关轨道 */
  --cyan:        #1FC8F0;
  --cyan-soft:   #E1F8FE;
  --brand-grad:  linear-gradient(135deg,#63E1FF 0%,#2D8CFF 46%,#1557E8 100%);
  --brand-grad-soft: linear-gradient(135deg,rgba(99,225,255,.20) 0%,rgba(45,140,255,.12) 50%,rgba(21,87,232,.10) 100%);

  /* ---------- Status system (text on tint ≥ 4.5:1) ----------
     ok   = 成功 / 已完成 / 已成交 / 接單中
     run  = 進行中 / 執行中 / 運行中 / 提交中
     wait = 等待 / 待搶單 / 待結算 / 退出中 / 無可匹配需求
     warn = 警告 / 餘額不足 / 本週額度用完 / 報價已變化
     bad  = 失敗 / 逾時 / 載入失敗
     off  = 中性 / 已取消 / 已暫停 / 已關閉 / 沒額度 / 已到期            */
  --ok:   #067A51;  --ok-bg:   #E1F5EB;  --ok-line:   rgba(6,122,81,.22);
  --run:  #0F56D9;  --run-bg:  #E7EFFF;  --run-line:  rgba(15,86,217,.22);
  --wait: #5F49CF;  --wait-bg: #EEEAFD;  --wait-line: rgba(95,73,207,.22);
  --warn: #945400;  --warn-bg: #FFF0D3;  --warn-line: rgba(148,84,0,.24);
  --bad:  #C02532;  --bad-bg:  #FDE8EA;  --bad-line:  rgba(192,37,50,.22);
  --off:  #5B6781;  --off-bg:  #EBEFF5;  --off-line:  rgba(91,103,129,.22);
  --gain: #067A51;  /* +$ */
  --loss: #C02532;  /* -$ */
  --side-buy:  #0F56D9;
  --side-sell: #0A7F86;

  /* ---------- Type ----------
     Selected variable families: Plus Jakarta Sans for Latin/numbers, Noto Sans TC for Traditional Chinese.
     All sizes in rem so the system/browser text size setting applies. */
  --font: "Plus Jakarta Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --fs-11: .6875rem;   /* 11 · dock labels, badges — the floor for any text */
  --fs-12: .75rem;     /* 12 · captions, table secondary lines */
  --fs-13: .8125rem;   /* 13 · labels, secondary text */
  --fs-14: .875rem;    /* 14 · form labels, supporting copy and notices */
  --fs-15: .9375rem;   /* 15 · body */
  --fs-16: 1rem;       /* 16 · editable text; avoids mobile input zoom */
  --fs-17: 1.0625rem;   /* 17 · module titles */
  --fs-18: 1.125rem;
  --fs-24: 1.5rem;
  --fs-28: 1.75rem;
  --fs-32: 2rem;
  --fs-40: 2.5rem;
  --fs-48: 3rem;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fs-20: 1.25rem;    /* 20 · section titles */
  --fs-26: 1.625rem;   /* 26 · page large titles */
  /* 第 5 批 · 七级字号：文字只用这七级（金额 / 价格等大数字、动态图里的文字、可编辑输入框另算）。
     每级都指向上面已有的 --fs-NN，所以 var(--fs-11/12/13/15/17/20/26) 本身就在阶梯上。 */
  --ts-micro:   var(--fs-11);   /* 1 · 11 · 底栏（英、德）、计数、缩略图名、表格次行、价格单位、窄屏的紧凑说明与按钮 */
  --ts-caption: var(--fs-12);   /* 2 · 12 · 说明、备注、时间、状态标签、表头、单位、并排的紧凑按钮 */
  --ts-label:   var(--fs-13);   /* 3 · 13 · 标签、chip、分段、链接、小按钮、列表次行、明细行 */
  --ts-body:    var(--fs-15);   /* 4 · 15 · 正文、列表主行、按钮、表单标签、弹层明细 */
  --ts-title:   var(--fs-17);   /* 5 · 17 · 页头标题、卡片标题、空状态标题 */
  --ts-section: var(--fs-20);   /* 6 · 20 · 区块标题、弹层标题 */
  --ts-page:    var(--fs-26);   /* 7 · 26 · 页面大标题 */
  --num-s:  1.0625rem; /* 17 · numbers in lists */
  --num-m:  1.375rem;  /* 22 · stat tiles */
  --num-l:  1.875rem;  /* 30 · balances */
  --num-xl: 2.25rem;   /* 36 · hero amount */
  --lh-tight: 1.15;
  --lh:       1.45;
  --lh-loose: 1.6;

  /* ---------- Space (4-pt grid) ---------- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --gutter: 16px;      /* page side padding */
  --gap: 12px;         /* gap between modules */

  /* ---------- Radius (concentric: inner = outer − padding) ---------- */
  --r-sheet: 30px;  /* bottom sheets */
  --r-mod:   18px;  /* page modules */
  --r-tile:  14px;  /* tiles inside modules, stat tiles */
  --r-ctl:   14px;  /* inputs, segmented tracks */
  --r-sm:    10px;  /* icon tiles, small chips */
  --r-btn:   10px;  /* action buttons, including sheet actions */
  --r-pill:  999px; /* status pills, filter chips */

  /* ---------- Sizes ---------- */
  --tap:      44px;   /* minimum hit area, every interactive element */
  --btn-h:    50px;
  --btn-h-s:  36px;   /* visual height; hit area padded to 44 */
  --field-h:  52px;
  --header-h: 64px;
  --dock-h:   96px;

  /* ---------- Motion ---------- */
  --ease-out:    cubic-bezier(.2,.8,.2,1);
  --ease-snap:   cubic-bezier(.2,.8,.2,1);
  --t-fast: 160ms;
  --t:      260ms;
  --t-slow: 420ms;
}
