:root {
  --navy: #0b3972;
  --navy-deep: #07265c;
  --cyan: #3bc5f3;
  --cyan-deep: #1992d1;
  --cyan-bright: #27bef1;
  --gold: #ffd317;
  --ink: #455775;
  --muted: #888daa;
  --line: #bcc7d5;
  --bg-top: #e7f2f7;
  --bg-mid: #d9e7f2;
  --bg-bot: #c5d6ea;
  --card: rgba(11, 57, 114, 0.92);
}

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

html, body {
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: "PingFang SC", "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  color: #fff;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(59, 197, 243, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(255, 211, 23, 0.12), transparent 45%),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 45%, var(--bg-bot));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.scene {
  position: relative;
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 2.5rem;
  isolation: isolate;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 180px;
  height: 180px;
  left: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(59, 197, 243, 0.45), transparent 70%);
}

.orb-2 {
  width: 140px;
  height: 140px;
  right: 10%;
  top: 22%;
  background: radial-gradient(circle, rgba(255, 211, 23, 0.28), transparent 70%);
  animation-delay: -2.5s;
}

.orb-3 {
  width: 220px;
  height: 220px;
  left: 18%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(11, 57, 114, 0.22), transparent 70%);
  animation-delay: -4s;
}

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

.card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 2.25rem 1.75rem 1.85rem;
  border-radius: 22px;
  background:
    linear-gradient(165deg, rgba(14, 70, 136, 0.96), rgba(7, 38, 92, 0.98));
  box-shadow:
    0 24px 48px rgba(7, 38, 92, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 40px rgba(39, 190, 241, 0.18);
  text-align: center;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(59, 197, 243, 0.22), transparent 70%);
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  margin: 0 auto 1rem;
  width: min(260px, 88%);
  padding: 0.85rem 1rem 0.7rem;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 0 24px rgba(59, 197, 243, 0.2);
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
  /* Logo 本身偏深蓝，提亮并加淡描边，避免融进卡片 */
  filter:
    brightness(1.18)
    contrast(1.12)
    saturate(1.15)
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55))
    drop-shadow(0 6px 14px rgba(7, 38, 92, 0.18));
}

.slogan {
  position: relative;
  z-index: 1;
  margin: 0 0 1.75rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: rgba(231, 242, 247, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.ring-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 1.35rem;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 6;
}

.ring-bar {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.2s linear;
}

.ring-core {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(59, 197, 243, 0.35), rgba(7, 38, 92, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ring-percent {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.star {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px rgba(255, 211, 23, 0.8));
  animation: twinkle 1.8s ease-in-out infinite;
}

.star-a { top: 8px; right: 10px; animation-delay: 0s; }
.star-b { bottom: 12px; left: 8px; width: 8px; height: 8px; animation-delay: 0.6s; }
.star-c { top: 18px; left: -4px; width: 7px; height: 7px; animation-delay: 1.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.status {
  position: relative;
  min-height: 1.6em;
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.status.is-swap {
  animation: statusIn 0.35s ease;
}

@keyframes statusIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-bright), var(--cyan-deep) 55%, var(--gold));
  box-shadow: 0 0 14px rgba(39, 190, 241, 0.55);
  transition: width 0.2s linear;
}

.hint {
  position: relative;
  font-size: 0.78rem;
  color: rgba(188, 199, 213, 0.9);
}

.footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink);
  opacity: 0.85;
}

/* —— Safari 门禁 —— */
#safari-gate {
  max-width: min(420px, calc(100vw - 30px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid rgba(59, 197, 243, 0.35);
  border-radius: 20px;
  overflow: auto;
  scrollbar-width: thin;
  background:
    radial-gradient(ellipse at bottom left, rgba(39, 190, 241, 0.18), transparent 70%),
    linear-gradient(165deg, #0e4688, #07265c);
  color: #fff;
  box-shadow: 0 24px 48px rgba(7, 38, 92, 0.45);
}

#safari-gate[open] {
  display: block;
  min-height: 0;
}

#safari-gate::backdrop {
  background: rgba(7, 38, 92, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.safari-gate-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.6rem 1.25rem 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
}

.safari-gate-visual img {
  display: block;
  width: min(200px, 72%);
  height: auto;
  filter:
    brightness(1.12)
    contrast(1.08)
    drop-shadow(0 6px 14px rgba(7, 38, 92, 0.16));
}

.safari-gate-content {
  position: relative;
  padding: 0 1.5rem 1.4rem;
  text-align: center;
}

.safari-gate-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  position: relative;
  border: 1px solid rgba(255, 211, 23, 0.55);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan-bright), var(--cyan-deep) 55%, var(--gold));
  color: #07265c;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(39, 190, 241, 0.35);
}

.safari-gate-content h2 {
  margin: 0.9rem 0 0.55rem;
  font-size: 1.35rem;
  line-height: 1.3;
  color: #fff;
}

.safari-gate-content > p {
  margin: 0 auto 1.15rem;
  max-width: 34em;
  color: rgba(231, 242, 247, 0.86);
  font-size: 0.88rem;
  line-height: 1.55;
}

.gate-btn {
  appearance: none;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gate-btn-primary {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(110deg, var(--cyan-bright), var(--cyan-deep) 60%, var(--gold));
  color: #07265c;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(39, 190, 241, 0.35);
}

.gate-btn-primary:hover {
  box-shadow: 0 10px 28px rgba(39, 190, 241, 0.5);
}

.gate-btn-ghost {
  background: rgba(59, 197, 243, 0.12);
  border-color: rgba(59, 197, 243, 0.45);
  color: #e7f2f7;
  white-space: nowrap;
}

.gate-btn-ghost:hover {
  background: rgba(59, 197, 243, 0.22);
  border-color: var(--cyan-bright);
}

.safari-address-row {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
}

.safari-address-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(188, 199, 213, 0.35);
  border-radius: 10px;
  background: rgba(7, 38, 92, 0.55);
  color: #e7f2f7;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  direction: ltr;
  text-align: left;
}

.safari-gate-content #safari-copy-status {
  min-height: 1.4em;
  margin: 0.7rem 0 0;
  color: var(--gold);
  font-size: 0.82rem;
}

@media (max-width: 480px) {
  .card {
    padding: 1.85rem 1.25rem 1.5rem;
    border-radius: 18px;
  }

  .brand {
    width: min(190px, 70%);
  }

  .slogan {
    font-size: 0.84rem;
  }

  .safari-gate-content {
    padding: 0 1.1rem 1.2rem;
  }

  .safari-gate-content h2 {
    font-size: 1.2rem;
  }

  .safari-address-row {
    flex-wrap: wrap;
  }

  .safari-address-row .gate-btn {
    width: 100%;
  }
}
