/* Sprunky · 共享样式（变量 / 基础组件 / 角色动画 / 弹窗 / 页脚） */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --cream: #fff7e8;
  --cream-2: #ffefd6;
  --ink: #2e2547;
  --ink-soft: #6f6689;
  --card: #ffffff;
  --orange: #ff9f43;
  --orange-deep: #e8831f;
  --red: #ff6b6b;
  --blue: #4dabf7;
  --green: #51cf66;
  --purple: #b197fc;
  --pink: #ff8cc8;
  --lime: #a9e34b;
  --yellow: #ffd43b;
  --radius: 28px;
  --shadow-soft: 0 10px 0 rgba(46, 37, 71, 0.09);
  --font: "Baloo 2", "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(rgba(46, 37, 71, 0.055) 1.5px, transparent 1.6px),
    radial-gradient(circle at 10% 6%, rgba(255, 159, 67, 0.2), transparent 42%),
    radial-gradient(circle at 90% 10%, rgba(177, 151, 252, 0.2), transparent 40%),
    radial-gradient(circle at 50% 102%, rgba(81, 207, 102, 0.16), transparent 46%);
  background-size: 22px 22px, auto, auto, auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.logo-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--orange);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  transform: rotate(-6deg);
}

/* ---------- 主导航 ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: background 0.14s ease, color 0.14s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(46, 37, 71, 0.08);
}

.site-nav a.is-current {
  color: #fff;
  background: var(--ink);
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    padding: 14px 18px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding: 2px 0;
  }

  .site-nav a {
    padding: 7px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  padding: 17px 28px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  text-shadow: 0 2px 0 rgba(46, 37, 71, 0.22);
}

.btn-primary:hover {
  background: #ffab5c;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.85);
}

.btn-xl {
  font-size: 24px;
  padding: 22px 44px;
  border-radius: 26px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: 0 6px 0 rgba(46, 37, 71, 0.4);
}

/* ---------- 角色 ---------- */
.char-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  filter: drop-shadow(0 5px 8px rgba(46, 37, 71, 0.1));
}

.char-bob {
  animation: char-bob 3.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.22s);
  transform-origin: 50% 100%;
}

@keyframes char-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

.char-jump {
  animation: char-jump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes char-jump {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-24px) scale(1.04, 0.96);
  }
  60% {
    transform: translateY(0) scale(0.94, 1.06);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.char-shake {
  animation: char-shake 0.4s ease;
}

@keyframes char-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  25% {
    transform: translateX(-7px) rotate(-3deg);
  }
  75% {
    transform: translateX(7px) rotate(3deg);
  }
}

/* ---------- 弹窗 ---------- */
.modal {
  width: min(440px, calc(100vw - 40px));
  border: 4px solid var(--ink);
  border-radius: 36px;
  padding: 32px 28px 28px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 16px 0 rgba(46, 37, 71, 0.18);
  text-align: center;
}

.modal::backdrop {
  background: rgba(46, 37, 71, 0.35);
  backdrop-filter: blur(5px);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream-2);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

.modal-close:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.modal-char {
  width: 128px;
  margin: -8px auto 4px;
}

.modal-tag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  background: rgba(255, 159, 67, 0.18);
  color: var(--orange-deep);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 900;
}

.modal h3 em {
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  color: var(--ink-soft);
  margin-left: 6px;
}

.modal-intro {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.modal-quote {
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 900;
}

.modal .btn {
  width: 100%;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  padding: 14px 24px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
  max-width: calc(100vw - 40px);
  text-align: center;
}

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

/* ---------- 页脚 ---------- */
.site-footer {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 28px 24px 36px;
  border-top: 3px dashed rgba(46, 37, 71, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

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