:root {
  --primary: #ff7a59;
  --primary-dark: #e85d3a;
  --primary-light: #ffb09c;
  --secondary: #5b8def;
  --accent: #ffd166;
  --bg: #fef9f6;
  --bg-alt: #fff5f0;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 122, 89, 0.16);
  --text: #2d2a28;
  --text-soft: #6b6360;
  --text-muted: #9a918d;
  --shadow-sm: 0 2px 10px rgba(255, 122, 89, 0.08);
  --shadow-md: 0 8px 30px rgba(255, 122, 89, 0.12);
  --shadow-lg: 0 18px 50px rgba(255, 122, 89, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --gradient-banner: linear-gradient(135deg, #ff7a59 0%, #ff9a76 40%, #ffd166 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255, 122, 89, 0.1), rgba(91, 141, 239, 0.08));
  --blur: 16px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff8a6b;
    --primary-dark: #ff7a59;
    --primary-light: #ffb09c;
    --secondary: #7aa2f7;
    --accent: #ffd166;
    --bg: #17151a;
    --bg-alt: #1e1b21;
    --bg-card: rgba(40, 36, 44, 0.72);
    --bg-glass: rgba(40, 36, 44, 0.55);
    --border: rgba(255, 138, 107, 0.18);
    --text: #f0ece9;
    --text-soft: #b8b0ac;
    --text-muted: #857d7a;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
    --gradient-banner: linear-gradient(135deg, #c9482b 0%, #d96a45 40%, #b89a3e 100%);
    --gradient-soft: linear-gradient(135deg, rgba(255, 138, 107, 0.08), rgba(122, 162, 247, 0.06));
  }
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 122, 89, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(91, 141, 239, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 92%, rgba(255, 209, 102, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

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

ul {
  list-style: none;
}

header {
  position: relative;
  padding: 0;
  background: var(--gradient-banner);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 82% 75%, rgba(255, 255, 255, 0.16) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
  transition: background 0.4s ease;
  pointer-events: none;
}

header h1 {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px 20px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.16);
  animation: fadeUp 0.9s ease both;
}

header > p {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
  animation: fadeUp 1s ease 0.15s both;
}

header nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

header nav ul {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  justify-content: center;
}

header nav ul li a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

header nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.28s ease;
}

header nav ul li a:hover {
  color: var(--primary-dark);
  background: rgba(255, 122, 89, 0.1);
  transform: translateY(-2px);
}

header nav ul li a:hover::after {
  width: 50%;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

section {
  margin-bottom: 56px;
  padding: 36px 32px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease,
              background 0.4s ease,
              border-color 0.4s ease;
  opacity: 0;
  transform: translateY(36px);
  animation: revealCard 0.8s ease forwards;
}

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:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 122, 89, 0.28);
}

section h2 {
  position: relative;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 22px;
  padding-left: 20px;
  color: var(--text);
  letter-spacing: 0.3px;
}

section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--gradient-banner);
  box-shadow: 0 0 12px rgba(255, 122, 89, 0.4);
}

section h3 {
  position: relative;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 700;
  line-height: 1.5;
  margin: 28px 0 12px;
  color: var(--primary-dark);
  padding-left: 14px;
}

section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.15);
}

section h4 {
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  font-weight: 700;
  line-height: 1.55;
  margin: 22px 0 10px;
  color: var(--secondary);
  padding-left: 12px;
  border-left: 3px solid var(--secondary);
}

section p {
  font-size: 0.98rem;
  line-height: 1.9;
  color: var(--text-soft);
  margin-bottom: 14px;
  text-align: justify;
  word-break: break-word;
}

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

section#faq h3 {
  padding: 14px 18px;
  margin: 16px 0 8px;
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  color: var(--text);
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.28s ease;
}

section#faq h3::before {
  display: none;
}

section#faq h3:hover {
  background: rgba(255, 122, 89, 0.14);
  transform: translateX(4px);
}

section#faq h3 + p {
  padding: 4px 18px 12px;
  margin: 0 0 6px;
  font-size: 0.94rem;
  color: var(--text-soft);
  border-left: 4px solid transparent;
  transition: all 0.28s ease;
}

section#faq h3:hover + p {
  border-left-color: rgba(255, 122, 89, 0.3);
}

section#articles h3 {
  padding: 12px 16px;
  margin: 14px 0 6px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  color: var(--text);
  font-size: 0.98rem;
  transition: all 0.3s ease;
}

section#articles h3::before {
  display: none;
}

section#articles h3:hover {
  background: rgba(255, 209, 102, 0.14);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

section#articles h3 + p {
  padding-left: 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

section#howto h3 {
  margin-top: 24px;
}

section#contact p {
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.95rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

section#contact p:hover {
  background: rgba(255, 122, 89, 0.08);
  transform: translateX(4px);
}

footer {
  position: relative;
  padding: 48px 24px 36px;
  background: var(--gradient-banner);
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

footer > p {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto 24px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

footer nav ul {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 6px;
}

footer nav ul li a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

footer nav ul li a:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  opacity: 1;
}

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

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

@keyframes floatSoft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.8;
  }

  header h1 {
    padding: 44px 18px 16px;
    font-size: 1.45rem;
    line-height: 1.4;
  }

  header > p {
    padding: 0 18px 32px;
    font-size: 0.92rem;
    line-height: 1.8;
  }

  header::after {
    height: 36px;
  }

  header nav ul {
    padding: 8px 10px;
    gap: 4px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

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

  header nav ul li a {
    padding: 7px 13px;
    font-size: 0.82rem;
  }

  main {
    padding: 28px 14px 56px;
  }

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

  section:hover {
    transform: translateY(-3px);
  }

  section h2 {
    font-size: 1.22rem;
    padding-left: 16px;
    margin-bottom: 16px;
  }

  section h2::before {
    width: 5px;
  }

  section h3 {
    font-size: 1.02rem;
    margin: 22px 0 10px;
  }

  section h4 {
    font-size: 0.96rem;
  }

  section p {
    font-size: 0.92rem;
    line-height: 1.85;
    text-align: left;
  }

  section#faq h3 {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  section#faq h3 + p {
    padding: 2px 14px 10px;
    font-size: 0.88rem;
  }

  section#articles h3 {
    padding: 11px 13px;
    font-size: 0.92rem;
  }

  section#contact p {
    font-size: 0.88rem;
    padding: 9px 12px;
  }

  footer {
    padding: 36px 16px 28px;
  }

  footer > p {
    font-size: 0.82rem;
    margin-bottom: 18px;
  }

  footer nav ul {
    gap: 6px 5px;
  }

  footer nav ul li a {
    padding: 6px 13px;
    font-size: 0.8rem;
  }
}

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

  section {
    padding: 20px 14px;
  }

  section h2 {
    font-size: 1.12rem;
  }

  section p {
    font-size: 0.88rem;
  }
}

@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 {
    opacity: 1;
    transform: none;
  }
}

::selection {
  background: rgba(255, 122, 89, 0.28);
  color: var(--text);
}

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

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

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

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

:focus-visible {
  outline: 3px solid rgba(255, 122, 89, 0.5);
  outline-offset: 3px;
  border-radius: 6px;
}