/* ===================帝王云 ==================== */
/* ============= www.diwangyun.com ================ */
/* ============= www.diwangyun.cn ================= */
/* ============== 代码有价，版权无价 ================= */
/* =======帝王云模板为帝王云自行开发，已办理源码著作权 ========== */
/* =======未经允许 仿站或扒站 发现必究，请尊重开发者心血 ========== */
/* ==========="愿你走完山水万城 仍与理想重逢" ============ */
/* ============模板作者：江遇:QQ 1481234828=========== */


/* ==================== 帝王仪式感体验样式 ==================== */

/* ==================== 1. 开场登基动画 ==================== */

/* 登基大典遮罩层 */
.imperial-ceremony-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a2e 50%, #0a0a0a 100%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: ceremonyFadeOut 1s ease-in-out 3s forwards;
  pointer-events: none;
}

/* 金色光柱 */
.imperial-light-beam {
  position: absolute;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(255, 215, 0, 0.3) 50%,
    rgba(255, 215, 0, 0.6) 70%,
    rgba(255, 215, 0, 0.8) 100%);
  animation: lightBeamGrow 1.5s ease-out 0.5s forwards;
  box-shadow: 0 0 60px 20px rgba(255, 215, 0, 0.4);
}

/* 光束横向扩散 */
.imperial-light-spread {
  position: absolute;
  width: 0;
  height: 100%;
  background: radial-gradient(ellipse at center,
    rgba(255, 215, 0, 0.6) 0%,
    rgba(255, 215, 0, 0.3) 30%,
    transparent 70%);
  animation: lightSpread 1s ease-out 2s forwards;
}

/* 皇冠光芒 */
.imperial-crown-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.8) 0%,
    rgba(255, 215, 0, 0.4) 30%,
    transparent 70%);
  opacity: 0;
  animation: crownGlow 1s ease-in-out 1.5s forwards;
  box-shadow: 0 0 100px 50px rgba(255, 215, 0, 0.3);
}

/* 登基文字 */
.imperial-title {
  font-size: 48px;
  font-weight: 800;
  color: #FFD700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.8),
               0 0 60px rgba(255, 215, 0, 0.6),
               0 0 90px rgba(255, 215, 0, 0.4);
  opacity: 0;
  animation: titleAppear 2s ease-in-out 2s forwards;
  letter-spacing: 8px;
  margin-top: 60px;
}

.imperial-subtitle {
  font-size: 24px;
  color: #7C3AED;
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.8);
  opacity: 0;
  animation: subtitleAppear 1.5s ease-in-out 2.5s forwards;
  margin-top: 20px;
  letter-spacing: 4px;
}

/* 动画关键帧 */
@keyframes lightBeamGrow {
  0% {
    height: 0;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    height: 100vh;
    opacity: 1;
  }
}

@keyframes lightSpread {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 100%;
    opacity: 1;
  }
}

@keyframes crownGlow {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes titleAppear {
  0% {
    opacity: 0;
    transform: translateY(30px);
    letter-spacing: 20px;
  }
  50% {
    letter-spacing: 4px;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 8px;
  }
}

@keyframes subtitleAppear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ceremonyFadeOut {
  0%, 80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

/* ==================== 2. 鼠标金色轨迹 ==================== */

/* 鼠标轨迹容器 */
.imperial-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* 轨迹点 */
.imperial-trail-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle,
    #FFD700 0%,
    rgba(255, 215, 0, 0.6) 50%,
    transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  animation: trailFade 1s ease-out forwards;
  box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.6);
}

@keyframes trailFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
}

/* 鼠标光晕 */
.imperial-cursor-glow {
  position: fixed;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.3) 0%,
    rgba(255, 215, 0, 0.1) 50%,
    transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.1s ease-out;
  box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0.2);
}

.imperial-cursor-glow.active {
  transform: scale(1.5);
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.5) 0%,
    rgba(255, 215, 0, 0.2) 50%,
    transparent 70%);
}

/* ==================== 3. 滚动动画 - 帝王巡游 ==================== */

/* 滚动触发的元素动画 */
.imperial-scroll-fade-in {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imperial-scroll-fade-in.imperial-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 从左侧滑入 */
.imperial-scroll-left {
  opacity: 0;
  transform: translateX(-100px);
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imperial-scroll-left.imperial-visible {
  opacity: 1;
  transform: translateX(0);
}

/* 从右侧滑入 */
.imperial-scroll-right {
  opacity: 0;
  transform: translateX(100px);
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imperial-scroll-right.imperial-visible {
  opacity: 1;
  transform: translateX(0);
}

/* 缩放淡入 */
.imperial-scroll-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imperial-scroll-scale.imperial-visible {
  opacity: 1;
  transform: scale(1);
}

/* 带金色光芒的淡入 */
.imperial-scroll-glow {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imperial-scroll-glow.imperial-visible {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 0 40px 20px rgba(255, 215, 0, 0.3);
}

/* 滚动章节标题 */
.imperial-chapter-title {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 72px;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 0 50px rgba(255, 215, 0, 0.8),
               0 0 100px rgba(255, 215, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  letter-spacing: 12px;
}

.imperial-chapter-title.imperial-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.imperial-chapter-title.imperial-hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.2);
}

/* ==================== 4. 按钮尊贵触感 ==================== */

/* 尊贵按钮基础样式 - 仅添加额外效果，不覆盖原有样式 */
.imperial-btn {
  position: relative;
  overflow: visible;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 如果需要完整的帝王样式，请同时添加 imperial-btn-full 类 */
.imperial-btn-full.imperial-btn {
  border: 2px solid #FFD700 !important;
  background: linear-gradient(135deg, rgba(45, 27, 105, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%) !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3),
              inset 0 0 20px rgba(255, 215, 0, 0.1) !important;
}

/* 边框金色流动 */
.imperial-btn::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(90deg,
    transparent 0%,
    #FFD700 20%,
    #FFC107 40%,
    #FFD700 60%,
    #FFC107 80%,
    transparent 100%);
  background-size: 200% 100%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.imperial-btn:hover::before {
  opacity: 1;
  animation: borderFlow 2s linear infinite;
}

@keyframes borderFlow {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* hover效果 */
.imperial-btn-full.imperial-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.5),
              0 10px 30px rgba(0, 0, 0, 0.3),
              inset 0 0 30px rgba(255, 215, 0, 0.2) !important;
  background: linear-gradient(135deg, rgba(45, 27, 105, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%) !important;
}

/* 点击效果 */
.imperial-btn-full.imperial-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4),
              0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

/* 玉玺印章效果 */
.imperial-btn::after {
  content: '御';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 40px;
  height: 40px;
  background: #FFD700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2D1B69;
  font-weight: 900;
  font-size: 20px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
}

.imperial-btn:active::after {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
  animation: sealStamp 0.5s ease-out forwards;
}

@keyframes sealStamp {
  0% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* 金色粒子散开效果 */
.imperial-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #FFD700;
  border-radius: 50%;
  pointer-events: none;
  animation: particleExplode 0.6s ease-out forwards;
  box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.6);
}

@keyframes particleExplode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* ==================== 5. 页面切换宫门开合 ==================== */

/* 宫门遮罩 */
.imperial-palace-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99998;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s ease;
}

.imperial-palace-gate.active {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s ease;
}

/* 左门 */
.imperial-gate-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
    #2D1B69 0%,
    #7C3AED 50%,
    #1a0a2e 100%);
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-right: 4px solid #FFD700;
  box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
}

.imperial-palace-gate.active .imperial-gate-left {
  transform: translateX(0);
}

/* 右门 */
.imperial-gate-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(-90deg,
    #2D1B69 0%,
    #7C3AED 50%,
    #1a0a2e 100%);
  transform: translateX(100%);
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-left: 4px solid #FFD700;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
}

.imperial-palace-gate.active .imperial-gate-right {
  transform: translateX(0);
}

/* 门内光芒 */
.imperial-gate-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.8) 0%,
    rgba(255, 215, 0, 0.4) 30%,
    transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 100px 50px rgba(255, 215, 0, 0.5);
}

.imperial-palace-gate.active .imperial-gate-glow {
  opacity: 1;
  animation: gateGlowPulse 1.5s ease-in-out infinite;
}

@keyframes gateGlowPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
}

/* 门上装饰 */
.imperial-gate-decoration {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 100px;
  background: linear-gradient(180deg, #FFD700 0%, #FFC107 50%, #FFD700 100%);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.imperial-gate-left .imperial-gate-decoration {
  right: 30px;
  border-radius: 10px 0 0 10px;
}

.imperial-gate-right .imperial-gate-decoration {
  left: 30px;
  border-radius: 0 10px 10px 0;
}

/* ==================== 6. 加载动画 - 龙腾云起 ==================== */

/* 加载遮罩 */
.imperial-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a2e 50%, #0a0a0a 100%);
  z-index: 99997;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.imperial-loading.active {
  opacity: 1;
  visibility: visible;
}

/* 龙形logo旋转 */
.imperial-dragon-spinner {
  width: 100px;
  height: 100px;
  position: relative;
  animation: dragonRotate 3s linear infinite;
}

/* 龙形logo */
.imperial-dragon-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  animation: dragonPulse 2s ease-in-out infinite;
}

@keyframes dragonRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dragonPulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
  }
}

/* 祥云飘动 */
.imperial-cloud-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin-top: 30px;
}

.imperial-cloud {
  position: absolute;
  font-size: 40px;
  opacity: 0.6;
  animation: cloudFloat 4s ease-in-out infinite;
}

.imperial-cloud:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.imperial-cloud:nth-child(2) {
  top: 60%;
  left: 70%;
  animation-delay: 1s;
}

.imperial-cloud:nth-child(3) {
  top: 40%;
  left: 40%;
  animation-delay: 2s;
}

@keyframes cloudFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px) translateX(10px);
    opacity: 1;
  }
}

/* 加载文字 */
.imperial-loading-text {
  font-size: 24px;
  color: #FFD700;
  margin-top: 40px;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  animation: loadingTextPulse 2s ease-in-out infinite;
}

@keyframes loadingTextPulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* 进度条 */
.imperial-loading-progress {
  width: 300px;
  height: 4px;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 2px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

.imperial-loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FFC107 50%, #FFD700 100%);
  border-radius: 2px;
  animation: progressFill 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes progressFill {
  0% {
    width: 0%;
    left: 0;
  }
  50% {
    width: 70%;
    left: 0;
  }
  100% {
    width: 0%;
    left: 100%;
  }
}

/* ==================== 通用工具类 ==================== */

/* 金色光芒效果 */
.imperial-glow-effect {
  position: relative;
}

.imperial-glow-effect::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
    rgba(255, 215, 0, 0.3) 0%,
    transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.imperial-glow-effect:hover::before {
  opacity: 1;
  animation: glowRotate 3s linear infinite;
}

@keyframes glowRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 悬停金色边框 */
.imperial-border-glow {
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  transition: all 0.3s ease;
}

.imperial-border-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(90deg,
    transparent 0%,
    #FFD700 20%,
    #FFC107 40%,
    #FFD700 60%,
    #FFC107 80%,
    transparent 100%);
  background-size: 200% 100%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.imperial-border-glow:hover::before {
  opacity: 1;
  animation: borderFlow 2s linear infinite;
}

/* 禁用动画（针对需要性能优化的场景） */
.imperial-no-animation {
  animation: none !important;
  transition: none !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .imperial-title {
    font-size: 32px;
    letter-spacing: 4px;
  }

  .imperial-subtitle {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .imperial-chapter-title {
    font-size: 36px;
    letter-spacing: 6px;
  }

  .imperial-loading-text {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .imperial-loading-progress {
    width: 200px;
  }

  /* 移动端禁用鼠标轨迹 */
  .imperial-trail,
  .imperial-cursor-glow {
    display: none;
  }
}
