/**
 * Design Tokens - 赛镜智评设计系统
 * Modern Clean SaaS Style
 * 
 * 使用方法: 在需要的页面中引入此文件
 * <link rel="stylesheet" href="/css/design-tokens.css">
 */

:root {
  /* ========================================
   * Colors - 颜色系统
   * ======================================== */
  
  /* Background Colors */
  --color-bg-app: #f9fafb;           /* gray-50 - 应用背景 */
  --color-bg-card: #ffffff;          /* 卡片背景 */
  --color-bg-sidebar: #1e1e2d;       /* 深色侧边栏 */
  --color-bg-sidebar-hover: #2d2d3d; /* 侧边栏悬停 */
  --color-bg-input: #ffffff;         /* 输入框背景 */
  --color-bg-muted: #f3f4f6;         /* gray-100 - 次要背景 */
  
  /* Primary Brand Colors - 靛蓝色系 */
  --color-primary: #4f46e5;          /* indigo-600 - 主品牌色 */
  --color-primary-hover: #4338ca;    /* indigo-700 - 悬停状态 */
  --color-primary-light: rgba(79, 70, 229, 0.1);  /* 浅色背景 */
  --color-primary-ring: rgba(79, 70, 229, 0.3);   /* Focus ring */
  
  /* Text Colors */
  --color-text-primary: #111827;     /* gray-900 - 主要文字 */
  --color-text-secondary: #6b7280;   /* gray-500 - 次要文字 */
  --color-text-muted: #9ca3af;       /* gray-400 - 弱化文字 */
  --color-text-inverse: #ffffff;     /* 反色文字（深色背景上） */
  --color-text-sidebar: #a1a1aa;     /* 侧边栏文字 */
  --color-text-sidebar-active: #ffffff; /* 侧边栏激活文字 */
  
  /* Border Colors */
  --color-border: #e5e7eb;           /* gray-200 - 默认边框 */
  --color-border-light: #f3f4f6;     /* gray-100 - 浅色边框 */
  --color-border-focus: #4f46e5;     /* 聚焦边框 */
  
  /* Semantic Colors - 语义化颜色 */
  --color-success: #10b981;          /* emerald-500 */
  --color-success-light: #d1fae5;    /* emerald-100 */
  --color-success-dark: #059669;     /* emerald-600 */
  
  --color-warning: #f59e0b;          /* amber-500 */
  --color-warning-light: #fef3c7;    /* amber-100 */
  --color-warning-dark: #d97706;     /* amber-600 */
  
  --color-danger: #ef4444;           /* red-500 */
  --color-danger-light: #fee2e2;     /* red-100 */
  --color-danger-dark: #dc2626;      /* red-600 */
  
  --color-info: #3b82f6;             /* blue-500 */
  --color-info-light: #dbeafe;       /* blue-100 */
  --color-info-dark: #2563eb;        /* blue-600 */

  /* ========================================
   * Spacing - 间距系统 (基于 4px)
   * ======================================== */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ========================================
   * Border Radius - 圆角系统
   * ======================================== */
  --radius-none: 0;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ========================================
   * Shadows - 阴影系统
   * ======================================== */
  --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-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  
  /* Card Shadow - 卡片专用阴影 */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 
                 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                       0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* ========================================
   * Typography - 字体系统
   * ======================================== */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
               'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 
               Consolas, monospace;
  
  /* Font Sizes */
  --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 */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ========================================
   * Transitions - 过渡动画
   * ======================================== */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-colors: color 200ms ease, background-color 200ms ease, 
                       border-color 200ms ease;

  /* ========================================
   * Z-Index - 层级系统
   * ======================================== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* ========================================
   * Layout - 布局尺寸
   * ======================================== */
  --sidebar-width: 260px;
  --header-height: 64px;
  --content-max-width: 1200px;
}

/* ========================================
 * Base Reset & Defaults
 * ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-app);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
