/* ============================================================
   小树时钟 · 暗夜森林设计系统
   Midnight Forest Design System — Little Tree Clock
   ============================================================ */

:root {
  /* 色板：深夜森林 */
  --forest-950: #030806;
  --forest-900: #050c09;
  --forest-850: #081310;
  --forest-800: #0c1a15;
  --forest-700: #12241d;

  --ink: #ecf4ee;
  --sage: #93a89b;
  --sage-dim: #63766b;

  /* 主色：新芽绿（品牌色演化） */
  --sprout: #3ee2a4;
  --sprout-strong: #6ff0bd;
  --sprout-deep: #17b982;
  --sprout-dim: rgba(62, 226, 164, 0.12);

  /* 点缀色：萤火暖金 */
  --firefly: #ffcf6b;
  --firefly-strong: #ffe09a;
  --firefly-dim: rgba(255, 207, 107, 0.10);

  --line: rgba(236, 244, 238, 0.08);
  --line-strong: rgba(236, 244, 238, 0.14);
  --card: rgba(236, 244, 238, 0.028);
  --card-2: rgba(236, 244, 238, 0.055);
  --glass: rgba(7, 14, 11, 0.72);

  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
  --font-grotesk: 'Space Grotesk', 'Noto Sans SC', sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 0;
  --nav-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--forest-900);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sprout); color: #05281b; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--forest-950); }
::-webkit-scrollbar-thumb {
  background: var(--forest-700);
  border-radius: 0;
  border: 2px solid var(--forest-950);
}
::-webkit-scrollbar-thumb:hover { background: var(--sprout-deep); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--sprout); outline-offset: 2px; }

/* ---------- 背景层 ---------- */
#forest-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- 字体工具 ---------- */
.font-serif { font-family: var(--font-serif); }
.grotesk { font-family: var(--font-grotesk); }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 14px 20px 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-radius: 0;
  border: 1px solid transparent;
  transition: all 0.45s var(--ease);
}

.nav.scrolled .nav-inner {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--line);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--line-strong), 0 4px 14px rgba(0, 0, 0, 0.4);
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-family: var(--font-grotesk);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--sage-dim);
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-link {
  padding: 8px 14px;
  border-radius: 0;
  font-size: 14px;
  color: var(--sage);
  transition: all 0.25s ease;
  position: relative;
}

.nav-link:hover { color: var(--ink); background: var(--card-2); }
.nav-link.active { color: var(--sprout); }

.nav-link.nav-cta {
  color: #05281b;
  background: linear-gradient(135deg, var(--sprout-strong), var(--sprout-deep));
  font-weight: 600;
  margin-left: 6px;
  box-shadow: 0 4px 16px rgba(62, 226, 164, 0.22);
}

.nav-link.nav-cta:hover {
  color: #05281b;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(62, 226, 164, 0.32);
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 0;
  color: var(--sage);
  border: 1px solid var(--line);
  background: var(--card);
  transition: all 0.25s ease;
  font-size: 15px;
}

.icon-btn:hover {
  color: var(--sprout);
  border-color: rgba(62, 226, 164, 0.3);
  transform: translateY(-1px);
}

/* ---------- 语言切换 ---------- */
.lang-toggle {
  display: flex;
  padding: 3px;
  border-radius: 0;
  background: var(--card);
  border: 1px solid var(--line);
}

.lang-btn {
  padding: 5px 13px;
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sage);
  transition: all 0.25s ease;
}

.lang-btn.active { background: var(--sprout); color: #05281b; }
.lang-btn:not(.active):hover { color: var(--ink); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sprout-strong) 0%, var(--sprout-deep) 100%);
  color: #05281b;
  box-shadow: 0 10px 30px rgba(62, 226, 164, 0.22);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.7s var(--ease);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(62, 226, 164, 0.35); }
.btn-primary:hover::after { transform: translateX(110%); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(236, 244, 238, 0.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover:not([disabled]) {
  background: var(--card-2);
  border-color: rgba(62, 226, 164, 0.3);
  transform: translateY(-2px);
}

.btn[disabled], .btn.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn[disabled]::after { display: none; }

.download-btn-wrap { position: relative; display: inline-flex; }

.recommend-badge {
  position: absolute;
  top: -11px;
  right: -8px;
  z-index: 5;
  background: linear-gradient(135deg, var(--firefly-strong), var(--firefly));
  color: #3a2a05;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 11px;
  border-radius: 0;
  box-shadow: 0 4px 14px rgba(255, 207, 107, 0.35);
  pointer-events: none;
}

/* ---------- 布局与区块 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; width: 100%; }

.section {
  position: relative;
  z-index: 10;
  padding: 110px 24px;
  scroll-margin-top: 80px;
}

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-grotesk);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sprout);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sprout));
}

.section-head.center .eyebrow::after {
  content: '';
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--sprout), transparent);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--sage);
  font-size: 15.5px;
  line-height: 1.8;
  text-wrap: pretty;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.4s var(--ease);
  position: relative;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card:hover {
  background: var(--card-2);
  border-color: rgba(62, 226, 164, 0.22);
  transform: translateY(-3px);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 0;
  background: var(--sprout-dim);
  color: var(--sprout);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}

/* ---------- 呼吸点 ---------- */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sprout);
  flex-shrink: 0;
  animation: pulseDot 2.4s ease-out infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(62, 226, 164, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(62, 226, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 226, 164, 0); }
}

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.in-view { opacity: 1; transform: none; }

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(3, 8, 6, 0.72));
  padding: 56px 24px 30px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-brand { max-width: 320px; }

.footer-desc {
  color: var(--sage-dim);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 14px;
}

.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }

.footer-col h5 {
  font-family: var(--font-grotesk);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sage-dim);
  margin-bottom: 16px;
  font-weight: 500;
}

.footer-col a {
  display: block;
  color: var(--sage);
  font-size: 14px;
  padding: 5px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--sprout); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--sage-dim);
  font-size: 12.5px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .brand-sub { display: none; }
}

@media (max-width: 640px) {
  .section { padding: 80px 18px; }
  .nav { padding: 10px 12px 0; }
  .nav-inner { padding: 8px 8px 8px 12px; gap: 8px; }
  .nav-actions .icon-btn { display: none; }
  .btn { padding: 13px 22px; font-size: 14px; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
