/**
 * 小媛社区统一设计令牌 (Unified Design Tokens)
 * 适用于: 社区论坛 / 后台管理 / 公开官网
 *
 * 品牌色基于官网现有的淡紫色 #7755b8
 *
 * 修改约定：
 * - 只新增或调整变量值，不删除变量名，避免各页面样式引用断裂。
 * - 颜色一律通过变量引用，不要在组件样式里写死十六进制值。
 */

:root {
  /* ========== 主色 / Primary Color ========== */
  --primary: #7755b8;
  --primary-hover: #8e6bc7;
  --primary-active: #6a4aa3;
  --primary-light: #c9b8e0;
  --primary-soft: #f3eef8;
  --primary-softer: #f8f5fc;
  --primary-ink: #5c3f92;
  --primary-ring: rgba(119, 85, 184, 0.28);

  /* 品牌渐变：用于强调区域、进度条和图标底 */
  --gradient-brand: linear-gradient(135deg, #8e6bc7 0%, #7755b8 55%, #6a4aa3 100%);
  --gradient-brand-soft: linear-gradient(135deg, #f3eef8 0%, #f8f5fc 100%);
  --gradient-warm: linear-gradient(135deg, #f9edf2 0%, #fdf7fa 100%);

  /* ========== 表面阶梯 / Surface Ladder ========== */
  --surface-0: #fbfafc;
  --surface-1: #f6f4f9;
  --surface-2: #ffffff;
  --surface-3: #fcfbfd;
  --border: #e8dff0;
  --border-hover: #d3c4e3;
  --border-strong: #cbb9de;

  /* 暗色变体 (用于后台侧边栏) */
  --surface-0-dark: #0a0812;
  --surface-1-dark: #15111d;
  --surface-2-dark: #1f1a2b;
  --surface-3-dark: #2a2436;
  --border-dark: #39304a;

  /* 玻璃层：吸顶导航、浮层、模态 */
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(232, 223, 240, 0.7);

  /* ========== 文本色 / Text Colors ========== */
  --text: #302a42;
  --text-secondary: #6b5f7d;
  --text-muted: #998ba6;
  --text-disabled: #bcafc7;
  --text-on-accent: #ffffff;

  /* ========== 语义色 / Semantic Colors ========== */
  --success: #2d8659;
  --success-soft: #e9f5ef;
  --success-border: #b6ddc9;
  --warning: #a37d1f;
  --warning-soft: #fef6e8;
  --warning-border: #ecd6a3;
  --error: #c4405a;
  --error-soft: #fbeef2;
  --error-border: #eeb8c5;
  --info: #5a6fb8;
  --info-soft: #eef1f9;
  --info-border: #c2cbe8;

  /* ========== 排版 / Typography ========== */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: Consolas, "Courier New", monospace;

  /* 流式尺寸 */
  --text-xs: clamp(0.688rem, 0.66rem + 0.14vw, 0.75rem);
  --text-sm: clamp(0.813rem, 0.77rem + 0.21vw, 0.938rem);
  --text-base: clamp(0.938rem, 0.88rem + 0.29vw, 1.063rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.38vw, 1.313rem);
  --text-xl: clamp(1.375rem, 1.27rem + 0.53vw, 1.688rem);
  --text-2xl: clamp(1.75rem, 1.60rem + 0.75vw, 2.188rem);
  --text-3xl: clamp(2.25rem, 2.03rem + 1.10vw, 2.875rem);

  /* 字重 */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* 行高 */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* 字距 */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.15em;

  /* ========== 间距 / Spacing ========== */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ========== 圆角 / Border Radius ========== */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 999px;

  /* ========== 阴影 / Shadows ========== */
  --shadow-xs: 0 1px 2px rgba(119, 85, 184, 0.06);
  --shadow-sm: 0 2px 6px rgba(119, 85, 184, 0.08);
  --shadow-md: 0 4px 12px rgba(119, 85, 184, 0.10);
  --shadow-lg: 0 8px 24px rgba(119, 85, 184, 0.12);
  --shadow-xl: 0 16px 48px rgba(119, 85, 184, 0.14);
  --shadow-2xl: 0 24px 64px rgba(119, 85, 184, 0.16);
  --shadow-focus: 0 0 0 3px rgba(119, 85, 184, 0.25);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* 悬停时卡片抬升的距离 */
  --lift: -3px;

  /* ========== 过渡 / Transitions ========== */
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);

  /* 统一的过渡组合，供组件直接引用 */
  --transition-colors: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
  --transition-lift: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  --transition-surface: background-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);

  /* 动效时长（供 motion.css 与 JS 共用） */
  --motion-duration-fast: 0.16s;
  --motion-duration: 0.28s;
  --motion-duration-slow: 0.5s;
  --motion-stagger: 55ms;
  --motion-reveal-shift: 14px;

  /* ========== 图标 / Icons ========== */
  --icon-xs: 0.875rem;
  --icon-sm: 1rem;
  --icon-md: 1.25rem;
  --icon-lg: 1.5rem;
  --icon-tile-sm: 2.5rem;
  --icon-tile-md: 3rem;
  --icon-tile-lg: 4rem;

  /* ========== 布局 / Layout ========== */
  --layout-community: 1184px;
  --layout-public: 1184px;
  --layout-admin-sidebar: 248px;
  --layout-header-height: 64px;

  /* ========== Z-index 层级 ========== */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;
  --z-tooltip: 70;

  /* ========== 旧变量别名 (向后兼容) ========== */
  --secondary: var(--primary-light);
  --bg: var(--surface-0);
  --card-bg: var(--surface-2);
  --header-bg: var(--surface-2);
  --text-color: var(--text);
  --bg-color: var(--surface-0);
  --border-color: var(--border);
  --primary-color: var(--primary);
  --danger: var(--error);
}
