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

/* =====================
   CSS 自定义属性
   ===================== */
:root {
  --c-bg: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-soft: #555555;
  --c-ink-muted: #888888;
  --c-border: rgba(31,31,31,0.10);
  --c-glass: rgba(255,255,255,0.72);
  --c-glass-border: rgba(255,255,255,0.55);
  --c-accent: #1f1f1f;
  --c-accent-hover: #444444;
  --c-cta: #1f1f1f;
  --c-cta-text: #ffffff;
  --radius-card: 18px;
  --radius-lg: 24px;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.12);
  --nav-width: 220px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* =====================
   基础重置
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body.bento-body {
  font-family: var(--font);
  background: var(--c-surface);
  color: var(--c-ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* =====================
   页面外壳
   ===================== */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================
   左侧固定竖排导航
   details > summary + menu > li > a
   ===================== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--c-glass);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 28px 16px 24px;
  overflow-y: auto;
}

/* details open 固定展开 */
.sidenav[open] { display: flex; }

/* 隐藏 details 的默认三角 */
.sidenav > summary { list-style: none; }
.sidenav > summary::-webkit-details-marker { display: none; }

.sidenav-brand {
  margin-bottom: 36px;
  cursor: default;
}

.brand-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--c-ink);
  color: var(--c-cta-text);
  font-weight: 600;
  font-size: 18px;
  overflow: hidden;
  transition: opacity var(--transition);
}

.brand-icon-link:hover { opacity: 0.82; }

.site-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sidenav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidenav-menu li { width: 100%; }

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(31,31,31,0.07);
  color: var(--c-ink);
  outline: none;
}

/* =====================
   主区域（左偏移 nav 宽度）
   ===================== */
.main-area {
  margin-left: var(--nav-width);
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 100vh;
  position: relative;
}

/* =====================
   aside 在内容左侧
   ===================== */
.content-aside {
  width: 200px;
  flex-shrink: 0;
  order: -1;
  padding: 40px 0 40px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.aside-inner {
  background: var(--c-glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: 0.01em;
}

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

.aside-nav-list li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-ink-soft);
  transition: background var(--transition), color var(--transition);
}

.aside-nav-list li a:hover {
  background: rgba(31,31,31,0.06);
  color: var(--c-ink);
}

.aside-note {
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--c-ink-muted);
}

/* =====================
   主内容区
   main > div.wrap > section > article
   ===================== */
.main-content {
  flex: 1;
  min-width: 0;
}

.wrap {
  padding: 0 32px 60px;
  max-width: 1060px;
}

.content-section {
  width: 100%;
}

.content-article {
  width: 100%;
}

/* =====================
   Hero：右图左文，100vh，文案左对齐
   ===================== */
.hero-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  gap: 48px;
  padding: 48px 0;
}

.hero-text {
  flex: 0 0 48%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.hero-h1 {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--c-ink);
}

.hero-desc {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--c-ink-soft);
  max-width: 420px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  background: var(--c-cta);
  color: var(--c-cta-text);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.hero-cta:hover {
  background: var(--c-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31,31,31,0.18);
}

.hero-media {
  flex: 0 0 46%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.hero-placeholder {
  width: 100%;
  min-height: 400px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e4e4e4 100%);
  border-radius: var(--radius-lg);
}

/* =====================
   Bento 标题装饰
   small 同级紧邻 h2
   ===================== */
.bento-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 56px 0 28px;
}

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
}

.bento-title {
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

/* =====================
   page.content 正文容器
   Bento Box 风格：sections 以网格排布
   ===================== */
.page-content-body {
  width: 100%;
}

/* section 内容体：默认块布局 + 呼吸感 */
.page-content-body section {
  background: var(--c-glass);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-card);
  padding: 36px 36px 40px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 32px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.page-content-body section:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px) scale(1.005);
}

/* 奇偶节交替底色微调 */
.page-content-body section:nth-child(even) {
  background: rgba(245,245,245,0.82);
}

/* section 内 h2 */
.page-content-body h2 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--c-ink);
}

/* section 内 h3 */
.page-content-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--c-ink);
}

.page-content-body p {
  font-size: 16px;
  line-height: 1.72;
  color: var(--c-ink-soft);
  margin-bottom: 14px;
}

.page-content-body ul,
.page-content-body ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.page-content-body li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-ink-soft);
  margin-bottom: 6px;
}

.page-content-body a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.page-content-body a:hover {
  opacity: 0.7;
}

.page-content-body strong {
  font-weight: 600;
  color: var(--c-ink);
}

/* =====================
   页脚：三栏，footer > div + nav + div
   ===================== */
.site-footer {
  margin-left: var(--nav-width);
  background: var(--c-ink);
  color: rgba(255,255,255,0.75);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  padding: 40px 48px;
}

.footer-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
}

.footer-col:first-child { padding-left: 0; }
.footer-col:last-child { padding-right: 0; }

.footer-col + .footer-col {
  border-left: 1px solid rgba(255,255,255,0.10);
}

.footer-logo-link {
  display: flex;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
}

.footer-tagline {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.55);
  max-width: 200px;
}

.footer-col-nav {
  flex-direction: column;
  gap: 6px;
}

.footer-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  transition: color var(--transition);
}

.footer-nav-link:hover { color: #ffffff; }

.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-align: right;
}

.footer-note {
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255,255,255,0.35);
  text-align: right;
}

/* =====================
   Scroll Reveal 动效
   ===================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--transition), transform 0.5s var(--transition);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
  .page-content-body section:hover,
  .hero-cta:hover {
    transform: none;
  }
}

/* =====================
   响应式
   ===================== */

/* 中等屏幕 */
@media (max-width: 1100px) {
  :root { --nav-width: 68px; }

  .nav-link {
    font-size: 0;
    padding: 10px;
    justify-content: center;
  }

  .nav-link::before {
    font-size: 14px;
    content: attr(data-icon);
  }

  .sidenav { padding: 20px 10px; }
  .sidenav-brand { margin-bottom: 24px; }
  .brand-icon-link { width: 44px; height: 44px; }

  .content-aside { display: none; }

  .wrap { padding: 0 24px 48px; }
}

/* 平板 */
@media (max-width: 860px) {
  .hero-block {
    flex-direction: column;
    min-height: auto;
    padding: 60px 0 40px;
    gap: 32px;
  }

  .hero-text { flex: unset; width: 100%; }
  .hero-media { flex: unset; width: 100%; min-height: 260px; }

  .site-footer {
    flex-direction: column;
    gap: 24px;
    padding: 32px 24px;
    margin-left: var(--nav-width);
  }

  .footer-col { padding: 0; }
  .footer-col + .footer-col { border-left: none; border-top: 1px solid rgba(255,255,255,0.10); padding-top: 18px; }
  .footer-copy, .footer-note { text-align: left; }
}

/* 手机端 */
@media (max-width: 600px) {
  :root { --nav-width: 0px; }

  .sidenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: column;
    border-right: none;
    border-top: 1px solid var(--c-border);
    padding: 0;
    z-index: 200;
  }

  .sidenav-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    margin-bottom: 0;
    cursor: pointer;
    border-bottom: 1px solid var(--c-border);
  }

  .sidenav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px 12px;
    gap: 4px;
    flex: unset;
  }

  .sidenav-menu li { flex-shrink: 0; }

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

  .main-area {
    margin-left: 0;
    margin-bottom: 140px;
    flex-direction: column;
  }

  .site-footer {
    margin-left: 0;
    margin-bottom: 140px;
  }

  .wrap { padding: 0 16px 40px; }

  .hero-block { padding: 32px 0 24px; gap: 24px; }
  .hero-h1 { font-size: 26px; }
  .hero-desc { font-size: 15px; }

  .page-content-body section { padding: 24px 20px 28px; }

  .bento-intro { margin: 40px 0 20px; }

  .content-aside { display: none; }
}

/* scroll-margin-top for fixed/sticky nav on mobile */
section[id] { scroll-margin-top: 80px; }

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