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

/* ========== CSS 变量 ========== */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000000;
  --white: #ffffff;
  --bg: #f5f5f5;
  --shadow: 5px 5px 0 #000;
  --shadow-sm: 3px 3px 0 #000;
  --border: 3px solid #000;
  --radius: 0px;
  --font-heading: 'Orbitron', 'Exo 2', sans-serif;
  --font-body: 'Exo 2', system-ui, sans-serif;
  --nav-h: 64px;
  --anchor-h: 44px;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--black);
}
body { font-family: var(--font-body); min-width: 320px; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ========== Scroll offset for sticky nav ========== */
article[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--anchor-h) + 8px);
}

/* ========== 全站包裹 ========== */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* ========== 顶部 Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--black);
  border-bottom: var(--border);
  height: var(--nav-h);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  min-width: 48px;
  min-height: 40px;
}
.nav-logo-img { height: 40px; width: auto; display: block; }
.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* 搜索框 */
.header-search { flex: 1; max-width: 360px; }
.search-form { display: flex; gap: 0; }
.search-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 3px solid var(--white);
  border-right: none;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--black);
  outline: none;
}
.search-input::placeholder { color: #888; }
.search-btn {
  height: 40px;
  padding: 0 18px;
  background: var(--blue);
  color: var(--black);
  border: 3px solid var(--white);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.search-btn:hover { background: var(--red); color: var(--white); }

/* 汉堡按钮 */
.hamburger-btn {
  margin-left: auto;
  width: 48px;
  height: 48px;
  background: var(--red);
  border: 3px solid var(--white);
  box-shadow: 3px 3px 0 var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.hamburger-btn:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--white); }
.ham-bar {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--white);
}

/* ========== 全屏遮罩菜单 ========== */
.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.overlay-menu.is-open {
  opacity: 1;
  pointer-events: all;
}
.overlay-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--red);
  color: var(--white);
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  font-size: 1.4rem;
  width: 52px;
  height: 52px;
  font-weight: 700;
  transition: transform 0.1s;
}
.overlay-close:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--white); }

/* aside > nav > ul > li > a 契约结构 */
.overlay-aside { width: 100%; max-width: 640px; padding: 32px; }
.overlay-nav ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.overlay-nav li a {
  display: block;
  padding: 18px 28px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  background: transparent;
  border: 3px solid var(--blue);
  box-shadow: var(--shadow);
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.1s;
  min-height: 60px;
  line-height: 1.2;
}
.overlay-nav li a:hover,
.overlay-nav li a:focus {
  background: var(--blue);
  color: var(--black);
  transform: translate(-3px,-3px);
  box-shadow: 8px 8px 0 var(--red);
}
.overlay-nav li a:focus { outline: 2px dashed var(--red); outline-offset: 2px; }

/* ========== 粘性锚点条 ========== */
.sticky-anchor-aside {
  position: sticky;
  top: var(--nav-h);
  z-index: 190;
  background: var(--blue);
  border-bottom: 3px solid var(--black);
  height: var(--anchor-h);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.sticky-anchor-aside::-webkit-scrollbar { display: none; }
.sticky-anchor-nav { height: 100%; }
.sticky-anchor-nav ul {
  display: flex;
  align-items: stretch;
  height: 100%;
  white-space: nowrap;
  padding: 0 8px;
}
.sticky-anchor-nav li { display: flex; align-items: center; }
.sticky-anchor-nav li a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: 0.04em;
  border-right: 2px solid var(--black);
  transition: background 0.15s, color 0.15s;
}
.sticky-anchor-nav li:last-child a { border-right: none; }
.sticky-anchor-nav li a:hover,
.sticky-anchor-nav li a:focus {
  background: var(--black);
  color: var(--blue);
}
.sticky-anchor-nav li a:focus { outline: 2px dashed var(--red); }

/* ========== Hero ========== */
.hero-block {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 4px solid var(--black);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.82) 45%, rgba(59,177,255,0.38) 100%);
}
.hero-content {
  position: relative;
  z-index: 10;
  max-width: 700px;
  padding: 48px 40px 80px;
  text-align: left;
}
.hero-h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-shadow: 4px 4px 0 var(--black);
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 32px;
  line-height: 1.6;
}
.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  border: 3px solid var(--black);
  box-shadow: 5px 5px 0 var(--black);
  letter-spacing: 0.06em;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.hero-cta:hover {
  background: var(--blue);
  color: var(--black);
  transform: translate(-3px,-3px);
  box-shadow: 8px 8px 0 var(--black);
}
/* 45° 斜切色带 */
.hero-slash {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 30%, 100% 100%);
  z-index: 20;
}

/* ========== 主体内容区 ========== */
.site-main {
  flex: 1;
  padding: 48px 0;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* main > div.wrap > article > section 四层直接嵌套契约 */
.content-section {
  background: var(--white);
  border: 3px solid var(--black);
  box-shadow: var(--shadow);
  padding: 0;
}
.content-article {
  padding: 40px 48px;
}

/* ========== 正文内容通用排版 ========== */
.content-article h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--black);
  border-left: 6px solid var(--blue);
  padding-left: 16px;
  margin: 48px 0 8px;
  letter-spacing: 0.03em;
}
.content-article h2:first-child { margin-top: 0; }
.content-article .subtitle,
.content-article .subhead,
.content-article .desc,
.content-article .lead,
.content-article p.subtitle {
  font-size: 1rem;
  color: #444;
  margin-bottom: 20px;
  line-height: 1.7;
}
.content-article h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red);
  margin: 32px 0 10px;
  letter-spacing: 0.02em;
}
.content-article p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
  color: #222;
}
.content-article a {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
  transition: color 0.12s, border-color 0.12s;
}
.content-article a:hover { color: var(--red); border-color: var(--red); }
.content-article ul,
.content-article ol {
  margin: 0 0 20px 24px;
}
.content-article li {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.7;
}
.content-article ul li { list-style: square; }
.content-article ol li { list-style: decimal; }

/* article 区块分隔（page.content 的 article） */
.content-article > article {
  border-top: 3px solid var(--black);
  padding-top: 40px;
  margin-top: 40px;
}
.content-article > article:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* 卡片式子块（正文内如有 .card 类） */
.content-article .card {
  background: rgba(59,177,255,0.08);
  border: 3px solid var(--black);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin: 24px 0;
  border-radius: var(--radius);
}

/* 表格 */
.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.content-article th {
  background: var(--black);
  color: var(--white);
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-align: left;
}
.content-article td {
  padding: 10px 16px;
  border: 2px solid var(--black);
}
.content-article tr:nth-child(even) td { background: rgba(59,177,255,0.07); }

/* blockquote */
.content-article blockquote {
  border-left: 6px solid var(--red);
  margin: 24px 0;
  padding: 16px 24px;
  background: rgba(255,82,82,0.06);
  font-style: italic;
}

/* ========== 正文内的 h2 + .subtitle 契约结构 ========== */
/* 由 build2 自动补齐，CSS 确保视觉正常 */
.content-article h2 + .subtitle,
.content-article h2 + .subhead,
.content-article h2 + .desc,
.content-article h2 + .lead {
  margin-top: 0;
  margin-bottom: 24px;
  color: #555;
  font-size: 1.05rem;
}

/* ========== 页脚 footer：仅 p + small ========== */
.site-footer {
  background: var(--black);
  border-top: 4px solid var(--red);
  padding: 48px 20px 32px;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 20px;
  text-shadow: 4px 4px 0 var(--red);
}
.footer-copy {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
}

/* ========== 动效：parallax + hover micro-interaction ========== */
@media (prefers-reduced-motion: no-preference) {
  .hero-block { will-change: transform; }
  .content-article > article {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .content-article > article.in-view {
    opacity: 1;
    transform: none;
  }
  .hero-cta { will-change: transform, box-shadow; }
  .overlay-nav li a { will-change: transform, box-shadow; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .header-search { display: none; }
  .content-article { padding: 24px 16px; }
  .hero-content { padding: 32px 20px 72px; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 0.95rem; }
  .site-main { padding: 28px 0; }
  .content-article h2 { font-size: 1.2rem; }
  .footer-brand { font-size: 2.2rem; }
}
@media (max-width: 480px) {
  .hero-block { min-height: 60vh; }
  .hero-h1 { font-size: 1.5rem; }
  .hero-cta { font-size: 0.9rem; padding: 12px 24px; }
  .sticky-anchor-nav li a { font-size: 0.7rem; padding: 0 10px; }
}

/* ========== 焦点可见性 ========== */
:focus-visible {
  outline: 2px dashed var(--red);
  outline-offset: 3px;
}

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