/* LiquidGlass 液态玻璃效果 */

/* 基础玻璃效果 */
.liquid-glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

/* 高光反射效果 */
.liquid-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* 边缘折射效果 */
.liquid-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* 深色背景下的玻璃效果 */
.liquid-glass-dark {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 悬停状态 */
.liquid-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

/* 按钮玻璃效果 */
.btn-glass {
  background: rgba(0, 113, 227, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(0, 113, 227, 0.3);
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(0, 119, 237, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 20px rgba(0, 113, 227, 0.4);
  transform: translateY(-1px);
}

/* 卡片玻璃效果 */
.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.card-glass:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 动态折射动画（可选） */
@keyframes liquid-shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.liquid-glass-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: liquid-shimmer 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

/* 减少动画的媒体查询 */
@media (prefers-reduced-motion: reduce) {
  .liquid-glass,
  .btn-glass,
  .card-glass {
    transition: none;
  }

  .liquid-glass-shimmer::before {
    animation: none;
  }
}

/* 浏览器不支持 backdrop-filter 时的降级方案 */
@supports not (backdrop-filter: blur(20px)) {
  .liquid-glass {
    background: rgba(255, 255, 255, 0.85);
  }

  .liquid-glass-dark {
    background: rgba(30, 30, 30, 0.85);
  }

  .card-glass {
    background: rgba(255, 255, 255, 0.95);
  }
}
