:root {
  --primary: #0f4c81;
  --primary-light: #1a6fb5;
  --primary-dark: #0a3459;
  --accent: #00c2a8;
  --accent-light: #2ee6cc;
  --gradient-1: linear-gradient(135deg, #0f4c81 0%, #00c2a8 100%);
  --gradient-2: linear-gradient(135deg, #1a6fb5 0%, #0a3459 100%);
  --gradient-hero: linear-gradient(135deg, #0a3459 0%, #0f4c81 40%, #00c2a8 100%);
  --bg: #f4f7fa;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1c2b3a;
  --text-light: #52677a;
  --text-muted: #7a8fa3;
  --border: rgba(15, 76, 129, 0.12);
  --shadow-sm: 0 2px 8px rgba(15, 76, 129, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 76, 129, 0.12);
  --shadow-lg: 0 16px 48px rgba(15, 76, 129, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1180px;
  --header-height: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4a9ede;
    --primary-light: #6bb8f0;
    --primary-dark: #2a7bbf;
    --accent: #2ee6cc;
    --accent-light: #5ff2dd;
    --gradient-1: linear-gradient(135deg, #0d2a42 0%, #0a5c52 100%);
    --gradient-2: linear-gradient(135deg, #12314d 0%, #071a2b 100%);
    --gradient-hero: linear-gradient(135deg, #05121f 0%, #0d2a42 40%, #0a5c52 100%);
    --bg: #0a1420;
    --bg-card: rgba(20, 38, 58, 0.72);
    --bg-card-solid: #12243a;
    --bg-glass: rgba(18, 34, 52, 0.55);
    --text: #e2ecf5;
    --text-light: #a8bccf;
    --text-muted: #7a8fa3;
    --border: rgba(74, 158, 222, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}

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

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

body {
  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 10% 0%, rgba(0, 194, 168, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(15, 76, 129, 0.1) 0%, transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

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

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

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

ul {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 10px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

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

#site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient-1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.brand:hover::after {
  transform: scaleX(1);
}

#site-header nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#site-header nav > ul > li > a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-light);
  border-radius: 999px;
  transition: all var(--transition);
  position: relative;
}

#site-header nav > ul > li > a:hover {
  color: #fff;
  background: var(--gradient-1);
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.3);
  transform: translateY(-2px);
}

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

section {
  margin-top: 72px;
  animation: fadeUp 0.8s ease both;
}

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

section:nth-child(2) { animation-delay: 0.05s; }
section:nth-child(3) { animation-delay: 0.1s; }
section:nth-child(4) { animation-delay: 0.15s; }
section:nth-child(5) { animation-delay: 0.2s; }

/* ===== Hero / Home ===== */
#home {
  margin-top: 40px;
  padding: 64px 48px;
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite, fadeUp 0.8s ease both;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#home::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

#home::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 50%;
  height: 120%;
  background: radial-gradient(circle, rgba(0, 194, 168, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

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

#home h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.35;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
  position: relative;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

#home p {
  font-size: 1.02rem;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 16px;
  position: relative;
  max-width: 820px;
}

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

/* ===== Headings ===== */
h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 28px;
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1.2em;
  border-radius: 6px;
  background: var(--gradient-1);
  box-shadow: 0 0 12px rgba(0, 194, 168, 0.4);
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 14px;
  line-height: 1.5;
  transition: color var(--transition);
}

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

h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 10px;
}

p {
  color: var(--text-light);
  margin-bottom: 14px;
}

/* ===== Card sections ===== */
#about,
#products,
#solutions,
#cases,
#news,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal,
#author {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

#about:hover,
#products:hover,
#solutions:hover,
#cases:hover,
#news:hover,
#faq:hover,
#howto:hover,
#contact:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ===== Articles ===== */
#articles {
  margin-top: 72px;
}

#articles > h2 {
  margin-bottom: 28px;
}

#articles article {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  position: relative;
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-1);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 194, 168, 0.35);
}

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

#articles article h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

#articles article > p:first-of-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
}

@media (prefers-color-scheme: dark) {
  #articles article > p:first-of-type {
    background: rgba(74, 158, 222, 0.12);
  }
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--gradient-1);
  color: #fff;
  margin-top: 6px;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(15, 76, 129, 0.25);
}

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

#articles article a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 194, 168, 0.4);
}

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

/* ===== Blockquote / Cases ===== */
blockquote {
  margin: 18px 0;
  padding: 20px 24px 20px 28px;
  background: linear-gradient(
    135deg,
    rgba(0, 194, 168, 0.08),
    rgba(15, 76, 129, 0.06)
  );
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

blockquote p {
  color: var(--text);
  font-style: italic;
  margin-bottom: 8px;
}

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

/* ===== FAQ ===== */
#faq h3 {
  padding: 14px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin: 20px 0 0;
  font-size: 1.02rem;
  position: relative;
  cursor: default;
  transition: background var(--transition), color var(--transition);
}

#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(--gradient-1);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

#faq h3 + p {
  padding: 16px 20px;
  margin: 0 0 6px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.95rem;
  transition: background var(--transition);
}

#faq h3:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 194, 168, 0.12),
    rgba(15, 76, 129, 0.08)
  );
}

/* ===== HowTo ===== */
#howto h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(
    135deg,
    rgba(15, 76, 129, 0.06),
    rgba(0, 194, 168, 0.06)
  );
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
  margin: 18px 0 10px;
  transition: transform var(--transition), border-color var(--transition);
}

#howto h4:hover {
  transform: translateX(6px);
  border-left-color: var(--accent);
}

/* ===== Contact ===== */
#contact p {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  font-size: 0.98rem;
}

#contact p:hover {
  background: var(--bg-glass);
  transform: translateX(4px);
}

#contact p:nth-child(2)::before { content: "🏷️"; }
#contact p:nth-child(3)::before { content: "🌐"; }
#contact p:nth-child(4)::before { content: "✉️"; }
#contact p:nth-child(5)::before { content: "📞"; }
#contact p:nth-child(6)::before { content: "📍"; }
#contact p:nth-child(7)::before { content: "🕘"; }
#contact p:nth-child(8)::before { content: "💬"; }

/* ===== Sitemap & Links ===== */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: var(--gradient-1);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(15, 76, 129, 0.3);
}

/* ===== Legal ===== */
#legal h2:not(:first-child) {
  margin-top: 36px;
}

#legal p {
  font-size: 0.95rem;
}

/* ===== Author ===== */
#author p {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

#author p:last-child {
  border-bottom: none;
}

/* ===== Footer ===== */
footer {
  margin-top: 80px;
  padding: 40px 24px;
  text-align: center;
  background: var(--gradient-2);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    var(--primary-light),
    transparent
  );
}

footer p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  #site-header {
    height: auto;
    min-height: var(--header-height);
  }

  #site-header nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 18px;
    gap: 10px;
  }

  #site-header nav > ul {
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
  }

  #site-header nav > ul > li > a {
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  main {
    padding: 0 16px 60px;
  }

  section {
    margin-top: 48px;
  }

  #home {
    padding: 44px 26px;
    border-radius: var(--radius-lg);
  }

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

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

  h2 {
    padding-left: 14px;
  }

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

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

  #site-header nav > ul {
    flex-wrap: wrap;
  }

  #site-header nav > ul > li > a {
    padding: 5px 9px;
    font-size: 0.8rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  #home {
    padding: 32px 20px;
  }

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

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

  #about,
  #products,
  #solutions,
  #cases,
  #news,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal,
  #author {
    padding: 22px 16px;
  }

  #articles article {
    padding: 16px;
  }

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

  #faq h3 + p {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  #contact p {
    font-size: 0.9rem;
    padding: 8px 10px;
  }

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

  footer {
    padding: 28px 16px;
    font-size: 0.82rem;
  }
}

/* ===== 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;
  }
}

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

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

  section {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}