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

/* ===== CSS 变量 ===== */
:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-light: #6a6a6a;
  --ink-faint: #b0b0b0;
  --border: #e0e0e0;
  --border-dark: #c0c0c0;
  --accent: #1a1a1a;
  --nav-h: 60px;
  --radius-card: 18px;
  --font-main: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --max-w: 1200px;
  --content-max: 820px;
}

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

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

body.eink-body {
  font-family: var(--font-main);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 纸张噪点纹理 */
body.eink-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: none; }
ol, ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== 页面包装 ===== */
.page-wrapper {
  position: relative;
  z-index: 1;
  padding-bottom: var(--nav-h);
}

/* ===== 底部固定导航条 ===== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--ink);
  color: var(--paper);
  z-index: 1000;
  border-top: 2px solid var(--border-dark);
  display: flex;
  align-items: stretch;
}

.bottom-nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
}

.brand-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px 0 4px;
  min-height: 44px;
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 8px;
}

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

.brand-text-mark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--paper);
  white-space: nowrap;
}

.primary-nav {
  flex: 1;
  overflow: hidden;
}

.primary-nav ol {
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--nav-h);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.primary-nav ol::-webkit-scrollbar { display: none; }

.primary-nav ol li { flex-shrink: 0; }

.primary-nav ol li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 44px;
  color: rgba(253,251,247,0.75);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: none;
}

.primary-nav ol li a:hover {
  color: var(--paper);
  background: rgba(255,255,255,0.07);
}

.nav-icon {
  font-size: 14px;
  line-height: 1;
  margin-bottom: 2px;
  display: block;
}

.nav-label {
  display: block;
  white-space: nowrap;
}

.cta-btn {
  flex-shrink: 0;
  margin-left: 10px;
  padding: 0 16px;
  min-height: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.03em;
  border: 2px solid var(--paper);
}

.cta-btn:hover {
  background: var(--paper-2);
}

/* ===== Hero ===== */
.hero-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: grayscale(60%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,26,26,0.55) 0%, rgba(26,26,26,0.75) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--paper);
  padding: 0 24px;
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  border: 1px solid rgba(253,251,247,0.45);
  color: rgba(253,251,247,0.8);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 5px 14px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(28px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 300;
  color: rgba(253,251,247,0.7);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}

/* section 的 scroll-margin-top */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ===== 主体布局 ===== */
.site-main {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.content-article {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* ===== 侧边栏（内容左侧） ===== */
.content-aside {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--paper-2);
  padding: 24px 20px;
}

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

.aside-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

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

.aside-nav li a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-mid);
  padding: 5px 4px;
  border-bottom: 1px solid transparent;
  line-height: 1.4;
}

.aside-nav li a:hover {
  color: var(--ink);
  border-bottom-color: var(--border);
}

.aside-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.aside-rule {
  height: 1px;
  background: var(--border);
}

.aside-note {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
  font-style: italic;
}

/* ===== 正文区域 ===== */
.main-content-section {
  flex: 1;
  min-width: 0;
}

.content-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}

/* 正文内部元素 */
.content-body h1 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
}

.content-body h2 {
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  border-left: 3px solid var(--ink);
  padding-left: 12px;
}

.content-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--ink-mid);
}

.content-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.content-body p {
  margin: 0 0 18px;
  color: var(--ink);
}

.content-body p.subtitle,
.content-body p.subhead,
.content-body p.desc,
.content-body p.lead {
  font-size: 17px;
  font-weight: 300;
  color: var(--ink-mid);
  margin-top: -6px;
  margin-bottom: 24px;
}

.content-body ul,
.content-body ol {
  margin: 0 0 18px 0;
  padding-left: 0;
  list-style: none;
}

.content-body ul li,
.content-body ol li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 16px;
  line-height: 1.7;
}

.content-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-faint);
  font-weight: 300;
}

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

.content-body ol li {
  counter-increment: ol-counter;
}

.content-body ol li::before {
  content: counter(ol-counter, decimal-leading-zero) '.';
  position: absolute;
  left: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  top: 7px;
}

.content-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 1px;
}

.content-body a:hover {
  border-bottom-color: var(--ink);
}

.content-body strong { font-weight: 600; }
.content-body em { font-style: italic; color: var(--ink-mid); }

.content-body blockquote {
  margin: 28px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
  font-size: 16px;
  color: var(--ink-mid);
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.content-body th,
.content-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

.content-body th {
  background: var(--paper-2);
  font-weight: 600;
  font-size: 13px;
}

.content-body img {
  margin: 24px 0;
  border: 1px solid var(--border);
  max-width: 100%;
}

/* div 分隔 */
.content-body div {
  padding-top: 40px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.content-body div:first-child {
  padding-top: 0;
  border-top: none;
  margin-top: 0;
}

/* ===== 卡片（正文内如有） ===== */
.content-body .card,
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 2px 12px rgba(26,26,26,0.06), 0 1px 4px rgba(26,26,26,0.04);
  transition: none;
}

.content-body .card:hover,
.card:hover {
  box-shadow: 0 6px 24px rgba(26,26,26,0.10), 0 2px 8px rgba(26,26,26,0.06);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 80px;
}

.footer-brand-section {
  padding: 60px 40px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.footer-brand-super {
  font-size: clamp(36px, 8vw, 88px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--paper);
  margin-bottom: 16px;
  opacity: 0.95;
}

.footer-brand-desc {
  font-size: 14px;
  font-weight: 300;
  color: rgba(253,251,247,0.5);
  max-width: 480px;
  line-height: 1.6;
}

.footer-nav-section {
  padding: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.footer-col-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(253,251,247,0.45);
  margin-bottom: 16px;
}

.footer-col-list { display: flex; flex-direction: column; gap: 8px; }

.footer-col-list li a {
  font-size: 14px;
  color: rgba(253,251,247,0.65);
  line-height: 1.5;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.footer-col-list li a:hover {
  color: var(--paper);
  border-bottom-color: rgba(253,251,247,0.3);
}

.footer-col-text {
  font-size: 13px;
  color: rgba(253,251,247,0.5);
  line-height: 1.7;
  font-weight: 300;
}

.footer-bottom-section {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 40px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copy {
  font-size: 12px;
  color: rgba(253,251,247,0.35);
  font-weight: 300;
}

.footer-legal {
  font-size: 12px;
  color: rgba(253,251,247,0.35);
  font-weight: 300;
}

/* ===== Scroll Reveal ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.in-view {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ===== Hover Micro-interaction ===== */
@media (prefers-reduced-motion: no-preference) {
  .primary-nav ol li a {
    transition: color 0.15s, background 0.15s;
  }
  .cta-btn {
    transition: background 0.15s;
  }
  .aside-nav li a {
    transition: color 0.12s, border-bottom-color 0.12s;
  }
  .footer-col-list li a {
    transition: color 0.12s, border-bottom-color 0.12s;
  }
  .content-body .card {
    transition: box-shadow 0.2s, transform 0.2s;
  }
}

/* ===== 响应式 ===== */

/* 平板 */
@media (max-width: 1024px) {
  .content-aside {
    width: 180px;
  }
  .footer-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 移动端 */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  .page-wrapper { padding-bottom: var(--nav-h); }

  .site-main {
    padding: 24px 16px 48px;
  }

  .content-article {
    flex-direction: column;
    gap: 24px;
  }

  .content-aside {
    width: 100%;
    position: static;
    order: -1;
  }

  .aside-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .hero-wrap {
    min-height: 100vh;
  }

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

  .hero-badge {
    font-size: 10px;
    padding: 4px 10px;
    margin-bottom: 20px;
  }

  .brand-text-mark {
    font-size: 11px;
  }

  .primary-nav ol li a {
    padding: 6px 7px;
    font-size: 10px;
    min-height: 44px;
  }

  .nav-icon {
    font-size: 13px;
  }

  .cta-btn {
    padding: 0 10px;
    font-size: 12px;
    margin-left: 6px;
    min-height: 44px;
    height: 44px;
  }

  .footer-brand-section {
    padding: 40px 20px 28px;
  }

  .footer-nav-section {
    padding: 28px 20px;
  }

  .footer-nav-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-bottom-section {
    padding: 16px 20px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .content-body h2 {
    margin-top: 36px;
  }

  .content-body div {
    padding-top: 28px;
    margin-top: 28px;
  }
}

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

  .aside-nav {
    grid-template-columns: 1fr;
  }

  .primary-nav ol li a {
    padding: 6px 6px;
    min-height: 44px;
  }
}

/* ===== 打印样式 ===== */
@media print {
  .bottom-nav-bar,
  .hero-wrap,
  .content-aside,
  .site-footer { display: none; }

  .page-wrapper { padding: 0; }
  .site-main { max-width: 100%; padding: 0; }
  .content-article { display: block; }
  .content-body { font-size: 12pt; }
}

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