/**
 * 门户 404 页：独立样式，不依赖站点基础包，保证错误场景下首屏轻量、可预期。
 * 强调色与整站主题绿一致（#058951 / #06a35f，与 wave-spring-design、online-message 等页相同）。
 */

:root {
  /* 深色底略带绿，与主色同色相，避免再偏蓝 */
  --e404-bg0: #060b08;
  --e404-accent: #058951;
  --e404-accent-bright: #06a35f;
  --e404-accent-dim: rgba(5, 137, 81, 0.42);
  --e404-text: #e8eef8;
  --e404-muted: rgba(232, 238, 248, 0.62);
  --e404-card: rgba(8, 22, 16, 0.78);
  --e404-border: rgba(5, 137, 81, 0.28);
  --e404-glow: rgba(5, 137, 81, 0.16);
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--e404-text);
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: radial-gradient(120% 80% at 50% 0%, #0f2418 0%, var(--e404-bg0) 48%, #020302 100%);
  overflow-x: hidden;
}

/* 背景：细网格 + 径向光晕，与主题绿同色系 */
.e404-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(5, 137, 81, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 137, 81, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, black 20%, transparent 70%);
}

.e404-scene::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 20%, var(--e404-glow), transparent 55%);
  opacity: 0.95;
}

@media (prefers-reduced-motion: no-preference) {
  .e404-scene {
    animation: e404-grid-drift 28s linear infinite;
  }
}

@keyframes e404-grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 48px 48px, 48px 48px;
  }
}

.e404-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.e404-panel {
  width: min(100%, 520px);
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 16px;
  border: 1px solid var(--e404-border);
  background: var(--e404-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 12px 28px -8px rgba(5, 137, 81, 0.06);
}

/* 状态角标：与站点主色一致 */
.e404-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--e404-accent-bright);
  border: 1px solid var(--e404-border);
  border-radius: 999px;
  background: rgba(5, 137, 81, 0.08);
}

.e404-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--e404-accent-bright);
  box-shadow: 0 0 10px rgba(5, 137, 81, 0.65);
}

.e404-heading {
  margin: 0 0 0.75rem;
  font-size: inherit;
  font-weight: normal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* 大号 404：等宽数字 + 主题色光晕 */
.e404-code {
  display: block;
  margin: 0 0 0.35rem;
  font-family: "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: clamp(4rem, 14vw, 5.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow:
    0 0 40px var(--e404-accent-dim),
    0 0 80px rgba(5, 137, 81, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
  .e404-code {
    animation: e404-code-pulse 4s ease-in-out infinite;
  }
}

@keyframes e404-code-pulse {
  0%,
  100% {
    text-shadow:
      0 0 40px var(--e404-accent-dim),
      0 0 80px rgba(5, 137, 81, 0.14);
  }
  50% {
    text-shadow:
      0 0 52px rgba(5, 137, 81, 0.48),
      0 0 100px rgba(5, 137, 81, 0.22);
  }
}

.e404-title {
  display: block;
  margin: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.e404-desc {
  margin: 0 0 1.75rem;
  color: var(--e404-muted);
  font-size: 0.95rem;
}

.e404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* 主按钮：与站内「提交 / 确认」渐变一致 */
.e404-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--e404-accent-bright) 0%, var(--e404-accent) 100%);
  box-shadow: 0 4px 20px rgba(5, 137, 81, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.e404-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 28px rgba(5, 137, 81, 0.45);
}

.e404-btn:focus-visible {
  outline: 2px solid var(--e404-accent);
  outline-offset: 3px;
}

.e404-btn--ghost {
  color: var(--e404-text);
  background: transparent;
  border: 1px solid rgba(232, 238, 248, 0.22);
  box-shadow: none;
  font-weight: 500;
}

.e404-btn--ghost:hover {
  border-color: rgba(5, 137, 81, 0.45);
  background: rgba(5, 137, 81, 0.1);
  box-shadow: none;
  filter: none;
}

.e404-meta {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Cascadia Mono", "SF Mono", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(232, 238, 248, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .e404-scene,
  .e404-code {
    animation: none !important;
  }

  .e404-btn {
    transition: none;
  }
}
