/* ========================================
   创意页面视觉元素设计系统
   整合自页面创意设计项目
   ======================================== */

:root {
  /* 主色彩系统 */
  --creative-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --creative-secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --creative-accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --creative-success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --creative-warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  
  /* 基础色值 */
  --creative-primary: #667eea;
  --creative-secondary: #764ba2;
  --creative-accent: #4facfe;
  --creative-success: #43e97b;
  --creative-warning: #fa709a;
  --creative-danger: #ff6b6b;
  --creative-dark: #2d3748;
  --creative-light: #f7fafc;
  
  /* 阴影系统 */
  --creative-shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --creative-shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
  --creative-shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --creative-shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  --creative-shadow-glow: 0 0 20px rgba(102, 126, 234, 0.5);
  
  /* 圆角系统 */
  --creative-radius-sm: 4px;
  --creative-radius-md: 8px;
  --creative-radius-lg: 12px;
  --creative-radius-xl: 20px;
  --creative-radius-full: 9999px;
  
  /* 动画曲线 */
  --creative-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --creative-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --creative-ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* 动画时长 */
  --creative-duration-fast: 150ms;
  --creative-duration-normal: 300ms;
  --creative-duration-slow: 500ms;
}

/* ========================================
   1. 创意按钮元素系列
   ======================================== */

/* 1.1 渐变光晕按钮 */
.btn-glow {
  position: relative;
  padding: 12px 32px;
  border: none;
  border-radius: var(--creative-radius-full);
  background: var(--creative-primary-gradient);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
  box-shadow: var(--creative-shadow-md);
}

.btn-glow::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 var(--creative-duration-slow) var(--creative-ease-smooth);
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: var(--creative-shadow-glow), var(--creative-shadow-lg);
}

.btn-glow:hover::before {
  left: 100%;
}

.btn-glow:active {
  transform: translateY(0);
}

/* 1.2 边框动画按钮 */
.btn-border-animate {
  position: relative;
  padding: 12px 32px;
  background: transparent;
  border: 2px solid var(--creative-primary);
  border-radius: var(--creative-radius-md);
  color: var(--creative-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
  z-index: 1;
}

.btn-border-animate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--creative-primary-gradient);
  transition: width var(--creative-duration-normal) var(--creative-ease-smooth);
  z-index: -1;
}

.btn-border-animate:hover {
  color: white;
  border-color: transparent;
  box-shadow: var(--creative-shadow-lg);
}

.btn-border-animate:hover::before {
  width: 100%;
}

/* 1.3 3D 按压按钮 */
.btn-3d {
  position: relative;
  padding: 12px 32px;
  border: none;
  border-radius: var(--creative-radius-lg);
  background: var(--creative-accent-gradient);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--creative-duration-fast) var(--creative-ease-smooth);
  box-shadow: 0 6px 0 #2c8ad4, 0 6px 10px rgba(0,0,0,0.2);
  transform: translateY(0);
}

.btn-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #2c8ad4, 0 8px 15px rgba(0,0,0,0.2);
}

.btn-3d:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #2c8ad4, 0 0 0 rgba(0,0,0,0.2);
}

/* ========================================
   2. 加载动画元素系列
   ======================================== */

/* 2.1 脉冲圆点加载器 */
.loader-pulse {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.loader-pulse .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--creative-primary-gradient);
  animation: pulse 1.4s var(--creative-ease-elastic) infinite;
}

.loader-pulse .dot:nth-child(1) { animation-delay: 0s; }
.loader-pulse .dot:nth-child(2) { animation-delay: 0.2s; }
.loader-pulse .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 2.2 旋转环加载器 */
.loader-ring {
  width: 48px;
  height: 48px;
  position: relative;
}

.loader-ring::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--creative-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-ring::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border: 4px solid rgba(118, 75, 162, 0.2);
  border-bottom-color: var(--creative-secondary);
  border-radius: 50%;
  animation: spin-reverse 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  to { transform: rotate(-360deg); }
}

/* ========================================
   3. 卡片装饰元素系列
   ======================================== */

/* 3.1 渐变边框卡片 */
.card-gradient-border {
  position: relative;
  padding: 24px;
  background: white;
  border-radius: var(--creative-radius-lg);
  box-shadow: var(--creative-shadow-md);
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
}

.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--creative-radius-lg);
  background: var(--creative-primary-gradient);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--creative-duration-normal) var(--creative-ease-smooth);
}

.card-gradient-border:hover {
  transform: translateY(-4px);
  box-shadow: var(--creative-shadow-xl);
}

.card-gradient-border:hover::before {
  opacity: 1;
}

/* 3.2 悬浮标签卡片 */
.card-floating-badge {
  position: relative;
  padding: 24px;
  background: white;
  border-radius: var(--creative-radius-lg);
  box-shadow: var(--creative-shadow-md);
  overflow: visible;
}

.card-floating-badge::after {
  content: 'NEW';
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 6px 16px;
  background: var(--creative-secondary-gradient);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--creative-radius-full);
  box-shadow: var(--creative-shadow-md);
  animation: float 3s var(--creative-ease-elastic) infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ========================================
   4. 导航指示器元素系列
   ======================================== */

/* 4.1 滑动下划线指示器 */
.nav-indicator-slide {
  display: inline-block;
  position: relative;
  padding: 8px 16px;
  color: var(--creative-dark);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--creative-duration-normal) var(--creative-ease-smooth);
}

.nav-indicator-slide::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--creative-primary-gradient);
  border-radius: var(--creative-radius-full);
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
  transform: translateX(-50%);
}

.nav-indicator-slide:hover {
  color: var(--creative-primary);
}

.nav-indicator-slide:hover::after {
  width: 100%;
}

.nav-indicator-slide.active::after {
  width: 100%;
}

/* 4.2 光点跟随指示器 */
.nav-indicator-dot {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--creative-radius-full);
}

.nav-indicator-dot .dot-item {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.3);
  cursor: pointer;
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
}

.nav-indicator-dot .dot-item.active {
  background: var(--creative-primary);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
  transform: scale(1.2);
}

.nav-indicator-dot .dot-item:hover {
  background: var(--creative-primary);
}

/* ========================================
   5. 徽章标签元素系列
   ======================================== */

/* 5.1 渐变徽章 */
.badge-gradient {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--creative-primary-gradient);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--creative-radius-full);
  box-shadow: var(--creative-shadow-sm);
}

.badge-gradient .icon {
  width: 14px;
  height: 14px;
  animation: badge-pulse 2s var(--creative-ease-smooth) infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 5.2 状态徽章 */
.badge-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(67, 233, 123, 0.1);
  border: 2px solid var(--creative-success);
  color: var(--creative-success);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--creative-radius-full);
}

.badge-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--creative-success);
  border-radius: 50%;
  margin-right: 8px;
  animation: status-pulse 2s var(--creative-ease-smooth) infinite;
}

@keyframes status-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(67, 233, 123, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(67, 233, 123, 0);
  }
}

/* ========================================
   6. 分隔线装饰元素系列
   ======================================== */

/* 6.1 渐变点状分隔线 */
.divider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
  border: none;
}

.divider-dots::before,
.divider-dots::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(102, 126, 234, 0.3) 50%, 
    transparent 100%);
}

.divider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--creative-primary-gradient);
  animation: divider-pulse 2s var(--creative-ease-smooth) infinite;
}

.divider-dots .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.divider-dots .dot:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes divider-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* 6.2 渐变线条分隔线 */
.divider-gradient {
  position: relative;
  height: 3px;
  margin: 32px 0;
  border: none;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--creative-primary) 20%, 
    var(--creative-secondary) 80%, 
    transparent 100%);
  border-radius: var(--creative-radius-full);
  overflow: hidden;
}

.divider-gradient::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.6), 
    transparent);
  animation: divider-shine 3s var(--creative-ease-smooth) infinite;
}

@keyframes divider-shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* ========================================
   7. 额外创意元素
   ======================================== */

/* 7.1 悬浮提示气泡 */
.tooltip-bubble {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip-bubble::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  padding: 8px 14px;
  background: var(--creative-dark);
  color: white;
  font-size: 12px;
  border-radius: var(--creative-radius-md);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
  pointer-events: none;
}

.tooltip-bubble::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  border: 6px solid transparent;
  border-top-color: var(--creative-dark);
  margin-bottom: -12px;
  margin-left: -6px;
  opacity: 0;
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
}

.tooltip-bubble:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.tooltip-bubble:hover::after {
  opacity: 1;
}

/* 7.2 数字计数徽章 */
.counter-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--creative-warning-gradient);
  color: white;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: var(--creative-shadow-md);
  animation: counter-bounce 2s var(--creative-ease-elastic) infinite;
}

@keyframes counter-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 7.3 进度指示器 */
.progress-glow {
  width: 100%;
  height: 8px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: var(--creative-radius-full);
  overflow: hidden;
  position: relative;
}

.progress-glow .bar {
  height: 100%;
  background: var(--creative-primary-gradient);
  border-radius: var(--creative-radius-full);
  position: relative;
  transition: width var(--creative-duration-slow) var(--creative-ease-smooth);
}

.progress-glow .bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: white;
  border-radius: var(--creative-radius-full);
  box-shadow: 0 0 10px white;
  animation: progress-glow 1.5s var(--creative-ease-smooth) infinite;
}

@keyframes progress-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 7.4 图标按钮组 */
.icon-btn-group {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--creative-radius-md);
  background: rgba(102, 126, 234, 0.1);
  color: var(--creative-primary);
  cursor: pointer;
  transition: all var(--creative-duration-normal) var(--creative-ease-smooth);
}

.icon-btn:hover {
  background: var(--creative-primary-gradient);
  color: white;
  transform: translateY(-3px) rotate(5deg);
  box-shadow: var(--creative-shadow-lg);
}

.icon-btn:active {
  transform: translateY(0) rotate(0);
}

/* 7.5 开关切换器 */
.toggle-switch {
  position: relative;
  width: 56px;
  height: 32px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: var(--creative-radius-full);
  cursor: pointer;
  transition: background var(--creative-duration-normal) var(--creative-ease-smooth);
}

.toggle-switch.active {
  background: var(--creative-primary-gradient);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--creative-shadow-md);
  transition: transform var(--creative-duration-normal) var(--creative-ease-smooth);
}

.toggle-switch.active::after {
  transform: translateX(24px);
}

/* 7.6 星级评分 */
.star-rating {
  display: flex;
  gap: 4px;
}

.star-rating .star {
  width: 24px;
  height: 24px;
  color: rgba(102, 126, 234, 0.3);
  cursor: pointer;
  transition: all var(--creative-duration-fast) var(--creative-ease-smooth);
}

.star-rating .star.active,
.star-rating .star:hover {
  color: #ffd700;
  transform: scale(1.2);
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

/* ========================================
   8. 响应式适配
   ======================================== */
@media (max-width: 768px) {
  .btn-glow,
  .btn-border-animate,
  .btn-3d {
    padding: 10px 24px;
    font-size: 13px;
  }
  
  .badge-gradient,
  .badge-status {
    padding: 4px 12px;
    font-size: 11px;
  }
  
  .nav-indicator-slide {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ========================================
   9. 性能优化类
   ======================================== */
.creative-will-change {
  will-change: transform, opacity;
}

.creative-contain-strict {
  contain: strict;
  isolation: isolate;
}

/* ========================================
   10. 无障碍支持
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .btn-glow::before,
  .btn-border-animate::before,
  .loader-pulse .dot,
  .loader-ring::before,
  .loader-ring::after,
  .card-floating-badge::after,
  .badge-gradient .icon,
  .badge-status::before,
  .divider-dots .dot,
  .divider-gradient::after,
  .counter-badge,
  .progress-glow .bar::after {
    animation: none !important;
    transition: none !important;
  }
}
