:root {
  --primary: #ff6b35;
  --primary-dark: #e85a28;
  --primary-light: #ff8f5e;
  --secondary: #7c4dff;
  --secondary-dark: #651fff;
  --accent: #00d9c0;
  --bg: #f7f8fc;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --text: #1a1d29;
  --text-secondary: #4a5068;
  --text-muted: #8b90a5;
  --border: #e4e7f0;
  --shadow-sm: 0 2px 8px rgba(26, 29, 41, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 29, 41, 0.08);
  --shadow-lg: 0 16px 48px rgba(26, 29, 41, 0.12);
  --shadow-primary: 0 8px 28px rgba(255, 107, 53, 0.28);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 68px;
}

[data-theme="dark"] {
  --bg: #0f1119;
  --bg-alt: #161923;
  --bg-card: #1c2030;
  --glass-bg: rgba(28, 32, 48, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --text-secondary: #b0b6cc;
  --text-muted: #6b7190;
  --border: #262b3d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-primary: 0 8px 28px rgba(255, 107, 53, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1119;
    --bg-alt: #161923;
    --bg-card: #1c2030;
    --glass-bg: rgba(28, 32, 48, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #eef0f6;
    --text-secondary: #b0b6cc;
    --text-muted: #6b7190;
    --border: #262b3d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-primary: 0 8px 28px rgba(255, 107, 53, 0.2);
  }
}

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

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

body {
  font-family: var(--font);
  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(255, 107, 53, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(124, 77, 255, 0.06), transparent);
  background-attachment: fixed;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  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(--primary-dark);
}

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

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

header.scrolled {
  box-shadow: var(--shadow-md);
  background: var(--glass-bg);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 32px;
}

header nav > a:first-child {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
}

header nav > a:first-child::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

header nav > a:first-child:hover::after {
  transform: scaleX(1);
}

header nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

header nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

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

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

/* ===== Sections ===== */
section {
  margin-top: 72px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

section > h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
  position: relative;
  padding-left: 20px;
  line-height: 1.3;
}

section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

section > h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
  line-height: 1.4;
}

section > h2 + p,
section > p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.98rem;
}

section p {
  color: var(--text-secondary);
}

section ul,
section ol {
  padding-left: 24px;
  margin: 12px 0;
  color: var(--text-secondary);
}

section ul li,
section ol li {
  margin-bottom: 8px;
  padding-left: 4px;
}

section ul li::marker {
  color: var(--primary);
}

section ol li::marker {
  color: var(--primary);
  font-weight: 700;
}

/* ===== Hero ===== */
#hero {
  margin-top: 32px;
  padding: 64px 40px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, #ff6b35 0%, #ff8f5e 25%, #7c4dff 75%, #651fff 100%);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-primary);
  color: #fff;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.18), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(60px);
  pointer-events: none;
}

#hero h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

#hero p {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.92);
  max-width: 820px;
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

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

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

/* ===== Cards / Content Sections ===== */
#brand,
#products,
#solutions,
#applications,
#cases,
#news,
#articles,
#knowledge,
#faq,
#howto,
#contact,
#author,
#sitemap,
#links,
#legal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

#brand:hover,
#products:hover,
#solutions:hover,
#applications:hover,
#cases:hover,
#news:hover,
#articles:hover,
#knowledge:hover,
#faq:hover,
#howto:hover,
#contact:hover {
  box-shadow: var(--shadow-md);
}

/* ===== Articles ===== */
article {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 18px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

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

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 53, 0.3);
}

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

article h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.45;
  transition: color var(--transition);
}

article:hover h3 {
  color: var(--primary);
}

article > p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

article > p:first-of-type::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

article p {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
  transition: gap var(--transition), color var(--transition);
}

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

article a:hover {
  gap: 10px;
}

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

/* ===== Blockquote ===== */
blockquote {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.06), rgba(124, 77, 255, 0.06));
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 16px 0;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

blockquote p {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.96rem;
  line-height: 1.8;
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: -8px;
  left: 16px;
  font-size: 3rem;
  font-family: Georgia, serif;
  color: var(--primary);
  opacity: 0.25;
  line-height: 1;
}

/* ===== FAQ ===== */
#faq h3 {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 12px 0 0;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  padding-right: 48px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

#faq h3::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform var(--transition);
}

#faq h3:hover {
  background: rgba(255, 107, 53, 0.06);
  border-color: rgba(255, 107, 53, 0.3);
}

#faq h3 + p {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px 20px;
  margin: 0 0 8px;
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ===== HowTo ===== */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 56px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

#howto ol li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(255, 107, 53, 0.3);
}

#howto ul li {
  position: relative;
  list-style: none;
  padding-left: 24px;
}

#howto ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: rotate(45deg);
}

/* ===== Contact ===== */
#contact ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

#contact ul li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

#contact ul li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 217, 192, 0.15);
}

#contact ul li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(0, 217, 192, 0.4);
}

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

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 10px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

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

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

#legal p {
  font-size: 0.92rem;
  line-height: 1.85;
}

/* ===== Footer ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}

footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

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

footer a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}

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

/* ===== Scroll Animation ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

section {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }
section:nth-child(n+13) { animation-delay: 0.65s; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  header nav {
    padding: 0 16px;
    gap: 16px;
  }

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

  main {
    padding: 0 16px 60px;
  }

  section {
    margin-top: 52px;
  }

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

  #hero {
    padding: 44px 24px;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 60px;
  }

  header nav {
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }

  header nav > a:first-child {
    font-size: 1.15rem;
  }

  header nav ul {
    width: 100%;
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: 0;
  }

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

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

  main {
    padding: 0 12px 48px;
  }

  section {
    margin-top: 40px;
  }

  section > h2 {
    font-size: 1.35rem;
    padding-left: 16px;
    margin-bottom: 18px;
  }

  section > h3 {
    font-size: 1.05rem;
  }

  #hero {
    padding: 32px 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
  }

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

  #hero p {
    font-size: 0.92rem;
  }

  #brand,
  #products,
  #solutions,
  #applications,
  #cases,
  #news,
  #articles,
  #knowledge,
  #faq,
  #howto,
  #contact,
  #author,
  #sitemap,
  #links,
  #legal {
    padding: 22px 16px;
    border-radius: var(--radius-sm);
  }

  article {
    padding: 18px 16px;
  }

  blockquote {
    padding: 16px 18px;
  }

  #contact ul {
    grid-template-columns: 1fr;
  }

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

  #faq h3 {
    padding: 14px 16px;
    padding-right: 42px;
    font-size: 0.94rem;
  }

  #howto ol li {
    padding: 12px 14px 12px 48px;
  }

  #howto ol li::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }

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

/* ===== 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 {
  header,
  footer {
    display: none;
  }

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

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