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

:root {
  --background: #FAFAFA;
  --foreground: #0F172A;
  --card: #FFFFFF;
  --card-foreground: #0F172A;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #0052FF;
  --accent-secondary: #4D7CFF;
  --accent-foreground: #FFFFFF;
  --accent-gradient: linear-gradient(135deg, #0052FF 0%, #4D7CFF 100%);
  --accent-glow: rgba(0, 82, 255, 0.10);
  --accent-glow-strong: rgba(0, 82, 255, 0.25);
  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --input-bg: #FFFFFF;
  --input-border: #E2E8F0;
  --ring: rgba(0, 82, 255, 0.35);
  --success: #10B981;
  --success-light: rgba(16, 185, 129, 0.08);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.08);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.08);
  --purple: #8B5CF6;
  --purple-light: rgba(139, 92, 246, 0.08);
  --cyan: #06B6D4;
  --cyan-light: rgba(6, 182, 212, 0.08);
  --inverted-bg: #0F172A;
  --inverted-fg: #F8FAFC;
  --inverted-muted: #334155;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.10);
  --shadow-accent: 0 4px 14px rgba(0, 82, 255, 0.25);
  --shadow-accent-lg: 0 8px 24px rgba(0, 82, 255, 0.30);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  --sidebar-w: 264px;
  --sidebar-collapsed-w: 72px;
  --header-h: 64px;
  --font-display: "Calistoga", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-cjk: "Noto Sans TC", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

body {
  font-family: var(--font-body), var(--font-cjk);
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 0.9375rem;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

a { color: var(--accent); text-decoration: none; transition: color var(--duration-fast) ease; }
a:hover { color: var(--accent-secondary); }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display), var(--font-cjk);
  color: var(--foreground);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.875rem; font-weight: 400; }
h2 { font-size: 1.375rem; font-weight: 400; }
h3 { font-size: 1.125rem; font-weight: 400; }

h4, h5, h6 {
  font-family: var(--font-body), var(--font-cjk);
  font-weight: 600;
  line-height: 1.4;
}
h4 { font-size: 0.9375rem; }

code, pre, .mono { font-family: var(--font-mono); }

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--muted-foreground); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: var(--font-mono); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.dot-pattern {
  background-image: radial-gradient(circle, var(--foreground) 0.5px, transparent 0.5px);
  background-size: 16px 16px;
  opacity: 0.025;
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.radial-glow {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.inverted-section {
  background: var(--inverted-bg);
  color: var(--inverted-fg);
  position: relative;
  overflow: hidden;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInLeft { from { transform: translateX(-16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulseRing { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-out) both; }
.animate-fade-up { animation: fadeUp var(--duration-slow) var(--ease-out) both; }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-spring) both; }
.animate-slide-right { animation: slideInRight var(--duration-slow) var(--ease-out) both; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
