:root {
  --bg: #f3f7fb;
  --bg-soft: #e8eff8;
  --text: #0f1d2e;
  --muted: #4c5a70;
  --surface: #ffffff;
  --line: #d5deea;
  --primary: #1369d5;
  --primary-deep: #0b4da5;
  --accent: #16a085;
  --highlight: #ff9f40;
  --shadow: 0 12px 30px rgba(12, 34, 68, 0.12);
  --shadow-soft: 0 8px 18px rgba(15, 35, 67, 0.09);
  --radius: 18px;
  --container: min(1260px, 92vw);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, #d9e9ff 0, transparent 32%),
    radial-gradient(circle at 90% 0%, #d9fff5 0, transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #f9fbfe 100%);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  right: -80px;
  top: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 159, 64, 0.22), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  z-index: 999;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(213, 222, 234, 0.7);
  backdrop-filter: blur(10px);
  background: rgba(243, 247, 251, 0.78);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 6px rgba(19, 105, 213, 0.12);
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-list a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--primary-deep);
}

/* Language toggle */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.08), rgba(22, 160, 133, 0.1));
  color: var(--primary-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.16), rgba(22, 160, 133, 0.18));
  border-color: rgba(19, 105, 213, 0.4);
  transform: scale(1.04);
}

/* ─── Hero ─── */
.hero {
  padding: 100px 0 80px;
}

.hero-grid {
  display: grid;
  gap: 34px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.8vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 10px;
  display: inline-block;
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lead {
  margin: 0;
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 60ch;
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(6px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-item strong {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: rgba(19, 105, 213, 0.35);
  background: rgba(255, 255, 255, 0.9);
}

/* Hero panel */
.hero-panel,
.card,
.panel,
.code-panel,
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 30px;
  display: grid;
  gap: 12px;
}

.studio-kicker {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
}

.hero-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.studio-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  font-size: 0.9rem;
}

.studio-row span {
  color: var(--muted);
}

.studio-row strong {
  font-size: 0.9rem;
}

.studio-btn {
  margin-top: 4px;
}

/* ─── Sections ─── */
.section {
  padding: 86px 0;
}

.section-alt {
  background:
    linear-gradient(180deg, rgba(232, 239, 248, 0.45), rgba(255, 255, 255, 0.6));
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.28;
}

.section-head p {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 64ch;
}

/* ─── Templates ─── */
.template-toolbar {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter-pill:hover,
.filter-pill:focus-visible {
  border-color: rgba(19, 105, 213, 0.4);
  color: var(--primary-deep);
}

.filter-pill.is-active {
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.1), rgba(22, 160, 133, 0.14));
  color: var(--primary-deep);
  border-color: rgba(19, 105, 213, 0.3);
}

.template-grid {
  margin-top: 28px;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.template-card:hover,
.template-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 26px rgba(12, 32, 60, 0.14);
  border-color: rgba(19, 105, 213, 0.35);
}

.template-preview {
  min-height: 158px;
  position: relative;
  border-bottom: 1px solid rgba(213, 222, 234, 0.8);
  background-size: cover;
  background-position: center;
}

.template-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.18), transparent 48%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.46), transparent 32%);
}

.template-badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.9);
  color: #122640;
}

.template-meta {
  padding: 18px 18px 20px;
}

.template-meta h3 {
  margin: 0;
  font-size: 1.06rem;
}

.template-meta p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.template-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-deep);
  border: 1px solid rgba(19, 105, 213, 0.3);
  background: rgba(19, 105, 213, 0.08);
  transition: background 0.2s ease;
}

.template-action:hover,
.template-action:focus-visible {
  background: rgba(19, 105, 213, 0.14);
}

.theme-blue {
  background-image: linear-gradient(135deg, #4a74ff, #77c4ff);
}

.theme-green {
  background-image: linear-gradient(135deg, #17a589, #63d7c3);
}

.theme-ink {
  background-image: linear-gradient(135deg, #21354f, #4a5f7e);
}

.theme-sunset {
  background-image: linear-gradient(135deg, #ff7e52, #ffd16f);
}

.theme-rose {
  background-image: linear-gradient(135deg, #f05f88, #ffb3c1);
}

.theme-vintage {
  background-image: linear-gradient(135deg, #8a674d, #d3b18c);
}

.theme-cyan {
  background-image: linear-gradient(135deg, #0094c6, #7ce8ff);
}

.theme-orange {
  background-image: linear-gradient(135deg, #ff8a39, #ffd186);
}

.theme-amber {
  background-image: linear-gradient(135deg, #d97f22, #ffca7f);
}

/* ─── Process Steps ─── */
.process-steps {
  margin-top: 40px;
  display: flex;
  align-items: stretch;
  gap: 0;
  justify-content: center;
}

.step-card {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: 28px 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.step-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.1), rgba(22, 160, 133, 0.12));
  color: var(--primary);
  margin-bottom: 16px;
}

.step-num {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(19, 105, 213, 0.3);
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

.step-arrow {
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--muted);
  opacity: 0.45;
}

/* ─── Capabilities ─── */
.cap-grid {
  margin-top: 34px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cap-card {
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cap-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(19, 105, 213, 0.3);
}

.cap-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.1), rgba(22, 160, 133, 0.12));
  color: var(--primary);
  margin-bottom: 16px;
}

.cap-card h3 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.cap-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Trust strip */
.cap-trust {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  padding: 20px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(19, 105, 213, 0.04), rgba(22, 160, 133, 0.05));
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.trust-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── FAQ ─── */
.faq-list {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

.faq {
  padding: 0 20px;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 4px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.2s ease;
}

.faq summary:hover {
  color: var(--primary-deep);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid var(--muted);
  border-bottom: 2.5px solid var(--muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.faq[open] summary::after {
  transform: rotate(-135deg);
}

.faq p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Old panels (keep for backward compat) ─── */
.cards {
  margin-top: 26px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 22px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.card ul {
  margin: 0;
  padding-left: 18px;
}

.split {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  padding: 26px;
}

.panel h3 {
  margin-top: 0;
}

.panel ul {
  margin: 0;
  padding-left: 18px;
}

.grid-two {
  display: grid;
  gap: 30px;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
}

.code-panel {
  padding: 22px;
  overflow: auto;
}

.code-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 12px;
  background: #0b1220;
  color: #dfebff;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ─── Footer ─── */
.site-footer {
  padding: 56px 0 42px;
  background: linear-gradient(180deg, transparent, rgba(232, 239, 248, 0.3));
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}

.footer-brand .brand {
  margin-bottom: 8px;
}

.footer-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links h4 {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-deep);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: var(--primary);
}

/* ─── Animations ─── */
.reveal {
  animation: rise 560ms ease both;
}

.template-grid .template-card:nth-child(2),
.cap-grid .cap-card:nth-child(2),
.faq-list .faq:nth-child(2),
.hero-grid .hero-panel {
  animation-delay: 80ms;
}

.template-grid .template-card:nth-child(3),
.cap-grid .cap-card:nth-child(3),
.faq-list .faq:nth-child(3) {
  animation-delay: 140ms;
}

.template-grid .template-card:nth-child(4),
.cap-grid .cap-card:nth-child(4),
.faq-list .faq:nth-child(4) {
  animation-delay: 190ms;
}

.template-grid .template-card:nth-child(5),
.template-grid .template-card:nth-child(6),
.cap-grid .cap-card:nth-child(5),
.cap-grid .cap-card:nth-child(6),
.faq-list .faq:nth-child(5),
.faq-list .faq:nth-child(6) {
  animation-delay: 220ms;
}

.template-grid .template-card:nth-child(7),
.template-grid .template-card:nth-child(8),
.template-grid .template-card:nth-child(9),
.template-grid .template-card:nth-child(10),
.template-grid .template-card:nth-child(11),
.template-grid .template-card:nth-child(12) {
  animation-delay: 260ms;
}

.process-steps .step-card:nth-child(3) {
  animation-delay: 100ms;
}

.process-steps .step-card:nth-child(5) {
  animation-delay: 180ms;
}

.process-steps .step-card:nth-child(7) {
  animation-delay: 250ms;
}

.process-steps .step-arrow:nth-child(2) {
  animation-delay: 60ms;
}

.process-steps .step-arrow:nth-child(4) {
  animation-delay: 140ms;
}

.process-steps .step-arrow:nth-child(6) {
  animation-delay: 210ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .hero-grid,
  .grid-two,
  .split {
    grid-template-columns: 1fr;
  }

  .template-grid,
  .cap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-list {
    gap: 12px;
  }

  .nav-list a {
    font-size: 0.88rem;
  }

  .process-steps {
    flex-wrap: wrap;
    gap: 16px;
  }

  .step-card {
    max-width: 100%;
    flex: 1 1 calc(50% - 16px);
  }

  .step-arrow {
    display: none;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .hero-stats {
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
  }

  .nav-wrap {
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    padding: 8px 0 10px;
    gap: 12px;
  }

  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
  }

  .nav-list a {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .hero {
    padding-top: 56px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .stat-item {
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }

  .template-grid,
  .cap-grid {
    grid-template-columns: 1fr;
  }

  .template-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -4vw;
    margin-right: -4vw;
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .template-toolbar::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex: 0 0 auto;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    width: 100%;
    justify-content: center;
  }

  .process-steps {
    flex-direction: column;
    align-items: stretch;
  }

  .step-card {
    max-width: 100%;
  }

  .cap-trust {
    flex-direction: column;
    gap: 14px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
