/* ==========================================
   测试页样式 - 完全按照设计图还原
   ========================================== */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #ffffff;
  color: #333333;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ========== 性能优化 ========== */

.container {
  max-width: 100%;
  width: 100%;
  min-height: 100vh;
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 状态栏和头部已移除 - 微信会自动显示这些内容 */

/* ========== 轮播图 ========== */
.carousel {
  position: relative;
  width: 100%;
  margin-bottom: 60px;
  background: #f5f5f5;
  overflow: hidden;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dots .dot.active {
  background: #ffffff;
  width: 28px;
  border-radius: 5px;
}

/* 轮播图左右切换按钮 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  user-select: none;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-arrow-left {
  left: 16px;
}

.carousel-arrow-right {
  right: 16px;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .carousel-arrow-left {
    left: 8px;
  }

  .carousel-arrow-right {
    right: 8px;
  }
}

/* ========== 六宫格和三宫格 ========== */
.grid-container {
  padding: 0 16px 20px;
  display: grid;
  gap: 20px 16px;
}

.grid-container.grid-6 {
  grid-template-columns: repeat(3, 1fr);
  row-gap: 35px;
}

.grid-container.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  row-gap: 35px;
}

.grid-container.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 50px;
  padding: 0 40px 50px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #333333;
  transition: transform 0.2s;
  cursor: pointer;
}

.grid-item:active {
  transform: scale(0.95);
}

/* Logo图标容器 */
.grid-icon-img {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 30%, #ececec 100%);
  border-radius: 18px;
  padding: 16px;
  border: 2px solid #d5d5d5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 -3px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
}

.grid-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.grid-item:active .grid-icon-img {
  transform: scale(0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.12);
}

/* 圆形图标（视频页使用）*/
.grid-icon {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #5b7ebd;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* 多边形图标 */
.blue-polygon-icon {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  background: #5b7ebd;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* 圆形图标 */
.yellow-circle-icon {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* 青色形状图标 */
.teal-shape-icon {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  background: #4a7c7e;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* 图标颜色变体 */
.blue-icon {
  background: #5b7ebd;
}

.yellow-icon {
  background: #f5a623;
}

.teal-icon {
  background: #4a7c7e;
}

.red-icon {
  background: #d0021b;
}

.grid-label {
  font-size: 15px;
  font-weight: 600;
  color: #333333;
  text-align: center;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

/* ========== 底部Logo ========== */
.footer-logo {
  padding: 30px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-logo img {
  width: 60px;
  height: auto;
}

.footer-logo p {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  margin: 0;
}

/* ========== 底部联系信息 ========== */
.footer-contact {
  background: #f5f5f5;
  padding: 24px 20px;
  margin-top: auto;
  border-top: 1px solid #e5e5e5;
}

.footer-contact-inner {
  max-width: 768px;
  margin: 0 auto;
  text-align: center;
}

.footer-contact-item {
  margin-bottom: 12px;
  line-height: 1.6;
}

.footer-contact-item:last-child {
  margin-bottom: 0;
}

.footer-contact-label {
  font-size: 14px;
  font-weight: 600;
  color: #666666;
  margin-right: 6px;
}

.footer-contact-value {
  font-size: 14px;
  color: #333333;
  font-weight: 400;
}

@media (max-width: 360px) {
  .footer-contact {
    padding: 20px 16px;
  }

  .footer-contact-label,
  .footer-contact-value {
    font-size: 13px;
  }
}

/* ========== PDF产品列表页 ========== */
.category-header {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  max-height: 280px;
  overflow: hidden;
}

.category-header img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: bottom !important;
  display: block;
}

.category-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 20px;
  white-space: nowrap;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  background: #ffffff;
}

.product-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 35px 16px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  color: #333333;
  transition: background 0.15s;
  cursor: pointer;
  min-height: 260px;
}

.product-item:nth-child(2n) {
  border-right: none;
}

.product-item:active {
  background: #f8f9fa;
}

.product-item img {
  width: 140px;
  height: 165px;
  object-fit: contain;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.product-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: #333333;
  margin: 0 0 8px 0;
  text-align: center;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.product-item p {
  font-size: 14px;
  font-weight: 400;
  color: #666666;
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

/* ========== PDF详情下载页 ========== */
.pdf-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 30px;
  text-align: center;
  min-height: auto;
}

.pdf-detail + .pdf-detail {
  padding-top: 20px;
}

.pdf-pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 100px;
  width: 100%;
  max-width: 800px;
}

.pdf-page-image {
  width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.pdf-icon {
  width: 140px;
  height: 165px;
  margin-bottom: 24px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.12));
}

.product-info {
  margin-bottom: 24px;
}

.product-info h2 {
  font-size: 26px;
  font-weight: 700;
  color: #333333;
  margin: 0 0 12px 0;
  letter-spacing: 0.8px;
}

.product-info p {
  font-size: 17px;
  font-weight: 400;
  color: #666666;
  margin: 0;
  line-height: 1.6;
}

.download-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 60px);
  max-width: 320px;
  padding: 18px 40px;
  background: linear-gradient(135deg, #5eb3e6 0%, #4a9dd9 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 6px 18px rgba(74, 157, 217, 0.35);
  letter-spacing: 0.8px;
  z-index: 1000;
}

.download-btn:active {
  transform: translateX(-50%) scale(0.97);
}

/* ========== 视频分类页 ========== */
.video-category-title {
  background: linear-gradient(135deg, #6b9bd1 0%, #5a8bc7 100%);
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  margin-bottom: 0;
}

.video-category-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 1px;
}

.video-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  background: #ffffff;
}

.video-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 18px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  color: #333333;
  transition: background 0.15s;
  cursor: pointer;
  min-height: 220px;
}

.video-category-item:nth-child(2n) {
  border-right: none;
}

.video-category-item:active {
  background: #f8f9fa;
}

.video-category-item img {
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 18px;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.video-category-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin: 0;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ========== 视频播放页 ========== */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 16px 20px;
  background: #f5f5f5;
}

.video-item {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.video-thumbnail {
  position: relative;
  width: 100%;
  background: #000000;
  overflow: hidden;
}

.vertical-video .video-thumbnail {
  aspect-ratio: 9/16;
  max-width: 360px;
  margin: 0 auto;
}

.horizontal-video .video-thumbnail {
  aspect-ratio: 16/9;
}

.video-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button svg circle {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* 视频进度条容器 */
.video-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 16px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 20;
}

.video-thumbnail.playing .video-progress-container {
  opacity: 1;
  pointer-events: auto;
}

/* 视频控制栏 */
.video-controls {
  position: absolute;
  bottom: 46px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 15;
  pointer-events: none;
}

.video-thumbnail.playing .video-controls {
  opacity: 1;
  pointer-events: auto;
}

.control-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn svg {
  pointer-events: none;
}

.video-item h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin: 0;
  padding: 16px 20px;
  background: #ffffff;
  text-align: center;
  letter-spacing: 0.3px;
}

/* 进度条 */
.progress-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 6px;
  overflow: visible;
}

.progress-bar:hover {
  height: 6px;
}

.progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #4a90e2;
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
  pointer-events: none;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #4a90e2;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.progress-bar:hover .progress-handle {
  opacity: 1;
}

/* 时间显示 */
.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #ffffff;
  font-family: 'Courier New', monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.current-time,
.duration {
  min-width: 35px;
}

/* ========== 响应式适配 ========== */
@media (max-width: 360px) {
  .carousel-container {
    padding-bottom: 56.25%;
  }

  .grid-icon-img {
    max-width: 105px;
    padding: 12px;
  }

  .grid-icon,
  .blue-polygon-icon,
  .yellow-circle-icon,
  .teal-shape-icon {
    max-width: 105px;
  }

  .carousel {
    margin-bottom: 40px;
  }

  .grid-container {
    gap: 18px 12px;
    padding: 0 12px 16px;
  }

  .grid-container.grid-6 {
    row-gap: 28px;
  }

  .grid-container.grid-3 {
    row-gap: 28px;
  }

  .grid-container.grid-2 {
    gap: 35px;
    padding: 0 24px 40px;
  }

  .grid-label {
    font-size: 14px;
  }

  .product-item {
    padding: 30px 12px;
    min-height: 240px;
  }

  .product-item img {
    width: 120px;
    height: 140px;
  }

  .product-item h3 {
    font-size: 15px;
  }

  .video-category-item {
    padding: 32px 14px;
    min-height: 200px;
  }

  .video-category-item img {
    max-width: 150px;
  }

  .video-list {
    gap: 16px;
    padding: 16px;
  }

  .video-item h3 {
    font-size: 15px;
    padding: 14px 16px;
  }

  .pdf-detail {
    padding: 50px 20px;
    min-height: auto;
  }

  .pdf-icon {
    width: 120px;
    height: 140px;
    margin-bottom: 30px;
  }

  .product-info {
    margin-bottom: 40px;
  }

  .product-info h2 {
    font-size: 22px;
  }

  .product-info p {
    font-size: 16px;
  }

  .download-btn {
    padding: 16px 32px;
    font-size: 16px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    margin: 0 auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-item:nth-child(2n) {
    border-right: none;
  }

  .video-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-category-item:nth-child(2n) {
    border-right: none;
  }
}
