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

/* =============================================
   CSS 变量 & 基础重置
============================================= */
:root {
  --c-white: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-soft: #444444;
  --c-ink-muted: #888888;
  --c-accent: #c0392b;
  --c-accent-dim: rgba(192, 57, 43, 0.12);
  --c-border: rgba(31,31,31,0.10);
  --c-overlay: rgba(31,31,31,0.04);

  --shadow-sm: 0 2px 8px rgba(31,31,31,0.08);
  --shadow-md: 0 6px 20px rgba(31,31,31,0.12);
  --shadow-lg: 0 16px 40px rgba(31,31,31,0.16);
  --shadow-xl: 0 28px 60px rgba(31,31,31,0.22);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --nav-w: 220px;
  --font: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  --transition-fast: 0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-std: 0.28s cubic-bezier(0.4,0,0.2,1);
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* =============================================
   布局骨架：左侧固定侧边 + 右侧滚动内容
============================================= */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* =============================================
   左侧竖排导航 (sidebar-nav)
============================================= */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-white);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  padding: 28px 0 20px;
  z-index: 40;
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 8px;
}

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

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-tagline {
  font-size: 11px;
  color: var(--c-ink-muted);
  padding: 6px 20px 12px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 10px;
}

/* 有序导航列表 */
.nav-list {
  flex: 1;
  padding: 0 12px;
  counter-reset: nav-counter;
}

.nav-list > li {
  counter-increment: nav-counter;
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink-soft);
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 1;
  min-height: 42px;
}

.nav-link::before {
  content: counter(nav-counter, decimal-leading-zero);
  font-size: 10px;
  font-weight: 300;
  color: var(--c-ink-muted);
  min-width: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--c-accent-dim);
  color: var(--c-accent);
  transform: translateX(3px) translateZ(0);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.sidebar-footer-note {
  padding: 14px 20px 0;
  font-size: 11px;
  color: var(--c-ink-muted);
  border-top: 1px solid var(--c-border);
  margin-top: auto;
  line-height: 1.6;
}

/* =============================================
   右侧内容区
============================================= */
.content-wrap {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* =============================================
   Hero 区块
============================================= */
.hero-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 70vh;
  padding: 60px 48px 60px 48px;
  background: var(--c-white);
  position: relative;
  z-index: 3;
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(192,57,43,0.05) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-text {
  flex: 1;
  max-width: 480px;
  text-align: right;
  position: relative;
  z-index: 2;
  padding-right: 40px;
}

.hero-h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 16px;
  font-weight: 300;
  color: var(--c-ink-soft);
  line-height: 1.7;
}

.hero-media {
  flex: 1;
  max-width: 480px;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  max-width: 460px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateZ(0);
  transition: transform var(--transition-std), box-shadow var(--transition-std);
}

.hero-img:hover {
  transform: translateY(-6px) translateZ(0);
  box-shadow: 0 36px 72px rgba(31,31,31,0.26);
}

.hero-media--empty {
  min-height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--c-surface) 0%, rgba(192,57,43,0.06) 100%);
}

/* =============================================
   正文 + 侧边栏布局
============================================= */
.body-layout {
  display: flex;
  flex: 1;
  gap: 32px;
  padding: 40px 48px 40px 48px;
  align-items: flex-start;
}

.main-area {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

/* =============================================
   正文 section > div
============================================= */
.page-article {
  position: relative;
}

.page-content-section {
  position: relative;
  z-index: 2;
}

/* 页面 content 内部元素样式 */
.page-content-section h2,
.page-content-section h3 {
  font-weight: 700;
  color: var(--c-ink);
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.page-content-section h2 { font-size: 1.4rem; }
.page-content-section h3 { font-size: 1.15rem; }

.page-content-section p {
  margin-bottom: 1em;
  color: var(--c-ink-soft);
}

.page-content-section ul,
.page-content-section ol {
  margin: 0.8em 0 1em 1.4em;
  list-style: revert;
}

.page-content-section li {
  margin-bottom: 0.4em;
  color: var(--c-ink-soft);
}

.page-content-section a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition-fast);
}

.page-content-section a:hover { opacity: 0.75; }

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

/* div 内部区块卡片化 */
.page-content-section div {
  background: var(--c-white);
  border-radius: var(--radius-md);
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
  transition: transform var(--transition-std), box-shadow var(--transition-std);
  scroll-margin-top: 32px;
}

.page-content-section div:hover {
  transform: translateY(-3px) translateZ(0);
  box-shadow: var(--shadow-lg);
}

/* small 眉题（紧邻在 h2/h3 之前） */
.page-content-section small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--c-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* =============================================
   侧边栏 aside（右侧，内容区右侧）
============================================= */
.sidebar-aside {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  z-index: 3;
}

.aside-card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 3;
  overflow: hidden;
}

.aside-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-accent), rgba(192,57,43,0.3));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.aside-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--c-accent);
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}

.aside-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}

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

.aside-link {
  display: block;
  font-size: 13px;
  color: var(--c-ink-soft);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  min-height: 34px;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  background: var(--c-accent-dim);
  color: var(--c-accent);
  transform: translateX(4px);
}

.aside-tip {
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 4px;
}

.aside-tip-text {
  font-size: 12px;
  color: var(--c-ink-muted);
  line-height: 1.6;
  margin: 0;
}

/* =============================================
   页脚：3列 dl 并排
============================================= */
.site-footer {
  display: flex;
  gap: 0;
  background: var(--c-ink);
  color: var(--c-surface);
  padding: 28px 48px;
  margin-top: auto;
  position: relative;
  z-index: 4;
  box-shadow: 0 -4px 20px rgba(31,31,31,0.18);
}

.footer-dl {
  flex: 1;
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.footer-dl:first-child { padding-left: 0; }
.footer-dl:last-child { border-right: none; }

.footer-dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.footer-dd {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.8;
  margin-bottom: 2px;
}

.footer-link {
  color: rgba(255,255,255,0.55);
  transition: color var(--transition-fast);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.footer-link:hover { color: var(--c-white); }

/* =============================================
   内容 div 间分隔 & 层次
============================================= */
.page-content-section div:nth-child(even) {
  background: var(--c-white);
  z-index: 1;
  transform: translateZ(0);
}

.page-content-section div:nth-child(odd) {
  background: var(--c-white);
  z-index: 2;
}

/* 高层级浮动装饰层 */
.page-content-section div::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-border), transparent);
  pointer-events: none;
}

/* =============================================
   动效：stagger list & hover micro
============================================= */
@media (prefers-reduced-motion: no-preference) {
  .nav-list > li {
    opacity: 0;
    transform: translateX(-16px);
    animation: slideInLeft var(--transition-std) forwards;
  }

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

  @keyframes slideInLeft {
    to { opacity: 1; transform: translateX(0); }
  }

  .page-content-section div {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.4s ease forwards;
  }

  .page-content-section div:nth-child(1) { animation-delay: 0.08s; }
  .page-content-section div:nth-child(2) { animation-delay: 0.16s; }
  .page-content-section div:nth-child(3) { animation-delay: 0.24s; }
  .page-content-section div:nth-child(4) { animation-delay: 0.32s; }
  .page-content-section div:nth-child(5) { animation-delay: 0.40s; }
  .page-content-section div:nth-child(6) { animation-delay: 0.48s; }
  .page-content-section div:nth-child(7) { animation-delay: 0.56s; }

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

  .aside-card {
    animation: fadeIn 0.5s ease 0.3s both;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
  }
}

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

/* =============================================
   响应式：移动端（≤768px）
============================================= */
@media (max-width: 768px) {
  :root { --nav-w: 0px; }

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

  .sidebar-nav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    padding: 16px 0 12px;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: visible;
  }

  .sidebar-brand { padding: 0 16px 12px; }
  .sidebar-tagline { padding: 6px 16px 10px; }
  .sidebar-footer-note { display: none; }

  .nav-list {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list > li { margin-bottom: 0; }

  .nav-link {
    padding: 10px 14px;
    min-height: 42px;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-link::before { display: none; }

  .content-wrap { margin-left: 0; }

  .hero-section {
    flex-direction: column;
    min-height: auto;
    padding: 40px 20px 32px;
    gap: 24px;
  }

  .hero-text {
    text-align: left;
    max-width: 100%;
    padding-right: 0;
    order: 1;
  }

  .hero-media {
    max-width: 100%;
    order: 2;
  }

  .body-layout {
    flex-direction: column;
    padding: 24px 16px;
    gap: 24px;
  }

  .sidebar-aside {
    width: 100%;
    position: static;
  }

  .page-content-section div {
    padding: 20px 18px;
    margin-bottom: 16px;
  }

  .site-footer {
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px;
  }

  .footer-dl {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0 0 16px;
  }

  .footer-dl:last-child { border-bottom: none; padding-bottom: 0; }
  .footer-dl:first-child { padding-left: 0; }
}

/* =============================================
   平板（769~1100px）调整
============================================= */
@media (min-width: 769px) and (max-width: 1100px) {
  :root { --nav-w: 200px; }

  .hero-section { padding: 40px 32px; }
  .body-layout { padding: 28px 28px; gap: 20px; }
  .sidebar-aside { width: 200px; }
  .site-footer { padding: 24px 28px; }
}

/* =============================================
   div 内 scroll-margin-top（配合固定左侧导航）
============================================= */
div[id] {
  scroll-margin-top: 32px;
}

@media (max-width: 768px) {
  div[id] {
    scroll-margin-top: 80px;
  }
}

/* =============================================
   Z-index 层级规范
   z1: 背景/content div odd
   z2: 主要内容/cards
   z3: sticky aside / hero content
   z4: footer
   z40: fixed nav
============================================= */

/* =============================================
   焦点可访问性
============================================= */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* =============================================
   选中样式
============================================= */
::selection {
  background: rgba(192,57,43,0.15);
  color: var(--c-ink);
}

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