@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ============================================================
   CSS 变量与基础重置
   ============================================================ */
:root {
  --paper: #fdfbf7;
  --paper-alt: #f5f5f5;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-light: #6a6a6a;
  --border: #d8d4cc;
  --border-light: #e8e4de;
  --accent: #1a1a1a;
  --accent-hover: #3a3a3a;
  --card-shadow: 0 2px 12px rgba(26,26,26,0.10), 0 1px 3px rgba(26,26,26,0.06);
  --card-shadow-hover: 0 6px 24px rgba(26,26,26,0.16), 0 2px 8px rgba(26,26,26,0.10);
  --radius-card: 28px;
  --radius-sm: 6px;
  --sidebar-w: 220px;
  --bottom-bar-h: 60px;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --transition: none;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}

/* 纸质噪点纹理（伪元素叠加） */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

body {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   布局骨架
   ============================================================ */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  padding-bottom: var(--bottom-bar-h);
}

/* 侧边栏（左侧，桌面显示） */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--paper-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 0 2rem 0;
  z-index: 100;
  overflow-y: auto;
}

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

.sidebar-nav nav ul li {
  border-bottom: 1px solid var(--border-light);
}

.sidebar-nav nav ul li a {
  display: block;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  letter-spacing: 0.02em;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav nav ul li a:hover,
.sidebar-nav nav ul li a:focus {
  color: var(--ink);
  background: var(--border-light);
  border-left-color: var(--ink);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}

/* 内容区（偏移侧边栏宽度） */
.content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Hero 区块（左图右文，约70vh）
   ============================================================ */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}

.hero-inner {
  display: flex;
  width: 100%;
  min-height: 70vh;
}

.hero-media {
  flex: 0 0 48%;
  max-width: 48%;
  overflow: hidden;
  background: var(--paper-alt);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--border);
  letter-spacing: 0.15em;
  min-height: 300px;
}

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 3rem 3rem 3rem 2.5rem;
  text-align: right;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--ink-light);
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  max-width: 480px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.75;
  max-width: 420px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  min-height: 44px;
  line-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}

.hero-cta:hover,
.hero-cta:focus {
  background: var(--ink-mid);
  border-color: var(--ink-mid);
}

/* ============================================================
   主内容区（main > article.wrap > section > div）
   ============================================================ */
.main-content {
  padding: 0;
}

.main-content .wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}

.content-section {
  margin-bottom: 3rem;
}

.content-article {
  width: 100%;
}

/* ============================================================
   内容正文排版
   ============================================================ */
.content-article h1,
.content-article h2,
.content-article h3,
.content-article h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.content-article h2 {
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.content-article h3 {
  font-size: 1.05rem;
}

.content-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 1.2rem;
}

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

.content-article a:hover {
  color: var(--ink-light);
}

.content-article ul,
.content-article ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.content-article li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-size: 0.97rem;
  color: var(--ink-mid);
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.content-article th,
.content-article td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.content-article th {
  background: var(--paper-alt);
  font-weight: 500;
  color: var(--ink);
}

.content-article blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper-alt);
  font-style: italic;
  color: var(--ink-mid);
}

/* section 区块分隔（page.content 里的 section） */
.content-article section {
  padding-top: 2rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--border-light);
  scroll-margin-top: calc(var(--bottom-bar-h) + 1rem);
}

.content-article section:first-child {
  border-top: none;
  padding-top: 0;
}

/* ============================================================
   标题装饰（h2 + p.subtitle）
   ============================================================ */
.section-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 0.88rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ============================================================
   卡片样式（柔阴影，圆角28px）
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem 1.75rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

/* content 内部卡片样式（正文里的 .card 类） */
.content-article .card {
  margin-bottom: 1.25rem;
}

/* ============================================================
   页脚（三栏，footer address + ul > li > a）
   ============================================================ */
.site-footer {
  background: var(--paper-alt);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.footer-logo {
  display: block;
  max-width: 120px;
  height: auto;
  margin-bottom: 0.75rem;
}

.footer-brand-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.footer-desc {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.footer-contact {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.6;
}

.footer-contact a {
  color: var(--ink-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-mid);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0;
}

.footer-col ul li a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copy,
.footer-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* ============================================================
   底部固定导航条
   ============================================================ */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-h);
  background: var(--paper);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
}

.bottom-nav-left,
.bottom-nav-right {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.bottom-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.bottom-nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 0.5rem;
  min-width: 48px;
  min-height: 44px;
}

.bottom-nav-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.bnav-brand-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  color: var(--ink-light);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  min-height: 44px;
  padding: 0.3rem 0.2rem;
  border-right: 1px solid var(--border-light);
  gap: 0.15rem;
  transition: var(--transition);
}

.bottom-nav-left .bottom-nav-item:first-child {
  border-left: none;
}

.bottom-nav-right .bottom-nav-item:last-child {
  border-right: none;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  background: var(--paper-alt);
  color: var(--ink);
}

.bnav-icon {
  font-size: 0.8rem;
  line-height: 1;
  display: block;
}

.bnav-label {
  font-size: 0.58rem;
  line-height: 1.2;
  text-align: center;
  display: block;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* section scroll offset for fixed bottom bar */
section[id] {
  scroll-margin-top: calc(var(--bottom-bar-h) + 1.5rem);
}

/* ============================================================
   Scroll Reveal（原生 JS / CSS，prefers-reduced-motion 关闭）
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: none;
  }
}

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

/* ============================================================
   Hover 微交互（CSS 层）
   ============================================================ */
a {
  transition: color 0.12s ease;
}

.hero-cta {
  transition: background 0.12s ease, border-color 0.12s ease;
}

/* ============================================================
   移动端响应（≤768px）
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar-nav {
    display: none;
  }

  .content-area {
    margin-left: 0;
  }

  .hero-inner {
    flex-direction: column;
    min-height: auto;
  }

  .hero-media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hero-text {
    align-items: flex-start;
    text-align: left;
    padding: 2rem 1.25rem;
  }

  .hero-eyebrow {
    align-self: flex-start;
  }

  .hero-h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

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

  .main-content .wrap {
    padding: 2rem 1.25rem 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .site-footer {
    padding: 2rem 1.25rem 1.5rem;
  }

  .bottom-nav-bar {
    height: var(--bottom-bar-h);
  }

  .bnav-label {
    font-size: 0.55rem;
    max-width: 36px;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.4rem;
  }

  .footer-inner {
    gap: 1.25rem;
  }

  .bottom-nav-item {
    font-size: 0.55rem;
  }
}

/* ============================================================
   无横向滚动保障
   ============================================================ */
body, .page-wrapper, .content-area {
  overflow-x: hidden;
}

/* ============================================================
   可访问性
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

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