:root {
  --bg: #0b0f19;
  --bg-soft: #111827;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --text: #e8ecf4;
  --text-soft: #a8b3c7;
  --text-mute: #6b7689;
  --accent: #ff4d6d;
  --accent-2: #7c5cff;
  --accent-3: #22d3ee;
  --grad: linear-gradient(135deg, #ff4d6d 0%, #7c5cff 50%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 77, 109, 0.22), rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.18));
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 60px -24px rgba(124, 92, 255, 0.55);
  --glass: saturate(160%) blur(16px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.2);
    --text: #131a2a;
    --text-soft: #46536b;
    --text-mute: #7b879c;
    --shadow: 0 18px 40px -22px rgba(23, 32, 56, 0.28);
    --shadow-glow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 24px 60px -28px rgba(124, 92, 255, 0.4);
  }
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(255, 77, 109, 0.16), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(820px 560px at 50% 108%, rgba(34, 211, 238, 0.12), transparent 64%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.4vw, 2.9rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.16em;
  bottom: 0.16em;
  width: 5px;
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.55);
}

h3 {
  font-size: clamp(1.05rem, 1.9vw, 1.28rem);
  color: var(--text);
}

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

ul {
  margin: 0 0 1em;
  padding-left: 1.15em;
}

li {
  margin-bottom: 0.4em;
  color: var(--text-soft);
}

li::marker {
  color: var(--accent);
}

/* ===================== Header / Nav ===================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px clamp(14px, 3vw, 34px);
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.8);
  animation: fadeDown 0.7s var(--ease) both;
}

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

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

header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

header nav a:hover,
header nav a:focus-visible {
  color: var(--text);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

header nav a:hover::after,
header nav a:focus-visible::after {
  width: 46%;
}

/* ===================== Main layout ===================== */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 40px) clamp(14px, 3vw, 34px) 60px;
}

main > section {
  position: relative;
  margin-bottom: clamp(20px, 3.2vw, 38px);
  padding: clamp(20px, 3.4vw, 40px);
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: riseUp 0.75s var(--ease) both;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

main > section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

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

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

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

/* ===================== Hero (#home) ===================== */
#home {
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 56px);
  background:
    var(--grad-soft),
    var(--bg-card);
  border: 1px solid var(--border-strong);
  text-align: left;
}

#home::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -18%;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.45), transparent 68%);
  filter: blur(20px);
  animation: floatOrb 12s ease-in-out infinite alternate;
  pointer-events: none;
}

#home h1 {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.5em;
}

#home p {
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  max-width: 78ch;
}

/* ===================== Cards (products / solutions / cases) ===================== */
#products,
#solutions,
#cases {
  display: block;
}

#products h3,
#solutions h3,
#cases h3 {
  margin-top: 1.5em;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-image: var(--grad) 1;
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#products h3:hover,
#solutions h3:hover,
#cases h3:hover {
  transform: translateX(6px);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 28px -18px rgba(124, 92, 255, 0.7);
}

#products h3 + p,
#solutions h3 + p,
#cases h3 + p {
  padding: 0 4px;
}

/* ===================== News ===================== */
#news h3 {
  position: relative;
  padding: 16px 18px;
  margin-top: 1.2em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.32s var(--ease), background 0.32s var(--ease), border-color 0.32s var(--ease), box-shadow 0.32s var(--ease);
}

#news h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
}

#news h3:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px -22px rgba(34, 211, 238, 0.6);
}

#news h3 + p {
  font-size: 0.92rem;
  color: var(--text-mute);
  padding-left: 4px;
}

/* ===================== Articles ===================== */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

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

#articles article {
  position: relative;
  padding: 20px 20px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  animation: riseUp 0.7s var(--ease) both;
}

#articles article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

#articles article:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 26px 50px -26px rgba(255, 77, 109, 0.55);
}

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

#articles article h3 {
  font-size: 1.02rem;
  line-height: 1.45;
  margin-bottom: 0.5em;
  transition: color 0.3s var(--ease);
}

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

#articles article p {
  font-size: 0.9rem;
  color: var(--text-mute);
  margin-bottom: 0;
}

/* ===================== FAQ ===================== */
#faq h3 {
  position: relative;
  margin-top: 1.35em;
  padding: 14px 18px 14px 52px;
  font-size: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 6px 16px -6px rgba(255, 77, 109, 0.8);
}

#faq h3:hover {
  transform: translateX(5px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: 0 16px 34px -22px rgba(124, 92, 255, 0.8);
}

#faq h3 + p {
  margin: 0.55em 0 0.2em;
  padding: 12px 16px 12px 52px;
  font-size: 0.93rem;
  border-left: 2px dashed var(--border-strong);
  margin-left: 6px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 255, 255, 0.02);
}

/* ===================== HowTo ===================== */
#howto h3 {
  display: inline-block;
  margin-top: 1.4em;
  padding: 6px 14px;
  font-size: 0.95rem;
  border-radius: 999px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

#howto h3:hover {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

#howto p {
  margin-top: 0.4em;
}

/* ===================== Contact ===================== */
#contact p {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: transform 0.28s var(--ease), background 0.28s var(--ease), border-color 0.28s var(--ease);
}

#contact p:hover {
  transform: translateX(5px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

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

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

#sitemap a,
#links a {
  display: block;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.28s var(--ease), background 0.28s var(--ease), color 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

#sitemap a:hover,
#sitemap a:focus-visible,
#links a:hover,
#links a:focus-visible {
  transform: translateY(-3px);
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 16px 32px -18px rgba(255, 77, 109, 0.85);
}

/* ===================== Legal ===================== */
#legal h3 {
  margin-top: 1.3em;
  font-size: 1rem;
  color: var(--accent-3);
  letter-spacing: 0.02em;
}

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

/* ===================== Footer ===================== */
footer {
  max-width: var(--maxw);
  margin: 0 auto 40px;
  padding: 26px clamp(18px, 3vw, 34px);
  text-align: center;
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

footer p {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--text-mute);
}

footer p:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
}

/* ===================== Animations ===================== */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-40px, 30px) scale(1.12);
  }
}

main > section:nth-child(1) { animation-delay: 0.02s; }
main > section:nth-child(2) { animation-delay: 0.06s; }
main > section:nth-child(3) { animation-delay: 0.1s; }
main > section:nth-child(4) { animation-delay: 0.14s; }
main > section:nth-child(5) { animation-delay: 0.18s; }
main > section:nth-child(6) { animation-delay: 0.22s; }
main > section:nth-child(7) { animation-delay: 0.26s; }
main > section:nth-child(8) { animation-delay: 0.3s; }
main > section:nth-child(9) { animation-delay: 0.34s; }
main > section:nth-child(10) { animation-delay: 0.38s; }
main > section:nth-child(11) { animation-delay: 0.42s; }
main > section:nth-child(12) { animation-delay: 0.46s; }
main > section:nth-child(13) { animation-delay: 0.5s; }

#articles article:nth-child(1) { animation-delay: 0.04s; }
#articles article:nth-child(2) { animation-delay: 0.08s; }
#articles article:nth-child(3) { animation-delay: 0.12s; }
#articles article:nth-child(4) { animation-delay: 0.16s; }
#articles article:nth-child(5) { animation-delay: 0.2s; }
#articles article:nth-child(6) { animation-delay: 0.24s; }
#articles article:nth-child(7) { animation-delay: 0.28s; }
#articles article:nth-child(8) { animation-delay: 0.32s; }
#articles article:nth-child(9) { animation-delay: 0.36s; }
#articles article:nth-child(10) { animation-delay: 0.4s; }

/* ===================== Focus / Selection ===================== */
:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(255, 77, 109, 0.4);
  color: #fff;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 77, 109, 0.7), rgba(124, 92, 255, 0.7));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 77, 109, 1), rgba(124, 92, 255, 1));
  background-clip: content-box;
}

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  #articles {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
    background-attachment: scroll;
  }

  header {
    padding: 8px 10px;
  }

  header nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

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

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

  main {
    padding: 16px 12px 40px;
  }

  main > section {
    border-radius: var(--radius);
    padding: 18px 16px;
  }

  #home {
    padding: 26px 18px;
  }

  #home::after {
    width: 280px;
    height: 280px;
    right: -30%;
  }

  h2 {
    padding-left: 13px;
  }

  h2::before {
    width: 4px;
  }

  #articles {
    grid-template-columns: 1fr;
  }

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

  #faq h3::before {
    left: 12px;
    width: 24px;
    height: 24px;
  }

  #faq h3 + p {
    padding: 10px 12px 10px 40px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  footer {
    margin: 0 12px 28px;
    padding: 20px 16px;
    border-radius: var(--radius);
  }
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.5rem;
  }

  #products h3,
  #solutions h3,
  #cases h3,
  #news h3 {
    padding: 12px 14px;
    font-size: 0.98rem;
  }

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

/* ===================== Motion preference ===================== */
@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 {
  body {
    background: #fff;
    color: #000;
  }

  header {
    position: static;
    box-shadow: none;
  }

  main > section,
  footer {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }

  a {
    color: #000;
  }
}