/* MemeDAQ · base.css — v2「晨雾蓝交易所 · 敲钟上市」 (docs/03 §2)
   tokens · background layers · type scale · buttons · inputs · glass cards · tables · badge policy · notices ·
   toasts · modal · focus · reduced motion. Shared by every page.
   Light palette ①「晨雾蓝」: cobalt primary, navy dark surfaces (flaps, tags, footer), a touch of warm gold.
   Legacy class names from v1 (.key*, .panel, .ph/.pb/.pf, .sh, .pending, .closed, .led …) are kept and re-skinned so
   pages that have not been re-skinned yet still render. New code: .btn*, .card, .eyebrow, .badge (see board.css too). */

:root {
  /* ── palette (brief §2) ── */
  --bg: #F5F7FC;
  --bg-2: #EEF2FA;             /* alternate sections */
  --bg-3: #E7ECF7;             /* wells, tracks */
  --surface: #FFFFFF;
  --ink: #0B1B3F;              /* 15.8:1 on --bg */
  --ink-2: #4A5878;            /* 6.6:1 on --bg */
  --ink-3: #5B6784;            /* muted text: 5.3:1 on --bg, 5.0:1 on --bg-2, 4.8:1 on --bg-3 */
  --ink-4: #8C96B0;            /* decoration only (ticks, placeholders' icons) — never body text */
  --line: rgba(15, 35, 80, .10);
  --line-2: rgba(15, 35, 80, .16);
  --line-3: rgba(15, 35, 80, .26);
  --glass: rgba(255, 255, 255, .72);
  --glass-2: rgba(255, 255, 255, .84);
  --glass-3: rgba(255, 255, 255, .94);
  --panel: rgba(255, 255, 255, .84);
  --blur: blur(14px) saturate(140%);

  --accent: #2F5BFF;           /* primary, CTAs, links (5.2:1 on white) */
  --accent-2: #6E9BFF;
  --accent-deep: #1F3FD1;      /* link text (7.3:1 on --bg) */
  --accent-text: #2750EA;      /* small cobalt text (eyebrows): ≥ 5:1 on white, --bg and the tinted glass cards */
  --accent-soft: rgba(47, 91, 255, .12);
  --accent-softer: rgba(47, 91, 255, .06);
  --accent-line: rgba(47, 91, 255, .32);
  --btn: linear-gradient(180deg, #3D68FF, #2448E6);
  --btn-shadow: 0 8px 20px -8px rgba(47, 91, 255, .6);

  --navy: #0B1B3F;             /* dark surfaces: flaps, tag chips, footer */
  --navy-2: #14234D;
  --navy-3: #22346B;
  --on-navy: #F3F6FD;
  --on-navy-2: #A9B4D0;        /* 8.1:1 on --navy */
  --on-navy-3: #8E9AB8;        /* 6.0:1 on --navy */

  --gold: #FFD27A;             /* small warm highlights only (flap digits, coin, glow) — never large fills */
  --gold-2: #E0A63A;
  --gold-ink: #8A5A0E;         /* warm text on light surfaces (5.5:1) */
  --gold-soft: rgba(224, 166, 58, .14);

  --up: #12A870;               /* price moves only: fills, bars, arrows */
  --down: #E5484D;
  --up-ink: #0A6E45;           /* price-move TEXT: ≥ 5:1 on light surfaces and on --up-soft / --down-soft pills */
  --down-ink: #B82A33;
  --up-soft: rgba(18, 168, 112, .10);
  --down-soft: rgba(229, 72, 77, .09);
  --warn: #E0A63A;
  --warn-ink: #8A5A0E;

  --wordmark: linear-gradient(100deg, #0B1B3F 0%, #1D3BB8 34%, #2F5BFF 58%, #6E9BFF 100%);

  /* ── shape / depth ── */
  --r-xs: 6px;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(15, 35, 80, .04), 0 20px 50px -24px rgba(15, 35, 80, .28);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(15, 35, 80, .05), 0 8px 22px -14px rgba(15, 35, 80, .30);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(15, 35, 80, .04), 0 36px 80px -32px rgba(15, 35, 80, .38);
  --ring: 0 0 0 4px var(--accent-soft);

  /* ── type ── */
  --f-display: "Space Grotesk", "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-body: "Noto Sans SC", "Space Grotesk", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-mono: "JetBrains Mono", "Noto Sans SC", ui-monospace, "SFMono-Regular", Consolas, monospace;   /* CJK inside mono labels falls back to Noto Sans SC, not a system font */
  --t-hero: clamp(58px, 8.6vw, 132px);
  --t-h1: clamp(32px, 4.2vw, 54px);
  --t-h2: clamp(25px, 2.7vw, 36px);
  --t-h3: clamp(17px, 1.45vw, 20px);
  --t-lead: clamp(15.5px, 1.2vw, 17.5px);
  --t-body: 15px;
  --t-sm: 13px;
  --t-xs: 12px;
  --t-eyebrow: 11.5px;

  /* ── spacing / layout ── */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px; --s9: 72px;
  --gutter: 16px;
  --maxw: 1240px;
  --header-h: 62px;
  --header-top: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.4, .5, 1);

  /* ── v1 aliases (css/pages.css still uses these until the page re-skins land; do not use in new code) ── */
  --bg2: var(--bg-2);
  --panel2: #F8FAFE;
  --well: rgba(238, 242, 250, .7);
  --line2: var(--line-2);
  --amber: var(--accent);
  --amber-hi: var(--accent-deep);
  --amber-dim: rgba(47, 91, 255, .30);
  --amber-glow: rgba(47, 91, 255, .18);
  --orange: var(--gold-2);
  --text: var(--ink);
  --muted: var(--ink-2);
  --faint: var(--ink-3);
  --deco: rgba(15, 35, 80, .16);
  --tape-bg: var(--glass);
  --screen: #EEF2FA;
  --led: var(--f-mono);
  --mono: var(--f-mono);
  --sans: var(--f-body);
  color-scheme: light;
}
@media (min-width: 760px) { :root { --gutter: 28px; } }
@media (max-width: 900px) { :root { --header-h: 56px; --header-top: 10px; } }

/* ════════════════════════════════════════════════════════════════════
   reset + page background
   ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--header-top) + 24px); background: var(--bg); }
html.modal-open { overflow: hidden; }
body {
  position: relative;
  isolation: isolate;            /* the two background layers (z-index −1/−2) paint above body's own background */
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.65;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* layer 1: mesh — cobalt glow top-right, warm gold glow bottom-left (fixed to the viewport) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 92% -12%, rgba(64, 110, 255, .18), transparent 62%),
    radial-gradient(760px 520px at 62% 8%, rgba(110, 155, 255, .07), transparent 70%),
    radial-gradient(900px 560px at -10% 112%, rgba(255, 196, 84, .16), transparent 62%);
}
/* layer 2: 40 px faint grid over the top of every page, masked so it fades out towards the edges */
body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: min(1180px, 100%);
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 40, 90, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 40, 90, .065) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 58% 30%, #000 22%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 64% at 58% 30%, #000 22%, transparent 78%);
}
main { flex: 1 0 auto; outline: none; }
#main:focus, #main:focus-visible { outline: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, svg, canvas { display: block; }
img { max-width: 100%; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }
b, strong { font-weight: 700; }
sub { font-size: .68em; vertical-align: -.25em; line-height: 0; }
code, kbd { font-family: var(--f-mono); font-size: .92em; }
::selection { background: rgba(47, 91, 255, .2); color: var(--ink); }
[hidden] { display: none !important; }

/* ════════════════════════════════════════════════════════════════════
   layout helpers
   ════════════════════════════════════════════════════════════════════ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { max-width: 760px; }
.section { padding: clamp(52px, 7vw, 104px) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, rgba(238, 242, 250, 0), rgba(238, 242, 250, .85) 10%, rgba(238, 242, 250, .85) 90%, rgba(238, 242, 250, 0)); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stack { display: grid; gap: var(--s3); }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { gap: var(--s3); } }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent); border: 0; }
@media (max-width: 700px) { .hide-sm { display: none !important; } }
@media (min-width: 701px) { .hide-lg { display: none !important; } }

/* skip link */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: var(--r-pill); transition: top .15s; }
.skip:focus { top: 8px; }

/* ════════════════════════════════════════════════════════════════════
   typography
   ════════════════════════════════════════════════════════════════════ */
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.03em; line-height: .95; }
.h1 { font-size: var(--t-h1); font-weight: 900; letter-spacing: -.02em; line-height: 1.14; }
.h2 { font-size: var(--t-h2); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.38; }
.h1 em, .h2 em, .headline em { font-style: normal; color: var(--accent); }
.headline { font-size: clamp(28px, 3.3vw, 44px); font-weight: 900; letter-spacing: -.02em; line-height: 1.18; }
.lead { font-size: var(--t-lead); color: var(--ink-2); line-height: 1.8; }
.small { font-size: var(--t-sm); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: var(--accent); }
.gold { color: var(--gold-ink); }
.up { color: var(--up-ink); }
.down { color: var(--down-ink); }

/* wordmark: navy → cobalt → light-blue gradient (Space Grotesk) */
.wordmark {
  display: inline-block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-hero);
  line-height: .9;
  letter-spacing: -.035em;
  padding: .02em .03em .08em 0;
  color: var(--ink);
  background: var(--wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 14px 34px rgba(47, 91, 255, .14));
}
.wordmark.sm { font-size: clamp(34px, 4vw, 56px); }

/* eyebrow styled like a ticker code: [01] · INDEX */
.eyebrow, .sh-no {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
  line-height: 1.2;
  white-space: nowrap;
}
.eyebrow b, .sh-no b {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px;
  border-radius: 5px; background: var(--navy); color: var(--gold);
  font-weight: 700; letter-spacing: .04em; font-size: 11px;
  box-shadow: 0 4px 10px -6px rgba(11, 27, 63, .6);
}
.eyebrow.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; margin-right: 2px; }
.eyebrow.muted { color: var(--ink-3); }
.eyebrow.muted.dot::before { background: var(--ink-3); box-shadow: 0 0 0 4px rgba(15, 35, 80, .08); }

/* links */
a.link, .prose a { color: var(--accent-deep); text-decoration: underline; text-decoration-color: rgba(31, 63, 209, .3); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a.link:hover, .prose a:hover { color: var(--accent); text-decoration-color: currentColor; }
.prose { max-width: 760px; color: var(--ink-2); line-height: 1.85; }
.prose h2, .prose h3 { color: var(--ink); margin: 1.6em 0 .5em; }
.prose p + p { margin-top: .8em; }
.prose code { padding: 1px 6px; border-radius: 5px; background: var(--bg-3); color: var(--ink); }

/* arrows (price moves only) */
.arr { display: inline-block; width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; vertical-align: middle; margin-right: 4px; position: relative; top: -1px; }
.up .arr, .arr.up { border-bottom: 6px solid var(--up); }
.down .arr, .arr.down { border-top: 6px solid var(--down); }
.flat .arr, .arr.flat { width: 8px; height: 2px; border: 0; background: var(--ink-4); }

/* v1 LED text → plain mono number (no dot-matrix font, no glow) */
.led { font-family: var(--f-mono); color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.led-hi { color: var(--accent-deep); }
.dots { position: relative; }

/* ════════════════════════════════════════════════════════════════════
   buttons — .btn (new) and .key (v1 alias)
   ════════════════════════════════════════════════════════════════════ */
.btn, .key {
  --b-h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--b-h); padding: 0 20px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-family: var(--f-body); font-weight: 700; font-size: 14.5px; line-height: 1.1; letter-spacing: .01em;
  white-space: nowrap; text-align: center; user-select: none; position: relative; isolation: isolate; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease), background-color .2s, border-color .2s, color .2s, filter .2s;
}
.btn:active, .key:active { transform: translateY(1px) scale(.985); }
/* primary: cobalt gradient pill (btn-gold / key-amber are v1 names for the primary action) */
.btn-primary, .btn-gold, .key-amber {
  color: #fff;
  background: var(--btn);
  border-color: rgba(20, 50, 190, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(10, 30, 120, .3), var(--btn-shadow);
}
.btn-primary::after, .btn-gold::after, .key-amber::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .34) 48%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 150% 0;
  transition: background-position .8s var(--ease);
}
.btn-primary:hover, .btn-gold:hover, .key-amber:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #4A73FF, #2A4FEE);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -1px 0 rgba(10, 30, 120, .3), 0 14px 30px -12px rgba(47, 91, 255, .7);
}
.btn-primary:hover::after, .btn-gold:hover::after, .key-amber:hover::after { background-position: -50% 0; }
/* secondary: white glass pill */
.btn-glass, .key-line {
  color: var(--ink);
  background: rgba(255, 255, 255, .78);
  border-color: var(--line-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px -12px rgba(15, 35, 80, .35);
}
.btn-glass:hover, .key-line:hover { background: #fff; border-color: var(--line-3); transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 12px 26px -14px rgba(15, 35, 80, .4); }
/* navy: dark action on light cards */
.btn-navy { color: #fff; background: linear-gradient(180deg, #1B2C5E, #0B1B3F); border-color: #0B1B3F; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 20px -10px rgba(11, 27, 63, .6); }
.btn-navy:hover { transform: translateY(-1px); background: linear-gradient(180deg, #22346B, #10214A); }
/* quiet: text-only */
.btn-ghost, .key-ghost { color: var(--ink-2); background: transparent; }
.btn-ghost:hover, .key-ghost:hover { color: var(--ink); background: var(--accent-softer); border-color: var(--line); }
/* trade sides (price-move colours are allowed on buy / sell actions) */
.btn-up, .key-buy { color: #fff; background: linear-gradient(180deg, #0F9C66, #0A7C4E); border-color: rgba(6, 90, 56, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 20px -10px rgba(18, 168, 112, .6); }
.btn-down, .key-sell { color: #fff; background: linear-gradient(180deg, #DE4148, #BF2C34); border-color: rgba(150, 30, 36, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 20px -10px rgba(229, 72, 77, .6); }
.btn-up:hover, .key-buy:hover, .btn-down:hover, .key-sell:hover { transform: translateY(-1px); filter: brightness(1.06); }
/* sizes */
.btn-lg, .key-lg { --b-h: 54px; padding: 0 28px; font-size: 16px; }
.btn-sm, .key-sm { --b-h: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-xs, .key-xs { --b-h: 28px; padding: 0 11px; font-size: 12px; gap: 6px; }
.btn-block, .key-block { width: 100%; }
.btn-icon { --b-h: 40px; width: var(--b-h); padding: 0; }
.btn .arrow, .key .arrow { transition: transform .2s var(--ease); font-family: var(--f-display); }
.btn:hover .arrow, .key:hover .arrow { transform: translateX(3px); }
/* disabled: one calm neutral pill for every variant (no washed-out cobalt / green / red) */
.btn:disabled, .key:disabled, .btn[aria-disabled="true"], .key[aria-disabled="true"] {
  cursor: not-allowed; transform: none !important; filter: none !important; box-shadow: none !important;
  color: var(--ink-3) !important; background: var(--bg-3) !important; border-color: var(--line) !important;
}
.btn:disabled .arrow, .key:disabled .arrow { transform: none; opacity: .7; }
.btn .spin, .key .spin, .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
.btn svg, .key svg, .ico { width: 16px; height: 16px; flex: none; }
.btn-reason { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.btn-reason .btn, .btn-reason .key { vertical-align: middle; }

/* icon button (copy etc.) */
.ibtn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--ink-3); border: 1px solid transparent; flex: none; transition: color .15s, background .15s, border-color .15s; }
.ibtn:hover { color: var(--accent); border-color: var(--line); background: #fff; }
.ibtn svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════════════════════════════
   glass cards — .card (new) and .panel (v1 alias)
   ════════════════════════════════════════════════════════════════════ */
.card, .panel, .glass {
  position: relative;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .72));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.card-pad { padding: clamp(18px, 2.2vw, 28px); }
.card-sm { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-solid { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.card-tint { background: linear-gradient(180deg, rgba(238, 242, 250, .9), rgba(238, 242, 250, .6)); box-shadow: none; }
.card-accent { border-color: rgba(47, 91, 255, .22); background: radial-gradient(520px 220px at 100% 0%, rgba(47, 91, 255, .10), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .74)); }
.card-gold { border-color: rgba(224, 166, 58, .3); background: radial-gradient(520px 220px at 0% 0%, rgba(255, 210, 122, .22), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .74)); }
.card-navy { color: var(--on-navy); border-color: rgba(255, 255, 255, .08); background: radial-gradient(600px 260px at 100% 0%, rgba(47, 91, 255, .38), transparent 65%), linear-gradient(180deg, #14234D, #0B1B3F); box-shadow: 0 30px 60px -30px rgba(11, 27, 63, .65); }
.card-navy h2, .card-navy h3 { color: #fff; }
.card-navy p, .card-navy .muted { color: var(--on-navy-2); }
.card-hover { transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.panel > .screw { display: none; }
.panel.screwed { padding: 0; }
/* card head / body / foot */
.ph, .card-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.ph h2, .ph h3, .card-h h2, .card-h h3 { font-size: 16.5px; font-weight: 800; letter-spacing: 0; }
.ph .ph-right, .card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.pb, .card-b { padding: 18px 22px; }
.pf, .card-f {
  padding: 13px 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3);
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center;
  border-radius: 0 0 var(--r-lg) var(--r-lg); background: rgba(238, 242, 250, .55);
}
@media (max-width: 600px) { .ph, .card-h { padding: 16px 16px 12px; } .pb, .card-b { padding: 16px; } .pf, .card-f { padding: 12px 16px; } }

/* ════════════════════════════════════════════════════════════════════
   section head (UI.sectionHead / v1 .sh)
   ════════════════════════════════════════════════════════════════════ */
.sh { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: clamp(22px, 3vw, 36px); }
.sh .sh-no { flex: 0 0 100%; margin-bottom: 4px; }
.sh h1, .sh h2 { font-size: var(--t-h2); font-weight: 900; line-height: 1.18; letter-spacing: -.015em; }
.sh h1 { font-size: var(--t-h1); }
/* the description always starts a new line: flex-basis 100% (a max-width would shrink the basis and let it sit beside the title) */
.sh p { flex: 0 0 100%; padding-right: max(0px, calc(100% - 720px)); color: var(--ink-2); font-size: var(--t-lead); line-height: 1.8; }
.sh .badge, .sh .pending { align-self: center; }

/* ════════════════════════════════════════════════════════════════════
   badges — policy: at most ONE status badge per page area (docs/03 §4).
   Pre-launch numbers are quiet text (.pending / .pre), never a badge.
   ════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
  color: var(--accent-deep); background: var(--accent-soft); border: 1px solid rgba(47, 91, 255, .18);
  font-family: var(--f-body); letter-spacing: .02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.no-dot::before { display: none; }
.badge.ok, .badge.live { color: var(--up-ink); background: var(--up-soft); border-color: rgba(18, 168, 112, .24); }
.badge.live::before { animation: pulse 1.8s ease-out infinite; }
.badge.bad { color: var(--down-ink); background: var(--down-soft); border-color: rgba(229, 72, 77, .24); }
.badge.plain { color: var(--ink-2); background: rgba(255, 255, 255, .8); border-color: var(--line-2); }
.badge.gold { color: var(--gold-ink); background: var(--gold-soft); border-color: rgba(224, 166, 58, .3); }
.badge.navy { color: #fff; background: var(--navy); border-color: var(--navy); }
.badge.navy::before { background: var(--gold); }
.badge.violet { color: var(--accent-deep); background: var(--accent-soft); }
/* quiet pre-launch value text (v1 .pending keeps its class, loses the badge look) */
.pending, .pre {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-body); font-size: 13px; font-weight: 500; line-height: 1.3; letter-spacing: .01em;
  color: var(--ink-3); white-space: nowrap; background: none; border: 0; padding: 0; text-shadow: none;
}
.retrying { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--down-ink); white-space: nowrap; font-family: var(--f-body); }
.retrying::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--down); animation: blink 1.2s ease-in-out infinite; flex: none; }
.loading-txt { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); font-family: var(--f-body); }
.loading-txt::before { content: ""; width: 38px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(15, 35, 80, .06), rgba(47, 91, 255, .16), rgba(15, 35, 80, .06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton { border-radius: 6px; background: linear-gradient(90deg, rgba(15, 35, 80, .05), rgba(15, 35, 80, .1), rgba(15, 35, 80, .05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* 「合约部署后开放」 — gated action note */
.closed {
  display: flex; gap: 14px; align-items: center; padding: 15px 18px;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: rgba(238, 242, 250, .6);
}
.closed .lock { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: var(--gold); box-shadow: 0 8px 18px -10px rgba(11, 27, 63, .7); }
.closed .lock svg { width: 18px; height: 18px; }
.closed b { display: block; font-family: var(--f-body); font-weight: 700; color: var(--ink); font-size: 15px; letter-spacing: 0; text-shadow: none; }
.closed p { color: var(--ink-2); font-size: 13px; margin-top: 2px; line-height: 1.6; }

/* notices */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.65; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .8); color: var(--ink-2); }
.notice.warn { border-color: rgba(224, 166, 58, .38); background: #FFF8EA; color: #6E4708; }
.notice.err { border-color: rgba(229, 72, 77, .32); background: #FFF3F3; color: #9E2329; }
.notice.ok { border-color: rgba(18, 168, 112, .3); background: #EFFAF5; color: #0A6340; }
.notice.info { border-color: rgba(47, 91, 255, .24); background: #F0F4FF; color: #1A3499; }

/* ════════════════════════════════════════════════════════════════════
   forms
   ════════════════════════════════════════════════════════════════════ */
label.l, .label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
label.l em, .label em { font-style: normal; font-weight: 500; color: var(--ink-3); font-family: var(--f-mono); font-size: 11.5px; }
.inp {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  font-size: 15px; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2); border-radius: 12px; outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 35, 80, .06);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.inp:hover { border-color: var(--line-3); }
.inp::placeholder { color: #7A849E; }
.inp:focus { border-color: var(--accent); box-shadow: inset 0 1px 2px rgba(15, 35, 80, .04), var(--ring); }
.inp[aria-invalid="true"] { border-color: var(--down); box-shadow: 0 0 0 4px var(--down-soft); }
.inp:disabled { opacity: .6; cursor: not-allowed; background: var(--bg-2); }
.inp.mono, .inp.num { font-family: var(--f-mono); }
.inp.lg { min-height: 56px; font-size: 20px; font-family: var(--f-display); font-weight: 600; }
textarea.inp { resize: vertical; min-height: 96px; line-height: 1.6; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234A5878' stroke-width='1.6'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; }
select.inp option { background: #fff; color: var(--ink); }
.inp-group { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; box-shadow: inset 0 1px 2px rgba(15, 35, 80, .05); transition: border-color .2s, box-shadow .2s; }
.inp-group:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.inp-group .inp { border: 0; background: transparent; box-shadow: none; }
.inp-group .addon { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ink-2); font-size: 13px; font-weight: 600; border-left: 1px solid var(--line); white-space: nowrap; }
.field-err { font-size: 12.5px; color: var(--down-ink); margin-top: 6px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: rgba(255, 255, 255, .8);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); user-select: none;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.chip:hover { border-color: var(--line-3); color: var(--ink); background: #fff; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--accent); background: #F0F4FF; color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent), 0 6px 16px -10px rgba(47, 91, 255, .55); }
.chip:disabled { opacity: .5; cursor: not-allowed; }
.chip.static { padding: 0 12px 0 6px; min-height: 30px; font-size: 12.5px; }
/* segmented control / tabs */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg button { min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; color: var(--ink-3); transition: background .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button.on, .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 0 #fff inset, 0 4px 12px -6px rgba(15, 35, 80, .35); }
.seg button.buy[aria-pressed="true"], .seg button.buy.on, .seg button.buy[aria-selected="true"] { color: var(--up-ink); }
.seg button.sell[aria-pressed="true"], .seg button.sell.on, .seg button.sell[aria-selected="true"] { color: var(--down-ink); }
/* range */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--bg-3) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--bg-3) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 4px 10px rgba(15, 35, 80, .25); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
input[type=range]:disabled { opacity: .5; cursor: not-allowed; }
/* checkbox / radio */
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
/* key-value list */
.kv { display: grid; gap: 8px; font-size: 13.5px; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink-2); min-width: 0; }
.kv b { color: var(--ink); font-weight: 600; font-family: var(--f-mono); font-size: 13px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv b .pending, .kv b .pre { font-family: var(--f-body); }
.kv.lined > div { padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.kv.lined > div:last-child { border-bottom: 0; }

/* address chip */
.addr { display: inline-flex; align-items: center; gap: 2px; font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); min-width: 0; max-width: 100%; }
.addr a.addr-text { color: var(--accent-deep); text-decoration: underline; text-decoration-color: rgba(31, 63, 209, .28); text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr a.addr-text:hover { text-decoration-color: currentColor; }
.addr .addr-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════════
   tables
   ════════════════════════════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th {
  text-align: left; font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(238, 242, 250, .6);
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--accent-softer); }
.tbl .r, .tbl th.r { text-align: right; }
.tbl .n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .tbl th, .tbl td { padding: 11px 12px; } .tbl { font-size: 13px; } }

/* ════════════════════════════════════════════════════════════════════
   toasts
   ════════════════════════════════════════════════════════════════════ */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; width: min(400px, calc(100vw - 24px)); pointer-events: none; }
@media (max-width: 600px) { .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; } }
.toast {
  pointer-events: auto; position: relative; overflow: hidden;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 12px 12px 16px; border-radius: var(--r);
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 #fff inset, 0 24px 50px -20px rgba(15, 35, 80, .45);
  color: var(--ink); font-size: 14px; line-height: 1.5;
  animation: toastIn .32s var(--ease-spring);
}
.toast::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--t-accent, var(--accent)); }
.toast .t-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.toast .t-msg a { display: inline-block; margin-left: 8px; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.toast .t-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 800; font-size: 14px; color: var(--t-ink, var(--accent-deep)); background: var(--t-soft, var(--accent-soft)); }
.toast .t-art { flex: none; width: 48px; height: 48px; margin: -8px -2px -8px -6px; object-fit: contain; }
.toast .t-art + .t-ic { display: none; }
.toast .t-x { flex: none; align-self: flex-start; color: var(--ink-3); width: 26px; height: 26px; border-radius: 8px; line-height: 1; font-size: 18px; }
.toast .t-x:hover { color: var(--ink); background: var(--bg-2); }
.toast.k-info { --t-accent: var(--accent); }
.toast.k-ok { --t-accent: var(--up); --t-ink: var(--up-ink); --t-soft: var(--up-soft); }
.toast.k-warn { --t-accent: var(--warn); --t-ink: var(--warn-ink); --t-soft: var(--gold-soft); }
.toast.k-err { --t-accent: var(--down); --t-ink: var(--down-ink); --t-soft: var(--down-soft); }
.toast.k-pending { --t-accent: var(--accent); }
.toast.k-pending .t-ic::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ════════════════════════════════════════════════════════════════════
   modal
   ════════════════════════════════════════════════════════════════════ */
.modal-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(11, 27, 63, .34); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); animation: fadeIn .18s ease-out; }
.modal {
  width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; position: relative; outline: none;
  background: linear-gradient(180deg, #FFFFFF, #F8FAFE);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line), 0 40px 100px -30px rgba(11, 27, 63, .55);
  animation: pop .26s var(--ease-spring);
  scrollbar-width: thin;
}
.modal::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: radial-gradient(420px 120px at 100% 0%, rgba(47, 91, 255, .10), transparent 70%); pointer-events: none; }
.modal.md { width: min(640px, 100%); }
.modal-h { position: relative; display: flex; align-items: center; gap: 10px; padding: 20px 22px 8px; }
.modal-h h2 { font-size: 19px; font-weight: 900; flex: 1; min-width: 0; letter-spacing: -.005em; }
.modal-h .t-x { color: var(--ink-3); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; background: var(--bg-2); border: 1px solid var(--line); }
.modal-h .t-x:hover { color: var(--ink); background: #fff; }
.modal-b { position: relative; padding: 10px 22px 18px; display: grid; gap: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.75; }
.modal-b b { color: var(--ink); }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 20px; border-top: 1px solid var(--line); background: rgba(238, 242, 250, .5); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (max-width: 520px) {
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: sheetUp .3s var(--ease); padding-bottom: env(safe-area-inset-bottom, 0); }
  .modal-f { border-radius: 0; }
  .modal-f .btn, .modal-f .key { flex: 1; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }

/* wallet chooser */
.wlist { display: grid; gap: 8px; }
.wlist button, .wlist a { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); font-weight: 700; text-align: left; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.wlist button:hover, .wlist a:hover { border-color: var(--accent); background: #F7F9FF; transform: translateY(-1px); box-shadow: 0 10px 24px -16px rgba(47, 91, 255, .6); }
.wlist img, .wlist .wicon { width: 34px; height: 34px; border-radius: 10px; flex: none; background: var(--navy); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; color: var(--gold); }
.wlist small { margin-left: auto; font-weight: 600; color: var(--accent-deep); font-size: 12px; }

/* ════════════════════════════════════════════════════════════════════
   motion + focus
   ════════════════════════════════════════════════════════════════════ */
@keyframes blink { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.rise { animation: rise .6s var(--ease) both; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .key:focus-visible, .chip:focus-visible, .seg button:focus-visible { border-radius: var(--r-pill); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover, .key:hover, .card-hover:hover { transform: none !important; }
}
html.rm *, html.rm *::before, html.rm *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; }
