/* 中明 · 落地页样式
   数值来源：assets/ref 三张参考图逐像素实测（381×678 / 363×678 / 393×672）
   设计基准宽度 381px，容器上限 430px，按 1:1 px 还原。 */

:root {
  --brand: #2C4035;      /* 主按钮 / 底部按钮条 */
  --teal: #026968;       /* 成功页标题 */
  --panel: #F2F2F2;      /* 表单卡片底 */
  --line: #EFEFEF;       /* 输入框描边 */
  --accent: #8FACE4;     /* 獲取驗證碼 按钮 */
  --muted: #8C8C8C;
  --danger: #C62828;
  --ok: #1B6B4A;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  background: #fff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC",
    "Hiragino Sans CNS", "Microsoft JhengHei", "Noto Sans CJK HK", system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid #8FACE4; outline-offset: 2px; }

.screen,
.fscreen,
.sscreen { max-width: 430px; margin: 0 auto; background: #fff; min-height: 100vh; }

/* ---------- 通用按钮 ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 45px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .6px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity .15s, background .15s;
}
.btn:active { opacity: .86; }
.btn[disabled],
.btn.is-busy { opacity: .55; pointer-events: none; }

/* ---------- 页面 1：第一屏 ---------- */

.hero {
  width: 100%;
  height: auto;
  aspect-ratio: 381 / 393;
  object-fit: cover;
  object-position: 50% 100%;
}

.p1 { padding: 0 20px 15px; }

.p1 h1 {
  margin: 26px 0 18px;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: .2px;
}

.p1 p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: .1px;
  word-break: break-word;
}

.p1 .btn { margin-top: 26px; }

/* ---------- 页面 2：登记表单 ---------- */

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

.brandblock { padding: 12px 26px 0; text-align: center; }
.brandblock img { width: 100%; max-width: 330px; margin: 0 auto; }

.f-title {
  margin: 8px 18px 12px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .2px;
}

.panel {
  margin: 0 14px;
  padding: 14px 12px;
  background: var(--panel);
  border-radius: 10px;
}

.logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 22px;
  margin: 0 2px 16px;
}
.logos img { height: 100%; width: auto; object-fit: contain; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  margin-bottom: 10px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color .12s, background .12s;
}
.field:last-child { margin-bottom: 0; }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder { color: #1b1b1b; opacity: 1; }
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field.invalid { border-color: #E7A9A9; background: #FFF9F9; }

.field .tag { display: none; flex: 0 0 auto; height: 18px; margin-left: 8px; }
.field .tag img { height: 100%; width: auto; }
.field.has-brand .tag { display: block; }

.field select {
  flex: 0 0 auto;
  margin: 0 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.field.otp { padding-right: 0; }

.btn-code {
  flex: 0 0 auto;
  min-width: 104px;
  height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.btn-code[disabled] { opacity: .8; cursor: default; }
.btn-code.is-done { background: #A9BBDD; }

.hint {
  min-height: 17px;
  margin: 10px 3px 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--muted);
}
.hint.err { color: var(--danger); }
.hint.ok { color: var(--ok); }

.btnbar {
  margin-top: auto;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* ---------- 页面 3：成功页 ---------- */

.sscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #8FBEDC url("/assets/img/success-bg.png") 50% 100% / cover no-repeat;
}

.sscreen h1 {
  margin: 26px 16px 0;
  color: var(--teal);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
}

.sscreen h2 {
  margin: 9px 16px 0;
  color: var(--teal);
  font-size: 27px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
}

/* ---------- 成功页 · WhatsApp 客服卡 ---------- */

.support {
  width: calc(100% - 40px);
  max-width: 360px;
  margin: auto auto calc(20px + env(safe-area-inset-bottom));
  padding: 18px 16px 14px;
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(12, 40, 60, .18);
  text-align: center;
}

.support-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #16352B;
  letter-spacing: .3px;
}

.support-sub {
  margin: 0 0 13px;
  font-size: 12.5px;
  line-height: 18px;
  color: #5C6B65;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 10px;
  background: #25D366;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(37, 211, 102, .34);
  transition: transform .12s ease, background .18s, box-shadow .18s;
}
.wa-btn:active { transform: scale(.985); }
.wa-btn:focus-visible { outline: 2px solid #128C7E; outline-offset: 2px; }

.wa-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.support-hours {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 16px;
  color: #7B8A84;
}

/* ---------- 第一屏 / 表单页：WhatsApp 悬浮小按钮 ---------- */

[hidden] { display: none !important; }

.wa-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .38);
  transition: transform .14s ease, box-shadow .18s, background .18s;
}
.wa-fab:active { transform: scale(.94); }
.wa-fab-ico { width: 24px; height: 24px; fill: currentColor; }

/* 表单页底部是提交按钮条，抬高一层避免压住 */
.page-form .wa-fab { bottom: calc(70px + env(safe-area-inset-bottom)); }

@media (min-width: 431px) {
  body { background: #ECEEEF; }
  .screen, .fscreen, .sscreen {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 18px 48px rgba(0, 0, 0, .1);
  }
}

/* =====================================================================
   桌面端 / Web 版式（≥900px）
   基准仍是 H5：以上所有规则先按手机竖屏成立，这里只做桌面增强。
   ===================================================================== */
@media (min-width: 900px) {

  /* ---------- 第一屏：左图右文 ---------- */
  body.page-home { background: #fff; }

  .page-home .screen {
    max-width: none;
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    box-shadow: none;
  }

  .page-home .hero {
    width: 100%;
    height: 100vh;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 30% 58%;
  }

  .page-home .p1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 780px;
    padding: 72px clamp(48px, 6vw, 104px);
  }

  .page-home .p1 h1 {
    margin: 0 0 24px;
    font-size: clamp(30px, 2.8vw, 44px);
    line-height: 1.22;
    letter-spacing: .5px;
  }

  .page-home .p1 p {
    max-width: 620px;
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 27px;
    letter-spacing: .2px;
  }

  .page-home .p1 .btn {
    width: 300px;
    height: 52px;
    margin-top: 32px;
    font-size: 15px;
    letter-spacing: 1px;
    transition: background .18s, opacity .15s;
  }
  .page-home .p1 .btn:hover { background: #22352B; }

  /* ---------- 表单：居中白卡 ---------- */
  body.page-form { background: #EDEFF2; }

  .page-form .fscreen {
    max-width: 620px;
    min-height: 0;
    margin: 32px auto 48px;
    padding: 28px 30px 26px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .05);
  }

  .page-form .brandblock { padding: 0 0 4px; }
  .page-form .brandblock img { max-width: 300px; }

  .page-form .f-title {
    margin: 10px 0 18px;
    font-size: 23px;
    line-height: 1.3;
    text-align: center;
  }

  .page-form .panel { padding: 16px; border-radius: 12px; }
  .page-form .logos { height: 23px; margin-bottom: 14px; }

  .page-form .field {
    height: 48px;
    margin-bottom: 10px;
    padding: 0 16px;
    border-radius: 8px;
  }
  .page-form .field input,
  .page-form .field select { font-size: 16px; }
  .page-form .field.otp { padding-right: 0; }

  .page-form .btn-code {
    height: 40px;
    min-width: 126px;
    margin: 0 4px;
    font-size: 14px;
    transition: background .18s;
  }
  .page-form .btn-code:hover:not([disabled]) { background: #7C9EE0; }

  .page-form .hint { margin-top: 11px; font-size: 13px; line-height: 19px; }

  .page-form .btnbar { margin-top: 18px; padding: 0; }
  .page-form .btnbar .btn {
    height: 50px;
    font-size: 15px;
    letter-spacing: 1px;
    transition: background .18s;
  }
  .page-form .btnbar .btn:hover { background: #22352B; }

  /* ---------- 成功页：居中海报 ---------- */
  body.page-success { background: #E7F0F6; }

  .page-success .sscreen {
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .16);
  }

  .page-success .sscreen h1 {
    margin: 76px 20px 0;
    font-size: 40px;
  }

  .page-success .sscreen h2 {
    margin: 12px 20px 0;
    font-size: 33px;
    line-height: 1.2;
  }

  .page-success .support {
    max-width: 400px;
    margin-bottom: 44px;
    padding: 22px 22px 18px;
    border-radius: 18px;
  }

  .page-success .support-title { font-size: 16px; }
  .page-success .support-sub { font-size: 13px; line-height: 19px; margin-bottom: 15px; }

  .page-success .wa-btn {
    height: 52px;
    font-size: 15px;
    transition: transform .12s ease, background .18s, box-shadow .18s;
  }
  .page-success .wa-btn:hover {
    background: #1FBF5B;
    box-shadow: 0 10px 24px rgba(37, 211, 102, .42);
  }
  .page-success .wa-ico { width: 22px; height: 22px; }

  /* ---------- 桌面端客服小按钮 ---------- */
  .wa-fab {
    right: 28px;
    bottom: 28px;
    width: 54px;
    height: 54px;
  }
  .wa-fab-ico { width: 26px; height: 26px; }
  .wa-fab:hover {
    background: #1FBF5B;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(37, 211, 102, .45);
  }
  .page-form .wa-fab { bottom: 28px; }
}
