:root {
  --bg-primary: #0b0d17;
  --bg-secondary: #12152a;
  --bg-card: rgba(26, 30, 56, 0.65);
  --bg-card-hover: rgba(36, 42, 78, 0.85);
  --text-primary: #eef1ff;
  --text-secondary: #a9b0d6;
  --text-muted: #6f77a0;
  --accent: #e94560;
  --accent-2: #7b5cff;
  --accent-3: #00d4ff;
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #533483 100%);
  --gradient-accent: linear-gradient(135deg, #e94560 0%, #7b5cff 100%);
  --gradient-text: linear-gradient(120deg, #ff6b8b 0%, #7b5cff 50%, #00d4ff 100%);
  --border-glass: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(123, 92, 255, 0.28);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --blur: blur(18px);
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 1180px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f3f5fc;
    --bg-secondary: #e8ecfa;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --text-primary: #14172b;
    --text-secondary: #4a5178;
    --text-muted: #7c84a8;
    --gradient-hero: linear-gradient(135deg, #dfe6ff 0%, #e8dcff 45%, #d4f0ff 100%);
    --border-glass: rgba(20, 23, 43, 0.08);
    --shadow-card: 0 8px 32px rgba(60, 70, 130, 0.12);
    --shadow-hover: 0 16px 48px rgba(123, 92, 255, 0.22);
    color-scheme: light;
  }
}

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

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, rgba(123, 92, 255, 0.18), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(233, 69, 96, 0.14), transparent 40%),
    radial-gradient(circle at 70% 90%, rgba(0, 212, 255, 0.12), transparent 45%);
  pointer-events: none;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 3rem);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  margin-bottom: 1.2rem;
  position: relative;
  padding-left: 1rem;
}

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

h3 {
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
  margin: 1.6rem 0 0.6rem;
  color: var(--text-primary);
}

h4 {
  font-size: 1.02rem;
  margin: 1.1rem 0 0.35rem;
  color: var(--accent-3);
}

p {
  margin: 0.5rem 0 0.85rem;
  color: var(--text-secondary);
}

ul {
  list-style: none;
}

blockquote {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text-secondary);
  font-style: italic;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-hover);
}

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 23, 0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition), box-shadow var(--transition);
}

@media (prefers-color-scheme: light) {
  #site-header {
    background: rgba(243, 245, 252, 0.78);
  }
}

#site-header:hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border-glass);
}

.top-bar span:last-child {
  color: var(--accent-3);
}

#site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

#site-header nav::-webkit-scrollbar {
  display: none;
}

#site-header nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

#site-header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.18rem;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
  transform: translateX(-50%);
  transition: width var(--transition);
}

#site-header nav a:hover,
#site-header nav a:focus-visible {
  color: var(--text-primary);
  background: rgba(123, 92, 255, 0.14);
  transform: translateY(-1px);
}

#site-header nav a:hover::after,
#site-header nav a:focus-visible::after {
  width: 60%;
}

/* ---------- Layout ---------- */
main {
  display: block;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

main > section {
  position: relative;
  margin: 1.75rem 0;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main > section:hover {
  border-color: rgba(123, 92, 255, 0.35);
  box-shadow: var(--shadow-hover);
}

main > section:nth-of-type(2) { animation-delay: 0.05s; }
main > section:nth-of-type(3) { animation-delay: 0.1s; }
main > section:nth-of-type(4) { animation-delay: 0.15s; }
main > section:nth-of-type(5) { animation-delay: 0.2s; }
main > section:nth-of-type(6) { animation-delay: 0.25s; }
main > section:nth-of-type(7) { animation-delay: 0.3s; }
main > section:nth-of-type(8) { animation-delay: 0.35s; }
main > section:nth-of-type(9) { animation-delay: 0.4s; }
main > section:nth-of-type(10) { animation-delay: 0.45s; }

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

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(233, 69, 96, 0); }
}

/* ---------- Hero ---------- */
#hero {
  overflow: hidden;
  background: var(--gradient-hero);
  border: 1px solid var(--border-glass);
  text-align: center;
  padding: clamp(1.75rem, 4.5vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.35), transparent 68%);
  filter: blur(30px);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -45% -15%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.28), transparent 68%);
  filter: blur(30px);
  pointer-events: none;
}

#hero > * {
  position: relative;
  z-index: 1;
}

#hero h1 {
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(123, 92, 255, 0.35);
}

#hero p {
  max-width: 760px;
  margin: 0 auto 1.4rem;
  font-size: clamp(0.92rem, 1.6vw, 1.05rem);
  color: var(--text-secondary);
}

.hero-media {
  margin: 1.5rem auto;
  max-width: 640px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: floatSoft 6s ease-in-out infinite;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-media:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 28px 80px rgba(123, 92, 255, 0.4);
}

.hero-media svg {
  width: 100%;
  height: auto;
}

#hero > a {
  display: inline-block;
  margin: 0.4rem 0.5rem;
  padding: 0.72rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--gradient-accent);
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

#hero > a:last-of-type {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: none;
}

#hero > a:hover,
#hero > a:focus-visible {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: 0 14px 34px rgba(233, 69, 96, 0.45);
  color: #fff;
}

#hero > a:last-of-type:hover,
#hero > a:last-of-type:focus-visible {
  border-color: var(--accent-3);
  color: var(--accent-3);
  box-shadow: 0 10px 28px rgba(0, 212, 255, 0.25);
}

/* ---------- Articles ---------- */
#articles > p {
  margin-bottom: 1.25rem;
}

#articles article {
  position: relative;
  margin: 1rem 0;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  overflow: hidden;
}

@media (prefers-color-scheme: light) {
  #articles article {
    background: rgba(255, 255, 255, 0.6);
  }
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
}

#articles article:hover {
  transform: translateY(-4px);
  border-color: rgba(123, 92, 255, 0.4);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

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

#articles article h3 {
  margin-top: 0;
  transition: color var(--transition);
}

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

#articles article p:nth-of-type(1) {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

#articles article a {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.42rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-3);
  border: 1px solid rgba(0, 212, 255, 0.35);
  transition: all var(--transition);
}

#articles article a:hover,
#articles article a:focus-visible {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.35);
}

/* ---------- FAQ ---------- */
#faq h3 {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 2.4rem;
  margin: 0.7rem 0 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: rgba(123, 92, 255, 0.1);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  cursor: default;
  transition: background var(--transition), color var(--transition);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: var(--gradient-accent);
}

#faq h3 + p {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem 1rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-top: none;
  font-size: 0.94rem;
  transition: background var(--transition);
}

@media (prefers-color-scheme: light) {
  #faq h3 + p {
    background: rgba(255, 255, 255, 0.55);
  }
}

#faq h3:hover {
  background: rgba(123, 92, 255, 0.2);
  color: var(--accent-3);
}

#faq h3:hover + p {
  background: rgba(123, 92, 255, 0.07);
}

/* ---------- HowTo ---------- */
#howto h4 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

#howto h4::before {
  content: "";
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.16);
}

/* ---------- Contact ---------- */
#contact p {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-glass);
  transition: color var(--transition), padding-left var(--transition);
}

#contact p:hover {
  color: var(--text-primary);
  padding-left: 0.5rem;
}

#contact p:last-child {
  border-bottom: none;
}

/* ---------- Sitemap & Links ---------- */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

#sitemap li a,
#links li a {
  display: block;
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition);
}

@media (prefers-color-scheme: light) {
  #sitemap li a,
  #links li a {
    background: rgba(255, 255, 255, 0.6);
  }
}

#sitemap li a:hover,
#sitemap li a:focus-visible,
#links li a:hover,
#links li a:focus-visible {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(233, 69, 96, 0.3);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(123, 92, 255, 0.08));
  border-top: 1px solid var(--border-glass);
}

footer > section {
  max-width: var(--max-width);
  margin: 0 auto 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: transform var(--transition), box-shadow var(--transition);
}

footer > section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

footer h2 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

footer h2::before {
  width: 3px;
}

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

footer > p {
  max-width: var(--max-width);
  margin: 0.35rem auto;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  main {
    padding: 1rem 0.9rem 2.5rem;
  }

  main > section {
    border-radius: var(--radius-md);
    margin: 1.1rem 0;
  }

  h2 {
    padding-left: 0.85rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .top-bar {
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    padding: 0.45rem 0.9rem;
  }

  #site-header nav {
    gap: 0.15rem;
    padding: 0.5rem 0.7rem;
    -webkit-overflow-scrolling: touch;
  }

  #site-header nav a {
    padding: 0.4rem 0.7rem;
    font-size: 0.84rem;
  }

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

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

  #hero {
    text-align: left;
  }

  #hero p {
    text-align: left;
  }

  #hero > a {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    text-align: center;
  }

  .hero-media {
    border-radius: var(--radius-sm);
  }

  #articles article {
    padding: 1rem;
  }

  #faq h3 {
    padding-left: 2.2rem;
    font-size: 1rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  footer > section {
    padding: 1rem;
  }
}

@media (max-width: 380px) {
  #site-header nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }
}

/* ---------- Accessibility & 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-glass: rgba(255, 255, 255, 0.35);
    --text-secondary: #d3d8f0;
  }
}

::selection {
  background: rgba(233, 69, 96, 0.4);
  color: #fff;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  border: 2px solid var(--bg-secondary);
}

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

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

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

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    backdrop-filter: none;
  }
}