:root {
  --brand: #8B1A3A;
  --brand-light: #B33A5E;
  --brand-dark: #5E0F26;
  --accent: #E8A0B4;
  --bg: #FBF7F8;
  --bg-alt: #F3EAED;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --text: #2A1A20;
  --text-soft: #6B5560;
  --text-mute: #9A8790;
  --border: rgba(139, 26, 58, 0.12);
  --shadow: 0 8px 30px rgba(139, 26, 58, 0.08);
  --shadow-lg: 0 20px 60px rgba(139, 26, 58, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --gradient: linear-gradient(135deg, #8B1A3A 0%, #B33A5E 45%, #D96A8C 100%);
  --gradient-soft: linear-gradient(135deg, rgba(139, 26, 58, 0.08), rgba(217, 106, 140, 0.06));
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #E86A8E;
    --brand-light: #F08BA8;
    --brand-dark: #B33A5E;
    --accent: #F5B8C8;
    --bg: #140A0E;
    --bg-alt: #1C0F15;
    --surface: rgba(38, 22, 30, 0.66);
    --surface-solid: #22121A;
    --text: #F5E8EC;
    --text-soft: #C4A9B4;
    --text-mute: #8E727E;
    --border: rgba(232, 106, 142, 0.18);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --gradient: linear-gradient(135deg, #5E0F26 0%, #8B1A3A 45%, #B33A5E 100%);
    --gradient-soft: linear-gradient(135deg, rgba(232, 106, 142, 0.1), rgba(139, 26, 58, 0.06));
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(179, 58, 94, 0.10), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(217, 106, 140, 0.10), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(139, 26, 58, 0.06), transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease);
}

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

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

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

/* ============ HEADER ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(139, 26, 58, 0.05);
}

header nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  flex-wrap: wrap;
}

header nav > a {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  position: relative;
}

header nav > a::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 4px 14px rgba(139, 26, 58, 0.35);
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

header nav > a:hover::before {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 6px 20px rgba(139, 26, 58, 0.5);
}

header nav > a:hover {
  color: var(--brand);
}

header ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

header ul li a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  position: relative;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}

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

header ul li a:hover {
  color: var(--brand);
  background: var(--gradient-soft);
  transform: translateY(-1px);
}

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

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 40px;
}

main > section {
  margin: 32px 0;
  padding: 40px 40px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  animation: sectionIn 0.8s var(--ease) forwards;
  transition: box-shadow 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.45s var(--ease);
}

main > section:nth-child(1) { animation-delay: 0.02s; }
main > section:nth-child(2) { animation-delay: 0.06s; }
main > section:nth-child(3) { animation-delay: 0.10s; }
main > section:nth-child(4) { animation-delay: 0.14s; }
main > section:nth-child(5) { animation-delay: 0.18s; }
main > section:nth-child(6) { animation-delay: 0.22s; }
main > section:nth-child(7) { animation-delay: 0.26s; }
main > section:nth-child(8) { animation-delay: 0.30s; }
main > section:nth-child(9) { animation-delay: 0.34s; }
main > section:nth-child(10) { animation-delay: 0.38s; }
main > section:nth-child(11) { animation-delay: 0.42s; }
main > section:nth-child(12) { animation-delay: 0.46s; }
main > section:nth-child(13) { animation-delay: 0.50s; }

main > section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0.85;
  border-radius: var(--radius) var(--radius) 0 0;
}

main > section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(139, 26, 58, 0.22);
}

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

/* ============ HERO / BANNER ============ */
#home {
  margin-top: 28px;
  padding: 64px 48px;
  background: var(--gradient);
  border: none;
  color: #fff;
  border-radius: calc(var(--radius) + 8px);
  box-shadow: 0 24px 70px rgba(139, 26, 58, 0.35);
  isolation: isolate;
  text-align: left;
}

#home::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.28), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.14), transparent 50%);
  z-index: -1;
  pointer-events: none;
}

#home::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -10%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 65%);
  z-index: -1;
  animation: floatOrb 12s ease-in-out infinite;
  pointer-events: none;
}

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

#home h1 {
  margin: 0 0 20px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.18);
}

#home p {
  margin: 0;
  max-width: 820px;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

/* ============ HEADINGS ============ */
main h2 {
  margin: 0 0 24px;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.35;
  position: relative;
  padding-left: 18px;
}

main h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1.1em;
  border-radius: 4px;
  background: var(--gradient);
  box-shadow: 0 2px 10px rgba(139, 26, 58, 0.3);
}

main h3 {
  margin: 28px 0 12px;
  font-size: clamp(1.08rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1.5;
  letter-spacing: 0.005em;
  transition: color 0.3s var(--ease);
}

main h4 {
  margin: 20px 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}

main h4::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(139, 26, 58, 0.12);
}

main p {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.85;
}

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

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

/* ============ ARTICLE CARDS ============ */
#articles {
  display: block;
}

#articles > p:first-of-type {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--gradient-soft);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.94rem;
}

#articles article {
  margin: 0 0 18px;
  padding: 24px 26px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(139, 26, 58, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

#articles article::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(139, 26, 58, 0.24);
}

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

#articles article h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  color: var(--text);
}

#articles article:hover h3 {
  color: var(--brand);
}

#articles article > p:nth-of-type(1) {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--gradient-soft);
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

#articles article > p:nth-of-type(2) {
  margin: 0 0 14px;
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--text-soft);
}

#articles article > p:last-child {
  margin: 0;
}

#articles article > p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(139, 26, 58, 0.28);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

#articles article > p:last-child a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

#articles article > p:last-child a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(139, 26, 58, 0.42);
  filter: brightness(1.06);
}

#articles article > p:last-child a:hover::after {
  transform: translateX(4px);
}

/* ============ FAQ ============ */
#faq h3 {
  margin: 0 0 10px;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  padding-right: 48px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

#faq h3::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--brand);
  line-height: 1;
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

#faq h3:hover {
  background: var(--gradient-soft);
  border-color: rgba(139, 26, 58, 0.28);
  box-shadow: 0 4px 16px rgba(139, 26, 58, 0.08);
  transform: translateX(3px);
}

#faq h3:hover::after {
  transform: translateY(-50%) rotate(90deg);
}

#faq p {
  margin: 0 0 18px;
  padding: 0 20px 0 22px;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-soft);
  border-left: 2px solid var(--border);
  margin-left: 6px;
}

/* ============ HOWTO ============ */
#howto h3 {
  padding: 14px 20px;
  margin: 24px 0 12px;
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  color: var(--brand);
  border: 1px solid var(--border);
}

#howto h4 {
  counter-increment: howto-step;
  padding: 14px 18px 14px 54px;
  margin: 12px 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#howto {
  counter-reset: howto-step;
}

#howto h4::before {
  content: counter(howto-step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(139, 26, 58, 0.3);
}

#howto h4:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(139, 26, 58, 0.1);
  border-color: rgba(139, 26, 58, 0.24);
}

#howto h4 + p {
  margin: 0 0 16px;
  padding-left: 54px;
  font-size: 0.94rem;
}

/* ============ CONTACT ============ */
#contact h3 {
  margin-top: 26px;
}

#contact p {
  padding: 18px 22px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 2;
  font-size: 0.95rem;
  color: var(--text-soft);
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#contact p:hover {
  box-shadow: 0 6px 22px rgba(139, 26, 58, 0.08);
  border-color: rgba(139, 26, 58, 0.24);
}

#contact a {
  font-weight: 600;
  border-bottom: 1px dashed var(--brand);
}

/* ============ SITEMAP & LINKS ============ */
#sitemap ul,
#links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 14px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#sitemap ul li a::before,
#links ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  z-index: -1;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(139, 26, 58, 0.28);
}

#sitemap ul li a:hover::before,
#links ul li a:hover::before {
  opacity: 1;
}

/* ============ LEGAL ============ */
#legal h2 {
  margin-top: 28px;
  font-size: 1.15rem;
}

#legal h2:first-child {
  margin-top: 0;
}

#legal p {
  padding: 16px 20px;
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  border: 1px solid var(--border);
}

/* ============ FOOTER ============ */
footer {
  margin-top: 48px;
  padding: 48px 24px 40px;
  background: linear-gradient(180deg, transparent, rgba(139, 26, 58, 0.06));
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--gradient);
}

footer p {
  margin: 0 auto 10px;
  max-width: 760px;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-mute);
}

footer p:first-child {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

footer p:last-child {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-mute);
}

/* ============ SCROLL REVEAL (progressive enhancement) ============ */
@media (prefers-reduced-motion: no-preference) {
  main > section {
    will-change: opacity, transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  main > section {
    opacity: 1;
    transform: none;
    animation: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  header nav {
    padding: 10px 18px;
    min-height: auto;
    gap: 10px;
  }

  header ul {
    gap: 2px;
    padding: 4px 0;
    width: 100%;
    justify-content: flex-start;
  }

  header ul li a {
    padding: 6px 11px;
    font-size: 0.84rem;
  }

  main {
    padding: 0 16px 32px;
  }

  main > section {
    padding: 30px 24px;
    margin: 24px 0;
    border-radius: var(--radius-sm);
  }

  #home {
    padding: 44px 28px;
    margin-top: 20px;
  }
}

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

  html {
    scroll-padding-top: 120px;
  }

  header nav > a {
    font-size: 1.12rem;
  }

  header ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
  }

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

  header ul li a {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  #home {
    padding: 36px 22px;
    border-radius: var(--radius);
  }

  #home h1 {
    font-size: 1.45rem;
    margin-bottom: 14px;
  }

  main > section {
    padding: 24px 18px;
    margin: 18px 0;
  }

  main h2 {
    font-size: 1.22rem;
    padding-left: 14px;
    margin-bottom: 18px;
  }

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

  main h3 {
    font-size: 1.02rem;
    margin-top: 22px;
  }

  main p {
    font-size: 0.93rem;
  }

  #articles article {
    padding: 18px 18px;
  }

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

  #faq h3 {
    padding: 14px 44px 14px 16px;
    font-size: 0.94rem;
  }

  #faq p {
    padding: 0 8px 0 14px;
    font-size: 0.9rem;
  }

  #howto h4 {
    padding: 12px 14px 12px 48px;
    font-size: 0.94rem;
  }

  #howto h4::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.76rem;
  }

  #howto h4 + p {
    padding-left: 14px;
    font-size: 0.9rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 11px 10px;
    font-size: 0.85rem;
  }

  #contact p {
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  footer {
    padding: 36px 18px 30px;
  }

  footer p {
    font-size: 0.82rem;
  }

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

@media (max-width: 380px) {
  main > section {
    padding: 20px 14px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }
}

/* ============ HOVER CAPABILITY GUARD ============ */
@media (hover: none) {
  main > section:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
  }

  #articles article:hover {
    transform: none;
  }

  #articles article:hover::after {
    transform: scaleY(0);
  }

  #sitemap ul li a:hover,
  #links ul li a:hover {
    transform: none;
  }
}