:root {
  --ink: #eaf7ff;
  --muted: #9db6c6;
  --deep: #04111d;
  --gold: #ffd27a;
  --gold2: #f0a24a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}

/* ---------- 海洋背景 ---------- */
.ocean {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 0%, #1d7f80 0%, #0d4d5c 32%, #072334 66%, #04111d 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  pointer-events: none;
}
.g1 {
  width: 52vw;
  height: 52vw;
  left: -12vw;
  top: -18vw;
  background: radial-gradient(circle, rgba(255, 219, 150, .55), transparent 70%);
}
.g2 {
  width: 46vw;
  height: 46vw;
  right: -10vw;
  bottom: -16vw;
  background: radial-gradient(circle, rgba(80, 220, 210, .30), transparent 70%);
}

.bubble {
  position: absolute;
  border: 1px solid rgba(220, 250, 255, .30);
  border-radius: 50%;
  pointer-events: none;
  animation: float 12s linear infinite;
}
.b1 { width: 14px; height: 14px; left: 12%; bottom: -4%; animation-duration: 14s; }
.b2 { width: 8px; height: 8px; left: 26%; bottom: -6%; animation-duration: 17s; animation-delay: -4s; }
.b3 { width: 18px; height: 18px; left: 72%; bottom: -6%; animation-duration: 19s; animation-delay: -8s; }
.b4 { width: 10px; height: 10px; left: 84%; bottom: -4%; animation-duration: 13s; animation-delay: -2s; }
.b5 { width: 6px; height: 6px; left: 52%; bottom: -4%; animation-duration: 21s; animation-delay: -11s; }

@keyframes float {
  from { transform: translateY(0) scale(.9); opacity: .1; }
  20% { opacity: .65; }
  to { transform: translateY(-118vh) scale(1.05); opacity: 0; }
}

/* ---------- 主卡片 ---------- */
.card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 38px 34px 30px;
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 35, 48, .72), rgba(5, 19, 30, .82));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.logo {
  width: 132px;
  height: 132px;
  border-radius: 30px;
  display: block;
  margin: 0 auto 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .12);
  animation: bob 4.5s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: 1.5px;
  font-weight: 800;
  background: linear-gradient(180deg, #fff7e6 10%, var(--gold) 55%, var(--gold2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 20px rgba(255, 190, 90, .18);
}

.sub {
  margin: 8px 0 26px;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--muted);
}

/* ---------- 下载按钮 ---------- */
.download {
  width: 100%;
  padding: 17px 20px;
  border: 0;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #3a1f05;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe6a9 0%, var(--gold) 38%, var(--gold2) 100%);
  box-shadow:
    0 14px 30px rgba(240, 162, 74, .32),
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -3px 0 rgba(150, 85, 20, .25);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.download:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 20px 38px rgba(240, 162, 74, .42),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -3px 0 rgba(150, 85, 20, .25);
}

.download:active { transform: translateY(1px) scale(.99); }

.download:disabled {
  filter: grayscale(.35) brightness(.85);
  cursor: default;
  transform: none;
}

.meta {
  margin: 16px 0 0;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(170, 200, 214, .75);
}

/* ---------- 密码弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 9, 15, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity .18s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.dialog {
  position: relative;
  width: min(92vw, 380px);
  padding: 30px 26px 24px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(14, 42, 56, .97), rgba(6, 20, 32, .98));
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  transform: translateY(0) scale(1);
  transition: transform .18s ease;
}

.modal.hidden .dialog { transform: translateY(8px) scale(.98); }

.dialog h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: 1px;
}

.hint {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .5px;
}

.close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(220, 240, 250, .65);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input[type="password"]:focus {
  border-color: rgba(255, 210, 122, .7);
  box-shadow: 0 0 0 3px rgba(255, 210, 122, .14);
}

.err {
  min-height: 18px;
  margin: 8px 0 2px;
  font-size: 13px;
  color: #ff9b8a;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.actions button {
  flex: 1;
  padding: 12px 0;
  border-radius: 999px;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.actions button:active { transform: scale(.98); }

.ghost {
  background: rgba(255, 255, 255, .10);
  color: rgba(230, 245, 252, .85);
}
.ghost:hover { background: rgba(255, 255, 255, .16); }

.primary {
  background: linear-gradient(180deg, #ffe6a9, var(--gold2));
  color: #3a1f05;
}
.primary:hover { filter: brightness(1.05); }
.primary:disabled { filter: grayscale(.4) brightness(.8); cursor: default; }

@media (max-width: 420px) {
  .card { padding: 30px 24px 24px; }
  h1 { font-size: 32px; }
  .logo { width: 112px; height: 112px; border-radius: 26px; }
}
