/* ============ 基础重置 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ 移动端适配 - 以 750px 设计稿为基准 ============ */
html {
  font-size: calc(100vw / 7.5); /* 1rem = 100px @750设计稿 */
}

@media screen and (min-width: 750px) {
  html {
    font-size: 100px;
  }
  body {
    max-width: 750px;
    margin: 0 auto;
  }
}

/* ============ 页面容器 ============ */
.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
}

/* ============ 内容区域 ============ */
.content-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content-wrapper .bg {
  width: 100%;
  display: block;
}

.content {
  position: absolute;
  top: 55%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============ 按钮区域 ============ */
.btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 0.34rem;
}

.btns .btn {
  width: calc(50% - 0.34rem);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btns .btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

/* ============ 进度条 ============ */
.progress-wrapper {
  width: 100%;
  padding: 0 0.8rem;
  margin-top: 0.56rem;
}

.progress-bg {
  background-color: #ffffff;
  height: 0.7rem;
  border-radius: 0.35rem;
  padding: 0.1rem;
  width: 100%;
}

.progress-item-wrapper {
  width: 100%;
  height: 100%;
  border-radius: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.07rem;
  overflow: hidden;
}

.progress-item-wrapper .item {
  flex: 1;
  height: 100%;
  background-color: #F7B03F;
  transition: background-color 0.3s ease;
}

.progress-item-wrapper .item.active {
  background-color: red;
}

/* ============ 进度文字 ============ */
.progress-text {
  margin-top: 0.13rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-text .text {
  line-height: 0.5rem;
  font-size: 0.5rem;
  font-weight: bold;
  color: #FFFFFF;
}

/* ============ 弹窗遮罩层 ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

/* ============ 参与活动弹窗 ============ */
.join-modal {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 0.2rem;
}

.join-modal-inner {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 6rem;
}

.join-modal .modal-bg {
  width: 100%;
  display: block;
}

/* 表单区域 - 绝对定位在背景图底部 */
.join-modal .form-wrapper {
  position: absolute;
  bottom: 0.2rem;
  left: 0;
  right: 0;
  width: 100%;
  height: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.form-item {
  width: 4.5rem;
  max-width: 85%;
  height: 0.6rem;
  margin-top: 0.12rem;
  position: relative;
  display: flex;
  align-items: center;
}

.input-box {
  width: 100%;
  height: 100%;
  border-radius: 0.32rem;
  border: 1px solid #D4D4D4;
  padding: 0 0.32rem;
  font-size: 0.28rem;
  color: #1B1A1F;
  outline: none;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.input-box::placeholder {
  color: #8D94A1;
}

.input-box:focus {
  border-color: #47D4E6;
}

/* 验证码输入框 */
.code-item .input-box {
  padding-right: 1.6rem;
}

.code-btn {
  position: absolute;
  right: -1px;
  top: 0;
  height: 100%;
  padding: 0 0.15rem;
  min-width: 1.5rem;
  border: none;
  border-top-right-radius: 0.32rem;
  border-bottom-right-radius: 0.32rem;
  background-color: #47d4e6;
  color: #fff;
  font-size: 0.24rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.code-btn:active {
  background-color: #3bc4d6;
}

.code-btn.disabled {
  background-color: #EEEEEE;
  color: #8D94A1;
  cursor: not-allowed;
}

.code-btn .countdown {
  color: #47d4e6;
}

.form-action {
  margin-top: 0rem;
}

.submit-btn {
  width: 1.94rem;
  height: 0.6rem;
  border-radius: 0.32rem;
  background-color: rgba(71, 212, 230, 0.5);
  border: none;
  color: #fff;
  font-size: 0.28rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.submit-btn:not(:disabled) {
  background-color: #47D4E6;
}

.submit-btn:not(:disabled):active {
  background-color: #3bc4d6;
}

/* ============ 分享弹窗 ============ */
.share-modal {
  display: flex;
  align-items: center;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  width: 100%;
  padding: 0 0.2rem;
}

.share-modal-inner {
  position: relative;
  max-width: 6rem;
  width: 100%;
}

.share-modal .qr-bg {
  width: 100%;
  display: block;
}

/* 二维码位置 - 与原始保持一致 */
.share-modal .qr-wrapper {
  position: absolute;
  
  bottom: 14%;
  width: 60%;
  height: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
 left: 53%;
 transform: translateX(-50%);
}

.share-modal .qr-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============ Toast 提示 ============ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.2rem 0.4rem;
  border-radius: 0.1rem;
  font-size: 0.28rem;
  z-index: 2000;
  display: none;
  max-width: 80%;
  text-align: center;
  word-break: break-all;
}

.toast.show {
  display: block;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============ Loading ============ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 0.6rem;
  height: 0.6rem;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #47D4E6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============ 安全区域适配 ============ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============ 微信蒙版提示 ============ */
.wechat-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: none;
}

.wechat-mask.show {
  display: block;
}

.wechat-tip {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wechat-tip .arrow {
  width: 0;
  height: 0;
  border-left: 0.2rem solid transparent;
  border-right: 0.2rem solid transparent;
  border-bottom: 0.3rem solid #fff;
  margin-right: 0.3rem;
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.15rem);
  }
}

.wechat-tip .tip-content {
  background-color: #fff;
  border-radius: 0.16rem;
  padding: 0.3rem 0.4rem;
  text-align: center;
}

.wechat-tip .tip-content p {
  margin: 0;
  padding: 0.1rem 0;
  font-size: 0.32rem;
  color: #333;
  line-height: 1.5;
}

.wechat-tip .tip-content strong {
  color: #07C160;
  font-weight: bold;
}
