/* ==========================================================================
   variables.css — Global CSS variables, reset, and Chinese browser compat
   全局 CSS 变量、重置和中国浏览器兼容性修复
   ========================================================================== */

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

html {
  /* Prevent rubber-band scrolling on iOS / 防止 iOS 橡皮筋滚动 */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  /* Smooth font rendering / 平滑字体渲染 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* Use --vh for WeChat Android 100vh fix / 使用 --vh 修复微信安卓 100vh 问题 */
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-black);
}

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

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

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

/* --- Color Palette — Black + Pink luxury theme --- */
/* --- 调色板 — 黑色+粉色奢华主题 --- */
:root {
  /* Background blacks / 背景黑色系 */
  --bg-black: #0D0D0D;
  --bg-dark-rose: #1A0A14;
  --bg-deep-magenta: #2D0A24;
  --bg-card: rgba(255, 255, 255, 0.04);

  /* Pink accents / 粉色强调色 */
  --pink-primary: #FF1493;
  --pink-soft: #E65C9C;
  --pink-light: #FB8CAB;
  --pink-glow: rgba(255, 20, 147, 0.3);
  --pink-border: rgba(255, 20, 147, 0.15);

  /* Gold accent / 金色点缀 */
  --gold: #FFD700;
  --gold-soft: #F0C040;

  /* Text colors / 文字颜色 */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Spacing / 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Border radius / 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions / 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s ease;
  --transition-slow: 0.8s ease;

  /* WeChat 100vh fix — set by JS / 微信 100vh 修复 — 由 JS 设置 */
  --vh: 1vh;

  /* Z-index layers / 层级 */
  --z-background: 0;
  --z-content: 10;
  --z-effects: 20;
  --z-overlay: 30;
  --z-opening: 100;
  --z-music: 50;
}

/* --- Utility Classes --- */

/* Hardware-accelerated element / 硬件加速元素 */
.gpu-accelerated {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Full viewport section / 全视口区域 */
.full-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
}

/* Visually hidden but accessible / 视觉隐藏但可访问 */
.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;
}

/* Prevent text selection on interactive elements / 防止交互元素的文字选择 */
.no-select {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Prevent touch scrolling on specific elements / 防止特定元素的触摸滚动 */
.no-touch-scroll {
  touch-action: none;
}

/* --- Glassmorphism with fallback --- */
/* --- 毛玻璃效果及降级方案 --- */
.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@supports ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
  .glass-panel {
    background: rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
  }
}

/* --- Reduced Motion — Respect user preference --- */
/* --- 减少动画 — 尊重用户偏好 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
