/* ==========================================================================
   泰安资产 — 共享设计系统
   三个页面共用的变量、重置与基础组件。
   ========================================================================== */

:root {
  /* 背景层次：从最深到最浅 */
  --bg: #080a0f;
  --surface: #11141c;
  --surface-2: #181d28;
  --surface-3: #212736;
  --border: #262d3d;
  --border-soft: #1c2231;

  /* 文字 */
  --text: #eceef4;
  --text-dim: #9aa3b8;
  --text-faint: #646d82;

  /* 品牌与语义色 */
  --gold: #e5b53c;
  --gold-soft: #f3d68a;
  --gold-dim: rgba(229, 181, 60, 0.14);
  --up: #16c784;
  --up-dim: rgba(22, 199, 132, 0.14);
  --down: #f0616d;
  --down-dim: rgba(240, 97, 109, 0.14);
  --info: #4c8dff;

  /* 间距刻度 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 68px rgba(0, 0, 0, 0.58);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  --font-num: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono",
    Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

/* 数字统一使用等宽字形，避免逐秒刷新时宽度跳动 */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   品牌标识
   -------------------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--gold), #b8862a);
  color: #1a1204;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 14px rgba(229, 181, 60, 0.28);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   连接状态指示灯
   -------------------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
  transition: background 0.3s var(--ease);
}

.status.is-live .status-dot {
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

.status.is-error .status-dot {
  background: var(--down);
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(22, 199, 132, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0);
  }
}

/* --------------------------------------------------------------------------
   页面切换导航
   -------------------------------------------------------------------------- */

.nav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.nav a {
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover {
  color: var(--text);
}

.nav a[aria-current="page"] {
  background: var(--surface-3);
  color: var(--gold);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   工具类
   -------------------------------------------------------------------------- */

.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;
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
