/*
 * 蓝海智推首页样式系统 - 渐变未来主义版
 * 设计理念：数据驱动的智能转化系统，每个像素都为转化服务
 * 作者：AI设计师 | 版本：Ultimate V1.0
 */

/* ===== 核心变量系统 ===== */
:root {
  /* 动态色彩系统 */
  --primary: #667eea;
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #4facfe;
  --premium: #ffecd2;
  --dark: #1a202c;
  --light: #f8fafc;
  
  /* 渐变定义 */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --premium-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --hero-pattern: radial-gradient(circle at 20% 50%, #667eea 0%, transparent 50%), 
                  radial-gradient(circle at 80% 20%, #764ba2 0%, transparent 50%);
  
  /* 高级阴影系统 */
  --shadow-magical: 0 25px 50px -12px rgba(102, 126, 234, 0.25), 
                    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 
                 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  --shadow-button: 0 4px 15px rgba(102, 126, 234, 0.4), 
                   0 0 0 2px rgba(255, 255, 255, 0.1) inset;
  
  /* 动画时间函数 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86);
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* 响应式断点 */
  --mobile: 480px;
  --tablet: 768px;
  --desktop: 1024px;
  --large: 1280px;
}

/* ===== 全局重置和基础样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #374151;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f8fafc 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== 智能导航系统 ===== */
#main-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s var(--ease-out-expo);
}

#main-header.scrolled {
  background: rgba(102, 126, 234, 0.98) !important;
  box-shadow: var(--shadow-magical);
}

#main-header.hidden {
  opacity: 0;
  visibility: hidden;
}

/* 导航下拉菜单增强 */
.group:hover .group-hover\\:opacity-100 {
  opacity: 1 !important;
  visibility: visible !important;
}

/* 移动端菜单动画 */
#mobile-menu.show {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== 页面加载器 ===== */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--primary-gradient);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.8s var(--ease-out-expo);
}

#page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* ===== 英雄区域高级效果 ===== */
#hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-pattern);
  opacity: 0.05;
  background-size: 400% 400%;
}

/* 英雄区粒子系统 */
.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.6;
}

.hero-particle:nth-child(2) { opacity: 0.5; }
.hero-particle:nth-child(3) { opacity: 0.4; }
.hero-particle:nth-child(4) { opacity: 0.3; }
.hero-particle:nth-child(5) { opacity: 0.2; }

/* 文字发光效果 */
.text-glow {
  text-shadow: 0 0 15px rgba(102, 126, 234, 0.4),
               0 0 30px rgba(118, 75, 162, 0.2);
}

/* ===== 卡片系统增强 ===== */
.card-hover-3d {
  transition: box-shadow 0.3s ease;
}

.card-hover-3d:hover {
  box-shadow: var(--shadow-card);
}

/* 流体卡片设计 */
.fluid-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.fluid-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--primary-gradient);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fluid-card:hover::before {
  opacity: 0.1;
}

.fluid-card:hover {
  box-shadow: var(--shadow-magical);
}

/* ===== 超级CTA按钮系统 ===== */
.super-cta {
  position: relative;
  background: var(--primary-gradient);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.super-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.8s ease;
}

.super-cta:hover::before {
  left: 100%;
}

.super-cta:hover {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.super-cta:active {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 稀缺性标签 */
.urgency-label {
  position: absolute;
  top: -12px;
  left: 50%;
  margin-left: -50px;
  background: #ef4444;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ===== 套餐价格心理学设计 ===== */
.pricing-card {
  position: relative;
  transition: box-shadow 0.3s ease;
}

.pricing-card.featured {
  z-index: 10;
}

.pricing-card:hover {
  box-shadow: var(--shadow-magical);
}

.pricing-card.featured:hover {
  box-shadow: var(--shadow-magical);
}

/* 价格动画 */
.price-animate {
  display: inline-block;
}

/* 社会证明元素 */
.social-proof {
  position: relative;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ===== 案例筛选动画 ===== */
.case-filter {
  transition: all 0.3s ease;
  cursor: pointer;
}

.case-filter.active,
.case-filter:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.case-card {
  transition: box-shadow 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.case-card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.case-card:hover {
  box-shadow: var(--shadow-magical);
}

/* ===== 视频播放器增强 ===== */
#video-player {
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

#video-player:hover {
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

#play-button {
  transition: all 0.3s ease;
}

#video-player:hover #play-button {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

#video-loading {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== 表单增强样式 ===== */
.form-input {
  transition: all 0.3s ease;
  border: 2px solid rgba(102, 126, 234, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input:hover {
  border-color: rgba(102, 126, 234, 0.2);
}

/* ===== 实时状态指示器 ===== */
.status-indicator {
  position: relative;
}

.status-indicator::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--success-gradient);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
}

.status-indicator.online::before {
  opacity: 0.3;
}

/* ===== 返回顶部按钮 ===== */
#back-to-top {
  transition: all 0.3s ease;
}

#back-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

#back-to-top:hover {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#back-to-top:active {
  box-shadow: var(--shadow-button);
}

/* ===== 滚动指示器 ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(102, 126, 234, 0.1);
  z-index: 1000;
}

.scroll-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-gradient);
  width: var(--scroll-progress, 0%);
  transition: width 0.1s ease-out;
}

/* ===== 微交互增强 ===== */
.micro-bounce:hover {
  box-shadow: var(--shadow-card);
}

.micro-bounce:active {
  box-shadow: var(--shadow-button);
}

.micro-rotate:hover {
  box-shadow: var(--shadow-card);
}

/* ===== 响应式媒体查询增强 ===== */

/* 超小屏幕优化 (320px - 480px) */
@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  
  /* 导航栏移动端优化 */
  #main-header {
    padding: 0.5rem 0;
  }
  
  #main-header .container {
    padding: 0 1rem;
  }
  
  /* 品牌标识缩小 */
  #main-header .flex.items-center.space-x-3 {
    font-size: 0.9em;
  }
  
  /* 英雄区移动端优化 */
  #hero {
    min-height: 90vh;
    padding-top: 5rem;
  }
  
  .hero-title {
    font-size: 2.25rem !important;
    line-height: 1.1;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem;
  }
  
  /* 数据展示卡片移动端优化 */
  .hero-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem;
  }
  
  .hero-stats > div:last-child {
    grid-column: 1 / -1;
  }
  
  /* 按钮组移动端优化 */
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .hero-buttons button {
    width: 100%;
    padding: 1rem 2rem;
  }
  
  /* 卡片优化 */
  .card-hover-3d:hover {
    box-shadow: var(--shadow-card);
  }
  
  .fluid-card {
    padding: 1.5rem;
    border-radius: 1rem;
  }
  
  .fluid-card:hover {
    box-shadow: var(--shadow-magical);
  }
  
  /* 套餐区域移动端优化 */
  .pricing-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .pricing-card.featured {
    order: -1; /* 推荐套餐显示在最前面 */
  }
  
  .pricing-card:hover {
    box-shadow: var(--shadow-magical);
  }
  
  .pricing-card.featured:hover {
    box-shadow: var(--shadow-magical);
  }
  
  /* 案例卡片移动端优化 */
  .case-card {
    padding: 1.5rem;
  }
  
  .case-card:hover {
    box-shadow: var(--shadow-magical);
  }
  
  /* 表单优化 */
  .form-input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
  
  /* 视频播放器移动端优化 */
  #video-player {
    margin: 1rem 0;
  }
  
  #play-button {
    width: 4rem;
    height: 4rem;
  }
  
  /* 联系信息卡片优化 */
  .contact-info-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  /* 页脚优化 */
  footer {
    padding: 3rem 0 2rem;
  }
  
  footer .grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  /* 动画性能优化 */
  .super-cta {
    animation: none; /* 节省移动端电池 */
  }
  
  /* 移除所有动画效果 */
  *,
  *::before,
  *::after {
    animation: none !important;
  }
  
  /* 滚动优化 */
  .scroll-progress {
    height: 2px;
  }
  
  /* 返回顶部按钮移动端优化 */
  #back-to-top {
    width: 3rem;
    height: 3rem;
    bottom: 1rem;
    right: 1rem;
  }
}

/* 小屏幕优化 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    font-size: 15px;
  }
  
  /* 英雄区平板优化 */
  #hero {
    min-height: 85vh;
  }
  
  .hero-title {
    font-size: 3rem !important;
  }
  
  .hero-subtitle {
    font-size: 1.125rem !important;
  }
  
  /* 卡片网格优化 */
  .advantages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .pricing-card.featured {
    grid-column: 1 / -1;
    max-width: 24rem;
    margin: 0 auto;
  }
  
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  /* 视频区域平板优化 */
  .video-section {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  /* 联系我们区域平板优化 */
  .contact-section {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .contact-form {
    order: -1; /* 表单在上方 */
  }
}

/* 中等屏幕优化 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* 容器宽度调整 */
  .container {
    max-width: 90%;
  }
  
  /* 网格布局调整 */
  .advantages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .services-grid > div:last-child {
    grid-column: 1 / -1;
    max-width: 32rem;
    margin: 0 auto;
  }
  
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .pricing-card.featured {
    grid-column: 1 / -1;
    max-width: 28rem;
    margin: 0 auto;
  }
  
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除hover效果，使用点击激活 */
  .card-hover-3d:hover {
    box-shadow: var(--shadow-card);
  }
  
  .fluid-card:hover {
    box-shadow: var(--shadow-magical);
  }
  
  /* 增大点击区域 */
  button,
  .btn,
  a[href] {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 表单元素触摸优化 */
  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  /* 导航菜单触摸优化 */
  nav a {
    padding: 1rem;
    margin: 0.25rem 0;
  }
  
  /* CTA按钮触摸优化 */
  .super-cta {
    padding: 1rem 2rem;
    min-height: 56px;
  }
}

/* 横屏手机优化 */
@media (orientation: landscape) and (max-height: 500px) {
  #hero {
    min-height: 100vh;
    padding: 4rem 0 2rem;
  }
  
  .hero-title {
    font-size: 2.5rem !important;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 移动端性能优化 */
@media (max-width: 768px) {
  /* 减少模糊效果以提升性能 */
  .backdrop-blur-md {
    backdrop-filter: blur(5px);
  }
  
  .backdrop-blur-sm {
    backdrop-filter: blur(2px);
  }
  
  /* 简化阴影效果 */
  .shadow-magical {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  }
  
  .shadow-card {
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
  }
  
  /* 移动端间距优化 */
  .py-24 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .py-16 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* 移动端容器内边距 */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== 性能优化 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 高对比度模式支持 ===== */
@media (prefers-contrast: high) {
  :root {
    --primary: #0056b3;
    --secondary: #495057;
  }
  
  .fluid-card {
    border: 2px solid var(--primary);
  }
}

/* ===== 暗色主题支持 ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --light: #1a202c;
    --dark: #f8fafc;
  }
  
  body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    color: #e2e8f0;
  }
}

/* ===== 工具类 ===== */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out-expo);
}

.animate-on-scroll.animate {
  opacity: 1;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-border {
  position: relative;
  background: white;
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: var(--primary-gradient);
  border-radius: inherit;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: destination-out;
}

/* ===== 加载状态 ===== */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-gradient);
}

/* ===== 打印样式 ===== */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .no-print {
    display: none !important;
  }
}

/* ===== CSS变量动画支持 ===== */
@supports (color: color(display-p3 1 0 0)) {
  :root {
    --primary: color(display-p3 0.4 0.49 0.92);
    --secondary: color(display-p3 0.46 0.29 0.64);
  }
}

/* ===== 现代CSS功能支持 ===== */
@supports (backdrop-filter: blur(10px)) {
  .modern-blur {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }
}

/* ===== 焦点可见性增强 ===== */
.focus-visible\:ring-2:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== CSS子网格支持 ===== */
@supports (grid-template-rows: subgrid) {
  .subgrid {
    grid-template-rows: subgrid;
  }
}

/* ===== 结束 ===== */

/*
 * 性能优化提示：
 * 1. 使用 transform 和 opacity 进行动画，避免触发布局重排
 * 2. 使用 will-change 属性预告动画元素
 * 3. 使用 contain 属性隔离重绘区域
 * 4. 合理使用 GPU 加速，避免过度消耗资源
 * 
 * 兼容性说明：
 * - 支持现代浏览器（Chrome 90+, Firefox 88+, Safari 14+, Edge 90+）
 * - 渐进式增强，在不支持的浏览器中提供基础体验
 * - 使用 @supports 规则进行特性检测
 */