
:root {
  /* 使用CSS变量定义基础尺寸 */
  --base-font-size: clamp(14px, 4vw, 20px); /* 字体在 14px~20px 间弹性变化 */
  --base-size: 1rem;
  --spacing: calc(var(--base-size) * 0.5);
  --radius: calc(var(--base-size) * 0.5);
  --input-height: calc(var(--base-size) * 2.5);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}
html {
  font-size: var(--base-font-size); /* 使用智能适配的基础字体大小 */
}
/* 基础重置与适配 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "微软雅黑", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  padding: 5vw;
  text-align: center;
  background-repeat: no-repeat;
 background-position: center;
  background-size: cover;
  justify-content: center;
  align-items: center; 
}


/* 通用容器样式 - 透明背景版本 */
.container,
.result-container {
  width: 92vw;
  max-width: 380px;
  min-width: 280px;
  margin: auto;
  background: transparent; /* 修改为完全透明 */
  border-radius: var(--radius);
  padding: var(--spacing);
  /* 移除白色背景的阴影 */
  box-shadow: none; 
}


/* LOGO 样式 */
.logo {
  text-align: center;
  margin-bottom: var(--spacing);
}

.logo img {
  height: calc(var(--base-size) * 2.75);
  max-height: 44px;
}

/* 输入框组样式 */
.form-group {
  margin-bottom: var(--spacing);
}

.form-group label {
  display: block;
  font-size: calc(var(--base-size) * 0.875);
  color: #333;
  margin-bottom: calc(var(--spacing) * 0.75);
}

.form-group input {
  width: 100%;
  height: var(--input-height);
  font-size: calc(var(--base-size) * 0.875);
  padding: 0 calc(var(--spacing) * 1.5);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: #4169e1;
}

/* 验证码行样式 */
.code-row {
  display: flex;
  gap: var(--spacing);
}

.code-row button {
  width: calc(var(--base-size) * 6.25);
  height: var(--input-height);
  background: linear-gradient(90deg, #4169e1, #6488ff);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: calc(var(--base-size) * 0.875);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.code-row button:hover {
  opacity: 0.9;
}

/* 协议勾选样式 */
.agreement {
  display: flex;
  align-items: center;
  font-size: calc(var(--base-size) * 0.75);
  color: #666;
  margin-bottom: var(--spacing);
}

.agreement input {
  width: calc(var(--base-size) * 0.875);
  height: calc(var(--base-size) * 0.875);
  margin-right: calc(var(--spacing) * 0.5);
  accent-color: #4169e1;
}

.agreement a {
  color: #4169e1;
  text-decoration: none;
}

/* 提交按钮样式 - 完全无边框无闪动版本 */
.submit-btn {
  width: 100%;
  height: calc(var(--input-height) + 0.25rem);
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  
  /* 关键属性 - 彻底去除所有状态下的边框 */
  -webkit-tap-highlight-color: transparent; /* 移除iOS点击高亮 */
  -webkit-touch-callout: none; /* 禁用长按菜单 */
  user-select: none; /* 防止文字选中 */
  
  /* 覆盖所有可能的状态样式 */
  &:focus, &:active, &:hover {
    outline: none;
    box-shadow: none;
    border: none;
    background: transparent;
  }
}

/* 图片样式确保无干扰 */
.submit-btn-img {
  width: 60%;
  max-width: 200px;
  height: auto;
  border-radius: var(--radius);
  pointer-events: none;
}
/* 结果页特定样式 */
.title {
  font-size: calc(var(--base-size) * 1.25);
  color: #000;
  font-weight: bold;
  margin-bottom: var(--spacing);
  text-shadow: 0 2px 3px rgba(255, 255, 255, 0.8);
}

.prize-wrap {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% auto;
  width: 90%;
  max-width: 340px;
  padding: var(--spacing);
  margin-bottom: var(--spacing);
}

.prize-content {
  font-size: calc(var(--base-size) * 0.875);
  color: #333;
  line-height: 1.7;
}

.exchange-btn {
  display: inline-block;
  width: calc(var(--base-size) * 7.5);
  height: var(--input-height);
  line-height: var(--input-height);
  font-size: calc(var(--base-size) * 0.875);
  border-radius: var(--radius);
  margin-bottom: var(--spacing);
  cursor: pointer; /* 添加手型光标 */

}

.download-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  padding: var(--spacing);
  border-radius: var(--radius);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.download-bar img {
  height: calc(var(--base-size) * 2);
  margin-right: var(--spacing);
}

.download-text .app-name {
  font-size: calc(var(--base-size) * 0.875);
  font-weight: 600;
}

.download-text .slogan {
  font-size: calc(var(--base-size) * 0.75);
}

.download-link {
  margin-left: auto;
  font-size: calc(var(--base-size) * 0.875);
}
/* 验证码输入框特定样式 */
#code {
  letter-spacing: normal; 
  text-indent: 0.5em; /* 补偿letter-spacing导致的偏移 */
  font-family: "PingFang SC", "微软雅黑", sans-serif;
}

/* 无效状态样式 */
.invalid {
  border-color: #ff4d4f !important;
  background-color: #fff1f0;
  animation: shake 0.5s;
}

/* 输入完成时的有效状态 */
#code:valid {
  border-color: #52c41a;
  background-color: #f6ffed;
}

/* 抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}


/* 卷轴区域优化 */
.scroll-container {
  position: relative;
  width: 90%;
  max-width: 380px;
  margin: 0 auto 20px;
}

.scroll-bg {
  width: 100%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}
/* 中奖标题 */
.prize-title {
  margin-bottom: 1.5rem;
}

.prize-title img {
  width: 80%;
  max-width: 300px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.scroll-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20% 8%;
  /* 隐藏中间框框 */
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* "获得"文字样式 */
.prize-desc {
  font-size: 1.4rem;
    font-weight: bold;
    color: #FF0000;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(255, 0, 0, 0.3);
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* 奖品描述文字样式 */
.prize-item {
  font-size: 1.0rem;
    font-weight: bold;
    color: #800080;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 8px rgba(128, 0, 128, 0.2);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}


/* 兑换码样式 */
.prize-code {
    font-size: 0.8rem;
    font-weight: bold;
    color: #0000FF;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 6px rgba(0, 0, 255, 0.2);
    letter-spacing: 1px;
    margin-top: 10px;
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    transform: translateY(-10px);
    margin-bottom: 1.2rem;
}

/* 兑换码截止时间样式 */
.prize-validDate {
    font-size: 0.6rem;
    font-weight: lighter;
    color: #000000;
    /* text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 6px rgba(0, 0, 255, 0.2); */
    letter-spacing: 1px;
    margin-top: -0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    transform: translateY(-10px);
    margin-bottom: 1.2rem;
}
.bold-text {
  font-weight: bold;
}


/* 星星装饰 */
.scroll-content::before,
.scroll-content::after {
  content: "★";
  position: absolute;
  font-size: 2.5rem;
  color: #ffd700; /* 金色 */
  top: 50%;
  transform: translateY(-30%);
  animation: twinkle 2s infinite alternate;
}


.scroll-content::before {
  left: 4%;
  top: 50%; /* 调整初始位置 */
  animation-delay: 0.3s;
}

.scroll-content::after {
  right: 11%;
  top: 11%;
  animation-delay: 0.6s;
}

@keyframes twinkle {
  0% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
  100% { opacity: 1; transform: translateY(-50%) scale(1.1); }
}


/* 城市景观固定在底部 - 取消透明 */
.cityscape {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  object-position: center bottom;
  z-index: 0; /* 关键修改 */
  filter: drop-shadow(0 -2px 5px rgba(0, 0, 0, 0.2));
  cursor: pointer;
  /* 确保没有其他干扰属性 */
  pointer-events: auto !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* 星星装饰优化 */
.star {
  position: absolute;
  font-size: 1.8rem;
  animation: twinkle 2s infinite alternate;
  animation-delay: var(--delay);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  /* 更明显的星星效果 */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

@keyframes twinkle {
  0% { opacity: 0; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1.1) rotate(10deg); }
  100% { opacity: 0; transform: scale(1.3) rotate(-10deg); }
}

/* 下载栏位置调整 */
.download-bar-img {
  width: 90%;
  max-width: 340px;
  margin: 20px auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative; /* 确保在景观图上方 */
  z-index: 1;
}

.download-bar-img:hover {
  transform: scale(1.02);
}

 /* 错误提示容器样式（居中显示） */
.error-message {
  /* 核心定位逻辑保留 */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 320px; /* 适配移动端，更紧凑 */
  padding: 24px 16px; /* 调整内边距，让文案呼吸感更好 */
  
  /* 背景融合：用毛玻璃+渐变，呼应页面柔和风格 */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.92), 
    rgba(255, 255, 255, 0.85)
  );
  backdrop-filter: blur(12px); /* 毛玻璃效果，增强融合感 */
  -webkit-backdrop-filter: blur(12px); /* Safari 兼容 */
  
  border-radius: 20px; /* 更大圆角，贴合页面柔和调性 */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); /* 更淡的阴影，不突兀 */
  
  /* 文字细节优化 */
  font-size: 1rem; /* 适配移动端阅读 */
  color: #555; /* 深灰文字，比#333更柔和 */
  text-align: center;
  line-height: 1.6; /* 增加行高，长文案更易读 */
  letter-spacing: 0.3px; /* 字间距微调，更精致 */
  
  display: none; /* 默认隐藏 */
  overflow: hidden; /* 防止内容溢出 */
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); /* 丝滑过渡 */
  opacity: 0; /* 配合动画，替代display直接隐藏 */
  transform: translate(-50%, -50%) scale(0.95);
}

/* 显示状态动画 */
.error-message.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1); /* 显示时增强阴影层次感 */
}

/* 小屏幕适配（如iPhone SE） */
@media (max-width: 320px) {
  .error-message {
    font-size: 0.9rem;
    padding: 20px 12px;
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .error-message {
    background: linear-gradient(135deg, 
      rgba(50, 50, 50, 0.9), 
      rgba(30, 30, 30, 0.9)
    );
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

 /* 弹窗样式 */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.7);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }

    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .modal-container {
      width: 90%;
      max-width: 500px;
      max-height: 80vh;
      background-color: white;
      border-radius: 10px;
      overflow: hidden;
      transform: translateY(20px);
      transition: transform 0.3s ease;
    }

    .modal-overlay.active .modal-container {
      transform: translateY(0);
    }

    .modal-header {
      padding: 1rem;
      background-color: #f5f5f5;
      border-bottom: 1px solid #e0e0e0;
      position: relative;
    }

    .modal-title {
      font-size: 1.1rem;
      font-weight: bold;
      text-align: center;
      margin: 0;
    }

    .modal-close {
      position: absolute;
      top: 50%;
      right: 1rem;
      transform: translateY(-50%);
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: #666;
      width: 2rem;
      height: 2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background-color 0.2s;
    }

    .modal-close:hover {
      background-color: #e0e0e0;
    }

    .modal-content {
      padding: 1rem;
      overflow-y: auto;
      max-height: calc(80vh - 6rem);
      font-size: 0.9rem;
      line-height: 1.6;
    }

    /* 协议内容样式优化 */
    .agreement-content h1 {
      font-size: 1.2rem;
      margin: 1.5rem 0 1rem;
      color: #333;
      font-weight: bold;
    }
    
    .agreement-content h2 {
      font-size: 1.1rem;
      margin: 1.2rem 0 0.8rem;
      color: #444;
      font-weight: bold;
    }
    
    .agreement-content p {
      margin: 0.8rem 0;
      text-align: justify;
    }
    
    .agreement-content .paragraph-indent {
      text-indent: 2em;
    }

    /* 进度条样式 */
    .progress-container {
      padding: 0 1rem 1rem;
      background-color: #f5f5f5;
      border-top: 1px solid #e0e0e0;
    }

    .progress-bar {
      height: 6px;
      background-color: #e0e0e0;
      border-radius: 3px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background-color: #4169e1;
      width: 0%;
      transition: width 0.1s linear;
    }
	
	
	 /* 动态设置 html 的 font-size */
    html {
      font-size: 16px;
    }
    
    @media screen and (max-width: 320px) {
      html {
        font-size: 14px;
      }
    }
    
    @media screen and (min-width: 414px) and (max-width: 480px) {
      html {
        font-size: 17px;
      }
    }
    
    @media screen and (min-width: 481px) and (max-width: 768px) {
      html {
        font-size: 18px;
      }
    }
    
    @media screen and (min-width: 769px) {
      html {
        font-size: 20px;
      }
    }
	
	/* 全局容器：移除最小宽度限制，用相对单位自适应 */
.container, .result-container {
  min-width: unset; /* 取消320px硬限制，适配极端小屏 */
  width: 92vw; /* 用vw替代固定值，随屏幕等比缩放 */
  max-width: clamp(300px, 90vw, 500px); /* 大屏上限放宽至500px，避免空旷 */
  padding: clamp(10px, 4vw, 20px); /* 内边距随屏幕动态变化 */
}

/* 表单与间距：小屏更紧凑，大屏更舒展 */
.form-group, .agreement {
  margin-bottom: clamp(8px, 3vw, 16px); /* 间距动态调整 */
}

/* 卷轴区域：在小屏缩小比例，避免溢出 */
.scroll-container {
  width: clamp(80%, 85vw, 380px); /* 宽度随屏幕自适应 */
}
/* 根字体：结合clamp和dpr（设备像素比）动态计算 */
:root {
  --base-font-size: clamp(12px, 3.5vw, 18px); /* 缩小下限，适配小屏阅读 */
}

/* 辅助文本：确保小屏清晰可见 */
.agreement, .prize-validDate {
  font-size: calc(var(--base-font-size) * 0.85); /* 相对根字体缩放，保持比例 */
}

/* 按钮与输入框：统一触摸热区 */
.form-group input, .code-row button, .submit-btn {
  min-width: 44px;
  min-height: 44px; /* 符合iOS触摸规范，避免热区过小 */
}

/* 验证码按钮：小屏防文字溢出 */
.code-row button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* 文字过长时省略，不换行 */
}
/* 背景图：确保全尺寸覆盖且不变形 */
body {
  background-size: cover;
  background-position: center top; /* 从顶部开始显示，避免内容被底部景观遮挡 */
}
