:root {
  --peach-50: #fdf2f4;
  --peach-100: #fbe3e8;
  --peach-200: #f7c5cf;
  --peach-300: #f28b9c;
  --peach-400: #e85d75;
  --peach-500: #d94460;
  --peach-600: #b8354e;
  --peach-700: #8a2c3c;
  --leaf-400: #4caf50;
  --leaf-500: #3d9142;
  --ink-900: #2a1d20;
  --ink-700: #4a3a3e;
  --ink-500: #6f5c61;
  --ink-300: #a08c91;
  --bg: #fffafb;
  --bg-soft: #fdf2f4;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.65);
  --border: rgba(232, 93, 117, 0.16);
  --shadow-sm: 0 2px 8px rgba(138, 44, 60, 0.06);
  --shadow-md: 0 8px 24px rgba(138, 44, 60, 0.1);
  --shadow-lg: 0 18px 48px rgba(138, 44, 60, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --container: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --peach-50: #2a1a1f;
  --peach-100: #3a222a;
  --peach-200: #4d2c36;
  --peach-300: #f28b9c;
  --peach-400: #f2748a;
  --peach-500: #e85d75;
  --peach-600: #f28b9c;
  --peach-700: #fbc5cf;
  --ink-900: #f6eef0;
  --ink-700: #e2d3d7;
  --ink-500: #b9a5aa;
  --ink-300: #8d787d;
  --bg: #171114;
  --bg-soft: #1f161a;
  --surface: #221820;
  --surface-glass: rgba(34, 24, 32, 0.62);
  --border: rgba(242, 139, 156, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px 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: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-700);
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--peach-100), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, var(--peach-50), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--peach-500);
}

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

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

h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--peach-400), var(--peach-300));
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin-top: 1.4em;
}

p {
  margin: 0 0 1em;
}

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

li {
  margin-bottom: 0.4em;
}

.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(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

#site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--ink-900);
}

.brand-logo svg {
  transition: transform 0.5s var(--ease);
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--peach-500), var(--peach-300));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#main-nav {
  flex: 1;
}

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

#main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-700);
  font-weight: 500;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a:hover {
  background: var(--peach-100);
  color: var(--peach-600);
  transform: translateY(-1px);
}

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

#site-search {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

#site-search:focus-within {
  border-color: var(--peach-300);
  box-shadow: 0 0 0 4px rgba(232, 93, 117, 0.12);
}

#search-input {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--ink-900);
  width: 150px;
  font-family: inherit;
}

#search-input::placeholder {
  color: var(--ink-300);
}

#search-input:focus {
  outline: none;
}

#site-search button {
  border: 0;
  background: linear-gradient(135deg, var(--peach-400), var(--peach-500));
  color: #fff;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.25s var(--ease);
}

#site-search button:hover {
  filter: brightness(1.08);
}

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-700);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--peach-100);
  color: var(--peach-600);
  transform: translateY(-1px);
}

#menu-toggle {
  display: none;
}

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

main > nav[aria-label="面包屑导航"] {
  margin-bottom: 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ink-500);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--ink-300);
}

.breadcrumb a {
  color: var(--ink-500);
}

.breadcrumb a:hover {
  color: var(--peach-500);
}

/* ===== Sections ===== */
main > section {
  margin-bottom: 56px;
  padding: 32px clamp(20px, 4vw, 44px);
  background: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  opacity: 0;
  transform: translateY(28px);
}

main > section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(232, 93, 117, 0.28);
}

/* ===== Hero ===== */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 48px);
  background:
    linear-gradient(135deg, rgba(232, 93, 117, 0.14), rgba(242, 139, 156, 0.06) 45%, rgba(76, 175, 80, 0.08)),
    var(--surface-glass);
  border-radius: var(--radius-xl);
}

#hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 93, 117, 0.35), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.22), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

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

.hero-lead {
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  color: var(--ink-700);
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 8px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--peach-400), var(--peach-500));
  box-shadow: 0 10px 24px rgba(232, 93, 117, 0.32);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(232, 93, 117, 0.42);
}

.btn-secondary {
  color: var(--peach-600);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--peach-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-figure {
  margin: 32px 0 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.hero-figure svg {
  width: 100%;
  display: block;
}

.hero-figure figcaption {
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--ink-500);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ===== Articles ===== */
#articles > article {
  padding: 22px 24px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles > article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(232, 93, 117, 0.32);
}

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

#articles article h3 a {
  color: var(--ink-900);
}

#articles article h3 a:hover {
  color: var(--peach-500);
}

.meta {
  font-size: 0.82rem;
  color: var(--ink-300);
  margin-bottom: 0.7em;
  letter-spacing: 0.02em;
}

#articles article > a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--peach-600);
  padding: 4px 0;
  position: relative;
}

#articles article > a::after {
  content: "→";
  margin-left: 6px;
  transition: transform 0.25s var(--ease);
  display: inline-block;
}

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

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 54px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach-400), var(--peach-500));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== FAQ ===== */
#faq h3 {
  padding: 12px 18px;
  margin: 16px 0 0;
  background: var(--peach-50);
  border-left: 4px solid var(--peach-400);
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

#faq h3:hover {
  background: var(--peach-100);
  transform: translateX(3px);
}

#faq h3 + p {
  padding: 10px 18px 4px;
  color: var(--ink-700);
}

/* ===== Contact ===== */
.contact-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.contact-list li {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.contact-list li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(232, 93, 117, 0.3);
}

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--ink-700);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: var(--peach-400);
  border-color: var(--peach-400);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== Footer ===== */
footer {
  background: linear-gradient(180deg, transparent, var(--peach-50));
  border-top: 1px solid var(--border);
  padding: 40px 20px 48px;
  margin-top: 24px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
  color: var(--ink-500);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0 0 8px;
}

.footer-inner nav ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.footer-inner nav a {
  color: var(--ink-500);
  font-size: 0.88rem;
  transition: color 0.25s var(--ease);
}

.footer-inner nav a:hover {
  color: var(--peach-500);
}

/* ===== Back to top ===== */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--peach-600);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s, background 0.3s var(--ease), color 0.3s var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--peach-400);
  color: #fff;
  transform: translateY(-3px);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  main > section {
    opacity: 1;
    transform: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  #main-nav a {
    padding: 8px 9px;
    font-size: 0.86rem;
  }
  #search-input {
    width: 120px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 64px;
  }

  #menu-toggle {
    display: inline-block;
  }

  #main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }

  #main-nav.is-open {
    max-height: 480px;
  }

  #main-nav ul {
    flex-direction: column;
    padding: 12px 20px 20px;
    gap: 2px;
  }

  #main-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  #site-search {
    display: none;
  }

  .header-inner {
    position: relative;
    gap: 12px;
  }

  .header-tools {
    margin-left: auto;
  }

  main > section {
    padding: 26px 20px;
    margin-bottom: 40px;
    border-radius: var(--radius-md);
  }

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

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

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

  .header-inner {
    padding: 0 14px;
  }

  main {
    padding: 16px 14px 48px;
  }

  main > section {
    padding: 22px 16px;
    margin-bottom: 32px;
  }

  #hero {
    padding: 26px 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  #articles > article {
    padding: 18px 16px;
  }

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

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

  h2::after {
    width: 44px;
    height: 3px;
  }
}