/* 页面整体居中布局 */
body {
  margin: 0;
  height: 100vh;
  background-color: #1f1e1e;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* 封面容器居中展示 */
.cover-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 封面浮动动画和放大状态 */
.float-wrapper {
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

.float-wrapper.hovered {
  animation-play-state: paused;
  transform: scale(1.15);
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
}

/* 封面图包裹器用于限制遮罩范围 */
.cover-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cover-wrapper:hover {
  transform: scale(1.1);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
}

/* 封面图片样式 */
.cover {
  width: 350px;
  max-height: 90vh;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  display: block;
}

/* 鼠标悬停遮罩滑入 */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
}

.cover-wrapper:hover .overlay {
  transform: translateX(0);
}

/* 浮动动画效果 */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

/* 标题与作者文字样式 */
.ebook-info {
  text-align: center;
  margin-top: 20px;
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ebook-title {
  font-size: 24px;
  margin: 10px 0 5px;
}

.ebook-author {
  font-size: 16px;
  color: #ccc;
}
.read-button {
  position: relative;
  padding: 10px 20px;
  border: 2px solid white;
  border-radius: 20px;
  font-size: 20px;
  color: white;
  z-index: 1;
  overflow: hidden;
}

/* 动画伪元素 */
.read-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: rgba(204, 57, 57, 0.584); /* 半透明白色 */
  transition: width 0.5s ease;
  z-index: -1;
  border-radius: 20px;
}

/* 悬停时填满背景 */
.cover-wrapper:hover .read-button::before {
  width: 100%;
}
/* 延迟填充开始时间，不与遮罩动画保持同步 */
.cover-wrapper:hover .read-button::before {
  width: 100%;
  transition-delay: 0.5s; 
}
.read-button {
  position: relative;
  padding: 10px 20px;
  border: 2px solid white;
  border-radius: 20px;
  font-size: 20px;
  color: white;
  z-index: 1;
  overflow: hidden;
  background-color: transparent;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

/* 按钮填充动画背景 */
.read-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: rgba(201, 75, 75, 0.482); /* 初始填充 */
  transition: width 0.5s ease;
  transition-delay: 0s;
  z-index: -1;
  border-radius: 20px;
}

/* 遮罩悬停后触发填充延迟 */
.cover-wrapper:hover .read-button::before {
  width: 100%;
  transition-delay: 0.5s;
}

/* 填充完成后，按钮激活状态：变为酒红色背景 */
.read-button.active {
  background-color: #800000;
}

/* 激活状态下才允许放大效果 */
.read-button.active:hover {
  transform: scale(1.1);
}


.object-meta {
  margin-top: 20px;
  font-size: 0.75rem;
  color: #ccc;
  line-height: 1.6;
}

.object-meta p {
  margin: 5px 0;
}

/* ==== 视频弹窗背景层 ==== */
.modal {
  display: flex;
  justify-content: center;    /* 水平居中 */
  align-items: center;        /* 垂直居中 */
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

/* ==== 弹窗内容区域 ==== */
.modal-content {
  position: relative;
  width: 80%;
  max-width: 720px;
  background-color: #111;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: slideIn 0.4s ease-out;
}

/* ==== 视频样式 ==== */
.modal-content video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background-color: black;
}

/* ==== 关闭按钮样式 ==== */
.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 0, 0, 0.8);
}

/* ==== 入场动画效果（可选） ==== */
@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
 /* 重新播放按钮 */
 /* 重新播放按钮 */
#replay-button {
  position: fixed;
  top: 30px;
  left: 30px;
  width: 55px;
  height: 55px;
  background-color: #535353;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;

  /* 不再用 flex，改为 relative 容器 */
  display: block;
  position: fixed;
  overflow: hidden;
  padding: 0;
  transition: transform 0.2s ease;
}

/* 悬停放大效果 */
#replay-button:hover {
  transform: scale(1.3);
  background-color: #732c2c;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* 图标绝对居中 */
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  display: block;
  pointer-events: none; /* 防止点击事件被图片吃掉 */
}


/* 菜单按钮容器样式 */
.menu-button {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border: 1px solid white; /* 初始边框 */
  border-radius: 30px; /* 圆角效果 */
  background-color: transparent; /* 初始透明背景 */
  color: white; /* 文本颜色 */
  font-family: 'Arial', sans-serif;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.5s ease; /* 背景颜色过渡效果 */
}

/* 鼠标悬停时背景渐变到红色 */
.menu-button:hover {
  background-color: #622a1d; /* 红色填充背景 */
}

/* 菜单文字样式 */
.menu-text {
  margin-right: 10px;
}


/* 菜单按钮容器样式 */
.menu-button {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border: 1px solid white; /* 初始边框 */
  border-radius: 30px; /* 圆角效果 */
  background-color: transparent; /* 初始透明背景 */
  color: white; /* 文本颜色 */
  font-family: 'Arial', sans-serif;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.5s ease; /* 背景颜色过渡效果 */
  z-index: 9;
}

/* 鼠标悬停时背景渐变到红色 */
.menu-button:hover {
  background-color: #622a1d; /* 红色填充背景 */
}

/* 菜单文字样式 */
.menu-text {
  margin-right: 10px;
  overflow: hidden; /* 确保动画范围受限 */
  position: relative;
  display: inline-block;
  height: 1em;
  line-height: 1em; /* 与文本高度保持一致 */
  transition: transform 0.3s ease-in-out;
  z-index: 9;
}

.menu-text span {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(0);
  transition: transform 0.3s ease-in-out;
}

.menu-text span.inactive {
  transform: translateY(-100%); /* 初始状态隐藏 */
}

.menu-text span.active {
  transform: translateY(0); /* 显示内容 */
}

/* 菜单图标容器样式 */
.menu-icon {
  display: flex;
  gap: 5px; /* 两个点之间的间距 */
  position: relative;
  transition: transform 0.5s ease; /* 旋转过渡效果 */
}

/* 鼠标悬停时图标旋转 */
.menu-button:hover .menu-icon {
  transform: rotate(270deg); /* 图标旋转 270 度 */
}

/* 图标点样式 */
.dot {
  width: 5px;
  height: 5px;
  background-color: white;
  border-radius: 50%; /* 圆形 */
  transition: background-color 0.5s ease;
}

/* 鼠标悬停时点颜色变化 */
.menu-button:hover .dot {
  background-color: #ffd700; /* 点颜色变为金色 */
}
/* 激活状态，显示 CLOSE */
.menu-button.active .text-close {
  top: 0; /* 滑入到可见位置 */
  opacity: 1; /* 变得可见 */
}

.menu-button.active .text-menu {
  top: -100%; /* 滑出到不可见位置 */
  opacity: 0; /* 变得透明 */
}

/* 图标旋转时的过渡效果 */
.menu-icon {
  transition: transform 0.5s ease;
}

/* 图标容器样式 */
.icon-container {
  display: flex; /* 使用 flex 布局确保图标和条形水平排列 */
  align-items: center; /* 垂直居中 */
  gap: 10px; /* 图标与黄色条形之间的间距 */
  position: relative; /* 保持相对定位 */
  margin-bottom: 20px; /* 与下方文字保持间距 */
}
/* 菜单容器初始样式 */
.menu-list {
  position: absolute;
  top: 100px;
  right: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: scale(0.5) rotate(45deg); /* 初始缩小并旋转 */
  transition: transform 0.5s ease, opacity 0.5s ease;
  pointer-events: none; /* 防止未显示时点击 */
  z-index: 9;
}

/* 菜单项样式 */
.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  background-color: white;
  color: black;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Arial', sans-serif;
  font-size: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, border-radius 0.3s ease;
  overflow: hidden;
}

/* 箭头图片初始样式 */
.arrow-icon {
  position: absolute;
  left: -40px; /* 起始位置在菜单项左侧外 */
  width: 20px; /* 设置箭头宽度 */
  height: auto; /* 自动调整高度 */
  transition: left 0.3s ease; /* 滑动动画 */
}

/* 鼠标悬停效果 */
.menu-item:hover {
  background-color: #894735; /* 黄色背景 */
  border-radius: 50px; /* 变成两端圆形条状 */
  transform: scale(1.5); /* 整体扩大 */
}

.menu-item:hover .arrow-icon {
  left: 10px; /* 向右滑动到菜单项内 */
}

.menu-item:hover .menu-text {
  color: white; /* 文字变为白色 */
  transform: translateX(20px); /* 文字向右移动 */
}

/* 显示菜单时的动画 */
.menu-list.active {
  opacity: 1;
  transform: scale(1) rotate(0); /* 展开到正常大小和角度 */
  pointer-events: auto; /* 允许点击 */
}

.menu-list.active .menu-item {
  transform: rotate(0); /* 逐项旋转到正常角度 */
}
.menu-link {
  text-decoration: none; /* 去掉超链接的下划线 */
  color: inherit; /* 继承父元素的颜色 */
  display: block; /* 使链接区域覆盖整个子元素 */
}

.menu-link:hover .menu-item {
  transform: scale(1.05); /* 保持悬停特效 */
  transition: transform 0.3s ease; /* 平滑过渡 */
}
