/* =========================================================================
   戴卓豪｜游戏场景美术作品集
   视觉方向：游戏引擎视口 / HUD 交互
   固定顶底 HUD + 中间内容屏切换（首页 / 个人介绍 / 作品展示，作品内四板块再切换）
   ========================================================================= */

:root {
  --bg: #0b0c0f;
  --bg-soft: #101218;
  --card: #15171c;
  --card-hover: #191c22;
  --line: #24262d;
  --line-soft: #1b1d22;
  --text: #e8e9ed;
  --text-muted: #9aa0a9;
  --text-dim: #686d76;
  --accent: #7e96ad;
  --accent-dim: #55687a;
  --accent-soft: rgba(126, 150, 173, 0.12);
  --ember: #c9a87c;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;

  --hud-h: 58px;
  --wrap: 1200px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC",
    sans-serif;
  --font-display: "Space Grotesk", "Sora", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  scrollbar-color: #2a2d34 var(--bg);
}

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video { display: block; max-width: 100%; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

::selection { background: rgba(126, 150, 173, 0.34); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: #2a2d34;
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-track { background: transparent; }

/* ---- 氛围层：冷暖两团光 + 极轻颗粒 ---- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(126, 150, 173, 0.08), transparent 60%),
    radial-gradient(820px 480px at 88% 112%, rgba(201, 168, 124, 0.05), transparent 62%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: calc(var(--hud-h) + 10px); }

.noscript {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* =========================================================================
   1. 顶部 / 底部 HUD
   ========================================================================= */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(9, 10, 13, 0.82);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.hud-top { top: 0; border-bottom: 1px solid var(--line-soft); }
.hud-bottom { bottom: 0; border-top: 1px solid var(--line-soft); }

.hud-inner {
  height: var(--hud-h);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  white-space: nowrap;
}

.brand-mark {
  width: 8px;
  height: 8px;
  flex: none;
  transform: rotate(45deg);
  background: var(--ember);
  box-shadow: 0 0 10px rgba(201, 168, 124, 0.55);
}

.brand-name { font-weight: 500; }
.brand-sep { color: var(--line); }
.brand-sub { font-size: 13px; color: var(--text-dim); transition: color 0.25s var(--ease); }
.brand:hover .brand-sub { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 26px; }

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}

.nav-num {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
  transition: color 0.25s var(--ease);
}

.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: #fff; }
.nav-links a.is-active .nav-num { color: var(--ember); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--ember);
  opacity: 1;
  box-shadow: 0 0 8px rgba(216, 169, 111, 0.45);
}

.hud-meta {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* 底部状态栏 */
.hud-bottom .hud-inner { justify-content: space-between; font-size: 12.5px; color: var(--text-dim); }
.hud-left { display: flex; align-items: center; gap: 10px; }
.hud-name { font-family: var(--font-display); letter-spacing: 0.14em; color: var(--text-muted); }

.hud-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 9px rgba(216, 169, 111, 0.8);
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}
.hud-cta {
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
}
.hud-right { display: flex; align-items: center; gap: 18px; }
.hud-role { color: var(--text-dim); }
.hud-mail { color: var(--text-muted); transition: color 0.25s var(--ease); }
.hud-mail:hover { color: var(--ember); }
.hud-copy { color: #55585f; }

/* =========================================================================
   2. 视口舞台与屏幕切换
   ========================================================================= */
.stage {
  position: fixed;
  top: var(--hud-h);
  bottom: var(--hud-h);
  left: 0;
  right: 0;
  z-index: 1;
  overflow: hidden;
}

.stage-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 50% 32%, rgba(0, 0, 0, 0.9), transparent 82%);
  mask-image: radial-gradient(circle at 50% 32%, rgba(0, 0, 0, 0.9), transparent 82%);
}

.frame-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(143, 166, 189, 0.48);
}
.frame-tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.frame-tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.frame-bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.frame-br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

.page {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-size: 100% 100%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.997);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
    visibility 0.45s var(--ease);
}

.page.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.page-pad {
  width: min(var(--wrap), 92%);
  margin: 0 auto;
  padding: clamp(30px, 5vh, 56px) 0 48px;
  position: relative;
  z-index: 1;
}

/* =========================================================================
   3. 首页 Hero
   ========================================================================= */
.hero {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
  filter: saturate(0.9) contrast(1.08) brightness(0.7);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 72% 62% at 50% 46%,
    rgba(11, 12, 15, 0) 0%,
    rgba(11, 12, 15, 0.34) 48%,
    rgba(8, 9, 12, 0.94) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(900px, 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-rule {
  display: block;
  width: 64px;
  height: 1px;
  margin: 0 auto 34px;
  background: var(--ember);
  opacity: 0.85;
}

.hero-title {
  margin: 0 0 30px;
  font-size: clamp(46px, 9vw, 118px);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: 0.08em;
  color: #f5f6f8;
  text-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
  max-width: 62ch;
  margin: 0 auto 22px;
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.9;
  color: #b6bcc4;
  white-space: pre-line;
}

.hero-note {
  max-width: 58ch;
  margin: 0 auto clamp(42px, 8vh, 76px);
  font-size: 14px;
  line-height: 1.95;
  color: #8b919a;
  white-space: pre-line;
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}
.scroll-hint:hover { color: var(--ember); }

.scroll-hint-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--line), transparent);
}

.hero-title,
.hero-subtitle,
.hero-note,
.hero-rule,
.scroll-hint { animation: heroIn 0.85s var(--ease) both; }
.hero-subtitle { animation-delay: 0.12s; }
.hero-note { animation-delay: 0.24s; }
.hero-rule { animation-delay: 0.08s; }
.scroll-hint { animation-delay: 0.38s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* =========================================================================
   4. 区块标题
   ========================================================================= */
.section-head { position: relative; margin-bottom: clamp(30px, 4vw, 52px); }

.section-ghost {
  position: absolute;
  left: -0.03em;
  top: -0.42em;
  z-index: 0;
  font-family: var(--font-display);
  font-size: clamp(76px, 13vw, 160px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.04);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  user-select: none;
}

.section-kicker,
.section-title,
.section-desc { position: relative; z-index: 1; }

.section-kicker {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember);
  opacity: 0.9;
}

.section-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #f0f1f3;
}

.section-desc {
  max-width: 72ch;
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.95;
  color: var(--text-muted);
  white-space: pre-line;
}

/* =========================================================================
   5. 个人介绍
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

/* 基本信息快览卡片 */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-bottom: clamp(28px, 4vw, 44px);
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact {
  background: var(--card);
  padding: 16px 18px;
}

.fact-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.fact-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

.about-block + .about-block { margin-top: 34px; }

.about-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.about-text-body {
  margin: 0;
  font-size: 15px;
  line-height: 2.05;
  color: var(--text-muted);
  white-space: pre-line;
}

.about-side { display: grid; gap: 28px; }

.side-title {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.skill-tags li {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 13.5px;
  color: var(--text-muted);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.skill-tags li:hover { border-color: #34343c; color: var(--text); }

.contact-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.contact-label {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.contact-mail {
  display: inline-block;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
  word-break: break-all;
}
.contact-mail:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }

.contact-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-dim);
  white-space: pre-line;
}

/* ---- 制作管线时间轴 ---- */
.workflow { position: relative; padding-left: 24px; }

.workflow::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-dim), var(--line));
}

.workflow li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.workflow li::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent-dim);
}

.workflow .wf-num {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent-dim);
}

.workflow .wf-label { color: var(--text-muted); }

/* =========================================================================
   6. 作品展示：板块切换标签
   ========================================================================= */
.work-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.work-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(21, 23, 28, 0.55);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.work-tab .tab-num {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent-dim);
  transition: color 0.25s var(--ease);
}

.work-tab:hover { color: var(--text); border-color: #33343b; }
.work-tab.is-active {
  color: var(--text);
  border-color: var(--ember);
  background: rgba(216, 169, 111, 0.08);
}
.work-tab.is-active .tab-num { color: var(--ember); }

.work-stage { position: relative; }
.work-stage.is-switching { animation: stageIn 0.35s var(--ease); }
@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.work-section { display: none; padding-top: 8px; }
.work-section.is-active { display: block; }

.work-head {
  position: relative;
  margin-bottom: 16px;
  padding-left: clamp(46px, 6vw, 72px);
}

.work-ghost {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 600;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  user-select: none;
}

.work-head-text { display: flex; flex-direction: column; gap: 6px; }

.work-title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 400;
  letter-spacing: 0.07em;
  color: #eeeef0;
}

.work-subtitle { font-size: 13px; color: var(--text-dim); }

.work-desc {
  max-width: 76ch;
  margin: 0 0 30px;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-muted);
  white-space: pre-line;
}

/* ---- 卡片网格（含编辑式主打作品） ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: #33343b;
}

.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #101013;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

.card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.045) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
.card-thumb.is-loaded::before,
.card-thumb.is-error::before { display: none; }

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -90% 0; }
}

.card-thumb::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 32%,
    rgba(255, 255, 255, 0.1) 47%, rgba(216, 169, 111, 0.2) 53%, transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.9s var(--ease);
}
.card:hover .card-thumb::after { transform: translateX(130%); }

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}

.card-thumb img.is-loaded { opacity: 1; }
.card:hover .card-thumb img.is-loaded { transform: scale(1.035); }

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: linear-gradient(150deg, #17181d, #101013);
}

.card-thumb.is-error .thumb-fallback { display: flex; }
.card-thumb.is-error img { display: none; }

.thumb-fallback-text { font-size: 13px; color: var(--text-dim); }
.thumb-fallback-path {
  font-size: 11.5px;
  color: var(--accent-dim);
  word-break: break-all;
}

.thumb-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(9, 10, 13, 0.74);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-body { padding: 18px 20px 22px; }

.card-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #ececef;
}

.card-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-muted);
  white-space: pre-line;
}

.card-video-wrap { padding: 14px 14px 0; }

.card.is-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
}

.card.is-featured .card-thumb { aspect-ratio: auto; min-height: 300px; height: 100%; }
.card.is-featured .card-video-wrap { grid-column: 1 / -1; }

.card.is-featured .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 46px);
}

.card.is-featured .card-title {
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.card.is-featured .card-desc { font-size: 14.5px; line-height: 1.95; }

/* ---- 游戏项目经历：图文结合 case-study ---- */
.cases { display: flex; flex-direction: column; gap: 24px; }

.case {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.case--reverse .case-media { order: 2; }
.case--reverse .case-body { order: 1; }

.case-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #101013;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

.case-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.045) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
.case-media.is-loaded::before { display: none; }

.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}
.case-media img.is-loaded { opacity: 1; }
.case:hover .case-media img.is-loaded { transform: scale(1.03); }

.case-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(9, 10, 13, 0.74);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.case-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 46px);
}

.case-index {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
}

.case-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #ececef;
}

.case-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--text-muted);
  white-space: pre-line;
}

.case-video { margin-top: 6px; }

/* 竖屏 / 方形图片自适应 */
.card-thumb.is-portrait,
.case-media.is-portrait { aspect-ratio: 3 / 4; }
.card-thumb.is-square,
.case-media.is-square { aspect-ratio: 1 / 1; }

/* ---- 视频（电影画框） ---- */
.video-block {
  margin-top: 26px;
  padding: 12px;
  background: linear-gradient(180deg, #101218, #0c0e11);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.video-frame {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 18px 44px rgba(0, 0, 0, 0.42);
}

.video-frame video {
  width: 100%;
  max-height: 62vh;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: #000;
}

.video-meta { padding: 16px 6px 6px; }

.video-title { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: #ececef; }
.video-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-muted);
  white-space: pre-line;
}

.media-error {
  display: none;
  margin: 12px 6px 2px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--accent-dim);
}
.video-frame.is-error + .media-error { display: block; }

.empty-tip {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* =========================================================================
   7. 大图预览画廊
   ========================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(56px, 8vh, 72px) clamp(70px, 8vw, 110px) clamp(18px, 4vh, 34px);
  background: rgba(7, 8, 10, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-top {
  position: absolute;
  top: clamp(16px, 3vh, 26px);
  left: clamp(18px, 4vw, 40px);
  right: clamp(18px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-count {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.lightbox-tools { display: flex; gap: 10px; }

.lightbox-zoom,
.lightbox-close {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(21, 23, 28, 0.72);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lightbox-zoom:hover,
.lightbox-close:hover { color: var(--text); border-color: #3a3b43; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(21, 23, 28, 0.72);
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lightbox-nav:hover { color: var(--text); border-color: #3a3b43; }
.lightbox-prev { left: clamp(14px, 2.5vw, 30px); }
.lightbox-next { right: clamp(14px, 2.5vw, 30px); }

.lightbox-stage {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.lightbox-stage.is-zoomed {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border-radius: 6px;
  background: #0c0d10;
  cursor: zoom-in;
  transition: opacity 0.25s var(--ease);
}

.lightbox-stage.is-zoomed img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: grab;
  -webkit-user-drag: none;
  user-select: none;
}

.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-zoomed.is-panning { cursor: grabbing; }

.lightbox-meta { max-width: min(900px, 100%); text-align: center; }

.lightbox-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.lb-title { font-size: 15px; color: var(--text); letter-spacing: 0.04em; }
.lb-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 76ch;
}

.lightbox-strip {
  display: flex;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 2px 10px;
}

.lightbox-strip button {
  flex: 0 0 auto;
  width: 68px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  opacity: 0.5;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lightbox-strip img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-strip button:hover { opacity: 0.85; }
.lightbox-strip button.is-active { border-color: var(--accent); opacity: 1; }

body.is-locked { overflow: hidden; }

/* =========================================================================
   8. 回到顶部 & 编辑面板
   ========================================================================= */
.back-top {
  position: fixed;
  right: 18px;
  bottom: calc(var(--hud-h) + 16px);
  z-index: 60;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20, 21, 26, 0.82);
  color: var(--text-muted);
  font-size: 17px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    visibility 0.3s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { color: var(--ember); border-color: #3a3b43; }

.editor-toggle {
  position: fixed;
  right: 18px;
  bottom: calc(var(--hud-h) + 62px);
  z-index: 70;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(24, 24, 27, 0.75);
  color: var(--text-dim);
  font-size: 13px;
  opacity: 0.35;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}

body.is-admin .editor-toggle { display: flex; }
.editor-toggle:hover { opacity: 1; color: var(--accent); }

.editor {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(430px, 100vw);
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #121318;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(102%);
  transition: transform 0.35s var(--ease);
  font-size: 13px;
  line-height: 1.7;
}

body.is-admin .editor { display: flex; }
.editor.is-open { transform: none; }

.editor.is-collapsed { height: auto; bottom: auto; }
.editor.is-collapsed .editor-body,
.editor.is-collapsed .editor-foot { display: none; }

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #17171c;
}

.editor-head-text { display: flex; flex-direction: column; gap: 2px; }
.editor-title { font-size: 14px; font-weight: 500; color: var(--text); }
.editor-source { font-size: 11.5px; color: var(--text-dim); }

.editor-ghost {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.editor-ghost:hover { color: var(--text); border-color: #3a3b43; }

.editor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-group {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}

.editor-group > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-group > summary::-webkit-details-marker { display: none; }
.editor-group > summary::after {
  content: "＋";
  color: var(--text-dim);
  font-size: 12px;
}
.editor-group[open] > summary::after { content: "－"; }
.editor-group[open] > summary { border-bottom: 1px solid var(--line-soft); }

.group-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.input,
.textarea {
  width: 100%;
  padding: 9px 11px;
  background: #0b0c0f;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  transition: border-color 0.25s var(--ease);
}

.input:focus,
.textarea:focus { outline: none; border-color: var(--accent-dim); }

.textarea { min-height: 84px; resize: vertical; }

.field-hint { font-size: 11px; line-height: 1.6; color: #5e5e66; }

.path-row { display: flex; gap: 8px; }
.path-row .input { flex: 1; }

.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.check-row .field-label { font-size: 12px; color: var(--text-muted); }

.mini-btn {
  flex: none;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #1a1a1f;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.mini-btn:hover { color: var(--text); border-color: #3a3b43; }

.editor-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #141419;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-card-tag { font-size: 11.5px; color: var(--accent-dim); letter-spacing: 0.08em; }

.head-actions { display: flex; align-items: center; gap: 8px; }
.move-btns { display: flex; gap: 4px; }
.move-btns .mini-btn { padding: 0 9px; }

.link-danger {
  font-size: 11.5px;
  color: #8a6a6a;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.link-danger:hover { color: #c08a8a; border-bottom-color: #6d4c4c; }

.editor-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.editor-foot {
  border-top: 1px solid var(--line);
  background: #17171c;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-status { margin: 0; min-height: 18px; font-size: 11.5px; color: var(--accent-dim); }

.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #1c1c21;
  font-size: 12.5px;
  color: var(--text-muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
.btn:hover { color: var(--text); border-color: #3a3b43; background: #212127; }

.btn-primary {
  background: rgba(126, 150, 173, 0.15);
  border-color: var(--accent-dim);
  color: #cfdae5;
}
.btn-primary:hover { background: rgba(126, 150, 173, 0.22); color: #e4ecf4; }

.btn-quiet { color: var(--text-dim); }

.editor-tip { margin: 0; font-size: 11px; line-height: 1.7; color: #5c5c64; }

/* 编辑面板打开时，舞台与 HUD 让出右侧空间 */
@media (min-width: 1180px) {
  body.editor-open .stage,
  body.editor-open .hud { right: min(430px, 34vw); }
  body.editor-open .editor-toggle { right: calc(min(430px, 34vw) + 18px); }
  body.editor-open .back-top { right: calc(min(430px, 34vw) + 18px); }
}

/* =========================================================================
   9. 响应式
   ========================================================================= */
@media (max-width: 900px) {
  .hud-meta { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { gap: 24px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
  .card.is-featured { grid-template-columns: 1fr; }
  .card.is-featured .card-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .card.is-featured .card-body { padding: 22px; }
  .case { grid-template-columns: 1fr; }
  .case--reverse .case-media { order: 0; }
  .case--reverse .case-body { order: 0; }
  .case-media { aspect-ratio: 16 / 9; }
  .case-body { padding: 22px; }
}

@media (max-width: 720px) {
  :root { --hud-h: 52px; }

  .hud-inner { padding: 0 16px; gap: 16px; }
  .brand-sub,
  .brand-sep { display: none; }
  .brand-name { font-size: 14.5px; }

  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12.5px; gap: 6px; }

  .hero-title { letter-spacing: 0.05em; }
  .hero-backdrop img {
    opacity: 0.26;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 78%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 78%);
  }

  .hud-bottom .hud-role,
  .hud-bottom .hud-copy { display: none; }
  .hud-cta { letter-spacing: 0.02em; }

  .page-pad { padding: 22px 0 32px; }
  .section-ghost { top: -0.42em; }

  .cards { grid-template-columns: 1fr; }
  .card-thumb { aspect-ratio: 3 / 2; }

  .lightbox { padding: 60px 44px 18px; }
  .lightbox-stage img { max-height: 60vh; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-strip button { width: 58px; height: 40px; }

  .editor { width: 100vw; }
}

@media (max-width: 420px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  .skill-tags li { padding: 7px 13px; font-size: 12.5px; }
  .contact-card { padding: 20px; }
  .lightbox-nav { display: none; }
}

/* =========================================================================
   10. 无障碍：减少动效偏好
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================================
   11. 打印
   ========================================================================= */
@media print {
  .hud,
  .stage-grid,
  .frame-corner,
  .lightbox,
  .editor,
  .editor-toggle,
  .back-top,
  .atmosphere,
  .hero-backdrop { display: none !important; }
  body { background: #fff; color: #111; height: auto; overflow: visible; }
  .stage { position: static; overflow: visible; }
  .page { position: static; opacity: 1; visibility: visible; transform: none; }
}
