@tailwind base;
@tailwind components;
@tailwind utilities;

/* 主题 CSS 变量定义 */
:root {
  /* 颜色变量 - 默认值（会被主题管理器动态覆盖） */
  --theme-color-primary: #a855f7;
  --theme-color-primaryHover: #9333ea;
  --theme-color-primaryActive: #7e22ce;
  --theme-color-background: #1a1a1a;
  --theme-color-backgroundSecondary: #2a2a2a;
  --theme-color-backgroundTertiary: #3a3a3a;
  --theme-color-surface: rgba(255, 255, 255, 0.1);
  --theme-color-surfaceHover: rgba(255, 255, 255, 0.15);
  --theme-color-surfaceActive: rgba(255, 255, 255, 0.2);
  --theme-color-text: #ffffff;
  --theme-color-textSecondary: rgba(255, 255, 255, 0.7);
  --theme-color-textTertiary: rgba(255, 255, 255, 0.5);
  --theme-color-textInverse: #1a1a1a;
  --theme-color-border: rgba(255, 255, 255, 0.1);
  --theme-color-borderLight: rgba(255, 255, 255, 0.05);
  --theme-color-borderDark: rgba(255, 255, 255, 0.2);
  --theme-color-success: #10b981;
  --theme-color-warning: #f59e0b;
  --theme-color-error: #ef4444;
  --theme-color-info: #3b82f6;
  --theme-color-glassBackground: rgba(255, 255, 255, 0.3);
  --theme-color-glassBorder: rgba(255, 255, 255, 0.3);
  --theme-color-glassHover: rgba(255, 255, 255, 0.4);
  --theme-color-shadow: rgba(0, 0, 0, 0.1);
  --theme-color-shadowHover: rgba(0, 0, 0, 0.15);
  --theme-color-shadowActive: rgba(0, 0, 0, 0.2);

  /* 间距变量 */
  --theme-spacing-xs: 0.25rem;
  --theme-spacing-sm: 0.5rem;
  --theme-spacing-md: 1rem;
  --theme-spacing-lg: 1.5rem;
  --theme-spacing-xl: 2rem;
  --theme-spacing-2xl: 3rem;
  --theme-spacing-3xl: 4rem;

  /* 圆角变量 */
  --theme-radius-none: 0;
  --theme-radius-sm: 0.25rem;
  --theme-radius-md: 0.5rem;
  --theme-radius-lg: 1rem;
  --theme-radius-xl: 1.5rem;
  --theme-radius-2xl: 2rem;
  --theme-radius-full: 9999px;

  /* 字体变量 */
  --theme-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --theme-font-mono: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;

  /* 动画变量 */
  --theme-duration-fast: 150ms;
  --theme-duration-normal: 300ms;
  --theme-duration-slow: 500ms;
  --theme-easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --theme-easing-in: cubic-bezier(0.4, 0, 1, 1);
  --theme-easing-out: cubic-bezier(0, 0, 0.2, 1);
  --theme-easing-inOut: cubic-bezier(0.4, 0, 0.2, 1);

  /* 毛玻璃效果变量 */
  --theme-glass-blur-light: 8px;
  --theme-glass-blur-medium: 16px;
  --theme-glass-blur-heavy: 24px;
  --theme-glass-opacity-light: 0.2;
  --theme-glass-opacity-medium: 0.3;
  --theme-glass-opacity-heavy: 0.5;

  /* 语义令牌（从基础变量派生，方便组件复用与扩展） */
  --fs-bg: var(--theme-color-background);
  --fs-bg-secondary: var(--theme-color-backgroundSecondary);
  --fs-bg-tertiary: var(--theme-color-backgroundTertiary);
  --fs-surface: var(--theme-color-surface);
  --fs-surface-hover: var(--theme-color-surfaceHover);
  --fs-surface-active: var(--theme-color-surfaceActive);
  --fs-surface-border: var(--theme-color-border);
  --fs-text: var(--theme-color-text);
  --fs-text-weak: var(--theme-color-textSecondary);
  --fs-text-muted: var(--theme-color-textTertiary);
  --fs-text-inverse: var(--theme-color-textInverse);
  --fs-primary: var(--theme-color-primary);
  --fs-primary-hover: var(--theme-color-primaryHover);
  --fs-primary-active: var(--theme-color-primaryActive);
  --fs-success: var(--theme-color-success);
  --fs-warning: var(--theme-color-warning);
  --fs-error: var(--theme-color-error);
  --fs-info: var(--theme-color-info);
  --fs-shadow: var(--theme-color-shadow);
  --fs-shadow-hover: var(--theme-color-shadowHover);
  --fs-shadow-active: var(--theme-color-shadowActive);
  --fs-overlay: rgba(0, 0, 0, 0.1); /* 保持现有蒙版近似效果，可被主题覆盖 */
  --fs-glass-bg: var(--theme-color-glassBackground);
  --fs-glass-border: var(--theme-color-glassBorder);
  --fs-glass-hover: var(--theme-color-glassHover);
}


body {
  margin: 0;
  font-family: var(--theme-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--theme-color-background);
  color: var(--theme-color-text);
  transition: background-color var(--theme-duration-normal) var(--theme-easing-default),
              color var(--theme-duration-normal) var(--theme-easing-default);
}

code {
  font-family: var(--theme-font-mono);
}

/* 搜索栏 placeholder 颜色支持 */
input[data-placeholder-color]::placeholder {
  color: var(--theme-searchbar-placeholder, rgba(255, 255, 255, 0.5));
}
