/**
 * 全局布局 / 设计令牌
 * 方向：「冷雾交易所」—— 冷静蓝灰底 + 墨色行情脊 + 青绿信号色
 * 避免：奶油衬线 / 黑底酸绿 / 报纸细线排版
 */

:root {
  --mist: #e4ebf3;
  --paper: #f4f7fb;
  --ink: #0e1628;
  --ink-soft: #3d4a63;
  --muted: #6b7a90;
  --spine: #152033;
  --spine-edge: #1e2d45;
  --signal: #128c7e;
  --signal-soft: rgba(18, 140, 126, 0.14);
  --up: #e11d48;
  --down: #0f766e;
  --line: rgba(14, 22, 40, 0.08);
  --focus: #128c7e;
  --radius: 2px;
  --header-h: 64px;
  --spine-h: 52px;

  /*
   * 全站字体：英文本地 Plex/Syne，中文系统字体
   * num — 报价数字
   */
  --font-sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "IBM Plex Sans", "PingFang SC", "Songti SC", "SimSun", serif;
  --font-body: var(--font-sans);
  --font-display: "Syne", "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-logo: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SF Mono", monospace;
  --font-num: var(--font-mono);

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --leading-tight: 1.25;
  --leading-normal: 1.6;

  --shadow-soft: 0 18px 40px rgba(14, 22, 40, 0.06);
  --color-text: var(--ink);
  --color-logo-brand: #f7931a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(18, 140, 126, 0.09), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(30, 64, 120, 0.08), transparent 50%),
    linear-gradient(180deg, var(--mist) 0%, var(--paper) 42%, #eef3f8 100%);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 报价数字：等宽数字，易对齐 */
.num,
[data-f],
[data-q="last"],
[data-q="chg"],
[data-q="open"],
[data-q="high"],
[data-q="low"],
[data-q="prev"],
[data-q="pre"],
[data-q="after"],
[data-q="mcap"],
[data-q="pe"],
[data-q="high24"],
[data-q="low24"],
[data-q="fxusdt"] {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--signal);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

/* —— 顶栏 —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(244, 247, 251, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

/* Logo SVG — 字号/字重/字体与 usd.btc126.com/style/header.css 对齐 */
.site-header__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex-shrink: 0;
}

.site-header__logo:hover {
  color: inherit;
}

.site-header__logo-svg {
  display: block;
  height: 32px;
  width: auto;
}

.site-header__logo-text {
  fill: var(--color-text);
  font-family: var(--font-logo);
}

.site-header__logo-text--main {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.site-header__logo-divider {
  stroke: var(--color-text);
  stroke-width: 1.5;
  opacity: 0.75;
}

.site-header__logo-text--brand {
  fill: var(--color-logo-brand);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-header__logo-text--sub {
  font-family: var(--font-logo);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius);
}

.nav a.is-active,
.nav a:hover {
  color: var(--ink);
  background: var(--signal-soft);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

/* —— 页脚：居中两行 —— */
.site-footer {
  margin-top: 35px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.site-footer__lead {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

.site-footer__copy {
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

/* —— 通用状态色 —— */
.is-up {
  color: var(--up) !important;
}

.is-down {
  color: var(--down) !important;
}

.is-flat {
  color: var(--muted) !important;
}

@media (max-width: 767px) {
  .site-wrap {
    width: min(100% - 24px, 1120px);
  }

  /* 手机保留顶部 Logo 标题（比特币家园），等比缩小避免被裁切 */
  .site-header__logo {
    max-width: calc(100% - 56px);
  }

  .site-header__logo-svg {
    height: 30px;
    width: auto;
    max-width: 100%;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
  }

  .nav.is-open {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
