/*
  灵犀 AI 平台 — Brand Tokens
  Modern AI tech feel · single indigo brand hue · dark-first
*/

/* ============ Light Mode (default) ============ */
:root {
  /* Primary scale — custom electric indigo */
  --ai-primary-50: #f0f0fe;
  --ai-primary-100: #e2e1fd;
  --ai-primary-200: #c8c5fa;
  --ai-primary-300: #a79ff5;
  --ai-primary-400: #8b80ef;
  --ai-primary-500: #7568e8;
  --ai-primary-600: #5f4fd4;
  --ai-primary-700: #4e41ae;
  --ai-primary-800: #42388e;
  --ai-primary-900: #393172;
  --ai-primary-950: #221d45;

  /* Neutral cool scale */
  --ai-neutral-0: #ffffff;
  --ai-neutral-50: #f6f7fa;
  --ai-neutral-100: #eceef3;
  --ai-neutral-200: #dfe2ea;
  --ai-neutral-300: #c8cdd9;
  --ai-neutral-400: #9aa1b3;
  --ai-neutral-500: #6c7386;
  --ai-neutral-600: #52586b;
  --ai-neutral-700: #414656;
  --ai-neutral-800: #2a2e3c;
  --ai-neutral-850: #20232f;
  --ai-neutral-900: #171924;
  --ai-neutral-950: #0e0f17;

  /* Semantic surfaces */
  --ai-background: #f6f7fa;
  --ai-foreground: #171924;
  --ai-card: #ffffff;
  --ai-card-foreground: #171924;
  --ai-popover: #ffffff;
  --ai-popover-foreground: #171924;
  --ai-muted: #eceef3;
  --ai-muted-foreground: #5c6174;
  --ai-primary: #5f4fd4;
  --ai-primary-foreground: #ffffff;
  --ai-border: #e0e3ec;
  --ai-input: #e0e3ec;
  --ai-ring: #5f4fd4;
  --ai-destructive: #d93d58;
  --ai-destructive-foreground: #ffffff;

  /* App chrome */
  --ai-sidebar: #ffffff;
  --ai-sidebar-foreground: #171924;
  --ai-sidebar-accent: #f0f1f6;
  --ai-sidebar-border: #e4e7ef;
  --ai-surface-hover: #f2f3f8;
  --ai-surface-active: #e9ebf3;

  /* State colors — semantic status only */
  --state-success: #15a37a;
  --state-success-soft: #e3f6ef;
  --state-warning: #cf8a12;
  --state-warning-soft: #faf0da;
  --state-error: #d93d58;
  --state-error-soft: #fbe8ec;
  --state-info: #2f7fe0;
  --state-info-soft: #e6f0fc;

  /* Radius — restrained scale */
  --ai-radius-sm: 4px;
  --ai-radius-md: 8px;
  --ai-radius-lg: 14px;
  --ai-radius-full: 9999px;

  /* Shadows */
  --ai-shadow-static: 0 1px 2px rgba(20, 23, 38, 0.05);
  --ai-shadow-float: 0 16px 48px -12px rgba(20, 23, 38, 0.18);
  --ai-shadow-overlay: 0 24px 64px -16px rgba(20, 23, 38, 0.28);

  /* Typography */
  --ai-font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --ai-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

/* ============ Dark Mode ============ */
.dark {
  color-scheme: dark;
  /* Semantic surfaces — layered, never pure black */
  --ai-background: #0b0c12;
  --ai-foreground: #e9eaf2;
  --ai-card: #14151f;
  --ai-card-foreground: #e9eaf2;
  --ai-popover: #1a1b27;
  --ai-popover-foreground: #e9eaf2;
  --ai-muted: #181a25;
  --ai-muted-foreground: #969bb0;
  --ai-primary: #7c72f5;
  --ai-primary-foreground: #161331;
  --ai-border: #242636;
  --ai-input: #2a2c3e;
  --ai-ring: #7c72f5;
  --ai-destructive: #f0607a;
  --ai-destructive-foreground: #2a0d15;

  /* App chrome */
  --ai-sidebar: #10111a;
  --ai-sidebar-foreground: #e9eaf2;
  --ai-sidebar-accent: #1b1d2a;
  --ai-sidebar-border: #20223180;
  --ai-surface-hover: #1b1d2a;
  --ai-surface-active: #232536;

  /* State colors */
  --state-success: #35c98f;
  --state-success-soft: #13251f;
  --state-warning: #e5b24b;
  --state-warning-soft: #2a2313;
  --state-error: #f0607a;
  --state-error-soft: #2c151b;
  --state-info: #5ba3f0;
  --state-info-soft: #142236;

  /* Shadows — deep floats only */
  --ai-shadow-static: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ai-shadow-float: 0 16px 48px -12px rgba(0, 0, 0, 0.55);
  --ai-shadow-overlay: 0 24px 64px -16px rgba(0, 0, 0, 0.65);
}

/* ============ Global Typography ============ */
html {
  font-family: var(--ai-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--ai-font-sans);
}

.font-mono,
code,
pre {
  font-family: var(--ai-font-mono);
}

/* Numeric alignment for metrics */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Focus visibility baseline */
:focus-visible {
  outline: 2px solid var(--ai-ring);
  outline-offset: 2px;
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: var(--ai-radius-full);
}
::-webkit-scrollbar-track {
  background: transparent;
}
