/* ============================================================
   X 前端：登录页门面 + 「通行证」式激活弹窗
   ============================================================ */
:root {
  --ink:     #0f1419;
  --muted:   #536471;
  --muted-2: #7d8a95;
  --blue:    #1d9bf0;
  --blue-d:  #1a8cd8;
  --line:    #eff3f4;
  --border:  #cfd9de;
  --danger:  #f4212e;
  --paper:   #fafbfc;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
body.locked { overflow: hidden; }
button { font-family: inherit; }
svg { display: block; }

/* ============================================================
   一、登录页（门面）
   ============================================================ */
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

.landing-inner {
  width: 100%;
  max-width: 460px;
  padding: calc(40px + env(safe-area-inset-top)) 32px calc(36px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.land-brand { display: flex; justify-content: center; padding-top: 6px; }
.land-brand svg { width: 30px; height: 30px; fill: var(--ink); }

.land-title {
  margin: 88px 0 0;
  font-size: 30px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--ink);
  max-width: 330px;
}

.land-actions {
  margin-top: 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cta {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .06s ease;
}
.cta:hover { background: #f7f9f9; }
.cta:active { transform: scale(.995); background: #eff3f4; }
.cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.cta .ico { width: 19px; height: 19px; flex: 0 0 auto; }
.cta .ico.apple { width: 20px; height: 20px; fill: var(--ink); }

.cta-solid {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.cta-solid:hover { background: #272c30; border-color: #272c30; }
.cta-solid:active { background: #3b4043; }

.land-or {
  display: flex;
  align-items: center;
  margin: 6px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.land-or::before, .land-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.land-or span { padding: 0 12px; }

.land-legal {
  margin: 22px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  letter-spacing: .1px;
}
.land-legal a, .ticket-legal a { color: var(--blue); text-decoration: none; }
.land-legal a:hover, .ticket-legal a:hover { text-decoration: underline; }

.land-signin {
  margin: 24px 0 0;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.land-signin button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue);
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.land-signin button:hover { text-decoration: underline; }

/* ============================================================
   二、激活弹窗 —— 通行证 / 票据造型
   ============================================================ */
.gate-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: rgba(15, 20, 25, .42);
  opacity: 0;
  transition: opacity .22s ease;
}
.gate-mask[hidden] { display: none; }
.gate-mask.on { opacity: 1; }

.ticket {
  position: relative;
  width: min(444px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border-radius: 22px;
  padding: 28px 30px 26px;
  box-shadow:
    0 1px 4px rgba(15, 20, 25, .07),
    0 36px 80px -30px rgba(15, 20, 25, .48);
  transform: translateY(15px) scale(.978);
  transition: transform .3s cubic-bezier(.2, .85, .25, 1);
  will-change: transform;
}
.gate-mask.on .ticket { transform: none; }

/* 顶部品牌渐变条 */
.ticket-ribbon {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, #1d9bf0 0%, #58cdf2 46%, #8ef0d6 100%);
}

.ticket-x {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #93a1ad;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ticket-x svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.1; stroke-linecap: round; }
.ticket-x:hover { background: #f1f4f6; color: var(--ink); }
.ticket-x:active { background: #e6ebef; }

.ticket-body { display: block; }

/* 眉标 */
.ticket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding-right: 34px;
}
.ticket-mark { color: var(--ink); }
.ticket-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ticket-mark svg circle { fill: currentColor; stroke: none; }
.ticket-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #a2aeb8;
}

/* 标题区（左对齐是刻意的，与常见弹窗区分开） */
.ticket-h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--ink);
}
.ticket-sub {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #6b7a86;
}

/* 输入：带 KEY 前缀的序列号输入条 */
.ticket-form { margin-top: 24px; }

.keybox {
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 6px;
  border: 1.5px solid #e3e9ee;
  border-radius: 13px;
  background: var(--paper);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.keybox-pre {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: #eaeff3;
  color: #8493a0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}
.keybox input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: .085em;
  text-transform: uppercase;
  text-align: left;
}
.keybox input::placeholder {
  color: #b5c0c9;
  font-weight: 400;
  letter-spacing: .07em;
}
.keybox:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 155, 240, .12);
}
.keybox.is-bad {
  border-color: var(--danger);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(244, 33, 46, .10);
}

/* 输入进度：一条细线，随字符填充 */
.keybar {
  height: 2px;
  margin: 9px 2px 0;
  border-radius: 2px;
  background: #eef2f5;
  overflow: hidden;
}
.keybar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), #58cdf2);
  transition: width .15s ease;
}

/* 图形验证码 */
.cap { margin-top: 14px; }
.cap[hidden] { display: none; }
.cap-row { display: flex; gap: 10px; align-items: stretch; }
.cap-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 12px;
  border: 1.5px solid #e3e9ee;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none;
}
.cap-row input::placeholder { letter-spacing: 0; font-weight: 400; font-size: 14px; color: #b5c0c9; }
.cap-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29, 155, 240, .12); }
.cap-row input:disabled { background: #f4f6f8; color: #98a6ad; }
.cap-row img {
  width: 128px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  object-fit: cover;
  display: block;
}
.cap-hint { margin: 7px 0 0; font-size: 11.5px; color: #a2aeb8; }

.msg {
  min-height: 16px;
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--danger);
}

/* 主按钮：方角矩形式（不是胶囊），带箭头 */
.ticket-go {
  width: 100%;
  height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, transform .07s ease;
}
.ticket-go svg {
  width: 17px; height: 17px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .18s ease;
}
.ticket-go:hover { background: #232a31; }
.ticket-go:hover svg { transform: translateX(3px); }
.ticket-go:active { transform: scale(.99); }
.ticket-go:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ticket-go[disabled] { opacity: .6; cursor: default; }

/* 次级入口 */
.ticket-alt {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #7d8a95;
}
.ticket-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ticket-link:hover { text-decoration: underline; }

/* 条款：虚线分隔，像票根下缘 */
.ticket-legal {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px dashed #e6ecf1;
  font-size: 11.5px;
  line-height: 1.7;
  color: #93a1ad;
  text-wrap: balance;
}

/* 校验失败：整张票抖一下 */
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* 成功态：整块替换掉表单区 */
.ticket-body.is-done .ticket-head,
.ticket-body.is-done #intro,
.ticket-body.is-done .ticket-form,
.ticket-body.is-done .ticket-alt,
.ticket-body.is-done .ticket-legal { display: none; }

.ticket-done {
  text-align: center;
  padding: 26px 0 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .38s ease, transform .38s ease;
  cursor: pointer;              /* 整块可点，点了就跳 */
  -webkit-tap-highlight-color: transparent;
}
.ticket-done[hidden] { display: none; }
.ticket-done.in { opacity: 1; transform: none; }

.tick svg { width: 62px; height: 62px; display: inline-block; }
.tick-c {
  fill: none; stroke: var(--blue); stroke-width: 2.4;
  stroke-dasharray: 150; stroke-dashoffset: 150;
  animation: draw .62s ease forwards;
}
.tick-p {
  fill: none; stroke: var(--blue); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw .42s .42s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.done-t { margin: 16px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.4px; color: var(--ink); }
.done-s { margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; color: #6b7a86; }
.done-go {
  margin: 20px auto 0;
  height: 50px;
  padding: 0 26px;
  border-radius: 13px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, transform .07s ease;
}
.done-go:hover { background: #232a31; }
.done-go:active { transform: scale(.98); }
.done-go svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.done-note { margin: 13px 0 0; font-size: 11.5px; color: #a2aeb8; }

/* 自动跳转被打断时：按钮转蓝 + 呼吸光圈 + 提示变强调色，告诉用户「点这里」 */
.ticket-done.is-stuck .done-go {
  background: var(--blue);
  animation: goPulse 1.5s ease-in-out infinite;
}
@keyframes goPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 155, 240, .5); }
  55%      { box-shadow: 0 0 0 13px rgba(29, 155, 240, 0); }
}
.ticket-done.is-stuck .done-note {
  color: var(--blue);
  font-weight: 600;
  font-size: 12.5px;
}

.bar { height: 3px; width: 120px; margin: 20px auto 0; background: #eef2f5; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; animation: fill 2.9s .15s linear forwards; }
@keyframes fill { to { width: 100%; } }

/* ============================================================
   三、获取激活码 弹层
   ============================================================ */
.mini {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(15, 20, 25, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade .2s ease;
}
.mini[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.mini-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 26px 24px 20px;
  text-align: center;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .45);
  animation: pop .3s cubic-bezier(.2, .85, .25, 1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

.mini-card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.mini-body { color: var(--muted); font-size: 14px; line-height: 1.75; word-break: break-word; user-select: all; }
.mini-go {
  width: 100%; height: 48px; margin-top: 18px;
  border-radius: 12px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 650; text-decoration: none;
}
.mini-close {
  width: 100%; height: 48px; margin-top: 10px;
  border-radius: 12px; border: 1px solid var(--border); background: #fff;
  color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer;
}

/* 客服弹窗 */
.mini-kefu { padding-top: 30px; }
.kefu-avatar {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.mini-kefu h3 { margin-bottom: 10px; }
.kefu-qr {
  width: 168px; max-width: 62%;
  margin: 16px auto 0;
}
.kefu-qr img {
  width: 100%; height: auto; display: block;
  border-radius: 10px; border: 1px solid var(--border);
}

/* ============================================================
   四、响应式
   ============================================================ */
@media (max-width: 520px) {
  .landing-inner { padding-left: 26px; padding-right: 26px; }
  .land-title { font-size: 27px; margin-top: 72px; }
  .land-actions { margin-top: 60px; }

  .gate-mask { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .ticket { border-radius: 20px; max-height: calc(100dvh - 24px); padding: 24px 20px 22px; }
  .ticket-ribbon { border-radius: 20px 20px 0 0; }
  .ticket-head { margin-bottom: 20px; }
  .ticket-h1 { font-size: 22px; }
  .ticket-sub { font-size: 13.5px; margin-top: 8px; }
  .ticket-form { margin-top: 20px; }
  .keybox { height: 54px; border-radius: 12px; }
  .keybox input { font-size: 15.5px; letter-spacing: .06em; }
  .ticket-go { height: 50px; margin-top: 16px; border-radius: 12px; }
  .ticket-legal { margin-top: 17px; padding-top: 14px; font-size: 11px; }
  .cap-row input { height: 46px; font-size: 16px; border-radius: 11px; }
  .cap-row img { width: 112px; height: 46px; border-radius: 10px; }
  .ticket-done { padding-top: 18px; }
}

@media (min-width: 900px) {
  body.landing-body {
    background: radial-gradient(120% 55% at 50% 0%, #f4f7f9 0%, #ffffff 62%);
  }
  .landing { align-items: center; }
  .landing-inner { padding-top: 0; padding-bottom: 0; }
  .land-title { font-size: 32px; margin-top: 76px; max-width: 372px; }
  .land-actions { margin-top: 72px; }
}

@media (max-height: 700px) {
  .ticket { padding-top: 22px; padding-bottom: 18px; }
  .ticket-head { margin-bottom: 16px; }
  .ticket-form { margin-top: 16px; }
  .ticket-go { margin-top: 14px; }
  .ticket-legal { margin-top: 14px; padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
