:root {
  --bg: #0f0f12;
  --bg-soft: #1a1a22;
  --bg-card: #22222c;
  --bg-light: #f7f5f6;
  --text: #f5f0f2;
  --text-muted: #a8a0a6;
  --text-dark: #1c1618;
  --text-body: #3d3438;
  --brand: #e11d48;
  --brand-soft: #fb7185;
  --brand-deep: #9f1239;
  --line: rgba(255, 255, 255, 0.08);
  --line-dark: rgba(28, 22, 24, 0.1);
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font-display: "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-soft);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #fff;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* Sticky ads bar under header */
.ads-bar {
  position: sticky;
  top: 68px;
  z-index: 99;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

#ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  background: transparent;
  margin: 0;
  padding: 8px 10px 6px;
  min-height: 0;
}

#ads:empty {
  display: none;
}

#ads > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  box-sizing: border-box;
}

#ads figure {
  margin: 0;
}

#ads img {
  width: 65px;
  height: 65px;
  max-width: none;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(24, 24, 24, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: block;
  border: none;
  background: linear-gradient(135deg, #fff, #fff);
}

#ads a {
  display: inline-block;
  text-decoration: none;
  border-radius: 15px;
  color: inherit;
}

#ads img:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 24px rgba(24, 24, 24, 0.18);
}

#ads figcaption,
#ads .caption {
  height: 15px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.brand-name span {
  color: var(--brand-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav a {
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(225, 29, 72, 0.18);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(15, 15, 18, 0.82), rgba(15, 15, 18, 0.45)),
    url("/featured.jpg") center/cover no-repeat;
  z-index: -1;
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.08) translateY(-1.5%); }
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: 999px;
  color: var(--brand-soft);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.25;
  font-weight: 700;
  max-width: 16ch;
  animation: fadeUp 0.8s ease 0.08s both;
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  color: var(--text-muted);
  font-size: 1.08rem;
  animation: fadeUp 0.8s ease 0.16s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fadeUp 0.8s ease 0.24s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 10px 28px rgba(225, 29, 72, 0.35);
}

.btn-primary:hover {
  color: #fff;
  opacity: 0.92;
}

.btn-ghost {
  border-color: var(--line);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fff;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-light {
  background: var(--bg);
  color: var(--text);
}

.section-light a {
  color: var(--brand-soft);
}

.section-light a:hover {
  color: #fff;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.3;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  max-width: 46rem;
}

.section-light .section-head p {
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  color: var(--brand-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.section-light .eyebrow {
  color: var(--brand-soft);
}

/* Cards / grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 113, 133, 0.35);
}

.section-light .card {
  background: var(--bg-card);
  border-color: var(--line);
  box-shadow: none;
}

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-body {
  padding: 1rem 1.05rem 1.15rem;
}

.card-body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.section-light .card-body p {
  color: var(--text-muted);
}

.card-body a {
  font-weight: 600;
}

/* Content article */
.article {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: none;
}

.article h2,
.article h3 {
  font-family: var(--font-display);
  line-height: 1.35;
  scroll-margin-top: 90px;
  color: var(--text);
}

.article h2 {
  margin: 2.2rem 0 0.9rem;
  font-size: 1.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid rgba(225, 29, 72, 0.2);
}

.article h2:first-child {
  margin-top: 0;
}

.article h3 {
  margin: 1.6rem 0 0.7rem;
  font-size: 1.2rem;
}

.article p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.article ul,
.article ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.article li {
  margin-bottom: 0.45rem;
}

.article a {
  color: var(--brand-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.toc strong {
  display: block;
  margin-bottom: 0.55rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc a {
  text-decoration: none;
  color: var(--brand-soft);
}

.inline-figure {
  margin: 1.4rem 0;
  border-radius: 14px;
  overflow: hidden;
}

.inline-figure img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.inline-figure figcaption {
  padding: 0.7rem 0.2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.callout {
  border-left: 4px solid var(--brand);
  background: var(--bg-soft);
  padding: 1rem 1.1rem;
  border-radius: 0 12px 12px 0;
  margin: 1.25rem 0;
}

.callout p {
  margin: 0;
  color: var(--text-muted);
}

/* Feature list */
.feature-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
}

.feature-row.reverse {
  grid-template-columns: 0.9fr 1.1fr;
}

.feature-row.reverse .feature-text {
  order: 2;
}

.feature-media {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.feature-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: #fff;
}

/* Error pages */
.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  color: var(--brand-soft);
  margin: 0;
}

.error-page h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.6rem;
}

.error-page p {
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  background: var(--bg);
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  color: #fff;
  font-weight: 700;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-footer p,
.site-footer li {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.4rem;
}

.site-footer h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.age-note {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: 8px;
  color: var(--brand-soft);
  font-size: 0.82rem;
}

/* Mobile */
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .feature-text {
    order: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem 1rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 0.8rem 0.9rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2.5rem 0;
  }

  .article {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
