:root {
  color-scheme: light;
  --card-bg: rgba(255, 255, 255, 0.18);
  --card-bg-hover: rgba(255, 255, 255, 0.28);
  --card-border: rgba(255, 255, 255, 0.42);
  --text-main: rgba(255, 255, 255, 0.96);
  --text-soft: rgba(255, 255, 255, 0.78);
  --shadow-card: 0 20px 55px rgba(31, 16, 92, 0.24);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.30) 0, rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.20) 0, rgba(255, 255, 255, 0) 24%),
    linear-gradient(135deg, #00c4ff 0%, #3676ff 42%, #9d1bb2 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(0.5px);
  pointer-events: none;
}

body::before {
  width: 36vw;
  height: 36vw;
  min-width: 300px;
  min-height: 300px;
  left: -12vw;
  bottom: -13vw;
  background: rgba(255, 255, 255, 0.04);
}

body::after {
  width: 28vw;
  height: 28vw;
  min-width: 240px;
  min-height: 240px;
  right: -9vw;
  top: 9vh;
  background: rgba(255, 255, 255, 0.08);
}

.homepage-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 42px) 0 clamp(24px, 4vh, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 3vh, 34px);
}

.top-feature {
  width: 100%;
  display: flex;
  justify-content: center;
}

.featured-card {
  width: min(214px, calc(100vw - 48px));
}

.launcher-panel {
  width: 100%;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: clamp(24px, 3vw, 38px);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 26px 80px rgba(31, 16, 92, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px) saturate(142%);
  -webkit-backdrop-filter: blur(10px) saturate(142%);
}

.launcher-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 26px);
}

.featured-card,
.launcher-card a {
  position: relative;
  min-height: clamp(156px, 16vw, 206px);
  padding: clamp(16px, 2vw, 24px) 12px clamp(14px, 1.8vw, 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.3vw, 16px);
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: clamp(20px, 2.4vw, 30px);
  background: linear-gradient(160deg, rgba(255,255,255,0.26), rgba(255,255,255,0.10));
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.50);
  overflow: hidden;
  transform: translateZ(0);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.featured-card {
  min-height: clamp(136px, 12vw, 166px);
}

.featured-card::before,
.launcher-card a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 18%, rgba(255,255,255,0.34), rgba(255,255,255,0) 34%);
  opacity: 0.9;
  pointer-events: none;
}

.featured-card img,
.featured-card span,
.launcher-card img,
.launcher-card span {
  position: relative;
  z-index: 1;
}

.featured-card img,
.launcher-card img {
  width: clamp(78px, 8vw, 122px);
  height: clamp(78px, 8vw, 122px);
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 10px 18px rgba(31, 16, 92, 0.22));
  transition: transform 180ms ease, filter 180ms ease;
}

.featured-card img {
  width: clamp(72px, 7vw, 104px);
  height: clamp(72px, 7vw, 104px);
}

.featured-card span,
.launcher-card span {
  max-width: 100%;
  color: var(--text-main);
  font-size: clamp(15px, 1.38vw, 19px);
  font-weight: 700;
  line-height: 1.28;
  text-shadow: 0 2px 5px rgba(31, 16, 92, 0.56), 0 0 12px rgba(31, 16, 92, 0.26);
  overflow-wrap: anywhere;
}

.featured-card:hover,
.launcher-card a:hover {
  transform: translateY(-7px) scale(1.025);
  background: linear-gradient(160deg, rgba(255,255,255,0.34), rgba(255,255,255,0.16));
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: 0 26px 66px rgba(31, 16, 92, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.featured-card:hover img,
.launcher-card a:hover img {
  transform: scale(1.08);
  filter: drop-shadow(0 14px 22px rgba(31, 16, 92, 0.30));
}

.featured-card:active,
.launcher-card a:active {
  transform: translateY(-2px) scale(0.99);
}

.featured-card:focus-visible,
.launcher-card a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.84);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .homepage-shell {
    width: min(920px, calc(100% - 28px));
  }

  .launcher-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .homepage-shell {
    width: min(100% - 22px, 680px);
    justify-content: flex-start;
    padding-top: 22px;
  }

  .featured-card {
    width: min(154px, 48vw);
  }

  .launcher-panel {
    padding: 14px;
    border-radius: 24px;
  }

  .launcher-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .featured-card,
  .launcher-card a {
    min-height: 132px;
    padding: 14px 8px 12px;
    border-radius: 20px;
  }

  .featured-card img,
  .launcher-card img {
    width: 72px;
    height: 72px;
  }

  .featured-card span,
  .launcher-card span {
    font-size: 13.5px;
  }
}

@media (max-width: 380px) {
  .homepage-shell {
    width: calc(100% - 16px);
  }

  .launcher-panel {
    padding: 10px;
  }

  .launcher-grid {
    gap: 9px;
  }

  .featured-card,
  .launcher-card a {
    min-height: 118px;
  }

  .featured-card img,
  .launcher-card img {
    width: 62px;
    height: 62px;
  }

  .featured-card span,
  .launcher-card span {
    font-size: 12.5px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .homepage-shell {
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 14px;
  }

  .featured-card {
    width: min(150px, 28vw);
  }

  .featured-card,
  .launcher-card a {
    min-height: 104px;
    gap: 8px;
  }

  .featured-card img,
  .launcher-card img {
    width: 58px;
    height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-card,
  .featured-card img,
  .launcher-card a,
  .launcher-card img {
    transition: none;
  }
}
