/* shared-site.css - 全站通用交互/优化样式 */

/* 0) 全局 reset + 防溢出 */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { word-wrap: break-word; }

/* 1) 滚动淡入动画 - 只对产品卡片生效，避免整页闪烁 */
.fx {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
  will-change: transform, opacity;
}
.fx-on {
  opacity: 1;
  transform: translateY(0);
}
/* 首屏不做动画 */
.hero, .hero.fx, .hero.fx-on,
section:first-of-type, section:first-of-type.fx {
  opacity: 1 !important;
  transform: none !important;
}
/* 整个 section 不做淡入动画（避免闪烁） */
section.fx {
  opacity: 1;
  transform: none;
}

/* 2) 详情页画廊激活态 */
.thumb-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  opacity: 1 !important;
  transform: scale(1.02);
}

/* 3) Toast 提示 */
.site-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  padding: 14px 28px;
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: all .4s cubic-bezier(.22, .61, .36, 1);
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.site-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.site-toast.success {
  background: rgba(4, 106, 56, 0.95);
  border-left: 4px solid #5BC486;
}
.site-toast.warn {
  background: rgba(180, 50, 50, 0.95);
  border-left: 4px solid #FF6B6B;
}

/* 4) 返回顶部 */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  border-radius: 50%;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  z-index: 99;
  pointer-events: none;
}
.scroll-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-2px);
}

/* 5) 全站通知条 */
.site-notice {
  background: linear-gradient(90deg, #8B0000 0%, #C41E3A 50%, #8B0000 100%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1.2px;
  text-align: center;
  padding: 10px 20px;
  position: relative;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  border-bottom: 1px solid rgba(255,255,255,.15);
  animation: noticeSlide .6s cubic-bezier(.22,.61,.36,1);
}
/* 确保 sticky header 在通知条下面 */
header[class*="site-header"], header[class*="head"], header[class*="topnav"],
.site-header, .masthead, .gfh, .head, .topnav, .hbbh, .bph, .ppfh, .hdr, .jfh {
  z-index: 50 !important;
}
@keyframes noticeSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.site-notice b { color: #FFD700; font-weight: 700; }
.site-notice .notice-icon {
  display: inline-block;
  margin-right: 8px;
  color: #FFD700;
  animation: pulse 2s infinite;
}
.site-notice .notice-link {
  color: #FFD700;
  font-weight: 700;
  text-decoration: none;
  margin: 0 8px;
  padding: 4px 10px;
  background: rgba(255,215,0,.12);
  border-radius: 20px;
  transition: all .2s ease;
  display: inline-block;
}
.site-notice .notice-link:hover {
  background: #FFD700;
  color: #8B0000;
  transform: translateY(-1px);
}
.site-notice-inner {
  max-width: 1400px;
  margin: 0 auto;
  line-height: 1.6;
}
@keyframes pulse { 50% { opacity: .3; } }

/* 6) 移动端适配 */
@media (max-width: 600px) {
  .scroll-top { width: 44px; height: 44px; font-size: 18px; bottom: 20px; right: 20px; }
  .site-toast { bottom: 20px; font-size: 13px; padding: 12px 22px; }
  .site-notice { font-size: 12px; padding: 8px 10px; letter-spacing: .5px; }
  .site-notice .notice-link { display: block; margin: 6px auto 0; width: fit-content; }
}
