/* ============================================
   智慧社区平台官网 · 通用样式
   Design tokens + layout + components
   ============================================ */

:root {
  /* Brand */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e3a8a;
  --brand-900: #172554;

  /* Accent cyan / purple */
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;

  /* Semantic */
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* Neutral */
  --ink-900: #0b1220;
  --ink-800: #111827;
  --ink-700: #1f2937;
  --ink-600: #374151;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50:  #f9fafb;
  --white:   #ffffff;

  /* Surfaces */
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-muted: #eef2f8;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);

  /* Dark surfaces */
  --dark-bg: #070b1c;
  --dark-surface: #0f1734;
  --dark-surface-2: #141d46;
  --dark-line: rgba(255, 255, 255, 0.08);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --grad-cyan:  linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --grad-warm:  linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  --grad-hero:  radial-gradient(1200px 600px at 80% -10%, rgba(124,58,237,0.35), transparent 60%),
                radial-gradient(900px 500px at 10% 10%, rgba(37,99,235,0.30), transparent 60%),
                linear-gradient(180deg, #05081a 0%, #0a1033 60%, #0b1447 100%);
  --grad-text:  linear-gradient(120deg, #60a5fa, #a78bfa 55%, #22d3ee);

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.12), 0 8px 16px rgba(15,23,42,.06);
  --shadow-glow: 0 10px 40px rgba(37,99,235,.25);

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Typography */
  --ff-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
             "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-fast: .18s;
  --dur: .32s;
  --dur-slow: .6s;

  /* Layout */
  --nav-h: 72px;
  --max-w: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* =============== Reset =============== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ink-900); }
p { margin: 0; }
section { position: relative; }

/* =============== Utility =============== */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.hide-mobile { display: initial; }
.hide-desktop { display: none; }
.text-center { text-align: center; }
.text-gradient { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--ink-500); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: rgba(37, 99, 235, 0.08); color: var(--brand-700);
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
}
.eyebrow.on-dark { background: rgba(255,255,255,.08); color: #cbd5ff; border: 1px solid rgba(255,255,255,.12); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-600); box-shadow: 0 0 0 4px rgba(37,99,235,.18); }
.eyebrow.on-dark .dot { background: #22d3ee; box-shadow: 0 0 0 4px rgba(34,211,238,.2); }

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(28px, 3.6vw, 44px); margin: 18px 0 14px; }
.section-head p { font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-500); }

/* Section on dark */
.section-dark { background: var(--dark-bg); color: #dbe4ff; }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark .muted { color: #9fb1e6; }

/* =============== Buttons =============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; font-weight: 600; font-size: 15px;
  border-radius: var(--r-pill); transition: all var(--dur) var(--ease);
  white-space: nowrap; border: 1px solid transparent;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(124,58,237,.35); }
.btn-ghost { color: var(--ink-800); border-color: var(--ink-200); background: #fff; }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-700); transform: translateY(-1px); }
.btn-dark { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.btn-dark:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* =============== Nav =============== */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center;
  transition: background var(--dur), box-shadow var(--dur), border-color var(--dur);
  border-bottom: 1px solid transparent;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; }
.nav.is-scrolled { background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(16px); border-bottom-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.nav.is-scrolled .brand { color: var(--ink-900); }
.nav.is-scrolled .nav-links a { color: var(--ink-700); }
.nav.is-scrolled .nav-links a:hover { color: var(--brand-700); background: var(--brand-50); }
.nav.is-scrolled .nav-links a.active { color: var(--brand-700); background: var(--brand-50); }
.nav.is-scrolled .nav-toggle { color: var(--ink-700); }
.nav.is-scrolled .btn-dark { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.nav.is-light { background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(16px); border-bottom-color: var(--ink-200); }
.nav.is-open {
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--ink-200);
  box-shadow: var(--shadow-sm);
}
.nav.is-open .brand { color: var(--ink-900); }
.nav.is-open .nav-toggle { color: var(--ink-700); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink-900); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; letter-spacing: -1px;
  box-shadow: var(--shadow-glow);
}
.nav.is-transparent:not(.is-scrolled):not(.is-open) .brand { color: #fff; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--r-pill); font-weight: 500; color: var(--ink-700);
  transition: all var(--dur-fast) var(--ease);
}
.nav.is-transparent:not(.is-scrolled):not(.is-open) .nav-links a { color: #e2e8ff; }
.nav-links a:hover { color: var(--brand-700); background: var(--brand-50); }
.nav.is-transparent:not(.is-scrolled):not(.is-open) .nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active { color: var(--brand-700); background: var(--brand-50); }
.nav.is-transparent:not(.is-scrolled):not(.is-open) .nav-links a.active { color: #fff; background: rgba(255,255,255,.14); }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center;
}
.nav.is-transparent:not(.is-scrolled):not(.is-open) .nav-toggle { color: #fff; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; transition: transform var(--dur); }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav.is-open .nav-toggle span { background: transparent; }
.nav.is-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.is-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* =============== Hero (dark) =============== */
.hero {
  position: relative; padding: calc(var(--nav-h) + 60px) 0 100px;
  background: var(--grad-hero); color: #e8eeff; overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 70%);
  opacity: .6;
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(32px, 4.6vw, 60px); line-height: 1.1; letter-spacing: -0.02em; }
.hero h1 .accent { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: #b6c3f2; font-size: clamp(15px, 1.6vw, 18px); margin: 20px 0 32px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 24px; color: #8ea1d8; font-size: 13px; }
.hero-badges .bd { display: inline-flex; align-items: center; gap: 8px; }
.hero-badges .bd svg { width: 18px; height: 18px; color: #22d3ee; }

/* Hero stats strip */
.hero-stats { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 24px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-stats .s { text-align: center; }
.hero-stats .s .n { font-size: clamp(22px, 2.6vw, 32px); font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats .s .l { font-size: 12px; color: #9fb1e6; margin-top: 4px; letter-spacing: .08em; }

/* =============== Cards =============== */
.card {
  background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--ink-200);
  padding: 28px; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.card .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--ink-500); font-size: 14.5px; }

.card-dark { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border-color: rgba(255,255,255,.1); color: #d9e1ff; }
.card-dark:hover { border-color: rgba(99,102,241,.5); box-shadow: 0 20px 60px rgba(14,21,58,.6); }
.card-dark h3 { color: #fff; }
.card-dark p { color: #9fb1e6; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Icon palette for cards */
.ico-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.ico-cyan   { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.ico-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.ico-pink   { background: linear-gradient(135deg, #f472b6, #ec4899); }
.ico-orange { background: linear-gradient(135deg, #fb923c, #ef4444); }
.ico-green  { background: linear-gradient(135deg, #34d399, #059669); }
.ico-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.ico-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }

/* =============== CTA block =============== */
.cta {
  background: var(--grad-hero); color: #fff; border-radius: var(--r-xl);
  padding: 56px clamp(28px, 5vw, 64px); display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; align-items: center;
  position: relative; overflow: hidden; margin: 0 var(--gutter);
}
.cta::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(124,58,237,.45), transparent 70%); filter: blur(10px);
}
.cta h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); }
.cta p { color: #b6c3f2; margin-top: 12px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }

/* =============== Footer =============== */
.footer { background: #06091a; color: #9fb1e6; padding: 72px 0 28px; }
.footer a { color: #c6d1f8; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 40px; }
.footer-brand p { margin-top: 14px; color: #8094c6; font-size: 14px; max-width: 320px; }
.footer h5 { color: #fff; font-size: 14px; letter-spacing: .08em; margin-bottom: 16px; }
.footer ul li { padding: 6px 0; font-size: 14px; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: #6b7fb5; font-size: 13px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
}
.footer-social a:hover { background: rgba(255,255,255,.1); }

/* =============== Tabs / Pills =============== */
.pill-tabs { display: inline-flex; gap: 6px; padding: 6px; background: var(--bg-muted); border-radius: var(--r-pill); }
.pill-tabs button { padding: 10px 18px; border-radius: var(--r-pill); font-weight: 600; color: var(--ink-600); transition: all var(--dur-fast); }
.pill-tabs button.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* =============== Timeline =============== */
.timeline { position: relative; margin-left: 24px; padding-left: 32px; border-left: 2px solid var(--ink-200); }
.timeline .item { position: relative; padding-bottom: 36px; }
.timeline .item::before {
  content: ""; position: absolute; left: -41px; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad-brand); box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--brand-100);
}
.timeline .y { font-weight: 800; color: var(--brand-700); font-size: 14px; letter-spacing: .08em; }
.timeline h4 { font-size: 17px; margin: 4px 0 6px; }
.timeline p { color: var(--ink-500); font-size: 14.5px; }

/* =============== Feature diagram layer (dark) =============== */
.stack {
  background: linear-gradient(180deg, #0a1135 0%, #090e2e 100%);
  border-radius: var(--r-xl); padding: 40px; border: 1px solid rgba(255,255,255,.06);
  color: #c6d1f8; box-shadow: 0 40px 80px rgba(0,0,0,.4);
}
.stack .layer {
  display: flex; align-items: center; gap: 20px; padding: 18px 22px;
  border-radius: var(--r-md); margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  transition: all var(--dur);
}
.stack .layer:hover { border-color: rgba(124,58,237,.5); transform: translateX(4px); }
.stack .layer .tag { flex: 0 0 auto; padding: 6px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.stack .layer h4 { color: #fff; font-size: 16px; }
.stack .layer p { color: #8ea1d8; font-size: 13.5px; margin-top: 4px; }
.stack .connector { height: 20px; width: 2px; background: linear-gradient(180deg, var(--violet-500), transparent); margin: 0 auto; }

/* =============== Bento / showcase =============== */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(180px, auto); gap: 20px; }
.bento > .cell { grid-column: span 2; }
.bento > .cell.wide { grid-column: span 3; }
.bento > .cell.full { grid-column: span 6; }

/* =============== Mobile =============== */
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .cta { grid-template-columns: 1fr; }
  .bento > .cell, .bento > .cell.wide { grid-column: span 3; }
}
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .hide-mobile { display: none !important; }
  .hide-desktop { display: initial; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav-links {
    display: flex; flex-direction: column; position: absolute; inset: var(--nav-h) 0 auto 0;
    background: #fff; padding: 16px; border-bottom: 1px solid var(--ink-200);
    box-shadow: var(--shadow-md); gap: 4px;
  }
  .nav.is-open .nav-links a { padding: 12px 16px; font-size: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento > .cell, .bento > .cell.wide, .bento > .cell.full { grid-column: span 2; }
}
@media (max-width: 480px) {
  .hero { padding-top: calc(var(--nav-h) + 36px); padding-bottom: 72px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .cta { padding: 36px 24px; }
}

/* =============== Reveal animation =============== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =============== Scrollbar =============== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }
::-webkit-scrollbar-track { background: transparent; }
