:root {
  --primary: #c0392b;
  --primary-dark: #922b21;
  --primary-light: #e74c3c;
  --accent: #f39c12;
  --accent-light: #f1c40f;
  --bg: #fdfaf6;
  --bg-alt: #f5efe8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #2c2620;
  --text-muted: #6b5f54;
  --text-light: #8a7d70;
  --border: rgba(192, 57, 43, 0.12);
  --border-strong: rgba(192, 57, 43, 0.22);
  --shadow-sm: 0 2px 8px rgba(44, 38, 32, 0.06);
  --shadow-md: 0 8px 28px rgba(44, 38, 32, 0.1);
  --shadow-lg: 0 18px 50px rgba(44, 38, 32, 0.14);
  --shadow-primary: 0 10px 30px rgba(192, 57, 43, 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #ff6b5b;
    --accent: #f5b041;
    --accent-light: #f7c948;
    --bg: #14100d;
    --bg-alt: #1c1712;
    --surface: rgba(38, 31, 26, 0.72);
    --surface-solid: #221c17;
    --text: #f2ebe3;
    --text-muted: #b8a99a;
    --text-light: #93857a;
    --border: rgba(231, 76, 60, 0.18);
    --border-strong: rgba(231, 76, 60, 0.32);
    --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 50px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 10px 30px rgba(231, 76, 60, 0.3);
  }
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 16px;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(192, 57, 43, 0.06), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(243, 156, 18, 0.06), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(192, 57, 43, 0.04), transparent 50%);
  background-attachment: fixed;
  transition: background-color var(--transition), color var(--transition);
}

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

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

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

ul,
ol {
  list-style: none;
}

/* ============ 滚动动画 ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes floatSoft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.35);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(192, 57, 43, 0);
  }
}

section {
  animation: fadeUp 0.7s var(--transition) both;
}

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

/* ============ 头部导航 ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -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: background var(--transition), box-shadow var(--transition);
}

header nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

header nav ul li {
  flex: 0 0 auto;
}

header nav ul li a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 999px;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition), background var(--transition),
    transform var(--transition);
}

header nav ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--transition);
}

header nav ul li a:hover {
  color: var(--primary);
  background: rgba(192, 57, 43, 0.08);
  transform: translateY(-1px);
}

header nav ul li a:hover::after {
  width: 55%;
}

/* ============ 主体容器 ============ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ============ 面包屑 ============ */
main > nav[aria-label="面包屑导航"] {
  padding: 22px 0 6px;
  font-size: 0.86rem;
  color: var(--text-light);
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

main > nav[aria-label="面包屑导航"] ol li {
  display: flex;
  align-items: center;
  gap: 8px;
}

main > nav[aria-label="面包屑导航"] ol li + li::before {
  content: "›";
  color: var(--text-light);
  opacity: 0.6;
}

main > nav[aria-label="面包屑导航"] ol li a {
  color: var(--text-muted);
}

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

/* ============ 通用区块 ============ */
section {
  margin-top: 56px;
  position: relative;
}

section > h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
  padding-left: 18px;
  position: relative;
  color: var(--text);
}

section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1.15em;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  box-shadow: 0 0 16px rgba(192, 57, 43, 0.4);
}

section > h3 {
  font-size: clamp(1.08rem, 2.2vw, 1.28rem);
  font-weight: 700;
  line-height: 1.5;
  margin: 30px 0 12px;
  color: var(--primary-dark);
  transition: color var(--transition);
}

section > h3::before {
  content: "◆";
  display: inline-block;
  margin-right: 9px;
  font-size: 0.62em;
  vertical-align: middle;
  color: var(--accent);
  transform: translateY(-1px);
}

section p {
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ============ 首屏 Banner ============ */
#banner {
  margin-top: 34px;
  padding: clamp(38px, 6vw, 76px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(
    125deg,
    #c0392b 0%,
    #a93226 22%,
    #7d2a1f 48%,
    #b9770e 78%,
    #d68910 100%
  );
  background-size: 220% 220%;
  animation: gradientShift 16s ease infinite, fadeUp 0.8s var(--transition) both;
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  isolation: isolate;
}

#banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.14), transparent 36%);
  z-index: -1;
}

#banner::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
  animation: floatSoft 9s ease-in-out infinite;
  z-index: -1;
}

#banner h1 {
  font-size: clamp(1.6rem, 4.4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.28);
}

#banner p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.96rem, 1.5vw, 1.06rem);
  line-height: 1.9;
  max-width: 900px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 0;
}

/* ============ 玻璃卡片（通用内容区） ============ */
#about,
#products,
#solutions,
#scenarios,
#cases,
#news,
#knowledge,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal {
  background: var(--surface);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 46px);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), border-color var(--transition),
    transform var(--transition);
}

#about:hover,
#products:hover,
#solutions:hover,
#scenarios:hover,
#cases:hover,
#news:hover,
#knowledge:hover,
#faq:hover,
#howto:hover,
#contact:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* ============ 技术文章列表 ============ */
#articles > article {
  background: var(--surface);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(20px, 3.2vw, 32px);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

#articles > article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

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

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

#articles > article h3 {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}

#articles > article h3::before {
  content: "❖";
  color: var(--primary);
}

#articles > article p:first-of-type {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid var(--border);
  padding: 2px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

#articles > article p {
  font-size: 0.95rem;
}

#articles > article p:last-child {
  margin-bottom: 0;
  margin-top: 14px;
}

#articles > article p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(192, 57, 43, 0.06);
  transition: all var(--transition);
}

#articles > article p:last-child a::after {
  content: "→";
  transition: transform var(--transition);
}

#articles > article p:last-child a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

#articles > article p:last-child a:hover::after {
  transform: translateX(4px);
}

/* ============ FAQ 手风琴风格 ============ */
#faq h3 {
  margin-top: 22px;
  padding: 14px 18px 14px 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  cursor: default;
  transition: all var(--transition);
}

#faq h3::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  vertical-align: middle;
  transform: translateY(-1px);
}

#faq h3:hover {
  border-left-color: var(--accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

#faq h3 + p {
  padding: 6px 20px 6px 22px;
  font-size: 0.94rem;
  color: var(--text-muted);
  border-left: 1px dashed var(--border-strong);
  margin-left: 12px;
  margin-bottom: 6px;
}

/* ============ HowTo 步骤 ============ */
#howto h3 {
  color: var(--primary-dark);
}

#howto h3:nth-of-type(1)::before,
#howto h3:nth-of-type(2)::before,
#howto h3:nth-of-type(3)::before,
#howto h3:nth-of-type(4)::before,
#howto h3:nth-of-type(5)::before,
#howto h3:nth-of-type(6)::before,
#howto h3:nth-of-type(7)::before {
  content: "▸";
  color: var(--accent);
}

/* ============ 联系信息 ============ */
#contact p {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: background var(--transition);
}

#contact p:hover {
  background: rgba(192, 57, 43, 0.06);
}

#contact h3 {
  margin-top: 26px;
}

#contact h3:first-of-type {
  margin-top: 0;
}

/* ============ 网站地图 & 友情链接 ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

/* ============ 法律声明 ============ */
#legal h2 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 10px;
}

#legal h2:first-of-type {
  margin-top: 0;
}

#legal h2::before {
  width: 4px;
  height: 0.9em;
  background: var(--accent);
  box-shadow: none;
}

#legal p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ============ 页脚 ============ */
footer {
  position: relative;
  background: linear-gradient(160deg, #2c1a14 0%, #1a0f0b 55%, #221410 100%);
  color: rgba(255, 255, 255, 0.72);
  padding: 46px 24px 54px;
  text-align: center;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)) 1;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(192, 57, 43, 0.18), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(243, 156, 18, 0.12), transparent 45%);
  pointer-events: none;
}

footer p {
  position: relative;
  margin: 6px auto;
  font-size: 0.86rem;
  line-height: 1.8;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.66);
}

footer p:first-child {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  main {
    padding: 0 18px 64px;
  }

  header nav {
    padding: 0 14px;
  }

  header nav ul {
    min-height: 58px;
    gap: 2px;
  }

  header nav ul li a {
    padding: 7px 11px;
    font-size: 0.86rem;
  }

  html {
    scroll-padding-top: 78px;
  }

  section {
    margin-top: 42px;
  }

  #banner {
    margin-top: 24px;
  }
}

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

  main {
    padding: 0 14px 54px;
  }

  header nav ul {
    min-height: 52px;
  }

  header nav ul li a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  header nav ul li a:hover {
    transform: none;
  }

  html {
    scroll-padding-top: 70px;
  }

  section {
    margin-top: 34px;
  }

  section > h2 {
    padding-left: 14px;
    margin-bottom: 20px;
  }

  section > h2::before {
    width: 5px;
  }

  section > h3 {
    margin-top: 24px;
  }

  #banner {
    padding: 34px 22px;
    border-radius: var(--radius-lg);
  }

  #banner::after {
    width: 160px;
    height: 160px;
    right: -50px;
    top: -50px;
  }

  #about,
  #products,
  #solutions,
  #scenarios,
  #cases,
  #news,
  #knowledge,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

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

  #articles > article:hover {
    transform: none;
  }

  #faq h3 {
    padding: 12px 14px 12px 16px;
    font-size: 0.95rem;
  }

  #faq h3:hover {
    transform: none;
  }

  #faq h3 + p {
    padding: 4px 14px 4px 16px;
    margin-left: 8px;
  }

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

  #sitemap ul li a,
  #links ul li a {
    padding: 8px 15px;
    font-size: 0.84rem;
  }

  footer {
    padding: 36px 18px 44px;
  }

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

/* ============ 打印样式 ============ */
@media print {
  header,
  footer,
  #banner::after {
    display: none;
  }

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

  section,
  #articles > article {
    box-shadow: none;
    border: 1px solid #ddd;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    break-inside: avoid;
  }

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