:root {
  --ink: #2a2118;
  --ink-soft: #5a4a38;
  --paper: #f7f1e6;
  --paper-2: #efe4d2;
  --card: #fffaf1;
  --brand: #8b4513;
  --brand-2: #b5651d;
  --brand-3: #d4a373;
  --accent: #c0392b;
  --line: rgba(139, 69, 19, 0.16);
  --shadow: 0 10px 30px rgba(74, 44, 16, 0.12);
  --shadow-lg: 0 24px 60px rgba(74, 44, 16, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --glass: rgba(255, 250, 241, 0.6);
  --glass-border: rgba(255, 255, 255, 0.5);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2e8da;
    --ink-soft: #c9b89f;
    --paper: #17120c;
    --paper-2: #1f1810;
    --card: #241b11;
    --brand: #d4a373;
    --brand-2: #e0b183;
    --brand-3: #8b4513;
    --accent: #e07a5f;
    --line: rgba(212, 163, 115, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --glass: rgba(36, 27, 17, 0.55);
    --glass-border: rgba(212, 163, 115, 0.22);
  }
}

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

html {
  scroll-behavior: smooth;
  -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.8;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(212, 163, 115, 0.18), transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(139, 69, 19, 0.12), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(181, 101, 29, 0.1), transparent 55%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

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

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

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

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

ul,
ol {
  padding-left: 1.4em;
}

h1,
h2,
h3 {
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
  color: var(--ink);
  font-weight: 700;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink);
}

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

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(74, 44, 16, 0.08);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

header > div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

header > div > a {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.22), rgba(139, 69, 19, 0.08));
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

header > div > a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

nav[aria-label="主导航"] {
  flex: 1 1 auto;
}

nav[aria-label="主导航"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

nav[aria-label="主导航"] li {
  margin: 0;
}

nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

nav[aria-label="主导航"] a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: var(--brand);
  background: rgba(212, 163, 115, 0.16);
  transform: translateY(-1px);
}

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

/* ============ Main / layout ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 60px;
}

section {
  margin: 34px 0;
  padding: clamp(20px, 3.5vw, 38px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s var(--ease);
  animation: rise 0.7s var(--ease) both;
}

section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 163, 115, 0.14), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(139, 69, 19, 0.08), transparent 42%);
  pointer-events: none;
}

section:hover {
  box-shadow: var(--shadow-lg);
}

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

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

/* stagger reveal */
section:nth-of-type(2) { animation-delay: 0.05s; }
section:nth-of-type(3) { animation-delay: 0.1s; }
section:nth-of-type(4) { animation-delay: 0.15s; }
section:nth-of-type(5) { animation-delay: 0.2s; }

/* ============ Breadcrumb ============ */
nav[aria-label="面包屑导航"] {
  margin: 22px 0 0;
  font-size: 0.88rem;
}

nav[aria-label="面包屑导航"] ol {
  list-style: none;
  margin: 0;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  width: fit-content;
}

nav[aria-label="面包屑导航"] li {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
}

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

nav[aria-label="面包屑导航"] a {
  color: var(--ink-soft);
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

nav[aria-label="面包屑导航"] a:hover {
  color: var(--brand);
  background: rgba(212, 163, 115, 0.16);
}

/* ============ Hero ============ */
#hero {
  margin-top: 26px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(139, 69, 19, 0.94) 0%, rgba(181, 101, 29, 0.9) 45%, rgba(212, 163, 115, 0.88) 100%);
  color: #fff8ee;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 62%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -10%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 220, 0.22), transparent 60%);
  pointer-events: none;
}

#hero h1 {
  color: #fffaf2;
  text-shadow: 0 2px 18px rgba(60, 30, 8, 0.35);
  max-width: 22em;
}

#hero p {
  color: rgba(255, 250, 242, 0.92);
  max-width: 62em;
  font-size: clamp(0.95rem, 1.4vw, 1.06rem);
}

#hero img {
  margin-top: 22px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 44px rgba(50, 24, 6, 0.35);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

#hero img:hover {
  transform: scale(1.015);
  box-shadow: 0 26px 60px rgba(50, 24, 6, 0.45);
}

/* ============ Cards inside sections (products, solutions, cases) ============ */
#products h3,
#solutions h3,
#cases h3 {
  margin-top: 1.4em;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.16), rgba(139, 69, 19, 0.06));
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

#products h3:hover,
#solutions h3:hover,
#cases h3:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.26), rgba(139, 69, 19, 0.1));
}

/* ============ News ============ */
#news ul {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
  display: grid;
  gap: 12px;
}

#news li {
  padding: 14px 18px 14px 46px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#news li::before {
  content: "◆";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-2);
  font-size: 0.8rem;
}

#news li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-3);
}

/* ============ Articles ============ */
#articles {
  display: block;
}

#articles article {
  margin: 0 0 18px;
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-3);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-left-color 0.35s var(--ease), background 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--brand);
  background: var(--card);
}

#articles article h3 {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 1.12rem;
}

#articles article p {
  margin: 0 0 8px;
  font-size: 0.94rem;
}

#articles article p:first-of-type {
  font-size: 0.82rem;
  color: var(--brand-2);
  letter-spacing: 0.04em;
}

#articles article a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(212, 163, 115, 0.14);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), color 0.25s var(--ease);
}

#articles article a:hover {
  background: var(--brand);
  color: #fff8ee;
  transform: translateX(3px);
}

/* ============ FAQ ============ */
#faq dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

#faq dt {
  font-weight: 700;
  color: var(--brand);
  padding: 14px 18px 14px 44px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.2), rgba(139, 69, 19, 0.08));
  border: 1px solid var(--line);
  border-bottom: none;
  position: relative;
  cursor: default;
  transition: background 0.3s var(--ease);
}

#faq dt::before {
  content: "?";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  font-size: 0.75rem;
  color: #fff8ee;
  background: var(--brand-2);
}

#faq dd {
  margin: 0 0 6px;
  padding: 14px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  transition: background 0.3s var(--ease);
}

#faq dt:hover {
  background: linear-gradient(135deg, rgba(212, 163, 115, 0.3), rgba(139, 69, 19, 0.12));
}

#faq dt:hover + dd {
  background: var(--card);
}

/* ============ HowTo ============ */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1em 0;
  display: grid;
  gap: 12px;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 16px 18px 16px 62px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff8ee;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

#howto ol li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

#howto h3 {
  margin-top: 1.3em;
  color: var(--brand);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#howto h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(181, 101, 29, 0.18);
}

/* ============ Contact ============ */
#contact p {
  padding: 12px 16px 12px 44px;
  margin: 0 0 10px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#contact p::before {
  content: "◈";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-2);
  font-size: 0.85rem;
}

#contact p:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

#contact p:last-child {
  border-left: 4px solid var(--brand-2);
}

/* ============ Sitemap / Links / Legal ============ */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff8ee;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

#legal h3 {
  margin-top: 1.2em;
  font-size: 1rem;
  color: var(--brand);
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

#legal p {
  font-size: 0.93rem;
}

/* ============ Footer ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto 40px;
  padding: 26px 24px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

footer p {
  margin: 4px 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

footer p:first-child {
  font-weight: 700;
  color: var(--brand);
  font-size: 0.95rem;
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  header > div {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }

  header > div > a {
    align-self: flex-start;
  }

  nav[aria-label="主导航"] ul {
    justify-content: flex-start;
    gap: 2px;
  }

  nav[aria-label="主导航"] a {
    padding: 6px 11px;
    font-size: 0.86rem;
  }

  main {
    padding: 0 14px 44px;
  }

  section {
    margin: 22px 0;
    padding: 20px 16px;
    border-radius: var(--radius-sm);
  }

  #hero {
    padding: 26px 18px;
  }
}

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

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

  nav[aria-label="主导航"] a {
    white-space: nowrap;
  }

  nav[aria-label="面包屑导航"] ol {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  #articles article {
    padding: 16px;
  }

  #faq dt {
    padding: 12px 14px 12px 40px;
    font-size: 0.95rem;
  }

  #faq dd {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  #howto ol li {
    padding: 14px 14px 14px 56px;
  }

  #howto ol li::before {
    left: 12px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 0.85rem;
  }

  #contact p {
    padding: 10px 12px 10px 38px;
    font-size: 0.92rem;
  }

  footer {
    margin: 0 14px 30px;
    padding: 20px 16px;
  }
}

/* ============ Motion & accessibility ============ */
@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;
  }
}

@media (hover: none) {
  section:hover,
  #articles article:hover,
  #news li:hover,
  #products h3:hover,
  #solutions h3:hover,
  #cases h3:hover,
  #howto ol li:hover,
  #contact p:hover {
    transform: none;
  }
}

::selection {
  background: rgba(181, 101, 29, 0.28);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-2);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-radius: 10px;
  border: 2px solid var(--paper-2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}