:root {
  --primary: #c0392b;
  --primary-light: #e74c3c;
  --primary-dark: #96281b;
  --accent: #f39c12;
  --accent-light: #f1c40f;
  --bg: #fef9f4;
  --bg-alt: #fff5ee;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255, 255, 255, 0.92);
  --text: #2c1810;
  --text-secondary: #6b4c3b;
  --text-muted: #9b7b6b;
  --border: rgba(192, 57, 43, 0.12);
  --shadow-sm: 0 2px 8px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 8px 24px rgba(44, 24, 16, 0.1);
  --shadow-lg: 0 16px 48px rgba(44, 24, 16, 0.14);
  --shadow-glow: 0 0 30px rgba(192, 57, 43, 0.15);
  --gradient-banner: linear-gradient(135deg, #c0392b 0%, #e74c3c 30%, #f39c12 70%, #f1c40f 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,245,238,0.7));
  --gradient-accent: linear-gradient(135deg, #f39c12, #e74c3c);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #e74c3c;
    --primary-light: #ff6b5b;
    --primary-dark: #c0392b;
    --accent: #f1c40f;
    --accent-light: #f9e547;
    --bg: #1a1210;
    --bg-alt: #231816;
    --surface: rgba(40, 28, 24, 0.78);
    --surface-solid: #2a1e1a;
    --surface-hover: rgba(50, 35, 30, 0.92);
    --text: #f5e6dc;
    --text-secondary: #c9a99a;
    --text-muted: #8a6f62;
    --border: rgba(231, 76, 60, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(231, 76, 60, 0.2);
    --gradient-banner: linear-gradient(135deg, #96281b 0%, #c0392b 30%, #e67e22 70%, #f39c12 100%);
    --gradient-card: linear-gradient(145deg, rgba(42,30,26,0.9), rgba(35,24,22,0.7));
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

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

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(192, 57, 43, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(243, 156, 18, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(ellipse at 20% 0%, rgba(231, 76, 60, 0.08) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 100%, rgba(241, 196, 15, 0.05) 0%, transparent 60%);
  }
}

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

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

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

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

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

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

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

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

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

/* ============ HEADER ============ */

header[role="banner"] {
  position: relative;
  background: var(--gradient-banner);
  color: #fff;
  padding: 90px 40px 70px;
  overflow: hidden;
  z-index: 1;
  animation: bannerFadeIn 1s ease-out;
}

header[role="banner"]::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.08) 0%, transparent 50%);
  animation: bannerShimmer 12s ease-in-out infinite alternate;
  pointer-events: none;
}

header[role="banner"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
  z-index: 2;
}

@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bannerShimmer {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(3%, -3%) rotate(3deg); }
}

header[role="banner"] h1 {
  position: relative;
  z-index: 3;
  max-width: 1000px;
  margin: 0 auto 24px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
  animation: slideUp 0.8s ease-out 0.2s both;
}

header[role="banner"] p {
  position: relative;
  z-index: 3;
  max-width: 1000px;
  margin: 0 auto;
  font-size: clamp(0.92rem, 1.8vw, 1.08rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0,0,0,0.1);
  animation: slideUp 0.8s ease-out 0.4s both;
}

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

/* ============ NAV ============ */

nav[aria-label="主导航"] {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0;
  justify-content: center;
}

nav[aria-label="主导航"] ul li a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

nav[aria-label="主导航"] ul li a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

nav[aria-label="主导航"] ul li a:active {
  transform: translateY(0);
}

/* ============ MAIN ============ */

main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ============ SECTIONS ============ */

main > section {
  margin-bottom: 48px;
  padding: 36px 32px;
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: sectionReveal 0.7s ease-out both;
}

main > section:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: rgba(192, 57, 43, 0.2);
  transform: translateY(-2px);
}

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

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; }
main > section:nth-child(5) { animation-delay: 0.25s; }
main > section:nth-child(6) { animation-delay: 0.3s; }

/* ============ HEADINGS ============ */

main > section > h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid transparent;
  border-image: var(--gradient-accent) 1;
  position: relative;
  letter-spacing: -0.01em;
}

main > section > h2::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

main > section > h3 {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 12px;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

main > section > h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  background: var(--gradient-accent);
  border-radius: 3px;
}

main > section > h3:first-of-type {
  margin-top: 0;
}

/* ============ PARAGRAPHS ============ */

main > section p {
  font-size: 0.95rem;
  line-height: 1.92;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-align: justify;
  word-break: break-word;
}

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

/* ============ LISTS ============ */

main > section ul,
main > section ol {
  margin: 16px 0;
  padding-left: 24px;
}

main > section ul li,
main > section ol li {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}

main > section ul li::marker {
  color: var(--primary);
  font-weight: 700;
}

main > section ol li::marker {
  color: var(--primary);
  font-weight: 700;
}

/* ============ ARTICLES ============ */

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

main > section article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

main > section article:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(6px);
  border-color: rgba(192, 57, 43, 0.18);
}

main > section article:hover::before {
  opacity: 1;
}

main > section article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  padding-left: 0;
  transition: color var(--transition-fast);
}

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

main > section article h3::before {
  display: none;
}

main > section article p {
  margin-bottom: 8px;
}

main > section article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}

main > section article a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 16px;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  transition: all var(--transition-fast);
  margin-top: 6px;
}

main > section article a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

/* ============ BLOCKQUOTE ============ */

main > section blockquote {
  position: relative;
  padding: 22px 28px 22px 32px;
  margin: 16px 0;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: all var(--transition);
}

main > section blockquote:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-left-color: var(--accent);
}

main > section blockquote::before {
  content: "\201C";
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.2;
  font-family: Georgia, serif;
  pointer-events: none;
}

main > section blockquote p {
  font-size: 0.94rem;
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.85;
}

/* ============ CONTACT SECTION ============ */

#contact p {
  padding: 10px 16px;
  margin-bottom: 8px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 0.93rem;
}

#contact p:hover {
  border-color: rgba(192, 57, 43, 0.2);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

/* ============ FAQ ============ */

#faq h3 {
  margin-top: 24px;
  cursor: default;
  transition: color var(--transition-fast);
}

#faq h3:hover {
  color: var(--primary-light);
}

#faq h3 + p {
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-left: 2px;
}

/* ============ HOWTO ============ */

#howto ol {
  counter-reset: howto-counter;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: howto-counter;
  position: relative;
  padding: 14px 18px 14px 56px;
  margin-bottom: 10px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

#howto ol li::before {
  content: counter(howto-counter);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.25);
}

#howto ol li:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(6px);
  border-color: rgba(192, 57, 43, 0.18);
}

/* ============ SITEMAP / LINKS ============ */

#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding-left: 0;
}

#sitemap ul li,
#links ul li {
  margin-bottom: 0;
  padding-left: 0;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 7px 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

/* ============ FOOTER ============ */

footer[role="contentinfo"] {
  position: relative;
  z-index: 1;
  background: var(--gradient-banner);
  color: rgba(255, 255, 255, 0.9);
  padding: 48px 32px 36px;
  text-align: center;
  overflow: hidden;
}

footer[role="contentinfo"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

footer[role="contentinfo"] p {
  position: relative;
  font-size: 0.86rem;
  line-height: 1.9;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.85);
}

footer[role="contentinfo"] p:last-child {
  margin-bottom: 0;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

footer[role="contentinfo"] a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  transition: all var(--transition-fast);
  padding: 2px 6px;
  border-radius: 4px;
}

footer[role="contentinfo"] a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  html {
    scroll-padding-top: 60px;
  }

  header[role="banner"] {
    padding: 60px 20px 50px;
  }

  header[role="banner"] h1 {
    font-size: 1.35rem;
    line-height: 1.45;
  }

  header[role="banner"] p {
    font-size: 0.88rem;
    line-height: 1.85;
  }

  nav[aria-label="主导航"] {
    padding: 0 12px;
  }

  nav[aria-label="主导航"] ul {
    gap: 2px;
    padding: 8px 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav[aria-label="主导航"] ul::-webkit-scrollbar {
    display: none;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  main {
    padding: 24px 14px 60px;
  }

  main > section {
    padding: 24px 18px;
    margin-bottom: 28px;
    border-radius: var(--radius-md);
  }

  main > section > h2 {
    font-size: 1.15rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  main > section > h3 {
    font-size: 1rem;
    margin: 22px 0 10px;
  }

  main > section p {
    font-size: 0.9rem;
    line-height: 1.88;
    text-align: left;
  }

  main > section article {
    padding: 18px 16px;
  }

  main > section article:hover {
    transform: translateX(3px);
  }

  main > section blockquote {
    padding: 18px 18px 18px 24px;
  }

  main > section blockquote p {
    font-size: 0.88rem;
  }

  #howto ol li {
    padding: 12px 14px 12px 48px;
    font-size: 0.9rem;
  }

  #howto ol li::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  #sitemap ul,
  #links ul {
    gap: 6px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  footer[role="contentinfo"] {
    padding: 36px 18px 28px;
  }

  footer[role="contentinfo"] p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  header[role="banner"] {
    padding: 48px 16px 40px;
  }

  header[role="banner"] h1 {
    font-size: 1.2rem;
  }

  header[role="banner"] p {
    font-size: 0.84rem;
  }

  main {
    padding: 18px 10px 50px;
  }

  main > section {
    padding: 20px 14px;
    margin-bottom: 22px;
    border-radius: var(--radius-sm);
  }

  main > section > h2 {
    font-size: 1.08rem;
  }

  main > section > h3 {
    font-size: 0.95rem;
  }

  main > section p {
    font-size: 0.86rem;
  }

  main > section article {
    padding: 16px 14px;
  }

  main > section article h3 {
    font-size: 0.95rem;
  }

  main > section article a {
    font-size: 0.82rem;
    padding: 5px 12px;
  }

  #contact p {
    padding: 8px 12px;
    font-size: 0.86rem;
  }
}

/* ============ ACCESSIBILITY ============ */

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

/* ============ PRINT ============ */

@media print {
  nav[aria-label="主导航"],
  footer[role="contentinfo"] {
    display: none;
  }

  header[role="banner"] {
    background: none;
    color: #000;
    padding: 20px;
  }

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