:root {
  --primary: #1a8cff;
  --primary-dark: #0d6fd4;
  --accent: #ff6b35;
  --text: #1a1a2e;
  --text-light: #5a5a72;
  --bg: #f5f8fc;
  --white: #ffffff;
  --border: #e4eaf2;
  --shadow: 0 4px 24px rgba(26, 140, 255, 0.08);
  --radius: 12px;
  --max-width: 1200px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-link img { width: 40px; height: 40px; border-radius: 8px; }

.main-nav { display: flex; gap: 28px; list-style: none; }
.main-nav a { color: var(--text); font-size: 0.95rem; font-weight: 500; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* Ad bar */
.ad-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 10px 0;
}

#ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  background: transparent;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

#ads > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  box-sizing: border-box;
}

#ads img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(24,24,24,0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: block;
  border: none;
  background: linear-gradient(135deg, #fff, #fff);
}

#ads a {
  display: inline-block;
  text-decoration: none;
  border-radius: 15px;
}

#ads img:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 24px rgba(24,24,24,0.18);
}

#ads figcaption,
#ads .caption {
  height: 15px;
  font-size: 11px;
  color: #666;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a8cff 0%, #0d6fd4 50%, #0056b3 100%);
  color: var(--white);
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero h1 { font-size: 2.2rem; line-height: 1.3; margin-bottom: 16px; }
.hero-desc { font-size: 1.05rem; opacity: 0.92; margin-bottom: 28px; }

.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.6);
}

.btn-outline:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.hero-img {
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-width: 320px;
  margin: 0 auto;
}

/* Sections */
.section { padding: 60px 0; }
.section-alt { background: var(--white); }

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 40px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.feature-card:hover { transform: translateY(-4px); }

.feature-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--primary); }
.feature-card p { color: var(--text-light); font-size: 0.92rem; }

/* Image showcase */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

.showcase-grid.reverse { direction: rtl; }
.showcase-grid.reverse > * { direction: ltr; }

.showcase-img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.showcase-text h3 { font-size: 1.35rem; margin-bottom: 14px; }
.showcase-text p { color: var(--text-light); margin-bottom: 12px; }

/* Steps */
.steps-list { counter-reset: step; list-style: none; }
.steps-list li {
  counter-increment: step;
  padding: 20px 20px 20px 72px;
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
}

.gallery-item img { width: 100%; aspect-ratio: 9/16; object-fit: cover; }
.gallery-item figcaption {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-q {
  padding: 18px 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q::after { content: "+"; font-size: 1.3rem; color: var(--primary); }
.faq-item.open .faq-q::after { content: "−"; }

.faq-a {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
  color: var(--text-light);
}

.faq-item.open .faq-a { max-height: 300px; padding: 0 24px 18px; }

/* Content page */
.page-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}

.page-hero h1 { font-size: 1.8rem; }

.content-page { padding: 48px 0 64px; }
.content-page .container { max-width: 860px; }

.content-page h2 { font-size: 1.3rem; margin: 32px 0 14px; color: var(--primary); }
.content-page h3 { font-size: 1.1rem; margin: 24px 0 10px; }
.content-page p, .content-page li { color: var(--text-light); margin-bottom: 12px; }
.content-page ul, .content-page ol { padding-left: 24px; margin-bottom: 16px; }

.breadcrumb {
  padding: 16px 0;
  font-size: 0.88rem;
  color: var(--text-light);
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* Error pages */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-msg { font-size: 1.3rem; margin: 16px 0 24px; }

/* Footer */
.site-footer {
  background: #0f1a2e;
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand img { width: 48px; border-radius: 8px; margin-bottom: 12px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; }

.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.82rem;
}

/* TOC */
.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.toc h4 { margin-bottom: 12px; font-size: 0.95rem; }
.toc ol { padding-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 992px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .main-nav.open { display: flex; }

  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 1.6rem; }
  .hero-btns { justify-content: center; }
  .hero-img { max-width: 260px; }

  .showcase-grid { grid-template-columns: 1fr; }
  .showcase-grid.reverse { direction: ltr; }

  .features-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }

  #ads { gap: 10px; }
  #ads > div { width: 62px; }
  #ads img { width: 58px; height: 58px; }
}
