:root {
  --aqua: #00a9ba;
  --aqua-dark: #007f8d;
  --rose: #eb7183;
  --ink: #1b2d33;
  --muted: #5c6d73;
  --paper: rgba(255, 255, 255, 0.9);
  --paper-strong: #ffffff;
  --line: rgba(0, 169, 186, 0.2);
  --shadow: 0 24px 70px rgba(23, 56, 62, 0.16);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial,
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.7)),
    url("sp_main_background.png") center / cover fixed no-repeat,
    #f4fbfc;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.9)
  );
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin: 16px 0 22px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(30, 72, 78, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  font-weight: 800;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  overflow: hidden;
  place-items: center;
  color: white;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 169, 186, 0.22);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a,
.nav-links button {
  min-width: 58px;
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links button:hover,
.nav-links button:focus-visible {
  color: var(--aqua-dark);
  background: rgba(0, 169, 186, 0.1);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.94fr);
  gap: 30px;
  align-items: center;
  min-height: 78vh;
  padding: 36px 0 62px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.field-label,
.mini-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--aqua-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 740px;
  margin: 18px 0 18px;
  font-size: 4.4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 640px;
  margin: 0 0 28px;
  color: #31464c;
  font-size: 1.16rem;
  line-height: 1.78;
}

.connect-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  max-width: 690px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.connect-panel code {
  display: block;
  min-width: 0;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 1.24rem;
  font-weight: 800;
}

.copy-feedback {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button {
  min-width: 118px;
  padding: 0 18px;
  font-weight: 800;
}

.button:hover,
.button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button.primary {
  color: white;
  background: var(--aqua);
  box-shadow: 0 14px 28px rgba(0, 169, 186, 0.24);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--aqua-dark);
}

.button.secondary {
  color: var(--aqua-dark);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.button.rose-button {
  color: #9d3042;
  border-color: rgba(235, 113, 131, 0.35);
}

.text-link {
  color: var(--aqua-dark);
  font-weight: 800;
}

.action-link {
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--rose);
  outline: none;
}

.status-card {
  min-height: 470px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.status-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-title {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  font-size: 1.08rem;
  font-weight: 900;
}

.status-dot {
  width: 12px;
  height: 12px;
  background: #a9b7bb;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(169, 183, 187, 0.16);
}

.status-dot.online {
  background: var(--aqua);
  box-shadow: 0 0 0 7px rgba(0, 169, 186, 0.14);
}

.status-dot.offline {
  background: var(--rose);
  box-shadow: 0 0 0 7px rgba(235, 113, 131, 0.14);
}

.status-dot.loading {
  animation: pulse 1.25s ease-in-out infinite;
}

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--aqua-dark);
  background: rgba(0, 169, 186, 0.1);
}

.icon-button span {
  font-size: 1.16rem;
  line-height: 1;
}

.player-summary {
  margin: 40px 0 30px;
}

.player-summary strong {
  display: block;
  font-size: 3rem;
  line-height: 1;
}

.player-summary > span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.progress-track {
  position: relative;
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  background: rgba(0, 169, 186, 0.16);
  border-radius: 999px;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--aqua), var(--rose));
  background-size: var(--progress-track-width, 100%) 100%;
  background-repeat: no-repeat;
  border-radius: inherit;
  transition: width 260ms ease;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.status-grid div {
  min-height: 96px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.status-grid dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-grid dd {
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 900;
}

.motd {
  min-height: 56px;
  margin: 20px 0 0;
  padding: 14px 16px;
  color: #31464c;
  line-height: 1.7;
  background: rgba(0, 169, 186, 0.08);
  border-left: 4px solid var(--aqua);
  border-radius: 8px;
}

.info-strip,
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-strip {
  margin: 0 0 74px;
}

.info-strip article,
.details-grid article {
  min-height: 180px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(23, 56, 62, 0.1);
  backdrop-filter: blur(18px);
}

.info-strip h2,
.details-grid h3 {
  margin: 12px 0 10px;
  font-size: 1.3rem;
}

.info-strip p,
.details-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.74;
}

.mini-kicker {
  color: var(--aqua-dark);
}

.mini-kicker.rose {
  color: var(--rose);
}

.details {
  padding-bottom: 64px;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 10px 0 0;
  font-size: 2rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 34px;
  color: var(--muted);
  border-top: 1px solid rgba(0, 169, 186, 0.18);
}

body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 45, 51, 0.38);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius);
  box-shadow: 0 26px 80px rgba(23, 56, 62, 0.24);
}

.modal-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-heading h2 {
  margin: 8px 0 0;
  font-size: 1.7rem;
}

.modal-summary {
  margin: 18px 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.player-list {
  display: grid;
  gap: 10px;
}

.player-row,
.empty-state,
.download-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 169, 186, 0.06);
}

.player-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}

.player-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--aqua), var(--rose));
  border-radius: 8px;
}

.player-avatar img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}

.player-avatar.has-image {
  color: transparent;
  background: rgba(0, 169, 186, 0.1);
}

.player-avatar.has-image img {
  opacity: 1;
}

.player-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.empty-state {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.download-options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.download-option {
  display: grid;
  gap: 7px;
  padding: 16px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.download-option:hover,
.download-option:focus-visible {
  transform: translateY(-1px);
  background: rgba(0, 169, 186, 0.1);
  border-color: rgba(0, 169, 186, 0.38);
  outline: none;
}

.download-option strong {
  font-size: 1.08rem;
}

.download-option span {
  color: var(--muted);
  line-height: 1.6;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.24);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .site-shell {
    width: min(100% - 28px, 760px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 18px;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .status-card {
    min-height: auto;
  }

  .info-strip,
  .details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    background-attachment: scroll;
  }

  .site-shell {
    width: calc(100% - 22px);
  }

  .topbar {
    top: 8px;
    margin-top: 8px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links a,
  .nav-links button {
    min-width: 50px;
    padding: 10px 8px;
  }

  .hero h1 {
    font-size: 2.34rem;
    line-height: 1.08;
  }

  .lead {
    font-size: 1rem;
  }

  .connect-panel {
    grid-template-columns: 1fr;
  }

  .connect-panel .button {
    width: 100%;
  }

  .player-summary strong {
    font-size: 2.36rem;
  }

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

  .modal-panel {
    padding: 18px;
  }
}
