:root {
  color-scheme: light;
  --page-bg: #f8f7f9;
  --text: #242331;
  --muted: #706b7b;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.66);
  --line: rgba(255, 255, 255, 0.5);
  --card-line: rgba(57, 45, 82, 0.09);
  --shadow: 0 26px 90px rgba(55, 26, 63, 0.18), 0 8px 30px rgba(55, 26, 63, 0.1);
  --card-shadow: 0 8px 24px rgba(37, 28, 56, 0.09);
  --accent: #d12072;
  --accent-2: #7b45ec;
  --success: #1b9b6b;
  --button-bg: rgba(255, 255, 255, 0.76);
  --focus: #503bd6;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px 48px;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  transition: color 240ms ease, background-color 240ms ease;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 42%);
  outline-offset: 3px;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(255, 72, 83, 0.86), rgba(255, 187, 48, 0.78) 42%, rgba(65, 211, 213, 0.82)),
    var(--page-bg);
  transition: filter 400ms ease;
}

.aurora::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image: radial-gradient(rgba(255, 255, 255, 0.38) 0.8px, transparent 0.8px);
  background-size: 9px 9px;
  opacity: 0.18;
  mix-blend-mode: soft-light;
}

.aurora__blob {
  position: absolute;
  width: 48vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.72;
  will-change: transform;
}

.aurora__blob--one {
  top: -18vw;
  left: -12vw;
  background: #ffec45;
  animation: drift-one 15s ease-in-out infinite alternate;
}

.aurora__blob--two {
  top: 20vh;
  right: -16vw;
  background: #ff435d;
  animation: drift-two 18s ease-in-out infinite alternate;
}

.aurora__blob--three {
  bottom: -26vw;
  left: 28vw;
  background: #49e3d7;
  animation: drift-three 20s ease-in-out infinite alternate;
}

.floating-controls {
  position: fixed;
  top: 26px;
  right: 24px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 22px rgba(50, 34, 68, 0.13);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, background-color 180ms ease;
}

.round-button::before {
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff7a8, #ffab23 48%, #ff6c32 78%);
  box-shadow: 0 0 22px rgba(255, 169, 34, 0.7);
  content: "";
}

.round-button__icon {
  position: relative;
  z-index: 1;
  color: #7a4300;
  font-size: 12px;
  font-weight: 900;
}

#music-button::before {
  background: radial-gradient(circle at 40% 38%, #e8f8ff, #8ae4ee 45%, #9d7af1 84%);
  box-shadow: 0 0 22px rgba(100, 213, 232, 0.56);
}

#music-button .round-button__icon {
  color: #33266f;
  font-size: 14px;
}

.round-button:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255, 255, 255, 0.5);
}

.round-button.is-active {
  animation: control-pulse 1.4s ease-in-out infinite alternate;
}

.app-shell {
  width: min(900px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 15px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(125%);
}

.hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 0 10px 12px;
  text-align: center;
}

.rocket-mark {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 25px;
  background: var(--surface-strong);
  box-shadow: 0 10px 32px rgba(103, 74, 143, 0.12);
  animation: rocket-float 3.6s ease-in-out infinite;
}

.rocket-mark svg {
  width: 74px;
  height: 74px;
}

h1 {
  margin: 25px 0 3px;
  background: linear-gradient(90deg, #ff3d53, #f08b1b, #35b961, #179bdd, #694acb, #ca1f82);
  background-size: 500% 500%;
  background-clip: text;
  color: transparent;
  font-size: clamp(1.85rem, 5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 0.045em;
  animation: rainbow 8s ease infinite;
}

.hero__eyebrow,
.section-heading__kicker {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.instructions {
  margin-top: 15px;
  padding: 20px 15px 20px 35px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: left;
}

.instructions ol {
  margin: 0;
  padding-left: 1.15rem;
}

.instructions li {
  margin: 4px 0;
  padding-left: 1px;
  line-height: 1.55;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(214, 53, 119, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(183, 39, 103, 0.06);
}

.mini-link:hover {
  border-color: rgba(214, 53, 119, 0.3);
  background: rgba(255, 255, 255, 0.86);
}

.accounts-section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  padding: 0 3px 12px;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.demo-badge {
  display: inline-flex;
  max-width: min(52vw, 280px);
  min-height: 26px;
  padding: 3px 10px;
  overflow: hidden;
  align-items: center;
  border: 1px solid rgba(99, 71, 180, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.account-card {
  position: relative;
  padding: 18px 15px 15px;
  overflow: hidden;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--card-shadow);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.account-card::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 2px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, transparent, rgba(133, 86, 239, 0.48), transparent);
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.account-card:hover {
  transform: translateY(-3px);
  border-color: rgba(115, 75, 211, 0.15);
  box-shadow: 0 13px 30px rgba(37, 28, 56, 0.13);
}

.account-card:hover::before {
  opacity: 1;
}

.account-email {
  overflow: hidden;
  color: #30404d;
  font-size: 0.96rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta {
  display: flex;
  margin: 10px 0 13px;
  padding-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  border-bottom: 1px dashed rgba(42, 34, 57, 0.12);
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success), transparent 84%);
  content: "";
}

.source-tag {
  display: inline-flex;
  max-width: 9em;
  padding: 2px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #8a67f2), transparent 88%);
  color: color-mix(in srgb, var(--text, #2a2239), white 12%);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.copy-button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 10px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(44, 35, 59, 0.13);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.copy-button:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background: linear-gradient(135deg, #7661df, #c34896);
  color: white;
}

.copy-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.loading-state,
.error-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 11px;
  color: var(--muted);
}

.loading-state[hidden],
.error-state[hidden],
.accounts-grid[hidden] {
  display: none;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(108, 72, 199, 0.16);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.error-state button {
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-2);
  color: white;
  cursor: pointer;
  font-weight: 750;
}

.usage-note {
  display: flex;
  margin-top: 18px;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid rgba(122, 96, 50, 0.1);
  border-radius: 12px;
  background: rgba(255, 243, 196, 0.38);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.usage-note p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: 26px;
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  transform: translate(50%, 22px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(34, 28, 43, 0.88);
  color: white;
  box-shadow: 0 10px 34px rgba(24, 16, 32, 0.24);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translate(50%, 0);
  opacity: 1;
}

body.dark-mode {
  color-scheme: dark;
  --page-bg: #15131d;
  --text: #f7f3fb;
  --muted: #bbb4c6;
  --surface: rgba(23, 21, 31, 0.84);
  --surface-strong: rgba(37, 34, 48, 0.88);
  --surface-soft: rgba(34, 31, 44, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --card-line: rgba(255, 255, 255, 0.09);
  --shadow: 0 26px 90px rgba(9, 6, 16, 0.45), 0 8px 30px rgba(9, 6, 16, 0.25);
  --card-shadow: 0 8px 24px rgba(7, 5, 12, 0.25);
  --button-bg: rgba(255, 255, 255, 0.07);
}

body.dark-mode .aurora {
  filter: brightness(0.48) saturate(1.28);
}

body.dark-mode .account-email {
  color: #f3eff8;
}

body.dark-mode .mini-link {
  background: rgba(255, 255, 255, 0.07);
  color: #ff84b7;
}

body.dark-mode .usage-note {
  background: rgba(94, 74, 26, 0.18);
}

body.dark-mode #theme-button::before {
  background: radial-gradient(circle at 60% 40%, #f2edff, #baa5ff 45%, #7356c8 84%);
  box-shadow: 0 0 22px rgba(161, 130, 255, 0.55);
}

body.dark-mode #theme-button .round-button__icon {
  color: #36277b;
}

@keyframes rainbow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes rocket-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes drift-one {
  to { transform: translate(14vw, 18vh) scale(1.12); }
}

@keyframes drift-two {
  to { transform: translate(-15vw, 12vh) scale(0.88); }
}

@keyframes drift-three {
  to { transform: translate(8vw, -16vh) scale(1.08); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes control-pulse {
  to { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.15), 0 8px 22px rgba(50, 34, 68, 0.13); }
}

@media (max-width: 720px) {
  body {
    padding: 20px 10px 30px;
  }

  .app-shell {
    width: 100%;
    padding: 22px 12px 16px;
    border-radius: 19px;
  }

  .floating-controls {
    top: 12px;
    right: 13px;
  }

  .round-button {
    width: 42px;
    height: 42px;
  }

  .hero {
    padding-top: 8px;
  }

  .rocket-mark {
    width: 88px;
    height: 88px;
  }

  .rocket-mark svg {
    width: 65px;
    height: 65px;
  }

  .instructions {
    padding: 17px 12px 17px 30px;
    font-size: 0.92rem;
  }

  .accounts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .floating-controls {
    flex-direction: row;
  }

  .section-heading {
    align-items: center;
  }

  .account-actions {
    gap: 8px;
  }

  .copy-button {
    padding: 8px 5px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
