:root {
  --c-bg: #f4f6fb;
  --c-bg-soft: #ffffff;
  --c-surface: rgba(255, 255, 255, 0.72);
  --c-surface-solid: #ffffff;
  --c-border: rgba(26, 26, 46, 0.08);
  --c-text: #1f2333;
  --c-text-soft: #565c73;
  --c-text-mute: #8a90a6;
  --c-primary: #6c5ce7;
  --c-primary-deep: #4b3fd4;
  --c-accent: #ff6b9d;
  --c-accent-2: #22d3ee;
  --c-gold: #f6b93b;
  --grad-banner: linear-gradient(135deg, #5b4bd6 0%, #7d5cf0 38%, #b06ae8 68%, #ff6b9d 100%);
  --grad-accent: linear-gradient(135deg, #6c5ce7 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(160deg, rgba(108, 92, 231, 0.08), rgba(34, 211, 238, 0.06));
  --shadow-sm: 0 2px 8px rgba(31, 35, 51, 0.06);
  --shadow-md: 0 10px 30px rgba(31, 35, 51, 0.10);
  --shadow-lg: 0 22px 60px rgba(31, 35, 51, 0.16);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --blur: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
  --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 {
    --c-bg: #0f1220;
    --c-bg-soft: #161a2e;
    --c-surface: rgba(30, 35, 58, 0.62);
    --c-surface-solid: #1a1f36;
    --c-border: rgba(255, 255, 255, 0.08);
    --c-text: #eceef7;
    --c-text-soft: #b3b9d0;
    --c-text-mute: #7e86a3;
    --c-primary: #8b7cff;
    --c-primary-deep: #6c5ce7;
    --c-accent: #ff7fae;
    --c-accent-2: #3ee0f5;
    --grad-banner: linear-gradient(135deg, #2a2160 0%, #4a2f8f 40%, #7a3fa8 70%, #b23a72 100%);
    --grad-soft: linear-gradient(160deg, rgba(139, 124, 255, 0.14), rgba(62, 224, 245, 0.08));
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--c-text);
  background: var(--c-bg);
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(108, 92, 231, 0.16), transparent 60%),
    radial-gradient(800px 520px at 96% 4%, rgba(34, 211, 238, 0.14), transparent 62%),
    radial-gradient(700px 600px at 50% 110%, rgba(255, 107, 157, 0.10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(108, 92, 231, 0.28); color: var(--c-text); }

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

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}
a:hover, a:focus-visible { color: var(--c-accent); }
a:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--c-text);
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
  font-weight: 750;
}
h1 { font-size: clamp(1.75rem, 4.2vw, 2.75rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
h4 { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--c-text-soft); }

p { margin: 0 0 1em; color: var(--c-text-soft); }
strong { color: var(--c-text); font-weight: 750; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.35em; color: var(--c-text-soft); }
li::marker { color: var(--c-primary); }

/* ============ 头部 ============ */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px clamp(14px, 4vw, 40px) 10px;
  background: var(--c-surface);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.brand-bar {
  max-width: var(--maxw);
  margin: 0 auto 10px;
  font-size: 0.88rem;
  color: var(--c-text-mute);
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
}
.brand-bar strong {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--grad-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

header nav {
  max-width: var(--maxw);
  margin: 0 auto;
}
header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
header nav li { margin: 0; }
header nav a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-soft);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
  white-space: nowrap;
}
header nav a:hover,
header nav a:focus-visible {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.32);
}

/* ============ 主体容器 ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(14px, 4vw, 40px) 40px;
}

/* 面包屑 */
main > nav[aria-label="面包屑"] {
  margin-bottom: clamp(16px, 3vw, 26px);
}
main > nav[aria-label="面包屑"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0;
  font-size: 0.85rem;
  background: var(--c-surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}
main > nav[aria-label="面包屑"] li {
  margin: 0;
  color: var(--c-text-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
main > nav[aria-label="面包屑"] li + li::before {
  content: "›";
  color: var(--c-text-mute);
  font-weight: 700;
}
main > nav[aria-label="面包屑"] a { font-weight: 600; }

/* ============ 通用 Section ============ */
section {
  position: relative;
  margin-bottom: clamp(20px, 3.4vw, 34px);
  padding: clamp(22px, 3.6vw, 40px);
  background: var(--c-surface);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: riseIn 0.75s var(--ease) both;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(108, 92, 231, 0.22);
}
section > h2 {
  position: relative;
  padding-bottom: 0.55em;
  margin-bottom: 1em;
}
section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: var(--grad-accent);
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
}
section > h3 { margin-top: 1.4em; }

/* ============ Hero 渐变 Banner ============ */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5.5vw, 64px) clamp(22px, 4.5vw, 56px);
  background: var(--grad-banner);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px rgba(91, 75, 214, 0.35);
  color: #fff;
}
#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.30), transparent 62%);
  border-radius: 50%;
  animation: floaty 12s ease-in-out infinite;
  pointer-events: none;
}
#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -15%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 65%);
  border-radius: 50%;
  animation: floaty 15s ease-in-out infinite reverse;
  pointer-events: none;
}
#hero h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  max-width: 22ch;
}
#hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  max-width: 72ch;
  margin-bottom: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

/* ============ 文章卡片 ============ */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
}
#articles > h2 { grid-column: 1 / -1; }
#articles article {
  position: relative;
  padding: 20px 22px 18px;
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: riseIn 0.7s var(--ease) both;
}
#articles article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.28);
}
#articles article:hover::before { opacity: 1; }
#articles article h3 { font-size: 1.06rem; margin-bottom: 0.5em; }
#articles article p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--c-text-soft);
}
#articles article p:first-of-type {
  font-size: 0.78rem;
  color: var(--c-text-mute);
  letter-spacing: 0.02em;
  margin-bottom: 0.75em;
  padding-bottom: 0.6em;
  border-bottom: 1px dashed var(--c-border);
}
#articles article p:last-of-type { margin-bottom: 0; }
#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--c-primary);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(108, 92, 231, 0.09);
  transition: all 0.3s var(--ease);
}
#articles article a::after { content: "→"; transition: transform 0.3s var(--ease); }
#articles article a:hover {
  color: #fff;
  background: var(--grad-accent);
  box-shadow: 0 8px 18px rgba(108, 92, 231, 0.3);
}
#articles article a:hover::after { transform: translateX(4px); }

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  padding: 14px 18px 14px 44px;
  margin: 0 0 8px;
  font-size: 1rem;
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all 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.75rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: var(--grad-accent);
}
#faq h3:hover {
  border-color: rgba(108, 92, 231, 0.3);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}
#faq h3 + p {
  margin: 0 0 16px;
  padding: 0 18px 0 44px;
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ============ HowTo ============ */
#howto { counter-reset: howto; }
#howto h4 {
  position: relative;
  padding-left: 42px;
  margin-top: 1.3em;
  color: var(--c-text);
  counter-increment: howto;
}
#howto h4::before {
  content: counter(howto);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  border-radius: 9px;
  background: var(--grad-banner);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.32);
}
#howto h4 + p { padding-left: 42px; }

/* ============ 联系信息 ============ */
#contact h3 + p {
  padding: 18px 20px;
  background: var(--grad-soft);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius-sm);
  line-height: 2;
  font-size: 0.94rem;
}

/* ============ 网站地图 / 友情链接 ============ */
#sitemap ul, #links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#sitemap li, #links li { margin: 0; }
#sitemap a, #links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-text-soft);
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}
#sitemap a:hover, #links a:hover {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(108, 92, 231, 0.32);
}

/* ============ 页脚 ============ */
footer[role="contentinfo"] {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto 40px;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 40px);
  background: var(--c-surface);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(18px, 3vw, 32px);
}
footer section { margin: 0; padding: 0; background: none; border: none; box-shadow: none; animation: none; }
footer section:hover { box-shadow: none; border-color: transparent; }
footer h2 {
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding-bottom: 0.5em;
  margin-bottom: 0.75em;
  border-bottom: 2px solid transparent;
  border-image: var(--grad-accent) 1;
  display: inline-block;
}
footer p {
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--c-text-mute);
  margin-bottom: 0.7em;
}
#meta { grid-column: 1 / -1; padding-top: 18px; border-top: 1px dashed var(--c-border); }
#meta p { margin-bottom: 0.4em; }
#meta p:last-child {
  font-weight: 700;
  color: var(--c-text-soft);
  letter-spacing: 0.03em;
}

/* ============ 动画 ============ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-24px, 28px, 0) scale(1.08); }
}

/* 滚动触发动画 */
@supports (animation-timeline: view()) {
  section {
    animation: riseIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  #articles article {
    animation: riseIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 65%;
  }
}

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

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  header nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  header nav ul::-webkit-scrollbar { display: none; }
  header nav a { padding: 6px 12px; font-size: 0.85rem; }
  #articles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 15px; line-height: 1.8; }
  header[role="banner"] { padding: 10px 14px 8px; }
  .brand-bar { font-size: 0.78rem; margin-bottom: 8px; }
  .brand-bar strong { font-size: 1rem; }
  main { padding: 16px 12px 28px; }
  section {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  #hero {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }
  #hero h1 { max-width: 100%; }
  #articles { grid-template-columns: 1fr; }
  #faq h3 { padding: 12px 14px 12px 40px; font-size: 0.95rem; }
  #faq h3 + p { padding: 0 14px 0 40px; font-size: 0.88rem; }
  #howto h4 { padding-left: 36px; }
  #howto h4 + p { padding-left: 36px; }
  #howto h4::before { width: 24px; height: 24px; font-size: 0.75rem; border-radius: 8px; }
  footer[role="contentinfo"] {
    margin: 0 12px 28px;
    padding: 22px 18px;
    border-radius: var(--radius-lg);
    grid-template-columns: 1fr;
  }
  #sitemap a, #links a { padding: 7px 14px; font-size: 0.82rem; }
  main > nav[aria-label="面包屑"] ol { font-size: 0.78rem; padding: 8px 12px; }
}

@media (max-width: 380px) {
  header nav a { padding: 5px 10px; font-size: 0.8rem; }
  section { padding: 16px 13px; }
}

@media print {
  header, footer, main > nav { display: none; }
  body { background: #fff; color: #000; }
  section { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
}