/* ═══════════════════════════════════════════════════════
   澄衡 — Base Reset + Typography + Global Animations
   ═══════════════════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-root);
  color: var(--color-text-primary);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(50, 80, 150, 0.3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(50, 80, 150, 0.5);
}

/* ── Selection ── */
::selection {
  background: rgba(30, 111, 240, 0.3);
  color: #fff;
}

/* ── Number font ── */
.num, .mono {
  font-family: var(--font-inter);
  font-variant-numeric: tabular-nums;
}

/* ── Text utilities ── */
.text-up     { color: var(--color-up); }
.text-down   { color: var(--color-down); }
.text-flat   { color: var(--color-flat); }
.text-muted  { color: var(--color-text-tertiary); }
.text-dim    { color: var(--color-text-disabled); }

/* ── Keyframes (shared) ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

@keyframes shimmer {
  0%   { left: -100%; }
  40%  { left: 150%; }
  100% { left: 150%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Border glow (shared) ── */
@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@property --glow-angle2 {
  syntax: '<angle>';
  initial-value: 180deg;
  inherits: false;
}

@keyframes borderFlow {
  to { --glow-angle: 360deg; }
}

@keyframes borderFlow2 {
  to { --glow-angle2: 540deg; }
}
