:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b7a;
  --accent: #ff8c42;
  --accent-2: #ffb703;
  --bg: #f7f5f2;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --text: #1d1d1f;
  --text-soft: #4a4a52;
  --text-muted: #6e6e78;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 2px 8px rgba(29, 29, 31, 0.06);
  --shadow-md: 0 8px 28px rgba(29, 29, 31, 0.09);
  --shadow-lg: 0 18px 48px rgba(29, 29, 31, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --container: 1240px;
  --gap-mobile: 14px;
  --gap-desktop: 18px;
  --section-mobile: 48px;
  --section-desktop: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --bg-elevated: #1c1c21;
    --bg-glass: rgba(28, 28, 33, 0.68);
    --text: #f2f2f5;
    --text-soft: #c4c4cd;
    --text-muted: #9a9aa6;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
    --primary: #ff5566;
    --primary-dark: #e63946;
    --primary-light: #ff8a96;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(230, 57, 70, 0.1), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(255, 140, 66, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 183, 3, 0.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

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

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

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

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

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

h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 23px;
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

h3 {
  font-size: 17px;
  color: var(--text);
}

h4 {
  font-size: 15.5px;
}

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

li {
  margin-bottom: 0.4em;
}

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

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding: 8px 20px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  background: linear-gradient(100deg, var(--primary-dark), var(--primary) 45%, var(--accent) 100%);
}

.topbar span {
  display: inline-block;
  opacity: 0.94;
}

header nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  justify-content: center;
}

header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

header nav a:hover,
header nav a:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.32);
  outline: none;
}

/* ============ Main / Sections ============ */
main {
  display: block;
}

main > section,
main > nav,
footer > section {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

main > section {
  padding-top: var(--section-mobile);
  padding-bottom: var(--section-mobile);
}

main > section + section {
  border-top: 1px solid var(--border);
}

main > section:first-of-type {
  padding-top: 32px;
}

/* Hero (#home) */
#home {
  position: relative;
  padding-top: 36px !important;
  padding-bottom: 40px !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 183, 3, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(230, 57, 70, 0.12), rgba(255, 140, 66, 0.1) 55%, rgba(255, 183, 3, 0.08));
  overflow: hidden;
}

#home::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.28), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

#home h1 {
  max-width: 900px;
  background: linear-gradient(100deg, var(--primary-dark), var(--primary) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

#home p {
  max-width: 860px;
  font-size: 15px;
  color: var(--text-soft);
}

#home img {
  margin-top: 24px;
  width: 100%;
  max-width: 860px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

#home img:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 26px 60px rgba(29, 29, 31, 0.2);
}

/* Breadcrumb */
main > nav[aria-label="面包屑导航"] {
  padding-top: 16px;
  padding-bottom: 16px;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 16px;
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

main > nav[aria-label="面包屑导航"] li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin: 0 8px 0 2px;
  color: var(--text-muted);
  opacity: 0.6;
}

main > nav[aria-label="面包屑导航"] a {
  color: var(--text-soft);
  font-weight: 500;
}

main > nav[aria-label="面包屑导航"] a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Generic section content spacing */
main > section > p {
  max-width: 900px;
  font-size: 15px;
}

main > section > h3 {
  margin-top: 1.6em;
}

main > section > h3 + p {
  margin-top: 0;
}

main > section > img {
  margin-top: 26px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

main > section > img:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============ Cards: article / faq / howto / cases / products ============ */
#products > h3,
#solutions > h3,
#cases > h3,
#about > h3,
#news > h3,
#howto > h3,
#contact > h3 {
  display: inline-block;
  padding: 4px 14px 4px 12px;
  font-size: 15.5px;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(90deg, rgba(230, 57, 70, 0.1), transparent);
}

/* Articles grid */
#articles {
  display: block;
}

#articles > h2 {
  margin-bottom: 1em;
}

#articles article {
  position: relative;
  padding: 20px;
  margin-bottom: var(--gap-mobile);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  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);
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

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

#articles article:hover::before {
  opacity: 1;
}

#articles article h3 {
  font-size: 17px;
  margin-bottom: 0.5em;
}

#articles article p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}

#articles article p:nth-of-type(1) {
  display: inline-block;
  margin-bottom: 0.7em;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(230, 57, 70, 0.1);
  border-radius: var(--radius-pill);
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  margin-top: 6px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.28);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    filter 0.25s var(--ease);
}

#articles article a::after {
  content: "→";
  transition: transform 0.25s 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.05);
}

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

/* FAQ */
#faq h3 {
  position: relative;
  margin-top: 1.4em;
  padding: 14px 18px 14px 44px;
  font-size: 15.5px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
}

#faq h3:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#faq h3 + p {
  margin-top: 0;
  padding: 16px 20px 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
}

#faq h3 + p + h3 {
  margin-top: 1.2em;
}

/* HowTo */
#howto h3 {
  padding: 10px 0 8px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px dashed var(--border-strong);
}

#howto h3::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

#howto p {
  font-size: 14.5px;
  line-height: 1.8;
}

/* ============ Contact ============ */
#contact p {
  font-size: 14.5px;
}

#contact h3 + p {
  padding: 12px 16px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

#contact h3 + p:hover {
  transform: translateX(4px);
  border-color: var(--primary);
}

/* ============ Sitemap ============ */
#sitemap ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px var(--gap-mobile);
  margin: 0;
  padding: 0;
  list-style: none;
}

#sitemap li {
  margin: 0;
}

#sitemap a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#sitemap a::before {
  content: "›";
  font-size: 16px;
  color: var(--primary);
  transition: transform 0.25s var(--ease);
}

#sitemap a:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#sitemap a:hover::before {
  transform: translateX(3px);
}

/* ============ Friend Links ============ */
#friendlinks ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#friendlinks li {
  margin: 0;
}

#friendlinks a {
  display: inline-block;
  padding: 4px 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

#friendlinks a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

/* ============ Footer ============ */
footer {
  margin-top: var(--section-mobile);
  padding-top: 36px;
  padding-bottom: 28px;
  background:
    linear-gradient(180deg, transparent, rgba(230, 57, 70, 0.04)),
    var(--bg-elevated);
  border-top: 1px solid var(--border);
}

footer > section {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 22px;
}

footer h2 {
  font-size: 16px;
  padding-left: 13px;
  margin-bottom: 0.5em;
}

footer h2::before {
  width: 4px;
  top: 0.15em;
  bottom: 0.15em;
}

footer p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

footer > p {
  max-width: var(--container);
  margin: 26px auto 0;
  padding: 16px 20px 0;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ============ Scroll animation ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main > section,
main > nav[aria-label="面包屑导航"],
footer > section {
  animation: fadeUp 0.7s var(--ease) both;
}

#home {
  animation-delay: 0.02s;
}
#about {
  animation-delay: 0.06s;
}
#products {
  animation-delay: 0.1s;
}
#solutions {
  animation-delay: 0.14s;
}
#cases {
  animation-delay: 0.18s;
}
#news {
  animation-delay: 0.22s;
}
#articles {
  animation-delay: 0.26s;
}
#faq {
  animation-delay: 0.3s;
}
#howto {
  animation-delay: 0.34s;
}
#contact {
  animation-delay: 0.38s;
}

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

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

/* ============ Responsive: 720px ============ */
@media (min-width: 720px) {
  body {
    font-size: 16px;
  }

  main > section,
  main > nav,
  footer > section,
  header nav,
  footer > p {
    padding-left: 32px;
    padding-right: 32px;
  }

  main > section {
    padding-top: var(--section-desktop);
    padding-bottom: var(--section-desktop);
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 26px;
    padding-left: 18px;
  }

  h3 {
    font-size: 18px;
  }

  #home p,
  main > section > p {
    font-size: 16px;
  }

  #articles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap-desktop);
    align-items: start;
  }

  #articles > h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.4em;
  }

  #articles article {
    margin-bottom: 0;
  }

  #sitemap ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px var(--gap-desktop);
  }

  #friendlinks ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 24px;
  }

  footer {
    margin-top: var(--section-desktop);
    padding-top: 48px;
  }

  footer > section {
    margin-bottom: 28px;
  }

  footer p {
    font-size: 13.5px;
  }
}

/* ============ Responsive: 1100px ============ */
@media (min-width: 1100px) {
  main > section,
  main > nav,
  footer > section,
  header nav,
  footer > p {
    padding-left: 40px;
    padding-right: 40px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 29px;
  }

  h3 {
    font-size: 19px;
  }

  #home h1 {
    line-height: 1.16;
  }

  #home p {
    font-size: 17px;
  }

  #articles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }

  #articles article {
    padding: 24px;
  }

  #sitemap ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #friendlinks ul {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 28px;
  }

  header nav {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  header nav a {
    font-size: 14px;
    padding: 8px 16px;
  }

  footer {
    padding-top: 56px;
    padding-bottom: 36px;
  }
}

/* ============ Responsive: 1240px+ ============ */
@media (min-width: 1240px) {
  #friendlinks ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ============ Narrow screens 320px ============ */
@media (max-width: 380px) {
  main > section,
  main > nav,
  footer > section,
  header nav,
  footer > p {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 21px;
  }

  #sitemap ul {
    grid-template-columns: 1fr;
  }

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

  #articles article {
    padding: 16px;
  }
}

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

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

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