:root {
  --primary: #f5a623;
  --primary-dark: #e08e0b;
  --primary-light: #ffc85c;
  --accent: #ff6b35;
  --accent-2: #7b5cff;
  --bg: #faf7f2;
  --bg-alt: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(245, 166, 35, 0.18);
  --text: #2b2620;
  --text-soft: #6b6357;
  --text-muted: #9a9184;
  --header-bg: rgba(250, 247, 242, 0.78);
  --shadow-sm: 0 2px 10px rgba(43, 38, 32, 0.06);
  --shadow-md: 0 10px 30px rgba(43, 38, 32, 0.1);
  --shadow-lg: 0 20px 50px rgba(43, 38, 32, 0.14);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --gradient-hero: linear-gradient(135deg, #fff3d6 0%, #ffe0b0 35%, #ffc85c 70%, #ffb347 100%);
  --gradient-accent: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --gradient-soft: linear-gradient(135deg, rgba(245, 166, 35, 0.12), rgba(123, 92, 255, 0.1));
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ffb547;
    --primary-dark: #f5a623;
    --primary-light: #ffd27a;
    --accent: #ff8a5c;
    --accent-2: #9d86ff;
    --bg: #14110d;
    --bg-alt: #1c1813;
    --card-bg: rgba(38, 32, 25, 0.72);
    --card-border: rgba(255, 181, 71, 0.16);
    --text: #f4efe7;
    --text-soft: #c4bbac;
    --text-muted: #8f8677;
    --header-bg: rgba(20, 17, 13, 0.8);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
    --gradient-hero: linear-gradient(135deg, #2a2114 0%, #3a2c15 40%, #4a3512 70%, #5c3f10 100%);
    --gradient-soft: linear-gradient(135deg, rgba(255, 181, 71, 0.14), rgba(157, 134, 255, 0.12));
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(245, 166, 35, 0.1), transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(123, 92, 255, 0.08), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255, 107, 53, 0.07), transparent 50%);
  background-attachment: fixed;
}

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

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

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

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

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

/* ============ HEADER / NAV ============ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

nav[aria-label="主导航"] {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

nav[aria-label="主导航"] > a {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary-dark);
  position: relative;
  padding-left: 34px;
}

nav[aria-label="主导航"] > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--gradient-accent);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.45);
}

nav[aria-label="主导航"] > a::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #fff;
}

nav[aria-label="主导航"] ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

nav[aria-label="主导航"] ul li a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: all var(--transition);
  position: relative;
}

nav[aria-label="主导航"] ul li a:hover {
  color: #fff;
  background: var(--gradient-accent);
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.4);
  transform: translateY(-2px);
}

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

main > section {
  margin-bottom: 56px;
  animation: fadeUp 0.7s ease both;
}

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

/* ============ HERO ============ */
section[aria-labelledby="hero-title"] {
  margin-top: 32px;
  padding: 64px 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

section[aria-labelledby="hero-title"]::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 70%);
  z-index: -1;
  animation: float 9s ease-in-out infinite;
}

section[aria-labelledby="hero-title"]::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 92, 255, 0.22), transparent 70%);
  z-index: -1;
  animation: float 11s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.08); }
}

section[aria-labelledby="hero-title"] h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  color: #2b2620;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.5);
}

section[aria-labelledby="hero-title"] p {
  font-size: clamp(1rem, 1.8vw, 1.14rem);
  color: #4a4136;
  max-width: 780px;
  line-height: 1.85;
}

@media (prefers-color-scheme: dark) {
  section[aria-labelledby="hero-title"] h1 {
    color: #fff5e1;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  }
  section[aria-labelledby="hero-title"] p {
    color: #e8dcc6;
  }
}

/* ============ BREADCRUMB ============ */
nav[aria-label="面包屑导航"] {
  margin: 24px 0 0;
}

nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] ol li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--primary);
  font-weight: 700;
}

nav[aria-label="面包屑导航"] ol li a {
  color: var(--text-soft);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all var(--transition);
}

nav[aria-label="面包屑导航"] ol li a:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ============ SECTION HEADINGS ============ */
main > section > h2 {
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 26px;
  padding-left: 20px;
  position: relative;
  color: var(--text);
  line-height: 1.35;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 6px;
  border-radius: 6px;
  background: var(--gradient-accent);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.5);
}

main > section > h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

main > section > h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gradient-accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

h4 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--primary-dark);
  padding-left: 14px;
  border-left: 3px solid var(--primary);
  line-height: 1.5;
}

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

/* ============ CARD SECTIONS ============ */
#brand,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal,
#meta-info {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px 38px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

#brand::after,
#products::after,
#solutions::after,
#cases::after,
#news::after,
#articles::after,
#faq::after,
#howto::after,
#contact::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0.85;
}

/* ============ ARTICLES ============ */
#articles article {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  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;
  bottom: 0;
  width: 4px;
  background: var(--gradient-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

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

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

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

#articles article p {
  font-size: 0.95rem;
  line-height: 1.8;
}

#articles article p:first-of-type {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--gradient-soft);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  font-weight: 500;
}

#articles article p:last-child {
  margin-bottom: 0;
  margin-top: 12px;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--gradient-soft);
  border: 1px solid var(--card-border);
  color: var(--primary-dark);
  transition: all var(--transition);
}

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

#articles article a:hover {
  background: var(--gradient-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.4);
  transform: translateY(-2px);
}

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

/* ============ FAQ ============ */
#faq h3 {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px 16px 46px;
  margin: 14px 0 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
  cursor: default;
  transition: all var(--transition);
}

#faq h3::before {
  content: "?";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(245, 166, 35, 0.45);
}

#faq h3:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 12px 20px 4px 46px;
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 0;
}

/* ============ HOWTO ============ */
#howto h4 {
  background: var(--gradient-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 18px;
  margin: 14px 0 8px;
  color: var(--text);
  font-weight: 700;
  transition: all var(--transition);
}

#howto h4:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

#howto h4 + p {
  padding-left: 18px;
}

/* ============ CASES ============ */
#cases > p {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  border-left: 3px solid var(--accent-2);
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 12px;
  transition: all var(--transition);
}

#cases > p:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-left-color: var(--primary);
}

/* ============ NEWS ============ */
#news h3 {
  color: var(--text);
  font-size: 1.12rem;
}

#news h3 + p {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--gradient-soft);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ============ CONTACT ============ */
#contact p {
  padding: 8px 0;
  border-bottom: 1px dashed var(--card-border);
  font-size: 0.96rem;
}

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

#contact h3 {
  margin-top: 22px;
}

/* ============ SITEMAP & LINKS ============ */
#sitemap ul,
#links ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

#sitemap ul li a::before,
#links ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: -1;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.35);
}

#sitemap ul li a:hover::before,
#links ul li a:hover::before {
  opacity: 1;
}

/* ============ LEGAL & META ============ */
#legal p,
#meta-info p {
  font-size: 0.94rem;
}

#meta-info p {
  padding: 6px 0;
  border-bottom: 1px dashed var(--card-border);
}

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

/* ============ FOOTER ============ */
footer {
  background: linear-gradient(180deg, transparent, rgba(245, 166, 35, 0.08));
  border-top: 1px solid var(--card-border);
  padding: 40px 24px;
  text-align: center;
  margin-top: 20px;
}

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

footer p a {
  color: var(--text-soft);
  padding: 2px 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

footer p a:hover {
  color: var(--primary-dark);
  background: var(--gradient-soft);
}

/* ============ SCROLL ANIMATION (progressive) ============ */
@supports (animation-timeline: view()) {
  main > section {
    animation: none;
    animation: revealSection linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }

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

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  nav[aria-label="主导航"] {
    padding: 10px 16px;
  }

  nav[aria-label="主导航"] ul {
    gap: 2px;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  nav[aria-label="主导航"] ul li a {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 0.88rem;
  }

  main {
    padding: 0 16px 60px;
  }

  section[aria-labelledby="hero-title"] {
    padding: 44px 26px;
    margin-top: 20px;
  }

  #brand,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal,
  #meta-info {
    padding: 28px 22px;
  }

  main > section {
    margin-bottom: 40px;
  }
}

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

  nav[aria-label="主导航"] > a {
    font-size: 1.15rem;
    padding-left: 30px;
  }

  nav[aria-label="主导航"] > a::before {
    width: 22px;
    height: 22px;
  }

  nav[aria-label="主导航"] > a::after {
    left: 7px;
    width: 8px;
    height: 8px;
  }

  section[aria-labelledby="hero-title"] {
    padding: 36px 20px;
    border-radius: var(--radius);
  }

  main > section > h2 {
    padding-left: 16px;
    margin-bottom: 20px;
  }

  main > section > h2::before {
    width: 5px;
  }

  #brand,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal,
  #meta-info {
    padding: 24px 18px;
    border-radius: var(--radius);
  }

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

  #articles article:hover {
    transform: translateY(-3px);
  }

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

  #faq h3 + p {
    padding: 10px 16px 4px 42px;
  }

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

  footer {
    padding: 30px 16px;
  }
}

/* ============ 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,
  nav[aria-label="主导航"],
  nav[aria-label="面包屑导航"] {
    display: none;
  }

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

  #brand,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal,
  #meta-info {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}