:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: rgba(30, 30, 50, 0.55);
  --bg-card-hover: rgba(40, 40, 70, 0.75);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #eaeaf2;
  --text-secondary: #b8b8d0;
  --text-muted: #8888a8;
  --accent-1: #ff6b9d;
  --accent-2: #c44dff;
  --accent-3: #4d9fff;
  --accent-4: #ffb84d;
  --gradient-main: linear-gradient(135deg, #ff6b9d 0%, #c44dff 50%, #4d9fff 100%);
  --gradient-banner: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 30%, #1e3a5f 60%, #1a1a2e 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 107, 157, 0.08) 0%, rgba(196, 77, 255, 0.06) 50%, rgba(77, 159, 255, 0.08) 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(196, 77, 255, 0.25);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeeef6;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #444466;
    --text-muted: #7777aa;
    --gradient-banner: linear-gradient(135deg, #fce4ec 0%, #e8d5f5 30%, #d5e8f5 60%, #fce4ec 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 107, 157, 0.1) 0%, rgba(196, 77, 255, 0.08) 50%, rgba(77, 159, 255, 0.1) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(196, 77, 255, 0.15);
  }
}

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

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

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(196, 77, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(77, 159, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 107, 157, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: rgba(196, 77, 255, 0.35);
  color: #ffffff;
}

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

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

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

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

ul, ol {
  list-style: none;
}

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

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

h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  margin-bottom: 1.25rem;
  position: relative;
  padding-left: 1.1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 4px;
  background: var(--gradient-main);
  box-shadow: 0 0 12px rgba(196, 77, 255, 0.5);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

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

header nav a {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.35rem 0.25rem;
  transition: color var(--transition-fast);
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-smooth);
}

header nav a:hover {
  color: var(--text-primary);
}

header nav a:hover::after {
  transform: scaleX(1);
}

header nav a:first-child {
  font-weight: 700;
  color: var(--accent-1);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  margin-bottom: 3rem;
  padding: 2rem 2rem 2.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth);
  animation: fadeInUp 0.7s ease-out both;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}

section:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  background: var(--bg-card-hover);
}

section#home {
  margin-top: 2rem;
  padding: 3rem 2.5rem;
  background: var(--gradient-banner);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  animation: none;
}

section#home::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(196, 77, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: floatGlow 8s ease-in-out infinite;
}

section#home::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(circle, rgba(77, 159, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: floatGlow 10s ease-in-out infinite reverse;
}

section#home h1 {
  font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

section#home p {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  max-width: 800px;
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
}

section#home,
section#contact,
section#legal {
  background: var(--gradient-card);
}

section#articles article {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: transform var(--transition-bounce), box-shadow var(--transition-smooth), border-color var(--transition-fast), background var(--transition-fast);
  position: relative;
  overflow: hidden;
}

section#articles article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

section#articles article:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-md), 0 0 20px rgba(196, 77, 255, 0.15);
  border-color: rgba(196, 77, 255, 0.3);
  background: var(--bg-card-hover);
}

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

section#articles article h3 {
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

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

section#articles article p {
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}

section#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: rgba(196, 77, 255, 0.1);
  border: 1px solid rgba(196, 77, 255, 0.25);
  transition: all var(--transition-fast);
}

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

section#articles article a:hover {
  background: rgba(196, 77, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(196, 77, 255, 0.3);
}

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

section#faq h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  position: relative;
  padding-right: 2.5rem;
}

section#faq h3::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent-2);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

section#faq h3:hover {
  background: var(--bg-card-hover);
  border-color: rgba(196, 77, 255, 0.3);
  color: var(--accent-1);
}

section#faq h3:hover::after {
  transform: translateY(-50%) rotate(90deg);
  color: var(--accent-1);
}

section#faq h3 + p {
  padding: 0.5rem 1rem 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid rgba(196, 77, 255, 0.2);
  margin-left: 1rem;
  transition: border-color var(--transition-fast);
}

section#faq h3:hover + p {
  border-left-color: var(--accent-2);
}

section#howto h3 {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--gradient-main);
  color: #ffffff;
  font-size: 0.95rem;
  border-radius: 999px;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 14px rgba(196, 77, 255, 0.3);
}

section#howto p {
  padding-left: 0.5rem;
}

section#contact p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--glass-border);
  font-size: 0.95rem;
}

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

section#contact p::first-letter {
  color: var(--accent-2);
}

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

section#sitemap li,
section#links li {
  list-style: none;
}

section#sitemap a,
section#links a {
  display: block;
  padding: 0.55rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

section#sitemap a::before,
section#links a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--gradient-main);
  opacity: 0.12;
  transition: width var(--transition-smooth);
}

section#sitemap a:hover,
section#links a:hover {
  color: var(--accent-1);
  border-color: rgba(196, 77, 255, 0.35);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

section#sitemap a:hover::before,
section#links a:hover::before {
  width: 100%;
}

section#legal h2 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

section#legal h2:first-child {
  margin-top: 0;
}

section#legal p {
  font-size: 0.9rem;
}

section#legal p:last-child {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer {
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid var(--glass-border);
}

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

footer p:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

footer p:last-child {
  margin-bottom: 0;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

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

@keyframes floatGlow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-5%, 5%) scale(1.1);
    opacity: 1;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(196, 77, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(196, 77, 255, 0.4);
  }
}

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

@media (max-width: 900px) {
  main {
    padding: 0 1rem;
  }

  section {
    padding: 1.5rem 1.25rem 1.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
  }

  section#home {
    padding: 2rem 1.5rem;
  }

  header nav {
    padding: 0.6rem 1rem;
    gap: 0.25rem 1rem;
  }

  header nav a {
    font-size: 0.82rem;
  }
}

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

  main {
    padding: 0 0.75rem;
  }

  section {
    padding: 1.25rem 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
  }

  section#home {
    margin-top: 1rem;
    padding: 1.75rem 1.25rem;
  }

  section#home h1 {
    font-size: 1.45rem;
  }

  h2 {
    font-size: 1.25rem;
    padding-left: 0.9rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  section#articles article {
    padding: 1.1rem;
  }

  section#faq h3 {
    font-size: 0.95rem;
    padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  }

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

  section#sitemap a,
  section#links a {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  header nav {
    padding: 0.5rem 0.75rem;
    gap: 0.2rem 0.85rem;
  }

  header nav a {
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  section#home h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  header nav a {
    font-size: 0.72rem;
  }
}

@media (hover: none) {
  section:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }

  section#articles article:hover {
    transform: none;
  }

  section#sitemap a:hover,
  section#links a:hover {
    transform: none;
  }
}

@media print {
  header,
  footer {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  section {
    box-shadow: none;
    border: 1px solid #cccccc;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  h1 {
    -webkit-text-fill-color: #000000;
    background: none;
  }

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