/* ═══════════════════════════════════════════════════════════
   灵犀漆语 · 设计系统基础
   Design Tokens + Reset + Typography + Utilities
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&family=Noto+Serif+SC:wght@400;600;700;900&display=swap');

/* ── Design Tokens ── */
:root {
  /* Colors - 灵犀漆语 */
  --color-bg-primary: #08080d;
  --color-bg-secondary: #0f1018;
  --color-bg-card: #161822;
  --color-bg-elevated: #1c1f2e;
  --color-bg-hover: #232738;
  --color-bg-input: #12141e;

  --color-vermillion: #c23616;
  --color-vermillion-light: #e84118;
  --color-vermillion-glow: rgba(194, 54, 22, 0.15);
  --color-gold: #d4a853;
  --color-gold-light: #f0c96e;
  --color-gold-glow: rgba(212, 168, 83, 0.12);
  --color-jade: #2ecc71;
  --color-jade-glow: rgba(46, 204, 113, 0.1);
  --color-azure: #3498db;
  --color-azure-glow: rgba(52, 152, 219, 0.1);

  --color-text-primary: #f5f0e8;
  --color-text-secondary: #a0a5b8;
  --color-text-muted: #6b7c8d;
  --color-text-accent: var(--color-gold);
  --color-text-inverse: #08080d;

  --color-border: rgba(212, 168, 83, 0.12);
  --color-border-active: rgba(212, 168, 83, 0.35);
  --color-divider: rgba(255, 255, 255, 0.06);

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #d4a853, #f0c96e);
  --gradient-vermillion: linear-gradient(135deg, #c23616, #e84118);
  --gradient-dark: linear-gradient(180deg, #0f1018, #08080d);
  --gradient-card: linear-gradient(145deg, rgba(28, 31, 46, 0.8), rgba(22, 24, 34, 0.4));
  --gradient-hero: linear-gradient(135deg, rgba(194, 54, 22, 0.08), rgba(212, 168, 83, 0.06), rgba(8, 8, 13, 0));

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 168, 83, 0.15);
  --shadow-vermillion: 0 4px 20px rgba(194, 54, 22, 0.2);

  /* Typography */
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Noto Serif SC', Georgia, serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --mobile-nav-height: 64px;
  --content-max-width: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* SVG 图标全局对齐修复 */
svg {
  display: block; /* 避免行内元素基线对齐问题 */
}

a { color: var(--color-gold); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-gold-light); }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-bg-hover); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ── Selection ── */
::selection { background: rgba(212, 168, 83, 0.3); color: var(--color-text-primary); }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 54, 22, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(194, 54, 22, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

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

.animate-fade-in { animation: fadeIn 0.6s ease forwards; }
.animate-slide-up { animation: slideUp 0.6s ease forwards; }

/* Staggered animation */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ── Accessibility - Focus Styles ── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-gold);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 1000;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.skip-link:focus {
  top: var(--space-2);
}
