/* CSS Variables */
:root {
  /* 颜色系统 */
  --color-primary: #2c3e50;
  --color-secondary: #34495e;
  --color-accent: #3498db;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-lighter: #999999;
  --color-background: #ffffff;
  --color-background-secondary: #f8f9fa;
  --color-border: #e0e0e0;
  --color-overlay: rgba(0, 0, 0, 0.85);
  --color-overlay-light: rgba(0, 0, 0, 0.5);
  --color-success: #27ae60;
  --color-error: #e74c3c;

  /* 间距系统 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-xxxl: 64px;

  /* 网格间距 */
  --grid-gap: 20px;
  --grid-gap-mobile: 12px;

  /* 字体系统 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
               "Noto Color Emoji";
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-xxl: 24px;
  --font-size-xxxl: 32px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* 断点 (用于JS) */
  --breakpoint-mobile: 768px;
  --breakpoint-tablet: 1024px;
  --breakpoint-desktop: 1280px;

  /* 网格列数 */
  --grid-columns-mobile: 2;
  --grid-columns-tablet: 3;
  --grid-columns-desktop: 4;

  /* 边框圆角 */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-round: 50%;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* 动画时长 */
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;

  /* 移动端动画时长（更快） */
  --duration-mobile-fast: 0.1s;
  --duration-mobile-normal: 0.2s;
  --duration-mobile-slow: 0.35s;

  /* 缓动函数 */
  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-in: cubic-bezier(0.4, 0, 1, 1);
  --easing-out: cubic-bezier(0, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-index 层级 */
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;

  /* 灯箱特定 */
  --lightbox-z-index: var(--z-index-modal);
  --lightbox-overlay-bg: var(--color-overlay);
  --lightbox-max-width: 90vw;
  --lightbox-max-height: 90vh;

  /* 移动端底部导航栏高度 */
  --mobile-nav-height: 64px;

  /* 安全区域（刘海屏适配） */
  --safe-area-inset-top: env(safe-area-inset-top, 0);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0);
  --safe-area-inset-left: env(safe-area-inset-left, 0);
  --safe-area-inset-right: env(safe-area-inset-right, 0);

  /* 触摸按钮最小尺寸 (Apple HIG & Material Design) */
  --touch-target-min-size: 48px;

  /* 顶部导航高度 */
  --header-height: 64px;
  --header-height-mobile: 56px;
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #ecf0f1;
    --color-secondary: #bdc3c7;
    --color-text: #ecf0f1;
    --color-text-light: #bdc3c7;
    --color-text-lighter: #95a5a6;
    --color-background: #1a1a1a;
    --color-background-secondary: #2c2c2c;
    --color-border: #3a3a3a;
    --color-overlay: rgba(0, 0, 0, 0.95);
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01s;
    --duration-normal: 0.01s;
    --duration-slow: 0.01s;
    --duration-mobile-fast: 0.01s;
    --duration-mobile-normal: 0.01s;
    --duration-mobile-slow: 0.01s;
  }
}
