@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ==========================================
   CSS 变量 & 基础重置
   ========================================== */
:root {
  --c-bg: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-20: rgba(31,31,31,0.12);
  --c-accent: #1f1f1f;
  --c-accent-hover: #444444;
  --c-border: rgba(31,31,31,0.12);
  --c-cta: #1f1f1f;
  --c-cta-text: #ffffff;

  --sidebar-w: 220px;
  --hero-h: 45vh;
  --radius-card: 0px;
  --radius-sm: 4px;

  /* 阴影层级 elevation 1-4 */
  --shadow-sm: 0 1px 3px rgba(31,31,31,0.10), 0 1px 2px rgba(31,31,31,0.08);
  --shadow-md: 0 4px 12px rgba(31,31,31,0.12), 0 2px 6px rgba(31,31,31,0.08);
  --shadow-lg: 0 8px 24px rgba(31,31,31,0.14), 0 4px 10px rgba(31,31,31,0.10);
  --shadow-xl: 0 16px 40px rgba(31,31,31,0.18), 0 8px 20px rgba(31,31,31,0.12);

  --font-base: 'Roboto', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --scroll-offset: 80px;
  --transition-base: 0.25s ease;
}

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

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

body {
  font-family: var(--font-base);
  background: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.65;
  -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;
}

/* scroll-margin for fixed sidebar offset */
section[id] {
  scroll-margin-top: var(--scroll-offset);
}

/* ==========================================
   布局骨架：侧边栏 + 内容区
   ========================================== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================
   左侧固定竖排导航 (aside > nav > ul > li > a)
   ========================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-ink);
  color: var(--c-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.brand-logo {
  display: block;
}

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

.brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav li {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  transition: color var(--transition-base), background var(--transition-base);
  min-height: 44px;
  position: relative;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  outline: none;
}

.nav-indicator {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: background var(--transition-base), transform var(--transition-base);
}

.nav-link:hover .nav-indicator,
.nav-link:focus-visible .nav-indicator {
  background: #ffffff;
  transform: scale(1.8);
}

.nav-text {
  line-height: 1.3;
}

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

/* ==========================================
   Hero：右图左文，45vh，紧凑
   ========================================== */
.hero-block {
  display: flex;
  align-items: center;
  min-height: var(--hero-h);
  background: var(--c-surface);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero-text {
  flex: 1 1 55%;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 3;
}

.hero-h1 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

.hero-desc {
  font-size: 1rem;
  color: var(--c-ink-60);
  max-width: 420px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--c-cta);
  color: var(--c-cta-text);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-height: 44px;
  border-bottom: 3px solid rgba(255,255,255,0.15);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  position: relative;
  z-index: 4;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: var(--c-accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  outline: none;
}

.hero-media {
  flex: 0 0 40%;
  max-width: 40%;
  height: var(--hero-h);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media--empty {
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-media--empty::after {
  content: '';
  display: block;
  width: 80px;
  height: 80px;
  border: 2px solid var(--c-ink-20);
  border-radius: 50%;
}

/* ==========================================
   主内容 main > section > figure/aside
   ========================================== */
.main-content {
  flex: 1;
  padding: 0;
}

.content-section {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-rows: auto 1fr;
  gap: 0;
  position: relative;
  padding: 48px 48px 64px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* figure 作为装饰层叠元素 */
.content-figure {
  grid-column: 1 / 3;
  grid-row: 1 / 2;
  position: relative;
  height: 6px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: visible;
  pointer-events: none;
}

.figure-layer {
  position: absolute;
  top: 0;
  border-radius: 3px;
}

.figure-layer--1 {
  left: 0;
  width: 60%;
  height: 6px;
  background: var(--c-ink);
  z-index: 3;
  box-shadow: var(--shadow-sm);
}

.figure-layer--2 {
  left: 12px;
  top: -4px;
  width: 40%;
  height: 6px;
  background: var(--c-ink-20);
  z-index: 2;
}

.figure-layer--3 {
  left: 24px;
  top: -8px;
  width: 20%;
  height: 6px;
  background: var(--c-border);
  z-index: 1;
}

/* aside 在内容右侧 */
.content-aside {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  background: var(--c-surface);
  padding: 24px 20px;
  position: sticky;
  top: 16px;
  align-self: start;
  box-shadow: var(--shadow-sm);
  border-bottom: 3px solid var(--c-ink);
  margin-left: 32px;
  z-index: 2;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin-bottom: 10px;
}

.content-aside hr,
.prose-wrap hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 10px 0 14px;
}

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

.aside-link {
  display: block;
  font-size: 0.85rem;
  color: var(--c-ink-60);
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition: color var(--transition-base), border-color var(--transition-base);
  line-height: 1.4;
}

.aside-link:hover,
.aside-link:focus-visible {
  color: var(--c-ink);
  border-left-color: var(--c-ink);
  outline: none;
}

/* 正文 prose */
.prose-wrap {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  min-width: 0;
}

/* ==========================================
   正文内 section 样式（page.content 的 sections）
   ========================================== */
.prose-wrap section {
  margin-bottom: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--c-border);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.prose-wrap section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.prose-wrap section:first-child {
  border-top: none;
}

.prose-wrap h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.prose-wrap h2 + hr {
  border: none;
  border-top: 2px solid var(--c-ink);
  margin: 0 0 24px;
  width: 48px;
}

.prose-wrap h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

.prose-wrap h3 + hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 0 0 16px;
  width: 32px;
}

.prose-wrap p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--c-ink);
}

.prose-wrap ul,
.prose-wrap ol {
  margin: 0 0 20px 0;
  padding-left: 0;
}

.prose-wrap ul li,
.prose-wrap ol li {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.65;
}

.prose-wrap ol li {
  list-style: decimal;
}

.prose-wrap a {
  color: var(--c-ink);
  border-bottom: 1px solid var(--c-ink);
  transition: opacity var(--transition-base);
}

.prose-wrap a:hover {
  opacity: 0.65;
}

.prose-wrap strong {
  font-weight: 700;
}

.prose-wrap em {
  font-style: italic;
  color: var(--c-ink-60);
}

/* 卡片样式（底部强调线，圆角 0） */
.prose-wrap .card,
.card {
  background: var(--c-surface);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  border-bottom: 3px solid var(--c-ink);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  position: relative;
  z-index: 1;
}

.prose-wrap .card:hover,
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  z-index: 2;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

/* 表格 */
.prose-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.prose-wrap th,
.prose-wrap td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
}

.prose-wrap th {
  font-weight: 600;
  background: var(--c-surface);
}

/* ==========================================
   页脚
   ========================================== */
.site-footer {
  background: var(--c-ink);
  color: rgba(255,255,255,0.80);
  padding: 0;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  gap: 0;
  align-items: start;
  padding: 40px 48px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.footer-logo-wrap {
  padding-right: 32px;
  display: flex;
  align-items: flex-start;
}

.footer-logo {
  display: block;
}

.footer-logo-img {
  max-height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.footer-brand-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.footer-nav {
  padding: 0 24px;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav li a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition-base);
  padding: 4px 0;
}

.footer-nav li a:hover {
  color: #ffffff;
}

.footer-col {
  padding: 0 24px;
}

.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
}

.footer-contact a {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  transition: color var(--transition-base);
}

.footer-contact a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding: 16px 48px;
  display: flex;
  align-items: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}

/* ==========================================
   hr 全局
   ========================================== */
hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 24px 0;
}

/* ==========================================
   Scroll Reveal 动效
   ========================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* elevation hover micro-interaction */
.elevate {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.elevate:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ==========================================
   prefers-reduced-motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .prose-wrap section,
  .hero-cta,
  .card,
  .prose-wrap .card,
  .elevate {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 180px;
  }

  .content-section {
    padding: 36px 32px 48px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    padding: 32px 32px 24px;
    gap: 28px;
  }

  .footer-logo-wrap {
    grid-column: 1 / 3;
    padding-right: 0;
  }

  .footer-bottom {
    padding: 14px 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --hero-h: auto;
    --scroll-offset: 60px;
  }

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

  /* 移动端：侧边栏变顶部横排 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    z-index: 200;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    overflow-y: visible;
  }

  .sidebar-brand {
    padding: 10px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
  }

  .sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-x: auto;
  }

  .sidebar-nav ul {
    flex-direction: row;
    gap: 0;
    flex-wrap: nowrap;
  }

  .sidebar-nav li {
    width: auto;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0 14px;
    height: 52px;
    white-space: nowrap;
    font-size: 0.82rem;
  }

  .nav-indicator {
    display: none;
  }

  .content-wrap {
    margin-left: 0;
    margin-top: 52px;
  }

  /* Hero 移动端 */
  .hero-block {
    flex-direction: column;
    min-height: auto;
  }

  .hero-text {
    padding: 32px 20px 24px;
    align-items: flex-start;
  }

  .hero-media {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    height: 200px;
    order: -1;
  }

  /* 正文区 移动端 */
  .content-section {
    display: flex;
    flex-direction: column;
    padding: 24px 20px 40px;
    gap: 0;
  }

  .content-figure {
    margin-bottom: 20px;
  }

  .content-aside {
    position: static;
    margin-left: 0;
    margin-bottom: 24px;
    align-self: auto;
  }

  .prose-wrap {
    order: 1;
  }

  /* 页脚 */
  .footer-inner {
    grid-template-columns: 1fr;
    padding: 28px 20px 20px;
    gap: 20px;
  }

  .footer-logo-wrap {
    grid-column: auto;
  }

  .footer-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .footer-nav li a {
    min-height: 40px;
    padding: 4px 8px;
    font-size: 0.82rem;
  }

  .footer-col {
    padding: 0;
  }

  .footer-bottom {
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.4rem;
  }

  .hero-text {
    padding: 24px 16px 20px;
  }

  .content-section {
    padding: 20px 16px 32px;
  }

  .prose-wrap h2 {
    font-size: 1.25rem;
  }
}

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