@import url('https://fonts.googleapis.com/css2?family=Inter: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;
  scroll-padding-top: 80px;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #1f1f1f;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol, dl {
  list-style: none;
}

/* ============================================================
   Layout Shell: 左侧固定导航 + 主内容区
   ============================================================ */
.site-shell {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  margin-left: 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   左侧竖排导航 (用 footer 标签满足契约)
   ============================================================ */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid rgba(31,31,31,0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  overflow-y: auto;
}

.side-nav-brand {
  padding: 28px 20px 20px;
  border-bottom: 1px solid rgba(31,31,31,0.06);
}

.nav-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #1f1f1f;
  border-radius: 12px;
  overflow: hidden;
  transition: opacity 0.2s;
}

.nav-brand-link:hover {
  opacity: 0.85;
}

.nav-logo-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.nav-logo-text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.side-nav nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1f;
  transition: background 0.18s, color 0.18s;
  min-height: 44px;
}

.nav-link:hover {
  background: #f5f5f5;
  color: #1f1f1f;
}

.nav-icon {
  font-size: 14px;
  opacity: 0.5;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-style: normal;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Hero Bento
   ============================================================ */
.hero-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 45vh;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  z-index: 2;
  position: relative;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(31,31,31,0.45);
  margin-bottom: 16px;
  display: block;
}

.hero-h1 {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #1f1f1f;
  margin-bottom: 16px;
}

.hero-lead {
  font-size: 15px;
  font-weight: 400;
  color: rgba(31,31,31,0.6);
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 28px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f1f1f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 100px;
  width: fit-content;
  min-height: 44px;
  transition: background 0.2s, transform 0.2s;
}

.hero-cta:hover {
  background: #3a3a3a;
  transform: translateY(-1px);
}

.hero-media-col {
  position: relative;
  overflow: hidden;
}

.hero-img-stack {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px;
}

.hero-img {
  border-radius: 14px;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-img-1 {
  transform: translateY(-12px);
}

.hero-img-2 {
  transform: translateY(12px);
}

.hero-slash {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,245,245,0.3) 0%, transparent 60%);
  pointer-events: none;
}

/* ============================================================
   Content Main: main > article.wrap > div > section
   ============================================================ */
.content-main {
  flex: 1;
  background: #f5f5f5;
  padding: 40px 32px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.content-section {
  /* div wraps section */
}

.content-article {
  /* section contains layout */
}

/* Article 双栏：主体 + aside */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.article-body {
  min-width: 0;
}

/* ============================================================
   page.content 内的 div 样式
   （page.content 里有 7 个 div[id]，全部直接插入）
   ============================================================ */
.article-body div {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 32px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  scroll-margin-top: 80px;
}

.article-body div:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1f1f1f;
  margin-bottom: 8px;
  line-height: 1.3;
}

.article-body h2 + p {
  color: rgba(31,31,31,0.55);
  font-size: 14px;
  margin-bottom: 20px;
}

.article-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1f1f1f;
  margin: 24px 0 10px;
}

.article-body p {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(31,31,31,0.8);
  margin-bottom: 14px;
}

.article-body ul, .article-body ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(31,31,31,0.8);
  margin-bottom: 6px;
}

.article-body a {
  color: #1f1f1f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body strong {
  font-weight: 600;
  color: #1f1f1f;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 14px;
}

.article-body th {
  background: #f5f5f5;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(31,31,31,0.1);
}

.article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(31,31,31,0.07);
}

/* ============================================================
   Aside 右侧边栏
   ============================================================ */
.article-aside {
  position: sticky;
  top: 24px;
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.article-aside h2 {
  font-size: 15px;
  font-weight: 700;
  color: #1f1f1f;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.article-aside .subtitle {
  font-size: 12px;
  color: rgba(31,31,31,0.45);
  margin-bottom: 16px;
  line-height: 1.5;
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.aside-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(31,31,31,0.75);
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  background: #f5f5f5;
  color: #1f1f1f;
}

.bento-card {
  background: #f5f5f5;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(31,31,31,0.4);
  text-transform: uppercase;
}

.aside-card-val {
  font-size: 14px;
  font-weight: 600;
  color: #1f1f1f;
}

/* ============================================================
   页脚：footer > div×n
   ============================================================ */
.site-footer {
  background: #1f1f1f;
  color: #ffffff;
  margin-top: auto;
}

.footer-sec {
  /* direct children sections */
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 32px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-logo .nav-brand-link {
  background: rgba(255,255,255,0.1);
}

.footer-logo .nav-logo-text {
  color: #ffffff;
}

.footer-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.footer-col-title + .subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
  display: block;
}

.footer-email,
.footer-social {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
  padding: 6px 0;
  transition: color 0.15s;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.footer-email:hover,
.footer-social:hover {
  color: #ffffff;
}

.footer-dl {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-dl dd {
  /* dd wraps a */
}

.footer-dl dd a {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  padding: 7px 0;
  transition: color 0.15s;
  min-height: 36px;
}

.footer-dl dd a:hover {
  color: #ffffff;
}

.footer-about-text {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.footer-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  text-align: right;
}

/* ============================================================
   Bento Grid 辅助（用于 page.content 内可能的bento块）
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 16px;
}

.bento-tile {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  position: relative;
}

.bento-tile:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.bento-tile.span-2h { grid-column: span 2; }
.bento-tile.span-2v { grid-row: span 2; }
.bento-tile.span-22 { grid-column: span 2; grid-row: span 2; }

/* 玻璃拟态卡片变体 */
.glass-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* ============================================================
   Animations & Micro-interactions
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .article-body div {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
  }

  .article-body div:nth-child(1) { animation-delay: 0.05s; }
  .article-body div:nth-child(2) { animation-delay: 0.1s; }
  .article-body div:nth-child(3) { animation-delay: 0.15s; }
  .article-body div:nth-child(4) { animation-delay: 0.2s; }
  .article-body div:nth-child(5) { animation-delay: 0.25s; }
  .article-body div:nth-child(6) { animation-delay: 0.3s; }
  .article-body div:nth-child(7) { animation-delay: 0.35s; }

  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .hero-img-1 {
    transition: transform 0.4s ease;
  }

  .hero-img-2 {
    transition: transform 0.4s ease 0.05s;
  }

  .bento-tile {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Responsive: Tablet 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .side-nav {
    width: 180px;
  }

  .main-wrapper {
    margin-left: 180px;
  }

  .hero-bento {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .article-layout {
    grid-template-columns: 1fr 240px;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

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

/* ============================================================
   Responsive: Mobile 768px
   ============================================================ */
@media (max-width: 768px) {
  /* 导航变为顶部横向 */
  .site-shell {
    flex-direction: column;
  }

  .side-nav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid rgba(31,31,31,0.08);
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
  }

  .side-nav-brand {
    padding: 12px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(31,31,31,0.06);
    flex-shrink: 0;
  }

  .side-nav nav {
    padding: 8px 12px;
    flex: 1;
    overflow-x: auto;
  }

  .nav-dl {
    flex-direction: row;
    gap: 2px;
    flex-wrap: nowrap;
  }

  .nav-item {
    flex-shrink: 0;
  }

  .nav-link {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  .nav-icon {
    display: none;
  }

  .main-wrapper {
    margin-left: 0;
  }

  /* Hero */
  .hero-bento {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-text-col {
    padding: 36px 24px 28px;
  }

  .hero-media-col {
    height: 240px;
  }

  .hero-img-stack {
    position: relative;
    height: 240px;
  }

  /* Content */
  .content-main {
    padding: 24px 16px;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
    order: -1;
    margin-bottom: 20px;
  }

  .article-body div {
    padding: 24px 20px;
    border-radius: 18px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 20px 28px;
  }

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

  .footer-meta {
    text-align: left;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 160px;
  }

  .bento-tile.span-2h,
  .bento-tile.span-2v,
  .bento-tile.span-22 {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ============================================================
   Mobile 375px fine-tune
   ============================================================ */
@media (max-width: 400px) {
  .hero-h1 {
    font-size: 26px;
  }

  .hero-text-col {
    padding: 28px 16px 22px;
  }

  .content-main {
    padding: 16px 12px;
  }

  .article-body div {
    padding: 20px 16px;
  }

  .article-aside {
    padding: 18px 14px;
  }
}

/* ============================================================
   Scroll-margin for sections (单页锚点)
   ============================================================ */
div[id] {
  scroll-margin-top: 80px;
}

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

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

/* p.subtitle 契约 */
p.subtitle {
  color: rgba(31,31,31,0.5);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.site-footer p.subtitle {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
}

button[aria-expanded]{min-width:44px;min-height:44px}
