/* ========== CSS Custom Properties ========== */
:root {
  --primary-color: #4d9cea;
  --danger-color: #fe4f66;
  --success-color: #28c445;
  --video-accent: #D93F47;
  --dark-bg: #2b2e39;
  --light-bg: #ededf2;
  --white: #fff;
  --text-dark: #1d1a18;
  --text-gray: #6e6f70;
  --text-light-gray: #737373;
  --price-red: #f83055;
  --discount-bg: #ffece8;
  --border-light: #dcdfe6;
  --border-lighter: #e4e4e4;
  --border-input: #e3e3e4b3;
  --gradient-hot: linear-gradient(90deg, #fb634b 0%, #fd2b54 100%);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 15px;
  --radius-round: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ========== Reset & Base ========== */
html {
  background: var(--light-bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  display: none;
}

/* ========== Card Header ========== */
.card-header:first-child {
  padding: 12px;
  font-size: 16px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  color: var(--white);
  border-radius: var(--radius-sm) !important;
  background: url(../assets/top_back.png) no-repeat;
  background-size: cover;
}

/* ========== Layout: Mobile Wrappers ========== */
.mobile {
  width: 100%;
  height: 100vh;
  font-size: 12px;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile2 {
  position: absolute;
  width: 100%;
  height: 100vh;
  overflow: auto;
  z-index: 99;
  padding: 0 10px;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile_back {
  width: 100%;
  height: 100vh;
  filter: blur(5px);
  object-fit: cover;
}

/* ========== Mobile Top Bar ========== */
.mobileTop {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  flex-wrap: wrap;
  text-align: center;
}

.mobileTop img {
  border-radius: 50%;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  flex-shrink: 0;
}

.mobileTitle {
  margin-top: 10px;
  font-size: 30px;
  color: #fff1cd;
  text-align: center;
  margin-bottom: 10px;
  word-break: break-word;
}

/* ========== Section Title ========== */
.listTitle {
  color: #000;
  font-weight: 600;
  margin-top: 6px;
  margin-bottom: 4px;
}

.configureTitle {
  margin-bottom: 10px;
  color: var(--white);
}

#title {
  color: #444444;
}

/* ========== Grid Layout: pypList ========== */
.pypList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 10px;
  margin: 10px 0;
}

.pypList img {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.pypList img:active {
  transform: scale(0.95);
}

/* ========== Activity Button Cards ========== */
.pyp_div {
  display: flex;
  width: calc(33.33% - 16px);
  align-items: center;
  margin-right: 16px;
  margin-bottom: 16px;
  padding: 10px 15px;
  background: var(--dark-bg);
}

.pyp_div1 {
  display: flex;
  align-items: center;
}

.pyp_img {
  width: 30px;
  border-radius: 5px;
}

.pyp_input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 10px;
}

.pyp_p {
  font-size: 16px;
}

/* Disable pointer events on children of clickable buttons */
.pypBtn * {
  pointer-events: none;
}

.pypBtn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pypBtn:active {
  opacity: 0.8;
}

/* ========== Form Switch ========== */
.layui-form-onswitch {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
}

.layui-form-switch {
  margin-top: 0px;
}

/* ========== Icons & Type ========== */
.thIcon {
  width: 20px;
  height: 20px;
  margin-right: 5px;
  margin-bottom: 2px;
}

.typeTitle {
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--white);
}

/* ========== layui Overrides ========== */
.layui-layer-dialog {
  border-radius: 10px !important;
}

.layui-layer-btn .layui-layer-btn0 {
  background-color: var(--danger-color) !important;
}

/* ========== Popup: Send Moments ========== */
.sendMomentsBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.625rem 0.9375rem 1.25rem;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 60px;
  -webkit-overflow-scrolling: touch;
}

.boxTitle {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
}

.copywritingBox {
  background-color: #f8f8f9;
  border: 1px solid var(--border-input);
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border-radius: var(--radius-xl);
}

.copyBtn {
  margin-top: 10px;
  color: var(--danger-color);
  cursor: pointer;
}

/* ========== Popup Buttons ========== */
.cancel {
  width: 48%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-gray);
  cursor: pointer;
}

.confirm {
  width: 48%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border: 1px solid var(--success-color);
  background: var(--success-color);
  color: var(--white);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.VideoConfirm {
  width: 48%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border: 1px solid var(--video-accent);
  background: var(--video-accent);
  color: var(--white);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.VideoConfirm div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.download {
  width: 30%;
  margin-left: 10px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border: 1px solid var(--success-color);
  background: var(--success-color);
  color: var(--white);
  border-radius: 5px;
  cursor: pointer;
}

/* ========== Bottom Button Bar ========== */
.BoxBtnList {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  padding-bottom: calc(10px + var(--safe-bottom));
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  background-color: var(--white);
  z-index: 10;
}

/* ========== Image & Video Boxes ========== */
.imgBox {
  width: 100%;
  text-align: center;
  margin-top: 10px;
  display: none;
}

.videoBox {
  width: 100%;
  text-align: center;
  margin-top: 10px;
  display: none;
}

.imgList {
  display: flex;
  align-items: center;
  overflow: auto;
  width: 100%;
  flex-wrap: wrap;
  gap: 4px;
}

.comment_img {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
}

.VideoImgList {
  width: 100%;
  position: relative;
}

.videoList {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  width: 100%;
}

/* ========== Mask Overlay ========== */
.mask {
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  box-sizing: border-box;
  z-index: 100;
}

.mask_box {
  position: relative;
  width: 100%;
  height: 100%;
}

.arrow {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 90px;
  z-index: 105;
}

.poptip {
  position: absolute;
  width: 90%;
  top: 140px;
}

/* ========== Group Deal List ========== */
.tgList {
  width: 100%;
  min-height: 110px;
  overflow: auto;
  margin: 10px 0;
  display: flex;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.tgItem {
  min-width: calc(100%);
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-sizing: border-box;
  transform: scale(0.9);
  margin-left: -20px;
  flex-shrink: 0;
}

.tgItem:first-child {
  margin-left: 0;
  transform: scale(1);
}

.tgImg {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-lg);
  margin-right: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.tgTitle {
  font-size: 14px;
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

.price {
  font-weight: bold;
  color: var(--price-red);
  font-size: 14px;
}

.originalPrice {
  font-size: 12px;
  font-weight: 500;
  color: #8e8e8e;
  text-decoration: line-through;
}

.discount {
  padding: 0 5px;
  color: var(--price-red);
  display: flex;
  align-items: center;
  font-size: 12px;
  background-color: var(--discount-bg);
  margin-top: 2px;
}

.tgRight {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 90px;
  flex: 1;
  align-items: flex-start;
  width: calc(100% - 95px);
  min-width: 0;
}

.tgTagList {
  display: flex;
  align-items: center;
  overflow: auto;
  width: calc(100% - 65px);
  -webkit-overflow-scrolling: touch;
}

.tgTagItem {
  padding: 0 5px;
  border: 1px solid var(--border-lighter);
  color: var(--text-light-gray);
  font-size: 12px;
  white-space: nowrap;
  margin-right: 10px;
}

.tgBtn {
  width: 80px;
  height: 30px;
  background: var(--gradient-hot);
  line-height: 30px;
  text-align: center;
  color: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}

.tgBtn:active {
  opacity: 0.85;
}

.listBox {
  width: 100%;
}

/* ========== Second Style (various sections) ========== */
.topbg {
  position: relative;
}

.topbgimg {
  width: 100%;
  position: absolute;
  z-index: 1;
  top: 0;
}

.userdata {
  display: flex;
  align-items: center;
  position: absolute;
  top: 40px;
  left: 20px;
  z-index: 1;
}

.userimg {
  width: 24px;
  height: 24px;
  margin-right: 5px;
}

.usertext {
  font-size: 14px;
  color: #ffffff;
}

.various {
  padding: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
  position: relative;
  top: 200px;
  z-index: 3;
}

/* ========== Section Cards ========== */
.dkdpdiv,
.fspdiv,
.wxyxdiv,
.sjtgdiv,
.gzzhdiv,
.wifidiv,
.yhtgdiv {
  border-radius: var(--radius-lg);
  border: 1px solid #ffffff;
  padding: 10px;
  margin-bottom: 15px;
}

.dkdpdiv {
  background: linear-gradient(180deg, rgba(247, 254, 243, 0.4) 0%, #fdf2de 100%);
}

.fspdiv {
  background: linear-gradient(180deg, rgba(243, 248, 254, 0.4) 0%, #deecfd 100%);
}

.wxyxdiv {
  background: linear-gradient(180deg, #abffda 0%, #a4e57e 100%);
}

.sjtgdiv {
  background: linear-gradient(180deg, rgba(254, 243, 243, 0.4) 0%, #fddede 100%);
}

.gzzhdiv {
  background: linear-gradient(180deg, #ecfef6 40%, #daf9f0 100%);
}

.wifidiv {
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
}

.yhtgdiv {
  background: linear-gradient(180deg, rgba(247, 254, 243, 0.4) 0%, #fdf2de 100%);
}

/* ========== dkdp (Review) Section ========== */
.dkdptop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dkdpdata,
.wxyxdata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.dpdiv,
.wxyx {
  width: 38%;
  display: flex;
  align-items: center;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: var(--radius-md);
  box-sizing: content-box;
  white-space: nowrap;
  cursor: pointer;
}

.dpdiv:active,
.wxyx:active {
  opacity: 0.8;
}

.dpimg,
.wxyximg {
  margin-right: 7px;
  width: 32px;
  height: 32px;
}

.dpp,
.wxyxp {
  font-size: 16px;
  color: var(--text-dark);
  font-weight: bold;
}

/* ========== Video Send Section ========== */
.fspleft,
.xhsks {
  width: 46%;
  position: relative;
  cursor: pointer;
}

.fdybg,
.xhsksbg {
  width: 100%;
  position: relative;
  z-index: 0;
  top: 0;
  left: 0;
}

.fspdata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.xhsksdyicon {
  width: 20px;
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 12px;
}

.xhsksdyp {
  white-space: nowrap;
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 36px;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-dark);
}

/* ========== Shop Deals Section ========== */
.sjtgdata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sjtgall {
  width: 33%;
  text-align: center;
  cursor: pointer;
}

.sjtgall:active {
  opacity: 0.8;
}

.sjtgp {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #e79f7e 0%, #410d01 100%);
  border-radius: var(--radius-round);
  padding: 4px 12px;
  width: fit-content;
  margin: -20px auto auto auto;
  text-align: center;
  font-size: 14px;
  color: #ffffff;
}

/* ========== Account Follow Section ========== */
.gzzhdata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
}

.gzzhimg {
  width: 30%;
  margin: 1%;
  cursor: pointer;
}

.gzzhimg:active {
  opacity: 0.8;
}

.gzzhtop {
  width: 65%;
  margin-left: 0;
}

/* ========== WiFi Section ========== */
.wifidata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
}

.wifileft {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.wifiimg {
  width: 48px;
  margin-right: 10px;
  flex-shrink: 0;
}

.wifiname {
  font-size: 13px;
  color: #5f7292;
  margin-bottom: 5px;
}

.wifipass {
  font-size: 15px;
  color: var(--text-dark);
  word-break: break-all;
}

.wifirig {
  background: #e1edfc;
  border-radius: var(--radius-round);
  padding: 5px 10px;
  font-size: 14px;
  color: #000000;
  display: flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.wifirig:active {
  background: #d0dff5;
}

/* ========== Deals Shop Section ========== */
.yhtgdata {
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px;
  border-radius: 10px;
  margin-right: 10px;
  width: 100%;
}

.tgspimg {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-lg);
  margin-right: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.spxxtop {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.spxxbot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spxxname {
  font-size: 14px;
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

.spjgall {
  display: flex;
  flex-direction: column;
}

.spjg {
  display: flex;
  align-items: baseline;
}

.xianjia {
  font-weight: bold;
  color: var(--price-red);
  font-size: 14px;
}

.yuanjia {
  font-size: 12px;
  font-weight: 500;
  color: #8e8e8e;
  text-decoration: line-through;
}

.yhtgbut {
  width: 80px;
  height: 30px;
  background: var(--gradient-hot);
  line-height: 30px;
  text-align: center;
  color: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}

.yhtgbut:active {
  opacity: 0.85;
}

.spyhtext {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow: auto;
  width: calc(100% - 65px);
}

.spxxdata {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spyouhui {
  display: flex;
  justify-content: space-between;
}

.sjtgimg {
  width: 80px;
}

.spyhp {
  padding: 0 5px;
  border: 1px solid var(--border-lighter);
  color: var(--text-light-gray);
  font-size: 12px;
  white-space: nowrap;
  margin-right: 10px;
}

.zhekou {
  padding: 0 5px;
  color: var(--price-red);
  display: flex;
  align-items: center;
  font-size: 12px;
  background-color: var(--discount-bg);
  margin-top: 2px;
}

.spchushou {
  font-size: 11px;
}

.yhtgList {
  display: flex;
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== Top Row Images ========== */
.fsptop,
.wxyxtop,
.sjtgtop,
.yhtgtop {
  width: 100%;
}

/* ========== Red Packet Overlay ========== */
.redPacket {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  box-sizing: border-box;
  z-index: 100;
  background: rgba(0, 0, 0, 0.2);
}

/* ========== Slider (Image Gallery) ========== */
.slider-container {
  width: 100%;
  height: 20rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.slider-dot.active {
  background-color: rgba(255, 255, 255, 1);
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 5;
}

.slider-arrow-left {
  left: 10px;
}

.slider-arrow-right {
  right: 10px;
}

/* ========== Show Video Thumbnail ========== */
.showVideo {
  cursor: pointer;
}

.showVideo:active {
  opacity: 0.85;
}

/* ========== Responsive: Small Screens (iPhone SE, older Androids) ========== */
@media screen and (max-width: 374px) {
  .pypList {
    column-gap: 6px;
    row-gap: 6px;
    margin: 6px 0;
  }

  .dpdiv,
  .wxyx {
    width: 42%;
    padding: 10px;
  }

  .dpp,
  .wxyxp {
    font-size: 14px;
  }

  .fspleft,
  .xhsks {
    width: 48%;
  }

  .tgImg {
    width: 70px;
    height: 70px;
  }

  .tgRight {
    height: 70px;
    width: calc(100% - 80px);
  }

  .tgBtn,
  .yhtgbut {
    width: 64px;
    font-size: 12px;
  }

  .sjtgimg {
    width: 64px;
  }

  .mobileTitle {
    font-size: 24px;
  }
}

/* ========== Responsive: Medium & Large Phones ========== */
@media screen and (min-width: 375px) and (max-width: 428px) {
  /* Default styles apply, fine-tune if needed */
}

/* ========== Responsive: Tablets / Large Screens ========== */
@media screen and (min-width: 768px) {
  .mobile2 {
    max-width: 500px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .mask {
    padding: 0 80px;
  }

  .poptip {
    width: 70%;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========== iOS Safe Area & Notch Support ========== */
@supports (padding: env(safe-area-inset-top)) {
  .mobile2 {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: calc(10px + var(--safe-left));
    padding-right: calc(10px + var(--safe-right));
  }

  .BoxBtnList {
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .mask,
  .redPacket {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
  }
}

/* ========== Accessibility: Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  .slider-track {
    transition: none;
  }

  .pypList img {
    transition: none;
  }
}

/* ========== Dark Mode Support (optional) ========== */
@media (prefers-color-scheme: dark) {
  /* Preserve original design on dark mode - no forced dark */
  html {
    background: var(--light-bg);
  }
}
