/* ====================================
   睿来智能体官网 - 公共样式
   Reliable Agent Official Website - Common Styles
   ==================================== */

/* 专业字体组合: Lexend (标题) + Source Sans 3 (正文) + 中文回退 */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* CSS变量定义 - 根据设计规范 */
:root {
  /* 主色调（品牌色）- 专业蓝紫色 Indigo */
  --color-primary: #6366F1;
  --color-primary-light: #818CF8;
  --color-primary-dark: #4F46E5;

  /* 背景色系（深色主题） */
  --color-bg-deep: #0F172A;
  --color-bg-dark: #1E293B;
  --color-bg-hover: #334155;
  --color-border: #3E4A63;

  /* 文字色系 */
  --color-text-white: #FFFFFF;
  --color-text-primary: #F1F5F9;
  --color-text-secondary: #A8B3C8;    /* 从#94A3B8改为#A8B3C8，对比度从3.8:1提升到4.6:1，符合WCAG AA */
  --color-text-disabled: #64748B;

  /* 功能色彩 */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* CTA 强调色 - 橙色，与蓝紫色形成互补对比 */
  --color-cta: #F97316;
  --color-cta-light: #FB923C;
  --color-cta-dark: #EA580C;

  /* 渐变色系 - 专业蓝紫色 */
  --gradient-purple: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  --gradient-blue-purple: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  --gradient-dark: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);

  /* 间距系统（8px基准） */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-xxxl: 96px;

  /* 字号层级 */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 36px;
  --font-size-3xl: 48px;
  --font-size-4xl: 64px;

  /* 圆角系统 */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 阴影系统 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

  /* 过渡动画 */
  --transition-fast: 200ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 400ms ease;
}

/* 浅色主题 - 优化配色方案 */
[data-theme="light"] {
  /* 主色调（品牌色）- 专业蓝紫色 Indigo */
  --color-primary: #4F46E5;
  --color-primary-light: #6366F1;
  --color-primary-dark: #4338CA;

  /* 背景色系（浅色主题 - 暖灰调） */
  --color-bg-deep: #FAFBFC;
  --color-bg-dark: #FFFFFF;
  --color-bg-hover: #F3F4F6;
  --color-border: #E5E7EB;

  /* 文字色系 - 优化对比度 */
  --color-text-white: #111827;
  --color-text-primary: #1F2937;
  --color-text-secondary: #4B5563;  /* 从#6B7280加深到#4B5563，提升对比度 */
  --color-text-disabled: #9CA3AF;

  /* 功能色彩（保持一致） */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* CTA 强调色 - 橙色 */
  --color-cta: #EA580C;
  --color-cta-light: #F97316;
  --color-cta-dark: #C2410C;

  /* 渐变色系 - 专业蓝紫色 */
  --gradient-purple: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  --gradient-blue-purple: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  --gradient-dark: linear-gradient(180deg, #FAFBFC 0%, #FFFFFF 100%);

  /* 阴影系统（浅色主题 - 增强层次感） */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.2);
}

/* CSS重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Sans 3', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg-deep);
  overflow-x: hidden;
}

/* 链接重置 */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

/* 列表重置 */
ul, ol {
  list-style: none;
}

/* 图片响应式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 按钮重置 */
button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* 标题样式 - 使用 Lexend 专业字体 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lexend', 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-weight: 600;
  color: var(--color-text-white);
  line-height: 1.3;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

/* 容器布局 */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-xxxl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-xxl);
}

.section-title h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-sm);
}

.section-title p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

/* 栅格系统 */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px;
}

.col {
  padding: 0 12px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-white { color: var(--color-text-white); }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-purple { color: var(--color-primary); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* 隐藏类 */
.hidden { display: none; }
.visible { display: block; }

/* 淡入动画（页面加载） */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 400ms ease-out;
}

/* 滚动进入动画 */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 数字滚动动画 */
@keyframes countUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 加载动画 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-bg-hover);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* 骨架屏动画 */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-dark) 0px,
    var(--color-bg-hover) 40px,
    var(--color-bg-dark) 80px
  );
  background-size: 1000px 100%;
  animation: shimmer 1500ms ease-in-out infinite;
}

/* 响应式设计 - 平板端 */
@media (max-width: 1199px) {
  :root {
    --font-size-4xl: 48px;
    --font-size-3xl: 36px;
    --font-size-2xl: 28px;
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .section {
    padding: var(--space-xxl) 0;
  }

  .col-6 { width: 50%; }
  .col-4 { width: 50%; }
  .col-3 { width: 50%; }
}

/* 响应式设计 - 移动端 */
@media (max-width: 767px) {
  :root {
    --font-size-4xl: 36px;
    --font-size-3xl: 28px;
    --font-size-2xl: 24px;
    --font-size-xl: 20px;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .col-12, .col-6, .col-4, .col-3 {
    width: 100%;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }
}

/* 减少动画偏好支持 - 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-animate {
    opacity: 1;
    transform: none;
  }

  .spinner {
    animation: none;
    border-color: var(--color-primary);
  }
}

/* 打印样式优化 */
@media print {
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none;
  }
}

/* 屏幕阅读器专用隐藏类（可访问性优化） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
