/* 
 * AI Translate Earbuds - Design Tokens
 * 设计系统: Apple Liquid Glass + 冷色调科技感
 * 三旋钮: VARIANCE=8 / MOTION=7 / DENSITY=4
 */

:root {
  /* 主色调 - 冷蓝科技感 */
  --primary: #0066FF;
  --primary-light: #4D94FF;
  --primary-dark: #0040CC;
  --primary-glow: rgba(0, 102, 255, 0.3);

  /* 辅助色 - 渐变紫 */
  --accent: #7C3AED;
  --accent-light: #A78BFA;
  --accent-glow: rgba(124, 58, 237, 0.3);

  /* 中性色 - 冷灰系 */
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --gray-950: #020617;

  /* 功能色 */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;

  /* 背景色 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-dark: rgba(15, 23, 42, 0.7);

  /* 文字色 */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-inverse: #FFFFFF;

  /* 边框色 */
  --border: #E2E8F0;
  --border-light: rgba(255, 255, 255, 0.3);
  --border-glow: rgba(0, 102, 255, 0.2);

  /* 圆角系统 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --shadow-glow-accent: 0 0 40px var(--accent-glow);

  /* 间距系统 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* 字体系统 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* 字号 */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 3.75rem;   /* 60px */
  --text-7xl: 4.5rem;    /* 72px */
  --text-8xl: 6rem;      /* 96px */

  /* 行高 */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* 字间距 */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* 动画 */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slower: 800ms cubic-bezier(0.16, 1, 0.3, 1);

  /* 模糊 */
  --blur-sm: 4px;
  --blur-md: 8px;
  --blur-lg: 16px;
  --blur-xl: 24px;
  --blur-2xl: 40px;

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --gradient-primary-light: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
  --gradient-dark: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);

  /* 玻璃态效果 */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(24px);

  /* 液态玻璃效果 (Apple Liquid Glass) */
  --liquid-glass-bg: linear-gradient(135deg, rgba(255,255,255,0.30), rgba(255,255,255,0.08)), rgba(255,255,255,0.12);
  --liquid-glass-border: 1px solid rgba(255,255,255,0.32);
  --liquid-glass-inner-shadow: inset 0 1px 0 rgba(255,255,255,0.48), inset 0 -1px 0 rgba(255,255,255,0.12);
  --liquid-glass-outer-shadow: 0 18px 60px rgba(0,0,0,0.18);
  --liquid-glass-highlight: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.55), transparent 34%);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --bg-glass-dark: rgba(15, 23, 42, 0.8);

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #64748B;

    --border: #334155;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 102, 255, 0.3);

    --gray-50: #1E293B;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748B;
    --gray-400: #94A3B8;
    --gray-500: #CBD5E1;
    --gray-600: #E2E8F0;
    --gray-700: #F1F5F9;
    --gray-800: #F8FAFC;
    --gray-900: #FFFFFF;
    --gray-950: #F8FAFC;

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --liquid-glass-bg: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04)), rgba(15,23,42,0.42);
    --liquid-glass-border: 1px solid rgba(255,255,255,0.18);
    --liquid-glass-inner-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
    --liquid-glass-outer-shadow: 0 18px 60px rgba(0,0,0,0.42);
    --liquid-glass-highlight: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.35), transparent 34%);
  }
}

/* 减少透明度模式 */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.96);
    --glass-blur: none;
    --liquid-glass-bg: rgba(255, 255, 255, 0.96);
  }
}

/* 全局重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* 可访问性 */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 选中文本 */
::selection {
  background: var(--primary);
  color: white;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* 基础排版 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}

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

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* 实用工具类 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

/* 玻璃态卡片 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--liquid-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--liquid-glass-outer-shadow);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--liquid-glass-highlight);
  pointer-events: none;
}

.glass-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid var(--glass-border);
  pointer-events: none;
}

/* 渐变按钮 */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--text-base);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--text-base);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

/* 动画关键帧 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 响应式 */
@media (max-width: 768px) {
  :root {
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
}