/* 版权所有者：姚程樱软件开发工作室 https://anyio.club */
/* ==========================================================
   index.html 独有样式
   公共基础样式（reset / 导航 / 页脚 / 信息页）见 public/common.css
   ========================================================== */

/* 首页专属文字 / 色彩辅助 */
.glow-text {
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.color-red {
  color: var(--c-red);
  font-weight: 500;
  font-size: 20px;
}
.ad-img {
  border-radius: 20px;
  max-width: 100%;
}

/* 产品网格 */
.product-list {
  /* 采用 CSS 多列，自动按宽度分栏 */
  column-width: 280px;
  column-gap: 28px;
  margin-top: 8px;
}
.product-card {
  break-inside: avoid;
  margin-bottom: 28px;
  background: var(--c-bg-elev);
  backdrop-filter: blur(4px);
  border: 1px solid var(--c-border-faint);
  border-radius: 20px;
  padding: 28px 20px;
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 20px -12px rgba(0, 0, 0, 0.5);
  height: auto;
}
.product-card:hover,
.product-card.hover {
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -16px rgba(120, 58, 237, 0.2);
}
.product-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-card p {
  color: var(--c-text-2);
  font-size: 15px;
  margin-bottom: 16px;
}
.product-card .link {
  color: var(--c-accent);
  font-weight: 500;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}
.product-card .link:hover {
  color: var(--c-accent-hover);
  gap: 12px;
}
.product-card button.link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.product-card img {
  width: 100%;
  max-width: 200px;
  border-radius: 10px;
  margin: 8px 0;
}
.product-card video {
  border-radius: 10px;
  margin: 8px 0;
}
.ss-animation {
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* 桌面萌宠区域（首页图文块） */
.pet-section img {
  border-radius: 20px;
  max-width: 100%;
  border: 1px solid var(--c-border-faint);
  margin: 12px 0 16px;
  box-shadow: 0 20px 40px -16px #00000080;
}
.pet-section h4 {
  font-weight: 400;
  color: var(--c-text-6);
  font-size: 16px;
  max-width: 780px;
  margin: 10px 0;
}
.pet-section div {
  color: var(--c-text-4);
  font-size: 15px;
  margin: 6px 0;
}

/* ===== 左右悬浮二维码（首页独有） ===== */
.float-qrcode {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 75px;
  height: 70px;
  background: var(--c-bg-elev);
  backdrop-filter: blur(8px);
  border: 1px solid var(--c-border-strong);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 98;
  transition: 0.2s;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.float-qrcode.left {
  left: 0;
  border-radius: 0 40px 40px 0;
}
.float-qrcode.right {
  right: 0;
  border-radius: 40px 0 0 40px;
}
.float-qrcode:hover {
  background: var(--c-surface-2-soft);
  border-color: rgba(167, 139, 250, 0.3);
}
.qrcode-box {
  position: absolute;
  width: 200px;
  background: var(--c-surface-2);
  backdrop-filter: blur(12px);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  color: var(--c-text);
  padding: 16px 14px;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
}
.float-qrcode.left .qrcode-box {
  left: 78px;
  top: 50%;
  transform: translateY(-50%);
}
.float-qrcode.right .qrcode-box {
  right: 78px;
  top: 50%;
  transform: translateY(-50%);
}
/* PC 端默认展开二维码 */
.float-qrcode .qrcode-box {
  display: flex;
}
.qrcode-img {
  width: 120px;
  height: 120px;
  background: var(--c-img-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 6px;
  overflow: hidden;
}
.qrcode-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qrcode-box .ss-shake {
  animation: shakeY 0.2s ease-in-out infinite alternate;
  font-size: 20px;
}
@keyframes shakeY {
  from {
    transform: translateY(-3px);
  }
  to {
    transform: translateY(3px);
  }
}

/* ===== 广告位自适应：固定尺寸广告 iframe 按容器宽度等比缩放 ===== */
.ad-slot {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  overflow: hidden;
}
.ad-slot iframe {
  max-width: none;
  display: block;
}
/* 广告位加载失败兜底（ad.js 标记 .ad-failed）：显示占位避免大片空白 */
.ad-slot.ad-failed {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  border-radius: 8px;
  border: 1px dashed var(--c-border-strong);
}
.ad-slot-fallback {
  font-size: 12px;
  color: var(--c-text-5);
  letter-spacing: 1px;
}

/* ===== 移动端适配（首页独有部分） ===== */
@media screen and (max-width: 768px) {
  section h2 {
    font-size: 26px;
  }
  .product-list {
    grid-template-columns: 1fr;
  }
  /* 移动端悬浮二维码：尺寸适中，默认隐藏，点击展开 */
  .float-qrcode {
    width: 75px;
    height: 60px;
    font-size: 14px;
  }
  .float-qrcode.left .qrcode-box {
    left: 75px;
    width: 180px;
  }
  .float-qrcode.right .qrcode-box {
    right: 75px;
    width: 180px;
  }
  .qrcode-img {
    width: 120px;
    height: 120px;
  }
  .qrcode-box {
    padding: 14px 12px;
  }
  .float-qrcode .qrcode-box {
    display: none;
  }
  .float-qrcode.active .qrcode-box {
    display: flex;
  }
}

/* 小屏手机微调 */
@media screen and (max-width: 420px) {
  .float-qrcode {
    width: 70px;
    height: 50px;
    font-size: 12px;
  }
  .float-qrcode.left .qrcode-box {
    left: 70px;
    width: 160px;
  }
  .float-qrcode.right .qrcode-box {
    right: 70px;
    width: 160px;
  }
  .qrcode-img {
    width: 120px;
    height: 120px;
  }
  .qrcode-box {
    padding: 12px 10px;
  }
}
