/* ==========================================================
   Ritsuai 律合官网 · 通用组件样式（多页共享）
   包含：返回顶部、滚动渐显、视差背景、段落过渡、
         玻璃卡片、渐变文字、几何纹理
   ========================================================== */

/* ----- 返回顶部按钮（works 深色页通过 CSS 变量覆盖配色） ----- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btt-bg, #1a1a1a);
  color: var(--btt-fg, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -4px rgba(0, 0, 0, 0.04);
}
.back-to-top.show { opacity: 1; transform: translateY(0); }
.back-to-top:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
}

/* ----- 滚动渐显动画系统（index / tsingtao / statement / ritsuainu 共享） ----- */
.reveal-element {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-element.revealed { opacity: 1; transform: translateY(0); }
.reveal-stagger-1 { transition-delay: 0.05s; }
.reveal-stagger-2 { transition-delay: 0.15s; }
.reveal-stagger-3 { transition-delay: 0.25s; }
.reveal-stagger-4 { transition-delay: 0.35s; }
.reveal-stagger-5 { transition-delay: 0.45s; }

/* ----- 视差背景（原 @layer utilities） ----- */
.parallax-bg {
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  will-change: transform;
  opacity: 0;
}
.bg-fade-in { animation: bgFadeIn 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }
@keyframes bgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (max-width: 768px) {
  .parallax-bg {
    position: fixed !important;
    height: 100vh !important;
    background-attachment: scroll !important;
  }
}

/* ----- 段落底部渐变过渡 ----- */
.section-bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 180px;
  z-index: 1;
  background: linear-gradient(to bottom,
    rgba(245,245,245,0) 0%,
    rgba(245,245,245,0.07) 10%,
    rgba(245,245,245,0.2) 30%,
    rgba(245,245,245,0.5) 50%,
    rgba(245,245,245,0.66) 65%,
    rgba(245,245,245,0.8) 75%,
    rgba(245,245,245,0.9) 80%,
    rgba(245,245,245,0.95) 86%,
    rgba(245,245,245,1) 90%,
    rgba(245,245,245,1) 100%);
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}
@media (max-width: 768px) { .section-bottom-gradient { height: 100px; } }

/* ----- 无缝过渡（Hero 与下一段衔接） ----- */
.seamless-transition { margin-top: -20px; padding-top: 40px; position: relative; }

/* ----- 几何圆点纹理 ----- */
.geo-dot-pattern {
  background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ----- 玻璃卡片 ----- */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-card:hover {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(99, 102, 241, 0.12);
  transform: translateY(-6px);
}
@media (max-width: 768px) { .glass-card:hover { transform: translateY(-3px); } }

/* ----- 渐变文字 ----- */
.text-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-warm {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 60%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
