:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #a78bfa;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --bg: #f7f5ff;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(124, 58, 237, 0.14);
  --text: #1e1b2e;
  --text-soft: #4b4763;
  --text-muted: #6b6880;
  --shadow-sm: 0 2px 8px rgba(76, 29, 149, 0.06);
  --shadow-md: 0 8px 28px rgba(76, 29, 149, 0.1);
  --shadow-lg: 0 18px 48px rgba(76, 29, 149, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --gradient-hero: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 32%, #06b6d4 100%);
  --gradient-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.12));
  --glass-blur: blur(16px);
  --maxw: 1180px;
  --transition: 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b18;
    --bg-alt: #14111f;
    --surface: rgba(30, 26, 48, 0.66);
    --surface-solid: #1a1628;
    --border: rgba(167, 139, 250, 0.18);
    --text: #ece9f7;
    --text-soft: #c4bfd8;
    --text-muted: #9d98b5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
    --gradient-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(6, 182, 212, 0.18));
  }
}

*,
*::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", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -8%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(6, 182, 212, 0.12), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  margin: 0 0 1rem;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

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

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin: 1.6rem 0 0.7rem;
  color: var(--primary-dark);
}

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

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

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

li {
  margin-bottom: 0.5rem;
}

li::marker {
  color: var(--primary);
}

blockquote {
  margin: 0 0 1.2rem;
  padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-sm);
}

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

/* ============ Header ============ */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand search"
    "nav nav";
  gap: 0.6rem 1.2rem;
  align-items: center;
  animation: slideDown 0.6s var(--transition) both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.brand-bar {
  grid-area: brand;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.brand-bar a {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: transform var(--transition), filter var(--transition);
}

.brand-bar a:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.slogan {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

header nav[role="navigation"] {
  grid-area: nav;
}

header nav[role="navigation"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

header nav[role="navigation"] li {
  margin: 0;
}

header nav[role="navigation"] a {
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

header nav[role="navigation"] a:hover {
  background: var(--gradient-soft);
  color: var(--primary);
  transform: translateY(-2px);
}

header form[role="search"] {
  grid-area: search;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

header form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

header form[role="search"] input {
  width: clamp(140px, 20vw, 230px);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition), width var(--transition);
}

header form[role="search"] input::placeholder {
  color: var(--text-muted);
}

header form[role="search"] input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
  outline: none;
}

header form[role="search"] button {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.32);
}

header form[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.42);
  filter: brightness(1.05);
}

header form[role="search"] button:active {
  transform: translateY(0);
}

/* ============ Breadcrumb ============ */
body > nav[aria-label="面包屑导航"] {
  max-width: var(--maxw);
  margin: 1.2rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

body > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  margin: 0;
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

body > nav[aria-label="面包屑导航"] li {
  margin: 0;
  display: flex;
  align-items: center;
}

body > nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-muted);
  opacity: 0.6;
}

body > nav[aria-label="面包屑导航"] li[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* ============ Main / Sections ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.5rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

main > section {
  position: relative;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s var(--transition) both;
}

main > section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(124, 58, 237, 0.28);
}

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

/* Stagger animation */
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; }
main > section:nth-child(9) { animation-delay: 0.34s; }
main > section:nth-child(10) { animation-delay: 0.38s; }
main > section:nth-child(11) { animation-delay: 0.42s; }
main > section:nth-child(12) { animation-delay: 0.46s; }
main > section:nth-child(13) { animation-delay: 0.5s; }
main > section:nth-child(14) { animation-delay: 0.54s; }
main > section:nth-child(15) { animation-delay: 0.58s; }
main > section:nth-child(16) { animation-delay: 0.62s; }
main > section:nth-child(17) { animation-delay: 0.66s; }
main > section:nth-child(18) { animation-delay: 0.7s; }
main > section:nth-child(19) { animation-delay: 0.74s; }
main > section:nth-child(20) { animation-delay: 0.78s; }

/* ============ Hero ============ */
#hero {
  padding: clamp(2rem, 6vw, 3.6rem) clamp(1.4rem, 5vw, 3rem);
  background: var(--gradient-hero);
  border: none;
  overflow: hidden;
  color: #fff;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -8%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 11s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-18px, 22px) scale(1.06); }
}

#hero h1 {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.18);
}

#hero h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 5px;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.2));
}

#hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.94);
  max-width: 820px;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
}

/* ============ Article cards ============ */
#articles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#articles h2 {
  margin-bottom: 0.4rem;
}

#articles article {
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.3);
}

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

#articles article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--gradient-soft);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

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

#articles article a:hover {
  background: var(--gradient-hero);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}

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

/* ============ FAQ details ============ */
#faq details {
  margin-bottom: 0.8rem;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

#faq details:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(6, 182, 212, 0.35);
}

#faq details[open] {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

#faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 2rem;
  transition: color var(--transition);
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-soft);
  color: var(--primary);
  font-weight: 700;
  transition: transform var(--transition), background var(--transition), color var(--transition);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: var(--gradient-hero);
  color: #fff;
}

#faq summary:hover {
  color: var(--primary);
}

#faq details p {
  margin: 0.8rem 0 0.2rem;
  animation: fadeIn 0.4s var(--transition) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Notice ============ */
#notice {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(124, 58, 237, 0.14));
  border-color: rgba(6, 182, 212, 0.3);
}

/* ============ Contact / Address ============ */
#contact address {
  font-style: normal;
  padding: 1rem 1.3rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

#contact address p {
  margin: 0.35rem 0;
  transition: color var(--transition), transform var(--transition);
}

#contact address p:hover {
  color: var(--primary);
  transform: translateX(4px);
}

/* ============ Sitemap quick links ============ */
#sitemap ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}

#sitemap li {
  margin: 0;
}

#sitemap a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  text-align: center;
  transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

#sitemap a:hover {
  background: var(--gradient-hero);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

/* ============ Footer ============ */
footer[role="contentinfo"] {
  margin-top: 2rem;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 2.5rem) 2rem;
  background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.08));
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

footer[role="contentinfo"] section {
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

footer[role="contentinfo"] section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

footer[role="contentinfo"] h2 {
  font-size: 1.02rem;
  margin: 0 0 0.8rem;
  padding-left: 14px;
}

footer[role="contentinfo"] h2::before {
  width: 4px;
}

footer[role="contentinfo"] p {
  font-size: 0.88rem;
  margin: 0.35rem 0;
  color: var(--text-muted);
}

footer[role="contentinfo"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer[role="contentinfo"] li {
  margin: 0 0 0.5rem;
}

footer[role="contentinfo"] li a {
  font-size: 0.88rem;
  color: var(--text-soft);
  display: inline-block;
  transition: color var(--transition), transform var(--transition);
}

footer[role="contentinfo"] li a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  header[role="banner"] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "nav";
    padding: 0.8rem 1rem;
  }

  header form[role="search"] input {
    flex: 1;
    width: auto;
  }

  header nav[role="navigation"] ul {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  header nav[role="navigation"] a {
    white-space: nowrap;
    font-size: 0.85rem;
  }

  .slogan {
    display: none;
  }

  main {
    gap: 1.2rem;
  }

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

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

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  main {
    padding: 1rem 0.8rem 2rem;
  }

  main > section {
    padding: 1.1rem 1rem;
    border-radius: var(--radius);
  }

  #hero {
    padding: 1.8rem 1.2rem;
  }

  #articles article {
    padding: 1rem;
  }

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

  footer[role="contentinfo"] {
    grid-template-columns: 1fr;
    padding: 1.5rem 0.8rem;
  }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Print ============ */
@media print {
  header[role="banner"],
  footer[role="contentinfo"],
  body > nav[aria-label="面包屑导航"] {
    display: none;
  }

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

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