@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

/* ===== CSS 变量 ===== */
:root {
  --paper: #fdfbf7;
  --paper-mid: #f5f5f5;
  --ink: #1a1a1a;
  --ink-light: #4a4a4a;
  --ink-faint: #8a8a8a;
  --border: #d8d4cc;
  --border-light: #e8e4de;
  --accent: #1a1a1a;
  --radius-card: 18px;
  --font-serif: 'Cormorant Garamond', 'Libre Baskerville', Georgia, 'Noto Serif SC', serif;
  --font-body: 'Libre Baskerville', 'Cormorant Garamond', Georgia, serif;
  --nav-h: 64px;
  --section-scroll-margin: 80px;
  --max-w: 1160px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  color: var(--ink);
}

body.paper-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

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

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul, menu {
  list-style: none;
}

/* ===== 纸质纹理叠层 ===== */
.paper-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 1;
}

/* ===== 页头 ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* 品牌 */
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  line-height: 0;
}

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

/* 导航 details/summary/menu */
.site-nav {
  display: flex;
  align-items: center;
}

.nav-details {
  position: relative;
}

/* 桌面：水平展开 */
@media (min-width: 768px) {
  .nav-details[open] > summary .nav-toggle-icon,
  .nav-details > summary .nav-toggle-icon {
    display: none;
  }

  .nav-details > summary {
    pointer-events: none;
    cursor: default;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
  }

  .nav-details > summary::-webkit-details-marker { display: none; }

  .nav-toggle-label {
    display: none;
  }

  .nav-details > menu {
    display: flex !important;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 0.1rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-details > menu li a {
    display: block;
    padding: 0.55rem 0.85rem;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--ink);
    border: 1px solid transparent;
    min-height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
  }

  .nav-details > menu li a:hover {
    border-color: var(--border);
    text-decoration: none;
    background: var(--paper-mid);
  }
}

/* 移动端：汉堡 */
@media (max-width: 767px) {
  .nav-details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    min-height: 44px;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 600;
  }

  .nav-details > summary::-webkit-details-marker { display: none; }

  .nav-toggle-label {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
  }

  .nav-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
  }

  .nav-toggle-icon span {
    display: block;
    height: 1.5px;
    background: var(--ink);
    width: 100%;
  }

  .nav-details > menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--paper);
    border: 1px solid var(--border);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 200;
    box-shadow: 2px 4px 0 rgba(26,26,26,0.08);
  }

  .nav-details > menu li a {
    display: block;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid var(--border-light);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-details > menu li:last-child a {
    border-bottom: none;
  }

  .nav-details > menu li a:hover {
    background: var(--paper-mid);
    text-decoration: none;
  }
}

/* ===== Hero ===== */
.hero-section {
  margin-top: var(--nav-h);
  position: relative;
  height: 45vh;
  min-height: 280px;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(30%) contrast(1.05);
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(253,251,247,0.15) 0%, rgba(26,26,26,0.55) 100%);
}

.hero-deco-text {
  position: absolute;
  top: 50%;
  left: -0.05em;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: 700;
  color: rgba(253,251,247,0.06);
  line-height: 1;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 2rem 2.5rem;
  max-width: 640px;
}

.hero-eyebrow {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(253,251,247,0.7);
  margin-bottom: 0.5rem;
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #fdfbf7;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: rgba(253,251,247,0.78);
  line-height: 1.6;
  max-width: 400px;
  margin-left: auto;
}

/* ===== 页面主体 ===== */
.page-body {
  position: relative;
  z-index: 1;
  background: var(--paper);
}

/* ===== main > article > section 三层结构 ===== */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.content-article {
  /* article 是 main 的直接子元素 */
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.article-primary {
  min-width: 0;
}

.content-sections {
  /* section 是 article 的直接子元素（通过 .content-sections > section 实现） */
}

/* ===== 正文内容样式（page.content 注入区域） ===== */
.content-sections section {
  scroll-margin-top: var(--section-scroll-margin);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.content-sections h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.4rem;
  position: relative;
  padding-left: 1.2rem;
}

.content-sections h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: var(--ink);
}

.content-sections h2 + p,
.content-sections h2 + .subtitle,
.content-sections h2 + p.subtitle {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.content-sections h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.content-sections p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.content-sections ul,
.content-sections ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-sections li {
  margin-bottom: 0.45rem;
  line-height: 1.7;
  color: var(--ink-light);
  font-size: 0.97rem;
}

.content-sections a {
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.content-sections a:hover {
  border-bottom-color: var(--ink);
  text-decoration: none;
}

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

.content-sections blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper-mid);
  font-style: italic;
  color: var(--ink-light);
}

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

.content-sections th,
.content-sections td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  text-align: left;
}

.content-sections th {
  background: var(--paper-mid);
  font-weight: 700;
  font-family: var(--font-serif);
}

/* 卡片类（正文内如有 .card 元素） */
.content-sections .card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

/* ===== Aside 侧边栏 ===== */
.content-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.aside-inner {
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--paper-mid);
}

.aside-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.aside-inner .subtitle,
p.subtitle {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  font-style: italic;
}

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

.aside-nav-list li {
  border-bottom: 1px solid var(--border-light);
}

.aside-nav-list li:last-child {
  border-bottom: none;
}

.aside-nav-list li a {
  display: block;
  padding: 0.55rem 0;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aside-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

.aside-note p {
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.65;
  font-style: italic;
}

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

.footer-cta-block {
  padding: 2.5rem 2rem;
  border-bottom: 1px solid rgba(253,251,247,0.15);
}

.footer-cta-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-cta-text {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--paper);
  min-height: 44px;
  white-space: nowrap;
}

.footer-cta-btn:hover {
  background: var(--paper-mid);
  text-decoration: none;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-address {
  font-style: normal;
  font-size: 0.82rem;
  color: rgba(253,251,247,0.55);
  font-family: var(--font-body);
}

.footer-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.footer-links li a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: rgba(253,251,247,0.65);
  min-height: 40px;
  border-left: 1px solid rgba(253,251,247,0.15);
}

.footer-links li:first-child a {
  border-left: none;
}

.footer-links li a:hover {
  color: var(--paper);
  text-decoration: none;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(253,251,247,0.35);
  font-family: var(--font-body);
  width: 100%;
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(253,251,247,0.1);
  margin-top: 0.5rem;
}

/* ===== 滚动进入动画 ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }
}

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

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

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

  .aside-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
  }

  .aside-title {
    width: 100%;
  }

  .aside-inner .subtitle {
    display: none;
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .aside-nav-list li {
    border-bottom: none;
    border-right: 1px solid var(--border-light);
  }

  .aside-nav-list li:last-child {
    border-right: none;
  }

  .aside-nav-list li a {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    min-height: 40px;
  }

  .aside-divider,
  .aside-note {
    display: none;
  }
}

@media (max-width: 767px) {
  :root {
    --nav-h: 56px;
    --section-scroll-margin: 64px;
  }

  html {
    font-size: 16px;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .hero-section {
    min-height: 240px;
  }

  .hero-content {
    padding: 1.25rem 1rem;
  }

  .hero-eyebrow {
    font-size: 0.7rem;
  }

  .main-content {
    padding: 2rem 1rem 3rem;
  }

  .content-sections h2 {
    font-size: 1.25rem;
  }

  .footer-bottom {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-links {
    flex-wrap: wrap;
  }

  .footer-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

@media (max-width: 400px) {
  .brand-name {
    font-size: 1.1rem;
  }

  .hero-h1 {
    font-size: 1.35rem;
  }
}

/* ===== 区块间分隔增强 ===== */
.content-sections div + div {
  position: relative;
}

/* ===== 无横向溢出保护 ===== */
.content-sections img,
.content-sections video,
.content-sections table,
.content-sections pre {
  max-width: 100%;
  overflow-x: auto;
}

pre {
  background: var(--paper-mid);
  border: 1px solid var(--border);
  padding: 1rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

code {
  font-size: 0.88em;
  background: var(--paper-mid);
  padding: 0.1em 0.35em;
  border: 1px solid var(--border-light);
}

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