/* Index Page Styles - Converted from miniprogram WXSS */

/* ========================================
   Content Section
   ======================================== */

/* Page container - ensures proper responsive behavior (Requirements 5.5, 6.4) */
.page-container {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  position: relative;
}

.content {
  padding-bottom: 100px; /* Space for bottom bar (78px + margin) */
  font-size: 0;
  width: 100%;
}

.detailimg {
  width: 100%;
  display: block;
}

/* ========================================
   Video Player Section
   ======================================== */

.video-section {
  width: 100%;
  padding: 20px 0;
  background-color: #ffffff;
}

.video-container {
  width: calc(100% - 10px);
  max-width: 320px;
  margin: 0 auto;
  position: relative;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
}

.demo-video {
  width: 100%;
  height: auto;
  display: block;
  background-color: #000;
  outline: none;
}

.video-tip {
  text-align: center;
  margin-top: 12px;
  font-size: 19px;
  font-weight: bold;
  color: #666;
  line-height: 1.4;
}

/* 视频控制条样式优化 */
.demo-video::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.8);
}

.demo-video::-webkit-media-controls-play-button {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

.demo-video::-webkit-media-controls-fullscreen-button {
  background-color: rgba(255, 255, 255, 0.9);
}

/* 移动端视频播放器优化 */
@media (max-width: 768px) {
  .video-section {
    padding: 16px 0;
  }
  
  .video-container {
    width: calc(100% - 8px);
    /* 确保视频在移动端正确显示 */
    -webkit-overflow-scrolling: touch;
  }
  
  .demo-video {
    /* 移动端视频播放优化 */
    object-fit: contain;
  }
  
  .video-tip {
    font-size: 17px;
    font-weight: bold;
    margin-top: 10px;
  }
}


/* ========================================
   Footer Section
   ======================================== */

.footerbox {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 78px; /* 60px * 1.3 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: white;
  box-sizing: border-box;
  z-index: 997;
}

.kefubox {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kefu_base {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kefu {
  width: 24px;
  height: 24px;
}

.kefutext {
  display: block;
  color: rgba(0, 0, 0, 0.6);
  font-size: 12px;
  margin-top: 2px;
}

.kefubtn {
  border: none;
  outline: none;
  width: 0;
  height: 0;
  opacity: 0;
  margin: 0 !important;
  padding: 0 !important;
}

.right_box {
  display: flex;
  align-items: center;
}

.tips {
  position: relative;
  width: 150px;
  height: 36px; /* 28px * 1.3 */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.tipsicon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.tips span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: white;
}

.btn1 {
  min-width: 150px;
  height: 52px; /* 40px * 1.3 */
  line-height: 52px;
  background: linear-gradient(to bottom, #FED331, #FBAE25);
  border-radius: 26px;
  font-size: 14px;
  text-align: center;
  color: white;
  font-weight: bold;
  padding: 0 16px;
  cursor: pointer;
}

.btn1 span:first-child {
  font-size: 22px;
  margin-right: 2px;
}


/* ========================================
   Popup Section - Rewritten for H5
   ======================================== */

/* 遮罩层 */
.popup-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
}

.popup-mask.show {
  display: block;
}

/* 弹窗容器 */
.popupbox {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: white;
  border-radius: 16px 16px 0 0;
  padding: 32px 16px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  z-index: 999;
  transform: translateY(100%);
  visibility: hidden; /* 初始隐藏，避免闪烁 */
}

.popupbox.show {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s ease;
}

/* 弹窗标题 */
.title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

/* 手机号输入 */
.phone {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

#phoneNumber {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: #333;
  padding: 8px 0;
}

#phoneNumber::placeholder {
  color: #999;
}

/* 购课类型标题 */
.typetext {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
}

/* 商品选择容器 */
.twotype {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 20px;
}

/* 商品卡片 */
.typeitem {
  flex: 1;
  position: relative;
  border: 2px solid #DADADA;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  background: white;
}

.typeitem.active {
  border-color: #FED231;
  background-color: #FFF5E5;
}

/* 推荐标签 */
.openicon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.openimg {
  width: 50px;
  height: 22px;
}

/* 商品名称 */
.textbox {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.item_title {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  line-height: 1.3;
  word-break: break-word;
}

/* 原价 */
.oldp {
  font-size: 11px;
  color: rgba(141, 66, 43, 0.63);
  text-decoration: line-through;
  margin-bottom: 4px;
}

/* 折扣价 */
.newp {
  font-size: 12px;
  color: #EC5E74;
  font-weight: bold;
}

.newp span:first-child {
  font-size: 20px;
}

/* 支付按钮 */
.btn2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 57px; /* 44px * 1.3 ≈ 57px */
  background: linear-gradient(to bottom, #FED331, #FBAE25);
  border-radius: 29px;
  padding: 0 16px;
  box-sizing: border-box;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.oldprice {
  font-size: 11px;
  color: rgba(141, 66, 43, 0.63);
  text-decoration: line-through;
}

.btn2 .right_box {
  display: flex;
  align-items: center;
}

.tips2 {
  position: relative;
  width: 100px; /* 80px * 1.25 */
  height: 31px; /* 24px * 1.3 */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.tipsicon2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.tips2 span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: white;
}

.price {
  display: flex;
  align-items: baseline;
}

.price span:first-child {
  font-size: 20px;
  margin-right: 2px;
}

.price span:last-child {
  font-size: 12px;
}

/* 单个商品时的样式 */
.onetype-container {
  margin-bottom: 20px;
}

.onetype {
  font-size: 14px;
  color: #333;
}


/* ========================================
   Responsive Styles - Desktop
   ======================================== */

/* Tablet and Desktop: Center content with fixed width */
@media (min-width: 769px) {
  body {
    background-color: #f5f5f5;
  }
  
  .page-container {
    max-width: 720px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    position: relative;
  }
  
  /* Footer stays within centered container */
  .footerbox {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    max-width: 720px;
  }
  
  /* Popup stays within centered container */
  .popupbox {
    position: fixed;
    left: 50%;
    width: 720px;
    max-width: 720px;
    transform: translateX(-50%) translateY(100%);
  }
  
  .popupbox.show {
    transform: translateX(-50%) translateY(0);
  }
  
  /* Mask covers entire viewport */
  .popup-mask {
    left: 0;
    right: 0;
  }
}

/* Mobile optimization: Ensure no horizontal scrolling */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
    width: 100%;
  }
  
  .page-container {
    width: 100%;
    overflow-x: hidden;
  }
}

/* ========================================
   Toast 提示框
   ======================================== */

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  max-width: 80%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  /* 初始不设置过渡，避免刷新时闪烁 */
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}
