/* 同伴童年 — tongban.site */
:root {
  --ink: #1c2a24;
  --ink-soft: #3d4f45;
  --muted: #6b7a70;
  --paper: #f3f6f2;
  --paper-deep: #e8eee7;
  --leaf: #3a6b52;
  --leaf-deep: #2a4f3c;
  --mist: #d4e2d8;
  --dawn: #f0ebe0;
  --line: rgba(28, 42, 36, 0.1);
  --radius: 4px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-display: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(58, 107, 82, 0.15);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--leaf);
  text-decoration: none;
}

a:active {
  opacity: 0.75;
}

/* Atmosphere */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(212, 226, 216, 0.9), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 20%, rgba(240, 235, 224, 0.7), transparent 50%),
    linear-gradient(180deg, #f7f9f5 0%, var(--paper) 40%, #eef3ec 100%);
}

.bg-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233a6b52' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.wrap {
  width: min(100% - 2rem, 680px);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(0.75rem + var(--safe-t)) 0 0.75rem;
  background: rgba(243, 246, 242, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(28, 42, 36, 0.04);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--leaf-deep);
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: rgba(247, 249, 245, 0.98);
  border-bottom: 1px solid var(--line);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.site-nav.is-open {
  max-height: 320px;
}

.site-nav ul {
  list-style: none;
  padding: 0.5rem 1rem 1rem;
  width: min(100%, 680px);
  margin-inline: auto;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}

.site-nav li:last-child a {
  border-bottom: none;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--leaf-deep);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.site-nav a.is-active .nav-icon {
  opacity: 1;
}

/* Hero */
.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  font-weight: 700;
  color: var(--leaf-deep);
  letter-spacing: 0.18em;
  line-height: 1.15;
  margin-bottom: 1rem;
  opacity: 0;
  animation: rise 0.8s ease 0.1s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  opacity: 0;
  animation: rise 0.8s ease 0.25s forwards;
}

.hero-lead {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 22em;
  margin-inline: auto;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: rise 0.8s ease 0.4s forwards;
}

.hero-visual {
  margin-top: 2rem;
  position: relative;
  opacity: 0;
  animation: rise 1s ease 0.55s forwards;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(42, 79, 60, 0.08);
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* Section header with icon */
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.section-head-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.section-head-text {
  flex: 1;
  min-width: 0;
}

.section-head-text .section-label {
  margin-bottom: 0.35rem;
}

.section-head-text .section-title {
  margin-bottom: 0.5rem;
}

.section-head-text .section-desc {
  margin-bottom: 0;
}

/* Guide banner */
.guide-banner {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(42, 79, 60, 0.06);
}

.guide-banner img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  object-position: center;
}

.page-head-with-banner {
  padding-bottom: 0;
}

.page-head-with-banner .guide-banner {
  margin-top: 1rem;
}

/* Sections */
.section {
  padding: 2.25rem 0;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--leaf);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 28em;
}

/* Dual concepts */
.concepts {
  display: grid;
  gap: 1.25rem;
}

.concept {
  padding: 1.25rem;
  border-left: 3px solid var(--leaf);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(232, 238, 231, 0.4));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.concept-illus {
  width: 100%;
  max-width: 120px;
  margin-bottom: 0.85rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.concept-illus img {
  width: 100%;
  height: auto;
  display: block;
}

.concept.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.concept:nth-child(2) {
  border-left-color: #5a7a8c;
  transition-delay: 0.12s;
}

.concept-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.concept-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  color: var(--leaf-deep);
}

.concept:nth-child(2) .concept-title {
  color: #3d5563;
}

.concept p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.concept p + p {
  margin-top: 0.65rem;
}

/* Categories */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.cat-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 7.5rem;
  padding: 1.1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: translateY(12px);
}

.cat-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.65rem;
}

.cat-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cat-item:nth-child(1) { transition-delay: 0s; }
.cat-item:nth-child(2) { transition-delay: 0.08s; }
.cat-item:nth-child(3) { transition-delay: 0.16s; }
.cat-item:nth-child(4) { transition-delay: 0.24s; }

.cat-item:active {
  transform: scale(0.98);
  background: var(--mist);
  border-color: var(--leaf);
}

.cat-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
}

.cat-hint {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Article list */
.page-head {
  padding: 1.75rem 0 1rem;
}

.page-head .crumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.page-head .crumb a {
  color: var(--muted);
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.page-head p {
  font-size: 0.9rem;
  color: var(--muted);
}

.article-list {
  list-style: none;
  padding-bottom: 2rem;
}

.article-list li {
  border-bottom: 1px solid var(--line);
}

.article-list a {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.15rem 0.15rem;
  color: var(--ink);
  transition: color 0.2s ease;
}

.article-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-deep);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  flex: 1;
  min-width: 0;
}

.article-list a:active {
  color: var(--leaf);
}

.article-meta {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

.article-excerpt {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article body */
.article-page {
  padding-bottom: 2.5rem;
}

.article-page .page-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
}

.article-page .guide-banner {
  margin-top: 1rem;
  margin-bottom: 0;
}

.prose h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--leaf);
  flex-shrink: 0;
}

.prose-tip {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  background: rgba(58, 107, 82, 0.06);
  border-radius: var(--radius);
  border: 1px solid rgba(58, 107, 82, 0.12);
}

.prose-tip-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.prose-tip p {
  margin: 0;
  font-size: 0.88rem;
  text-align: left;
}

.prose {
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin: 1.75rem 0 0.75rem;
}

.prose p {
  margin-bottom: 1rem;
  text-align: justify;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 0 0.85rem 1rem;
  border-left: 3px solid var(--mist);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.35);
}

.prose ul {
  margin: 0.5rem 0 1rem 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--leaf);
}

/* Footer */
.site-footer {
  margin-top: 1rem;
  padding: 2rem 0 calc(1.5rem + var(--safe-b));
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--leaf-deep);
  margin-bottom: 0.5rem;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.8;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:active {
  color: var(--leaf);
}

/* Reveal utility */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Wider phones / small tablets */
@media (min-width: 480px) {
  .cat-item {
    min-height: 8.5rem;
  }

  .article-thumb {
    width: 64px;
    height: 64px;
  }
}

/* Desktop: keep mobile-first feel, slightly roomier */
@media (min-width: 768px) {
  .wrap {
    width: min(100% - 3rem, 720px);
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0.25rem;
    padding: 0;
    width: auto;
  }

  .site-nav a {
    padding: 0.4rem 0.65rem;
    border: none;
    font-size: 0.85rem;
    display: inline-flex;
  }

  .nav-icon {
    display: none;
  }

  .concepts {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}
