:root {
  --primary: #c2185b;
  --primary-dark: #8e0e41;
  --primary-light: #f06292;
  --secondary: #7b1fa2;
  --secondary-light: #ab47bc;
  --accent: #ff7043;
  --accent-light: #ffab91;
  --bg: #fdf5f8;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #8888a0;
  --border: #f0dde6;
  --shadow: 0 4px 20px rgba(194, 24, 91, 0.08);
  --shadow-lg: 0 8px 40px rgba(194, 24, 91, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-blur: 16px;
  --gradient-banner: linear-gradient(135deg, #c2185b 0%, #7b1fa2 50%, #4a148c 100%);
  --gradient-accent: linear-gradient(135deg, #ff7043 0%, #c2185b 100%);
  --gradient-subtle: linear-gradient(135deg, #fdf5f8 0%, #f3e5f5 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0a14;
    --bg-alt: #1a1222;
    --bg-card: #1e1528;
    --text: #f0e6f0;
    --text-secondary: #b8a8c0;
    --text-muted: #807090;
    --border: #2d1f3a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
    --glass-bg: rgba(30, 21, 40, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
    --gradient-subtle: linear-gradient(135deg, #0f0a14 0%, #1a1222 100%);
  }
}

*, *::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);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  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(--primary-light);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.4;
  color: var(--text);
  font-weight: 700;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  background: var(--gradient-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  position: relative;
  padding-left: 1rem;
}

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

h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--primary);
}

h4 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
  color: var(--secondary);
}

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

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

#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow var(--transition);
}

#site-header.scrolled {
  box-shadow: var(--shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  background: var(--gradient-banner);
  color: #fff;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-slogan {
  font-size: 0.8rem;
  opacity: 0.85;
}

#main-nav {
  padding: 0 1.5rem;
}

#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.5rem 0;
}

#main-nav a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

#main-nav a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.3);
}

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

section {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}

section:hover {
  box-shadow: var(--shadow-lg);
}

#hero {
  margin-top: 2rem;
  padding: 3rem 2.5rem;
  background: var(--gradient-banner);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 50%;
  height: 160%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

#hero h1 {
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
  font-size: 1.9rem;
  position: relative;
  z-index: 1;
}

#hero p {
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

#hero figure {
  margin-top: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

#hero figcaption {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

#breadcrumb {
  margin: 1.5rem 0;
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}

#breadcrumb li {
  color: var(--text-muted);
}

#breadcrumb li + li::before {
  content: "/";
  margin-right: 0.3rem;
  color: var(--text-muted);
}

#breadcrumb a {
  color: var(--primary);
  font-weight: 500;
}

#anchor-nav {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

#anchor-nav h2 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  padding-left: 0.8rem;
}

#anchor-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#anchor-nav a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--gradient-subtle);
  color: var(--primary);
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

#anchor-nav a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.25);
}

article {
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  transition: all var(--transition);
}

article:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  border-left-color: var(--accent);
}

article h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

article p {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  transition: all var(--transition);
}

article a:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.3);
}

blockquote {
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--secondary);
  position: relative;
  transition: all var(--transition);
}

blockquote:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

blockquote p {
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.5rem;
}

blockquote footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

blockquote footer::before {
  content: "— ";
}

section ul:not([class]) {
  padding-left: 0.5rem;
}

section ul:not([class]) li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

section ul:not([class]) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-accent);
}

#contact ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.6rem;
}

#contact ul li {
  padding: 0.7rem 1rem;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  transition: all var(--transition);
}

#contact ul li:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#sitemap ul li,
#links ul li {
  padding: 0;
}

#sitemap ul li::before,
#links ul li::before {
  display: none;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

#sitemap a:hover,
#links a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.25);
}

#faq h3 {
  padding: 0.8rem 1rem;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  cursor: default;
  transition: all var(--transition);
}

#faq h3:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}

#faq h3 + p {
  padding: 0 1rem;
  font-size: 0.92rem;
}

#howto h4 {
  padding-left: 0.8rem;
  border-left: 3px solid var(--secondary-light);
}

#author-info {
  background: var(--gradient-banner);
  color: #fff;
  border: none;
}

#author-info h2 {
  color: #fff;
}

#author-info h2::before {
  background: #fff;
}

#author-info p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

#site-footer {
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
  background: var(--gradient-banner);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

#site-footer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

#site-footer a {
  color: #fff;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all var(--transition);
}

#site-footer a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

main > section {
  animation: fadeInUp 0.6s ease-out both;
}

main > section:nth-child(1) { animation-delay: 0.05s; }
main > section:nth-child(2) { animation-delay: 0.1s; }
main > section:nth-child(3) { animation-delay: 0.15s; }
main > section:nth-child(4) { animation-delay: 0.2s; }

article {
  animation: fadeIn 0.5s ease-out both;
}

article:nth-child(1) { animation-delay: 0.05s; }
article:nth-child(2) { animation-delay: 0.1s; }
article:nth-child(3) { animation-delay: 0.15s; }
article:nth-child(4) { animation-delay: 0.2s; }
article:nth-child(5) { animation-delay: 0.25s; }

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

::selection {
  background: var(--primary);
  color: #fff;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

@media (max-width: 900px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }
  section { padding: 1.5rem; margin: 2rem 0; }
  #hero { padding: 2rem 1.5rem; }
  #hero h1 { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  body { font-size: 15px; line-height: 1.75; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; padding-left: 0.8rem; }
  h3 { font-size: 1.05rem; }
  h4 { font-size: 0.98rem; }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1rem;
  }

  .brand-name { font-size: 1rem; }
  .brand-slogan { font-size: 0.72rem; }

  #main-nav { padding: 0 1rem; }

  #main-nav ul {
    gap: 0.15rem;
    padding: 0.4rem 0;
  }

  #main-nav a {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  #main-content { padding: 0 0.8rem; }

  section {
    padding: 1.2rem;
    margin: 1.2rem 0;
    border-radius: var(--radius);
  }

  #hero {
    padding: 1.5rem 1.2rem;
    margin-top: 1rem;
  }

  #hero h1 { font-size: 1.25rem; }

  #hero figure { margin-top: 1.2rem; }

  #anchor-nav { padding: 1rem; }
  #anchor-nav a { font-size: 0.75rem; padding: 0.3rem 0.65rem; }

  article { padding: 1rem; }
  article h3 { font-size: 0.95rem; }

  blockquote { padding: 1rem; }

  #contact ul {
    grid-template-columns: 1fr;
  }

  #site-footer { padding: 2rem 1rem; }
  #site-footer p { font-size: 0.78rem; }
}

@media (max-width: 380px) {
  #main-nav a { font-size: 0.72rem; padding: 0.3rem 0.5rem; }
  #hero h1 { font-size: 1.1rem; }
}

@media print {
  #site-header, #site-footer, #anchor-nav, #breadcrumb { display: none; }
  section { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}