:root {
  --brand: #1f6f5c;
  --brand-light: #2f9b7e;
  --brand-dark: #144a3d;
  --accent: #e8c07d;
  --accent-soft: #f2d9a8;
  --bg: #f7f4ee;
  --bg-alt: #efe9df;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --text: #23201b;
  --text-soft: #5a554c;
  --text-muted: #8a8377;
  --border: rgba(31, 111, 92, 0.14);
  --shadow-sm: 0 2px 8px rgba(31, 60, 50, 0.06);
  --shadow-md: 0 8px 28px rgba(31, 60, 50, 0.1);
  --shadow-lg: 0 18px 48px rgba(31, 60, 50, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10171a;
    --bg-alt: #0b1113;
    --surface: #182226;
    --surface-glass: rgba(24, 34, 38, 0.66);
    --text: #eef2ef;
    --text-soft: #b9c4bf;
    --text-muted: #7f8d88;
    --border: rgba(232, 192, 125, 0.16);
    --brand: #2f9b7e;
    --brand-light: #46b99a;
    --brand-dark: #1f6f5c;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 155, 126, 0.1), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 192, 125, 0.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  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 {
  color: var(--brand-light);
}

h1, h2, h3, h4 {
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  margin: 0 0 1rem;
}

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

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

h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  margin: 1.6rem 0 0.6rem;
  color: var(--brand-dark);
}

@media (prefers-color-scheme: dark) {
  h3 { color: var(--brand-light); }
}

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

ul, ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.4rem;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px clamp(16px, 4vw, 48px) 10px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

header nav[aria-label="主导航"] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
  justify-content: center;
  max-width: var(--maxw);
  margin: 0 auto;
}

header nav[aria-label="主导航"] a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

header 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-light), var(--accent));
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

header nav[aria-label="主导航"] a:hover,
header nav[aria-label="主导航"] a:focus-visible {
  color: var(--brand);
  background: rgba(31, 111, 92, 0.08);
  transform: translateY(-1px);
  outline: none;
}

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

/* ---------- Breadcrumb ---------- */
header nav[aria-label="面包屑"] {
  max-width: var(--maxw);
  margin: 10px auto 0;
}

header nav[aria-label="面包屑"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

header nav[aria-label="面包屑"] li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

header nav[aria-label="面包屑"] li + li::before {
  content: "/";
  color: var(--text-muted);
  opacity: 0.6;
}

header nav[aria-label="面包屑"] a {
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

header nav[aria-label="面包屑"] a:hover {
  color: var(--brand);
  background: rgba(31, 111, 92, 0.08);
}

header nav[aria-label="面包屑"] [aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

/* ---------- Main layout ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 32px) 64px;
}

main > section {
  position: relative;
  margin-bottom: clamp(28px, 4vw, 52px);
  padding: clamp(22px, 3.4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rise 0.7s var(--ease) both;
}

main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 40%);
  opacity: 0.5;
}

@media (prefers-color-scheme: dark) {
  main > section::after {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 40%);
  }
}

main > section:nth-child(1) { animation-delay: 0.02s; }
main > section:nth-child(2) { animation-delay: 0.06s; }
main > section:nth-child(3) { animation-delay: 0.1s; }
main > section:nth-child(4) { animation-delay: 0.14s; }
main > section:nth-child(5) { animation-delay: 0.18s; }
main > section:nth-child(6) { animation-delay: 0.22s; }
main > section:nth-child(7) { animation-delay: 0.26s; }
main > section:nth-child(8) { animation-delay: 0.3s; }

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

@media (prefers-reduced-motion: reduce) {
  main > section {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Hero / Banner ---------- */
#home {
  background:
    linear-gradient(135deg, rgba(31, 111, 92, 0.96) 0%, rgba(47, 155, 126, 0.9) 48%, rgba(232, 192, 125, 0.85) 100%);
  border: none;
  color: #fdfbf6;
  padding: clamp(28px, 5vw, 64px);
  box-shadow: var(--shadow-lg);
}

#home::after {
  background:
    radial-gradient(600px 300px at 85% 15%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(500px 260px at 10% 90%, rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 1;
}

#home h1 {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  max-width: 22ch;
}

#home p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 68ch;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}

#home > div {
  position: relative;
  z-index: 1;
  margin: 1.8rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

#home > div:hover {
  transform: translateY(-6px) scale(1.005);
  box-shadow: 0 32px 76px rgba(0, 0, 0, 0.3);
}

#home > div svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Articles ---------- */
#articles article {
  position: relative;
  margin: 0 0 18px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--brand-light), var(--accent));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  background: var(--surface);
  border-color: rgba(47, 155, 126, 0.32);
  box-shadow: var(--shadow-md);
}

#articles article:hover::before {
  opacity: 1;
}

#articles article h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

#articles article p {
  font-size: 0.94rem;
  margin-bottom: 0.6rem;
}

#articles article p:nth-of-type(1) {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 111, 92, 0.1);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

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

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

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

/* ---------- FAQ ---------- */
#faq h3 {
  position: relative;
  margin: 0;
  padding: 16px 44px 16px 20px;
  font-size: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq h3::after {
  content: "?";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(31, 111, 92, 0.28);
}

#faq h3 + p {
  margin: -2px 0 16px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.94rem;
}

#faq h3:hover {
  background: rgba(31, 111, 92, 0.1);
  border-color: rgba(47, 155, 126, 0.3);
  color: var(--brand);
}

/* ---------- HowTo steps ---------- */
#howto h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#howto h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-light), var(--accent));
  box-shadow: 0 0 0 4px rgba(47, 155, 126, 0.14);
}

#howto p {
  padding-left: 20px;
  border-left: 2px dashed var(--border);
  margin-left: 4px;
}

/* ---------- Cases ---------- */
#cases h3 {
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}

/* ---------- News ---------- */
#news h3 {
  position: relative;
  padding-left: 26px;
}

#news h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--brand-light), var(--accent));
}

/* ---------- Contact / Sitemap / Links ---------- */
#contact,
#sitemap,
#links {
  background:
    linear-gradient(180deg, var(--surface), var(--bg-alt));
}

#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 14px;
}

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

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

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  color: var(--brand);
  border-color: rgba(47, 155, 126, 0.4);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  padding: clamp(32px, 5vw, 64px) clamp(16px, 4vw, 32px) 28px;
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(47, 155, 126, 0.22), transparent 60%),
    linear-gradient(180deg, var(--brand-dark), #0d2a23);
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  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(circle at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}

footer > section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto 22px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

footer > section:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(232, 192, 125, 0.35);
  transform: translateY(-2px);
}

footer h2 {
  font-size: 1.05rem;
  color: var(--accent-soft);
  padding-left: 0;
  margin-bottom: 0.6rem;
}

footer h2::before {
  display: none;
}

footer p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

footer > p:last-child {
  position: relative;
  max-width: var(--maxw);
  margin: 18px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

/* ---------- Focus ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  header {
    padding: 12px 16px 8px;
  }

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

  header nav[aria-label="主导航"]::-webkit-scrollbar {
    height: 4px;
  }

  header nav[aria-label="主导航"]::-webkit-scrollbar-thumb {
    background: rgba(31, 111, 92, 0.3);
    border-radius: 4px;
  }

  main > section {
    border-radius: var(--radius-md);
  }

  #home {
    border-radius: var(--radius-md);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  main {
    padding: 18px 12px 40px;
  }

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

  #home {
    padding: 24px 18px;
  }

  #home h1 {
    max-width: none;
  }

  #articles article {
    padding: 16px;
  }

  #faq h3 {
    padding: 14px 40px 14px 16px;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

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

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

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

  footer {
    padding: 28px 12px 20px;
  }

  footer > section {
    padding: 16px;
    border-radius: var(--radius-sm);
  }
}

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

/* ---------- Print ---------- */
@media print {
  header,
  footer {
    position: static;
    background: none;
    color: #000;
    box-shadow: none;
  }

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

  a {
    color: #000;
    text-decoration: underline;
  }
}