/* ═══════════════════════════════════════════════════
   L4D2 社区网站 — 暗色游戏主题
   配色: off-black + #4ecca3 绿色 (L4D2 accent)
   Taste-Skill: 单 accent / 无纯黑 / hover 过渡
   ═══════════════════════════════════════════════════ */

/* ── CSS 变量 ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #151520;
  --border-color: #2a2a35;
  --text-primary: #e4e4e4;
  --text-secondary: #8b8b96;
  --accent-green: #4ecca3;
  --accent-green-hover: #3da882;
  --accent-glow: rgba(78,204,163,0.15);
  --accent-red: #e74c3c;
  --accent-orange: #f39c12;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── 全局 ── */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ── 链接 ── */
a {
  color: var(--accent-green);
}
a:hover {
  color: var(--accent-green-hover);
}

/* ── 导航栏 ── */
.navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.navbar-brand {
  letter-spacing: 1px;
}
.nav-link.active {
  border-bottom: 2px solid var(--accent-green);
}

/* ── 卡片 ── */
.card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  border-color: var(--accent-green);
}
.card-header {
  background-color: rgba(255, 255, 255, .03);
}

/* ── 表单控件 ── */
.form-control,
.form-select {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 .2rem rgba(78, 204, 163, .25);
}
.form-control::placeholder {
  color: var(--text-secondary);
}

/* ── 按钮 ── */
.btn-success {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: #000;
  transition: all var(--transition-smooth);
}
.btn-success:hover {
  background-color: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-outline-success {
  color: var(--accent-green);
  border-color: var(--accent-green);
  transition: all var(--transition-smooth);
}
.btn-outline-success:hover {
  background-color: var(--accent-green);
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ── 进度条 ── */
.progress {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
.progress-bar {
  background-color: var(--accent-green);
}

/* ── 代码 ── */
code {
  color: var(--accent-green);
  background-color: rgba(78, 204, 163, .1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── 表格 ── */
.table-dark {
  --bs-table-bg: var(--bg-card);
  --bs-table-border-color: var(--border-color);
}

/* ── 警告框 ── */
.alert {
  border: 1px solid;
}

/* ── Hero 区域 ── */
.hero-section {
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(78, 204, 163, .05) 0%, transparent 70%);
  pointer-events: none;
}

/* ── MOTD 模式特殊样式 ── */
.motd-banner {
  font-size: 0.95rem;
}

/* ── 更新日志内容 ── */
.changelog-content h1,
.changelog-content h2,
.changelog-content h3,
.changelog-content h4 {
  color: var(--accent-green);
}
.changelog-content li {
  margin-bottom: 4px;
}
.changelog-content code {
  font-size: 0.9rem;
}

/* ── 页脚 ── */
footer {
  font-size: 0.9rem;
}
footer a:hover {
  color: var(--accent-green) !important;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  .display-6 {
    font-size: 1.5rem;
  }
}

/* ── 滚动条 ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-green);
}

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card {
  animation: fadeIn .4s ease;
}

/* ── 选中发光 + 放大 ── */
.glow {
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(78,204,163,0.08) !important;
}
.scale-up {
  transform: scale(1.03);
}

/* ── 桌宠剪影 ── */
.pet-layer {
  position: fixed;
  inset: 0;
  z-index: 1030;
  pointer-events: none;
  overflow: hidden;
}

.zombie-pet,
.witch-pet {
  position: fixed;
  user-select: none;
  -webkit-user-drag: none;
}

.zombie-pet {
  left: var(--pet-x);
  bottom: 12px;
  width: 82px;
  height: 128px;
  cursor: crosshair;
  pointer-events: auto;
  transform: translateX(-50%);
}

.zombie-pet::after,
.witch-pet::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70%;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  filter: blur(4px);
  transform: translateX(-50%);
}

.zombie-body {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  transition: transform .25s ease, opacity .25s ease, filter .25s ease;
}

.zombie-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.zombie-art {
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.78)) drop-shadow(0 0 8px rgba(78,204,163,.16));
  animation: infectedLurch 1.15s ease-in-out infinite;
}

.zombie-pet.faces-left .zombie-body {
  transform: scaleX(-1);
}

.zombie-pet:hover .zombie-body {
  filter: drop-shadow(0 0 12px rgba(78,204,163,.25));
}

.zombie-pet.is-dead .zombie-body {
  opacity: .35;
  transform: rotate(86deg) translate(16px, 24px) scale(.85, .28);
}

.zombie-pet.faces-left.is-dead .zombie-body {
  transform: scaleX(-1) rotate(86deg) translate(16px, 24px) scale(.85, .28);
}

.zombie-eye {
  position: absolute;
  left: 45%;
  top: 20%;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(78,204,163,.75);
  box-shadow: 0 0 8px rgba(78,204,163,.75);
  opacity: .55;
}

.witch-pet {
  left: var(--witch-x);
  top: var(--witch-y);
  width: 244px;
  height: 216px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .18s ease, height .18s ease, filter .18s ease;
}

.witch-aura {
  position: absolute;
  inset: 14px 8px 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231,76,60,.22), rgba(231,76,60,.08) 38%, transparent 68%);
  opacity: .18;
  filter: blur(10px);
  transform: scale(.82);
  transition: opacity .22s ease, transform .22s ease;
}

.witch-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 50% 86%;
}

.witch-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.86)) drop-shadow(0 0 12px rgba(231,76,60,.14));
  transition: filter .16s ease, transform .16s ease;
  -webkit-user-drag: none;
}

.witch-pet.idle .witch-stage {
  animation: witchSit 2.1s ease-in-out infinite;
}

.witch-pet.disturbed .witch-stage {
  animation: witchDisturbed .45s ease-in-out infinite;
}

.witch-pet.angry .witch-stage,
.witch-pet.rise .witch-stage {
  animation: witchEnrage .16s linear infinite;
}

.witch-pet.chase {
  width: 276px;
  height: 244px;
}

.witch-pet.chase .witch-stage {
  animation: witchChase .28s ease-in-out infinite;
}

.witch-pet.attack {
  width: 310px;
  height: 274px;
  filter: drop-shadow(0 0 22px rgba(231,76,60,.35));
}

.witch-pet.attack .witch-stage {
  animation: witchAttack .46s cubic-bezier(.2,.8,.15,1) both;
}

.witch-pet.disturbed .witch-aura {
  opacity: .38;
  transform: scale(.94);
}

.witch-pet.angry .witch-aura,
.witch-pet.rise .witch-aura,
.witch-pet.chase .witch-aura,
.witch-pet.attack .witch-aura {
  opacity: .86;
  transform: scale(1.16);
}

.witch-pet.recover .witch-aura {
  opacity: .28;
  transform: scale(.92);
}

.witch-slash {
  position: absolute;
  z-index: 2;
  inset: 12% -18% 6% -18%;
  opacity: 0;
  pointer-events: none;
}

.witch-slash::before,
.witch-slash::after {
  content: '';
  position: absolute;
  left: 18%;
  top: 36%;
  width: 78%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,70,56,.18), rgba(255,70,56,.95), transparent);
  box-shadow: 0 0 18px rgba(255,70,56,.65);
  transform: rotate(-18deg);
}

.witch-slash::after {
  top: 54%;
  transform: rotate(14deg);
}

.witch-pet.attack .witch-slash {
  animation: witchSlash .46s ease both;
}

@keyframes infectedLurch {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  45% { transform: translateY(3px) rotate(1.5deg); }
  70% { transform: translateY(1px) rotate(-.5deg); }
}

@keyframes witchSit {
  0%, 100% { transform: translateY(0) scale(.98); }
  50% { transform: translateY(2px) scale(1); }
}

@keyframes witchDisturbed {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(1.2deg); }
}

@keyframes witchEnrage {
  0%, 100% { transform: translate(0,0) rotate(0deg) scale(1.02); }
  25% { transform: translate(-3px,2px) rotate(-1.8deg) scale(1.04); }
  50% { transform: translate(4px,-2px) rotate(1deg) scale(1.03); }
  75% { transform: translate(-2px,-3px) rotate(2deg) scale(1.05); }
}

@keyframes witchChase {
  0%, 100% { transform: translateX(0) rotate(-2deg) scale(1.02); }
  50% { transform: translateX(5px) rotate(2deg) scale(1.05); }
}

@keyframes witchAttack {
  0% { transform: translateX(-8px) scale(.95) rotate(-4deg); }
  45% { transform: translateX(14px) scale(1.12) rotate(5deg); }
  100% { transform: translateX(4px) scale(1.04) rotate(0deg); }
}

@keyframes witchSlash {
  0% { opacity: 0; transform: translateX(-24px) scaleX(.55); }
  35% { opacity: 1; transform: translateX(10px) scaleX(1); }
  100% { opacity: 0; transform: translateX(28px) scaleX(1.18); }
}

@media (max-width: 991.98px) {
  .pet-layer {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zombie-art,
  .witch-stage,
  .witch-pet.attack .witch-slash {
    animation: none;
  }
}
