/* ===========================================================
   手机端页面样式（页面1 / 页面2 / 页面3 共用）
   - 以 390px 宽为设计基准，clamp 流体缩放适配 320~430px+ 机型
   - 使用容器查询单位 cqw：所有元素相对手机画幅缩放，
     PC 预览时不会因视口过宽而失真
   - 适配刘海屏 / 底部手势条（safe-area）
   - 适配横屏矮屏、平板与桌面预览
   =========================================================== */

/* 手机画幅容器：宽屏下保持 480px 居中并呈现设备外框 */
.phone-page {
  container-type: inline-size;
  container-name: phone;
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* 安全区域-insets，PC 上 env() 为 0 */
  padding: calc(var(--sp-5) + var(--safe-t)) calc(var(--sp-4) + var(--safe-r))
           calc(var(--sp-6) + var(--safe-b)) calc(var(--sp-4) + var(--safe-l));
  /* 长内容可滚动：刘海屏/横屏下数据较多时不裁剪，背景光效固定 */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 宽屏（平板 / PC）预览：加圆角设备边框，居中展示 */
@media (min-width: 600px) {
  .phone-page {
    margin: 20px auto;
    min-height: calc(100dvh - 40px);
    border-radius: 32px;
    border: 6px solid #2a0204;
    box-shadow: 0 0 0 2px rgba(255, 208, 110, .25), 0 24px 70px rgba(0, 0, 0, .6);
  }
}

/* ---------- 顶部主视觉 ---------- */
.hero {
  position: relative;
  text-align: center;
  padding-top: clamp(28px, 9cqw, 46px);
  padding-bottom: var(--sp-4);
  flex: 0 0 auto;
}
.hero__title { margin: 0; }
.hero__title span { display: block; }
.hero__subtitle { margin-top: var(--sp-2); }
.hero__notice {
  margin: var(--sp-3) auto 0;
  max-width: 92%;
  color: #ffdca8;
  font-size: var(--fs-xs);
  line-height: 1.7;
  text-shadow: 0 1px 4px rgba(50, 0, 0, .8);
}
.hero--compact { padding-top: clamp(18px, 6cqw, 28px); }

/* ---------- 实时数据卡片 ---------- */
.stats-card {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  flex: 0 0 auto;
}
.stats-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.stats-card__title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-light);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .1em;
}
.stats-card__title .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ffd76a; box-shadow: 0 0 8px #ffd76a;
  animation: blink 1.6s infinite;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-1);
}
.stat { text-align: center; position: relative; min-width: 0; }
.stat + .stat::before {
  content: "";
  position: absolute;
  left: -3px; top: 12%;
  height: 76%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 214, 120, .5), transparent);
}
.stat__value {
  display: block;
  color: var(--gold-text);
  font-size: clamp(17px, 6cqw, 27px);
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(40, 0, 0, .6);
}
.stat__value small { font-size: .55em; font-weight: 600; margin-left: 1px; }
.stat__label {
  display: block;
  margin-top: var(--sp-2);
  color: #e9c29a;
  font-size: var(--fs-2xs);
  letter-spacing: .02em;
  white-space: nowrap;
}

/* 播报条 */
.broadcast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(255, 210, 120, .25);
  min-height: 30px;
  overflow: hidden;
}
.broadcast__tag {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid rgba(255, 216, 130, .6);
  border-radius: 7px;
  color: var(--gold-light);
  font-size: var(--fs-2xs);
}
.broadcast__viewport { flex: 1 1 auto; min-width: 0; overflow: hidden; height: 24px; position: relative; }
.broadcast__text {
  color: #ffe9cb;
  font-size: var(--fs-sm);
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.broadcast__text em { color: var(--gold); font-style: normal; font-weight: 700; }
.broadcast__text.is-enter { animation: floatUp .38s ease both; }

/* ---------- 我的中签数据 ---------- */
.my-result {
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  display: none;
}
.my-result.is-visible { display: block; animation: floatUp .45s ease both; }
.my-result__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  border-bottom: 1px dashed rgba(255, 214, 120, .35);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-2);
}
.my-result__title { color: var(--gold-light); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em; }
.my-result__badge {
  flex: 0 0 auto;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(90deg, #ffe9a8, #e9b23c);
  color: #7c1a05; font-size: var(--fs-2xs); font-weight: 800;
}
.my-result__group {
  margin: 2px 0 var(--sp-2);
  padding-left: 9px;
  border-left: 3px solid var(--gold);
  color: var(--gold-light);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
}
.my-result__group--result { margin-top: var(--sp-3); }
.my-result__rows { display: grid; gap: var(--sp-2); }
.my-result__row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.my-result__row span:first-child { color: #dfbda0; flex: 0 0 auto; }
.my-result__row span:last-child {
  color: #fff1d6; font-weight: 600; text-align: right;
  word-break: break-all; min-width: 0;
}
.my-result__amount { color: #ffd76a !important; font-size: var(--fs-lg) !important; }
.my-result__empty { color: #e9c29a; font-size: var(--fs-sm); text-align: center; padding: 6px 0; }

/* ---------- 底部 CTA ---------- */
.cta-area {
  margin-top: auto;
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-2);
  text-align: center;
  flex: 0 0 auto;
}
.cta-area__hint { margin-top: var(--sp-2); color: #ffd9a8; font-size: var(--fs-2xs); opacity: .85; }

/* ---------- 页面1：宣传落地页 ---------- */
.landing-hero { padding-top: clamp(30px, 12cqw, 58px); text-align: center; }
.landing-hero__eyebrow {
  display: inline-block;
  padding: 5px clamp(12px, 4cqw, 18px);
  border: 1px solid rgba(255, 220, 130, .6);
  border-radius: 999px;
  color: var(--gold-light);
  font-size: var(--fs-xs);
  letter-spacing: .2em;
  margin-bottom: var(--sp-3);
}
.landing-points {
  margin: var(--sp-5) auto 0;
  display: grid;
  gap: var(--sp-2);
  max-width: 92%;
}
.landing-point {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 14px;
  background: rgba(90, 8, 6, .42);
  border: 1px solid rgba(255, 210, 120, .28);
}
.landing-point__no {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffeaa4, #e6ad2e);
  color: #7c1a05; font-weight: 800; font-size: var(--fs-xs);
}
.landing-point__text { color: #ffe6c4; font-size: var(--fs-sm); line-height: 1.5; }

.qr-panel {
  margin: var(--sp-5) auto 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  max-width: min(320px, 88%);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 248, 224, .96), rgba(255, 232, 186, .96));
  border: 2px solid #e7bd5f;
  box-shadow: 0 12px 30px rgba(60, 0, 0, .45);
  text-align: center;
  color: #7a2a08;
}
.qr-panel__label { font-size: var(--fs-sm); font-weight: 800; letter-spacing: .12em; }
.qr-panel__box {
  width: clamp(140px, 44cqw, 176px);
  height: clamp(140px, 44cqw, 176px);
  margin: var(--sp-3) auto var(--sp-2);
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  display: grid; place-items: center;
}
.qr-panel__box img, .qr-panel__box canvas { width: 100%; height: 100%; display: block; }
.qr-panel__fallback { color: #9a7b5c; font-size: var(--fs-2xs); line-height: 1.6; }
.qr-panel__tip { margin-top: 4px; font-size: var(--fs-xs); font-weight: 700; }

/* ---------- 页面3：申购信息表单 ---------- */
.form-card {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-radius: 24px;
  background: linear-gradient(160deg, #fff6e2 0%, #ffedcb 100%);
  border: 2px solid #f0d59a;
  box-shadow: 0 12px 30px rgba(60, 0, 0, .4), inset 0 1px 0 #fff;
  color: var(--ink);
}
.form-card__title {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  margin: 2px 0 var(--sp-3);
  color: #8e1c06;
  font-family: var(--font-calligraphy);
  font-size: clamp(22px, 6.4cqw, 26px);
  font-weight: 700;
}
.form-card__title::before, .form-card__title::after {
  content: "";
  width: clamp(18px, 7cqw, 32px); height: 2px;
  background: linear-gradient(90deg, transparent, #d9a744);
}
.form-card__title::after { background: linear-gradient(90deg, #d9a744, transparent); }
.form-card__notice {
  margin: -4px 0 var(--sp-3);
  color: #9b6a3c;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  text-align: center;
}
.form-card__footer {
  margin-top: 4px;
  color: #9b6a3c;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  text-align: center;
}

/* 提交成功态 */
.success-panel {
  display: none;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}
.success-panel.is-visible { display: block; animation: floatUp .5s ease both; }
.success-panel__icon {
  width: clamp(58px, 18cqw, 72px); height: clamp(58px, 18cqw, 72px);
  margin: 0 auto var(--sp-3);
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #ffeaa4, #e6ad2e);
  color: #7c1a05;
  font-size: clamp(28px, 9cqw, 36px);
  font-weight: 800;
  box-shadow: 0 0 0 10px rgba(255, 214, 106, .12);
  animation: pulseGlow 2s infinite;
}
.success-panel__title { color: var(--gold-text); font-size: var(--fs-xl); font-weight: 800; }
.success-panel__amount { margin-top: var(--sp-2); color: #ffd76a; font-size: clamp(26px, 8cqw, 34px); font-weight: 800; }
.success-panel__desc { margin-top: var(--sp-3); color: #e9c29a; font-size: var(--fs-sm); line-height: 1.7; }

/* ===========================================================
   断点适配
   =========================================================== */

/* 超小屏（≤340px，如 iPhone SE 一代 / 老安卓） */
@container phone (max-width: 340px) {
  .hero { padding-top: 24px; }
  .stat__value { font-size: 16px; }
  .broadcast__tag { padding: 3px 6px; }
}

/* 极小视口兜底（未支持容器查询时） */
@media (max-width: 340px) {
  .phone-page { padding-left: 12px; padding-right: 12px; }
}

/* 大屏手机 / 小平板（≥430px）：适当放大内容，避免留白过多 */
@container phone (min-width: 430px) {
  .hero__notice, .landing-points { max-width: 380px; }
}

/* 横屏矮屏：压缩纵向留白，保证首屏可见核心内容 */
@media (max-height: 500px) and (orientation: landscape) {
  .phone-page { padding-top: calc(12px + var(--safe-t)); padding-bottom: calc(16px + var(--safe-b)); }
  .hero { padding-top: 8px; padding-bottom: 8px; }
  .hero--compact { padding-top: 4px; }
  .hero__notice { margin-top: 6px; }
  .landing-hero { padding-top: 10px; }
  .landing-points { margin-top: 12px; gap: 6px; }
  .landing-point { padding: 6px 12px; }
  .qr-panel { margin-top: 12px; padding: 10px; }
  .qr-panel__box { width: 96px; height: 96px; margin: 8px auto 6px; }
  .cta-area { padding-top: 10px; }
  .gold-btn { min-height: 44px; }
}

/* 置顶安全区补充：状态栏区域留白（iOS 状态栏） */
@supports (padding: env(safe-area-inset-top)) {
  .phone-page { padding-top: calc(var(--sp-5) + var(--safe-t)); }
}
