/* assets/css/pages/home.css */

/* 背景层只负责漂浮卡牌，不再自带背景（统一用 base.css） */
.bg-scene{
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
  perspective: 1200px;
}

@keyframes float-screensaver{
  0%{ transform: translate(0,0) rotate(var(--base-r)) scale(1); }
  25%{ transform: translate(4vw,3vh) rotate(calc(var(--base-r) + 4deg)) scale(1.03); }
  50%{ transform: translate(-3vw,6vh) rotate(var(--base-r)) scale(0.98); }
  75%{ transform: translate(2vw,-4vh) rotate(calc(var(--base-r) - 4deg)) scale(1.02); }
  100%{ transform: translate(0,0) rotate(var(--base-r)) scale(1); }
}

.layer-wrapper{
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  will-change: transform;
  transition: transform 0.1s linear;
}

.float-card-wrapper{
  position: absolute;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.card-animator{
  display: block;
  animation: float-screensaver linear infinite;
  animation-duration: 20s;
}

.card-img{
  display: block;
  border-radius: 10px;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.layer-far .card-img{
  width: 130px;
  opacity: 1;
  filter: blur(2px) brightness(0.5) grayscale(0.4);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.layer-mid .card-img{
  width: 170px;
  opacity: 1;
  filter: blur(0.5px) brightness(0.7);
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}
.layer-near .card-img{
  width: 240px;
  opacity: 1;
  filter: brightness(1.1) drop-shadow(0 20px 50px rgba(0,0,0,0.8));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

/* UI */
.home-layout{
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.home-logo{
  position: absolute;
  top: 10vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: logo-float 4s ease-in-out infinite;
}
@keyframes logo-float{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-8px); } }
.home-logo::before {
  content: "";
  position: absolute;
  /* 居中定位 */
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  
  /* 让阴影范围比 Logo 本身大一圈，形成光晕感 */
  width: 160%; 
  height: 160%;
  
  /* 核心：从中心向外由黑变透明的径向渐变 */
  /* 0.6 是透明度，你可以根据需要调深(0.8)或调浅(0.4) */
  background: radial-gradient(closest-side, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
  
  /* 置于底层，不遮挡 Logo */
  z-index: -1;
  pointer-events: none;
}

.home-logo .logo-img{
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(120,190,255,0.3));
}
.home-logo .logo-text{
  font-size: 50px;
  font-weight: 10;
  letter-spacing: 0.15em;
  font-family: "LingDongQiCheChunTang", "HanSerif", serif;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.9);
  margin-left: 10px;
}

.menu-container{
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 300px;
  z-index: 20;
  background: radial-gradient(closest-side, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  padding: 60px 40px;
}

.menu-item{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 64px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.28s cubic-bezier(0.25,0.8,0.25,1);
  overflow: hidden;
}
.menu-item.primary{
  background: linear-gradient(135deg, rgba(120,190,255,0.12), rgba(120,190,255,0.02));
  border-color: rgba(120,190,255,0.30);
  height: 74px;
}
.menu-item:not(.disabled):hover{
  transform: translateY(-2px) scale(1.02);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.menu-item.disabled{
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
  border-style: dashed;
}

.menu-item .en{
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  opacity: 0.8;
  margin-bottom: 2px;
  font-family: "Bahnschrift Condensed", "DIN Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", "Noto Sans", sans-serif;
  font-weight: 300;
  line-height: 1.1;
}
.menu-item .cn{
  font-size: 16px;
  letter-spacing: 0.1em;
  color: #fff;
  font-weight: 600;
}

.menu-item .shine{
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.30), transparent);
  transform: skewX(-25deg);
  transition: 0.5s;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.menu-item:hover .shine{ left: 200%; transition: 0.6s; }

/* contact widget（保留原功能） */
.contact-widget{ position: fixed; right: 30px; bottom: 50px; z-index: 100; }
.contact-bubble{
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(120,190,255,0.1), 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.3s;
  animation: bubble-float 3s infinite;
  position: relative;
  z-index: 2;
}
@keyframes bubble-float{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-6px); } }
.contact-bubble:hover{ transform: scale(1.1); background: #fff; }
.contact-bubble .icon{ font-size: 24px; }
.contact-bubble .hint{
  position: absolute; right: 65px; top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(0,0,0,0.8); color: #fff;
  padding: 6px 12px; border-radius: 6px; font-size: 12px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.contact-bubble:hover .hint{ opacity: 1; transform: translateY(-50%) translateX(0); }

.contact-dialog{
  position: absolute; bottom: 10px; right: 10px;
  width: 290px;
  background: rgba(26,27,32,0.95);
  border: 1px solid rgba(120,190,255,0.3);
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.9);
  transform-origin: bottom right;
  transform: scale(0); opacity: 0;
  transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.contact-widget.active .contact-dialog{ transform: scale(1); opacity: 1; }
.contact-widget.active .contact-bubble{ transform: scale(0); opacity: 0; pointer-events: none; }

.dialog-header{
  background: linear-gradient(90deg, rgba(120,190,255,0.1), transparent);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--accent); font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.close-btn{ cursor: pointer; padding: 4px; opacity: 0.6; }
.close-btn:hover{ opacity: 1; }
.dialog-body{ padding: 18px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.8); }
.dialog-btn{
  display: block; text-align: center; margin-top: 12px;
  background: var(--accent); color: #0e0f12; padding: 10px;
  border-radius: 8px; font-weight: 700; transition: 0.2s;
}
.dialog-btn:hover{ background: #fff; transform: translateY(-2px); }

@media (max-width: 600px){
  .layer-far .card-img, .layer-mid .card-img{
    filter: brightness(0.4) !important;
    box-shadow: none !important;
  }
  .layer-near .card-img{
    width: 180px;
    filter: brightness(1.05) !important;
  }
  .home-logo{ top: 8vh; }
  .menu-container{ transform: scale(0.9); padding: 40px 20px; }
  .contact-widget{ right: 20px; bottom: 30px; }
}
/* 让 logo 回到文档流，不再压住菜单 */
.home-logo{
  position: relative;           /* ✅ 从 absolute 改为 relative */
  top: auto;                    /* ✅ 取消 top */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;          /* ✅ 给菜单留出间距 */
  z-index: 30;
  animation: logo-float 4s ease-in-out infinite;
}
.home-layout{
  gap: 10px;
}
@media (orientation: landscape) and (max-height: 520px){
  .home-logo .logo-img{ width: 96px; height: 96px; }
  .home-logo .logo-text{ font-size: 20px; letter-spacing: 0.25em; margin-left: 0; }
  .menu-container{ padding: 26px 22px; gap: 12px; }
  .menu-item{ height: 54px; }
  .menu-item.primary{ height: 60px; }
}
