/* ForgeRankAI — single source of truth for design tokens.
 * Dark is the default :root; light mode overrides via [data-theme="light"] / .theme-light.
 * All components MUST reference these tokens (var(--x)) instead of hardcoded colors.
 * Keep this file free of component-level rules — only token definitions belong here. */

:root {
  /* surfaces & text */
  --bg: #0b0b0f;
  --sidebar: #15151b;
  --panel: #16161d;
  --panel-2: #1c1c24;
  --nav-bg: rgba(22,22,29,0.95);
  --text: #e8e8ea;
  --muted: #9a9aa8;
  --border: #26262f;
  --border-light: #3a3a48;

  /* brand */
  --purple: #7F77DD;
  --purple-bright: #a18ff0;
  --purple-hover: #6c64cf;        /* 比 --purple 深一档，用于 hover 不再一律 brightness(1.08) */
  --purple-subtle: rgba(127,119,221,0.12);
  --purple-border: rgba(127,119,221,0.35);
  --gold: #FFD700;
  --gold-soft: rgba(245,166,35,0.10);
  --gold-border: rgba(245,166,35,0.35);
  --gold-subtle: rgba(245,166,35,0.07);
  --user-bubble: #f5a623;

  /* status colors */
  --red: #ff7a7a;
  --danger-solid: #e5484d;
  --green: #5fdc8a;
  --blue: #6ca8ff;

  /* layout */
  --sidebar-w: 260px;

  /* elevation — 统一全站玻璃/阴影质感，不再各处写死 rgba(0,0,0,x) */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-card: 0 8px 28px rgba(0,0,0,0.35);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.5);

  /* links */
  --link: #a18ff0;

  /* pricing / legal banner */
  --banner-bg: rgba(127, 119, 221, 0.10);
  --banner-border: rgba(127, 119, 221, 0.28);
  --banner-text: #d7d7e0;

  /* trends status pills */
  --live-bg: #dcfce7;
  --live-fg: #166534;
  --ai-bg: #f3f4f6;
  --ai-fg: #374151;
  --up: #4ade80;
  --down: #f87171;
  --steady: #9a9aa8;

  /* semantic status / surface — 随主题自动翻转，组件不得再写死这些颜色 */
  --danger-bg: #3a1a1a;
  --danger-fg: #ff9a9a;
  --danger-border: #5a2a2a;

  --toast-error-bg: #2a1515;
  --toast-error-fg: #ffadad;
  --toast-error-border: #5a2a2a;
  --toast-success-bg: #132a1a;
  --toast-success-fg: #a3e6b5;
  --toast-success-border: #2a5a3a;
  --toast-info-bg: #151a2a;
  --toast-info-fg: #adc4ff;
  --toast-info-border: #2a3a5a;

  --chip-bg: rgba(255,255,255,0.06);
  --chip-fg: #d7d7e2;

  --cta-bg: #16161d;
  --cta-fg: #d7d7e0;
  --cta-border: #185FA5;
  --cta-hover: #12233a;
  --cta-accent: #3b82d6;

  --footer-border: #26262f;

  /* code 块（浅色模式下需显式 token，避免 #f0f0f3/#c00 硬编码） */
  --code-bg: transparent;
  --code-fg: inherit;
}

/* ---- 浅色覆盖：新增 token 的浅色值 ---- */
html[data-theme="light"], .theme-light {
  --purple-hover: #6c64cf;
  --purple-subtle: rgba(127,119,221,0.10);
  --purple-border: rgba(127,119,221,0.40);
  --gold-soft: rgba(245,166,35,0.12);
  --gold-border: rgba(245,166,35,0.40);
  --gold-subtle: rgba(245,166,35,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-card: 0 8px 28px rgba(0,0,0,0.10);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.18);
  --code-bg: #f0f0f3;
  --code-fg: #c00;
}

html[data-theme="light"], .theme-light {
  --bg: #f4f5f7;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f0f1f4;
  --nav-bg: rgba(255,255,255,0.95);
  --text: #1a1a1a;
  --muted: #4b5563;
  --border: #e5e7eb;
  --border-light: #d1d5db;
  --purple: #7F77DD;
  --purple-bright: #5f4fc4;   /* 🔴 2026-09-13 light 调深：原 #a18ff0 浅底仅 2.4-2.7:1，现白底 ~5:1（全站亮紫文字审计项） */
  --gold: #b45309;            /* 🔴 2026-09-13 light 调深：原 #f59e0b 浅底仅 1.9-2.2:1，现白底 ~5:1（全站金色文字审计项） */
  --user-bubble: #b45309;
  --link: #7F77DD;
  --red: #dc2626;
  --danger-solid: #dc2626;
  --green: #16a34a;
  --blue: #2563eb;
  --banner-bg: rgba(127, 119, 221, 0.08);
  --banner-border: rgba(127, 119, 221, 0.22);
  --banner-text: #374151;
  --live-bg: #dcfce7;
  --live-fg: #166534;
  --ai-bg: #f3f4f6;
  --ai-fg: #374151;
  --up: #16a34a;
  --down: #dc2626;
  --steady: #6b7280;

  /* semantic status / surface — light 值 */
  --danger-bg: #fdecea;
  --danger-fg: #b3261e;
  --danger-border: #f3b4ad;

  --toast-error-bg: #fdecea;
  --toast-error-fg: #b3261e;
  --toast-error-border: #f3b4ad;
  --toast-success-bg: #eafaf0;
  --toast-success-fg: #1b7a3d;
  --toast-success-border: #a7d9bd;
  --toast-info-bg: #eaf0fd;
  --toast-info-fg: #1f4fb0;
  --toast-info-border: #a8c0e8;

  --chip-bg: rgba(0,0,0,0.05);
  --chip-fg: #4b5563;

  --cta-bg: #ffffff;
  --cta-fg: #374151;
  --cta-border: #185FA5;
  --cta-hover: #eef4ff;
  --cta-accent: #2563eb;

  --footer-border: #e5e7eb;
}
