:root {
  --mango-primary: #ff7a1a;
  --mango-primary-light: #ffb347;
  --mango-primary-dark: #e05e00;
  --mango-secondary: #ff4e6a;
  --mango-accent: #ffd166;
  --mango-bg: #fff8f2;
  --mango-bg-alt: #ffffff;
  --mango-surface: rgba(255, 255, 255, 0.65);
  --mango-surface-solid: #ffffff;
  --mango-text: #2b1d12;
  --mango-text-soft: #6b5a4b;
  --mango-text-muted: #9c8b7c;
  --mango-border: rgba(255, 122, 26, 0.18);
  --mango-shadow: 0 8px 30px rgba(255, 122, 26, 0.12);
  --mango-shadow-hover: 0 16px 48px rgba(255, 122, 26, 0.22);
  --mango-radius: 20px;
  --mango-radius-sm: 12px;
  --mango-radius-lg: 28px;
  --mango-blur: 16px;
  --mango-transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --mango-gradient: linear-gradient(135deg, #ff7a1a 0%, #ff4e6a 50%, #ffb347 100%);
  --mango-gradient-soft: linear-gradient(135deg, rgba(255, 122, 26, 0.12) 0%, rgba(255, 78, 106, 0.08) 50%, rgba(255, 209, 102, 0.12) 100%);
  --mango-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mango-bg: #14100c;
    --mango-bg-alt: #1c1712;
    --mango-surface: rgba(40, 32, 24, 0.6);
    --mango-surface-solid: #241d16;
    --mango-text: #f5ece3;
    --mango-text-soft: #c9b8a8;
    --mango-text-muted: #8f7f70;
    --mango-border: rgba(255, 122, 26, 0.22);
    --mango-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --mango-shadow-hover: 0 16px 48px rgba(255, 122, 26, 0.25);
    --mango-gradient-soft: linear-gradient(135deg, rgba(255, 122, 26, 0.1) 0%, rgba(255, 78, 106, 0.06) 50%, rgba(255, 209, 102, 0.08) 100%);
  }
}

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

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

body {
  font-family: var(--mango-font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--mango-text);
  background-color: var(--mango-bg);
  background-image: var(--mango-gradient-soft);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--mango-transition), color var(--mango-transition);
}

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

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

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

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

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

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

a:hover {
  color: var(--mango-secondary);
}

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

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

ul,
ol {
  list-style-position: inside;
}

/* ========== HEADER ========== */
header {
  position: relative;
  padding: 0 0 40px;
  background: var(--mango-gradient);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 209, 102, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 78, 106, 0.2) 0%, transparent 60%);
  z-index: -1;
  animation: headerGlow 12s ease-in-out infinite alternate;
}

@keyframes headerGlow {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.15) rotate(3deg);
    opacity: 1;
  }
}

header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--mango-bg);
  clip-path: ellipse(75% 100% at 50% 100%);
  z-index: 1;
}

header > h1,
header > p,
header > nav {
  position: relative;
  z-index: 2;
}

header > h1 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 16px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  animation: fadeSlideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

header > p {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 28px;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.12);
  animation: fadeSlideDown 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ========== NAV ========== */
header nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 20px;
  animation: fadeSlideDown 0.8s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  justify-content: center;
}

header nav ul li {
  list-style: none;
}

header nav ul li a {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(var(--mango-blur));
  -webkit-backdrop-filter: blur(var(--mango-blur));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  transition: all var(--mango-transition);
  white-space: nowrap;
}

header nav ul li a:hover,
header nav ul li a:focus-visible {
  color: var(--mango-primary-dark);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border-color: transparent;
}

/* ========== MAIN ========== */
main {
  max-width: 1200px;
  margin: -20px auto 0;
  padding: 0 24px 60px;
  position: relative;
  z-index: 3;
}

/* ========== SECTIONS ========== */
section {
  position: relative;
  margin-bottom: 36px;
  padding: 36px 32px;
  background: var(--mango-surface);
  backdrop-filter: blur(var(--mango-blur));
  -webkit-backdrop-filter: blur(var(--mango-blur));
  border: 1px solid var(--mango-border);
  border-radius: var(--mango-radius-lg);
  box-shadow: var(--mango-shadow);
  transition: transform var(--mango-transition), box-shadow var(--mango-transition), border-color var(--mango-transition);
  opacity: 0;
  transform: translateY(40px);
  animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 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:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }
section:nth-child(13) { animation-delay: 0.65s; }
section:nth-child(14) { animation-delay: 0.7s; }
section:nth-child(15) { animation-delay: 0.75s; }
section:nth-child(16) { animation-delay: 0.8s; }

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

section:hover {
  box-shadow: var(--mango-shadow-hover);
  border-color: rgba(255, 122, 26, 0.35);
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 4px;
  background: var(--mango-gradient);
  border-radius: 0 0 4px 4px;
  opacity: 0.7;
  transition: opacity var(--mango-transition), left var(--mango-transition), right var(--mango-transition);
}

section:hover::before {
  opacity: 1;
  left: 24px;
  right: 24px;
}

/* ========== HEADINGS ========== */
h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--mango-text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  position: relative;
  letter-spacing: -0.01em;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 72px;
  height: 4px;
  background: var(--mango-gradient);
  border-radius: 4px;
  transition: width var(--mango-transition);
}

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

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

h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 4px;
  background: var(--mango-gradient);
  border-radius: 4px;
}

h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mango-text);
  margin: 18px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--mango-primary-light);
}

/* ========== PARAGRAPHS & TEXT ========== */
p {
  margin-bottom: 14px;
  color: var(--mango-text-soft);
  line-height: 1.85;
}

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

strong {
  color: var(--mango-text);
  font-weight: 700;
}

/* ========== LISTS ========== */
section ul,
section ol {
  margin: 12px 0 18px;
  padding-left: 8px;
}

section ul li,
section ol li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--mango-text-soft);
  line-height: 1.7;
  list-style: none;
  transition: color var(--mango-transition), transform var(--mango-transition);
}

section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.1em;
  width: 10px;
  height: 10px;
  background: var(--mango-gradient);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform var(--mango-transition), box-shadow var(--mango-transition);
}

section ul li:hover {
  color: var(--mango-text);
  transform: translateX(4px);
}

section ul li:hover::before {
  transform: translateY(-50%) scale(1.3);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15);
}

section ol {
  counter-reset: mango-counter;
}

section ol li {
  counter-increment: mango-counter;
  padding-left: 40px;
}

section ol li::before {
  content: counter(mango-counter);
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--mango-gradient);
  border-radius: 50%;
  line-height: 1;
  transition: transform var(--mango-transition), box-shadow var(--mango-transition);
}

section ol li:hover {
  color: var(--mango-text);
  transform: translateX(4px);
}

section ol li:hover::before {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15);
}

/* ========== ARTICLE CARDS ========== */
#articles {
  background: var(--mango-surface);
}

#articles article {
  position: relative;
  margin-bottom: 20px;
  padding: 24px 26px;
  background: var(--mango-surface-solid);
  border: 1px solid var(--mango-border);
  border-radius: var(--mango-radius);
  box-shadow: 0 4px 16px rgba(255, 122, 26, 0.06);
  transition: all var(--mango-transition);
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--mango-gradient);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--mango-transition);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--mango-shadow-hover);
  border-color: rgba(255, 122, 26, 0.4);
}

#articles article:hover::before {
  transform: scaleY(1);
}

#articles article h3 {
  margin-top: 0;
  color: var(--mango-text);
  font-size: 1.1rem;
}

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

#articles article h3 {
  padding-left: 0;
}

#articles article p:first-of-type {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mango-primary-dark);
  background: rgba(255, 122, 26, 0.1);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

#articles article p:last-child {
  margin-top: 12px;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--mango-primary-dark);
  padding: 6px 0;
  position: relative;
}

#articles article a::after {
  content: "→";
  transition: transform var(--mango-transition);
  display: inline-block;
}

#articles article a:hover::after {
  transform: translateX(5px);
}

/* ========== FAQ ========== */
#faq h3 {
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--mango-surface-solid);
  border: 1px solid var(--mango-border);
  border-radius: var(--mango-radius-sm);
  border-left: 4px solid var(--mango-primary);
  color: var(--mango-text);
  font-size: 1rem;
  transition: all var(--mango-transition);
  cursor: default;
}

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

#faq h3:hover {
  background: rgba(255, 122, 26, 0.06);
  border-left-color: var(--mango-secondary);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(255, 122, 26, 0.1);
}

#faq p {
  padding: 12px 18px 4px;
  margin-bottom: 0;
}

/* ========== BLOCKQUOTE ========== */
blockquote {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--mango-gradient-soft);
  border-left: 4px solid var(--mango-primary);
  border-radius: var(--mango-radius-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--mango-transition);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: -10px;
  right: 16px;
  font-size: 5rem;
  font-family: Georgia, serif;
  color: var(--mango-primary);
  opacity: 0.15;
  line-height: 1;
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(255, 122, 26, 0.12);
}

blockquote p {
  margin-bottom: 8px;
  font-style: italic;
  color: var(--mango-text);
  position: relative;
  z-index: 1;
}

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

/* ========== CONTACT / HOWTO SPECIAL ========== */
#contact p {
  padding: 6px 0;
  border-bottom: 1px dashed var(--mango-border);
}

#contact p:last-child {
  border-bottom: none;
}

#howto ol li {
  padding-top: 10px;
  padding-bottom: 10px;
}

#howto ul li {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ========== SITEMAP / LINKS ========== */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li,
#links ul li {
  padding: 0;
  list-style: none;
}

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

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mango-text-soft);
  background: var(--mango-surface-solid);
  border: 1px solid var(--mango-border);
  border-radius: 999px;
  transition: all var(--mango-transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: var(--mango-gradient);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 122, 26, 0.3);
}

/* ========== FOOTER ========== */
footer {
  position: relative;
  padding: 48px 24px 36px;
  background: var(--mango-gradient);
  color: #fff;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 209, 102, 0.2) 0%, transparent 50%);
  z-index: -1;
}

footer p {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  line-height: 1.7;
}

footer p:first-child {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

footer p:last-child {
  margin-bottom: 0;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--mango-accent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  header > h1 {
    padding: 48px 20px 14px;
  }

  header > p {
    padding: 0 20px 24px;
  }

  header nav {
    padding: 0 20px 16px;
  }

  main {
    padding: 0 20px 48px;
  }

  section {
    padding: 28px 24px;
    border-radius: var(--mango-radius);
  }

  section::before {
    left: 24px;
    right: 24px;
  }

  section:hover::before {
    left: 18px;
    right: 18px;
  }
}

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

  body {
    font-size: 15px;
  }

  header {
    padding-bottom: 28px;
  }

  header > h1 {
    padding: 36px 16px 12px;
    font-size: 1.5rem;
  }

  header > p {
    padding: 0 16px 20px;
    font-size: 0.88rem;
  }

  header nav {
    padding: 0 16px 12px;
  }

  header nav ul {
    gap: 8px;
  }

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

  main {
    padding: 0 14px 40px;
    margin-top: -14px;
  }

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

  section::before {
    left: 18px;
    right: 18px;
    height: 3px;
  }

  section:hover::before {
    left: 14px;
    right: 14px;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  h2::after {
    width: 56px;
    height: 3px;
  }

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

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

  section ul li,
  section ol li {
    font-size: 0.88rem;
    padding-top: 6px;
    padding-bottom: 6px;
  }

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

  #articles article h3 {
    font-size: 1rem;
  }

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

  #faq p {
    padding: 10px 14px 4px;
    font-size: 0.86rem;
  }

  blockquote {
    padding: 16px 18px;
  }

  blockquote p {
    font-size: 0.88rem;
  }

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

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

  footer p {
    font-size: 0.82rem;
  }

  footer p:first-child {
    font-size: 0.95rem;
  }
}

@media (max-width: 400px) {
  header nav ul li a {
    padding: 7px 11px;
    font-size: 0.78rem;
  }

  section {
    padding: 18px 14px;
  }

  h2 {
    font-size: 1.1rem;
  }
}

/* ========== REDUCED MOTION ========== */
@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;
  }
}

/* ========== PRINT ========== */
@media print {
  header {
    background: #fff;
    color: #000;
  }

  header::after,
  header::before {
    display: none;
  }

  header > h1,
  header > p {
    color: #000;
    text-shadow: none;
  }

  header nav ul li a {
    color: #000;
    background: transparent;
    border-color: #ccc;
  }

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

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

  footer p {
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}