/* ============================================
   织叶莺插件 - 主样式表
   ============================================ */

/* ----- CSS 变量 ----- */
:root {
  --primary: #014f28;
  --primary-light: #018a42;
  --primary-dark: #003820;
  --primary-lighter: #e8f5ee;

  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08), 0 4px 10px -4px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 40px -5px rgba(0,0,0,.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --max-width: 1200px;
  --nav-height: 64px;
}

/* ----- 全局重置 ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ----- 通用容器 ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- 通用区块 ----- */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 1.1rem;
  margin-bottom: 56px;
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: transparent;
  transition: background .35s ease, box-shadow .35s ease;
}

.navbar.scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.nav-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* 桌面导航链接 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: .95rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: color .2s, background .2s;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-lighter);
}

.nav-link.active {
  color: var(--primary);
}

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  z-index: 2;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(160deg, #eaf7f0 0%, #d4efe0 30%, #f0faf4 60%, var(--white) 100%);
  position: relative;
  padding: 100px 24px 60px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 28px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}

.hero-slogan {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* 滚动提示箭头 */
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  color: var(--gray-400);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: background .25s, transform .2s, box-shadow .25s;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(1,79,40,.3);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(1,79,40,.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 18px 48px;
  font-size: 1.15rem;
}

/* ============================================
   平台卡片网格
   ============================================ */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.platform-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 28px 16px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
  cursor: default;
}

.platform-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.platform-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
  user-select: none;
}

.platform-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* ============================================
   功能卡片
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  color: var(--primary);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.feature-desc {
  font-size: .95rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ============================================
   使用说明步骤
   ============================================ */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 860px;
  margin: 0 auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(1,79,40,.25);
}

.step-body {
  padding: 0 12px;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.step-desc {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--gray-200);
  margin-top: 27px;
  flex-shrink: 0;
}

/* ============================================
   下载区域
   ============================================ */
.download {
  background: var(--primary);
  text-align: center;
}

.download-title {
  color: var(--white);
}

.download-desc {
  color: rgba(255,255,255,.8);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.download .btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

.download .btn-primary:hover {
  background: var(--gray-50);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.download-version {
  margin-top: 20px;
  font-size: .85rem;
  color: rgba(255,255,255,.55);
}

/* ============================================
   页脚
   ============================================ */
.footer {
  background: var(--primary-dark);
  padding: 28px 0;
  text-align: center;
}

.footer-text {
  font-size: .9rem;
  color: rgba(255,255,255,.65);
}

/* ============================================
   滚动渐入动画
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1),
              transform .7s cubic-bezier(.22,1,.36,1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 错开动画延迟 */
.platforms-grid .fade-in:nth-child(1) { transition-delay: 0ms; }
.platforms-grid .fade-in:nth-child(2) { transition-delay: 60ms; }
.platforms-grid .fade-in:nth-child(3) { transition-delay: 120ms; }
.platforms-grid .fade-in:nth-child(4) { transition-delay: 180ms; }
.platforms-grid .fade-in:nth-child(5) { transition-delay: 240ms; }
.platforms-grid .fade-in:nth-child(6) { transition-delay: 300ms; }
.platforms-grid .fade-in:nth-child(7) { transition-delay: 360ms; }
.platforms-grid .fade-in:nth-child(8) { transition-delay: 420ms; }
.platforms-grid .fade-in:nth-child(9) { transition-delay: 480ms; }
.platforms-grid .fade-in:nth-child(10) { transition-delay: 540ms; }

.features-grid .fade-in:nth-child(1) { transition-delay: 0ms; }
.features-grid .fade-in:nth-child(2) { transition-delay: 100ms; }
.features-grid .fade-in:nth-child(3) { transition-delay: 200ms; }

.steps .fade-in { transition-delay: 80ms; }

/* ============================================
   响应式: ≤768px
   ============================================ */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: .95rem;
    margin-bottom: 36px;
  }

  /* 移动导航 */
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 72%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    transition: right .35s ease;
    padding: 40px;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-link {
    display: block;
    font-size: 1.1rem;
    padding: 12px 20px;
    text-align: center;
  }

  /* Hero */
  .hero-title {
    font-size: 2rem;
  }

  .hero-slogan {
    font-size: 1rem;
  }

  .hero-logo {
    width: 72px;
    height: 72px;
  }

  /* 平台卡片: 2-3列 */
  .platforms-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .platform-card {
    padding: 20px 10px 16px;
  }

  .platform-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .platform-name {
    font-size: .82rem;
  }

  /* 功能卡片: 单列 */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .feature-card {
    padding: 32px 24px;
  }

  /* 步骤: 纵向 */
  .steps {
    flex-direction: column;
    align-items: center;
  }

  .step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    width: 100%;
    max-width: 360px;
  }

  .step-number {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .step-body {
    padding: 0;
  }

  .step-line {
    width: 2px;
    height: 28px;
    margin: 0 0 0 21px;
  }

  /* 下载 */
  .download {
    padding: 64px 0;
  }

  .btn {
    padding: 12px 28px;
    font-size: .95rem;
  }

  .btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
