/* ========================================
   昆仑智界网站升级 V2 - 现代质感增强
   ======================================== */

/* 玻璃拟态效果 */
.glass-effect {
  background: rgba(26, 29, 35, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--brand-gold));
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(79, 140, 255, 0.5);
}

/* 光标跟随光晕 */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

body:hover .cursor-glow {
  opacity: 1;
}

/* 动画渐变文字 */
.gradient-text-animated {
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--brand-gold) 25%,
    var(--primary) 50%,
    var(--brand-gold) 75%,
    var(--primary) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* 3D 卡片倾斜效果 */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-card .tilt-content {
  transform: translateZ(20px);
  transition: transform 0.3s ease;
}

/* 动态边框卡片 */
.animated-border {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.animated-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    var(--border-angle, 0deg),
    var(--primary),
    var(--brand-gold),
    var(--primary)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.animated-border:hover::before {
  opacity: 1;
}

@keyframes borderRotate {
  to { --border-angle: 360deg; }
}

@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* 磁性按钮 */
.magnetic-btn {
  transition: transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.magnetic-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.magnetic-btn:hover::after {
  opacity: 1;
}

/* 骨架屏加载 */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-elevated) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 32px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-image {
  aspect-ratio: 16 / 9;
  width: 100%;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(79, 140, 255, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(79, 140, 255, 0.6);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* 主题切换按钮 */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: rotate(180deg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* 浅色主题 */
body.light-theme {
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --bg-elevated: #f1f3f5;
  --bg-secondary: #e9ecef;
  --text: #212529;
  --text-secondary: #495057;
  --text-light: #868e96;
  --border: #dee2e6;
  --border-light: #e9ecef;
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
}

body.light-theme .showcase-hero {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.05) 0%, rgba(212, 160, 23, 0.03) 100%);
}

body.light-theme .showcase-hero h1 {
  background: linear-gradient(135deg, #212529 0%, #495057 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 打字机效果 */
.typing-text {
  display: inline-block;
  border-right: 2px solid var(--brand-gold);
  animation: blink 1s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* 视差滚动区域 */
.parallax-section {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  transform: translateZ(0);
  will-change: transform;
}

/* 悬浮动画增强 */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

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

/* 脉冲动画 */
.pulse-animation {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 渐变分割线 */
.gradient-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--brand-gold), transparent);
  margin: 40px 0;
  border: none;
}

/* 标签云效果 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tag-cloud-item {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  cursor: default;
}

.tag-cloud-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.2);
}

/* 卡片堆叠效果 */
.stack-cards {
  position: relative;
}

.stack-card {
  position: relative;
  transition: all 0.3s ease;
}

.stack-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0;
  transition: all 0.3s ease;
}

.stack-card:hover::after {
  opacity: 0.5;
  inset: 4px;
}

/* 发光效果 */
.glow-on-hover {
  transition: all 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 
    0 0 20px rgba(79, 140, 255, 0.4),
    0 0 40px rgba(79, 140, 255, 0.2),
    0 0 60px rgba(79, 140, 255, 0.1);
}

/* 文字阴影 */
.text-glow {
  text-shadow: 0 0 20px rgba(79, 140, 255, 0.5);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 选中文字样式增强 */
::selection {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.3), rgba(212, 160, 23, 0.3));
  color: #fff;
}

/* 焦点样式增强 */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .cursor-glow {
    display: none;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .cursor-glow,
  .scroll-progress {
    display: none;
  }
}
