@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

/* ── 变量 ── */
:root {
  --green: #00ff80;
  --blue: #0000ff;
  --black: #000000;
  --white: #ffffff;
  --border: 3px solid var(--black);
  --border-green: 3px solid var(--green);
  --border-blue: 3px solid var(--blue);
  --sidebar-w: 240px;
  --aside-w: 160px;
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-sans: 'Atkinson Hyperlegible', system-ui, sans-serif;
}

/* ── 重置 ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body.body-root {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: none;
}

a:hover, a:focus {
  color: var(--black);
  background: var(--green);
  outline: none;
}

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

ul, ol {
  list-style: none;
}

/* ── 布局根 ── */
.site-root {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── 左侧固定导航 ── */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--black);
  border-right: var(--border-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  z-index: 100;
  overflow-y: auto;
}

.nav-brand {
  width: 100%;
  margin-bottom: 2.5rem;
  text-align: center;
}

.brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  background: none;
  color: var(--white);
}

.brand-link:hover, .brand-link:focus {
  background: none;
  color: var(--green);
}

.brand-logo {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: var(--border-green);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--green);
  border-bottom: 2px solid var(--green);
  padding-bottom: 0.25rem;
}

/* nav > ol > li > a  ← 契约结构 */
.nav-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  counter-reset: nav-counter;
}

.nav-list > li {
  border: 2px solid transparent;
}

.nav-list > li:hover {
  border-color: var(--green);
}

.nav-list > li > a {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  min-height: 44px;
}

.nav-list > li > a::before {
  counter-increment: nav-counter;
  content: counter(nav-counter, decimal-leading-zero) ".";
  color: var(--green);
  margin-right: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.nav-list > li > a:hover,
.nav-list > li > a:focus {
  color: var(--black);
  background: var(--green);
}

.nav-contact {
  margin-top: auto;
  padding-top: 2rem;
  width: 100%;
  border-top: 2px solid var(--blue);
  text-align: center;
}

.nav-contact-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--blue);
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
}

.nav-contact-link {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--white);
  word-break: break-all;
  padding: 0.4rem 0.5rem;
  display: inline-block;
  min-height: 40px;
}

.nav-contact-link:hover, .nav-contact-link:focus {
  background: var(--blue);
  color: var(--white);
}

.nav-deco {
  display: flex;
  gap: 6px;
  margin-top: 1.5rem;
}

.deco-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  display: block;
}

.deco-dot:nth-child(2) { background: var(--blue); }
.deco-dot:nth-child(3) { background: var(--white); }

/* ── 页面主体（排除侧边导航） ── */
.page-body {
  margin-left: var(--sidebar-w);
  display: flex;
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
}

/* ── aside 在内容左侧 ── */
.sidebar-aside {
  width: var(--aside-w);
  flex-shrink: 0;
  background: var(--black);
  border-right: 2px solid var(--blue);
  padding: 2rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.aside-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aside-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--blue);
  display: block;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 0.4rem;
}

.aside-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #ccc;
}

.aside-keywords {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kw-tag {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--blue);
  color: var(--white);
  padding: 2px 6px;
  display: inline-block;
  border: 1px solid var(--blue);
}

/* ── main > section.wrap > article > div ── */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Hero article ── */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0;
  position: relative;
  background: var(--black);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0,255,128,0.06) 39px, rgba(0,255,128,0.06) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,255,128,0.06) 39px, rgba(0,255,128,0.06) 40px);
  border-bottom: var(--border-green);
  scroll-margin-top: 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0,255,128,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.hero-article {
  position: relative;
  z-index: 1;
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.hero-h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--white);
  border-left: 6px solid var(--green);
  padding-left: 1rem;
  letter-spacing: -0.01em;
}

.hero-lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: #cccccc;
  max-width: 520px;
  padding-left: 1rem;
}

.hero-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-left: 1rem;
}

/* ── CTA 按钮 ── */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--green);
  color: var(--black);
  border: 2px solid var(--green);
  letter-spacing: 0.05em;
  cursor: pointer;
}

.cta-btn:hover, .cta-btn:focus {
  background: var(--black);
  color: var(--green);
}

.cta-btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.cta-btn--outline:hover, .cta-btn--outline:focus {
  background: var(--white);
  color: var(--black);
}

/* ── content sections ── */
.content-sections {
  scroll-margin-top: 0;
}

.content-article {
  padding: 3rem 0;
}

/* ── page.content 内部样式（7 sections） ── */
.content-article article {
  padding: 3.5rem 0;
  border-bottom: 2px solid rgba(0,255,128,0.2);
  scroll-margin-top: 80px;
}

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

.content-article h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--green);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  border-left: 5px solid var(--green);
  padding-left: 0.75rem;
}

.content-article h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--white);
  margin: 1.75rem 0 0.75rem;
  border-bottom: 1px solid rgba(0,255,128,0.3);
  padding-bottom: 0.3rem;
}

.content-article p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #e0e0e0;
  margin-bottom: 1rem;
}

.content-article ul,
.content-article ol {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
}

.content-article ul > li,
.content-article ol > li {
  padding: 0.4rem 0 0.4rem 1.4rem;
  position: relative;
  font-size: 1rem;
  color: #ddd;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.content-article ul > li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 0.9rem;
  top: 0.45rem;
}

.content-article ol {
  counter-reset: ol-counter;
}

.content-article ol > li {
  counter-increment: ol-counter;
}

.content-article ol > li::before {
  content: counter(ol-counter, decimal-leading-zero) ".";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  top: 0.5rem;
}

.content-article strong {
  color: var(--green);
  font-weight: 700;
}

.content-article em {
  color: #bbb;
  font-style: italic;
}

.content-article a {
  color: var(--green);
  border-bottom: 1px solid rgba(0,255,128,0.4);
  padding-bottom: 1px;
}

.content-article a:hover,
.content-article a:focus {
  background: var(--green);
  color: var(--black);
  border-bottom-color: var(--green);
}

.content-article blockquote {
  border-left: 5px solid var(--blue);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(0,0,255,0.08);
  font-style: italic;
  color: #bbb;
}

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

.content-article th,
.content-article td {
  border: 2px solid rgba(0,255,128,0.25);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.content-article th {
  background: rgba(0,255,128,0.1);
  color: var(--green);
  font-family: var(--font-sans);
  font-weight: 700;
}

/* ── 页脚 footer > article × n ── */
.site-footer {
  margin-left: var(--sidebar-w);
  border-top: var(--border-green);
}

.footer-cta {
  background: var(--blue);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.footer-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.7);
  display: block;
}

.footer-cta-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}

.footer-copy {
  background: var(--black);
  border-top: 2px solid rgba(0,255,128,0.2);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #888;
}

.copy-sep { color: var(--green); }

/* ── scroll reveal 动效 ── */
@media (prefers-reduced-motion: no-preference) {
  .content-article article {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

  .content-article article.is-visible {
    opacity: 1;
    transform: none;
  }

  .nav-list > li {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-list > li.is-visible {
    opacity: 1;
    transform: none;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ── 移动端响应式 ── */
@media (max-width: 900px) {
  :root {
    --aside-w: 0px;
    --sidebar-w: 0px;
  }

  .site-root {
    flex-direction: column;
  }

  .sidebar-nav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    border-right: none;
    border-bottom: var(--border-green);
    padding: 1rem;
    gap: 0.5rem;
    overflow-x: hidden;
  }

  .nav-brand {
    margin-bottom: 0.5rem;
    flex-basis: 100%;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
  }

  .nav-list > li {
    flex-shrink: 0;
  }

  .nav-list > li > a {
    font-size: 0.78rem;
    padding: 0.5rem 0.6rem;
    min-height: 44px;
    white-space: nowrap;
  }

  .nav-contact {
    margin-top: 0;
    padding-top: 0.5rem;
    border-top: none;
    text-align: left;
  }

  .nav-deco {
    margin-top: 0;
  }

  .page-body {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
  }

  .sidebar-aside {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 2px solid var(--blue);
    padding: 1rem 1.25rem;
    overflow-x: hidden;
  }

  .aside-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  .aside-desc {
    flex-basis: 100%;
  }

  .main-content {
    width: 100%;
  }

  .wrap {
    padding: 0 1rem;
    max-width: 100%;
  }

  .site-footer {
    margin-left: 0;
  }

  .hero-section {
    min-height: 100svh;
    background-image:
      repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(0,255,128,0.05) 19px, rgba(0,255,128,0.05) 20px),
      repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(0,255,128,0.05) 19px, rgba(0,255,128,0.05) 20px);
  }

  .hero-article {
    padding: 2rem 0;
    min-height: 100svh;
    justify-content: center;
  }

  .footer-cta {
    padding: 2rem 1.25rem;
  }

  .footer-copy {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.75rem;
    padding-left: 0.75rem;
  }

  .hero-lead {
    font-size: 1rem;
    padding-left: 0.75rem;
  }

  .hero-cta-row {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0.75rem;
  }

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

  .content-article h2 {
    font-size: 1.4rem;
  }

  .nav-list > li > a {
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
  }
}
