/* 赛博朋克黑镜主题 */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg-black: #000000;
  --bg-dark: #0d0d0d;
  --bg-panel: #111111;
  --text-green: #00ff41;
  --text-red: #ff0844;
  --text-cyan: #00d9ff;
  --text-white: #e8e8e8;
  --text-gray: #5a5a5a;
  --text-dim: #2a2a2a;
  --glitch-color: #00ffff;
  --border-color: #1a1a1a;
  --neon-green: #39ff14;
  --neon-red: #ff073a;
  --neon-blue: #00e5ff;
  --pressure-accent: var(--text-green);
  --pressure-soft: rgba(0, 255, 65, 0.14);
  --pressure-glow: rgba(0, 255, 65, 0.18);
}

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

body {
  background: var(--bg-black);
  color: var(--text-white);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* CRT屏幕效果 */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    );
  pointer-events: none;
  z-index: 9998;
  opacity: 0.3;
}

/* 噪点纹理 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9997;
  animation: noise 0.2s infinite;
}

@keyframes noise {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-10%, 5%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 10%); }
  80% { transform: translate(-15%, 0); }
  90% { transform: translate(10%, 5%); }
}

/* 屏幕切换 */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: screenFadeIn 0.6s ease-out;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* 开场动画 */
#intro-screen {
  background:
    var(--bg-black);
}

.intro-landing,
.intro-sequence {
  width: 100%;
  display: flex;
  justify-content: center;
}

.intro-shell,
.intro-sequence-panel {
  width: min(720px, 100%);
  position: relative;
  background: rgba(0, 0, 0, 0.82);
  box-shadow:
    0 0 40px rgba(0, 255, 65, 0.1),
    inset 0 0 60px rgba(0, 255, 65, 0.02);
  overflow: hidden;
}

.intro-shell {
  padding: 14px 16px 18px;
  text-align: center;
  min-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(8, 10, 10, 0.94) 0%, rgba(3, 5, 5, 0.96) 100%);
  box-shadow:
    0 0 80px rgba(0, 255, 65, 0.06),
    0 0 120px rgba(255, 46, 104, 0.06),
    inset 0 0 120px rgba(0, 255, 65, 0.015);
}

.intro-sequence-panel {
  max-width: 900px;
  padding: 40px;
}

.intro-shell::before,
.intro-sequence-panel::before {
  content: '> SYSTEM_INIT';
  position: absolute;
  top: 12px;
  left: 20px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  font-weight: 700;
}

.intro-shell::after,
.intro-sequence-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 49, 99, 0.12) 0%, transparent 18%, transparent 82%, rgba(93, 255, 111, 0.12) 100%);
  pointer-events: none;
}

.intro-shell > * {
  position: relative;
  z-index: 1;
}

.intro-shell::before {
  text-shadow: 0 0 10px rgba(93, 255, 111, 0.12);
}

.intro-shell::after {
  opacity: 0.5;
}

.intro-shell .intro-hero::before {
  content: '';
  position: absolute;
  inset: 2% 8% auto;
  height: 54%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 56%);
  filter: blur(24px);
  pointer-events: none;
}

.intro-shell .intro-hero::after {
  content: '';
  position: absolute;
  inset: 10% 0 24%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 42%, transparent 54%, transparent 100%);
  opacity: 0.2;
  pointer-events: none;
}

.intro-kicker {
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 2.6px;
  color: rgba(119, 255, 142, 0.82);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.intro-title-lockup {
  margin-top: 8px;
}

.intro-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(54px, 11.4vw, 96px);
  line-height: 0.9;
  color: #f8fbf9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    -2px 0 rgba(255, 49, 99, 0.46),
    2px 0 rgba(93, 255, 111, 0.32),
    0 0 18px rgba(255, 255, 255, 0.16);
  animation: introTitleJitter 3.2s steps(2, end) infinite;
}

.intro-title-line {
  display: block;
}

.intro-title-line:first-child {
  font-size: 0.8em;
  letter-spacing: 1.4px;
}

.intro-title-line:last-child {
  font-size: 0.72em;
  letter-spacing: 0.4px;
}

.intro-title-time {
  margin-bottom: 10px;
  color: #ff7398;
  text-shadow:
    -1px 0 rgba(255, 93, 143, 0.3),
    1px 0 rgba(255, 255, 255, 0.1),
    0 0 12px rgba(255, 93, 143, 0.14);
}

.intro-title-main {
  color: #f7fbf8;
}

.intro-title-main + .intro-title-main {
  margin-top: -2px;
}

.intro-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.intro-copy {
  position: relative;
  z-index: 2;
  margin-top: -18px;
}

.intro-visual {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intro-visual-glow {
  position: absolute;
  inset: 14% 8%;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.14;
}

.intro-visual-glow-red {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.015) 38%, transparent 64%);
  transform: translate(0%, 2%);
}

.intro-visual-glow-green {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.012) 42%, transparent 64%);
  transform: translate(0%, 8%);
}

.intro-grid {
  position: absolute;
  inset: 18% 16%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.95) 44%, transparent 82%);
  opacity: 0.22;
}

.intro-avatar-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.intro-avatar {
  width: min(82%, 304px);
  max-height: 96%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 28px rgba(255, 36, 90, 0.24))
    drop-shadow(0 0 42px rgba(88, 255, 117, 0.14));
  animation: avatarFloat 5.4s ease-in-out infinite;
}

.intro-subtitle {
  max-width: 252px;
  margin: 10px auto 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(236, 242, 238, 0.7);
  letter-spacing: 0.1px;
}

.intro-subtitle strong {
  color: var(--text-green);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
}

.intro-stakes {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 24px 0 22px;
  box-shadow: inset 0 1px 0 rgba(0, 255, 65, 0.14), inset 0 -1px 0 rgba(0, 255, 65, 0.14);
}

.intro-stake-card {
  min-height: 84px;
  padding: 12px 12px 10px;
  background:
    linear-gradient(180deg, rgba(11, 16, 13, 0.96) 0%, rgba(6, 9, 7, 0.98) 100%);
  border-top: 2px solid rgba(0, 255, 65, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(0, 255, 65, 0.08),
    inset 0 0 18px rgba(0, 255, 65, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.intro-stake-label {
  font-size: 10px;
  letter-spacing: 2.6px;
  color: rgba(172, 184, 172, 0.68);
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
}

.intro-stake-value {
  font-size: clamp(26px, 4vw, 40px);
  color: var(--text-green);
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(0, 255, 65, 0.28);
}

.intro-stake-copy {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(210, 218, 210, 0.84);
}

.intro-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.intro-actions .btn-primary {
  margin: 0;
  min-width: 292px;
  min-height: 56px;
  border: 1px solid rgba(160, 255, 174, 0.34);
  color: #f8fff9;
  background:
    linear-gradient(90deg, rgba(255, 46, 104, 0.14) 0%, rgba(9, 13, 14, 0.94) 22%, rgba(9, 13, 14, 0.94) 78%, rgba(93, 255, 111, 0.14) 100%),
    rgba(8, 12, 11, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 22px rgba(255, 36, 90, 0.14),
    0 0 30px rgba(88, 255, 117, 0.1),
    inset 0 0 28px rgba(255, 255, 255, 0.02);
  letter-spacing: 2.8px;
  border-radius: 999px;
}

.intro-cta-copy {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(175, 189, 175, 0.82);
  text-align: center;
}

.typewriter-text {
  font-size: 17px;
  margin: 16px 0;
  opacity: 0;
  color: var(--text-green);
  min-height: 26px;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  letter-spacing: 0.5px;
  font-weight: 400;
  text-align: center;
}

.typewriter-container {
  margin-top: 26px;
}

.intro-sequence {
  align-items: center;
  min-height: calc(100svh - 40px);
  justify-content: center;
  padding-top: 0;
  overflow: hidden;
}

.intro-sequence-panel {
  margin-top: 0;
}

@keyframes introTitleJitter {
  0%, 82%, 100% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
  83% {
    transform: translate3d(-1px, 0, 0);
  }
  86% {
    transform: translate3d(2px, -1px, 0);
  }
  89% {
    transform: translate3d(-2px, 1px, 0);
    filter: blur(0.2px);
  }
  92% {
    transform: translate3d(1px, 0, 0);
  }
}

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

.intro-sequence-panel .btn-primary {
  margin: 18px auto 0;
  display: block;
}

.intro-actions .btn-primary:hover {
  background:
    linear-gradient(90deg, rgba(255, 46, 104, 0.26) 0%, rgba(17, 22, 22, 0.96) 30%, rgba(17, 22, 22, 0.96) 70%, rgba(93, 255, 111, 0.24) 100%),
    rgba(10, 14, 12, 0.96);
  color: #ffffff;
  border-color: rgba(198, 255, 204, 0.8);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(255, 46, 104, 0.22),
    0 0 34px rgba(93, 255, 111, 0.2),
    inset 0 0 24px rgba(255, 255, 255, 0.05);
}

.typewriter-text.typing {
  opacity: 1;
  border-right: 3px solid var(--text-green);
  animation: blink 0.7s step-end infinite;
}

.typewriter-text.typed {
  opacity: 1;
  border-right: none;
  animation: textGlow 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { border-color: var(--text-green); }
  50% { border-color: transparent; }
}

@keyframes textGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 255, 65, 0.5); }
  50% { text-shadow: 0 0 15px rgba(0, 255, 65, 0.8); }
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
  padding: 16px 45px;
  font-size: 13px;
  font-family: 'Orbitron', 'JetBrains Mono', monospace;
  font-weight: 700;
  border: 2px solid var(--text-green);
  background: transparent;
  color: var(--text-green);
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: var(--text-green);
  color: var(--bg-black);
  box-shadow:
    0 0 30px var(--text-green),
    0 0 60px rgba(0, 255, 65, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 15px var(--text-green);
}

.btn-secondary {
  border-color: var(--text-gray);
  color: var(--text-gray);
  box-shadow: none;
}

.btn-secondary:hover {
  border-color: var(--text-white);
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

#restart-btn {
  border-color: rgba(106, 255, 151, 0.42);
  color: rgba(198, 255, 215, 0.92);
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.08) 0%, rgba(0, 255, 65, 0.02) 100%),
    rgba(4, 12, 7, 0.72);
  box-shadow:
    0 0 14px rgba(0, 255, 65, 0.12),
    inset 0 0 16px rgba(0, 255, 65, 0.05);
  letter-spacing: 1.4px;
  animation: restartBreath 2.8s ease-in-out infinite;
}

#restart-btn:hover {
  border-color: rgba(121, 255, 141, 0.86);
  color: #f2fff5;
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.14) 0%, rgba(0, 255, 65, 0.04) 100%),
    rgba(6, 16, 10, 0.84);
  box-shadow:
    0 0 20px rgba(0, 255, 65, 0.22),
    inset 0 0 18px rgba(0, 255, 65, 0.08);
  transform: translateY(-2px);
}

#restart-btn::after {
  content: '↺';
  display: inline-block;
  margin-left: 8px;
  font-size: 14px;
  animation: restartSpinHint 2.8s ease-in-out infinite;
}

#contact-btn {
  padding: 18px 26px 16px;
  min-width: min(100%, 360px);
  margin-top: 18px;
  border-color: #ffcf5a;
  color: #1c1300;
  background:
    linear-gradient(135deg, rgba(255, 230, 122, 1) 0%, rgba(255, 181, 78, 0.98) 55%, rgba(255, 126, 42, 0.96) 100%);
  box-shadow:
    0 0 22px rgba(255, 184, 59, 0.42),
    0 0 44px rgba(255, 145, 31, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.14);
  letter-spacing: 0.8px;
  text-transform: none;
  animation: ctaPulse 1.9s ease-in-out infinite, ctaWiggle 3.8s ease-in-out infinite;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

#contact-btn:hover {
  border-color: #ffe38a;
  color: #140d00;
  background:
    linear-gradient(135deg, rgba(255, 226, 118, 1) 0%, rgba(255, 174, 79, 0.98) 100%);
  box-shadow:
    0 0 30px rgba(255, 199, 87, 0.5),
    0 0 58px rgba(255, 153, 51, 0.3);
  transform: translateY(-3px) scale(1.02);
}

#contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 120%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transition: left 0.6s ease;
  z-index: 0;
}

#contact-btn::after {
  content: '推荐测试';
  position: absolute;
  top: 6px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ff174f;
  color: #fff4f6;
  font-size: 9px;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.6px;
  box-shadow: 0 0 16px rgba(255, 23, 79, 0.4);
}

#contact-btn:hover::before {
  left: 100%;
}

@keyframes ctaPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 22px rgba(255, 184, 59, 0.42),
      0 0 44px rgba(255, 145, 31, 0.22),
      inset 0 0 18px rgba(255, 255, 255, 0.14);
  }
  50% {
    transform: translateY(-2px) scale(1.045);
    box-shadow:
      0 0 32px rgba(255, 211, 110, 0.54),
      0 0 68px rgba(255, 145, 31, 0.32),
      inset 0 0 22px rgba(255, 255, 255, 0.2);
  }
}

@keyframes ctaWiggle {
  0%, 78%, 100% { transform: translateY(0) rotate(0deg); }
  82% { transform: translateY(-1px) rotate(-1deg); }
  86% { transform: translateY(-1px) rotate(1deg); }
  90% { transform: translateY(0) rotate(-0.8deg); }
  94% { transform: translateY(0) rotate(0.8deg); }
}

@keyframes restartBreath {
  0%, 100% {
    box-shadow:
      0 0 14px rgba(0, 255, 65, 0.12),
      inset 0 0 16px rgba(0, 255, 65, 0.05);
  }
  50% {
    box-shadow:
      0 0 20px rgba(0, 255, 65, 0.22),
      inset 0 0 18px rgba(0, 255, 65, 0.08);
  }
}

@keyframes restartSpinHint {
  0%, 82%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-20deg); }
  94% { transform: rotate(18deg); }
}

@media (max-width: 768px) {
  #contact-btn {
    width: 100%;
    min-width: 0;
    font-size: 14px;
    padding: 18px 18px 16px;
    animation: ctaPulse 1.9s ease-in-out infinite, ctaWiggle 3.4s ease-in-out infinite;
  }

  #contact-btn::after {
    right: 8px;
    top: 6px;
    font-size: 8px;
    letter-spacing: 0.5px;
  }
}

.hidden {
  display: none !important;
}

/* 游戏主界面 */
#game-screen {
  display: none;
  padding: 30px 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

#game-screen.active {
  display: block;
}

/* 资源面板 - 紧凑横向布局 */
/* 游戏主界面布局 */
#game-screen {
  display: none;
  padding: 0;
}

#game-screen.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#game-screen[data-crisis-resource="money"][data-crisis-level="warning"] {
  --pressure-accent: #ff7474;
  --pressure-soft: rgba(255, 116, 116, 0.14);
  --pressure-glow: rgba(255, 8, 68, 0.2);
}

#game-screen[data-crisis-resource="money"][data-crisis-level="critical"] {
  --pressure-accent: #ff4d6d;
  --pressure-soft: rgba(255, 77, 109, 0.18);
  --pressure-glow: rgba(255, 8, 68, 0.28);
}

#game-screen[data-crisis-resource="energy"][data-crisis-level="warning"] {
  --pressure-accent: #ffd166;
  --pressure-soft: rgba(255, 209, 102, 0.13);
  --pressure-glow: rgba(255, 209, 102, 0.2);
}

#game-screen[data-crisis-resource="energy"][data-crisis-level="critical"] {
  --pressure-accent: #ff9f43;
  --pressure-soft: rgba(255, 159, 67, 0.16);
  --pressure-glow: rgba(255, 159, 67, 0.24);
}

#game-screen[data-crisis-resource="network"][data-crisis-level="warning"] {
  --pressure-accent: #9bd1ff;
  --pressure-soft: rgba(155, 209, 255, 0.13);
  --pressure-glow: rgba(0, 229, 255, 0.18);
}

#game-screen[data-crisis-resource="network"][data-crisis-level="critical"] {
  --pressure-accent: #72b6ff;
  --pressure-soft: rgba(114, 182, 255, 0.16);
  --pressure-glow: rgba(0, 229, 255, 0.24);
}

#game-screen[data-crisis-resource="time"][data-crisis-level="warning"] {
  --pressure-accent: #f7a8ff;
  --pressure-soft: rgba(247, 168, 255, 0.13);
  --pressure-glow: rgba(247, 168, 255, 0.18);
}

#game-screen[data-crisis-resource="time"][data-crisis-level="critical"] {
  --pressure-accent: #ff89c5;
  --pressure-soft: rgba(255, 137, 197, 0.16);
  --pressure-glow: rgba(255, 137, 197, 0.24);
}

#game-screen.crisis-pulse {
  animation: crisisScreenShake 0.5s ease-in-out;
}

#game-screen.resource-break {
  animation: crisisBreakShake 0.72s ease-in-out;
}

#game-screen.resource-break::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
  background:
    linear-gradient(112deg,
      transparent 0%,
      transparent 33%,
      rgba(255, 255, 255, 0.08) 33.4%,
      rgba(255, 255, 255, 0.02) 34.1%,
      transparent 35%,
      transparent 58%,
      rgba(255, 255, 255, 0.06) 58.5%,
      transparent 59.2%,
      transparent 100%),
    linear-gradient(78deg,
      transparent 0%,
      transparent 46%,
      rgba(255, 32, 86, 0.08) 46.4%,
      transparent 47.1%,
      transparent 100%),
    linear-gradient(0deg,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 49.6%,
      transparent 50.3%,
      transparent 100%);
  mix-blend-mode: screen;
  animation: resourceBreakCrack 0.72s ease-out;
}

/* 小时显示（顶部） */
.hour-display {
  text-align: center;
  font-size: 36px;
  padding: 20px 0;
  color: var(--text-green);
  text-shadow:
    0 0 20px var(--text-green),
    0 0 40px rgba(0, 255, 65, 0.5),
    0 0 60px rgba(0, 255, 65, 0.3);
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  letter-spacing: 6px;
  position: relative;
  animation: hourGlow 3s ease-in-out infinite;
  background: var(--bg-black);
  box-shadow: inset 0 -1px 0 rgba(0, 255, 65, 0.12);
}

/* 主内容区域（左右布局） */
.game-content {
  flex: 1;
  padding: 18px 28px 28px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

/* 左侧整体组件 */
.story-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* 剧情内容区 */
.story-lower {
  display: block;
  width: 100%;
  padding: 24px 22px 22px;
  background:
    linear-gradient(180deg, rgba(8, 14, 10, 0.92) 0%, rgba(5, 9, 7, 0.96) 100%);
  box-shadow:
    0 0 24px rgba(0, 255, 65, 0.08),
    inset 0 0 48px rgba(0, 0, 0, 0.52);
  position: relative;
}

.story-lower::before {
  content: '';
  position: absolute;
  top: 0;
  left: 22px;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, rgba(121, 255, 141, 0.85), transparent 45%);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.24);
}

/* 场景图片容器 */
.scene-frame {
  position: relative;
  min-height: 220px;
  width: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 12, 9, 0.96) 0%, rgba(3, 6, 5, 0.98) 100%);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 0 42px rgba(0, 0, 0, 0.42);
}

.scene-frame:empty {
  display: none;
}

/* 资源面板（图片下方横向一行） */
.resources-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(10, 14, 11, 0.92) 0%, rgba(6, 9, 7, 0.98) 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 0 30px rgba(0, 0, 0, 0.45);
  position: sticky;
  top: 0;
  z-index: 100;
}

.resource-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "icon label value"
    "bar bar bar";
  align-items: center;
  row-gap: 8px;
  column-gap: 8px;
  min-width: 0;
  padding: 10px 10px 9px;
  background: rgba(255, 255, 255, 0.018);
  transition: all 0.3s ease;
  position: relative;
}

.resource-item:hover {
  background: rgba(0, 255, 65, 0.04);
  transform: translateY(-2px);
}

.resource-item.depleted {
  background:
    linear-gradient(135deg, rgba(255, 8, 68, 0.14) 0%, rgba(255, 8, 68, 0.04) 100%),
    rgba(28, 6, 10, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 8, 68, 0.28),
    0 0 18px rgba(255, 8, 68, 0.18);
  animation: depletedResourceAlarm 0.9s ease-in-out infinite;
}

.resource-item.critical:not(.depleted) {
  background:
    linear-gradient(135deg, rgba(255, 98, 122, 0.1) 0%, rgba(255, 8, 68, 0.03) 100%),
    rgba(22, 8, 11, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 8, 68, 0.18),
    0 0 14px rgba(255, 8, 68, 0.1);
  animation: criticalResourceBreath 1.25s ease-in-out infinite;
}

.resource-item.critical:not(.depleted) .resource-label,
.resource-item.critical:not(.depleted) .resource-value {
  color: rgba(255, 201, 210, 0.96);
  text-shadow: 0 0 10px rgba(255, 8, 68, 0.18);
}

.resource-item.critical:not(.depleted) .resource-icon {
  filter: drop-shadow(0 0 7px rgba(255, 8, 68, 0.34));
}

.resource-item.depleted .resource-label,
.resource-item.depleted .resource-value {
  color: #ff9cab;
  text-shadow: 0 0 10px rgba(255, 8, 68, 0.28);
}

.resource-item.depleted .resource-icon {
  filter: drop-shadow(0 0 8px rgba(255, 8, 68, 0.45));
}

.resource-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-green), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resource-item:hover::after {
  opacity: 1;
}

.resource-icon {
  grid-area: icon;
  font-size: 14px;
  filter: drop-shadow(0 0 6px rgba(0, 255, 65, 0.6));
}

.resource-label {
  grid-area: label;
  font-size: 9px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-bar {
  grid-area: bar;
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
  border-radius: 999px;
}

.resource-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.resource-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--text-green), var(--neon-green));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  box-shadow:
    0 0 15px var(--text-green),
    inset 0 0 10px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.resource-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.resource-bar.danger .resource-fill {
  background: linear-gradient(90deg, var(--text-red), var(--neon-red));
  box-shadow:
    0 0 15px var(--text-red),
    inset 0 0 10px rgba(255, 255, 255, 0.2);
  animation: dangerPulse 1s infinite;
}

.resource-item.critical:not(.depleted) .resource-bar.danger .resource-fill {
  box-shadow:
    0 0 18px rgba(255, 8, 68, 0.9),
    inset 0 0 10px rgba(255, 255, 255, 0.24);
  animation: dangerPulse 0.7s infinite;
}

.resource-item.depleted .resource-bar {
  background: rgba(255, 8, 68, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 8, 68, 0.18);
}

.resource-item.depleted .resource-bar::after {
  content: '归零';
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: rgba(255, 184, 197, 0.9);
  font-size: 9px;
  letter-spacing: 1px;
  font-family: 'Orbitron', monospace;
  z-index: 2;
}

@keyframes dangerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes criticalResourceBreath {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      inset 0 0 0 1px rgba(255, 8, 68, 0.18),
      0 0 14px rgba(255, 8, 68, 0.1);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      inset 0 0 0 1px rgba(255, 8, 68, 0.24),
      0 0 22px rgba(255, 8, 68, 0.18);
  }
}

@keyframes depletedResourceAlarm {
  0%, 100% {
    transform: translateX(0);
    box-shadow:
      inset 0 0 0 1px rgba(255, 8, 68, 0.28),
      0 0 18px rgba(255, 8, 68, 0.18);
  }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 8, 68, 0.36),
      0 0 24px rgba(255, 8, 68, 0.28);
  }
}

@keyframes crisisScreenShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-1px, 0, 0); }
  40% { transform: translate3d(1px, -1px, 0); }
  60% { transform: translate3d(-1px, 1px, 0); }
  80% { transform: translate3d(1px, 0, 0); }
}

@keyframes crisisBreakShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10% { transform: translate3d(-4px, 0, 0); }
  22% { transform: translate3d(4px, -2px, 0); }
  34% { transform: translate3d(-4px, 2px, 0); }
  46% { transform: translate3d(3px, 0, 0); }
  58% { transform: translate3d(-3px, -2px, 0); }
  70% { transform: translate3d(3px, 2px, 0); }
  82% { transform: translate3d(-2px, 0, 0); }
}

@keyframes resourceBreakCrack {
  0% {
    opacity: 0;
    transform: scale(1.01);
    filter: blur(1px);
  }
  18% {
    opacity: 0.95;
    transform: scale(1);
    filter: blur(0);
  }
  48% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: scale(1);
    filter: blur(0.4px);
  }
}

.resource-value {
  grid-area: value;
  font-size: 12px;
  color: var(--text-white);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-width: 42px;
  text-align: right;
  font-family: 'Orbitron', monospace;
}

/* 当前小时显示 - 紧凑版 */
.hour-display {
  text-align: center;
  font-size: 48px;
  margin: 20px 0;
  color: var(--text-green);
  text-shadow:
    0 0 20px var(--text-green),
    0 0 40px rgba(0, 255, 65, 0.5),
    0 0 60px rgba(0, 255, 65, 0.3);
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  letter-spacing: 6px;
  position: relative;
  animation: hourGlow 3s ease-in-out infinite;
}

@keyframes hourGlow {
  0%, 100% {
    text-shadow:
      0 0 20px var(--text-green),
      0 0 40px rgba(0, 255, 65, 0.5),
      0 0 60px rgba(0, 255, 65, 0.3);
  }
  50% {
    text-shadow:
      0 0 30px var(--text-green),
      0 0 60px rgba(0, 255, 65, 0.7),
      0 0 90px rgba(0, 255, 65, 0.5);
  }
}

.hour-label {
  font-size: 16px;
  color: var(--text-gray);
  font-weight: 400;
  letter-spacing: 3px;
}

.hour-number {
  font-weight: 900;
  margin: 0 10px;
  display: inline-block;
  animation: numberFlicker 0.1s infinite alternate;
}

@keyframes numberFlicker {
  0% { opacity: 0.98; }
  100% { opacity: 1; }
}

/* 剧情面板（左侧） */
.story-panel {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 8px 6px 6px 10px;
  box-shadow: none;
  position: relative;
  height: fit-content;
  max-width: none;
  overflow: visible;
}

/* 场景图片 */
.scene-image {
  width: 100%;
  max-width: 100%;
  height: clamp(220px, 30vw, 320px);
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
  object-fit: cover;
  object-position: center top;
  display: block;
  opacity: 0;
  animation: imageReveal 1s ease-out forwards;
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.story-panel::before {
  content: none;
}

.story-title {
  font-size: 36px;
  color: var(--text-green);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  text-shadow:
    0 0 15px rgba(0, 255, 65, 0.8),
    0 0 30px rgba(0, 255, 65, 0.4);
  position: relative;
  display: inline-block;
}

.story-title::after {
  content: '_';
  animation: blink 1s step-end infinite;
  margin-left: 5px;
}

.story-scene {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 25px;
  font-style: italic;
  letter-spacing: 1px;
  padding-left: 0;
}

.pressure-status {
  margin: 0 0 28px;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, var(--pressure-soft) 0%, transparent 100%),
    rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--pressure-accent);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.32);
}

.pressure-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  font-family: 'Orbitron', monospace;
  letter-spacing: 2.6px;
  color: var(--pressure-accent);
  font-weight: 700;
}

.pressure-text {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(234, 236, 234, 0.9);
}

.story-body {
  position: relative;
  min-height: 300px;
}

.story-body.consequence-active {
  min-height: max(300px, var(--consequence-height, 300px));
}

.story-body.consequence-active > *:not(.consequence-panel) {
  opacity: 0.16;
  filter: blur(4px);
  transform: scale(0.995);
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.story-description {
  font-size: 17px;
  line-height: 1.9;
  margin-bottom: 35px;
  color: var(--text-white);
  white-space: pre-line;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
  letter-spacing: 0.3px;
}

/* 选择按钮 */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 35px;
}

.choice-btn {
  padding: 46px 22px 20px;
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.06) 0%, rgba(0, 255, 65, 0.015) 36%, transparent 100%),
    rgba(0, 0, 0, 0.72);
  border: 2px solid var(--border-color);
  border-left: 4px solid rgba(0, 255, 65, 0.3);
  color: var(--text-white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  line-height: 1.6;
  min-height: 118px;
}

.choice-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(121, 255, 141, 0.08);
  pointer-events: none;
}

.choice-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
  transition: left 0.6s ease;
}

.choice-btn:hover::after {
  left: 100%;
}

.choice-btn:hover {
  border-color: var(--text-green);
  border-left-color: var(--neon-green);
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.12) 0%, rgba(0, 255, 65, 0.04) 40%, transparent 100%),
    rgba(0, 0, 0, 0.8);
  transform: translateX(6px);
  box-shadow:
    0 0 25px rgba(0, 255, 65, 0.2),
    inset 0 0 20px rgba(0, 255, 65, 0.05);
}

.choice-btn:active {
  transform: translateX(6px) scale(0.99);
}

.choice-index {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: rgba(0, 255, 65, 0.68);
}

.choice-cta {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 3px 7px;
  border: 1px solid rgba(0, 255, 65, 0.18);
  background: rgba(0, 255, 65, 0.06);
  color: rgba(191, 255, 201, 0.88);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
  white-space: nowrap;
}

.choice-title {
  display: block;
  margin-right: 62px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: rgba(238, 243, 238, 0.98);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

.choice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
}

.choice-cost,
.choice-gain,
.choice-warning {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.choice-cost {
  color: #ff7f8f;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 127, 143, 0.26);
}

.choice-gain {
  color: var(--text-green);
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
}

.choice-warning {
  color: #ff8f8f;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(255, 8, 68, 0.28);
}

.choice-trade {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  line-height: 1.75;
  color: rgba(201, 220, 201, 0.82);
}

.choice-btn-disabled {
  border-color: rgba(255, 8, 68, 0.22);
  border-left-color: rgba(255, 8, 68, 0.68);
  background:
    linear-gradient(135deg, rgba(255, 8, 68, 0.05) 0%, rgba(255, 8, 68, 0.01) 100%),
    rgba(0, 0, 0, 0.58);
  color: rgba(232, 232, 232, 0.72);
  cursor: not-allowed;
  opacity: 0.88;
}

.choice-btn-disabled .choice-cta {
  border-color: rgba(255, 8, 68, 0.22);
  background: rgba(255, 8, 68, 0.08);
  color: rgba(255, 173, 188, 0.92);
}

#game-screen[data-crisis-level="warning"] .choice-btn,
#game-screen[data-crisis-level="critical"] .choice-btn {
  border-left-color: var(--pressure-accent);
}

#game-screen[data-crisis-level="warning"] .choice-btn:hover,
#game-screen[data-crisis-level="critical"] .choice-btn:hover {
  border-color: var(--pressure-accent);
  background:
    linear-gradient(135deg, var(--pressure-soft) 0%, rgba(255, 255, 255, 0.01) 100%),
    rgba(0, 0, 0, 0.8);
  box-shadow:
    0 0 22px var(--pressure-glow),
    inset 0 0 18px rgba(255, 255, 255, 0.03);
}

#game-screen[data-crisis-level="critical"] .story-title {
  color: var(--pressure-accent);
  text-shadow:
    0 0 18px var(--pressure-glow),
    0 0 34px var(--pressure-glow);
}

#game-screen[data-crisis-level="warning"] .consequence-impact,
#game-screen[data-crisis-level="critical"] .consequence-impact {
  color: var(--pressure-accent);
  background: rgba(0, 0, 0, 0.28);
  border-left-color: var(--pressure-accent);
}

#game-screen[data-crisis-resource="energy"][data-crisis-level="critical"] .story-panel,
#game-screen[data-crisis-resource="energy"][data-crisis-level="critical"] .consequence-card {
  animation: fatiguePulse 3.2s ease-in-out infinite;
}

@keyframes fatiguePulse {
  0%, 100% { filter: none; }
  50% { filter: saturate(0.88) brightness(0.97); }
}

.choice-btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

.choice-btn-disabled::after {
  display: none;
}

/* 黑镜式旁白 */
.black-mirror-text {
  font-size: 14px;
  color: rgba(176, 154, 154, 0.72);
  font-style: italic;
  padding: 14px 14px 14px 30px;
  background: transparent;
  margin-top: 22px;
  position: relative;
  line-height: 1.95;
  letter-spacing: 0.2px;
  box-shadow: none;
}

.black-mirror-text::before {
  content: '“';
  position: absolute;
  left: 0;
  top: -4px;
  color: rgba(255, 122, 145, 0.42);
  font-size: 34px;
  line-height: 1;
  font-style: normal;
  font-family: Georgia, serif;
}

.black-mirror-text::after {
  content: '”';
  position: absolute;
  right: 2px;
  bottom: -18px;
  color: rgba(255, 122, 145, 0.24);
  font-size: 30px;
  line-height: 1;
  font-style: normal;
  font-family: Georgia, serif;
}

/* 后果面板 */
.consequence-panel {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background:
    linear-gradient(180deg, rgba(2, 8, 3, 0.18), rgba(2, 8, 3, 0.78) 30%, rgba(2, 8, 3, 0.9) 100%),
    radial-gradient(circle at top, rgba(0, 255, 65, 0.08), transparent 32%);
  padding: 8px 0 0;
  margin: 0;
  text-align: left;
  animation: consequenceFadeIn 0.6s ease;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;
  overflow: visible;
  z-index: 6;
  backdrop-filter: blur(12px);
}

.consequence-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 255, 65, 0.12);
  pointer-events: none;
}

.consequence-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 255, 65, 0.04), transparent 18%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 36%);
  pointer-events: none;
}

.consequence-card {
  width: 100%;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 24px 28px 28px;
  background:
    linear-gradient(180deg, rgba(12, 18, 14, 0.96) 0%, rgba(6, 9, 7, 0.98) 100%);
  border: 1px solid rgba(165, 255, 186, 0.14);
  border-top: 3px solid rgba(121, 255, 141, 0.9);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(0, 255, 65, 0.08);
  position: relative;
  z-index: 1;
}

.consequence-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(121, 255, 141, 0.95), transparent);
}

.consequence-kicker {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 11px;
  color: rgba(121, 255, 141, 0.9);
  letter-spacing: 2.8px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
}

@keyframes consequenceFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.consequence-text {
  font-size: 18px;
  line-height: 1.85;
  margin-bottom: 20px;
  color: rgba(236, 240, 236, 0.96);
  white-space: pre-line;
  text-shadow: none;
  letter-spacing: 0.4px;
}

.consequence-impact {
  margin: 0 0 22px;
  padding: 14px 0;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(176, 248, 188, 0.88);
  background: transparent;
  box-shadow: inset 0 1px 0 rgba(121, 255, 141, 0.1), inset 0 -1px 0 rgba(121, 255, 141, 0.1);
}

.impact-spent {
  color: rgba(255, 127, 148, 0.96);
  text-shadow: 0 0 10px rgba(255, 8, 68, 0.18);
}

.impact-gained {
  color: rgba(121, 255, 141, 0.94);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.16);
}

.impact-pressure {
  color: rgba(190, 224, 197, 0.76);
}

.consequence-actions {
  display: flex;
  justify-content: flex-start;
}

.consequence-btn {
  margin: 0;
  min-width: 132px;
  border-color: rgba(121, 255, 141, 0.45);
  color: rgba(225, 255, 231, 0.92);
  background: rgba(121, 255, 141, 0.06);
  box-shadow: none;
}

.consequence-btn:hover {
  border-color: var(--text-green);
  color: var(--bg-black);
  background: var(--text-green);
  box-shadow: 0 0 24px rgba(0, 255, 65, 0.22);
}

@media (max-width: 768px) {
  .story-body {
    min-height: 260px;
  }

  .story-body.consequence-active {
    min-height: max(260px, var(--consequence-height, 260px));
  }

  .consequence-panel {
    padding: 6px 0 0;
  }

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

  .consequence-text {
    font-size: 17px;
    line-height: 1.75;
  }

  .consequence-actions {
    justify-content: stretch;
  }

  .consequence-btn {
    width: 100%;
  }
}

/* 结局界面 */
#ending-screen {
  background:
    radial-gradient(ellipse at center, rgba(255, 8, 68, 0.1) 0%, transparent 70%),
    var(--bg-black);
}

.ending-transition {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(255, 8, 68, 0.12) 0%, rgba(0, 0, 0, 0.94) 42%, rgba(0, 0, 0, 0.985) 100%);
  backdrop-filter: blur(14px);
  animation: endingCollapseIn 3.2s ease forwards;
}

.ending-transition.hidden {
  display: none;
}

.ending-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.04) 47%, transparent 53%, transparent 100%);
  opacity: 0.5;
}

.ending-transition-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  animation: endingCollapseCopy 2.4s ease forwards;
}

.ending-transition-kicker {
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(255, 132, 160, 0.7);
  font-family: 'Orbitron', monospace;
}

.ending-transition-text {
  margin-top: 14px;
  font-size: clamp(22px, 4.5vw, 34px);
  line-height: 1.45;
  color: rgba(247, 236, 239, 0.96);
  letter-spacing: 1px;
  text-shadow: 0 0 18px rgba(255, 8, 68, 0.18);
}

@keyframes endingCollapseIn {
  0% {
    opacity: 0;
    transform: scale(1.02);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes endingCollapseCopy {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.ending-content {
  max-width: 900px;
  width: 100%;
  text-align: center;
  padding: 40px;
}

.ending-image-frame {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
}

.ending-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(20%) contrast(1.1);
}

.ending-kicker {
  display: inline-block;
  margin: 4px 0 12px;
  padding: 0 14px;
  font-size: 11px;
  color: rgba(255, 151, 176, 0.78);
  letter-spacing: 3.2px;
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
  background: rgba(255, 8, 68, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 8, 68, 0.14);
}

.ending-title {
  font-size: 64px;
  color: var(--text-red);
  margin-bottom: 26px;
  text-transform: uppercase;
  letter-spacing: 8px;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  text-shadow:
    0 0 20px var(--text-red),
    0 0 40px rgba(255, 8, 68, 0.6),
    0 0 60px rgba(255, 8, 68, 0.4);
  animation: endingGlitch 3s infinite;
}

@keyframes endingGlitch {
  0%, 90%, 100% {
    transform: translate(0);
    text-shadow:
      0 0 20px var(--text-red),
      0 0 40px rgba(255, 8, 68, 0.6),
      0 0 60px rgba(255, 8, 68, 0.4);
  }
  92% {
    transform: translate(-3px, 3px);
    text-shadow:
      -3px 3px 20px var(--text-red),
      3px -3px 40px var(--neon-blue),
      0 0 60px rgba(255, 8, 68, 0.4);
  }
  94% {
    transform: translate(3px, -3px);
    text-shadow:
      3px -3px 20px var(--neon-green),
      -3px 3px 40px var(--text-red),
      0 0 60px rgba(255, 8, 68, 0.4);
  }
  96% {
    transform: translate(-2px, -2px);
    text-shadow:
      -2px -2px 20px var(--neon-blue),
      2px 2px 40px var(--text-red),
      0 0 60px rgba(255, 8, 68, 0.4);
  }
}

.ending-stats {
  margin: 24px 0 26px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background:
    radial-gradient(circle at top, rgba(255, 8, 68, 0.08), transparent 46%),
    rgba(8, 0, 3, 0.72);
  box-shadow:
    0 0 26px rgba(255, 8, 68, 0.14),
    inset 0 1px 0 rgba(255, 8, 68, 0.18);
}

.ending-share-hook {
  margin: 0 auto 24px;
  max-width: 24em;
  padding: 12px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 216, 225, 0.92);
  background:
    linear-gradient(90deg, rgba(255, 8, 68, 0.08), rgba(255, 8, 68, 0.02) 55%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 8, 68, 0.1);
}

.ending-stat {
  margin: 0;
  min-height: 118px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(236, 224, 229, 0.82);
  letter-spacing: 1px;
  background:
    linear-gradient(180deg, rgba(255, 8, 68, 0.05) 0%, rgba(255, 8, 68, 0.015) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 8, 68, 0.12);
}

.stat-highlight {
  color: var(--text-red);
  font-size: clamp(42px, 7vw, 56px);
  font-weight: 900;
  font-family: 'Orbitron', monospace;
  text-shadow:
    0 0 15px var(--text-red),
    0 0 30px rgba(255, 8, 68, 0.5);
  display: inline-block;
  margin: 0;
  line-height: 1;
  animation: statPulse 2s ease-in-out infinite;
}

@keyframes statPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow:
      0 0 15px var(--text-red),
      0 0 30px rgba(255, 8, 68, 0.5);
  }
  50% {
    transform: scale(1.05);
    text-shadow:
      0 0 25px var(--text-red),
      0 0 50px rgba(255, 8, 68, 0.7);
  }
}

.ending-description {
  font-size: 17px;
  line-height: 2.05;
  margin: 42px 0 30px;
  color: var(--text-white);
  padding: 42px 48px;
  background:
    radial-gradient(circle at top, rgba(255, 8, 68, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(16, 16, 16, 0.96) 0%, rgba(10, 10, 10, 0.98) 100%);
  box-shadow:
    0 0 18px rgba(255, 8, 68, 0.05),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.ending-description p {
  margin: 18px auto;
  max-width: 20em;
  letter-spacing: 0.2px;
}

/* 最终资源 */
.final-resources {
  margin: 28px 0 50px;
  padding: 40px;
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.03) 0%, transparent 100%),
    var(--bg-panel);
  box-shadow:
    0 0 24px rgba(0, 255, 65, 0.1),
    inset 0 0 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

.final-resources h3 {
  font-size: 22px;
  color: rgba(228, 245, 228, 0.94);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(0, 255, 65, 0.14);
}

.final-state-summary {
  margin-bottom: 24px;
  padding: 18px 0;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(224, 237, 224, 0.94);
  background: transparent;
  box-shadow: inset 0 1px 0 rgba(121, 255, 141, 0.14), inset 0 -1px 0 rgba(121, 255, 141, 0.14);
}

.final-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.final-resource-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 25px 15px;
  background: rgba(255, 255, 255, 0.018);
  transition: all 0.3s ease;
  position: relative;
}

.final-resource-item:hover {
  background: rgba(0, 255, 65, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 255, 65, 0.2);
}

.final-resource-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--text-green), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.final-resource-item:hover::before {
  opacity: 1;
}

.final-resource-item .resource-icon {
  font-size: 40px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.6));
}

.final-resource-item span:last-child {
  font-size: 20px;
  color: var(--text-white);
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
  letter-spacing: 1px;
}

/* 结局按钮 */
.ending-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 50px;
}

/* 分享卡片 */
.share-card {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 600px;
  padding: 50px;
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.05) 0%, transparent 100%),
    var(--bg-black);
  border: 3px solid var(--text-green);
  color: var(--text-white);
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 255, 65, 0.3);
}

.share-card h2 {
  font-size: 26px;
  color: var(--text-green);
  margin-bottom: 25px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
}

.share-card h3 {
  font-size: 36px;
  color: var(--text-red);
  margin-bottom: 25px;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  text-shadow: 0 0 20px rgba(255, 8, 68, 0.6);
}

.share-card p {
  font-size: 20px;
  margin: 15px 0;
  letter-spacing: 1px;
}

.share-footer {
  margin-top: 35px;
  font-size: 16px;
  color: var(--text-gray);
  letter-spacing: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .intro-shell,
  .intro-sequence-panel {
    padding: 6px 10px 12px;
  }

  .intro-sequence-panel {
    margin-top: 0;
  }

  .intro-sequence {
    min-height: calc(100svh - 16px);
  }

  .intro-title {
    font-size: clamp(46px, 13vw, 62px);
    letter-spacing: 0;
    line-height: 0.86;
  }

  .intro-subtitle {
    font-size: 12px;
    line-height: 1.4;
  }

  .intro-actions .btn-primary {
    width: 100%;
    min-width: 0;
    min-height: 54px;
  }

  .intro-hero {
    gap: 0;
  }

  .intro-visual {
    width: min(100%, 356px);
    aspect-ratio: 1 / 1.06;
  }

  .intro-avatar {
    width: min(88%, 284px);
  }

  .intro-kicker {
    font-size: 9px;
    letter-spacing: 1.2px;
    margin-top: 6px;
  }

  .intro-copy {
    margin-top: -28px;
  }

  .game-content {
    padding: 16px;
  }

  .story-main {
    width: 100%;
    gap: 12px;
  }

  .story-lower {
    padding: 18px 16px 16px;
  }

  .scene-image {
    height: clamp(180px, 42vw, 240px);
  }

  .resources-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .resource-item {
    padding: 9px 8px 8px;
    row-gap: 7px;
    column-gap: 7px;
  }

  .resource-icon {
    font-size: 13px;
  }

  .resource-label {
    font-size: 8px;
  }

  .resource-bar {
    height: 7px;
  }

  .resource-value {
    font-size: 11px;
    min-width: 38px;
  }

  .hour-display {
    font-size: 36px;
    margin: 15px 0;
  }

  .hour-display::before,
  .hour-display::after {
    font-size: 24px;
  }

  .story-panel {
    padding: 20px;
  }

  .story-title {
    font-size: 26px;
    letter-spacing: 2px;
  }

  .story-description {
    font-size: 15px;
  }

  .choice-btn {
    padding: 20px 25px;
    font-size: 14px;
  }

  .choice-btn:hover {
    padding-left: 35px;
  }

  .choices-container {
    gap: 10px;
    margin-bottom: 20px;
  }

  .ending-image-frame,
  .ending-image {
    max-height: 180px;
    height: 180px;
  }

  .ending-title {
    font-size: 36px;
    letter-spacing: 2px;
    margin-bottom: 24px;
  }

  .ending-kicker {
    margin: 0 0 10px;
    font-size: 10px;
    letter-spacing: 2.4px;
  }

  .stat-highlight {
    font-size: 32px;
  }

  .ending-content {
    padding: 18px 12px 28px;
  }

  .ending-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 26px;
    padding: 16px;
  }

  .ending-stat {
    margin: 0;
    padding: 14px 10px 12px;
    background: rgba(255, 8, 68, 0.04);
    border: 1px solid rgba(255, 8, 68, 0.12);
    font-size: 14px;
    line-height: 1.6;
  }

  .ending-description {
    margin: 0 0 24px;
    padding: 20px 16px;
    font-size: 15px;
    line-height: 1.95;
  }

  .ending-share-hook {
    margin: 0 auto 18px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.65;
  }

  .ending-description p {
    margin: 14px 0;
  }

  .ending-stat {
    min-height: 92px;
    padding: 14px 12px 12px;
    font-size: 13px;
  }

  .stat-highlight {
    font-size: 34px;
  }

  .final-resources h3 {
    font-size: 20px;
    letter-spacing: 3px;
    margin-bottom: 14px;
  }

  .final-resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .final-resources {
    margin: 0 0 24px;
    padding: 20px 16px;
  }

  .final-resources h3 {
    margin-bottom: 18px;
    font-size: 15px;
    letter-spacing: 2px;
  }

  .final-state-summary {
    margin-bottom: 18px;
    padding: 14px 14px;
    font-size: 14px;
    line-height: 1.8;
  }

  .final-resource-item {
    gap: 10px;
    padding: 18px 10px 16px;
  }

  .final-resource-item span:last-child {
    font-size: 18px;
  }

  .ending-actions {
    gap: 12px;
    margin-top: 0;
  }

  .btn-primary, .btn-secondary {
    padding: 14px 35px;
    font-size: 12px;
    letter-spacing: 2px;
  }

  .intro-content {
    padding: 30px 25px;
  }

  .typewriter-text {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .choice-btn {
    padding: 40px 14px 14px;
    font-size: 13px;
    min-height: 96px;
  }

  .choice-btn:hover {
    transform: translateX(4px);
  }

  .choice-index {
    top: 10px;
    left: 12px;
    font-size: 9px;
    letter-spacing: 1.2px;
  }

  .choice-cta {
    top: 10px;
    right: 12px;
    font-size: 8px;
    padding: 2px 5px;
    letter-spacing: 0.3px;
  }

  .choice-title {
    margin-right: 50px;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0;
  }

  .choice-meta {
    gap: 5px 8px;
    margin-top: 8px;
  }

  .choice-cost,
  .choice-gain,
  .choice-warning {
    font-size: 10px;
    letter-spacing: 0.1px;
  }

  .intro-kicker {
    letter-spacing: 1.5px;
  }

  .intro-title {
    font-size: 40px;
  }

  .intro-subtitle {
    max-width: 236px;
    font-size: 12px;
  }

  .intro-shell {
    min-height: calc(100svh - 10px);
  }

  .intro-sequence-panel {
    margin-top: 0;
  }

  .intro-sequence {
    min-height: calc(100svh - 10px);
  }

  .intro-visual {
    width: min(100%, 320px);
    aspect-ratio: 1 / 1.08;
  }

  .intro-actions {
    margin-top: 6px;
  }

  .resources-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .resource-icon {
    font-size: 14px;
  }

  .resource-label {
    font-size: 8px;
  }

  .resource-value {
    font-size: 10px;
  }

  .hour-display {
    font-size: 28px;
    margin: 10px 0;
  }

  .story-title {
    font-size: 22px;
  }

  .ending-title {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .final-resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .final-resource-item {
    padding: 16px 8px 14px;
  }

  .ending-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-highlight {
    font-size: 28px;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-black);
  border-left: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-green);
  box-shadow: 0 0 10px var(--text-green);
}

/* 选择文本样式 */
::selection {
  background: var(--text-green);
  color: var(--bg-black);
  text-shadow: none;
}

::-moz-selection {
  background: var(--text-green);
  color: var(--bg-black);
  text-shadow: none;
}
