:root {
  --primary: #c8102e;
  --primary-dark: #a00d24;
  --primary-light: #e8435c;
  --accent: #f5c518;
  --accent-soft: #ffdd55;
  --bg: #f7f5f2;
  --bg-alt: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #1c1a1f;
  --text-soft: #4a4650;
  --text-muted: #7a747f;
  --border: rgba(28, 26, 31, 0.1);
  --shadow-sm: 0 2px 8px rgba(28, 26, 31, 0.06);
  --shadow-md: 0 8px 28px rgba(28, 26, 31, 0.1);
  --shadow-lg: 0 18px 48px rgba(28, 26, 31, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --glass-blur: 14px;
  --header-h: 72px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121016;
    --bg-alt: #1a171f;
    --bg-elevated: rgba(30, 26, 36, 0.66);
    --text: #f2eef5;
    --text-soft: #c8c2d0;
    --text-muted: #958fa0;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(200, 16, 46, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(245, 197, 24, 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(1.7rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

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

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.4em;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter: drop-shadow(0 4px 10px rgba(200, 16, 46, 0.35));
  transition: transform 0.4s var(--ease);
}

.brand:hover .brand-logo {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

#main-nav {
  flex: 1 1 auto;
}

#main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  background: linear-gradient(120deg, rgba(200, 16, 46, 0.12), rgba(245, 197, 24, 0.16));
  color: var(--primary);
  transform: translateY(-2px);
}

#site-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 300px;
  min-width: 200px;
}

#site-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#site-search input[type="search"]::placeholder {
  color: var(--text-muted);
}

#site-search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.14);
}

#site-search button {
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.32);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

#site-search button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(200, 16, 46, 0.42);
  filter: brightness(1.06);
}

#site-search button:active {
  transform: translateY(0);
}

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

main > section {
  margin-top: 56px;
  animation: fadeUp 0.7s var(--ease) both;
}

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

section > h2 {
  position: relative;
  padding-left: 20px;
  margin-bottom: 1em;
}

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

/* ============ BANNER ============ */
#banner {
  margin-top: 32px !important;
  border-radius: var(--radius-xl);
  padding: clamp(32px, 6vw, 72px) clamp(24px, 5vw, 64px);
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #8f0a20 0%, var(--primary) 35%, #e8435c 62%, #f5a623 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 85% 15%, rgba(245, 197, 24, 0.45), transparent 70%),
    radial-gradient(500px 400px at 10% 90%, rgba(255, 255, 255, 0.18), transparent 70%);
  animation: bannerShift 12s ease-in-out infinite alternate;
}

#banner::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  z-index: -1;
}

@keyframes bannerShift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.12) translate(-2%, 2%); }
}

.banner-slide {
  max-width: 780px;
  position: relative;
}

#banner h1 {
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.25);
  margin-bottom: 0.5em;
}

#banner p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  margin: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}

/* ============ BREADCRUMB ============ */
#breadcrumb {
  margin-top: 24px;
  font-size: 0.88rem;
}

#breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
}

#breadcrumb li {
  margin: 0;
  color: var(--text-muted);
}

#breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--text-muted);
  opacity: 0.6;
}

#breadcrumb a {
  color: var(--text-soft);
  font-weight: 600;
}

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

/* ============ GENERIC CARD SECTIONS ============ */
#intro,
#products,
#services,
#scenarios,
#cases,
#news,
#articles,
#faq,
#howto,
#knowledge,
#contact,
#sitemap,
#links {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

#intro:hover,
#products:hover,
#services:hover,
#scenarios:hover,
#cases:hover,
#news:hover,
#articles:hover,
#faq:hover,
#howto:hover,
#knowledge:hover,
#contact:hover,
#sitemap:hover,
#links:hover {
  box-shadow: var(--shadow-md);
}

#intro h3,
#products h3,
#services h3,
#scenarios h3,
#cases h3,
#news h3,
#howto h3,
#contact h3 {
  margin-top: 1.6em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--primary), var(--accent), transparent) 1;
  display: inline-block;
}

#intro h3:first-of-type,
#products h3:first-of-type,
#services h3:first-of-type,
#scenarios h3:first-of-type,
#cases h3:first-of-type,
#news h3:first-of-type,
#howto h3:first-of-type,
#contact h3:first-of-type {
  margin-top: 0.8em;
}

/* ============ ARTICLES ============ */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#articles:hover {
  box-shadow: none;
}

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

#articles > h2 {
  padding-left: 20px;
}

#articles > p {
  margin-top: -0.4em;
}

#articles article {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

#articles article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(200, 16, 46, 0.28);
}

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

#articles article h3 {
  font-size: 1.08rem;
  margin-bottom: 0.5em;
  color: var(--text);
}

#articles article p:first-of-type {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 0.6em;
}

#articles article p:nth-of-type(2) {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin-bottom: 1em;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(200, 16, 46, 0.1), rgba(245, 197, 24, 0.14));
  color: var(--primary);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}

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

#articles article a:hover {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff;
  transform: translateX(2px);
}

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

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  margin-top: 1.2em;
  padding: 14px 18px 14px 46px;
  background: linear-gradient(120deg, rgba(200, 16, 46, 0.06), rgba(245, 197, 24, 0.08));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 1.02rem;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
}

#faq h3:hover {
  background: linear-gradient(120deg, rgba(200, 16, 46, 0.11), rgba(245, 197, 24, 0.14));
  transform: translateX(3px);
}

#faq p {
  padding-left: 46px;
  margin-bottom: 0.6em;
}

/* ============ HOWTO ============ */
#howto h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

#howto h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.12);
}

/* ============ CONTACT ============ */
#contact p {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border-left: 3px solid var(--primary);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

#contact p:hover {
  transform: translateX(4px);
  background: linear-gradient(120deg, rgba(200, 16, 46, 0.06), rgba(245, 197, 24, 0.08));
}

#contact p strong {
  color: var(--text);
}

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

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

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

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.3);
}

/* ============ FOOTER ============ */
#site-footer {
  margin-top: 40px;
  padding: clamp(32px, 5vw, 56px) 20px 40px;
  background: linear-gradient(160deg, #1c1015 0%, #2a0f16 55%, #1a0d12 100%);
  color: rgba(255, 255, 255, 0.82);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)) 1;
}

#site-footer > section {
  max-width: var(--maxw);
  margin: 0 auto 26px;
  padding: 22px 26px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}

#site-footer > section:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

#site-footer h2 {
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.5em;
  letter-spacing: 0.04em;
}

#site-footer p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin: 0;
}

#site-footer > p {
  max-width: var(--maxw);
  margin: 0 auto 8px;
  text-align: center;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.55);
  padding: 0 20px;
}

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(200, 16, 46, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(200, 16, 46, 0.55);
  filter: brightness(1.08);
}

#back-to-top:active {
  transform: translateY(0);
}

/* ============ SCROLL REVEAL ============ */
@supports (animation-timeline: view()) {
  main > section {
    animation: none;
  }

  main > section:not(#banner):not(#breadcrumb) {
    animation: revealOnScroll linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }

  @keyframes revealOnScroll {
    from {
      opacity: 0;
      transform: translateY(40px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .header-inner {
    gap: 12px;
  }

  #main-nav {
    order: 3;
    flex-basis: 100%;
  }

  #main-nav ul {
    justify-content: center;
  }

  #site-search {
    flex: 1 1 240px;
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .header-inner {
    padding: 10px 16px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

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

  #main-nav ul::-webkit-scrollbar {
    display: none;
  }

  #main-nav a {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 6px 11px;
  }

  #site-search {
    flex-basis: 100%;
    order: 4;
    min-width: 0;
  }

  main {
    padding: 0 14px 60px;
  }

  main > section {
    margin-top: 36px;
  }

  #banner {
    margin-top: 20px !important;
    border-radius: var(--radius-lg);
  }

  #banner::after {
    width: 180px;
    height: 180px;
    top: -40px;
    right: -40px;
  }

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

  #articles article {
    padding: 20px;
  }

  #faq h3 {
    padding: 12px 14px 12px 42px;
  }

  #faq p {
    padding-left: 14px;
  }

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

  #site-footer > section {
    padding: 18px 20px;
  }

  #back-to-top {
    right: 14px;
    bottom: 14px;
    padding: 10px 15px;
    font-size: 0.8rem;
  }
}

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

  #banner {
    padding: 28px 20px;
  }

  #intro,
  #products,
  #services,
  #scenarios,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #knowledge,
  #contact,
  #sitemap,
  #links {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  section > h2 {
    padding-left: 16px;
  }

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

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

  #sitemap a,
  #links a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

/* ============ MOTION PREFERENCES ============ */
@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 {
  #site-header,
  #site-search,
  #back-to-top,
  #banner::before,
  #banner::after {
    display: none !important;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}