:root {
  --bg: #f7f4f1;
  --bg-alt: #ffffff;
  --text: #1a1a1a;
  --text-soft: #5c5652;
  --accent: #c45c6a;
  --accent-dark: #9e3f4d;
  --line: #e6dfd8;
  --header: #1f1c1b;
  --max: 1120px;
  --radius: 6px;
  --shadow: 0 8px 28px rgba(31, 28, 27, 0.08);
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, rgba(196, 92, 106, 0.08), transparent 45%),
    linear-gradient(180deg, #faf7f4 0%, var(--bg) 40%, #f3efe9 100%);
  line-height: 1.75;
  min-height: 100vh;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

/* Header */
.site-header {
  background: var(--header);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--accent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.logo:hover {
  color: #fff;
  text-decoration: none;
  opacity: 0.92;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}

.nav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: clamp(320px, 52vh, 520px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #1f1c1b center/cover no-repeat;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 15, 0.25) 0%, rgba(20, 16, 15, 0.78) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 48px 0 40px;
  max-width: 720px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

.hero p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 22px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-left: 10px;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section.alt {
  background: rgba(255, 255, 255, 0.55);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.section-head p {
  color: var(--text-soft);
  max-width: 720px;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  margin: 1.6em 0 0.7em;
  line-height: 1.35;
}

.prose h2 {
  font-size: 1.55rem;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.prose h3 {
  font-size: 1.2rem;
}

.prose p {
  margin-bottom: 1em;
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em 1.3em;
  color: var(--text-soft);
}

.prose li {
  margin-bottom: 0.45em;
}

.lead {
  font-size: 1.08rem;
  color: var(--text-soft);
}

/* Grids */
.grid-3,
.grid-2,
.grid-4,
.grid-6 {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

.media-item {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.media-item:hover {
  transform: translateY(-4px);
}

.media-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #ddd;
}

.media-item .cap {
  padding: 14px 16px 16px;
}

.media-item .cap h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  font-family: var(--font-display);
}

.media-item .cap p {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.feature-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 40px;
}

.feature-row.reverse {
  grid-template-columns: 0.9fr 1.1fr;
}

.feature-row.reverse .feature-text {
  order: 2;
}

.feature-row img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feature-text h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.feature-text p {
  color: var(--text-soft);
  margin-bottom: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-list span {
  background: #f1e6e8;
  color: var(--accent-dark);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.toc {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0 32px;
}

.toc h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  border: none;
  padding: 0;
}

.toc ol {
  margin-left: 1.2em;
}

.toc a {
  text-decoration: none;
}

.page-hero {
  padding: 40px 0 20px;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 10px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--text-soft);
}

.content-box {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.related {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.related h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.related ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.faq details {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin-top: 10px;
  color: var(--text-soft);
}

/* Footer */
.site-footer {
  background: var(--header);
  color: rgba(255, 255, 255, 0.82);
  padding: 40px 0 24px;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.site-footer h3 {
  color: #fff;
  font-family: var(--font-display);
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  margin-bottom: 8px;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Error pages */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 60px 0;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.error-page h2 {
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-soft);
  margin-bottom: 24px;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .media-item,
  .feature-row img,
  .btn {
    animation: fadeUp 0.6s ease both;
  }

  .media-item:nth-child(2) { animation-delay: 0.05s; }
  .media-item:nth-child(3) { animation-delay: 0.1s; }
  .media-item:nth-child(4) { animation-delay: 0.15s; }
  .media-item:nth-child(5) { animation-delay: 0.2s; }
  .media-item:nth-child(6) { animation-delay: 0.25s; }

  .hero-content {
    animation: fadeUp 0.7s ease both;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: min(220px, calc(100vw - 32px));
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 4px;
    background: #1f1c1b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    z-index: 120;
  }

  .nav.open {
    display: flex;
    position: absolute;
  }

  .nav a {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .nav a:hover,
  .nav a.active {
    border-bottom-color: transparent;
    background: rgba(196, 92, 106, 0.18);
    border-radius: 4px;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .grid-3,
  .grid-4,
  .grid-6,
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .feature-text {
    order: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .btn-outline {
    margin-left: 0;
    margin-top: 10px;
  }

  .hero-content .btn,
  .hero-content .btn-outline {
    display: inline-block;
  }

  .content-box {
    padding: 20px 16px;
  }
}

@media (max-width: 560px) {
  .grid-3,
  .grid-4,
  .grid-6,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 300px;
  }

  .section {
    padding: 40px 0;
  }
}
