/* --- 基础重置 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden; /* 单屏不可滚动 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #ffffff;
  background: #020009;
  background-image: url("../img/bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- 页面主体布局 --- */
.page {
  height: 100vh;
  /* 适配 iOS 底部安全区域 */
  height: calc(100vh - env(safe-area-inset-bottom));
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 61%, rgba(70, 13, 111, 0.58) 0 12px, transparent 13px),
    radial-gradient(145px 145px at -4% 78%, rgba(55, 15, 95, 0.82) 0%, rgba(55, 15, 95, 0.68) 55%, transparent 56%),
    radial-gradient(130px 130px at 91% 101%, rgba(52, 24, 95, 0.58) 0%, transparent 70%),
    radial-gradient(112px 112px at 82% 67%, rgba(36, 10, 73, 0.66) 0%, transparent 70%),
    linear-gradient(180deg, rgba(11, 18, 41, 0.18) 0%, rgba(62, 47, 83, 0.34) 34%, rgba(23, 0, 56, 0.96) 54%, #070016 100%);
  display: none;
}

.header {
  display: flex;
  align-items: center;
  gap: 0;
  position: absolute;
  top: min(360px, 100vw);
  left: 50%;
  z-index: 2;
  width: min(170px, 47.22vw);
  height: min(63px, 17.5vw);
  padding: 0;
  color: transparent;
  background: url("../img/2.png") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translateX(-50%);
}

.header .app-icon,
.header .app-title {
  display: none;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.app-title-main {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.app-title-sub {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  color: #151515;
}

.hero {
  position: absolute;
  top: min(459px, 127.5vw);
  left: 0;
  right: 0;
  z-index: 2;
  display: block;
  min-height: auto;
  text-align: center;
}

.hero-title-image {
  width: min(219px, 60.83vw);
  max-width: none;
  clip-path: none;
  filter: none;
}

.hero-image-wrapper {
  display: none;
}

.hero-main-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

/* --- 底部下载按钮容器 --- */
.main-download-wrapper {
  position: absolute;
  top: min(611px, 169.7vw);
  left: 50%;
  z-index: 10;
  width: min(303px, 84.17vw);
  padding: 0 !important;
  margin: 0;
  text-align: center;
  transform: translateX(-50%);
}

.download-btn-img-style {
  position: relative;
  display: block;
  width: 100% !important;
  height: auto;
  max-width: none;
  overflow: visible;
  border: 0 !important;
  border-radius: 0;
  background: none !important;
  padding: 0 !important;
  cursor: pointer;
  transition: transform 0.1s;
  outline: none;
  box-shadow: none;
}

.download-btn-img-style:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.download-btn-img-style img {
  display: block !important;
  width: 100% !important;
  height: auto;
}

.download-btn-img-style::before {
  content: none;
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: -2px;
  width: 50px;
  background: #020202 url("../img/logo.png") center / 34px 34px no-repeat;
  border-radius: 13px 0 0 13px;
}

.download-btn-img-style::after {
  content: none;
  position: absolute;
  inset: 0 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
}

/* --- 固定底部文字 --- */
.footer {
  display: none;
}

.tagline {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.download-btn-img {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  z-index: 10;
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  cursor: pointer;
}

/* --- 底部弹出层 (重点整合部分) --- */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
  z-index: 20;
}

.download-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 420px;
  height: 85vh; /* 增加高度以容纳步骤内容 */
  background: #ffffff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
  color: #111;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.25s ease-out;
}

/* 弹出层头部 */
.download-sheet-header {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #eee;
}

.sheet-back-btn {
  display: flex;
  align-items: center;
  font-size: 17px;
  color: #888;
  cursor: pointer;
}

.sheet-back-arrow {
  font-size: 24px;
  margin-right: 4px;
}

/* 弹出层主体内容 */
.download-sheet-body {
  flex: 1;
  padding: 15px 15px;
  overflow-y: auto; /* 允许内容过多时滚动 */
  text-align: center;
}

/* 步骤数字与标题 */
.step-item {
  margin-bottom: 12px;
}

.step-title-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 6px;
}

.step-number {
  font-size: 52px;
  font-weight: 900;
  color: #e61f2d;
  line-height: 1; /* 微调行高 */
  margin-right: 6px;
  position: relative; /* 必须：作为渐变条的定位基准 */
  z-index: 1; /* 确保数字在渐变条上方 */
}

/* 还原 Rectangle 31.png 的底部阴影效果 */
.step-number::after {
  content: "";
  position: absolute;
  bottom: 7px;      /* 调整垂直位置，压住数字底部 */
  left: 40%;        /* 从数字偏左位置开始 */
  width: 110px;     /* 渐变条长度 */
  height: 12px;     /* 渐变条高度 */
  background: linear-gradient(to right, #f15a72 0%, rgba(255, 255, 255, 0) 100%);
  z-index: -1;      /* 放在数字后面 */
  border-radius: 2px;
  pointer-events: none;
}

.step-text-title {
  font-size: 22px;
  font-weight: bold;
  color: #e61f2d;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 14px;
  color: #111;
  line-height: 1.4;
  font-weight: 500;
  padding: 0 10px;
}

.pink-text {
  color: #ff5c7c;
}

/* 黄色提示框 */
.yellow-notice {
  background: #fce571;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0;
  font-weight: bold;
}

.red-bold {
  color: #e61f2d;
  text-decoration: underline;
}

/* 模拟系统弹窗 */
.mock-ios-dialog {
  background: #f1f1f2;
  border-radius: 14px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 0.5px solid #d1d1d6;
}

.dialog-content {
  padding: 18px 16px;
  border-bottom: 0.5px solid #c8c8cc;
}

.dialog-main-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #000;
}

.dialog-sub-title {
  font-size: 13px;
  color: #000;
}

.dialog-buttons {
  display: flex;
}

.dialog-buttons div {
  flex: 1;
  padding: 12px 0;
  font-size: 17px;
  color: #007aff;
}

.btn-confirm {
  border-right: 0.5px solid #c8c8cc;
  font-weight: 600;
  position: relative;
}

/* 图片中的红色指引框效果 */
.btn-confirm::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 3px solid #e61f2d;
  border-radius: 6px;
  pointer-events: none;
}

/* 立即下载大按钮 */
.sheet-download-btn-wrap {
  padding: 10px 0 30px;
}

.orange-download-btn {
  background: linear-gradient(180deg, #ffae61 0%, #ff6b44 100%);
  background-color: transparent; /* 确保清除 button 默认色 */
  border: none;                  /* 确保没有边框 */
  color: white;
  padding: 14px;
  border-radius: 50px;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 15px rgba(255, 107, 68, 0.4);
}

.down-icon {
  background-color: transparent !important;
  margin-left: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 打开状态控制 --- */
body.sheet-open .sheet-mask {
  opacity: 1;
  pointer-events: auto;
}

body.sheet-open .download-sheet {
  transform: translate(-50%, 0);
}

/* --- 响应式适配 --- */
@media (min-width: 480px) {
  .page {
    max-width: 360px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.75);
  }
}
