:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b7a;
  --secondary: #457b9d;
  --secondary-dark: #2c5a78;
  --accent: #f4a261;
  --accent-dark: #e76f51;
  --bg: #fdf6f0;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1d1d2b;
  --text-secondary: #5a5a72;
  --text-muted: #8e8ea0;
  --border: rgba(230, 57, 70, 0.12);
  --shadow-sm: 0 2px 8px rgba(29, 29, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(29, 29, 43, 0.08);
  --shadow-lg: 0 16px 48px rgba(29, 29, 43, 0.12);
  --shadow-glow: 0 8px 32px rgba(230, 57, 70, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1200px;
  --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --bg-alt: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.78);
    --bg-glass: rgba(26, 26, 46, 0.6);
    --text: #eaeaf0;
    --text-secondary: #a8a8c0;
    --text-muted: #6e6e88;
    --border: rgba(230, 57, 70, 0.2);
    --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 8px 32px rgba(230, 57, 70, 0.25);
  }
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(230, 57, 70, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(69, 123, 157, 0.07), transparent),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(244, 162, 97, 0.06), transparent);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

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

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

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary), var(--primary));
  background-size: 300% 100%;
  animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--header-height);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

nav a {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

nav a::before {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width var(--transition-base), left var(--transition-base);
}

nav a:hover {
  color: var(--primary);
  background: rgba(230, 57, 70, 0.06);
  transform: translateY(-1px);
}

nav a:hover::before {
  width: 60%;
  left: 20%;
}

nav a:active {
  transform: translateY(0) scale(0.97);
}

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

section {
  position: relative;
  margin: 48px 0;
  padding: 40px 36px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(230, 57, 70, 0.22);
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }

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

#home {
  margin-top: 40px;
  padding: 56px 40px;
  background:
    linear-gradient(135deg, rgba(230, 57, 70, 0.92) 0%, rgba(193, 18, 31, 0.88) 30%, rgba(69, 123, 157, 0.85) 70%, rgba(44, 90, 120, 0.9) 100%);
  background-size: 200% 200%;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards, bannerGradient 12s ease infinite;
  border: none;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

#home::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}

#home::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

@keyframes bannerGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.1); }
}

#home h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

#home p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.85;
  max-width: 800px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

#home p + p {
  margin-top: 14px;
}

h2 {
  position: relative;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width var(--transition-slow);
}

section:hover h2::after {
  width: 100px;
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
  padding-left: 14px;
  border-left: 3px solid var(--primary);
  line-height: 1.5;
  transition: border-color var(--transition-fast), padding-left var(--transition-fast);
}

h3:hover {
  border-left-color: var(--accent);
  padding-left: 18px;
}

p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.85;
}

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

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

a:hover {
  color: var(--primary-dark);
  opacity: 0.85;
}

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

article {
  position: relative;
  margin: 20px 0;
  padding: 24px 26px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(230, 57, 70, 0.25);
  background: var(--bg-card);
}

article:hover::before {
  transform: scaleX(1);
}

article h3 {
  margin-top: 0;
  border-left: none;
  padding-left: 0;
  font-size: 1.1rem;
  color: var(--text);
  transition: color var(--transition-fast);
}

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

article p {
  font-size: 0.9rem;
}

article p:first-of-type {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(69, 123, 157, 0.08);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 16px;
  background: rgba(230, 57, 70, 0.08);
  border-radius: 20px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

article a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(2px);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
  opacity: 1;
}

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

#faq h3 {
  margin-top: 24px;
  font-size: 1.02rem;
  border-left-color: var(--secondary);
}

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

#faq p {
  padding-left: 14px;
  border-left: 2px solid transparent;
  transition: border-color var(--transition-fast), padding-left var(--transition-fast);
}

#faq p:hover {
  border-left-color: var(--accent);
  padding-left: 18px;
}

#howto h3 {
  border-left-color: var(--accent-dark);
}

#contact p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
}

#contact h3 {
  margin-top: 24px;
}

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

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all var(--transition-fast);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.3);
  opacity: 1;
}

footer {
  margin-top: 60px;
  padding: 48px 20px 32px;
  background: linear-gradient(180deg, transparent, rgba(230, 57, 70, 0.04) 30%, rgba(69, 123, 157, 0.06));
  border-top: 1px solid var(--border);
}

footer section {
  max-width: var(--max-width);
  margin: 0 auto 24px;
  padding: 24px 28px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

footer section:nth-child(1) { animation-delay: 0.1s; }
footer section:nth-child(2) { animation-delay: 0.2s; }
footer section:nth-child(3) { animation-delay: 0.3s; }

footer h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

footer h2::after {
  width: 40px;
  height: 3px;
}

footer p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

footer > p {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  padding-top: 16px;
}

footer > p a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
  border-radius: 28px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

footer > p a::before {
  content: "↑";
  font-size: 1rem;
}

footer > p a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(230, 57, 70, 0.45);
  opacity: 1;
  color: #fff;
}

@media (max-width: 900px) {
  section {
    padding: 32px 24px;
    margin: 32px 0;
    border-radius: var(--radius-md);
  }

  #home {
    padding: 40px 28px;
    margin-top: 24px;
  }

  nav {
    padding: 0 12px;
  }

  nav a {
    padding: 8px 12px;
    font-size: 13px;
  }

  article {
    padding: 20px 20px;
  }
}

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

  body {
    font-size: 15px;
  }

  main {
    padding: 0 14px;
  }

  section {
    padding: 24px 18px;
    margin: 24px 0;
    border-radius: var(--radius-md);
  }

  #home {
    padding: 32px 20px;
    margin-top: 16px;
    border-radius: var(--radius-md);
  }

  #home h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.25rem;
  }

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

  nav a {
    padding: 7px 10px;
    font-size: 12.5px;
  }

  article {
    padding: 18px 16px;
    border-radius: var(--radius-sm);
  }

  article h3 {
    font-size: 1rem;
  }

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

  footer {
    padding: 32px 14px 24px;
  }

  footer section {
    padding: 20px 18px;
  }
}

@media (max-width: 380px) {
  nav a {
    padding: 6px 8px;
    font-size: 12px;
  }

  section {
    padding: 20px 14px;
  }

  #home {
    padding: 26px 16px;
  }
}

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

  section,
  footer section {
    opacity: 1;
    transform: none;
  }
}

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

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

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