/**
 * @file tokens.css
 * @description GTools 门户设计系统 Tokens（颜色、排版、间距、动效、阴影与圆角）
 * @standard 遵循 apple-design 与 client-h5-responsive 规范
 */

:root {
  /* ================= 品牌与语义色 (系统级) ================= */
  --gt-blue: #0a84ff;
  --gt-blue-hover: #0071e3;
  --gt-blue-soft: rgba(10, 132, 255, 0.12);
  --gt-green: #30d158;
  --gt-green-soft: rgba(48, 209, 88, 0.12);
  --gt-orange: #ff9f0a;
  --gt-orange-soft: rgba(255, 159, 10, 0.12);
  --gt-red: #ff453a;
  --gt-red-soft: rgba(255, 69, 58, 0.12);
  --gt-indigo: #5e5ce6;
  --gt-indigo-soft: rgba(94, 92, 230, 0.12);
  --gt-teal: #64d2ff;
  --gt-teal-soft: rgba(100, 210, 255, 0.12);
  --gt-purple: #bf5af2;
  --gt-purple-soft: rgba(191, 90, 242, 0.12);
  --gt-yellow: #ffd60a;
  --gt-yellow-soft: rgba(255, 214, 10, 0.12);

  /* 四端设备专属标识色 */
  --gt-platform-mac: #8e8e93;
  --gt-platform-ios: #0a84ff;
  --gt-platform-android: #30d158;
  --gt-platform-harmony: #ff453a;

  /* ================= 深色模式（默认基底：黑曜石） ================= */
  --gt-bg: #000000;
  --gt-bg-elevated: #0e0e12;
  --gt-bg-surface: #16161e;
  --gt-card-bg: rgba(255, 255, 255, 0.05);
  --gt-card-bg-hover: rgba(255, 255, 255, 0.08);
  --gt-card-bg-active: rgba(255, 255, 255, 0.12);
  --gt-border: rgba(255, 255, 255, 0.1);
  --gt-border-subtle: rgba(255, 255, 255, 0.06);
  --gt-border-focus: rgba(10, 132, 255, 0.6);

  --gt-text-primary: #f5f5f7;
  --gt-text-secondary: rgba(235, 235, 245, 0.65);
  --gt-text-tertiary: rgba(235, 235, 245, 0.4);
  --gt-text-inverse: #000000;

  --gt-nav-bg: rgba(0, 0, 0, 0.75);
  --gt-island-bg: #000000;
  --gt-glass-filter: blur(24px) saturate(180%);

  /* 阴影 */
  --gt-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --gt-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --gt-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --gt-shadow-glow: 0 0 32px rgba(10, 132, 255, 0.25);

  /* ================= 排版与字体 ================= */
  --gt-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gt-font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, Monaco, monospace;

  /* ================= 圆角系统 (Apple G2 连续平滑曲率) ================= */
  --gt-radius-sm: 8px;
  --gt-radius-md: 14px;
  --gt-radius-lg: 20px;
  --gt-radius-xl: 28px;
  --gt-radius-pill: 9999px;

  /* ================= 间距体系 ================= */
  --gt-space-xs: 4px;
  --gt-space-sm: 8px;
  --gt-space-md: 16px;
  --gt-space-lg: 24px;
  --gt-space-xl: 36px;
  --gt-space-2xl: 56px;
  --gt-space-3xl: 80px;

  /* 布局宽度 */
  --gt-container-max: 1200px;
  --gt-container-narrow: 860px;

  /* ================= 动效参数 (符合 apple-design 规范) ================= */
  --gt-ease-standard: cubic-bezier(0.25, 1, 0.5, 1);
  --gt-ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --gt-ease-island: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gt-duration-fast: 160ms;
  --gt-duration-normal: 260ms;
  --gt-duration-slow: 400ms;
}

/* 浅色模式适配（通过 html[data-theme="light"] 或系统偏好） */
html[data-theme="light"] {
  --gt-bg: #f5f5f7;
  --gt-bg-elevated: #ffffff;
  --gt-bg-surface: #e5e5ea;
  --gt-card-bg: rgba(255, 255, 255, 0.8);
  --gt-card-bg-hover: rgba(255, 255, 255, 0.95);
  --gt-card-bg-active: #ffffff;
  --gt-border: rgba(0, 0, 0, 0.08);
  --gt-border-subtle: rgba(0, 0, 0, 0.04);
  --gt-border-focus: rgba(10, 132, 255, 0.5);

  --gt-text-primary: #1d1d1f;
  --gt-text-secondary: #6e6e73;
  --gt-text-tertiary: #86868b;
  --gt-text-inverse: #ffffff;

  --gt-nav-bg: rgba(245, 245, 247, 0.8);
  --gt-island-bg: #000000; /* 灵动岛始终保持纯黑硬件质感 */
  --gt-glass-filter: blur(20px) saturate(180%);

  --gt-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --gt-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --gt-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --gt-shadow-glow: 0 0 32px rgba(10, 132, 255, 0.18);
}
