:root {
  --bg: #faf7f4;
  --bg-card: #ffffff;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --stripe-1: #e11d48;
  --stripe-2: #ea580c;
  --stripe-3: #ca8a04;
  --stripe-4: #16a34a;
  --stripe-5: #0891b2;
  --stripe-6: #7c3aed;
  --rail-w: 6px;
  --node-size: 18px;
  --accent: #be123c;
  --accent-soft: #ffe4e6;
  --border: #e7e5e4;
  --link: #be123c;
  --shadow: 0 8px 32px rgba(28, 25, 23, 0.08);
  --radius: 14px;
  --max: 1140px;
  --header-h: 64px;
  --timeline-offset: 56px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "DM Serif Display", "Noto Serif SC", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--ink); font-weight: 600; font-size: 1.05rem;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand img { border-radius: 10px; }
.brand b { color: var(--accent); font-family: var(--font-display); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.45rem 0.8rem; border-radius: 8px;
  color: var(--ink-soft); font-size: 0.92rem;
}
.site-nav a:hover, .site-nav a.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

.ads-top-bar {
  padding: 0.5rem 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
#ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  background: transparent;
  margin: 10px 0;
  gap: 0.5rem;
}
#ads > div,
#ads .ads-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  box-sizing: border-box;
}
#ads img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(24, 24, 24, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: block;
  border: none;
}
#ads a { display: inline-block; text-decoration: none; border-radius: 15px; }
#ads img:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 24px rgba(24, 24, 24, 0.18);
}
#ads figcaption,
#ads .caption {
  height: 15px;
  font-size: 11px;
  color: #666;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}
.applist-title { text-align: center; font-size: 0.9rem; color: var(--ink-soft); }

/* ── Vertical Timeline Stripe Layout ── */
.timeline-hero {
  padding: 2.5rem 0 1.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.timeline-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.35;
  margin: 0 0 1rem;
  max-width: 720px;
}
.timeline-hero .lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 680px; margin: 0; }

.partner-strip {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.partner-strip a {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, var(--stripe-1), var(--stripe-3), var(--stripe-5));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.partner-strip a:hover { text-decoration: none; transform: translateY(-2px); }

.timeline-shell {
  position: relative;
  padding: 2rem 0 3rem;
}
.timeline-shell::before {
  content: "";
  position: absolute;
  left: var(--timeline-offset);
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  background: linear-gradient(
    180deg,
    var(--stripe-1) 0%,
    var(--stripe-1) 16.6%,
    var(--stripe-2) 16.6%,
    var(--stripe-2) 33.3%,
    var(--stripe-3) 33.3%,
    var(--stripe-3) 50%,
    var(--stripe-4) 50%,
    var(--stripe-4) 66.6%,
    var(--stripe-5) 66.6%,
    var(--stripe-5) 83.3%,
    var(--stripe-6) 83.3%,
    var(--stripe-6) 100%
  );
  border-radius: 3px;
  z-index: 1;
}

.timeline-item {
  position: relative;
  padding-left: calc(var(--timeline-offset) + 2.5rem);
  margin-bottom: 2.5rem;
  max-width: 820px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(var(--timeline-offset) - (var(--node-size) - var(--rail-w)) / 2);
  top: 0.35rem;
  width: var(--node-size);
  height: var(--node-size);
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.15);
  z-index: 2;
}
.timeline-item:nth-child(6n+1)::before { border-color: var(--stripe-1); box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15); }
.timeline-item:nth-child(6n+2)::before { border-color: var(--stripe-2); box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.15); }
.timeline-item:nth-child(6n+3)::before { border-color: var(--stripe-3); box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.15); }
.timeline-item:nth-child(6n+4)::before { border-color: var(--stripe-4); box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15); }
.timeline-item:nth-child(6n+5)::before { border-color: var(--stripe-5); box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.15); }
.timeline-item:nth-child(6n+6)::before { border-color: var(--stripe-6); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15); }

.timeline-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.timeline-item:nth-child(6n+1) .timeline-badge { color: var(--stripe-1); }
.timeline-item:nth-child(6n+2) .timeline-badge { color: var(--stripe-2); }
.timeline-item:nth-child(6n+3) .timeline-badge { color: var(--stripe-3); }
.timeline-item:nth-child(6n+4) .timeline-badge { color: var(--stripe-4); }
.timeline-item:nth-child(6n+5) .timeline-badge { color: var(--stripe-5); }
.timeline-item:nth-child(6n+6) .timeline-badge { color: var(--stripe-6); }

.timeline-item h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.timeline-item p { margin: 0 0 0.85rem; }
.timeline-item ul, .timeline-item ol { margin: 0 0 0.85rem; padding-left: 1.3rem; }
.timeline-item li { margin-bottom: 0.3rem; }

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-top: 0.75rem;
}
.timeline-card.callout {
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.img-grid figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.img-grid img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.img-grid figcaption { padding: 0.5rem 0.75rem; font-size: 0.82rem; color: var(--ink-soft); }

.hero-visual {
  float: right;
  width: min(100%, 300px);
  margin: 0 0 1rem 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.page-hero { padding: 2rem 0 1rem; }
.page-hero h1 { font-family: var(--font-display); font-size: 1.75rem; margin: 0 0 1rem; }
.prose p { margin: 0 0 1rem; }
.prose h2 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }

.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--ink-soft); }

.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--accent); font-family: var(--font-display); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 0.5rem; transform: translateY(-120%); opacity: 0;
    transition: 0.25s; pointer-events: none; z-index: 400;
  }
  .site-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav ul { flex-direction: column; }
  :root { --timeline-offset: 28px; }
  .timeline-item { padding-left: calc(var(--timeline-offset) + 1.75rem); }
  .hero-visual { float: none; width: 100%; margin: 0 0 1rem; }
  .ads-top-bar .container { width: 100%; padding-inline: 0.75rem; }
  #ads {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  #ads::-webkit-scrollbar { display: none; }
  #ads > div,
  #ads .ads-item { width: 84px; flex-shrink: 0; scroll-snap-align: center; }
}
