/* ============================================================
   拼豆星球 官网首页样式
   适配：PC (≥1024px) / 平板 (768-1023px) / 移动端 (<768px)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #2979ff;
  --primary-light: #e8f0fe;
  --primary-dark:  #1a56db;
  --accent2:       #7c3aed;
  --text:          #1f2937;
  --text-muted:    #6b7280;
  --bg:            #ffffff;
  --bg-soft:       #f8faff;
  --border:        #e5e7eb;
  --radius:        16px;
  --shadow:        0 4px 24px rgba(41,121,255,0.10);
  --shadow-lg:     0 12px 48px rgba(41,121,255,0.16);
  --nav-h:         64px;
  --max-w:         1140px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── 工具类 ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229,231,235,0.55);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.08); }

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img {
  width: 36px; height: 36px;
  object-fit: contain;
}
.nav-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* 桌面导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
  white-space: nowrap;
}
.nav-btn-outline {
  color: var(--primary);
  background: var(--primary-light);
}
.nav-btn-outline:hover { background: #d4e4ff; }

.nav-btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(41,121,255,0.28);
}
.nav-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(41,121,255,0.38);
}

/* 汉堡菜单（移动端） */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: var(--primary-light); }
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端抽屉菜单 */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 199;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  animation: slideDown 0.25s ease;
}
.nav-drawer.open { display: flex; }
.nav-drawer .nav-link {
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 12px;
}
.nav-drawer .nav-btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  margin-top: 4px;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: calc(var(--nav-h) + 80px) 32px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 40px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 28px;
  animation: fadeInDown 0.5s ease both;
}

.hero-title {
  font-size: clamp(36px, 4.5vw, 60px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 20px;
  animation: fadeInUp 0.55s 0.05s ease both;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.75;
  animation: fadeInUp 0.55s 0.12s ease both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeInUp 0.55s 0.2s ease both;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  animation: fadeInUp 0.55s 0.28s ease both;
}
.hero-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.hero-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 右侧画布区 */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 0.6s 0.1s ease both;
}

.canvas-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(41,121,255,0.06);
  width: 100%;
  max-width: 420px;
}

.canvas-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.canvas-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.canvas-dot-red   { background: #ef4444; }
.canvas-dot-yellow{ background: #f59e0b; }
.canvas-dot-green { background: #10b981; }
.canvas-card-title {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

#pixelCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  image-rendering: pixelated;
  background: #f8faff;
}

.canvas-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.canvas-color-row {
  display: flex;
  gap: 6px;
}
.canvas-color-dot {
  width: 16px; height: 16px;
  border-radius: 4px;
  animation: pixelPop 1.4s ease infinite;
}
.canvas-color-dot:nth-child(1){ background:#ef4444; animation-delay:0s; }
.canvas-color-dot:nth-child(2){ background:#f59e0b; animation-delay:0.2s; }
.canvas-color-dot:nth-child(3){ background:#10b981; animation-delay:0.4s; }
.canvas-color-dot:nth-child(4){ background:#3b82f6; animation-delay:0.6s; }
.canvas-color-dot:nth-child(5){ background:#8b5cf6; animation-delay:0.8s; }
.canvas-color-dot:nth-child(6){ background:#ec4899; animation-delay:1.0s; }
.canvas-card-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   通用 SECTION
   ============================================================ */
.section {
  padding: 100px 0;
}
.section-bg { background: var(--bg-soft); }

.section-header {
  margin-bottom: 56px;
}
.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 14px;
}
.section-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.75;
}
.section-desc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.section-desc a:hover { text-decoration: underline; }

/* ============================================================
   FEATURES
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature-card:hover::after { opacity: 1; }

.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.fi-blue   { background: #eff6ff; }
.fi-purple { background: #f5f3ff; }
.fi-orange { background: #fff7ed; }
.fi-green  { background: #f0fdf4; }
.fi-pink   { background: #fdf2f8; }
.fi-yellow { background: #fefce8; }

.feature-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.feature-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
}
/* 连接线 */
.steps-grid::before {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(12.5% + 22px);
  right: calc(12.5% + 22px);
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent2));
  opacity: 0.2;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(41,121,255,0.30);
}
.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
}

.guide-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  padding: 12px 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 40px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.guide-cta:hover {
  background: #d4e4ff;
  transform: translateY(-2px);
}

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 100%);
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before,
.cta-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.cta-section::before {
  width: 400px; height: 400px;
  top: -120px; right: -80px;
  background: rgba(255,255,255,0.06);
}
.cta-section::after {
  width: 300px; height: 300px;
  bottom: -100px; left: -60px;
  background: rgba(255,255,255,0.05);
}

.cta-inner {
  position: relative;
  z-index: 1;
}
.cta-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.cta-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.82);
  max-width: 480px;
  margin: 0 auto 44px;
  line-height: 1.75;
}
.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 48px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s ease;
  border: none;
  outline: none;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(41,121,255,0.30);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(41,121,255,0.42);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent2) 0%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.28);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,58,237,0.40);
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.btn-white {
  background: #fff;
  color: var(--primary);
  font-weight: 800;
}
.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.55);
}
.btn-outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: #0f172a;
  color: rgba(255,255,255,0.45);
  padding: 48px 0 32px;
  font-size: 14px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 28px;
}
.footer-brand {}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.footer-logo img {
  width: 30px; height: 30px;
  object-fit: contain;
  opacity: 0.9;
}
.footer-logo-text {
  font-size: 16px;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
}
.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  max-width: 240px;
  line-height: 1.6;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 13px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pixelPop {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%       { transform: scale(1.5); opacity: 1;   }
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — 平板 (768 ~ 1023px)
   ============================================================ */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
    padding-top: calc(var(--nav-h) + 60px);
  }
  .hero-left { align-items: center; }
  .hero-sub  { margin-left: auto; margin-right: auto; }
  .hero-stats { justify-content: center; }
  .hero-right { max-width: 380px; margin: 0 auto; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid    { grid-template-columns: repeat(2, 1fr); }
  .steps-grid::before { display: none; }

  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .nav-links { display: none; }
  .nav-cta   { display: none; }
  .nav-hamburger { display: flex; }
}

/* ============================================================
   RESPONSIVE — 移动端 (<768px)
   ============================================================ */
@media (max-width: 767px) {
  :root { --nav-h: 56px; }

  .nav-inner { padding: 0 20px; }
  .nav-logo-text { font-size: 16px; }

  .hero {
    padding: calc(var(--nav-h) + 40px) 20px 60px;
    gap: 36px;
  }
  .hero-title { letter-spacing: -0.5px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
  .hero-stat-num { font-size: 22px; }

  .canvas-card { padding: 16px; }

  .section { padding: 64px 0; }
  .section-header { margin-bottom: 36px; }

  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card  { padding: 24px 20px; }

  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .steps-grid::before { display: none; }

  .cta-section { padding: 72px 0; }
  .cta-sub { font-size: 15px; }
  .cta-actions { flex-direction: column; align-items: stretch; padding: 0 20px; }
  .cta-actions .btn { justify-content: center; }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }

  .btn { padding: 13px 26px; font-size: 14px; }
}

/* ============================================================
   RESPONSIVE — 小屏手机 (<400px)
   ============================================================ */
@media (max-width: 399px) {
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
