:root {
  --bg: #0e1620;
  --bg-soft: #131e2b;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8eef5;
  --text-soft: #a9b8c9;
  --text-mute: #7d8ea1;
  --accent: #f0b96b;
  --accent-2: #7fb7c9;
  --accent-3: #c98f6b;
  --gradient: linear-gradient(135deg, #1b2a3a 0%, #2a3f52 45%, #4a3a2e 100%);
  --gradient-soft: linear-gradient(135deg, rgba(240, 185, 107, 0.18), rgba(127, 183, 201, 0.14));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.25);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --blur: saturate(140%) blur(14px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f1ea;
    --bg-soft: #ece7dd;
    --surface: rgba(255, 255, 255, 0.62);
    --surface-strong: rgba(255, 255, 255, 0.82);
    --border: rgba(27, 42, 58, 0.12);
    --text: #1b2a3a;
    --text-soft: #44586c;
    --text-mute: #6b7d90;
    --accent: #b97a2a;
    --accent-2: #3d7d90;
    --accent-3: #9a5f3c;
    --gradient: linear-gradient(135deg, #e9e0d1 0%, #d9e5e9 50%, #f1e4d2 100%);
    --gradient-soft: linear-gradient(135deg, rgba(185, 122, 42, 0.14), rgba(61, 125, 144, 0.12));
    --shadow: 0 18px 50px rgba(27, 42, 58, 0.14);
    --shadow-soft: 0 8px 26px rgba(27, 42, 58, 0.1);
  }
}

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

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

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(240, 185, 107, 0.14), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(127, 183, 201, 0.14), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(201, 143, 107, 0.1), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1 {
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.9rem);
  background: linear-gradient(120deg, var(--text) 20%, var(--accent) 60%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem);
  position: relative;
  padding-left: 18px;
}

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

h3 {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  color: var(--text);
}

h4 {
  font-size: 1.02rem;
  color: var(--accent-2);
}

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

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

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

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

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

li {
  margin-bottom: 0.35em;
}

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

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

blockquote {
  margin: 0 0 1.2em;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

blockquote:hover {
  transform: translateY(-4px);
  border-left-color: var(--accent-2);
  box-shadow: var(--shadow);
}

blockquote p {
  margin: 0;
  color: var(--text);
  font-style: normal;
}

/* ===== Header ===== */

header[role="banner"] {
  position: relative;
  padding: 0 0 8px;
  background: var(--gradient);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

header[role="banner"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(240, 185, 107, 0.28), transparent 38%),
    radial-gradient(circle at 82% 18%, rgba(127, 183, 201, 0.26), transparent 40%),
    radial-gradient(circle at 50% 120%, rgba(201, 143, 107, 0.22), transparent 55%);
  pointer-events: none;
}

header[role="banner"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.7;
}

.brand-bar {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 40px) clamp(18px, 3vw, 30px);
  text-align: center;
}

.brand-name {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.9s var(--ease) both;
}

.brand-slogan {
  margin: 0;
  font-size: clamp(0.92rem, 0.85rem + 0.4vw, 1.1rem);
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.18em;
  animation: fadeUp 0.9s 0.12s var(--ease) both;
}

/* ===== Navigation ===== */

nav[aria-label="主导航"] {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 28px) 20px;
}

nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 10px;
  list-style: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

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

nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 7px 15px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.28s var(--ease), color 0.28s var(--ease), transform 0.28s var(--ease), border-color 0.28s var(--ease);
}

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: #1b2a3a;
  background: linear-gradient(135deg, #f6d39a, #bfe3ec);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* ===== Main layout ===== */

main[role="main"] {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 46px) clamp(16px, 4vw, 40px) 40px;
}

main > section {
  position: relative;
  margin-bottom: clamp(22px, 3.5vw, 38px);
  padding: clamp(20px, 3.4vw, 38px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: fadeUp 0.8s var(--ease) both;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

main > section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
  opacity: 0.85;
}

main > section:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 185, 107, 0.34);
  box-shadow: var(--shadow);
}

main > section:nth-child(2) { animation-delay: 0.04s; }
main > section:nth-child(3) { animation-delay: 0.08s; }
main > section:nth-child(4) { animation-delay: 0.12s; }
main > section:nth-child(5) { animation-delay: 0.16s; }
main > section:nth-child(6) { animation-delay: 0.2s; }

/* ===== Intro ===== */

#intro {
  background:
    linear-gradient(135deg, rgba(240, 185, 107, 0.12), rgba(127, 183, 201, 0.1)),
    var(--surface);
}

#intro h1 {
  margin-bottom: 0.6em;
}

#intro > p:first-of-type {
  font-size: 1.02rem;
  color: var(--text);
}

/* ===== Breadcrumb ===== */

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 18px 0 0;
  padding: 10px 16px;
  list-style: none;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

nav[aria-label="面包屑导航"] li {
  margin: 0;
  color: var(--text-mute);
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-mute);
  opacity: 0.6;
}

/* ===== Section inner structure ===== */

section > h3 {
  margin-top: 1.4em;
}

section > h3:first-of-type {
  margin-top: 1em;
}

section > h4 {
  margin-top: 1.1em;
  padding-left: 12px;
  border-left: 3px solid var(--accent-2);
}

/* ===== Articles ===== */

article {
  position: relative;
  margin: 0 0 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

article:last-child {
  margin-bottom: 0;
}

article:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 185, 107, 0.4);
  box-shadow: var(--shadow);
}

article h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

article h3::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width 0.35s var(--ease);
}

article:hover h3::after {
  width: 70px;
}

article p {
  margin: 0 0 0.6em;
  font-size: 0.94rem;
}

article p:last-child {
  margin-bottom: 0;
}

article a[href="#articles"] {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 16px;
  font-size: 0.85rem;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid rgba(240, 185, 107, 0.4);
  background: rgba(240, 185, 107, 0.08);
  transition: background 0.28s var(--ease), color 0.28s var(--ease), transform 0.28s var(--ease);
}

article a[href="#articles"]:hover {
  background: var(--accent);
  color: #1b2a3a;
  transform: translateX(3px);
}

/* ===== FAQ ===== */

#faq h3 {
  position: relative;
  margin: 22px 0 8px;
  padding: 14px 18px 14px 44px;
  font-size: 1.02rem;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  cursor: default;
  transition: background 0.3s var(--ease), border-color 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.72rem;
  font-weight: 800;
  color: #1b2a3a;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

#faq h3:hover {
  transform: translateX(4px);
  border-color: rgba(240, 185, 107, 0.4);
  background: var(--surface);
}

#faq h3 + p {
  margin: 0 0 6px;
  padding: 0 4px 0 18px;
  font-size: 0.94rem;
  border-left: 2px solid var(--border);
}

/* ===== HowTo ===== */

#howto h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-left: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#howto h4::before {
  content: "◆";
  font-size: 0.7rem;
  color: var(--accent);
}

/* ===== Contact ===== */

#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

#contact li {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

#contact li:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 183, 201, 0.45);
}

/* ===== 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: 7px 16px;
  font-size: 0.88rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: color 0.28s var(--ease), background 0.28s var(--ease), transform 0.28s var(--ease), border-color 0.28s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #1b2a3a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  transform: translateY(-2px);
}

/* ===== Legal ===== */

#legal h3 {
  margin-top: 1.2em;
  color: var(--text);
}

#legal h3:first-of-type {
  margin-top: 0.4em;
}

/* ===== Footer ===== */

footer[role="contentinfo"] {
  position: relative;
  margin-top: 10px;
  padding: clamp(28px, 4vw, 44px) clamp(18px, 4vw, 40px);
  text-align: center;
  background: var(--gradient);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

footer[role="contentinfo"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(240, 185, 107, 0.22), transparent 42%),
    radial-gradient(circle at 80% 100%, rgba(127, 183, 201, 0.2), transparent 45%);
  pointer-events: none;
}

footer[role="contentinfo"] p {
  position: relative;
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.04em;
}

footer[role="contentinfo"] p:first-child {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}

footer[role="contentinfo"] p:last-child {
  margin-bottom: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== Animations ===== */

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

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  nav[aria-label="主导航"] ul {
    border-radius: var(--radius);
    gap: 6px;
    padding: 8px;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.8;
    background-attachment: scroll;
  }

  main > section {
    border-radius: var(--radius);
    padding: 18px 16px;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  .brand-slogan {
    letter-spacing: 0.08em;
  }

  nav[aria-label="主导航"] ul {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

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

  #contact ul {
    grid-template-columns: 1fr;
  }

  article {
    padding: 16px 16px;
  }

  blockquote {
    padding: 14px 16px;
  }

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

@media (max-width: 380px) {
  nav[aria-label="主导航"] a {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  main > section {
    padding: 16px 13px;
  }
}

/* ===== Accessibility & motion ===== */

@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;
  }
}

::selection {
  background: rgba(240, 185, 107, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===== Scrollbar ===== */

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(240, 185, 107, 0.55), rgba(127, 183, 201, 0.55));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  background-clip: padding-box;
}