@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* =============================================
   CSS Reset & Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: #1f1f1f;
  background: #f5f5f5;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
dt, dd { display: block; }

/* =============================================
   CSS Variables
   ============================================= */
:root {
  --white: #ffffff;
  --light: #f5f5f5;
  --dark: #1f1f1f;
  --accent: #1f1f1f;
  --accent-soft: #3a3a3a;
  --border: rgba(31,31,31,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-width: 220px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   Layout: Sidebar + Main
   ============================================= */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   Left Fixed Nav (footer tag per spec)
   ============================================= */
footer.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

footer.side-nav nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.nav-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-link {
  display: block;
}

.brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.brand-logo {
  width: auto;
  height: 36px;
  object-fit: contain;
}

.nav-list {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-list dt a,
.nav-list dd a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.nav-list dt a:hover,
.nav-list dd a:hover {
  background: var(--light);
  color: var(--dark);
}

.nav-list dt a:active,
.nav-list dd a:active {
  background: #ebebeb;
}

.nav-footer-copy {
  margin-top: auto;
  padding: 20px 24px;
  font-size: 0.7rem;
  color: #aaa;
  border-top: 1px solid var(--border);
}

/* =============================================
   Main Content Area
   ============================================= */
.main-content {
  margin-left: var(--nav-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* =============================================
   Hero Section
   ============================================= */
.hero-section {
  display: flex;
  align-items: center;
  min-height: 100vh;
  gap: 48px;
  padding: 60px 48px;
  background: var(--white);
  scroll-margin-top: 0;
}

.hero-aside {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: center;
}

.hero-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.hero-img-placeholder {
  width: 100%;
  height: 320px;
  background: var(--light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #ccc;
}

.hero-aside-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-block;
  padding: 6px 14px;
  background: var(--light);
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

.hero-text {
  flex: 1;
  text-align: left;
  max-width: 560px;
}

.hero-eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--dark);
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #555;
  margin-bottom: 36px;
  max-width: 460px;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--dark);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  min-height: 48px;
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: transparent;
  color: var(--dark);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  min-height: 48px;
}

.btn-ghost:hover {
  border-color: var(--dark);
  background: var(--light);
  transform: translateY(-1px);
}

/* =============================================
   Main > div.wrap > section > article (契约结构)
   ============================================= */
main {
  flex: 1;
  background: var(--light);
}

main > div.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

main > div.wrap > section.content-section {
  padding: 64px 0;
}

main > div.wrap > section.content-section > article.content-article {
  /* Bento Box Grid for page.content sections */
}

/* =============================================
   Bento Box: Content Sections from page.content
   ============================================= */
.content-article > section {
  scroll-margin-top: 80px;
  margin-bottom: 64px;
}

.content-article > section:first-child {
  margin-top: 0;
}

/* Section heading decoration */
.content-article > section small {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.content-article > section h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--dark);
  margin-bottom: 24px;
  line-height: 1.25;
}

.content-article > section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 12px;
  margin-top: 28px;
}

.content-article > section p {
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 16px;
  max-width: 720px;
}

.content-article > section ul,
.content-article > section ol {
  padding-left: 1.5em;
  margin-bottom: 16px;
  list-style: disc;
}

.content-article > section ol {
  list-style: decimal;
}

.content-article > section li {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 6px;
}

.content-article > section a {
  color: var(--dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity var(--transition);
}

.content-article > section a:hover {
  opacity: 0.65;
}

/* Bento grid for card-like children inside sections */
.content-article .bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 16px;
  margin: 32px 0;
}

.content-article .bento-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-bottom: 3px solid var(--dark);
  border-radius: 0;
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.content-article .bento-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.content-article .bento-card.span-2 {
  grid-column: span 2;
}

.content-article .bento-card.span-2-row {
  grid-row: span 2;
}

/* Section divider */
.content-article > section + section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

/* Aside (左侧推荐区) */
aside.content-aside {
  display: none; /* mobile hidden */
}

/* =============================================
   Bottom Footer (横排单行)
   ============================================= */
footer.bottom-footer {
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 32px;
  flex-wrap: wrap;
}

.footer-logo-wrap img,
.footer-logo-wrap .footer-brand {
  opacity: 0.85;
}

.footer-brand {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
}

footer.bottom-footer nav.footer-bottom-nav {
  flex: 1;
}

.footer-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  align-items: center;
}

.footer-dl dt {
  display: inline;
}

.footer-dl dt a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  transition: color var(--transition);
  min-height: 40px;
}

.footer-dl dt a:hover {
  color: var(--white);
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* =============================================
   Scroll Reveal Animation
   ============================================= */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  .stagger .reveal:nth-child(1) { transition-delay: 0.05s; }
  .stagger .reveal:nth-child(2) { transition-delay: 0.12s; }
  .stagger .reveal:nth-child(3) { transition-delay: 0.19s; }
  .stagger .reveal:nth-child(4) { transition-delay: 0.26s; }
  .stagger .reveal:nth-child(5) { transition-delay: 0.33s; }
  .stagger .reveal:nth-child(6) { transition-delay: 0.40s; }
  .stagger .reveal:nth-child(7) { transition-delay: 0.47s; }
}

/* =============================================
   Responsive: Tablet
   ============================================= */
@media (max-width: 1024px) {
  .hero-aside {
    flex: 0 0 320px;
  }

  .content-article .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-article .bento-card.span-2 {
    grid-column: span 2;
  }
}

/* =============================================
   Responsive: Mobile
   ============================================= */
@media (max-width: 768px) {
  :root {
    --nav-width: 0px;
  }

  footer.side-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 200;
    overflow-x: auto;
    overflow-y: hidden;
  }

  footer.side-nav nav {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    height: auto;
  }

  .nav-brand {
    padding: 10px 16px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .nav-list {
    flex-direction: row;
    padding: 0;
    gap: 0;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list dt a,
  .nav-list dd a {
    padding: 10px 14px;
    font-size: 0.75rem;
    min-height: 48px;
    white-space: nowrap;
  }

  .nav-footer-copy {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 64px;
  }

  .hero-section {
    flex-direction: column;
    min-height: auto;
    padding: 40px 20px 48px;
    gap: 32px;
  }

  .hero-aside {
    flex: none;
    width: 100%;
  }

  .hero-img-placeholder {
    height: 220px;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  main > div.wrap {
    padding: 0 16px;
  }

  main > div.wrap > section.content-section {
    padding: 40px 0;
  }

  .content-article .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .content-article .bento-card.span-2,
  .content-article .bento-card.span-2-row {
    grid-column: span 1;
    grid-row: span 1;
  }

  footer.bottom-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px;
  }

  .footer-dl {
    gap: 2px;
  }

  .footer-dl dt a {
    padding: 8px 8px;
    font-size: 0.75rem;
  }
}

/* =============================================
   Scroll margin for anchor sections
   ============================================= */
section[id] {
  scroll-margin-top: 72px;
}

@media (max-width: 768px) {
  section[id] {
    scroll-margin-top: 56px;
  }
}

/* =============================================
   Utility
   ============================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
