:root {
  --bg: #0c0c0f;
  --bg-soft: #14141a;
  --bg-card: #1a1a22;
  --text: #f2f2f5;
  --text-muted: #a8a8b3;
  --accent: #e11d48;
  --accent-soft: #fb7185;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1180px;
  --radius: 12px;
  --font-display: "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(225, 29, 72, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(251, 113, 133, 0.08), transparent 50%),
    linear-gradient(180deg, #0c0c0f 0%, #121218 100%);
  background-attachment: fixed;
}

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% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(12, 12, 15, 0.86);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  position: relative;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 3rem;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  animation: heroZoom 18s ease-in-out infinite alternate;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 12, 15, 0.35) 0%,
    rgba(12, 12, 15, 0.55) 40%,
    rgba(12, 12, 15, 0.96) 100%
  );
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0 3rem;
  max-width: 720px;
  animation: fadeUp 0.9s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: #fff;
}

.hero-brand span {
  color: var(--accent-soft);
}

.hero h1 {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 1.5rem;
  max-width: 36em;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.35);
}

.btn-primary:hover {
  background: #be123c;
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Sections */
.section {
  padding: 2.75rem 0;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.section-head p {
  color: var(--text-muted);
  max-width: 42em;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.media-block {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.media-block:hover {
  transform: translateY(-4px);
  border-color: rgba(225, 29, 72, 0.4);
}

.media-block img {
  width: 100%;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  object-position: top;
}

.media-block.wide img {
  aspect-ratio: 16 / 10;
}

.media-block figcaption {
  padding: 0.85rem 1rem 1.05rem;
}

.media-block h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.media-block p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.prose {
  color: var(--text-muted);
}

.prose h2,
.prose h3 {
  color: var(--text);
  font-family: var(--font-display);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.35;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.15rem;
}

.prose p {
  margin-bottom: 1rem;
  text-align: justify;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem 1.25rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.feature-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem;
  align-items: center;
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature-row.reverse {
  grid-template-columns: 0.95fr 1.05fr;
}

.feature-row.reverse .feature-text {
  order: 2;
}

.feature-row img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  object-position: top;
  max-height: 480px;
}

.feature-text h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
}

.feature-text p {
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag-list a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.28);
  border-radius: 6px;
  color: var(--accent-soft);
  font-size: 0.85rem;
}

.tag-list a:hover {
  background: rgba(225, 29, 72, 0.25);
  color: #fff;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.12), rgba(20, 20, 26, 0.9));
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
}

.highlight-box h3 {
  margin-top: 0;
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-muted);
  max-width: 40em;
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-soft);
}

/* Error pages */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
  background: #09090b;
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  color: #fff;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.45rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent-soft);
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.toc h2 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-body);
}

.toc ol {
  margin-left: 1.1rem;
  color: var(--text-muted);
}

.toc a {
  color: var(--text-muted);
}

.toc a:hover {
  color: var(--accent-soft);
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-media img,
  .hero-content,
  .media-block {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .feature-text {
    order: 0;
  }

  .feature-row img {
    max-height: 420px;
    margin-inline: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(12, 12, 15, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid var(--line);
  }

  .header-inner {
    position: relative;
  }

  .hero {
    min-height: 72vh;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .media-block img {
    aspect-ratio: 9 / 13;
    max-height: 520px;
    margin-inline: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .prose p {
    text-align: left;
  }
}
