:root {
  --ink: #3a2b2c;
  --ink-soft: #7d6868;
  --accent: #c1121f;
  --accent-dark: #8f0710;
  --card: rgba(255, 252, 251, 0.87);
}

* { box-sizing: border-box; }

html { background: #e8cfcf; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 26px);
  padding: clamp(20px, 4vw, 48px);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景：整张插画铺满屏幕，柔化处理当作氛围底图 */
.background {
  position: fixed;
  inset: -8%;
  z-index: 0;
  background: url("assets/background.jpg") center 24% / cover no-repeat;
  filter: blur(16px) saturate(1.03) brightness(1.05);
  transform: scale(1.04);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(115% 85% at 50% 8%, rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(74, 30, 34, 0.10) 0%, rgba(74, 30, 34, 0.30) 100%);
  pointer-events: none;
}

.card {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  padding: clamp(26px, 4vw, 42px) clamp(20px, 4vw, 40px) clamp(22px, 3.4vw, 32px);
  border-radius: 30px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 26px 60px -20px rgba(74, 24, 30, 0.50),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  text-align: center;
  animation: rise 0.75s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.portrait {
  width: clamp(128px, 30vw, 164px);
  aspect-ratio: 1 / 1;
  margin: 0 auto clamp(16px, 2.2vw, 22px);
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow:
    0 12px 28px -10px rgba(120, 24, 34, 0.55),
    0 0 0 1px rgba(193, 18, 31, 0.18);
  animation: float 7s ease-in-out infinite;
}

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

.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 10px 0 12px;
  font-size: clamp(24px, 4.6vw, 31px);
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.desc {
  margin: 0 auto;
  max-width: 35ch;
  font-size: clamp(14px, 2.2vw, 15.5px);
  line-height: 1.8;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(20px, 2.8vw, 26px);
  padding: 15px 30px;
  border-radius: 999px;
  font-size: clamp(15px, 2.4vw, 16.5px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, #d81b2b, var(--accent) 55%, var(--accent-dark));
  box-shadow:
    0 16px 30px -14px rgba(150, 10, 22, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.38) inset;
  transition: transform 0.22s cubic-bezier(0.22, 0.8, 0.24, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 22px 38px -16px rgba(150, 10, 22, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.38) inset;
}

.btn:active { transform: translateY(0) scale(0.99); }

.btn:focus-visible {
  outline: 3px solid rgba(193, 18, 31, 0.45);
  outline-offset: 3px;
}

.icon { width: 20px; height: 20px; flex: none; }

.meta {
  margin: clamp(16px, 2.4vw, 22px) 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.meta-link {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted rgba(125, 104, 104, 0.7);
  padding-bottom: 1px;
}

.meta-link:hover { color: var(--accent); border-bottom-color: rgba(193, 18, 31, 0.6); }

.dot { margin: 0 6px; opacity: 0.6; }

.footer {
  position: relative;
  z-index: 2;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(74, 30, 34, 0.85);
  background: rgba(255, 252, 251, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@media (max-width: 420px) {
  .card { border-radius: 24px; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .portrait { animation: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
/* ============ 内嵌小游戏：贪吃蛇 ============ */
.game-card { width: min(520px, 100%); }

.game-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.game-title { margin: 8px 0 0; font-size: 19px; letter-spacing: 0.01em; }

.game-scores {
  flex: none;
  display: flex;
  gap: 16px;
  padding-top: 2px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.game-scores strong {
  font-size: 19px;
  line-height: 1.3;
  color: var(--accent);
}

.game-tip {
  margin: 14px 0 0;
  text-align: left;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.game-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #d81b2b, var(--accent) 55%, var(--accent-dark));
  box-shadow:
    0 14px 26px -14px rgba(150, 10, 22, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.24, 1), filter 0.2s ease;
}

.game-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.game-btn:active { transform: translateY(0) scale(0.99); }
.game-btn:focus-visible { outline: 3px solid rgba(193, 18, 31, 0.45); outline-offset: 3px; }

.game-btn--ghost {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(120, 24, 34, 0.18);
}

.game-btn--ghost:hover { filter: none; background: #fff; }

.game-panel { animation: rise 0.4s cubic-bezier(0.22, 0.8, 0.24, 1) both; }
.game-panel[hidden] { display: none; }

.snake-canvas {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 18px auto 0;
  border-radius: 18px;
  background: #191426;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 14px 28px -16px rgba(74, 24, 30, 0.65);
  touch-action: none;
  cursor: pointer;
}

.game-actions { display: flex; gap: 10px; }
.game-actions .game-btn { margin-top: 14px; }

.game-hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.game-hint--mobile { display: none; }

.game-hint kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11.5px;
  background: rgba(74, 30, 34, 0.08);
  border: 1px solid rgba(74, 30, 34, 0.14);
}

.game-dpad {
  display: none;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(3, 62px);
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.game-dpad button {
  border: 0;
  border-radius: 18px;
  background: rgba(74, 30, 34, 0.07);
  color: var(--ink);
  font-size: 21px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.game-dpad button:active { background: rgba(193, 18, 31, 0.16); }
.game-dpad .dpad-up { grid-column: 2; grid-row: 1; }
.game-dpad .dpad-left { grid-column: 1; grid-row: 2; }
.game-dpad .dpad-right { grid-column: 3; grid-row: 2; }
.game-dpad .dpad-down { grid-column: 2; grid-row: 3; }

@media (max-width: 480px) {
  .ai-head { flex-wrap: wrap; }
  .copy-btn { width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
  .game-dpad { display: grid; }
  .game-hint--desktop { display: none; }
  .game-hint--mobile { display: block; }
  .game-title { font-size: 17px; }
  .game-scores strong { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-panel { animation: none; }
  .game-btn { transition: none; }
  .game-btn:hover { transform: none; }
}
/* ============ QQ / AI 名片块 ============ */
.ai-box {
  margin-top: 22px;
  padding: 16px 16px 15px;
  border-radius: 20px;
  text-align: left;
  background: linear-gradient(180deg, rgba(193, 18, 31, 0.09), rgba(193, 18, 31, 0.04));
  border: 1px solid rgba(193, 18, 31, 0.16);
}

.ai-head { display: flex; align-items: center; gap: 10px; }

.ai-badge {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, #d81b2b, var(--accent-dark));
  box-shadow: 0 8px 16px -8px rgba(150, 10, 22, 0.8);
}

.ai-who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ai-who strong { font-size: 15.5px; letter-spacing: 0.01em; }
.ai-who span { font-size: 12px; color: var(--ink-soft); }

.copy-btn {
  flex: none;
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid rgba(193, 18, 31, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover { background: #fff; transform: translateY(-1px); }
.copy-btn:focus-visible { outline: 3px solid rgba(193, 18, 31, 0.35); outline-offset: 2px; }
.copy-btn.is-done { background: var(--accent); border-color: transparent; color: #fff; }

.ai-desc {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ============ 随机角落表情包彩蛋 ============ */
.egg-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.egg {
  position: absolute;
  width: clamp(84px, 8vw, 106px);
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(120, 24, 34, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 32px -16px rgba(74, 24, 30, 0.6);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.28s cubic-bezier(0.22, 0.8, 0.24, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.egg.is-in { opacity: 1; transform: none; pointer-events: auto; }

/* 鼠标悬停：轻轻上浮 + 放大（桌面） */
.egg.is-in:hover {
  transform: translateY(-5px) scale(1.09);
  box-shadow: 0 24px 40px -18px rgba(74, 24, 30, 0.7);
  border-color: rgba(193, 18, 31, 0.32);
}

/* 按住：轻微放大（手机端 .is-press 由脚本加上，桌面端 :active 也生效） */
.egg.is-in:active,
.egg.is-in.is-press {
  transform: translateY(-1px) scale(1.03);
}

.egg:focus-visible { outline: 3px solid rgba(193, 18, 31, 0.45); outline-offset: 3px; }

.egg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 60%;
}

/* 点一下换一个时的弹跳（作用在 img 上，不打架 hover 变换） */
.egg.is-pop img { animation: eggPop 0.5s cubic-bezier(0.22, 0.8, 0.24, 1); }

@keyframes eggPop {
  0% { transform: scale(1) rotate(0deg); }
  45% { transform: scale(1.12) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.egg-layer.is-tl .egg { top: clamp(12px, 2.4vw, 24px); left: clamp(12px, 2.4vw, 24px); }
.egg-layer.is-tr .egg { top: clamp(12px, 2.4vw, 24px); right: clamp(12px, 2.4vw, 24px); }
.egg-layer.is-bl .egg { bottom: clamp(12px, 2.4vw, 24px); left: clamp(12px, 2.4vw, 24px); }
.egg-layer.is-br .egg { bottom: clamp(12px, 2.4vw, 24px); right: clamp(12px, 2.4vw, 24px); }

@media (prefers-reduced-motion: reduce) {
  .egg { transition: opacity 0.2s ease; transform: none; }
  .egg.is-in:hover, .egg.is-in:active, .egg.is-in.is-press { transform: none; }
  .egg.is-pop img { animation: none; }
}
/* ============ 彩蛋进度点 + 开奖弹层 ============ */
.egg img { padding-bottom: 9px; }

.egg__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  gap: 3px;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.egg__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(74, 30, 34, 0.2);
  transition: background 0.2s ease;
}

.egg__dots i.is-on { background: var(--accent); }
.egg.has-progress .egg__dots { opacity: 1; }

body.is-modal-open { overflow: hidden; }

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

.egg-modal[hidden] { display: none; }

.egg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 12, 16, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: eggFade 0.25s ease both;
}

.egg-modal__box {
  position: relative;
  width: min(560px, 100%);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 252, 251, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 32px 70px -26px rgba(40, 10, 16, 0.75);
  animation: eggRise 0.32s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.egg-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(74, 30, 34, 0.08);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.egg-modal__close:hover { background: rgba(74, 30, 34, 0.16); }
.egg-modal__close:focus-visible { outline: 3px solid rgba(193, 18, 31, 0.45); outline-offset: 2px; }

.egg-modal__title {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--accent);
}

.egg-modal__media {
  border-radius: 16px;
  overflow: hidden;
}

.egg-modal__media video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.egg-audio {
  display: grid;
  gap: 16px;
  padding: 22px 16px 20px;
  justify-items: center;
  background: linear-gradient(180deg, rgba(193, 18, 31, 0.09), rgba(193, 18, 31, 0.03));
}

.egg-audio__art {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 14px 30px -14px rgba(74, 24, 30, 0.6);
  animation: eggSpin 9s linear infinite;
}

.egg-audio audio { width: 100%; }

.egg-modal__hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
  color: var(--ink-soft);
}

@keyframes eggFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes eggRise {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes eggSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .egg-modal__backdrop, .egg-modal__box { animation: none; }
  .egg-audio__art { animation: none; }
}