/* ===== 基础重置 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== 主题变量(清新天空 / 天使系) ===== */
:root {
  --sky-1: #b8e0f5;         /* 浅天蓝 */
  --sky-2: #7cc4e8;         /* 天空蓝 */
  --sky-3: #4fa8d8;         /* 较深天蓝 */
  --accent-soft: #ffe0ec;   /* 飘散花瓣粉(点缀) */
  --bg-fallback: #b8e0f5;   /* 背景图缺失兜底色:天蓝 */
  --text: #2c3e50;          /* 深蓝灰(卡片正文) */
  --text-soft: #5a6c7d;     /* 次要文字 */
  --text-light: #ffffff;    /* 标题/特殊元素白字 */
  --text-muted: #ffffff;    /* 副标题:在天空背景上仍用白+阴影 */
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 8px 32px rgba(80, 150, 200, 0.28);
  --glass-shadow-hover: 0 14px 44px rgba(124, 196, 232, 0.65);
  --font-stack: "Yu Gothic", "Hiragino Sans", "Microsoft YaHei",
    "PingFang SC", system-ui, -apple-system, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background-color: var(--bg-fallback);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* ===== 背景层(承载动漫背景图) ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('../assets/bg3.jpg') center / cover no-repeat,
    linear-gradient(135deg, #b8e0f5 0%, #7cc4e8 100%);
  background-blend-mode: overlay;
  filter: brightness(0.95) saturate(1.05);
  transform: scale(1.05);
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(184, 224, 245, 0.10) 0%,
    rgba(124, 196, 232, 0.05) 50%,
    rgba(79, 168, 216, 0.18) 100%
  );
  pointer-events: none;
}

/* ===== 容器 ===== */
.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 4rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

/* ===== 标题区 ===== */
.site-header {
  text-align: center;
  margin-top: 1rem;
}

.site-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #e8f6ff 30%,
    #b8e0f5 60%,
    #ffffff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 4px 24px rgba(79, 168, 216, 0.4),
    0 1px 2px rgba(255, 255, 255, 0.6);
  margin-bottom: 0.6rem;
  animation: titleFadeIn 0.8s ease-out;
}

.site-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-shadow:
    0 2px 12px rgba(79, 168, 216, 0.55),
    0 1px 3px rgba(40, 80, 120, 0.4);
  animation: titleFadeIn 0.8s ease-out 0.15s both;
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1000px;
}

/* ===== 服务卡片 ===== */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem 1.5rem;
  min-height: 170px;
  text-decoration: none;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s ease, border-color 0.3s ease,
    background-color 0.3s ease;
  overflow: hidden;
  animation: cardFadeIn 0.6s ease-out both;
}

/* 卡片光晕装饰 */
.service-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--glass-shadow-hover);
  border-color: rgba(124, 196, 232, 0.9);
  background: rgba(255, 255, 255, 0.78);
  outline: none;
}

.service-card:hover::before,
.service-card:focus-visible::before {
  opacity: 1;
}

/* 卡片内容 */
.card-icon {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(79, 168, 216, 0.3));
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  display: block;
  width: 48px;
  height: 48px;
}

.card-icon-emoji {
  display: inline-block;
  font-size: 2.8rem;
  line-height: 1;
}

.service-card:hover .card-icon {
  transform: scale(1.12) rotate(-4deg);
}

.card-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.4;
  max-width: 90%;
}

/* 卡片入场动画(按序号错开) */
.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.12s; }
.service-card:nth-child(3) { animation-delay: 0.19s; }
.service-card:nth-child(4) { animation-delay: 0.26s; }
.service-card:nth-child(5) { animation-delay: 0.33s; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== 页脚 ===== */
.site-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: center;
}

/* 页脚行间距 */
.site-footer p {
  margin: 0;
}

/* ICP 备案链接 - 显著展示 */
.site-footer .beian {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-footer .beian a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  color: var(--text);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(79, 168, 216, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease, border-color 0.25s ease;
}

.site-footer .beian a:hover,
.site-footer .beian a:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--sky-2);
  box-shadow: 0 8px 24px rgba(124, 196, 232, 0.55);
  outline: none;
}

.beian-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(40, 80, 120, 0.35));
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .container {
    padding: 3rem 1rem 1.5rem;
    gap: 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .service-card {
    min-height: 140px;
    padding: 1.6rem 1.2rem;
  }

  .card-icon {
    font-size: 2.4rem;
  }
}

/* ===== 可访问性:尊重用户降低动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== 不支持 backdrop-filter 的浏览器降级 ===== */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .service-card {
    background: rgba(255, 255, 255, 0.45);
  }
}
