/* 糖心内容中心 - tangxing.live */
:root {
  --bg: #0f0e10;
  --bg-soft: #1a171c;
  --bg-card: #221e24;
  --text: #f4eef2;
  --muted: #b8a8b0;
  --accent: #e83e6a;
  --accent-soft: #ff6b8a;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1120px;
  --radius: 14px;
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", "Songti 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(1200px 600px at 10% -10%, rgba(232, 62, 106, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(120, 40, 70, 0.28), transparent 50%),
    linear-gradient(180deg, #141116 0%, var(--bg) 40%, #120f13 100%);
  line-height: 1.75;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
}

a:hover {
  color: #fff;
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(15, 14, 16, 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: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent-soft);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 14, 16, 0.92) 28%, rgba(15, 14, 16, 0.55) 58%, rgba(15, 14, 16, 0.35)),
    url("/o.jpg") center / cover no-repeat;
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.hero-content {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem);
  max-width: 640px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 400;
}

.hero .lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c2184a);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Sections */
.section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--line);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 400;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.section h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
  color: #ffe6ee;
}

.section p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.section p strong,
.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose {
  color: var(--muted);
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li::marker {
  color: var(--accent);
}

/* Media layouts */
.media-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  margin-top: 1.5rem;
}

.media-split.reverse {
  grid-template-columns: 0.95fr 1.05fr;
}

.media-split.reverse .media-copy {
  order: 2;
}

.shot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.shot img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
}

.shot.landscape img {
  aspect-ratio: 4 / 5;
}

.shot figcaption {
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.grid-3,
.grid-4,
.grid-2 {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(232, 62, 106, 0.45);
  transform: translateY(-3px);
}

.feature-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
}

.feature-card .body {
  padding: 0.9rem 1rem 1.1rem;
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.tag {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.03);
}

.highlight-box {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 62, 106, 0.35);
  background: linear-gradient(135deg, rgba(232, 62, 106, 0.12), rgba(255, 255, 255, 0.02));
}

.highlight-box p {
  margin: 0;
}

.inline-links a {
  margin-right: 0.75rem;
}

/* Page header for inner pages */
.page-hero {
  padding: clamp(2.2rem, 5vw, 3.5rem) 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.6rem;
  font-weight: 400;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 48rem;
}

.article {
  padding: clamp(2rem, 4vw, 3rem) 0 3.5rem;
}

.article .shot {
  margin: 1.25rem 0 1.5rem;
}

/* Error pages */
.error-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 0.5rem;
  color: var(--accent-soft);
}

.error-wrap p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 2rem;
  background: #0b0a0c;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.site-footer h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
}

.copyright {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: #7e6f76;
  font-size: 0.85rem;
}

/* Fade-in on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 900px) {
  .media-split,
  .media-split.reverse {
    grid-template-columns: 1fr;
  }

  .media-split.reverse .media-copy {
    order: 0;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: nowrap;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0 1rem;
    gap: 0.65rem;
    background: rgba(15, 14, 16, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    z-index: 60;
    box-sizing: border-box;
  }

  .site-nav.open {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .shot img,
  .feature-card img {
    aspect-ratio: 3 / 4;
  }
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-content {
    max-width: none;
  }
}
