:root {
  --primary: #1a4d8f;
  --primary-light: #2e6bc4;
  --primary-dark: #0f2f5c;
  --accent: #c9a227;
  --accent-light: #e8c547;
  --accent-dark: #9a7b1a;
  --bg: #f5f7fa;
  --bg-alt: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-strong: rgba(255, 255, 255, 0.88);
  --text: #1f2937;
  --text-soft: #4b5563;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --border-glass: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 1px 3px rgba(15, 47, 92, 0.06), 0 1px 2px rgba(15, 47, 92, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 47, 92, 0.08), 0 2px 6px rgba(15, 47, 92, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 47, 92, 0.12), 0 4px 12px rgba(15, 47, 92, 0.06);
  --shadow-glow: 0 0 0 1px rgba(26, 77, 143, 0.06), 0 8px 32px rgba(26, 77, 143, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4a8fe0;
    --primary-light: #6aa8f0;
    --primary-dark: #2e6bc4;
    --accent: #e8c547;
    --accent-light: #f0d76a;
    --accent-dark: #c9a227;
    --bg: #0d1117;
    --bg-alt: #161b22;
    --bg-glass: rgba(22, 27, 34, 0.72);
    --bg-glass-strong: rgba(22, 27, 34, 0.88);
    --text: #e6edf3;
    --text-soft: #b1bac4;
    --text-muted: #8b949e;
    --border: #30363d;
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 1px rgba(74, 143, 224, 0.1), 0 8px 32px rgba(74, 143, 224, 0.15);
  }
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(26, 77, 143, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(201, 162, 39, 0.05), transparent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 143, 224, 0.12), transparent),
      radial-gradient(ellipse 60% 40% at 90% 10%, rgba(232, 197, 71, 0.06), transparent);
  }
}

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 {
  color: var(--accent);
}

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

ul,
ol {
  list-style: none;
}

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

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.top-bar span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar span:first-child {
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.top-bar span:last-child {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

nav[aria-label="主导航"] {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

nav[aria-label="主导航"] a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

nav[aria-label="主导航"] a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--transition);
}

nav[aria-label="主导航"] a:hover {
  color: var(--primary);
  background: rgba(26, 77, 143, 0.06);
  transform: translateY(-1px);
}

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

/* ========== Main Layout ========== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0;
  position: relative;
}

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

section > h2 {
  position: relative;
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  padding-bottom: 12px;
}

section > h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
}

section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
  letter-spacing: 0.01em;
}

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

section p {
  color: var(--text-soft);
  margin-bottom: 14px;
  max-width: 72ch;
}

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

/* ========== Hero / Home ========== */
#home {
  position: relative;
  padding: 96px 0 80px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(26, 77, 143, 0.92) 0%, rgba(15, 47, 92, 0.95) 40%, rgba(201, 162, 39, 0.85) 100%),
    radial-gradient(circle at 20% 80%, rgba(46, 107, 196, 0.6), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(232, 197, 71, 0.4), transparent 50%);
  background-size: 200% 200%, 100% 100%, 100% 100%;
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  animation: gradientShift 18s ease infinite;
}

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

#home::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.08) 0, transparent 35%);
  pointer-events: none;
}

#home::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  clip-path: polygon(0 100%, 5% 60%, 15% 85%, 25% 50%, 35% 75%, 45% 40%, 55% 70%, 65% 35%, 75% 65%, 85% 45%, 95% 75%, 100% 55%, 100% 100%);
  opacity: 0.15;
}

#home h1 {
  position: relative;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease both;
}

#home p {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 1.5vw, 1.125rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.9);
  animation: fadeInUp 0.8s ease 0.15s both;
}

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

/* ========== Cards ========== */
#about,
#products,
#solutions,
#cases,
#news,
#articles,
#howto,
#faq,
#knowledge,
#contact,
#sitemap,
#links {
  position: relative;
}

#about h3,
#products h3,
#solutions h3,
#cases h3,
#news h3,
#articles h3,
#howto h3,
#faq h3,
#knowledge h3,
#contact h3,
#sitemap h3,
#links h3 {
  position: relative;
  padding-left: 16px;
}

#about h3::before,
#products h3::before,
#solutions h3::before,
#cases h3::before,
#news h3::before,
#articles h3::before,
#howto h3::before,
#faq h3::before,
#knowledge h3::before,
#contact h3::before,
#sitemap h3::before,
#links h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* Card-style blocks */
#about > div,
#products > div,
#solutions > div,
#cases > div,
#news > div,
#articles > article,
#howto > div,
#faq > div,
#contact > div {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#about > div:hover,
#products > div:hover,
#solutions > div:hover,
#cases > div:hover,
#news > div:hover,
#articles > article:hover,
#howto > div:hover,
#faq > div:hover,
#contact > div:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(26, 77, 143, 0.2);
}

/* ========== News / Articles ========== */
#news > h3,
#articles > article > h3 {
  font-size: 1.0625rem;
  color: var(--text);
}

#news > h3 + p,
#articles > article > h3 + p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

#news > h3 + p::before,
#articles > article > h3 + p::before {
  content: "📅 ";
  font-size: 0.75rem;
}

#articles > article {
  position: relative;
  overflow: hidden;
}

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

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

/* ========== FAQ ========== */
#faq > h3 {
  cursor: default;
  transition: color var(--transition);
}

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

#faq > h3::after {
  content: "❓";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  opacity: 0.4;
}

/* ========== HowTo ========== */
#howto {
  counter-reset: howto-step;
}

#howto > h3 {
  counter-increment: howto-step;
}

#howto > h3::before {
  content: counter(howto-step);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  padding-left: 0;
}

#howto > h3 {
  padding-left: 34px;
}

/* ========== Contact ========== */
#contact p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

#contact p strong,
#contact p:first-child {
  color: var(--text);
  font-weight: 600;
}

/* ========== Sitemap / Links ========== */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

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

#sitemap li a,
#links li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

#sitemap li a::before,
#links li a::before {
  content: "→";
  font-size: 0.75rem;
  color: var(--accent);
  transition: transform var(--transition);
}

#sitemap li a:hover,
#links li a:hover {
  color: var(--primary);
  background: rgba(26, 77, 143, 0.06);
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

#sitemap li a:hover::before,
#links li a:hover::before {
  transform: translateX(2px);
}

/* ========== Footer ========== */
footer {
  margin-top: 64px;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: footerLine 6s linear infinite;
}

@keyframes footerLine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

footer > section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

footer > section:first-of-type {
  border-top: none;
  padding-top: 0;
}

footer > section h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

footer > section h2::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

footer > section p {
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 80ch;
}

footer > p {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ========== Glass Effect Accents ========== */
#home h1,
#home p {
  will-change: transform, opacity;
}

/* ========== Scroll Animation (CSS-only via animation-timeline if supported) ========== */
@supports (animation-timeline: view()) {
  section {
    animation: revealSection linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

  #about > div,
  #products > div,
  #solutions > div,
  #cases > div,
  #news > div,
  #articles > article,
  #howto > div,
  #faq > div,
  #contact > div,
  #sitemap li,
  #links li {
    animation: revealCard linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

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

@keyframes revealCard {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  section {
    padding: 48px 0;
  }

  #home {
    padding: 72px 0 64px;
  }

  main {
    padding: 0 20px;
  }

  #home {
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .top-bar {
    padding: 8px 20px;
  }

  nav[aria-label="主导航"] {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 16px;
    font-size: 12px;
  }

  .top-bar span:first-child {
    font-size: 12px;
  }

  nav[aria-label="主导航"] {
    padding: 0 16px;
    gap: 2px;
  }

  nav[aria-label="主导航"] a {
    padding: 6px 10px;
    font-size: 13px;
  }

  main {
    padding: 0 16px;
  }

  section {
    padding: 40px 0;
  }

  section > h2 {
    margin-bottom: 24px;
  }

  #home {
    margin: 0 -16px;
    padding: 56px 16px 48px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  #home h1 {
    font-size: clamp(1.375rem, 6vw, 1.75rem);
    margin-bottom: 16px;
  }

  #home p {
    font-size: 0.9375rem;
    line-height: 1.8;
  }

  #about > div,
  #products > div,
  #solutions > div,
  #cases > div,
  #news > div,
  #articles > article,
  #howto > div,
  #faq > div,
  #contact > div {
    padding: 18px 20px;
    border-radius: var(--radius-sm);
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  #sitemap li a,
  #links li a {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }

  footer {
    padding: 32px 16px 24px;
    margin-top: 40px;
  }

  footer > section {
    padding: 16px 0;
  }

  footer > section h2 {
    font-size: 0.875rem;
  }

  footer > section p {
    font-size: 0.75rem;
  }

  footer > p {
    font-size: 0.6875rem;
    margin-top: 16px;
    padding-top: 16px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  section {
    padding: 32px 0;
  }

  #home {
    padding: 44px 14px 40px;
  }

  #home h1 {
    font-size: 1.25rem;
  }

  #home p {
    font-size: 0.875rem;
  }

  #about > div,
  #products > div,
  #solutions > div,
  #cases > div,
  #news > div,
  #articles > article,
  #howto > div,
  #faq > div,
  #contact > div {
    padding: 16px;
  }

  section h3 {
    font-size: 1rem;
  }

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

  #faq > h3::after {
    display: none;
  }
}

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

  #home {
    animation: none;
  }

  footer::before {
    animation: none;
  }
}

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

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

  section {
    page-break-inside: avoid;
  }
}