/* ============================================
   青空树日语 - 公共样式
   ============================================ */

:root {
  --brand: #5A9A3A;
  --brand-dark: #3D7A2A;
  --brand-light: #7AB85A;
  --accent: #D4A84B;
  --bg-cream: #F5F0E6;
  --text-brown: #5C4A32;
}

/* === 基础重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-brown);
  overflow-x: hidden;
  background: var(--bg-cream);
}

/* === 绿色主题背景 === */
.aurora-bg {
  background: var(--bg-cream);
}
.aurora-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg,
    #E8F5D6 0%,
    #F5F0E6 25%,
    #E0EDD0 50%,
    #F0EBD8 75%,
    #E8F5D6 100%);
  background-size: 400% 400%;
  animation: auroraShift 12s ease infinite;
  z-index: 0;
  pointer-events: none;
}
@keyframes auroraShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* === 浮动光斑效果 === */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}
.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(90,154,58,0.25) 0%, rgba(90,154,58,0) 70%);
  top: 5%;
  left: 5%;
  animation: float1 12s ease-in-out infinite;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(122,184,90,0.2) 0%, rgba(122,184,90,0) 70%);
  top: 40%;
  right: 5%;
  animation: float2 14s ease-in-out infinite;
}
.blob-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(212,168,75,0.15) 0%, rgba(212,168,75,0) 70%);
  bottom: 10%;
  left: 25%;
  animation: float3 10s ease-in-out infinite;
}
.blob-4 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(61,122,42,0.18) 0%, rgba(61,122,42,0) 70%);
  top: 25%;
  left: 55%;
  animation: float4 16s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(0.95); }
  66% { transform: translate(20px, -40px) scale(1.05); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 40px) scale(1.1); }
}
@keyframes float4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-30px, -20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.1); }
}

/* === 文字渐变填充 === */
.text-gradient {
  background: linear-gradient(135deg, var(--brand), var(--brand-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-warm {
  background: linear-gradient(90deg, var(--accent), #E8C56B, var(--brand-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === 滚动触发淡入 === */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.card-3d {
  transform: translateY(30px);
  transition: transform 0.7s ease, box-shadow 0.3s ease, opacity 0.7s ease !important;
}
.fade-up.visible.card-3d {
  transform: translateY(0) perspective(600px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(1.02);
  transition: transform 0.15s ease-out, box-shadow 0.3s ease, opacity 0.7s ease !important;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 3D 倾斜卡片效果 === */
.perspective-container {
  perspective: 1200px;
  perspective-origin: center;
}
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
  --rotateX: 0deg;
  --rotateY: 0deg;
  transform: perspective(600px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(1.02);
}
.card-3d:hover {
  box-shadow: 0 25px 50px rgba(90,154,58,0.15), 0 8px 16px rgba(0,0,0,0.06);
}
.fade-up.visible.card-3d {
  transform: translateY(0) perspective(600px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(1.02);
}

/* === 从左右两侧入场动画 === */
.fade-up[data-slide] {
  transform: none !important;
  transition: opacity 0.7s ease;
}
.fade-up.visible[data-slide] {
  transform: none !important;
}
.slide-from-right {
  opacity: 0;
  transform: translateX(100px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.slide-from-left {
  opacity: 0;
  transform: translateX(-100px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible .slide-from-right,
.fade-up.visible .slide-from-left {
  opacity: 1;
  transform: translateX(0) perspective(600px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(1.02);
  transition: transform 0.15s ease-out, box-shadow 0.3s ease, opacity 0.7s ease;
}

/* === 阴影效果 === */
.depth-shadow {
  box-shadow:
    0 1px 1px rgba(0,0,0,0.02),
    0 2px 2px rgba(0,0,0,0.03),
    0 4px 4px rgba(0,0,0,0.04),
    0 8px 8px rgba(0,0,0,0.04),
    0 16px 16px rgba(0,0,0,0.05);
}

/* === 光泽效果 === */
.shine-effect {
  position: relative;
  overflow: hidden;
}
.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,0) 40%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0) 60%
  );
  transform: rotate(30deg);
  transition: transform 0.8s ease;
  pointer-events: none;
  z-index: 1;
}
.shine-effect:hover::after {
  transform: rotate(30deg) translateY(-100%);
}

/* === 下划线动画 === */
.animated-underline {
  position: relative;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--brand);
  transition: width 0.4s ease;
}
.animated-underline:hover::after {
  width: 100%;
}

/* === 滚动触发的文字揭示 === */
.scroll-reveal-text {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-reveal-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 无障碍：减少动画 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora-bg, .blob { animation: none !important; }
  .scroll-reveal-text { opacity: 1; transform: none; }
  .fade-up { opacity: 1; transform: none; }
  .card-3d { transform: none !important; }
}
