/* =============================================
   K38.ai NEXT — Design Tokens
   版本: v1.1 · 含 Light Theme + 功能色
   终审: 四路会审(CC+520+Kimi+Gemini)通过
   ============================================= */

/* -------- 暗色主题 (默认) -------- */
:root, [data-theme="dark"] {
  /* 背景层级 */
  --bg-primary:      #0a0a0c;
  --bg-secondary:    #111115;
  --bg-card:         #1a1a1e;
  --bg-elevated:     #222226;
  --bg-hover:        rgba(255,255,255,0.06);

  /* 品牌色 — 暗色模式 */
  --brand-gold:           #c9a96e;
  --brand-gold-dim:      #a8884d;
  --brand-blue:           #4a9eff;  /* 对比度优化版 (原#0071e3→#4a9eff) */
  --brand-blue-dim:      #2a7ee0;

  /* 文字色 */
  --text-primary:     rgba(255,255,255,0.92);
  --text-secondary:   rgba(255,255,255,0.70);
  --text-muted:       rgba(255,255,255,0.50);  /* 对比度>=3:1 ✓ */
  --text-disabled:    rgba(255,255,255,0.25);

  /* 边框 & 分割线 */
  --border-subtle:    rgba(255,255,255,0.08);
  --border-default:   rgba(255,255,255,0.14);
  --border-strong:    rgba(255,255,255,0.22);

  /* 功能色 */
  --color-success:    #34d399;
  --color-warning:    #fbbf24;
  --color-error:      #f87171;
  --color-info:       #60a5fa;

  /* 阴影 */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);

  /* 圆角 */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  /* 间距 */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;
  --space-4xl:  96px;

  /* 排版比例尺 */
  --fs-caption:   12px;
  --fs-body:      14px;
  --fs-body-lg:   16px;
  --fs-h4:        18px;
  --fs-h3:        22px;
  --fs-h2:        28px;
  --fs-h1:        36px;
  --fs-display:   48px;

  --lh-tight:    1.15;
  --lh-normal:   1.5;
  --lh-loose:    1.75;

  /* 字体栈 */
  --font-sans:    'Inter', 'PingFang SC', -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* 过渡 */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;
}


/* -------- 亮色主题 -------- */
[data-theme="light"] {
  /* 背景层级 */
  --bg-primary:      #fafafa;
  --bg-secondary:    #f5f5f5;
  --bg-card:         #ffffff;
  --bg-elevated:     #ffffff;
  --bg-hover:        rgba(0,0,0,0.04);

  /* 品牌色 — 亮色模式 */
  --brand-gold:           #c9a96e;
  --brand-gold-dim:      #b8964d;
  --brand-blue:           #0071e3;  /* 亮色下可用原色 */
  --brand-blue-dim:      #0058b3;

  /* 文字色 */
  --text-primary:     rgba(0,0,0,0.90);
  --text-secondary:   rgba(0,0,0,0.65);
  --text-muted:       rgba(0,0,0,0.45);
  --text-disabled:    rgba(0,0,0,0.22);

  /* 边框 & 分割线 */
  --border-subtle:    rgba(0,0,0,0.06);
  --border-default:   rgba(0,0,0,0.12);
  --border-strong:    rgba(0,0,0,0.20);

  /* 功能色（亮色下微调） */
  --color-success:    #16a34a;
  --color-warning:    #d97706;
  --color-error:      #dc2626;
  --color-info:       #2563eb;

  /* 阴影（亮色下更轻柔） */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
}

/* =============================================
   别名映射（兼容 base.css / layout.css 引用）
   修复 P0: 命名约定一致性问题
   2026-07-25 · Kimi 审核发现
   ============================================= */
:root, [data-theme="dark"], [data-theme="light"] {

  /* 字体别名 */
  --font-body:      var(--font-sans);
  --font-display:   var(--font-sans);

  /* 字号别名 */
  --text-xs:        var(--fs-caption);    /* 12px */
  --text-sm:        var(--fs-body);       /* 14px */
  --text-base:      var(--fs-body);       /* 14px */
  --text-lg:        var(--fs-body-lg);    /* 16px */
  --text-xl:        var(--fs-h4);         /* 18px */
  --text-2xl:       var(--fs-h3);         /* 22px */
  --text-3xl:       var(--fs-h2);         /* 28px */
  --text-4xl:       var(--fs-h1);         /* 36px */
  --text-5xl:       var(--fs-display);    /* 48px */

  /* 行高别名 */
  --leading-normal:  var(--lh-normal);    /* 1.5 */
  --leading-tight:   var(--lh-tight);     /* 1.15 */
  --leading-loose:   var(--lh-loose);     /* 1.75 */
  --leading-relaxed: var(--lh-loose);     /* 1.75 */

  /* 过渡别名 */
  --duration-fast:   var(--transition-fast);   /* 150ms ease */
  --duration-normal: var(--transition-normal); /* 250ms ease */
  --duration-slow:   var(--transition-slow);   /* 400ms ease */
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:     ease-in-out;

  /* 容器 */
  --content-max:     1200px;
  --content-narrow:  800px;
  --nav-height:      64px;

  /* 背景毛玻璃 */
  --bg-glass:        rgba(10,10,12,0.72);

  /* 品牌色变体 */
  --brand-amber:     #d4a35c;

  /* 发光效果 */
  --glow-gold:       0 0 20px rgba(201,169,110,0.15);

  /* 边框 */
  --border-medium:   1px solid var(--border-default);

  /* 字母间距 */
  --tracking-tight:  -0.02em;
  --tracking-wide:   0.05em;
}
