:root {
  --bg: #0c0c0e;
  --bg-soft: #141418;
  --bg-elevated: #1a1a20;
  --text: #f2f0ec;
  --text-muted: #a8a29a;
  --accent: #e23d4a;
  --accent-soft: #ff6b76;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1120px;
  --radius: 12px;
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(226, 61, 74, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(255, 107, 118, 0.08), transparent 50%),
    linear-gradient(180deg, #101014 0%, var(--bg) 35%, #0a0a0c 100%);
  background-attachment: fixed;
  line-height: 1.75;
  font-size: 16px;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(12, 12, 14, 0.82);
  border-bottom: 1px solid var(--line);
}

#site-ads-wrap {
  position: sticky;
  top: 64px;
  z-index: 99;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 56px 0 40px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero-copy .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 28px;
  max-width: 36em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c42936);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.hero-visual {
  position: relative;
}

.hero-visual img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: floatIn 0.9s ease both;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto -8% -10% 20%;
  height: 40%;
  background: radial-gradient(circle, rgba(226, 61, 74, 0.35), transparent 70%);
  z-index: -1;
  filter: blur(20px);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  animation: rise 0.7s ease both;
}

/* Sections */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 28px;
  max-width: 42em;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  margin: 0 0 10px;
  font-weight: 400;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

.prose {
  color: var(--text-muted);
}

.prose p {
  margin: 0 0 1.1em;
}

.prose h3 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 1.8em 0 0.7em;
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
  margin: 0 0 1.2em;
}

.prose li {
  margin-bottom: 0.45em;
}

/* Media grids */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.media-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.media-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.media-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.media-item:hover {
  border-color: rgba(226, 61, 74, 0.45);
  transform: translateY(-3px);
}

.media-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  background: #111;
}

.media-item.landscape img {
  aspect-ratio: 16 / 10;
}

.media-item figcaption {
  padding: 12px 14px 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.media-item figcaption strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 600;
}

/* Feature list */
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature {
  padding: 20px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 400;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* TOC / internal links */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
}

.toc a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.02);
}

.toc a:hover {
  color: var(--text);
  border-color: rgba(226, 61, 74, 0.4);
}

/* Breadcrumb */
.breadcrumb {
  padding: 20px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

/* Page hero for inner pages */
.page-hero {
  padding: 36px 0 12px;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0 0 12px;
  font-weight: 400;
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 40em;
}

.content-wrap {
  padding: 24px 0 64px;
}

.content-wrap .prose {
  max-width: 48em;
}

/* Error pages */
.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 16px;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 8px;
  color: var(--accent);
}

.error-page h2 {
  margin: 0 0 12px;
  font-weight: 500;
}

.error-page p {
  color: var(--text-muted);
  margin: 0 0 24px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
  background: rgba(0, 0, 0, 0.35);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.footer-grid p,
.footer-grid a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-grid h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copyright {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Related links block */
.related {
  margin-top: 40px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.related h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
}

.related ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-muted);
}

.related li {
  margin-bottom: 6px;
}

/* Mobile */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .media-grid,
  .media-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .menu-toggle:hover {
    border-color: rgba(226, 61, 74, 0.45);
    color: #fff;
  }

  .nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #15151a;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .nav a:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .header-inner {
    position: relative;
  }
}

@media (max-width: 560px) {
  .media-grid.cols-2,
  .media-grid,
  .media-grid.cols-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .media-item figcaption {
    padding: 10px;
    font-size: 0.82rem;
  }

  .section {
    padding: 40px 0;
  }

  body {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
