:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #334155;
  --text-soft: #475569;
  --accent: #0369a1;
  --accent-hover: #075985;
  --accent-ink: #ffffff;
  --success: #047857;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --container: 1160px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.25rem;
  --header-offset: 88px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

[id] {
  scroll-margin-top: var(--header-offset);
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  min-height: 44px;
  padding: 0.25rem 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--surface-alt);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

.site-nav .nav-cta {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0.45rem 1rem;
}

.site-nav .nav-cta:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

/* Sections */
.section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-4);
}

.section-tag {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

h1, h2, h3 {
  line-height: 1.3;
  margin-top: 0;
  color: var(--text);
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  margin-bottom: var(--space-2);
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.18rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0;
  color: var(--text-muted);
}

/* Hero */
.hero {
  position: relative;
  padding: 13.5rem 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.hero-storm {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 270px;
  pointer-events: none;
  overflow: hidden;
}

.hero-storm-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  transform: scale(1.04);
  animation: stormDrift 20s ease-in-out infinite alternate;
}

.hero-storm-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 68% 36%, rgba(186, 230, 253, 0.45), transparent 55%),
              radial-gradient(circle at 30% 42%, rgba(125, 211, 252, 0.28), transparent 48%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: thunderFlash 5.5s infinite;
}

.hero-storm-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0.72) 78%, #ffffff 100%);
}

@keyframes stormDrift {
  from { transform: scale(1.04) translateX(-1%); }
  to { transform: scale(1.07) translateX(1%); }
}

@keyframes thunderFlash {
  0%, 36%, 41%, 74%, 79%, 83%, 100% { opacity: 0; }
  37%, 75%, 80% { opacity: 0.9; }
  39%, 77% { opacity: 0.2; }
}

.hero-center {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero-lead {
  max-width: 680px;
  font-size: 1.08rem;
  color: var(--text-muted);
  margin: 0 auto var(--space-3);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
}

.hero-meta li {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.card-icon {
  width: 64px;
  height: 64px;
}

.card-media {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.card-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.card-list li + li {
  margin-top: 0.35rem;
}

/* Pricing Table */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.pricing-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.pricing-table caption {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.pricing-table th,
.pricing-table td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.pricing-table thead th {
  color: var(--text);
  font-size: 0.92rem;
  background: var(--surface-alt);
}

.pricing-table tbody tr:last-child th,
.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.price-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--success);
  white-space: nowrap;
}

.pricing-note {
  margin-top: var(--space-2);
  font-size: 0.92rem;
  color: var(--text-soft);
}

/* Reviews */
.rating-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.rating-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--success);
}

.review-author {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-body {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
}

.faq-body p:last-child {
  margin-bottom: 0;
}

/* Subpages & Articles */
.page-hero {
  padding: var(--space-4) 0 var(--space-3);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--text-soft);
  margin-bottom: var(--space-2);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.article-layout {
  padding: var(--space-4) 0 var(--space-5);
}

.prose {
  max-width: 780px;
}

.prose h2 {
  margin-top: var(--space-4);
}

.prose h3 {
  margin-top: var(--space-3);
}

.prose ul,
.prose ol {
  color: var(--text-muted);
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}

.article-nav {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Footer (Strictly 4 titles) */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.footer-link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.footer-link-card:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.footer-copy {
  margin: var(--space-3) 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .hero {
    padding-top: 9.5rem;
  }

  .hero-storm {
    height: 190px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .site-nav a,
  .site-nav .nav-cta {
    justify-content: center;
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }

  .hero-storm-img,
  .hero-storm-flash {
    animation: none;
  }
}
