:root {
  --bg: #0f1020;
  --bg-alt: #171a33;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef0ff;
  --text-muted: #a9aed4;
  --accent: #f39c12;
  --accent-2: #7c5cff;
  --accent-3: #2ee6c5;
  --gradient: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 45%, #4a1f5c 100%);
  --gradient-accent: linear-gradient(135deg, #f39c12 0%, #ff6b9d 50%, #7c5cff 100%);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(124, 92, 255, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --blur: blur(16px);
  --maxw: 1180px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4fb;
    --bg-alt: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --border: rgba(26, 26, 46, 0.1);
    --text: #1a1a2e;
    --text-muted: #5a5f82;
    --shadow: 0 8px 32px rgba(26, 26, 46, 0.1);
    --shadow-hover: 0 16px 48px rgba(124, 92, 255, 0.22);
    --gradient: linear-gradient(135deg, #e8e4ff 0%, #f7e6f0 50%, #e0f5f1 100%);
  }
}

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

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(124, 92, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(243, 156, 18, 0.14), transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(46, 230, 197, 0.12), transparent 50%);
  pointer-events: none;
}

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

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

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

/* ============ Header / Nav ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 16, 32, 0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(245, 244, 251, 0.78);
  }
}

nav[aria-label="主导航"] {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
  justify-content: center;
}

nav[aria-label="主导航"] a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

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

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: var(--text);
  background: var(--bg-card);
  transform: translateY(-2px);
}

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

/* ============ Main layout ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

section {
  margin: 3.5rem 0;
  scroll-margin-top: 90px;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

@supports (animation-timeline: view()) {
  section {
    animation: none;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
    animation-name: fadeUp;
    animation-duration: 1s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* ============ Hero Banner ============ */
#home {
  position: relative;
  margin-top: 2rem;
  padding: 4rem 2rem;
  border-radius: 28px;
  background: var(--gradient);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

#home::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    radial-gradient(circle at 25% 30%, rgba(243, 156, 18, 0.35), transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(124, 92, 255, 0.4), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(46, 230, 197, 0.18), transparent 55%);
  animation: aurora 16s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(12deg) scale(1.15);
  }
}

#home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}

#home h1 {
  font-size: clamp(1.7rem, 4.5vw, 3rem);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  background: linear-gradient(120deg, #ffffff 0%, #ffd9a0 45%, #c9b8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 40px rgba(243, 156, 18, 0.15);
}

#home p {
  max-width: 780px;
  color: rgba(238, 240, 255, 0.82);
  font-size: 1.02rem;
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: light) {
  #home h1 {
    background: linear-gradient(120deg, #1a1a2e 0%, #7c5cff 55%, #f39c12 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  #home p {
    color: #3a3f5c;
  }
}

/* ============ Headings ============ */
h2 {
  position: relative;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 1.5rem;
  padding-left: 1.1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 4px;
  background: var(--gradient-accent);
  box-shadow: 0 0 18px rgba(243, 156, 18, 0.5);
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 0.6rem;
  letter-spacing: -0.005em;
}

h3::before {
  content: "◆";
  color: var(--accent-3);
  font-size: 0.7em;
  margin-right: 0.5rem;
  vertical-align: 0.12em;
}

p {
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

/* ============ Cards ============ */
#brand,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact {
  background: var(--bg-card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#brand:hover,
#products:hover,
#solutions:hover,
#cases:hover,
#news:hover,
#articles:hover,
#faq:hover,
#howto:hover,
#contact:hover {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--shadow-hover);
}

/* ============ Articles ============ */
#articles {
  display: grid;
  gap: 1.25rem;
}

#articles h2 {
  grid-column: 1 / -1;
}

#articles article {
  position: relative;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.4rem 1.3rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  overflow: hidden;
}

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

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(243, 156, 18, 0.45);
}

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

#articles article h3 {
  margin-top: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

#articles article p {
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(243, 156, 18, 0.35);
  background: rgba(243, 156, 18, 0.08);
  transition: all var(--transition);
}

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

#articles article a:hover {
  background: var(--accent);
  color: #1a1a2e;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

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

/* ============ FAQ ============ */
#faq h3 {
  padding: 0.85rem 1rem;
  margin: 0.6rem 0 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-bottom: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
}

#faq h3:hover {
  padding-left: 1.4rem;
  color: var(--accent);
}

#faq h3 + p {
  margin: 0 0 0.75rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-top: 1px dashed var(--border);
  font-size: 0.94rem;
}

@media (prefers-color-scheme: light) {
  #faq h3 + p {
    background: rgba(26, 26, 46, 0.03);
  }
}

/* ============ HowTo ============ */
#howto h3 {
  display: inline-block;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  background: rgba(46, 230, 197, 0.1);
  border: 1px solid rgba(46, 230, 197, 0.3);
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

#howto h3::before {
  content: "▸";
  color: var(--accent-3);
}

#howto p {
  font-size: 0.96rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(46, 230, 197, 0.2);
  margin-left: 0.3rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

/* ============ Contact ============ */
#contact h3 + p {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  font-size: 0.94rem;
  transition: transform var(--transition), border-color var(--transition);
}

#contact h3 + p:hover {
  transform: translateX(4px);
  border-color: rgba(124, 92, 255, 0.4);
}

#contact p a {
  font-weight: 600;
}

/* ============ Footer ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  border-top: 1px solid var(--border);
}

footer section {
  margin: 0;
  padding: 1.25rem 1.15rem;
  background: var(--bg-card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

footer section:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: var(--shadow);
}

footer h2 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding-left: 0.75rem;
}

footer h2::before {
  width: 3px;
  background: var(--accent);
  box-shadow: none;
}

footer p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.7;
}

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

@media (min-width: 901px) {
  #articles {
    grid-template-columns: repeat(2, 1fr);
  }
  #articles h2 {
    grid-column: 1 / -1;
  }
}

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

  main {
    padding: 0 0.9rem 3rem;
  }

  #home {
    padding: 2.5rem 1.25rem;
    border-radius: 22px;
    margin-top: 1.25rem;
  }

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

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

  #brand,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact {
    padding: 1.6rem 1.1rem;
    border-radius: var(--radius-sm);
  }

  section {
    margin: 2.25rem 0;
    scroll-margin-top: 120px;
  }

  nav[aria-label="主导航"] {
    padding: 0.55rem 0.6rem;
    gap: 0.15rem 0.2rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

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

  nav[aria-label="主导航"] a {
    font-size: 0.82rem;
    padding: 0.35rem 0.7rem;
    flex: 0 0 auto;
  }

  h2 {
    font-size: 1.3rem;
    margin-bottom: 1.1rem;
  }

  h3 {
    font-size: 1.02rem;
  }

  #articles article {
    padding: 1.2rem 1rem;
  }

  footer {
    padding: 1.75rem 0.9rem 2.5rem;
    grid-template-columns: 1fr;
  }
}

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

  nav[aria-label="主导航"] a {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
  }
}

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

/* ============ Print ============ */
@media print {
  header,
  footer,
  #home::before,
  body::before {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  section {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
}