/* ============================================
   404 错误页样式
   ============================================ */

/* ---------- 主区域 ---------- */
.error-section {
  position: relative;
  min-height: calc(100vh - var(--header-topbar-h) - var(--header-main-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f7f3 0%, #eef6f1 50%, #faf5ec 100%);
}

/* ---------- 装饰背景 ---------- */
.error-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.error-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: errorFloat 12s ease-in-out infinite;
}

.error-bg-blob-1 {
  top: -10%;
  left: -8%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 128, 96, 0.18), transparent 70%);
  animation-delay: 0s;
}

.error-bg-blob-2 {
  bottom: -15%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(201, 152, 88, 0.18), transparent 70%);
  animation-delay: -6s;
}

.error-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 128, 96, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 128, 96, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
}

@keyframes errorFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
}

/* ---------- 主内容 ---------- */
.error-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* ---------- 404 数字插画 ---------- */
.error-illust {
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: center;
}

.error-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-weight: 900;
  line-height: 1;
  user-select: none;
}

.error-num {
  font-size: clamp(96px, 18vw, 180px);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
  filter: drop-shadow(0 6px 20px rgba(0, 128, 96, 0.18));
  animation: errorNumIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.error-num-4 { animation-delay: 0.1s; }
.error-num-last { animation-delay: 0.3s; }

@keyframes errorNumIn {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 中间 "0" 替换为图标圆环 */
.error-zero {
  width: clamp(96px, 18vw, 180px);
  height: clamp(96px, 18vw, 180px);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff 0%, #f0f7f3 100%);
  border: 4px solid transparent;
  background-clip: padding-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0, 128, 96, 0.15),
    0 12px 40px rgba(0, 128, 96, 0.12);
  animation: errorNumIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             errorSpin 0.6s ease-out 0.9s both;
}

.error-zero::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  z-index: -1;
}

.error-zero-icon {
  font-size: clamp(40px, 7vw, 72px);
  color: var(--color-primary);
  animation: errorBounce 2.5s ease-in-out 1.2s infinite;
}

@keyframes errorSpin {
  0% { transform: rotate(-180deg) scale(0.8); }
  100% { transform: rotate(0) scale(1); }
}

@keyframes errorBounce {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-6px) rotate(8deg); }
}

/* ---------- 文案 ---------- */
.error-title {
  font-size: var(--font-size-2xl);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-3);
  animation: errorFadeUp 0.6s ease 0.5s both;
}

.error-desc {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto var(--space-6);
  animation: errorFadeUp 0.6s ease 0.65s both;
}

@keyframes errorFadeUp {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------- 按钮组 ---------- */
.error-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  animation: errorFadeUp 0.6s ease 0.8s both;
}

.error-actions .btn {
  min-width: 160px;
}

.error-actions .btn i {
  margin-right: 6px;
  font-size: 0.95em;
}

/* ---------- 推荐入口 ---------- */
.error-suggest {
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  animation: errorFadeUp 0.6s ease 0.95s both;
}

.error-suggest-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-4);
  padding-left: var(--space-2);
}

.error-suggest-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.error-suggest-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  color: var(--color-text);
}

.error-suggest-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
}

.error-suggest-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg, rgba(0, 128, 96, 0.1));
  color: var(--icon-color, var(--color-primary));
  font-size: 18px;
  transition: transform var(--transition-base);
}

.error-suggest-item:hover .error-suggest-icon {
  transform: scale(1.08) rotate(-4deg);
}

.error-suggest-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.error-suggest-text strong {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.error-suggest-text small {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.error-suggest-arrow {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  transition: transform var(--transition-base), color var(--transition-base);
}

.error-suggest-item:hover .error-suggest-arrow {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .error-section {
    min-height: auto;
    padding: var(--space-10) 0 var(--space-8);
  }

  .error-content {
    padding: 0 var(--space-2);
  }

  .error-number {
    gap: var(--space-2);
  }

  .error-num,
  .error-zero {
    font-size: clamp(72px, 24vw, 120px);
    width: clamp(72px, 24vw, 120px);
    height: clamp(72px, 24vw, 120px);
  }

  .error-zero-icon {
    font-size: clamp(28px, 10vw, 48px);
  }

  .error-title {
    font-size: var(--font-size-xl);
  }

  .error-suggest {
    padding: var(--space-4);
  }

  .error-suggest-list {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .error-actions {
    flex-direction: column;
    width: 100%;
  }

  .error-actions .btn {
    width: 100%;
  }

  .error-suggest-item {
    padding: var(--space-3);
  }
}

@media (max-width: 480px) {
  .error-bg-blob {
    filter: blur(40px);
  }

  .error-bg-blob-1 {
    width: 280px;
    height: 280px;
  }

  .error-bg-blob-2 {
    width: 320px;
    height: 320px;
  }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {

  .error-bg-blob,
  .error-zero-icon,
  .error-num,
  .error-zero,
  .error-title,
  .error-desc,
  .error-actions,
  .error-suggest {
    animation: none !important;
  }
}
