:root {
  --primary: #1f6feb;
  --primary-dark: #0d47a1;
  --primary-light: #58a6ff;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.55);
  --text: #1a2233;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --shadow-sm: 0 2px 8px rgba(31, 111, 235, 0.08);
  --shadow-md: 0 8px 28px rgba(31, 111, 235, 0.12);
  --shadow-lg: 0 18px 48px rgba(31, 111, 235, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 68px;
  --gradient-hero: linear-gradient(135deg, #1f6feb 0%, #7c3aed 55%, #db2777 100%);
  --gradient-soft: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(124, 58, 237, 0.1));
  --blur: saturate(180%) blur(18px);
  --transition: 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #58a6ff;
    --primary-dark: #1f6feb;
    --primary-light: #8ec5ff;
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --bg: #0b1120;
    --bg-alt: #111a2e;
    --card-bg: rgba(23, 33, 54, 0.62);
    --card-border: rgba(120, 150, 200, 0.18);
    --text: #e6edf7;
    --text-secondary: #a9b6cc;
    --text-muted: #7d8ba3;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --gradient-hero: linear-gradient(135deg, #0d47a1 0%, #5b21b6 55%, #9d174d 100%);
    --gradient-soft: linear-gradient(135deg, rgba(88, 166, 255, 0.14), rgba(167, 139, 250, 0.12));
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(31, 111, 235, 0.1), transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(124, 58, 237, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(219, 39, 119, 0.07), transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

ul,
ol {
  padding-left: 1.35em;
  margin: 0 0 1em;
}

li {
  margin-bottom: 0.4em;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.75rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 0.7em;
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--gradient-hero);
}

h3 {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  margin: 1.5em 0 0.5em;
  color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
  h3 {
    color: var(--primary-light);
  }
}

p {
  margin: 0 0 1em;
  color: var(--text-secondary);
}

strong,
b {
  color: var(--text);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), background var(--transition);
}

header > div {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

header > div > a {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  transition: transform var(--transition), filter var(--transition);
}

header > div > a:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 6px 0;
}

header nav li {
  margin: 0;
}

header nav a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

header nav a:hover,
header nav a:focus-visible {
  color: var(--primary);
  background: var(--gradient-soft);
  transform: translateY(-2px);
}

/* ============ Main layout ============ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 60px);
  color: #fff;
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: heroShift 14s ease infinite;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -8%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

@keyframes heroShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#hero p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 78ch;
  font-size: clamp(0.95rem, 1.6vw, 1.06rem);
  animation: fadeUp 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#hero nav {
  margin-top: 18px;
  animation: fadeUp 0.7s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#hero nav ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

#hero nav li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
}

#hero nav li + li::before {
  content: "/";
  color: rgba(255, 255, 255, 0.55);
}

#hero nav a {
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background var(--transition), transform var(--transition);
}

#hero nav a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: #fff;
}

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

/* ============ Sections & Cards ============ */
main > section {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 44px);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main > section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(31, 111, 235, 0.28);
}

main > section article {
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

main > section article + article {
  margin-top: 8px;
}

/* Card-like inner articles on larger screens */
#articles article,
#news article,
#cases article {
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article:hover,
#news article:hover,
#cases article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.3);
}

#articles article h3,
#news article h3,
#cases article h3 {
  margin-top: 0;
}

#articles article p,
#news article p,
#cases article p {
  margin-bottom: 0.6em;
}

#articles article p:last-child,
#news article p:last-child,
#cases article p:last-child {
  margin-bottom: 0;
}

/* ============ Lists ============ */
#products ul,
#cases ul,
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

#products ul li,
#cases ul li,
#sitemap ul li,
#links ul li {
  margin: 0;
  padding: 12px 16px;
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: 0.94rem;
  color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

#products ul li:hover,
#cases ul li:hover,
#sitemap ul li:hover,
#links ul li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.18), rgba(124, 58, 237, 0.14));
}

#products ul li::before,
#cases ul li::before {
  content: "✓ ";
  color: var(--primary);
  font-weight: 700;
}

#sitemap ul li a,
#links ul li a {
  color: var(--text-secondary);
  font-weight: 500;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: var(--primary);
}

/* ============ HowTo ordered list ============ */
#howto ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 1em;
  display: grid;
  gap: 12px;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 58px;
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-sm);
}

#howto ol li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ============ FAQ ============ */
#faq article {
  display: grid;
  gap: 14px;
}

#faq h3 {
  position: relative;
  margin: 0;
  padding: 14px 18px 14px 46px;
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

#faq h3:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

#faq h3 + p {
  margin: -4px 0 0;
  padding: 0 18px 4px 46px;
  font-size: 0.95rem;
}

/* ============ Contact ============ */
#contact article p {
  padding: 10px 16px;
  margin: 0 0 8px;
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

#contact article p:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ============ Footer ============ */
footer {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--card-border);
  padding: 36px 20px;
  text-align: center;
  box-shadow: 0 -6px 24px rgba(31, 111, 235, 0.06);
}

footer p {
  max-width: 1000px;
  margin: 0 auto 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

footer p:first-child {
  font-weight: 700;
  color: var(--text);
  font-size: 0.98rem;
  margin-bottom: 14px;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ============ Scroll-triggered reveal ============ */
@media (prefers-reduced-motion: no-preference) {
  main > section {
    animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  main > section:nth-child(2) { animation-delay: 0.05s; }
  main > section:nth-child(3) { animation-delay: 0.1s; }
  main > section:nth-child(4) { animation-delay: 0.15s; }
  main > section:nth-child(5) { animation-delay: 0.2s; }
  main > section:nth-child(6) { animation-delay: 0.25s; }
  main > section:nth-child(7) { animation-delay: 0.3s; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header > div {
    justify-content: center;
    padding: 10px 16px;
    gap: 8px;
  }

  header nav {
    width: 100%;
  }

  header nav ul {
    justify-content: center;
    gap: 2px;
  }

  header nav a {
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  main {
    padding: 20px 14px 48px;
    gap: 20px;
  }

  #hero {
    border-radius: var(--radius-md);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  header > div > a {
    font-size: 1.12rem;
  }

  header nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav ul::-webkit-scrollbar {
    display: none;
  }

  header nav a {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  main > section {
    border-radius: var(--radius-md);
    padding: 20px 16px;
  }

  #hero {
    padding: 26px 18px;
  }

  #products ul,
  #cases ul,
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }

  #faq h3 {
    padding: 12px 14px 12px 42px;
    font-size: 0.96rem;
  }

  #faq h3 + p {
    padding: 0 14px 2px 42px;
  }

  #howto ol li {
    padding: 12px 14px 12px 52px;
  }

  #howto ol li::before {
    left: 12px;
    width: 26px;
    height: 26px;
    font-size: 0.78rem;
  }

  footer {
    padding: 28px 16px;
  }
}

@media (max-width: 380px) {
  main {
    padding: 16px 10px 40px;
  }

  main > section {
    padding: 16px 12px;
  }
}

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

/* ============ Print ============ */
@media print {
  header,
  footer,
  #hero nav {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  main > section {
    box-shadow: none;
    border: 1px solid #ddd;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}