:root {
  --bg: #f5f6fa;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(26, 26, 46, 0.08);
  --text: #1a1a2e;
  --text-soft: #4b4b63;
  --text-muted: #6f7085;
  --brand: #1a1a2e;
  --brand-2: #3a3a6a;
  --accent: #ff6b6b;
  --accent-2: #ffa94d;
  --accent-3: #4dabf7;
  --green: #38b98a;
  --gradient: linear-gradient(135deg, #1a1a2e 0%, #2d2d5a 45%, #4a3a7a 100%);
  --gradient-accent: linear-gradient(135deg, #ff6b6b 0%, #ffa94d 100%);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e1a;
    --bg-alt: #14142a;
    --surface: rgba(30, 30, 54, 0.66);
    --surface-solid: #1b1b34;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f2f3fa;
    --text-soft: #c8c9dc;
    --text-muted: #9a9bb4;
    --brand: #f2f3fa;
    --brand-2: #c8c9dc;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --gradient: linear-gradient(135deg, #14142a 0%, #23234a 45%, #3a2f66 100%);
  }
}

*,
*::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", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 107, 107, 0.08), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(77, 171, 247, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color 0.25s var(--ease);
  background-image: linear-gradient(var(--accent-3), var(--accent-3));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.25s var(--ease), background-size 0.3s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent);
  background-size: 100% 1px;
}

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

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  letter-spacing: -0.01em;
}

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

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

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--brand-2);
}

h4 {
  font-size: 1.02rem;
  color: var(--text-soft);
}

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

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

li {
  margin-bottom: 0.4em;
}

strong {
  color: var(--text);
}

/* ============ Header / Nav ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -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 {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

header nav > a {
  font-weight: 800;
  font-size: 1.18rem;
  color: var(--text);
  background: none;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  white-space: nowrap;
}

header nav > a::before {
  content: "🐼";
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  transition: transform 0.4s var(--ease);
}

header nav > a:hover::before {
  transform: rotate(-12deg) scale(1.15);
}

header nav > a:hover {
  color: var(--accent);
  background: none;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

header nav ul li {
  margin: 0;
}

header nav ul a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.92rem;
  color: var(--text-soft);
  border-radius: 999px;
  background: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
  white-space: nowrap;
}

header nav ul a:hover,
header nav ul a:focus-visible {
  color: var(--text);
  background: rgba(255, 107, 107, 0.12);
  transform: translateY(-1px);
  background-image: none;
}

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

/* ============ Hero / Banner ============ */
main > h1 {
  position: relative;
  margin: 32px 0 24px;
  padding: clamp(36px, 7vw, 72px) clamp(24px, 5vw, 56px);
  border-radius: var(--radius-xl);
  color: #fff;
  background: var(--gradient);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  animation: heroIn 0.9s var(--ease) both;
}

main > h1::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 85% 15%, rgba(255, 107, 107, 0.42), transparent 65%),
    radial-gradient(500px 260px at 15% 90%, rgba(77, 171, 247, 0.36), transparent 65%),
    radial-gradient(400px 200px at 50% 50%, rgba(255, 169, 77, 0.18), transparent 70%);
  animation: aurora 14s ease-in-out infinite alternate;
}

main > h1::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 340px;
  height: 340px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), transparent 60%);
  filter: blur(6px);
}

main > h1 + p {
  position: relative;
  margin: -8px 0 40px;
  padding: clamp(20px, 3.4vw, 32px) clamp(22px, 4vw, 40px);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  color: var(--text-soft);
  background: var(--surface);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes aurora {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translate3d(-3%, 2%, 0) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translate3d(2%, -2%, 0) scale(1.02);
    opacity: 0.95;
  }
}

/* ============ Sections ============ */
section {
  position: relative;
  margin: 0 0 32px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  scroll-margin-top: calc(var(--header-h) + 20px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: sectionReveal 0.7s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% entry 40%;
}

@supports not (animation-timeline: view()) {
  section {
    animation: none;
    opacity: 1;
  }
}

@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

section > h2 {
  margin-bottom: 1.2em;
}

section > h2 + p,
section > h2 + h3 {
  margin-top: 0;
}

/* ============ Cards inside sections ============ */
article {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 24px;
  background: var(--surface-solid);
  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);
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 107, 0.35);
}

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

article h3 {
  margin-bottom: 0.5em;
  transition: color 0.3s var(--ease);
}

article:hover h3 {
  color: var(--accent);
}

article p {
  margin-bottom: 0.7em;
}

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

/* article meta (发布时间) */
article p:first-of-type:not(:only-of-type) {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  margin: 1.4em 0 0.5em;
  padding: 14px 18px 14px 48px;
  font-size: 1.02rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
  cursor: default;
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-accent);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.35);
}

#faq h3:hover {
  transform: translateX(4px);
  border-color: rgba(255, 107, 107, 0.35);
}

#faq h3 + p {
  margin: 0 0 0.4em;
  padding: 4px 18px 12px 48px;
  font-size: 0.96rem;
}

/* ============ HowTo ============ */
#howto h4 {
  position: relative;
  margin: 1.3em 0 0.5em;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(77, 171, 247, 0.12), rgba(255, 107, 107, 0.1));
  border-left: 4px solid var(--accent-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

#howto h4:hover {
  transform: translateX(4px);
}

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

/* ============ Contact ============ */
#contact p {
  padding: 8px 14px;
  margin-bottom: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#contact p:hover {
  transform: translateX(4px);
  border-color: rgba(77, 171, 247, 0.4);
  box-shadow: var(--shadow-sm);
}

/* ============ Sitemap / Links ============ */
#sitemap ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 1.4em;
}

#sitemap ul li {
  margin: 0;
}

#sitemap ul a {
  display: block;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-image: none;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#sitemap ul a:hover,
#sitemap ul a:focus-visible {
  color: var(--accent);
  border-color: rgba(255, 107, 107, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background-image: none;
}

#sitemap h3 {
  margin-top: 1.6em;
}

/* ============ Legal ============ */
#legal {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.06), rgba(77, 171, 247, 0.06)), var(--surface);
}

#legal > p:last-child {
  margin-top: 1.6em;
  padding-top: 1.2em;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 24px;
  padding: clamp(32px, 5vw, 56px) 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  background: var(--gradient);
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 240px at 15% 0%, rgba(255, 107, 107, 0.24), transparent 65%),
    radial-gradient(520px 220px at 85% 100%, rgba(77, 171, 247, 0.22), transparent 65%);
  pointer-events: none;
}

footer p {
  position: relative;
  margin: 0 auto 10px;
  max-width: var(--maxw);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

footer p:first-child {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

footer p:last-child {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.62);
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.25s var(--ease), background-size 0.3s var(--ease);
}

footer a:hover,
footer a:focus-visible {
  color: #fff;
  background-size: 100% 1px;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 160, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 160, 0.6);
  background-clip: content-box;
}

::selection {
  background: rgba(255, 107, 107, 0.28);
  color: var(--text);
}

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

  header nav ul {
    margin-left: 0;
    width: 100%;
    gap: 2px;
    padding-bottom: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav ul::-webkit-scrollbar {
    display: none;
  }

  header nav ul a {
    padding: 6px 10px;
    font-size: 0.86rem;
  }

  main {
    padding: 0 16px 32px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --radius-lg: 20px;
    --radius-xl: 24px;
  }

  body {
    font-size: 15px;
    line-height: 1.75;
  }

  header nav > a {
    font-size: 1.05rem;
  }

  main > h1 {
    margin: 20px 0 18px;
    padding: 32px 22px;
    border-radius: var(--radius-lg);
  }

  main > h1 + p {
    margin-bottom: 28px;
    padding: 20px;
  }

  section {
    padding: 20px 18px;
    margin-bottom: 22px;
    border-radius: var(--radius-lg);
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  article {
    padding: 18px;
  }

  #faq h3 {
    padding: 12px 14px 12px 42px;
    font-size: 0.98rem;
  }

  #faq h3 + p {
    padding-left: 42px;
    padding-right: 8px;
  }

  #sitemap ul {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  footer {
    padding: 32px 16px;
  }
}

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

/* ============ Print ============ */
@media print {
  header,
  footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  section,
  article {
    box-shadow: none;
    border: 1px solid #ddd;
    background: #fff;
  }

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