:root {
  --primary: #5b3fa8;
  --primary-light: #7c5cd6;
  --primary-dark: #3f2a7a;
  --accent: #ffd36e;
  --accent-soft: #ffe9b8;
  --bg: #f6f4fc;
  --bg-alt: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #241c3a;
  --text-soft: #5a5275;
  --text-muted: #857da6;
  --border: rgba(91, 63, 168, 0.14);
  --shadow-sm: 0 2px 10px rgba(63, 42, 122, 0.08);
  --shadow-md: 0 12px 32px rgba(63, 42, 122, 0.12);
  --shadow-lg: 0 24px 60px rgba(63, 42, 122, 0.18);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --glass-blur: 16px;
  --gradient-banner: linear-gradient(135deg, #5b3fa8 0%, #7c5cd6 42%, #b28dff 78%, #ffd36e 130%);
  --gradient-soft: linear-gradient(160deg, rgba(91, 63, 168, 0.08), rgba(255, 211, 110, 0.12));
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 76px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #9d84f0;
    --primary-light: #b6a2ff;
    --primary-dark: #6b4fd1;
    --accent: #ffd36e;
    --accent-soft: #6b5a2e;
    --bg: #100d1c;
    --bg-alt: #181328;
    --bg-elevated: rgba(32, 26, 54, 0.68);
    --text: #efeaff;
    --text-soft: #bdb3d9;
    --text-muted: #8f86ad;
    --border: rgba(157, 132, 240, 0.2);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --gradient-banner: linear-gradient(135deg, #2a1d5c 0%, #4a2f9e 45%, #7c5cd6 80%, #a98bff 130%);
    --gradient-soft: linear-gradient(160deg, rgba(157, 132, 240, 0.12), rgba(255, 211, 110, 0.06));
  }
}

*,
*::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: "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.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(124, 92, 214, 0.18), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(255, 211, 110, 0.16), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(91, 63, 168, 0.1), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--primary-light);
}

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

li {
  margin-bottom: 0.45em;
}

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.7rem);
  margin: 0 0 0.6em;
}

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

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

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

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.4em;
}

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.3em;
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gradient-soft);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
}

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

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

::selection {
  background: rgba(124, 92, 214, 0.3);
  color: var(--text);
}

/* ---------- Header ---------- */

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(91, 63, 168, 0.35);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand-logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 10px 26px rgba(91, 63, 168, 0.5);
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 999px;
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--primary);
  background: rgba(124, 92, 214, 0.1);
  transform: translateY(-1px);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  width: 60%;
}

/* ---------- Layout ---------- */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

section {
  position: relative;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.6rem);
  box-shadow: var(--shadow-md);
  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(124, 92, 214, 0.3);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--gradient-banner);
  border: none;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.28), transparent 45%),
    radial-gradient(circle at 8% 88%, rgba(255, 211, 110, 0.3), transparent 50%);
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(60px);
  z-index: -1;
  animation: floatBlob 14s ease-in-out infinite;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.12); }
}

.hero h1 {
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.18);
}

.hero .hero-lead {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  max-width: 780px;
}

.hero-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}

.hero-carousel .slide {
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: slideIn 0.7s var(--ease) both;
}

.hero-carousel .slide:nth-child(1) { animation-delay: 0.05s; }
.hero-carousel .slide:nth-child(2) { animation-delay: 0.15s; }
.hero-carousel .slide:nth-child(3) { animation-delay: 0.25s; }

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

.hero-carousel .slide:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.hero-carousel .slide h3 {
  color: #fff;
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
}

.hero-carousel .slide p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 0.92rem;
}

/* ---------- Cards / Articles ---------- */

article {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

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

article h3 {
  margin-top: 0;
  transition: color 0.3s var(--ease);
}

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

article p {
  margin-bottom: 0.6rem;
}

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: rgba(124, 92, 214, 0.1);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), gap 0.3s var(--ease);
}

article a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

article a:hover {
  background: var(--primary);
  color: #fff;
  gap: 0.55rem;
}

article a:hover::after {
  transform: translateX(3px);
}

#articles {
  display: block;
}

#articles > article {
  display: flex;
  flex-direction: column;
}

/* ---------- FAQ ---------- */

#faq h3 {
  padding: 0.9rem 1.1rem;
  margin: 0.8rem 0 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 1rem;
  cursor: default;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

#faq h3:hover {
  background: rgba(124, 92, 214, 0.08);
  color: var(--primary);
}

#faq h3 + p {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 0 0 0.6rem;
  transition: background 0.3s var(--ease);
}

#faq h3 + p:hover {
  background: rgba(124, 92, 214, 0.04);
}

/* ---------- HowTo ---------- */

#howto ol,
#howto ul {
  padding-left: 1.5em;
}

#howto ol li {
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: rgba(124, 92, 214, 0.35);
  box-shadow: var(--shadow-sm);
}

#howto h3 {
  display: inline-block;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  font-size: 0.98rem;
}

/* ---------- Contact / Sitemap / Links ---------- */

#contact p {
  margin-bottom: 0.5rem;
}

#contact p:first-of-type {
  color: var(--text);
}

#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */

footer {
  margin-top: 1rem;
  padding: 2.5rem 1.5rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(91, 63, 168, 0.08));
  border-top: 1px solid var(--border);
}

footer section {
  max-width: 1240px;
  margin: 0 auto 1.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

footer section:hover {
  box-shadow: none;
  border-color: transparent;
}

footer h2 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  color: var(--text-soft);
}

footer h2::after {
  width: 32px;
  height: 3px;
}

footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* ---------- Scroll reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  main > section {
    animation: revealUp 0.8s var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% cover 26%;
  }

  @supports not (animation-timeline: view()) {
    main > section {
      animation: none;
    }
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Focus ---------- */

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

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .brand-bar {
    padding: 0.6rem 1rem;
  }

  .main-nav ul {
    gap: 0.1rem;
  }

  .main-nav a {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
  }

  main {
    padding: 1.5rem 1rem 2.5rem;
    gap: 1.8rem;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 68px;
    --radius-lg: 22px;
  }

  .brand-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav ul {
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .hero-carousel {
    grid-template-columns: 1fr;
  }

  section {
    padding: 1.3rem 1.1rem;
  }

  #faq h3 {
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 0.75rem 0.9rem;
  }

  footer {
    padding: 2rem 1rem 1.5rem;
  }
}

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

  .brand-logo svg {
    width: 38px;
    height: 38px;
  }

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

  article {
    padding: 1rem 1rem;
  }
}

/* ---------- High contrast / reduced motion ---------- */

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

@media (prefers-contrast: more) {
  :root {
    --border: rgba(91, 63, 168, 0.45);
    --text-soft: #3d3459;
  }

  section {
    border-width: 2px;
  }
}

/* ---------- Print ---------- */

@media print {
  #site-header,
  .hero-carousel,
  footer {
    display: none;
  }

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

  section,
  article {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    break-inside: avoid;
  }

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