:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: rgba(30, 30, 52, 0.72);
  --bg-card-hover: rgba(42, 42, 72, 0.85);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f8;
  --text-secondary: #b8b8d0;
  --text-muted: #7a7a9a;
  --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%, #4a1a6b 60%, #1a2a4e 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 107, 157, 0.08), rgba(77, 159, 255, 0.08));
  --gradient-btn: linear-gradient(135deg, #ff6b9d, #c44dff);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(196, 77, 255, 0.35);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ebebf5;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8a8aaa;
    --gradient-banner: linear-gradient(135deg, #ffe0ec 0%, #e8d5ff 30%, #d5e0ff 60%, #ffe8d5 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 107, 157, 0.06), rgba(77, 159, 255, 0.06));
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(196, 77, 255, 0.2);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-stack);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 107, 157, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(196, 77, 255, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(77, 159, 255, 0.08), transparent 60%);
  pointer-events: none;
}

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

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 {
  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.5rem, 4vw, 2.5rem);
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  margin-bottom: 24px;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  border-radius: 3px;
  background: var(--gradient-main);
  box-shadow: 0 0 12px rgba(196, 77, 255, 0.5);
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin-bottom: 12px;
  color: var(--text-primary);
}

p {
  margin-bottom: 14px;
  color: var(--text-secondary);
}

header {
  position: relative;
  background: var(--gradient-banner);
  padding: 48px 24px 40px;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 107, 157, 0.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(77, 159, 255, 0.15), transparent 45%),
    radial-gradient(circle at 50% 10%, rgba(196, 77, 255, 0.12), transparent 50%);
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
  pointer-events: none;
}

header > h1,
header > p,
header > nav {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

header > h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  background: linear-gradient(135deg, #fff 0%, #ffd6e8 40%, #e0c4ff 70%, #b8d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

header > p {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 32px;
  color: var(--text-secondary);
  font-size: clamp(0.88rem, 1.5vw, 1rem);
  line-height: 1.9;
  padding: 0 8px;
}

header > nav {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
}

header > nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

header > nav li {
  flex: 0 0 auto;
}

header > nav a {
  display: block;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

header > nav a:hover {
  color: #fff;
  background: rgba(196, 77, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(196, 77, 255, 0.25);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px 64px;
}

section {
  margin-bottom: 48px;
  padding: 32px;
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(196, 77, 255, 0.25);
}

section:hover::before {
  opacity: 0.8;
}

section h2 {
  margin-top: 0;
}

section h3 {
  margin-top: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}

section h3:first-of-type {
  margin-top: 8px;
}

section h3::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--gradient-main);
  border-radius: 2px;
}

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

article {
  background: var(--gradient-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

article::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

article:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(196, 77, 255, 0.3);
}

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

article h3 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

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

article h3::after {
  display: none;
}

article p {
  font-size: 0.92rem;
}

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
  padding: 4px 0;
  transition: all var(--transition-fast);
}

article a:hover {
  color: var(--accent-1);
  gap: 8px;
}

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

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

#faq h3 {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
  font-size: 1rem;
  cursor: default;
  transition: all var(--transition-fast);
}

#faq h3::after {
  display: none;
}

#faq h3:hover {
  background: rgba(196, 77, 255, 0.12);
  color: var(--accent-1);
}

#faq h3 + p {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

#faq h3 + p:hover {
  background: var(--bg-card-hover);
}

#howto h3 {
  margin-top: 28px;
}

#contact p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

#contact p::before {
  content: "▸";
  color: var(--accent-2);
  font-size: 0.8rem;
  margin-right: 4px;
}

#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

#sitemap li,
#links li {
  transition: transform var(--transition-fast);
}

#sitemap li:hover,
#links li:hover {
  transform: translateX(4px);
}

#sitemap a,
#links a {
  display: block;
  padding: 9px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

#sitemap a:hover,
#links a:hover {
  background: rgba(196, 77, 255, 0.18);
  border-color: rgba(196, 77, 255, 0.4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 77, 255, 0.2);
  transform: translateY(-2px);
}

#legal h2 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-left: 14px;
}

#legal h2::before {
  width: 4px;
  height: 60%;
}

#legal p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.85;
}

footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 40px 24px;
  text-align: center;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0.6;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

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

footer p:last-child {
  margin-bottom: 0;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.78rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  header {
    padding: 32px 16px 28px;
  }

  header > h1 {
    font-size: 1.3rem;
    line-height: 1.45;
  }

  header > p {
    font-size: 0.85rem;
    margin-bottom: 24px;
    padding: 0;
  }

  header > nav {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  header > nav ul {
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

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

  header > nav a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  main {
    padding: 28px 12px 48px;
  }

  section {
    padding: 20px 16px;
    margin-bottom: 28px;
    border-radius: var(--radius-md);
  }

  section:hover {
    transform: none;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  h3 {
    font-size: 1rem;
    margin-top: 20px;
  }

  p {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  article {
    padding: 16px 18px;
  }

  article:hover {
    transform: none;
  }

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

  #sitemap a,
  #links a {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  footer {
    padding: 28px 16px;
  }

  footer p {
    font-size: 0.78rem;
  }
}

@media (max-width: 400px) {
  header > h1 {
    font-size: 1.15rem;
  }

  main {
    padding: 20px 10px 40px;
  }

  section {
    padding: 16px 12px;
  }

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

@media (min-width: 1024px) {
  section {
    padding: 40px;
  }

  main {
    padding: 64px 24px 80px;
  }
}

@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 print {
  body::before,
  header::before,
  header::after,
  section::before {
    display: none;
  }

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

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

  header > nav {
    display: none;
  }
}