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

/* ============================
   CSS 变量 & 重置
   ============================ */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000000;
  --white: #ffffff;
  --yellow: #ffe566;
  --bg: #f5f5f0;
  --border: 3px solid var(--black);
  --shadow: 5px 5px 0 var(--black);
  --shadow-lg: 8px 8px 0 var(--black);
  --shadow-sm: 3px 3px 0 var(--black);
  --radius: 0px;
  --card-radius: 0px;
  --font-code: 'Fira Code', 'Courier New', monospace;
  --font-body: 'Fira Sans', 'Fira Code', system-ui, sans-serif;
  --nav-h: 110px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--black);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
}

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

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

/* ============================
   滚动偏移（固定导航）
   ============================ */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

/* ============================
   Header / 导航
   ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue);
  border-bottom: var(--border);
}

.header-announce {
  background: var(--black);
  color: var(--yellow);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 5px 16px;
  letter-spacing: 0.12em;
}

.header-announce span {
  display: inline-block;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--black);
  text-decoration: none;
  border: var(--border);
  background: var(--white);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  min-height: 44px;
}

.site-brand:hover {
  box-shadow: 7px 7px 0 var(--black);
  transform: translate(-2px, -2px);
}

.brand-name {
  font-size: 1.1rem;
}

.site-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* 导航结构：nav > p > a */
.site-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.site-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.site-nav a {
  font-family: var(--font-code);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--black);
  background: var(--white);
  border: var(--border);
  padding: 8px 12px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.12s, box-shadow 0.12s, transform 0.12s;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--black);
  transform: translate(-2px, -2px);
}

/* ============================
   Hero
   ============================ */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border-bottom: var(--border);
  background: var(--black);
}

.hero-bg-word {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: clamp(120px, 22vw, 320px);
  color: rgba(59, 177, 255, 0.08);
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 60px 40px 32px;
  max-width: 900px;
  margin-left: auto;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  padding: 4px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.15em;
}

.hero-section h1 {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 4rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 18px;
  text-shadow: 4px 4px 0 var(--red);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--blue);
  font-weight: 500;
  max-width: 520px;
  margin-left: auto;
  line-height: 1.6;
}

.hero-media {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-top: var(--border);
  margin-top: 24px;
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  opacity: 0.75;
  filter: contrast(1.1) saturate(1.1);
  display: block;
}

/* ============================
   内容布局（content-layout）
   ============================ */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
  padding: 0;
}

/* 正文结构：main > div > section */
.main-article {
  border-right: var(--border);
  min-width: 0;
}

.page-content-section {
  padding: 0;
}

/* ============================
   正文 HTML 内容样式（page.content 插入区）
   ============================ */
.page-content-section section {
  padding: 52px 40px;
  border-bottom: var(--border);
  position: relative;
}

.page-content-section section:nth-child(even) {
  background: var(--white);
}

.page-content-section section:nth-child(odd) {
  background: var(--bg);
}

.page-content-section h2 {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.2;
  position: relative;
  display: inline-block;
  background: var(--blue);
  border: var(--border);
  padding: 8px 18px;
  box-shadow: var(--shadow);
}

.page-content-section h3 {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--black);
  margin: 28px 0 12px;
  border-left: 6px solid var(--red);
  padding-left: 14px;
}

.page-content-section p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.page-content-section ul,
.page-content-section ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.page-content-section li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.page-content-section a {
  color: var(--black);
  border-bottom: 2px solid var(--blue);
  font-weight: 600;
  transition: border-color 0.12s, background 0.12s;
  padding: 0 2px;
}

.page-content-section a:hover {
  background: var(--blue);
  border-color: var(--black);
}

.page-content-section strong {
  font-weight: 700;
  color: var(--black);
}

.page-content-section blockquote {
  border-left: 5px solid var(--red);
  background: var(--white);
  padding: 16px 20px;
  margin: 20px 0;
  font-style: italic;
  box-shadow: var(--shadow-sm);
  border-top: var(--border);
  border-right: var(--border);
  border-bottom: var(--border);
}

.page-content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-family: var(--font-code);
  font-size: 0.9rem;
}

.page-content-section th {
  background: var(--black);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  border: var(--border);
}

.page-content-section td {
  padding: 10px 14px;
  border: 2px solid var(--black);
  background: var(--white);
}

.page-content-section tr:nth-child(even) td {
  background: var(--bg);
}

/* ============================
   Aside
   ============================ */
.site-aside {
  padding: 36px 24px;
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  background: var(--white);
  border-left: 0;
  min-height: 200px;
}

.aside-title {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  padding: 6px 14px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.aside-title span {
  display: inline;
}

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

.aside-link {
  font-family: var(--font-code);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black);
  background: var(--bg);
  border: var(--border);
  padding: 8px 14px;
  min-height: 40px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}

.aside-link:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--black);
}

.aside-card {
  border: var(--border);
  background: var(--blue);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.aside-card-title {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--black);
}

.aside-card-title span {
  display: inline;
}

.aside-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--black);
}

/* ============================
   Footer
   ============================ */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: var(--border);
  padding: 0;
}

.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--red);
  border-bottom: var(--border);
  padding: 28px 40px;
  flex-wrap: wrap;
}

.footer-cta-text {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  flex: 1;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--black);
  border: var(--border);
  padding: 10px 24px;
  min-height: 44px;
  box-shadow: var(--shadow);
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}

.footer-cta-btn:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(255,255,255,0.4);
}

.site-footer > p.footer-brand {
  font-family: var(--font-code);
  font-size: 0.9rem;
  color: var(--blue);
  text-align: center;
  padding: 22px 24px 8px;
  font-weight: 500;
}

.site-footer > small.footer-copy {
  display: block;
  font-family: var(--font-code);
  font-size: 0.78rem;
  color: #888;
  text-align: center;
  padding: 0 24px 24px;
}

/* ============================
   Neubrutalism 卡片（正文内 .card 等）
   ============================ */
.nb-card {
  border: var(--border);
  background: var(--white);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.nb-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

/* 玻璃拟态卡片（如正文中用到） */
.glass-card {
  background: rgba(255, 255, 255, 0.18);
  border: var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px;
}

/* ============================
   视差 / 动效
   ============================ */
@media (prefers-reduced-motion: no-preference) {
  .hero-section {
    transform: translateZ(0);
  }

  .hero-bg-word {
    transition: transform 0.6s cubic-bezier(.2,.8,.4,1);
  }

  .nb-card,
  .aside-link,
  .site-brand,
  .site-nav a,
  .footer-cta-btn {
    transition: transform 0.15s cubic-bezier(.2,.8,.4,1),
                box-shadow 0.15s cubic-bezier(.2,.8,.4,1),
                background 0.12s;
  }
}

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

/* ============================
   响应式断点
   ============================ */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .main-article {
    border-right: none;
    border-bottom: var(--border);
  }

  .site-aside {
    position: static;
    border-top: var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 28px 20px;
  }

  .aside-links {
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 0;
  }

  .aside-card {
    flex: 1 1 200px;
  }
}

@media (max-width: 680px) {
  :root {
    --nav-h: 130px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 16px;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav p {
    justify-content: flex-start;
    gap: 6px;
  }

  .site-nav a {
    font-size: 0.76rem;
    padding: 7px 9px;
    min-height: 40px;
  }

  .hero-text {
    padding: 36px 20px 20px;
    text-align: right;
  }

  .hero-section h1 {
    font-size: clamp(1.6rem, 8vw, 2.5rem);
  }

  .page-content-section section {
    padding: 36px 20px;
  }

  .footer-cta {
    padding: 20px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 375px) {
  .site-nav a {
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .page-content-section section {
    padding: 28px 14px;
  }
}

/* ============================
   app.js 加载的辅助 class
   ============================ */
.is-scrolled .site-header {
  box-shadow: 0 4px 0 var(--black);
}
