/* ============================================================
   MY PORTFOLIO QUEST — 像素风个人作品集
   配色 / 字体 / 布局全部为像素游戏风格
   ============================================================ */

/* ---------- 字体（本地托管，离线可用） ---------- */
@font-face {
  font-family: "Fusion Pixel SC";
  src: url("../fonts/fusion-pixel-12px-proportional-sc.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- 变量 ---------- */
:root {
  --bg: #12122b;
  --bg-deep: #0c0c1f;
  --bg-alt: #181835;
  --panel: #1e1e3f;
  --panel-top: #26264e;
  --panel-bottom: #14142e;
  --ink: #e8e8f8;
  --ink-dim: #9a9ac8;
  --ink-faint: #6a6a9e;
  --cyan: #4de3ff;
  --pink: #ff6ba8;
  --yellow: #ffd93d;
  --green: #54e38a;
  --outline: #0c0c1f;
  --text: #e8e8f8;
  --font-zh: "Fusion Pixel SC", "Microsoft YaHei", sans-serif;
  --font-en: "Press Start 2P", "Fusion Pixel SC", monospace;
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---------- 像素风鼠标指针 ---------- */
/* 默认：像素箭头；可点击处：像素宝剑 */
body,
body * {
  cursor: url("../assets/img/cursor-arrow.svg") 4 2, auto;
}
a, button,
.slot-link, .level-card, .cat-card, .equip-item, .equip-arrow,
.ending-link, .pixel-btn, .lightbox-close, .dialog-box,
[role="button"], label, input, textarea, select, video {
  cursor: url("../assets/img/cursor-sword.svg") 4 2, pointer;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: url("../assets/img/cursor-arrow.svg") 4 2, default;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; cursor: url("../assets/img/cursor-sword.svg") 4 2, pointer; color: inherit; }
svg { image-rendering: pixelated; }

::selection { background: var(--yellow); color: var(--bg); }

/* 英文像素小字 */
.en {
  font-family: var(--font-en);
  letter-spacing: 0.08em;
  font-size: 0.62em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* 像素面板：粗边框 + 内斜面 + 硬阴影 */
.pixel-panel {
  position: relative;
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow:
    inset 4px 4px 0 0 var(--panel-top),
    inset -4px -4px 0 0 var(--panel-bottom),
    8px 8px 0 0 rgba(0, 0, 0, 0.4);
}

/* ---------- CRT 覆盖层 ---------- */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: multiply;
}
.crt-vignette {
  position: fixed;
  inset: 0;
  z-index: 901;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(5, 5, 16, 0.55) 100%);
}

/* ---------- 顶部 HUD ---------- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(12, 12, 31, 0.92);
  border-bottom: 4px solid var(--outline);
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.35);
}
.hud-left { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.hud-logo {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--yellow);
}
.hud-sub { font-size: 14px; color: var(--ink-dim); }

.hud-nav { display: flex; gap: 4px; }
.hud-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  border: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.hud-nav a i {
  font-style: normal;
  font-family: var(--font-zh);
  font-size: 11px;
  color: var(--ink-faint);
}
.hud-nav a:hover, .hud-nav a.active {
  color: var(--yellow);
  border-color: var(--ink-dim);
  background: rgba(77, 227, 255, 0.06);
}
.hud-nav a.active i { color: var(--cyan); }

/* ---------- EXP 经验条 ---------- */
.exp-bar {
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px;
  background: rgba(12, 12, 31, 0.92);
  border-bottom: 3px solid var(--outline);
}
.exp-track {
  flex: 1;
  height: 10px;
  background: #0a0a1a;
  border: 2px solid var(--ink-faint);
}
.exp-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 8px, #2bb8d6 8px 12px);
  transition: width 0.1s linear;
}
.exp-text {
  font-family: var(--font-en);
  font-size: 8px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  min-width: 74px;
  text-align: right;
}

/* ---------- 星空 ---------- */
.stars { position: absolute; inset: 0; overflow: hidden; }
.sky-star {
  position: absolute;
  background: #cfd2ff;
  animation: twinkle 2.4s steps(2) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- 像素云 ---------- */
.clouds { position: absolute; inset: 0; overflow: hidden; }
.cloud { position: absolute; width: 168px; height: 72px; }
.cloud-1 { top: 12%; left: -200px; animation: drift 46s linear infinite; }
.cloud-2 { top: 30%; left: -200px; animation: drift 62s linear infinite 12s; opacity: 0.8; }
.cloud-3 { top: 6%; left: -200px; animation: drift 54s linear infinite 26s; opacity: 0.6; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 400px)); }
}

/* ---------- HERO 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 90px;
  overflow: hidden;
}
.hills {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 140px;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 760px;
  width: 100%;
}

/* 像素主角 */
.avatar-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  animation: float 2.6s steps(6) infinite;
}
.avatar { width: 112px; height: 112px; position: relative; z-index: 2; }
.avatar-glow {
  position: absolute;
  width: 130%;
  height: 130%;
  background: radial-gradient(circle, rgba(77, 227, 255, 0.22) 0%, rgba(77, 227, 255, 0.06) 55%, transparent 75%);
  animation: pulse-glow 2.6s steps(6) infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.16); opacity: 1; }
}

.hero-kicker { font-size: 10px; color: var(--yellow); }

.hero-title { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.hero-title .zh {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.25;
  text-shadow: 4px 4px 0 var(--outline), 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.hero-title .en { font-size: clamp(10px, 1.6vw, 15px); color: var(--cyan); }

/* RPG 对话框 */
.dialog-box {
  width: 100%;
  padding: 0;
  animation: dialog-in 0.35s steps(4) both;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.dialog-name {
  display: inline-block;
  margin: -14px 0 0 20px;
  padding: 4px 14px;
  background: var(--yellow);
  color: var(--bg);
  font-size: 15px;
  font-weight: bold;
  border: 3px solid var(--outline);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.dialog-body { padding: 16px 22px 10px; min-height: 108px; }
.dialog-zh { font-size: 19px; line-height: 1.75; min-height: 34px; }
.dialog-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--cyan);
  animation: blink 0.8s steps(1) infinite;
}
.dialog-en { margin-top: 6px; font-size: 10px; line-height: 1.9; }
.dialog-hint {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: baseline;
  padding: 0 16px 10px;
  color: var(--ink-faint);
  animation: blink-slow-anim 1.6s steps(2) infinite;
}
.dialog-hint .zh { font-size: 13px; }
.dialog-hint .en { font-size: 8px; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes blink-slow-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.blink-slow { animation: blink-slow-anim 1.6s steps(2) infinite; }

/* 开始探索按钮 */
.btn-start {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 34px;
  background: var(--yellow);
  color: var(--bg);
  border: 4px solid var(--ink);
  box-shadow:
    inset 4px 4px 0 0 #ffe98a,
    inset -4px -4px 0 0 #d9b022,
    8px 8px 0 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), background 0.12s;
  animation: btn-bounce 1.8s steps(4) infinite;
}
@keyframes btn-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.btn-start:hover {
  background: var(--cyan);
  box-shadow:
    inset 4px 4px 0 0 #a8f0ff,
    inset -4px -4px 0 0 #2bb8d6,
    12px 12px 0 0 rgba(0, 0, 0, 0.5);
  transform: translate(-2px, -2px);
  animation-play-state: paused;
}
.btn-start:active {
  transform: translate(4px, 4px);
  box-shadow: inset 4px 4px 0 0 #d9b022, 2px 2px 0 0 rgba(0, 0, 0, 0.45);
}
.btn-tri { font-size: 20px; animation: blink 0.9s steps(1) infinite; }
.btn-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.3; }
.btn-text .zh { font-size: 22px; font-weight: bold; }
.btn-text .en { font-size: 9px; color: rgba(12, 12, 31, 0.72); }

.press-start { font-size: 9px; color: var(--ink-faint); }

/* 滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink-dim);
  z-index: 2;
}
.scroll-hint .zh { font-size: 13px; }
.scroll-hint .en { font-size: 8px; }
.scroll-hint .arrow {
  margin-top: 6px;
  font-size: 16px;
  color: var(--cyan);
  animation: arrow-bounce 1.2s steps(2) infinite;
}
@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.scroll-hint.in-levels { position: static; transform: none; margin: 70px auto 0; }

/* ---------- 关卡选择 ---------- */
.levels {
  position: relative;
  padding: 130px 24px 100px;
  overflow: hidden;
}
.sky-dim { position: absolute; inset: 0; }
.section-head {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-tag { font-size: 10px; color: var(--cyan); }
.section-title { display: flex; flex-direction: column; gap: 10px; }
.section-title .zh {
  font-size: clamp(30px, 5vw, 46px);
  text-shadow: 4px 4px 0 var(--outline);
}
.section-title .en { font-size: clamp(9px, 1.4vw, 13px); color: var(--yellow); }
.section-desc { display: flex; flex-direction: column; gap: 4px; }
.section-desc .zh { font-size: 17px; color: var(--ink-dim); }
.section-desc .en { font-size: 9px; line-height: 2; }

.level-cards {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  max-width: 1080px;
  margin: 0 auto;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px 26px;
  text-align: center;
  transition: transform 0.14s steps(2), box-shadow 0.14s steps(2);
}
.level-card:hover { transform: translate(-4px, -6px); }

.level-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  font-size: 9px;
  background: var(--ink);
  color: var(--bg);
  border: 3px solid var(--outline);
  white-space: nowrap;
}
.level-icon { width: 76px; height: 76px; display: grid; place-items: center; }
.level-icon svg { width: 64px; height: 64px; }

.level-name { display: flex; flex-direction: column; gap: 6px; }
.level-name .zh { font-size: 26px; font-weight: bold; }
.level-name .en { font-size: 10px; }
.level-desc { display: flex; flex-direction: column; gap: 4px; }
.level-desc .zh { font-size: 14px; color: var(--ink-dim); }
.level-desc .en { font-size: 8px; }

.level-stars { display: flex; gap: 6px; font-size: 18px; }
.star { color: var(--ink-faint); opacity: 0.5; }
.star.on { color: var(--yellow); opacity: 1; }

.level-enter {
  margin-top: 6px;
  font-size: 10px;
  padding: 8px 20px;
  border: 3px solid var(--ink-dim);
  color: var(--ink-dim);
  transition: all 0.12s steps(2);
}
.level-card:hover .level-enter {
  border-color: var(--ink);
  color: var(--bg);
}

/* 关卡配色 */
.c-cyan { --lv: var(--cyan); --lv-deep: #2bb8d6; }
.c-pink { --lv: var(--pink); --lv-deep: #d64f87; }
.c-yellow { --lv: var(--yellow); --lv-deep: #d9b022; }

.level-card .level-badge { background: var(--lv); }
.level-card .level-name .en { color: var(--lv); }
.level-card:hover {
  box-shadow:
    inset 4px 4px 0 0 var(--panel-top),
    inset -4px -4px 0 0 var(--panel-bottom),
    14px 14px 0 0 rgba(0, 0, 0, 0.5);
}
.level-card:hover .level-enter { background: var(--lv); border-color: var(--lv-deep); }
.level-card:hover .level-icon { animation: icon-shake 0.4s steps(2) infinite; }
@keyframes icon-shake {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* ---------- 作品关卡区 ---------- */
.stage {
  position: relative;
  padding: 110px 24px;
  background: var(--bg-alt);
  border-top: 4px solid var(--outline);
  border-bottom: 4px solid var(--outline);
}
.stage-alt { background: var(--bg-deep); }

.stage[data-accent="cyan"] { --lv: var(--cyan); --lv-deep: #2bb8d6; }
.stage[data-accent="pink"] { --lv: var(--pink); --lv-deep: #d64f87; }
.stage[data-accent="yellow"] { --lv: var(--yellow); --lv-deep: #d9b022; }

/* 关卡背景装饰：像素网格 + 光斑 */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.stage::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 340px;
  background: radial-gradient(ellipse at center top, color-mix(in srgb, var(--lv) 9%, transparent), transparent 70%);
  pointer-events: none;
}

.stage-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
}

.stage-head { text-align: center; margin-bottom: 56px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.stage-badge {
  padding: 5px 18px;
  font-size: 9px;
  background: var(--lv);
  color: var(--bg);
  border: 3px solid var(--outline);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.stage-title { display: flex; flex-direction: column; gap: 10px; }
.stage-title .zh {
  font-size: clamp(30px, 5vw, 44px);
  text-shadow: 4px 4px 0 var(--outline);
}
.stage-title .en { font-size: clamp(9px, 1.4vw, 12px); color: var(--lv); }
.stage-desc { display: flex; flex-direction: column; gap: 4px; max-width: 620px; }
.stage-desc .zh { font-size: 17px; color: var(--ink-dim); }
.stage-desc .en { font-size: 9px; line-height: 2; }

/* 作品占位格 */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.grid-video { grid-template-columns: repeat(2, 1fr); }

/* ---------- LEVEL 1 支线类别卡 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 14px 20px;
  text-align: center;
  transition: transform 0.14s steps(2), box-shadow 0.14s steps(2);
}
.cat-card:hover { transform: translate(-3px, -5px); }
.cat-icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  font-size: 26px;
  border: 3px solid var(--outline);
  background: rgba(77, 227, 255, 0.1);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), inset -2px -2px 0 rgba(0,0,0,.3);
}
.cat-card:hover .cat-icon { animation: icon-shake 0.4s steps(2) infinite; }
.cat-name .zh { display: block; font-size: 17px; font-weight: bold; }
.cat-name .en { display: block; font-size: 8px; margin-top: 6px; letter-spacing: 1px; opacity: .75; }
/* 标题与介绍锁定高度，SELECT 按钮统一压到卡片底部，五张卡完全对齐 */
.cat-card .cat-name { min-height: 54px; width: 100%; }
.cat-desc {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.7;
  min-height: 62px;
  width: 100%;
}
.cat-desc .en { display: block; font-size: 7px; opacity: .7; margin-top: 4px; line-height: 1.6; }
.cat-count {
  font-size: 9px;
  padding: 3px 12px;
  background: var(--ink);
  color: var(--bg);
  border: 2px solid var(--outline);
  letter-spacing: 1px;
  margin-top: auto; /* 推到底部，保证按钮行对齐 */
}
.cat-card .cat-enter { font-size: 9px; letter-spacing: 1px; color: var(--cyan); }

@media (max-width: 1080px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

.slot {
  padding: 14px;
  transition: transform 0.14s steps(2), box-shadow 0.14s steps(2);
}
.slot:hover {
  transform: translate(-3px, -5px);
  box-shadow:
    inset 4px 4px 0 0 var(--panel-top),
    inset -4px -4px 0 0 var(--panel-bottom),
    12px 12px 0 0 rgba(0, 0, 0, 0.5);
}

.slot-thumb {
  height: 150px;
  background: repeating-linear-gradient(45deg, #171731 0 12px, #1b1b3a 12px 24px);
  border: 3px solid var(--outline);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  position: relative;
}
.slot-thumb::after {
  content: "?";
  position: absolute;
  right: 8px;
  bottom: 2px;
  font-family: var(--font-en);
  font-size: 26px;
  color: rgba(255, 255, 255, 0.09);
}
.slot-plus {
  font-size: 34px;
  color: var(--ink-faint);
  animation: blink-slow-anim 2.2s steps(2) infinite;
}
.slot-wide .slot-thumb { height: 230px; }
.thumb-video { background: repeating-linear-gradient(45deg, #14142c 0 12px, #1a1a38 12px 24px); }
.slot-play {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--bg);
  background: var(--lv);
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.3), inset -3px -3px 0 rgba(0, 0, 0, 0.25);
  animation: btn-bounce 2s steps(4) infinite;
}

/* 有封面的作品卡：海报背景 */
.slot-thumb.has-poster {
  background-size: cover;
  background-position: center;
  image-rendering: auto;
}
.slot-thumb.has-poster::after { display: none; }
.slot-thumb.has-poster .slot-play {
  background: rgba(255, 217, 61, 0.92);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.35), inset -3px -3px 0 rgba(0, 0, 0, 0.25);
}
.slot-thumb.has-poster:hover .slot-play { background: var(--yellow); }

/* 作品卡多图轮播（硬切换，像素游戏切换感） */
.img-cycler { overflow: hidden; }
.img-cycler img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: img-cycle 9.6s steps(1, end) infinite;
}
/* 3 张：每张 1.6s 轮一遍 */
.img-cycler[data-count="3"] img { animation-duration: 4.8s; }
.img-cycler[data-count="3"] img:nth-child(1) { animation-delay: 0s; }
.img-cycler[data-count="3"] img:nth-child(2) { animation-delay: 1.6s; }
.img-cycler[data-count="3"] img:nth-child(3) { animation-delay: 3.2s; }
@keyframes img-cycle3 {
  0% { opacity: 1; }
  33.33% { opacity: 0; }
  100% { opacity: 0; }
}
.img-cycler[data-count="3"] img { animation-name: img-cycle3; }
/* 4 张 */
.img-cycler[data-count="4"] img { animation-duration: 6.4s; }
.img-cycler[data-count="4"] img:nth-child(1) { animation-delay: 0s; }
.img-cycler[data-count="4"] img:nth-child(2) { animation-delay: 1.6s; }
.img-cycler[data-count="4"] img:nth-child(3) { animation-delay: 3.2s; }
.img-cycler[data-count="4"] img:nth-child(4) { animation-delay: 4.8s; }
@keyframes img-cycle4 {
  0% { opacity: 1; }
  25% { opacity: 0; }
  100% { opacity: 0; }
}
.img-cycler[data-count="4"] img { animation-name: img-cycle4; }

/* 影像作品：悬停播放预览 */
.thumb-video video.hover-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s steps(3);
}
.thumb-video.playing video.hover-preview { opacity: 1; }
.thumb-video.playing .slot-play { opacity: 0; }
.thumb-video.playing::after { content: "▶ PREVIEW"; position: absolute; right: 8px; bottom: 6px; font-family: var(--font-en); font-size: 9px; color: var(--bg); background: var(--yellow); border: 2px solid var(--outline); padding: 2px 8px; z-index: 3; }
.slot-award {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  font-size: 12px;
  background: var(--yellow);
  color: var(--bg);
  border: 2px solid var(--outline);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* 可点击作品卡 */
a.slot-link { display: block; color: inherit; }

.slot-title { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.slot-title .zh { font-size: 16px; }
.slot-title .en { font-size: 8px; }
.slot-meta { display: flex; flex-direction: column; gap: 2px; }
.slot-meta .zh { font-size: 12px; color: var(--ink-faint); }
.slot-meta .en { font-size: 7.5px; }

/* ---------- 结算屏 / 页脚 ---------- */
.ending {
  position: relative;
  padding: 110px 24px 70px;
  background: var(--bg);
  overflow: hidden;
}
.ending-inner { max-width: 720px; margin: 0 auto; }
.ending-panel {
  text-align: center;
  padding: 54px 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ending-tag { font-size: 10px; color: var(--green); }
.ending-title { display: flex; flex-direction: column; gap: 10px; }
.ending-title .zh {
  font-size: clamp(28px, 4.6vw, 40px);
  text-shadow: 4px 4px 0 var(--outline);
}
.ending-title .en { font-size: 11px; color: var(--yellow); }
.ending-desc { display: flex; flex-direction: column; gap: 4px; }
.ending-desc .zh { font-size: 16px; color: var(--ink-dim); }
.ending-desc .en { font-size: 9px; }

.ending-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 14px 0 6px;
}
.ending-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 22px;
  background: var(--bg-alt);
  border: 3px solid var(--ink-dim);
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  transition: all 0.12s steps(2);
}
.ending-link i { font-style: normal; font-family: var(--font-zh); font-size: 12px; color: var(--ink-faint); }
.ending-link:hover {
  background: var(--yellow);
  color: var(--bg);
  border-color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
}
.ending-link:hover i { color: rgba(12, 12, 31, 0.7); }

.ending-credit { font-size: 8px; color: var(--ink-faint); margin-top: 10px; }

/* ---------- 首屏联系方式（可选中复制，低调置于标题下） ---------- */
.contact-strip.pixel-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  padding: 4px 0 0;
  margin-top: 2px;
}
.contact-strip .contact-tag { display: none; }
.contact-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  width: auto;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  user-select: text;
}
.contact-icon { font-size: 11px; color: var(--ink-faint); }
.contact-label { font-size: 7px; color: var(--ink-faint); letter-spacing: 1px; }
.contact-value {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  user-select: text;
  cursor: text;
}
.contact-copy {
  font-family: var(--font-zh);
  font-size: 9px;
  padding: 1px 6px;
  background: transparent;
  color: var(--ink-faint);
  border: 1px solid var(--ink-faint);
  opacity: 0.7;
}
.contact-copy:hover { background: var(--yellow); color: var(--bg); border-color: var(--ink); opacity: 1; }
.contact-copy:active { transform: translate(1px, 1px); }
.contact-copy.copied { background: var(--green); color: var(--bg); border-color: var(--ink); opacity: 1; }
.contact-hint { display: none; }

/* 缩略图：完整显示不裁切（用于立绘类竖图） */
.slot-thumb.thumb-contain {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ---------- 滚动触发动画（仅 JS 可用时启用，渐进增强） ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(42px);
  transition: opacity 0.5s steps(8), transform 0.5s steps(8);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 开始探索过渡闪光 ---------- */
.flash-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash-screen.go { animation: flash 0.55s steps(6) forwards; }
@keyframes flash {
  0% { opacity: 0; }
  20% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .level-cards { grid-template-columns: 1fr; max-width: 420px; gap: 48px; }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hud { padding: 8px 12px; }
  .hud-sub { display: none; }
  .hud-nav a:nth-child(n+3) { display: none; } /* 小屏隐藏编号导航 */
  .hud-nav a { padding: 5px 8px; font-size: 8px; }
  .hud-nav a i { font-size: 10px; }
  .exp-bar { top: 52px; padding: 3px 12px; }
  .exp-text { display: none; }
  .hero { padding-top: 140px; }
  .avatar-wrap { width: 96px; height: 96px; }
  .avatar { width: 84px; height: 84px; }
  .dialog-body { padding: 12px 14px 8px; min-height: 96px; }
  .dialog-zh { font-size: 17px; }
  .btn-start { padding: 12px 24px; }
  .btn-text .zh { font-size: 19px; }
  .slot-grid { grid-template-columns: 1fr; }
  .grid-video { grid-template-columns: 1fr; }
  .stage, .levels, .ending { padding-left: 16px; padding-right: 16px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
