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

/* ===== CSS 变量 ===== */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000000;
  --white: #ffffff;
  --yellow: #ffe600;
  --bg: #f5f5f0;
  --card-bg: #ffffff;
  --border: 3px solid #000;
  --shadow: 5px 5px 0 #000;
  --shadow-sm: 3px 3px 0 #000;
  --shadow-lg: 8px 8px 0 #000;
  --radius-card: 28px;
  --radius-sm: 6px;
  --font-main: 'Archivo', 'Space Grotesk', system-ui, sans-serif;
  --nav-height: 110px;
  --transition: 0.18s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body, .nb-body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--black);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

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

/* ===== scroll-margin for anchored sections ===== */
div[id] {
  scroll-margin-top: 120px;
}

/* ===== 全屏遮罩菜单 ===== */
.overlay-menu {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay-menu.is-open {
  opacity: 1;
  pointer-events: all;
}

.overlay-inner {
  text-align: center;
  position: relative;
  width: 100%;
  padding: 2rem;
}

.overlay-close {
  position: absolute;
  top: -40px;
  right: 2rem;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-family: var(--font-main);
  transition: transform var(--transition);
  min-height: 44px;
  min-width: 44px;
}

.overlay-close:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--red);
}

.overlay-nav ul {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
}

.overlay-nav .nav-link {
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  padding: 0.6rem 1.5rem;
  border: 3px solid transparent;
  display: inline-block;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  min-height: 52px;
  line-height: 1.4;
}

.overlay-nav .nav-link:hover,
.overlay-nav .nav-link:focus {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(59,177,255,0.08);
  outline: none;
}

.overlay-brand {
  margin-top: 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ===== 页面包装 ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== ASIDE 导航（顶部两行） ===== */
.site-aside {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: var(--border);
  box-shadow: 0 4px 0 var(--black);
  width: 100%;
}

.aside-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  border-bottom: 2px solid rgba(0,0,0,0.12);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

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

.aside-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-form {
  display: flex;
  align-items: center;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--white);
  overflow: hidden;
}

.search-input {
  border: none;
  outline: none;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  width: 180px;
  background: transparent;
  min-height: 44px;
}

.search-btn {
  background: var(--blue);
  border: none;
  border-left: var(--border);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  transition: background var(--transition);
}

.search-btn:hover {
  background: var(--red);
}

.hamburger-btn {
  background: var(--black);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hamburger-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--red);
}

.ham-bar {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--white);
}

.aside-nav-row {
  padding: 0.5rem 2rem;
  overflow-x: auto;
}

.aside-nav-row nav ul {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
  align-items: center;
}

.aside-nav-row nav ul li a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  min-height: 44px;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.aside-nav-row nav ul li a:hover,
.aside-nav-row nav ul li a:focus {
  border-color: var(--black);
  background: var(--blue);
  color: var(--black);
  box-shadow: var(--shadow-sm);
  outline: none;
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--black);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--black);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59,177,255,0.45) 0%, rgba(0,0,0,0.7) 50%, rgba(255,82,82,0.35) 100%);
}

.hero-diagonal {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 2rem 5rem;
  max-width: 860px;
  margin: 0 auto;
}

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

.hero-desc {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255,255,255,0.88);
  margin-bottom: 2rem;
  font-weight: 500;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--black);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.8rem 2.2rem;
  border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 52px;
}

.hero-cta:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--red);
}

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

/* ===== MAIN > ARTICLE > SECTION ===== */
.main-content {
  min-width: 0;
}

.content-article {
  width: 100%;
}

.page-content-section {
  width: 100%;
}

/* ===== 正文内容区块样式（page.content 注入的 div 样式） ===== */
.page-content-section div {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--card-bg);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.page-content-section div.revealed {
  opacity: 1;
  transform: translateY(0);
}

.page-content-section div:nth-child(1) { transition-delay: 0.05s; }
.page-content-section div:nth-child(2) { transition-delay: 0.10s; }
.page-content-section div:nth-child(3) { transition-delay: 0.15s; }
.page-content-section div:nth-child(4) { transition-delay: 0.20s; }
.page-content-section div:nth-child(5) { transition-delay: 0.25s; }
.page-content-section div:nth-child(6) { transition-delay: 0.30s; }
.page-content-section div:nth-child(7) { transition-delay: 0.35s; }

.page-content-section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.page-content-section h2 + hr {
  border: none;
  border-top: 3px solid var(--blue);
  margin-bottom: 1.2rem;
}

.page-content-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 1.2rem;
}

.page-content-section h3 + hr {
  border: none;
  border-top: 2px solid var(--red);
  margin-bottom: 1rem;
}

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

.page-content-section ul,
.page-content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 0.9rem;
}

.page-content-section li {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 0.3rem;
  list-style: disc;
}

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

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

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

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

/* div 左侧色条装饰 */
.page-content-section div:nth-child(odd)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--blue);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.page-content-section div:nth-child(even)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--red);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ===== 侧边栏 ===== */
.sidebar-aside {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-aside > nav {
  display: none;
}

.sidebar-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}

.sidebar-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-card hr {
  border: none;
  border-top: 3px solid var(--black);
  margin-bottom: 1rem;
}

.sidebar-index-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-index-list li a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  min-height: 44px;
  width: 100%;
}

.sidebar-index-list li a:hover {
  border-color: var(--black);
  background: var(--blue);
  box-shadow: var(--shadow-sm);
}

.sidebar-tip p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #444;
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: 4px solid var(--blue);
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(59,177,255,0.35);
}

.footer-about-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.7);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col ul li a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--blue);
}

.footer-col address {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.contact-item {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  display: block;
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-link-list li a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-link-list li a:hover {
  color: var(--red);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-copy {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  margin-bottom: 0.3rem;
}

.footer-icp {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

/* ===== HR 全局样式 ===== */
hr {
  border: none;
  border-top: 3px solid var(--black);
  margin: 1rem 0;
}

/* ===== 滚动动效 ===== */
@media (prefers-reduced-motion: reduce) {
  .page-content-section div {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr 240px;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 90px;
  }

  .aside-brand-row {
    padding: 0.6rem 1rem;
  }

  .aside-nav-row {
    padding: 0.4rem 1rem;
  }

  .aside-nav-row nav ul {
    gap: 0.1rem;
  }

  .aside-nav-row nav ul li a {
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    min-height: 44px;
  }

  .search-input {
    width: 110px;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .content-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .sidebar-aside {
    position: static;
  }

  .sidebar-aside > nav {
    display: none;
  }

  .hero-section {
    min-height: 55vh;
  }

  .hero-content {
    padding: 2rem 1rem 4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .page-content-section div {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    padding: 2rem 1rem 1rem;
  }

  .aside-nav-row {
    display: none;
  }

  .search-wrap {
    display: none;
  }

  .brand-text {
    font-size: 1.2rem;
  }

  .hamburger-btn {
    min-height: 48px;
    min-width: 48px;
  }
}
