/* ============================================================
   首页科技主题（仅作用于 index.html，body.home-page）
   在 home.css 之后加载，避免影响其它页面
   ============================================================ */

.home-page {
  --tech-ink: #04120c;
  --tech-ink-2: #072016;
  --tech-green: #22c55e;
  --tech-leaf: #4ade80;
  --tech-lime: #84cc16;
  --tech-line: rgba(52, 211, 153, 0.22);
  --tech-text: #e0f5e8;
  --tech-muted: #8fb3a1;
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(34, 197, 94, 0.12), transparent 62%),
    radial-gradient(820px 500px at 94% 4%, rgba(132, 204, 22, 0.10), transparent 62%),
    linear-gradient(180deg, #f6fcf8 0%, #edf8f1 100%);
}

.home-page .page {
  padding-top: var(--header-height);
  padding-bottom: 40px;
}

/* 内容区容器：绿色渐变面板，承接首页整体绿色主题 */
.home-page .page > .container {
  padding-bottom: 28px;
  border: 1px solid rgba(34, 197, 94, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(620px 280px at 0% 0%, rgba(34, 197, 94, 0.12), transparent 70%),
    radial-gradient(560px 260px at 100% 100%, rgba(132, 204, 22, 0.10), transparent 72%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.94) 0%, rgba(232, 248, 238, 0.90) 46%, rgba(214, 241, 224, 0.86) 100%);
  box-shadow: 0 22px 55px rgba(9, 60, 36, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---------- Header ---------- */
.home-page .header {
  background: rgba(4, 18, 12, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tech-line);
  box-shadow: 0 10px 30px rgba(3, 24, 14, 0.25);
}

.home-page .logo { color: #effdf4; }
.home-page .logo:hover { color: #ffffff; }

.home-page .logo-icon {
  background: linear-gradient(135deg, #22c55e, #84cc16);
  color: #04140c;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}

.home-page .logo-icon svg { width: 18px; height: 18px; }

.home-page .header-nav a { color: #c2ddcf; }
.home-page .header-nav a:hover {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}
.home-page .header-nav .badge { background: #15803d; }
.home-page .menu-toggle span { background: #c2ddcf; }
.home-page .menu-overlay { background: rgba(2, 12, 7, 0.55); }

@media (max-width: 1024px) {
  .home-page .header-nav {
    /* header 的 backdrop-filter 会让 fixed 子元素以 header 为包含块，
       这里显式撑满视口，避免移动端侧边导航只有 header 高度 */
    height: 100vh;
    height: 100dvh;
    background: rgba(4, 22, 14, 0.98);
    border-left: 1px solid var(--tech-line);
    box-shadow: -10px 0 40px rgba(0, 16, 8, 0.35);
  }
  .home-page .header-nav a { border-bottom-color: rgba(52, 211, 153, 0.12); }
  /* 抽屉展开后会覆盖汉堡按钮，提升层级让其仍可点击关闭 */
  .home-page .menu-toggle { position: relative; z-index: 100; }
}

/* ---------- Hero carousel ---------- */
.hero-carousel {
  position: relative;
  height: clamp(450px, 66vh, 600px);
  overflow: hidden;
  isolation: isolate;
  background: var(--tech-ink);
  outline: none;
}

.hero-carousel:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.55);
}

/* 后台未配置轮播时隐藏轮播区，并取消统计面板的上浮 */
.home-page .hero-carousel.is-empty { display: none; }
.home-page.no-hero .stats-bar { margin-top: 24px; }

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.9s ease, visibility 0.9s;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide-media {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  filter: saturate(1.05) contrast(1.02);
}

.hero-slide.is-active .hero-slide-media {
  animation: heroKenBurns 8s ease-out forwards;
}

@keyframes heroKenBurns {
  from { transform: scale(1.03); }
  to { transform: scale(1.11); }
}

/* 暗色遮罩：保证文字可读 */
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(3, 16, 10, 0.94) 0%, rgba(3, 16, 10, 0.78) 38%, rgba(3, 16, 10, 0.3) 72%, rgba(3, 16, 10, 0.55) 100%),
    linear-gradient(0deg, rgba(3, 16, 10, 0.85) 0%, rgba(3, 16, 10, 0) 46%);
}

.hero-slide-inner {
  position: relative;
  z-index: 3;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  color: var(--tech-text);
}

/* ---------- 品牌页 ---------- */
.hero-slide-brand {
  background:
    radial-gradient(900px 440px at 78% 38%, rgba(34, 197, 94, 0.22), transparent 62%),
    radial-gradient(720px 400px at 16% 74%, rgba(132, 204, 22, 0.16), transparent 64%),
    linear-gradient(120deg, #04120c 0%, #082a1b 56%, #04170f 100%);
}

.hero-slide-brand::after {
  background:
    linear-gradient(0deg, rgba(3, 16, 10, 0.86) 0%, rgba(3, 16, 10, 0) 55%),
    linear-gradient(100deg, rgba(3, 16, 10, 0.6) 0%, rgba(3, 16, 10, 0.05) 70%);
}

.hero-slide-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(52, 211, 153, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.09) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 62% 46%, #000 18%, transparent 76%);
  mask-image: radial-gradient(ellipse at 62% 46%, #000 18%, transparent 76%);
  animation: heroGridDrift 22s linear infinite;
}

@keyframes heroGridDrift {
  to { background-position: 56px 56px, 56px 56px; }
}

/* 装饰轨道环 */
.hero-deco {
  position: absolute;
  right: 5%;
  top: 50%;
  width: min(46vw, 540px);
  aspect-ratio: 1 / 1;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  opacity: 0.9;
}

.hero-deco span {
  position: absolute;
  inset: 0;
  border: 10px solid rgba(52, 211, 153, 0.18);
  border-radius: 50%;
}

.hero-deco span:nth-child(1) {
  border-style: dashed;
  animation: heroSpin 28s linear infinite;
}

.hero-deco span:nth-child(2) {
  inset: 15%;
  border-color: rgba(52, 211, 153, 0.18);
  animation: heroSpin 36s linear infinite reverse;
}

.hero-deco span:nth-child(3) {
  inset: 31%;
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: inset 0 0 70px rgba(34, 197, 94, 0.12), 0 0 40px rgba(34, 197, 94, 0.1);
  animation: heroPulse 5.5s ease-in-out infinite;
}

@keyframes heroSpin { to { transform: rotate(360deg); } }
@keyframes heroPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ---------- 轮播文字 ---------- */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #86efac;
}

.hero-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #22c55e);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.hero-title {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f0fdf4;
  background: linear-gradient(180deg, #ffffff 28%, #bbf7d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 30px rgba(34, 197, 94, 0.16));
}

.hero-slide-cover .hero-title {
  max-width: 22ch;
  font-size: clamp(1.55rem, 2.9vw, 2.5rem);
  line-height: 1.24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-desc {
  max-width: 54ch;
  margin: 0;
  color: #a9c9b8;
  font-size: 1rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
  color: #86a897;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.hero-btn-primary {
  background: linear-gradient(135deg, #22c55e, #84cc16);
  color: #04140c;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.28);
}

.hero-btn-primary:hover {
  color: #04140c;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(34, 197, 94, 0.4);
}

.hero-btn-ghost {
  border-color: rgba(167, 201, 182, 0.35);
  background: rgba(6, 26, 17, 0.3);
  color: #d9f3e4;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hero-btn-ghost:hover {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.08);
  color: #9df5b8;
}

/* ---------- 轮播控件 ---------- */
.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(167, 201, 182, 0.28);
  border-radius: 50%;
  background: rgba(4, 20, 12, 0.5);
  color: #d9f3e4;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.hero-arrow svg { width: 20px; height: 20px; }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }

.hero-carousel:hover .hero-arrow,
.hero-carousel:focus-within .hero-arrow { opacity: 1; }

.hero-arrow:hover {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 62px;
  z-index: 7;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-dots[hidden] { display: none; }

.hero-dot {
  position: relative;
  width: 26px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: width 0.3s ease;
}

.hero-dot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  border-radius: 99px;
  background: rgba(203, 246, 225, 0.28);
  transform: translateY(-50%);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.hero-dot.is-active {
  width: 44px;
  background: transparent;
  box-shadow: none;
}

.hero-dot.is-active::after {
  background: linear-gradient(90deg, #22c55e, #84cc16);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.hero-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 7;
  height: 2px;
  background: rgba(167, 201, 182, 0.12);
}

.hero-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  transform: scaleX(0);
  transform-origin: left;
}

.hero-carousel.is-running .hero-progress i {
  animation: heroProgress 6s linear forwards;
}

.hero-carousel.is-paused .hero-progress i { animation-play-state: paused; }
.hero-carousel.no-auto .hero-progress { display: none; }

@keyframes heroProgress { to { transform: scaleX(1); } }

/* ---------- Stats ---------- */
.home-page .stats-bar {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 0;
  margin: -52px 0 28px;
  padding: 26px 10px;
  border: 1px solid rgba(52, 211, 153, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(5, 26, 17, 0.97), rgba(4, 18, 12, 0.96));
  box-shadow: 0 24px 60px rgba(3, 24, 14, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.home-page .stats-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(52, 211, 153, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 80%);
  pointer-events: none;
}

.home-page .stat-item {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 2px 16px;
  text-align: center;
  transition: transform 0.25s ease;
}

.home-page .stat-item:hover { transform: translateY(-2px); }

.home-page .stat-item + .stat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, transparent, rgba(52, 211, 153, 0.3), transparent);
  transform: translateY(-50%);
}

.home-page .stat-num {
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #86efac;
  background: linear-gradient(180deg, #f0fdf4, #86efac);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-page .stat-label {
  margin-top: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--tech-muted);
}

/* ---------- Section head ---------- */
.home-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 6px 0 18px;
}

.home-section-head h2 {
  position: relative;
  padding-left: 14px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #123d28;
}

.home-section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #22c55e, #84cc16);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
  transform: translateY(-50%);
}

.home-section-head .en {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #4f7a62;
}

.home-section-head .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.3), transparent);
}

/* ---------- Quick entry cards ---------- */
.home-page .quick-grid { gap: 16px; margin-bottom: 8px; }

.home-page .quick-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  overflow: hidden;
  border: 1px solid rgba(22, 101, 52, 0.14);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 252, 246, 0.92));
  box-shadow: 0 8px 24px rgba(9, 60, 36, 0.07);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-page .quick-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.home-page .quick-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.home-page .quick-card:hover {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 18px 42px rgba(8, 70, 40, 0.16);
  color: inherit;
  transform: translateY(-4px);
}

.home-page .quick-card:hover::before,
.home-page .quick-card:hover::after { opacity: 1; }

.home-page .quick-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(34, 197, 94, 0.16), rgba(52, 211, 153, 0.12));
  color: #15803d;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-page .quick-icon svg { width: 24px; height: 24px; }

.home-page .quick-card:hover .quick-icon {
  border-color: transparent;
  background: linear-gradient(135deg, #22c55e, #84cc16);
  color: #04140c;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.home-page .quick-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.home-page .quick-text strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #123d28;
}

.home-page .quick-text em {
  font-style: normal;
  font-size: 0.82rem;
  color: #52755f;
}

.home-page .quick-index {
  margin-left: auto;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: #7f9f8c;
}

.home-page .quick-arrow {
  margin-left: 6px;
  font-size: 1.15rem;
  color: #4f7a62;
  transition: color 0.25s ease, transform 0.25s ease;
}

.home-page .quick-card:hover .quick-arrow {
  color: #15803d;
  transform: translateX(4px);
}

/* ---------- Footer ---------- */
.home-page .footer {
  margin-top: 48px;
  border-top: 1px solid rgba(52, 211, 153, 0.14);
  background: linear-gradient(180deg, rgba(4, 18, 12, 0), rgba(4, 18, 12, 0.04));
  color: #4f7a62;
  letter-spacing: 0.08em;
}

/* ---------- Reveal ---------- */
.home-page .reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: homeReveal 0.7s ease forwards;
  animation-delay: var(--d, 0s);
}

@keyframes homeReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* 不支持文字渐变时回退为纯色，避免文字不可见 */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero-title,
  .home-page .stat-num {
    background: none;
    color: #f0fdf4;
    -webkit-text-fill-color: currentColor;
    filter: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-deco { right: -8%; width: min(60vw, 460px); opacity: 0.6; }
}

@media (max-width: 768px) {
  .hero-carousel { height: clamp(500px, 80vh, 620px); }

  .hero-slide-inner {
    justify-content: flex-end;
    padding: 0 20px 64px;
    gap: 12px;
  }

  .hero-slide-brand::before { background-size: 40px 40px; }
  .hero-deco { right: -22%; top: 34%; width: 320px; opacity: 0.45; }
  .hero-title { max-width: 100%; }
  .hero-slide-cover .hero-title { max-width: 100%; }
  .hero-desc { font-size: 0.92rem; }
  .hero-arrow { display: none; }
  .hero-dots { bottom: 42px; }

  .home-page .stats-bar {
    margin-top: -28px;
    padding: 18px 6px;
    flex-wrap: wrap;
    row-gap: 14px;
  }

  .home-page .stat-item { flex: 1 1 42%; padding: 6px 8px; }
  .home-page .stat-item + .stat-item::before { display: none; }
  .home-page .stat-label { letter-spacing: 0.08em; }

  .home-page .quick-card { padding: 18px; }
  .home-page .quick-index { display: none; }
}

@media (max-width: 480px) {
  .hero-actions { width: 100%; }
  .hero-btn { flex: 1 1 auto; justify-content: center; padding: 11px 18px; }
  .home-section-head .en { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-slide-media,
  .hero-slide-brand::before,
  .hero-deco span { animation: none !important; }

  .hero-slide { transition: none; }
  .home-page .reveal { opacity: 1; transform: none; animation: none; }
  .hero-btn,
  .home-page .quick-card,
  .home-page .quick-icon,
  .home-page .quick-arrow { transition: none; }
}
