:root {
  --bg: #120404;
  --card: rgba(95, 18, 12, 0.72);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #fff7f2;
  --muted: rgba(255, 243, 235, 0.75);
  --primary: #f13c1d;
  --primary-strong: #ff5a36;
  --shadow: 0 30px 80px rgba(15, 4, 4, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 130, 92, 0.16), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(255, 69, 27, 0.3), transparent 30%),
    linear-gradient(145deg, #220706 0%, #120404 58%, #090202 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.55;
}

.ambient-left {
  left: -110px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(255, 100, 74, 0.5), transparent 70%);
}

.ambient-right {
  top: -90px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 166, 102, 0.35), transparent 70%);
}

.card {
  position: relative;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 32px;
  padding: 44px;
  border: 1px solid var(--card-border);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.app-logo,
.wechat-logo {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(255, 76, 48, 0.25);
}

.eyebrow {
  margin: 28px 0 12px;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: rgba(255, 218, 204, 0.78);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
}

.subtitle,
.panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.subtitle {
  max-width: 42ch;
  margin-top: 18px;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 143, 110, 0.35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 121, 85, 0.2), rgba(255, 69, 28, 0.08));
  box-shadow: 0 14px 30px rgba(255, 76, 48, 0.12);
}

.invite-row[hidden] {
  display: none !important;
}

.invite-code {
  margin: 0;
  color: rgba(255, 236, 227, 0.92);
  font-size: 17px;
  font-weight: 700;
}

.invite-copy-button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff4ef, #ffd9cc);
  color: #7d2011;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 24px rgba(255, 160, 133, 0.18);
}

.invite-copy-button:hover {
  transform: translateY(-1px);
}

.invite-copy-button:focus-visible {
  outline: 2px solid #ffd1c3;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255, 188, 168, 0.28);
}

.desktop-panel,
.mobile-panel {
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.desktop-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.mobile-panel {
  display: none;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 240px;
  height: 240px;
  padding: 18px;
  border-radius: 28px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.qr-canvas {
  color: #24110d;
  text-align: center;
  line-height: 1.5;
  font-size: 14px;
}

.qr-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-fallback-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.panel-title {
  margin: 20px 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.text-link {
  margin-top: 14px;
  color: #ffd5c7;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 213, 199, 0.45);
}

.text-link:hover {
  color: #fff5f0;
}

.text-link,
.download-button,
.ghost-button,
.secondary-link {
  outline: none;
}

.text-link:focus-visible,
.download-button:focus-visible,
.ghost-button:focus-visible,
.secondary-link:focus-visible {
  outline: 2px solid #ffd1c3;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255, 188, 168, 0.28);
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.download-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 18px 32px rgba(241, 60, 29, 0.28);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.download-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

#device-tip {
  margin-top: 16px;
}

.noscript-tip {
  margin-top: 16px;
}

.noscript-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-link {
  color: #ffd5c7;
  text-decoration: none;
}

.wechat-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.wechat-overlay.hidden {
  display: none;
}

.wechat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 3, 3, 0.8);
  backdrop-filter: blur(8px);
}

.wechat-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 22px 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 98, 65, 0.22), rgba(25, 9, 9, 0.96));
  box-shadow: var(--shadow);
  text-align: center;
}

.corner-arrow {
  position: absolute;
  top: -12px;
  right: 10px;
  font-size: 40px;
  font-weight: 700;
}

.wechat-dialog h2 {
  margin: 18px 0 10px;
  font-size: 28px;
}

.wechat-dialog p {
  margin: 0 0 18px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 768px) {
  .page-shell {
    padding: 18px;
  }

  .card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 20px;
    border-radius: 28px;
  }

  .hero {
    align-items: center;
    text-align: center;
  }

  .eyebrow {
    margin-top: 20px;
  }

  .subtitle {
    max-width: none;
  }

  .desktop-panel {
    display: none;
  }

  .mobile-panel {
    display: block;
  }

  .app-logo,
  .wechat-logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
  }

  .wechat-dialog h2 {
    font-size: 24px;
  }
}
