/* Base CSS - Reset, Variables, Typography */

/* CSS Variables - Cyberpunk Color System */
:root {
  /* Neon Colors */
  --c-primary: #00E5FF;      /* 霓虹青 */
  --c-accent: #FF2D95;       /* 霓虹洋紅 */
  --c-success: #2EE59D;
  --c-warning: #FFC107;
  --c-danger: #FF5E57;
  --c-info: #6EC1FF;
  
  /* Background Layers */
  --bg-0: #0B0F14;          /* 基底深色 */
  --bg-1: #0F141B;          /* 次層 */
  --bg-2: #141A22;          /* 元件表層 */
  --bg-glass: rgba(15, 20, 27, 0.8);
  
  /* Text Colors */
  --tx-0: #E6F7FF;          /* 主要文字 */
  --tx-1: #A9B8C6;          /* 次要文字 */
  --tx-dim: #6C7A89;        /* 附註 */
  
  /* Borders & Effects */
  --brd: #1E2A36;
  --glow: 0 0 16px rgba(0, 229, 255, 0.35);
  --glow-accent: 0 0 20px rgba(255, 45, 149, 0.4);
  
  /* Spacing */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;
  
  /* Typography */
  --font-display: 'Bitcount Grid Single', monospace;
  --font-heading: 'Bitcount Grid Single', monospace;
  --font-body: 'Noto Sans TC', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@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;
  }
  
  .breathing-border,
  .breathing-border-corner {
    display: none !important;
  }
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-0);
  color: var(--tx-0);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--sp-md);
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
}

p {
  margin-bottom: var(--sp-md);
  color: var(--tx-1);
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: var(--c-accent);
  text-shadow: var(--glow);
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selection */
::selection {
  background-color: var(--c-primary);
  color: var(--bg-0);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--c-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-accent);
}

/* Utility Classes */
.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;
}

.text-primary {
  color: var(--c-primary);
}

.text-accent {
  color: var(--c-accent);
}

.text-dim {
  color: var(--tx-dim);
}

.glow-text {
  text-shadow: var(--glow);
}

/* Loading State */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* No Effects Mode */
body.no-effects * {
  animation: none !important;
  transition: none !important;
}

body.no-effects .breathing-border,
body.no-effects .breathing-border-corner {
  display: none !important;
}
