@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@700;900&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
  font-size: 16px;
  background: #1f1f1f;
  color: #f5f5f5;
}

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: #1f1f1f;
  color: #f5f5f5;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

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

ul, ol {
  list-style: none;
}

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

/* ===== ELEVATION SHADOWS (4 levels) ===== */
:root {
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.45);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.65), 0 4px 12px rgba(0,0,0,0.45);
  --shadow-xl: 0 28px 60px rgba(0,0,0,0.75), 0 8px 24px rgba(0,0,0,0.5);
  --c-white: #ffffff;
  --c-light: #f5f5f5;
  --c-dark: #1f1f1f;
  --c-mid: #2c2c2c;
  --c-border: #333333;
  --c-accent: #e0e0e0;
  --nav-h: 112px;
}

/* ===== LAYOUT: ASIDE + SITE-BODY ===== */
.dark-theme {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== ASIDE NAV (顶部固定，两行) ===== */
.site-aside {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: var(--c-white);
  text-transform: uppercase;
}

/* Search */
.header-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--c-mid);
  border: 1px solid var(--c-border);
  overflow: hidden;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--c-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 8px 12px;
  width: 200px;
  outline: none;
}

.search-input::placeholder {
  color: #666;
}

.search-btn {
  background: transparent;
  border: none;
  color: var(--c-light);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.search-btn:hover {
  background: rgba(255,255,255,0.08);
}

/* Nav row */
.site-aside > nav {
  padding: 0 32px;
}

.site-aside > nav > ul {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.site-aside > nav > ul > li > a {
  display: block;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #c0c0c0;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.site-aside > nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--c-white);
  transform: scaleX(0);
  transition: transform 0.25s;
}

.site-aside > nav > ul > li > a:hover {
  color: var(--c-white);
}

.site-aside > nav > ul > li > a:hover::after {
  transform: scaleX(1);
}

/* ===== SITE BODY ===== */
.site-body {
  margin-top: var(--nav-h);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translateZ(0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10,10,10,0.92) 0%,
    rgba(20,20,20,0.75) 50%,
    rgba(10,10,10,0.55) 100%
  );
  z-index: 2;
}

/* 斜切色带 */
.hero-slash {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    -12deg,
    transparent 55%,
    rgba(255,255,255,0.04) 55%,
    rgba(255,255,255,0.04) 58%,
    transparent 58%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 0 5vw;
  max-width: 760px;
}

.hero-eyebrow {
  margin-bottom: 16px;
}

.hud-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #999;
  border: 1px solid #444;
  padding: 4px 10px;
  background: rgba(31,31,31,0.7);
  backdrop-filter: blur(4px);
}

.hero-h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5.5vw, 4rem);
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--c-white);
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 0 0 40px rgba(255,255,255,0.15);
}

.hero-desc {
  font-size: 1rem;
  color: #aaa;
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  background: var(--c-white);
  color: var(--c-dark);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: box-shadow 0.25s, transform 0.2s;
  min-height: 48px;
}

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

/* HUD 装饰线 */
.hero-hud-lines {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.hud-line {
  position: absolute;
  background: rgba(255,255,255,0.06);
}

.hud-line-1 {
  left: 0;
  right: 0;
  top: 30%;
  height: 1px;
}

.hud-line-2 {
  left: 42%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.hud-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(255,255,255,0.25);
  border-style: solid;
}

.hud-corner-tl {
  top: 24px;
  left: 24px;
  border-width: 2px 0 0 2px;
}

.hud-corner-br {
  bottom: 24px;
  right: 24px;
  border-width: 0 2px 2px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  background: var(--c-dark);
}

.content-section {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas: "deco sidebar" "deco content";
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 32px 80px;
}

/* figure 装饰（左侧层叠层） */
.content-deco-figure {
  grid-area: deco;
  position: relative;
  width: 220px;
  padding-right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.deco-layer {
  position: relative;
  height: 4px;
  transform-origin: left center;
}

.deco-layer-1 {
  background: rgba(255,255,255,0.5);
  width: 80%;
  box-shadow: var(--shadow-sm);
  z-index: 3;
}

.deco-layer-2 {
  background: rgba(255,255,255,0.25);
  width: 60%;
  margin-left: 16px;
  z-index: 2;
}

.deco-layer-3 {
  background: rgba(255,255,255,0.1);
  width: 40%;
  margin-left: 32px;
  z-index: 1;
}

/* 侧边栏 */
.content-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  background: var(--c-mid);
  box-shadow: var(--shadow-md);
  z-index: 20;
  padding: 24px;
  margin-bottom: 32px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #666;
  display: block;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-link {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #999;
  padding: 7px 10px;
  letter-spacing: 0.04em;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.sidebar-nav-link:hover {
  color: var(--c-white);
  background: rgba(255,255,255,0.06);
}

/* 正文区 */
.page-content-wrap {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  z-index: 10;
}

/* ===== PAGE CONTENT (from CMS) ===== */
.page-content-wrap h2,
.page-content-wrap h3,
.page-content-wrap h4 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-white);
}

.page-content-wrap h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  margin: 56px 0 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}

.page-content-wrap h3 {
  font-size: 1.1rem;
  margin: 36px 0 14px;
}

.page-content-wrap p {
  font-size: 1rem;
  line-height: 1.85;
  color: #c8c8c8;
  margin-bottom: 20px;
}

.page-content-wrap ul,
.page-content-wrap ol {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 20px;
}

.page-content-wrap ol {
  list-style: decimal;
}

.page-content-wrap li {
  font-size: 1rem;
  line-height: 1.85;
  color: #c0c0c0;
  margin-bottom: 8px;
}

.page-content-wrap a {
  color: var(--c-white);
  border-bottom: 1px solid #555;
  transition: border-color 0.2s;
}

.page-content-wrap a:hover {
  border-color: var(--c-white);
}

.page-content-wrap blockquote {
  border-left: 3px solid var(--c-white);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--c-mid);
  box-shadow: var(--shadow-sm);
  color: #bbb;
  font-style: italic;
}

.page-content-wrap strong {
  color: var(--c-white);
  font-weight: 500;
}

.page-content-wrap article {
  position: relative;
  padding: 40px 0;
  margin-bottom: 8px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.page-content-wrap article:last-child {
  border-bottom: none;
}

/* 浮动层叠卡感 */
.page-content-wrap article::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 40px;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.page-content-wrap article:hover::before {
  opacity: 1;
}

/* ===== SMALL EYEBROW (h2 前紧邻) ===== */
small.hud-label {
  display: inline-block;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #111;
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  position: relative;
  z-index: 30;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 32px;
}

.footer-brand-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-white);
  opacity: 0.9;
}

.footer-nav > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.footer-nav > ul > li > a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  min-height: 40px;
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-nav > ul > li > a:hover {
  color: var(--c-light);
}

.footer-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #555;
  letter-spacing: 0.05em;
}

/* ===== STAGGER ANIMATION ===== */
@media (prefers-reduced-motion: no-preference) {
  .site-aside > nav > ul > li {
    opacity: 0;
    transform: translateY(-8px);
    animation: staggerFadeIn 0.4s ease forwards;
  }

  .site-aside > nav > ul > li:nth-child(1) { animation-delay: 0.05s; }
  .site-aside > nav > ul > li:nth-child(2) { animation-delay: 0.10s; }
  .site-aside > nav > ul > li:nth-child(3) { animation-delay: 0.15s; }
  .site-aside > nav > ul > li:nth-child(4) { animation-delay: 0.20s; }
  .site-aside > nav > ul > li:nth-child(5) { animation-delay: 0.25s; }
  .site-aside > nav > ul > li:nth-child(6) { animation-delay: 0.30s; }
  .site-aside > nav > ul > li:nth-child(7) { animation-delay: 0.35s; }

  @keyframes staggerFadeIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .page-content-wrap article {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .page-content-wrap article.in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-content-wrap article {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  :root {
    --nav-h: 104px;
  }

  .content-section {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "content";
    padding: 32px 20px 60px;
  }

  .content-deco-figure {
    display: none;
  }

  .content-sidebar {
    position: relative;
    top: auto;
    width: 100%;
    margin-bottom: 32px;
  }

  .page-content-wrap {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 96px;
  }

  .brand-row {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-input {
    width: 130px;
  }

  .site-aside > nav {
    padding: 0 16px;
    overflow-x: auto;
  }

  .site-aside > nav > ul {
    flex-wrap: nowrap;
    min-width: max-content;
  }

  .site-aside > nav > ul > li > a {
    padding: 12px 12px;
    font-size: 0.72rem;
  }

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

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

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

  .hero-cta {
    padding: 12px 24px;
  }

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

  .footer-nav > ul {
    gap: 0;
  }

  .footer-nav > ul > li > a {
    padding: 10px 10px;
  }

  .content-section {
    padding: 24px 16px 40px;
  }

  .page-content-wrap h2 {
    font-size: 1.1rem;
  }
}
