/* 栖梦岛 · 官网样式 —— 浮空岛粉彩卡通风 */

:root {
  --sky: #C8E7FF;
  --sky-deep: #9DCBF5;
  --sky-soft: #E8F6FF;
  --cream: #FFF8EC;
  --ink: #3D4B5C;
  --ink-soft: #6B7A8C;
  --coral: #FF8FA3;
  --coral-deep: #E8785A;
  --sun: #FFD966;
  --mint: #7EDDB9;
  --lav: #C9B6F5;
  --line: #E3D4C4;
  --shadow-sticker: 4px 4px 0 rgba(61, 75, 92, 0.12);
  --shadow-lift: 8px 10px 0 rgba(61, 75, 92, 0.14);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shell: 1080px;
  --font-display: 'Yuanti SC', 'YouYuan', '幼圆', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 45%, var(--sky-soft) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

/* ---------- 天空装饰 ---------- */

.sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 248, 236, 0.75);
  border-radius: 999px;
  filter: blur(0.2px);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-a {
  width: 140px;
  height: 44px;
  top: 12%;
  left: -160px;
  animation: drift 48s linear infinite;
}

.cloud-a::before {
  width: 60px;
  height: 60px;
  top: -28px;
  left: 24px;
}

.cloud-a::after {
  width: 46px;
  height: 46px;
  top: -18px;
  left: 70px;
}

.cloud-b {
  width: 180px;
  height: 52px;
  top: 38%;
  left: -200px;
  animation: drift 64s linear infinite;
  animation-delay: -20s;
  opacity: 0.65;
}

.cloud-b::before {
  width: 72px;
  height: 72px;
  top: -34px;
  left: 30px;
}

.cloud-b::after {
  width: 54px;
  height: 54px;
  top: -22px;
  left: 90px;
}

.cloud-c {
  width: 120px;
  height: 40px;
  top: 70%;
  left: -140px;
  animation: drift 56s linear infinite;
  animation-delay: -35s;
  opacity: 0.5;
}

.cloud-c::before {
  width: 52px;
  height: 52px;
  top: -24px;
  left: 20px;
}

.cloud-c::after {
  width: 40px;
  height: 40px;
  top: -16px;
  left: 62px;
}

.spark {
  position: absolute;
  color: rgba(255, 217, 102, 0.85);
  font-size: 18px;
  animation: twinkle 4s ease-in-out infinite;
}

.spark-a { top: 18%; right: 12%; animation-delay: 0s; }
.spark-b { top: 52%; right: 6%; animation-delay: 1.2s; font-size: 14px; }
.spark-c { top: 28%; left: 8%; animation-delay: 2s; font-size: 12px; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 240px)); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 头部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(255, 248, 236, 0.72);
  border-bottom: 2px solid rgba(227, 212, 196, 0.7);
}

#games,
#about,
#contact {
  scroll-margin-top: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-shadow: 1px 2px 0 rgba(61, 75, 92, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(255, 143, 163, 0.18);
  transform: translateY(-1px);
}

.nav-admin {
  border: 2px solid var(--line);
  background: var(--cream);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  padding: 48px 0 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding-bottom: 48px;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-shadow: 3px 4px 0 rgba(61, 75, 92, 0.12);
}

.tagline {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(61, 75, 92, 0.12);
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  text-shadow: 0 1px 0 rgba(61, 75, 92, 0.15);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #ff9fb1;
}

.btn-ghost {
  background: var(--cream);
}

.hero-art {
  display: grid;
  place-items: center;
}

.island {
  width: min(100%, 420px);
  height: auto;
  filter: drop-shadow(8px 12px 0 rgba(61, 75, 92, 0.1));
}

.island-float {
  animation: bob 5s ease-in-out infinite;
  transform-origin: center;
}

/* ---------- 波浪 ---------- */

.wave {
  line-height: 0;
  position: relative;
  z-index: 2;
}

.wave svg {
  width: 100%;
  height: 70px;
  display: block;
}

.wave-bottom {
  margin-top: -1px;
}

.about-section {
  background: transparent;
}

.wave-bottom-cream {
  background: var(--cream);
}

/* ---------- 区块 ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: 72px 0 80px;
}

.games-section {
  background: var(--cream);
  padding-top: 16px;
}

.about-section {
  padding-top: 40px;
}

.about-copy h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 2px 3px 0 rgba(61, 75, 92, 0.08);
}

.announcement {
  margin: 0 auto 28px;
  max-width: 720px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 217, 102, 0.35);
  border: 2.5px dashed var(--line);
  text-align: center;
  font-weight: 600;
}

/* ---------- 游戏卡片 ---------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.games-loading,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-soft);
  font-weight: 600;
}

.game-card {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sticker);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: rise-in 0.5s ease both;
}

.game-card:nth-child(2) { animation-delay: 0.08s; }
.game-card:nth-child(3) { animation-delay: 0.16s; }
.game-card:nth-child(4) { animation-delay: 0.24s; }
.game-card:nth-child(5) { animation-delay: 0.32s; }
.game-card:nth-child(6) { animation-delay: 0.4s; }

@media (hover: hover) {
  .game-card:hover {
    transform: translateY(-8px) rotate(-1.5deg) scale(1.02);
    box-shadow: var(--shadow-lift);
  }
}

.game-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.game-cover-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--sky-soft);
  cursor: pointer;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.game-cover-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cover-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.cover-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.cover-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.cover-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.cover-dots-manual {
  pointer-events: auto;
  bottom: 14px;
}

.cover-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid rgba(61, 75, 92, 0.25);
  padding: 0;
  cursor: default;
}

.cover-dots-manual .cover-dot {
  width: 10px;
  height: 10px;
  cursor: pointer;
}

.cover-dot.is-active {
  background: var(--cream);
  transform: scale(1.15);
}

.cover-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: rgba(255, 248, 236, 0.92);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 2px 2px 0 rgba(61, 75, 92, 0.12);
  transition: background 0.15s ease, transform 0.15s ease;
}

.cover-nav:hover,
.cover-nav:focus-visible {
  background: var(--coral);
  color: #fff;
}

.cover-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.cover-nav-prev { left: 12px; }
.cover-nav-next { right: 12px; }

.game-card:hover .game-cover-btn img {
  transform: scale(1.04);
}

.cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 217, 102, 0.7), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(126, 221, 185, 0.6), transparent 40%),
    linear-gradient(160deg, var(--sky), var(--lav));
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.game-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--sky-soft);
}

.tag:nth-child(3n + 2) { background: rgba(201, 182, 245, 0.35); }
.tag:nth-child(3n + 3) { background: rgba(126, 221, 185, 0.35); }

.game-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.game-title button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.game-title button:hover,
.game-title button:focus-visible {
  color: var(--coral-deep);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

.game-tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  min-height: 2.8em;
}

.game-links {
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px dashed rgba(227, 212, 196, 0.9);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.text-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--coral-deep);
  border-bottom-color: var(--coral);
}

.game-play {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--coral-deep);
  text-decoration: none;
  margin-left: auto;
}

.game-play:hover,
.game-play:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 关于 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.about-text {
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 32em;
}

.value-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.value-card {
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sticker);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  transition: transform 0.2s ease;
}

.value-card:hover {
  transform: translateX(4px) rotate(0.4deg);
}

.value-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: 2.5px solid var(--line);
  font-size: 22px;
}

.value-card:nth-child(2) .value-icon { background: var(--coral); color: #fff; }
.value-card:nth-child(3) .value-icon { background: var(--mint); }

.value-card h3 {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.value-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--sky-deep);
  padding: 36px 0 48px;
  border-top: 3px solid rgba(61, 75, 92, 0.08);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.footer-brand p,
.footer-meta p {
  margin: 6px 0 0;
  color: rgba(61, 75, 92, 0.8);
  font-size: 14px;
}

.footer-meta {
  text-align: right;
}

.footer-meta a {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- 弹窗 ---------- */

.game-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(640px, calc(100vw - 32px));
  width: 100%;
}

.game-dialog::backdrop {
  background: rgba(61, 75, 92, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-card {
  position: relative;
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(61, 75, 92, 0.12);
}

.dialog-close:hover,
.dialog-close:focus-visible {
  background: var(--coral);
  color: #fff;
}

.dialog-cover {
  aspect-ratio: 16 / 9;
  background: var(--sky-soft);
  overflow: hidden;
  position: relative;
}

.dialog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-cover .cover-stage {
  width: 100%;
  height: 100%;
}

.dialog-cover .cover-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-body {
  padding: 22px 24px 26px;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dialog-body h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.dialog-tagline {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.dialog-desc {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 15px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

button.text-link {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

button.text-link:hover,
button.text-link:focus-visible {
  color: var(--coral-deep);
  border-bottom-color: var(--coral);
}

.notice-dialog {
  max-width: min(480px, calc(100vw - 32px));
}

.notice-body {
  padding: 28px 28px 30px;
}

.notice-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(255, 217, 102, 0.55);
  border: 2px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.notice-body h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.notice-content {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 动效降级 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .cloud,
  .spark,
  .island-float,
  .game-card,
  .cover-slide {
    animation: none !important;
    transition: none !important;
  }

  .btn,
  .game-card,
  .game-cover-btn img,
  .value-card {
    transition: none !important;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-art {
    order: -1;
  }

  .island {
    width: min(100%, 340px);
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, var(--shell));
  }

  .header-inner {
    min-height: 60px;
  }

  .nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .brand-text {
    font-size: 18px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    text-align: left;
  }

  .section {
    padding: 56px 0 64px;
  }
}

@media (max-width: 380px) {
  .nav a:not(.nav-admin) {
    display: none;
  }
}
