@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ============================================================
   CSS 变量 & 基础重置
   ============================================================ */
:root {
  --c-white: #ffffff;
  --c-light: #f5f5f5;
  --c-dark: #1f1f1f;
  --c-mid: #3a3a3a;
  --c-muted: #777777;
  --c-accent: #2c2c2c;
  --c-border: #e0e0e0;

  --shadow-sm: 0 2px 8px rgba(31,31,31,0.08);
  --shadow-md: 0 6px 20px rgba(31,31,31,0.13);
  --shadow-lg: 0 16px 40px rgba(31,31,31,0.18);
  --shadow-xl: 0 32px 64px rgba(31,31,31,0.22);

  --radius-card: 28px;
  --radius-sm: 10px;

  --font-mono: 'Share Tech Mono', 'Fira Code', 'Courier New', monospace;
  --font-body: 'Fira Code', 'Share Tech Mono', monospace;

  --nav-h: 64px;
  --hero-clip: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  line-height: 1.65;
  background: var(--c-light);
  color: var(--c-dark);
}

body {
  font-family: var(--font-body);
  background: var(--c-light);
  min-height: 100vh;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

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

/* ============================================================
   页面包裹
   ============================================================ */
.page-wrapper {
  position: relative;
  z-index: 1;
}

/* ============================================================
   底部固定导航条（aside > nav > ul > li > a）
   ============================================================ */
.bottom-nav-aside {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--c-dark);
  box-shadow: 0 -4px 24px rgba(31,31,31,0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bottom-nav {
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--nav-h);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-brand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-right: 8px;
  border-radius: 10px;
  background: var(--c-white);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.nav-brand-icon:hover {
  box-shadow: var(--shadow-md);
}
.nav-logo-img { width: 36px; height: 36px; object-fit: contain; }
.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--c-dark);
  letter-spacing: -0.04em;
  text-align: center;
  line-height: 1.2;
}

.bottom-nav ul {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav ul::-webkit-scrollbar { display: none; }

.bottom-nav ul li a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  min-height: 44px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
  line-height: 44px;
}
.bottom-nav ul li a:hover {
  color: var(--c-white);
  background: rgba(255,255,255,0.1);
}

.nav-search {
  flex-shrink: 0;
  margin-left: 8px;
}
.nav-search input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: var(--c-white);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  width: 140px;
  transition: border-color 0.2s, background 0.2s, width 0.3s;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.4); }
.nav-search input:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.14);
  width: 200px;
}

/* ============================================================
   Hero 区块
   ============================================================ */
.hero-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-bottom: var(--hero-clip);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--c-dark);
}
.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.45;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31,31,31,0.85) 0%, rgba(31,31,31,0.4) 60%, transparent 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 680px;
  padding: 0 48px;
  padding-top: 60px;
}

.hero-content h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 36px;
  min-height: 48px;
  height: 48px;
  background: var(--c-white);
  color: var(--c-dark);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* 斜切底边 */
.hero-clip {
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: calc(var(--hero-clip) + 4px);
  background: var(--c-light);
  z-index: 4;
  clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
}

/* ============================================================
   主内容区（main > div > figure/aside 交错）
   ============================================================ */
.main-content {
  position: relative;
  z-index: 3;
  background: var(--c-light);
  padding: 48px 24px calc(var(--nav-h) + 40px);
}

.content-section {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.content-primary {
  min-width: 0;
}

/* ============================================================
   正文内容排版（page.content 注入区域）
   ============================================================ */
.content-primary div {
  position: relative;
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 40px 44px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
  transition: box-shadow 0.3s, transform 0.3s;
  z-index: 1;
}
.content-primary div:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px) translateZ(0);
}

.content-primary div:nth-child(even) {
  background: var(--c-dark);
  color: var(--c-white);
}
.content-primary div:nth-child(even) h2,
.content-primary div:nth-child(even) h3 {
  color: var(--c-white);
}
.content-primary div:nth-child(even) a {
  color: rgba(255,255,255,0.85);
}

.content-primary h2 {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.content-primary h3 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-mid);
  margin-bottom: 12px;
  line-height: 1.4;
}
.content-primary p {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.72;
}
.content-primary ul, .content-primary ol {
  margin-bottom: 14px;
  padding-left: 20px;
}
.content-primary ul { list-style: disc; }
.content-primary ol { list-style: decimal; }
.content-primary li { margin-bottom: 6px; line-height: 1.65; }
.content-primary a {
  color: var(--c-mid);
  border-bottom: 1px solid var(--c-border);
  transition: border-color 0.2s, color 0.2s;
}
.content-primary a:hover {
  color: var(--c-dark);
  border-color: var(--c-dark);
}

/* 标题装饰 span */
.content-primary h2 > span,
.content-primary h3 > span {
  display: inline;
}

/* ============================================================
   侧边栏（aside 在右侧）
   ============================================================ */
.content-aside {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 2;
}

.aside-card {
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
  transition: box-shadow 0.3s, transform 0.3s;
}
.aside-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.aside-card h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.aside-card h3 > span { display: inline; }

.aside-nav-list li {
  border-bottom: 1px solid var(--c-light);
}
.aside-nav-list li:last-child { border-bottom: none; }
.aside-nav-list li a {
  display: block;
  padding: 9px 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--c-mid);
  transition: color 0.2s, padding-left 0.2s;
}
.aside-nav-list li a:hover {
  color: var(--c-dark);
  padding-left: 6px;
}

.aside-figure {
  background: var(--c-dark);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
.aside-deco-block {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  border-radius: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.aside-deco-block::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 50%;
}
.aside-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
}

/* div 内 figure/aside 直接子约束 */
.content-primary div > figure {
  margin: 20px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.content-primary div > aside {
  background: var(--c-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  border-left: 3px solid var(--c-dark);
}

/* ============================================================
   页脚（footer 单行：logo + nav + copyright 横排）
   ============================================================ */
.site-footer {
  background: var(--c-dark);
  color: rgba(255,255,255,0.6);
  padding: 0 24px;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}

.footer-brand {
  flex-shrink: 0;
}
.footer-logo-link {
  display: flex;
  align-items: center;
}
.footer-logo {
  height: 32px; width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}
.footer-brand-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}

.footer-nav {
  flex: 1;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.footer-nav ul li a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-nav ul li a:hover {
  color: var(--c-white);
}

.footer-copy {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

/* ============================================================
   Scroll margin for fixed nav
   ============================================================ */
div[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ============================================================
   动效（Hover Micro-interaction + Parallax）
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .hero-wrap {
    will-change: transform;
  }
  .hero-media {
    transition: transform 0.1s linear;
  }
  .content-primary div {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }
  .aside-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }
  .hero-cta {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }
}

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

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
  }
  .content-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .aside-card { flex: 1 1 260px; }
  .aside-figure { flex: 1 1 200px; }
}

@media (max-width: 600px) {
  :root {
    --nav-h: 56px;
    --hero-clip: 48px;
  }

  .hero-content {
    padding: 0 20px;
    padding-top: 48px;
  }

  .content-primary div {
    padding: 28px 20px;
  }

  /* 移动端导航链接 tap 区域保证 ≥40px */
  .bottom-nav ul li a {
    font-size: 12px;
    padding: 0 10px;
    min-height: 44px;
    height: 44px;
    line-height: 44px;
  }

  .nav-search input {
    height: 44px;
    width: 80px;
  }
  .nav-search input:focus {
    width: 120px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
  }

  .footer-nav ul {
    gap: 4px 10px;
  }

  .main-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .aside-card, .aside-figure {
    flex: 1 1 100%;
  }
}

/* ============================================================
   辅助：空间层叠深度提示（伪元素装饰层）
   ============================================================ */
.content-primary div::before {
  content: '';
  position: absolute;
  top: -6px; left: 12px; right: 12px;
  height: 100%;
  background: var(--c-white);
  border-radius: var(--radius-card);
  z-index: -1;
  box-shadow: var(--shadow-sm);
  opacity: 0.5;
}
.content-primary div:nth-child(even)::before {
  background: var(--c-mid);
}

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