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

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-white: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-30: rgba(31,31,31,0.3);
  --c-ink-10: rgba(31,31,31,0.08);
  --c-border: rgba(31,31,31,0.12);
  --c-shadow: rgba(31,31,31,0.07);
  --c-shadow-md: rgba(31,31,31,0.12);
  --sidebar-w: 240px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-head: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --scroll-offset: 80px;
}

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

body {
  font-family: var(--font-body);
  background: var(--c-surface);
  color: var(--c-ink);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── 页面骨架 ── */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   侧边栏
══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-ink);
  color: var(--c-white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-announce {
  background: rgba(255,255,255,0.08);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 8px 12px;
  color: rgba(255,255,255,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--c-white);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-img {
  width: 36px;
  height: 36px;
  display: block;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav ul li {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  text-decoration: none;
  color: rgba(255,255,255,0.72);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  min-height: 44px;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--c-white);
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--c-white);
  background: rgba(255,255,255,0.08);
  padding-left: 26px;
  outline: none;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  flex-shrink: 0;
  transition: background var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link:focus-visible .nav-icon {
  background: var(--c-white);
}

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

.sidebar-footer-note {
  padding: 16px 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════
   主区域
══════════════════════════════════════ */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Hero ── */
.hero-block {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: var(--c-ink);
  overflow: hidden;
  padding: 64px 56px 64px 48px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: 680px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 4px 14px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  max-width: 520px;
  margin-left: auto;
}

/* ══════════════════════════════════════
   主内容 + Bento Grid
══════════════════════════════════════ */
main {
  flex: 1;
  padding: 48px 40px 48px;
}

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

.content-section {
  /* 容器 */
}

.content-article {
  /* 内容文章直接承载 page.content */
}

/* ── page.content 内的 div 卡片（Bento Box）── */
.content-article > div,
.content-section > article > div {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px var(--c-shadow), 0 1px 2px rgba(31,31,31,0.04);
  padding: 40px 44px;
  margin-bottom: 20px;
  transition: box-shadow var(--transition), transform var(--transition);
  scroll-margin-top: var(--scroll-offset);
  overflow: hidden;
}

.content-article > div:hover {
  box-shadow: 0 8px 24px var(--c-shadow-md), 0 2px 6px rgba(31,31,31,0.06);
  transform: translateY(-2px);
}

/* Bento grid for pairs */
.content-article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .content-article {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
  }

  /* 第1个 div：全宽 hero card */
  .content-article > div:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: span 1;
  }

  /* 第2个 div：2列 */
  .content-article > div:nth-child(2) {
    grid-column: span 2;
  }

  /* 第3个 div：2列 */
  .content-article > div:nth-child(3) {
    grid-column: span 2;
  }

  /* 第4个 div：3列 */
  .content-article > div:nth-child(4) {
    grid-column: span 3;
  }

  /* 第5个 div：1列 */
  .content-article > div:nth-child(5) {
    grid-column: span 1;
  }

  /* 第6个 div：2列 */
  .content-article > div:nth-child(6) {
    grid-column: span 2;
  }

  /* 第7个 div：2列 */
  .content-article > div:nth-child(7) {
    grid-column: span 2;
  }
}

/* ── 正文排版 ── */
.content-article h2,
.content-article h3,
.content-article h4 {
  font-family: var(--font-head);
  color: var(--c-ink);
  line-height: 1.3;
  margin-bottom: 16px;
  margin-top: 0;
}

.content-article h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.content-article h2 > span {
  display: inline;
}

.content-article h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
}

.content-article h3 > span {
  display: inline;
}

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

.content-article p:last-child {
  margin-bottom: 0;
}

.content-article ul,
.content-article ol {
  padding-left: 1.4em;
  margin-bottom: 14px;
}

.content-article li {
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
  margin-bottom: 6px;
}

.content-article a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--c-ink-30);
  transition: text-decoration-color var(--transition);
}

.content-article a:hover {
  text-decoration-color: var(--c-ink);
}

.content-article strong {
  font-weight: 700;
}

.content-article em {
  font-style: italic;
}

.content-article blockquote {
  border-left: 3px solid var(--c-ink-30);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--c-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.content-article blockquote p {
  color: var(--c-ink-60);
  font-style: italic;
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 15px;
}

.content-article th,
.content-article td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.content-article th {
  font-weight: 600;
  background: var(--c-surface);
}

.content-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

/* 玻璃拟态卡片（div内若有嵌套卡片类元素） */
.content-article .card,
.content-article figure {
  background: rgba(245,245,245,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(31,31,31,0.07);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px var(--c-shadow);
}

/* ══════════════════════════════════════
   页脚
══════════════════════════════════════ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-white);
  margin-top: 0;
}

.footer-cta {
  padding: 56px 56px 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.footer-cta-inner {
  max-width: 560px;
  margin: 0 auto;
}

.footer-cta-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 12px;
  line-height: 1.25;
}

.footer-cta-desc {
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 40px;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

.footer-sep {
  color: rgba(255,255,255,0.2);
  font-size: 13px;
}

.footer-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

/* ══════════════════════════════════════
   Scroll Reveal 动效
══════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .content-article > div:hover {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ══════════════════════════════════════
   响应式
══════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
    z-index: 200;
  }

  .sidebar-announce {
    display: none;
  }

  .sidebar-brand {
    padding: 12px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }

  .sidebar nav {
    flex: 1;
    padding: 0;
    overflow-x: auto;
  }

  .sidebar nav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .sidebar nav ul li {
    flex-shrink: 0;
  }

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

  .nav-link::before {
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    transition: transform var(--transition);
  }

  .nav-link:hover::before,
  .nav-link:focus-visible::before {
    transform: translateX(-50%) scaleX(1);
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    padding-left: 14px;
  }

  .sidebar-footer-note {
    display: none;
  }

  .main-area {
    margin-left: 0;
    padding-top: 56px;
  }

  .hero-block {
    min-height: 60vw;
    padding: 40px 24px 40px 24px;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hero-inner {
    text-align: right;
  }

  main {
    padding: 32px 20px;
  }

  .content-article > div {
    padding: 28px 24px;
  }

  .footer-cta {
    padding: 40px 24px 32px;
  }

  .footer-bottom {
    padding: 16px 24px;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-block {
    padding: 32px 20px 36px;
  }

  main {
    padding: 24px 16px;
  }

  .content-article > div {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

  .footer-cta {
    padding: 32px 18px 28px;
  }
}

/* div 滚动偏移（固定侧栏/顶栏）*/
div[id] {
  scroll-margin-top: var(--scroll-offset);
}

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

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