/* How to Buy 指导图标样式 */

.how-to-buy-guide {
  position: fixed;
  right: 36px;
  top: 62%;
  transform: translateY(-50%);
  z-index: 999;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 图标容器 */
.how-to-buy-icon {
  position: relative;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(249, 115, 22, 0.95));
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 34px rgba(231, 76, 60, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

/* 外发光圈：更显眼但不土 */
.how-to-buy-icon::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%);
  opacity: 0.9;
  filter: blur(6px);
  z-index: -1;
  animation: htb-glow 2.2s ease-in-out infinite;
}

@keyframes htb-glow {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* 闪光扫过：更显眼、更“有质感” */
.how-to-buy-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.55) 40%, transparent 70%);
  transform: translateX(-140%) skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  animation: htb-shine 4.2s ease-in-out infinite;
}

@keyframes htb-shine {
  0%, 60% {
    opacity: 0;
    transform: translateX(-140%) skewX(-18deg);
  }
  70% {
    opacity: 0.9;
  }
  88% {
    opacity: 0;
    transform: translateX(140%) skewX(-18deg);
  }
  100% {
    opacity: 0;
    transform: translateX(140%) skewX(-18deg);
  }
}

/* Hover效果 */
.how-to-buy-guide:hover .how-to-buy-icon {
  transform: translateX(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 18px 46px rgba(231, 76, 60, 0.36);
}

.how-to-buy-guide:hover .how-to-buy-icon::after {
  animation-duration: 2.4s;
}

/* 按钮文字 */
.how-to-buy-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.how-to-buy-brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1.05;
}

.how-to-buy-icon .brand-just {
  color: #b91c1c;
}

.how-to-buy-icon .brand-shop {
  color: #ffffff;
}

/* 点击效果 */
.how-to-buy-guide:active .how-to-buy-icon {
  transform: translateY(0);
}

/* 新增闪烁提示动画 - 第一次访问时 */
.how-to-buy-guide.first-visit .how-to-buy-icon {
  animation: htb-pop 0.6s ease 2;
}

@keyframes htb-pop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ===== 侧边栏面板样式（仿CNFans） ===== */

/* 遮罩层 */
.how-to-buy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.how-to-buy-modal-overlay.active {
  display: block;
  opacity: 1;
}

/* 居中模态框容器 */
.how-to-buy-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  height: 90vh;
  background: white;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: none;
  flex-direction: column;
  opacity: 0;
  min-height: 0;
}

.how-to-buy-modal.active {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 标签页导航 */
.how-to-buy-tabs {
  display: flex;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

/* 弹窗主标题 */
.how-to-buy-modal-header {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  padding: 25px 30px;
  text-align: center;
  position: relative;
}

.how-to-buy-modal-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: 1px;
}

.how-to-buy-modal-title .brand-just {
  color: #e74c3c;
}

.how-to-buy-modal-title .brand-shop {
  color: #ffffff;
}

.how-to-buy-tab {
  flex: 1;
  padding: 15px 20px;
  background: #f5f5f5;
  color: #666;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.how-to-buy-tab:first-child {
  border-right: 1px solid #e0e0e0;
}

.how-to-buy-tab.active {
  background: #e74c3c;
  color: white;
}

.how-to-buy-tab:not(.active):hover {
  background: #e8e8e8;
}

/* 关闭按钮 */
.how-to-buy-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.how-to-buy-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* 内容区域 */
.how-to-buy-modal-body {
  display: flex;
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* 图文指导标签页 - 左右分栏布局 */
#tab-picture,
.tab-content {
  display: flex;
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
}

/* 左侧章节导航 */
.htb-chapters-nav {
  width: 250px;
  background: #f8f9fa;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100%;
}

.htb-nav-title {
  padding: 20px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
}

.htb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.htb-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.htb-nav-item:hover {
  background: #e9ecef;
}

.htb-nav-item.active {
  background: #fff;
  border-left-color: #e74c3c;
}

.htb-nav-number {
  background: #6c757d;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

/* 艺术风格数字标记 - 方形（用于横向布局） */
.htb-art-number {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  margin-right: 10px;
}

.htb-nav-item.active .htb-nav-number {
  background: #e74c3c;
}

.htb-nav-text {
  font-size: 15px;
  color: #495057;
  font-weight: 500;
}

.htb-nav-item.active .htb-nav-text {
  color: #e74c3c;
  font-weight: 600;
}

/* 右侧章节内容 */
.htb-chapters-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
  height: 100%;
  min-height: 0;
}

.htb-chapter-view {
  display: none;
  padding: 40px;
  animation: fadeIn 0.3s ease;
}

.htb-chapter-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.htb-chapter-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #e74c3c;
}

.htb-chapter-body {
  color: #333;
  line-height: 1.8;
  font-size: 16px;
  margin-bottom: 40px;
}

/* 章节导航按钮 */
.htb-chapter-nav-buttons {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.htb-nav-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.htb-prev-btn {
  background: #6c757d;
  color: white;
}

.htb-prev-btn:hover {
  background: #5a6268;
  transform: translateX(-3px);
}

.htb-next-btn {
  background: #e74c3c;
  color: white;
}

.htb-next-btn:hover {
  background: #c0392b;
  transform: translateX(3px);
}

.htb-restart-btn {
  background: #28a745;
  color: white;
}

.htb-restart-btn:hover {
  background: #218838;
}

/* 内容区域内的图片自适应 */
.htb-chapter-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.htb-chapter-body img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 视频指导标签页 */
#tab-video {
  padding: 40px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ===== 图片灯箱样式 ===== */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  z-index: 100000;
  animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* 自定义滚动条 */
.htb-chapters-content::-webkit-scrollbar,
.htb-chapters-nav::-webkit-scrollbar,
#tab-video::-webkit-scrollbar {
  width: 8px;
}

.htb-chapters-content::-webkit-scrollbar-track,
.htb-chapters-nav::-webkit-scrollbar-track,
#tab-video::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.htb-chapters-content::-webkit-scrollbar-thumb,
.htb-chapters-nav::-webkit-scrollbar-thumb,
#tab-video::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.htb-chapters-content::-webkit-scrollbar-thumb:hover,
.htb-chapters-nav::-webkit-scrollbar-thumb:hover,
#tab-video::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* 空内容提示 */
.how-to-buy-empty-content {
  text-align: center;
  padding: 100px 20px;
  color: #999;
}

.how-to-buy-empty-content .empty-icon {
  font-size: 60px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.how-to-buy-empty-content p {
  font-size: 16px;
  color: #999;
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
  .how-to-buy-guide {
    top: auto;
    bottom: 28px;
    right: 18px;
    transform: none;
  }

  .how-to-buy-icon {
    padding: 12px 16px;
  }

  .how-to-buy-kicker {
    font-size: 11px;
  }

  .how-to-buy-brand {
    font-size: 16px;
  }

  /* 移动端模态框 */
  .how-to-buy-modal {
    width: 95%;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .how-to-buy-modal.active {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 平板设备 */
@media (max-width: 1024px) and (min-width: 769px) {
  .how-to-buy-guide {
    bottom: 60px;
  }

  .how-to-buy-icon {
    padding: 13px 17px;
  }

  .how-to-buy-modal {
    width: 90%;
    max-width: 700px;
  }
}
