:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b7a;
  --accent: #f4a261;
  --accent-2: #457b9d;
  --bg: #f8f9fb;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-strong: rgba(255, 255, 255, 0.82);
  --text: #1d2733;
  --text-soft: #4a5568;
  --text-muted: #718096;
  --border: rgba(29, 39, 51, 0.08);
  --border-strong: rgba(29, 39, 51, 0.14);
  --shadow-sm: 0 2px 8px rgba(29, 39, 51, 0.06);
  --shadow-md: 0 8px 24px rgba(29, 39, 51, 0.09);
  --shadow-lg: 0 16px 48px rgba(29, 39, 51, 0.14);
  --shadow-primary: 0 10px 30px rgba(230, 57, 70, 0.28);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --grad-hero: linear-gradient(135deg, #e63946 0%, #ff6b7a 38%, #f4a261 72%, #ffd166 100%);
  --grad-accent: linear-gradient(135deg, #457b9d 0%, #6a9fc0 100%);
  --grad-card: linear-gradient(160deg, rgba(230, 57, 70, 0.06), rgba(69, 123, 157, 0.05));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff5a68;
    --primary-dark: #e63946;
    --primary-light: #ff8b95;
    --accent: #f4a261;
    --accent-2: #6a9fc0;
    --bg: #0f141b;
    --bg-elevated: #171e27;
    --bg-glass: rgba(23, 30, 39, 0.62);
    --bg-glass-strong: rgba(23, 30, 39, 0.85);
    --text: #eef2f7;
    --text-soft: #c2ccd8;
    --text-muted: #8b98a8;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
    --shadow-primary: 0 10px 30px rgba(255, 90, 104, 0.25);
    --grad-hero: linear-gradient(135deg, #7a1420 0%, #b3222f 34%, #a8542c 68%, #7a5a1e 100%);
    --grad-accent: linear-gradient(135deg, #2c4a5e 0%, #3f6b88 100%);
    --grad-card: linear-gradient(160deg, rgba(255, 90, 104, 0.1), rgba(106, 159, 192, 0.08));
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(230, 57, 70, 0.08), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(69, 123, 157, 0.08), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(244, 162, 97, 0.07), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--grad-hero);
  box-shadow: 0 0 14px rgba(230, 57, 70, 0.4);
}

h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  color: var(--text);
}

h4 {
  font-size: 1.05rem;
  color: var(--primary);
}

p {
  margin: 0 0 1.1em;
  color: var(--text-soft);
}

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.5em;
}

strong {
  color: var(--text);
  font-weight: 700;
}

/* ============ Header / Navigation ============ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

header:hover {
  box-shadow: var(--shadow-md);
}

nav[aria-label="主导航"] {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

nav[aria-label="主导航"] > a {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  white-space: nowrap;
  transition: transform 0.3s var(--ease);
}

nav[aria-label="主导航"] > a::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

nav[aria-label="主导航"] > a:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

nav[aria-label="主导航"] > a:hover::before {
  transform: rotate(18deg) scale(1.08);
  box-shadow: 0 12px 34px rgba(230, 57, 70, 0.45);
}

nav[aria-label="主导航"] ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

nav[aria-label="主导航"] ul li {
  margin: 0;
}

nav[aria-label="主导航"] ul li a {
  display: inline-block;
  padding: 8px 13px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease);
}

nav[aria-label="主导航"] ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--grad-hero);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

nav[aria-label="主导航"] ul li a:hover,
nav[aria-label="主导航"] ul li a:focus-visible {
  color: var(--primary);
  background: rgba(230, 57, 70, 0.08);
  transform: translateY(-2px);
}

nav[aria-label="主导航"] ul li a:hover::after {
  width: 60%;
}

/* ============ Main layout ============ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section {
  margin: 0 0 28px;
  padding: clamp(22px, 4vw, 44px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease),
    border-color 0.4s var(--ease);
  animation: sectionRise 0.7s var(--ease) both;
}

main > section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

main > section:hover::before {
  opacity: 1;
}

main > section > * {
  position: relative;
  z-index: 1;
}

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; }

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

/* ============ Hero ============ */
#hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    var(--grad-hero);
  color: #fff;
  border: none;
  padding: clamp(34px, 6vw, 72px) clamp(24px, 5vw, 56px);
  margin-top: 28px;
  box-shadow: var(--shadow-lg), var(--shadow-primary);
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 8% 88%, rgba(255, 255, 255, 0.16), transparent 46%);
  opacity: 1;
  z-index: 0;
  animation: heroGlow 9s ease-in-out infinite alternate;
}

#hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -12%;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(255, 255, 255, 0.22), transparent 55%, rgba(255, 255, 255, 0.18));
  filter: blur(8px);
  z-index: 0;
  animation: heroSpin 22s linear infinite;
  pointer-events: none;
}

@keyframes heroGlow {
  from { opacity: 0.65; transform: scale(1); }
  to { opacity: 1; transform: scale(1.06); }
}

@keyframes heroSpin {
  to { transform: rotate(360deg); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.22);
  max-width: 900px;
  position: relative;
  z-index: 1;
}

#hero p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  max-width: 880px;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.14);
}

#hero p:first-of-type {
  margin-top: 14px;
}

/* ============ About / Products / Solutions cards ============ */
#about h3,
#products h3,
#solutions h3,
#cases h3,
#news h3,
#howto h3,
#knowledge h3 {
  margin-top: 1.4em;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-strong);
  display: inline-block;
}

#about h3:first-of-type,
#products h3:first-of-type,
#solutions h3:first-of-type,
#cases h3:first-of-type,
#news h3:first-of-type,
#howto h3:first-of-type,
#knowledge h3:first-of-type {
  margin-top: 0.4em;
}

#products h4 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.2em;
  padding: 6px 16px 6px 12px;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.98rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

#products h4::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.6);
}

#products h4:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

/* ============ Articles ============ */
#articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

#articles h2 {
  grid-column: 1 / -1;
}

#articles article {
  position: relative;
  padding: 22px 24px;
  margin: 0 0 16px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease), background 0.35s var(--ease);
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-hero);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  background: var(--bg-glass-strong);
}

#articles article:hover::before {
  transform: scaleY(1);
}

#articles article h3 {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  margin-bottom: 0.5em;
  transition: color 0.3s var(--ease);
}

#articles article:hover h3 {
  color: var(--primary);
}

#articles article p:nth-of-type(1) {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.7em;
  letter-spacing: 0.01em;
}

#articles article p:nth-of-type(2) {
  margin-bottom: 0.9em;
  font-size: 0.96rem;
}

#articles article p:last-of-type {
  margin-bottom: 0;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  background: var(--grad-hero);
  color: #fff;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.25);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    filter 0.3s var(--ease);
}

#articles article a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

#articles article a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(230, 57, 70, 0.4);
  filter: brightness(1.06);
}

#articles article a:hover::after {
  transform: translateX(4px);
}

/* ============ FAQ ============ */
#faq h3 {
  margin-top: 1.6em;
  padding: 16px 20px;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  color: var(--text);
  cursor: default;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease), background 0.3s var(--ease);
}

#faq h3:first-of-type {
  margin-top: 0.4em;
}

#faq h3::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--grad-hero);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: middle;
  box-shadow: 0 3px 10px rgba(230, 57, 70, 0.3);
}

#faq h3:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
  background: var(--bg-glass-strong);
}

#faq h3 + p {
  padding: 4px 20px 4px 54px;
  margin-bottom: 1.4em;
  font-size: 0.96rem;
  position: relative;
}

#faq h3 + p::before {
  content: "A";
  position: absolute;
  left: 20px;
  top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ============ HowTo ============ */
#howto h4 {
  position: relative;
  margin-top: 1.3em;
  padding: 12px 18px 12px 52px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

#howto h4::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 3px 10px rgba(230, 57, 70, 0.3);
}

#howto h4:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

#howto h4 + p {
  padding-left: 52px;
  font-size: 0.96rem;
}

#howto h3 + p,
#howto h4 + p {
  margin-bottom: 0.9em;
}

/* ============ Contact ============ */
#contact {
  background:
    linear-gradient(160deg, rgba(230, 57, 70, 0.05), rgba(69, 123, 157, 0.05)),
    var(--bg-elevated);
}

#contact h3 + p {
  padding: 18px 22px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 2;
  font-size: 0.95rem;
}

#contact h3 + p a {
  font-weight: 600;
}

/* ============ Sitemap & Links ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

#sitemap ul li,
#links ul li {
  margin: 0;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: var(--grad-hero);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-primary);
}

/* ============ Legal ============ */
#legal h3 {
  margin-top: 1.4em;
  color: var(--primary);
  font-size: 1.05rem;
}

#legal h3:first-of-type {
  margin-top: 0.4em;
}

#legal p:last-child {
  margin-top: 1.6em;
  padding-top: 1.2em;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ============ Footer ============ */
footer {
  background: var(--bg-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  margin-top: 8px;
}

footer p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

footer p:first-child {
  font-weight: 600;
  color: var(--text-soft);
}

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

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  background-clip: content-box;
}

::selection {
  background: rgba(230, 57, 70, 0.28);
  color: var(--text);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  nav[aria-label="主导航"] {
    min-height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  nav[aria-label="主导航"] ul {
    width: 100%;
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav[aria-label="主导航"] ul::-webkit-scrollbar {
    display: none;
  }

  nav[aria-label="主导航"] ul li a {
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 7px 11px;
  }

  main {
    padding: 0 14px 32px;
  }

  main > section {
    border-radius: var(--radius);
    margin-bottom: 20px;
  }

  #hero {
    margin-top: 18px;
  }

  #articles article {
    padding: 18px 18px;
  }

  #faq h3 + p {
    padding-left: 20px;
  }

  #faq h3 + p::before {
    display: none;
  }

  #howto h4 {
    padding-left: 46px;
  }

  #howto h4::before {
    left: 12px;
    width: 22px;
    height: 22px;
  }

  #howto h4 + p {
    padding-left: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
    line-height: 1.75;
  }

  main > section {
    padding: 20px 16px;
    border-radius: 14px;
  }

  #hero {
    padding: 28px 20px;
  }

  #hero h1 {
    font-size: 1.5rem;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  #articles article {
    padding: 16px 15px;
    border-radius: 12px;
  }

  #articles article a {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  #sitemap ul,
  #links ul {
    gap: 8px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

  footer {
    padding: 24px 16px;
  }

  footer p {
    font-size: 0.82rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ Print ============ */
@media print {
  header,
  footer,
  #hero::after,
  #hero::before {
    display: none !important;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    animation: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}