/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

img {
  max-width: 100%;
  height: auto;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

* {
  -webkit-overflow-scrolling: touch;
}

/* 云雾背景 - 全页面 */
body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(ellipse 100% 80% at 20% 30%, rgba(255,255,255,0.95) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(255,255,255,0.9) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 50% 80%, rgba(255,255,255,0.85) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 40%, rgba(191,219,254,0.7) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 60%, rgba(191,219,254,0.6) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 60% 15%, rgba(221,214,254,0.6) 0%, transparent 50%),
    radial-gradient(ellipse 45% 35% at 30% 50%, rgba(221,214,254,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 40% 85%, rgba(254,240,138,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 85% 75%, rgba(187,247,208,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 35% 30% at 15% 25%, rgba(254,202,202,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 45% 35% at 70% 55%, rgba(165,243,252,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 5% 45%, rgba(251,207,232,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 35% 30% at 45% 35%, rgba(254,215,170,0.5) 0%, transparent 50%),
    radial-gradient(ellipse 45% 35% at 55% 70%, rgba(199,210,254,0.5) 0%, transparent 50%);
  filter: blur(60px);
  animation: cloud-drift 30s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}

@keyframes cloud-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20px, -10px) scale(1.05); }
}

/* 波浪分隔线 */
.wave-divider {
  position: relative;
  width: 100%;
  height: 60px;
  overflow: hidden;
}

.wave-divider svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  animation: wave-move 8s linear infinite;
}

.wave-divider svg:nth-child(2) {
  opacity: 0.5;
  animation: wave-move 12s linear infinite reverse;
}

@keyframes wave-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 分类按钮 */
.cat-btn {
  transition: all 0.2s ease;
  appearance: none;
  border: 1px solid #f3f4f6;
  cursor: pointer;
  outline: none;
}

.cat-btn.active {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}

.cat-btn {
  opacity: 0;
  transform: translateY(10px);
}

.cat-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 设备卡片 */
.device-card {
  transition: all 0.2s ease;
  opacity: 0;
  transform: translateY(30px);
  cursor: pointer;
}

.device-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.device-card:active {
  transform: scale(0.98);
}

.device-card img {
  transition: transform 0.3s ease;
}

.device-card:hover img {
  transform: scale(1.05);
}

/* 点击波纹效果 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to { transform: scale(4); opacity: 0; }
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.modal-content {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 兼容性：IE10+ */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  body::before { display: none; }
}

/* 打印样式 */
@media print {
  body::before,
  .wave-divider,
  .modal-backdrop,
  .modal-content { display: none !important; }
}

/* 社交链接 */
footer + div a {
  transition: all 0.2s ease;
}
