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

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: #e4e4e4;
  --mute: #6d6d6d;
  --shadow: 0 4px 6px rgba(0, 0, 0, .05);
  --shadow-hi: 0 14px 28px rgba(0, 0, 0, .10);
  --serif: "Playfair Display", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 1180px;
  min-height: 66px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

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

.mark-glyph {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0;
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform .25s ease, opacity .25s ease;
}

.panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}

.sitenav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitenav a,
.group-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.sitenav a:hover,
.group-btn:hover { background: var(--mist); }

.group { position: relative; }

.group-btn::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-2px) rotate(45deg);
}

.sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 218px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--paper);
  box-shadow: var(--shadow-hi);
  border-top: 2px solid var(--ink);
}

.sub a { display: flex; min-height: 44px; padding: 0 12px; }

.group.open .sub { display: block; }

.find {
  display: flex;
  align-items: stretch;
  flex: none;
  border: 1px solid var(--line);
  background: var(--mist);
}

.find input {
  width: 132px;
  padding: 0 12px;
  min-height: 40px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline-offset: 2px;
}

.find button {
  min-height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  cursor: pointer;
}

/* ---------- 头图 ---------- */
.hero {
  position: relative;
  min-height: 45vh;
  padding: 64px 24px 84px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 46px));
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(.18);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 31, 31, .55), rgba(31, 31, 31, .84));
}

.hero-copy { max-width: 860px; }

.badge {
  display: inline-block;
  margin: 0 0 20px;
  padding: 5px 15px;
  font-size: 16px;
  letter-spacing: .18em;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(31, 31, 31, .28);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.18;
  letter-spacing: .01em;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .35);
}

/* ---------- 主体网格 ---------- */
.wrap {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
}

.doc { min-width: 0; }

.doc-head { margin: 0 0 20px; padding: 0 2px; }

.doc-head h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(23px, 2.8vw, 32px);
  line-height: 1.25;
}

.subtitle {
  margin: 0;
  color: var(--mute);
  font-size: 16px;
  line-height: 1.8;
}

/* ---------- 正文卡片 ---------- */
.prose > article,
.prose > div {
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  margin: 0 0 18px;
  scroll-margin-top: 90px;
  transition: transform .3s ease, box-shadow .3s ease;
}

.prose h2 {
  margin: 0 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 2.5vw, 28px);
  line-height: 1.35;
}

.prose h3 {
  margin: 26px 0 12px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.prose p {
  margin: 0 0 15px;
  font-size: 17px;
  line-height: 1.85;
  color: #262626;
}

.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child { margin-bottom: 0; }

.prose ul,
.prose ol { margin: 0 0 15px; padding-left: 22px; }
.prose li { margin: 0 0 8px; line-height: 1.85; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 18px 0;
}

.prose blockquote {
  margin: 18px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--ink);
  color: var(--mute);
}

.prose blockquote p { margin: 0; }

/* ---------- 右栏 ---------- */
.rail {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.rail-card {
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  transition: transform .3s ease, box-shadow .3s ease;
}

.rail-card h2 {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .2em;
  line-height: 1.6;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rail;
}

.rail-list li { border-top: 1px solid var(--line); }
.rail-list li:first-child { border-top: 0; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 2px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--ink);
  transition: color .2s ease, padding-left .2s ease;
}

.rail-list a:hover { padding-left: 6px; }

.rail-list .num {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--mute);
  flex: none;
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 54px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px 30px;
}

.f-mark a {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

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

.f-nav dl {
  margin: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  gap: 2px 22px;
}

.f-nav dt {
  font-size: 16px;
  color: var(--mute);
  line-height: 1.5;
}

.f-nav dd { margin: 0; }

.f-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

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

.sub {
  display: flex;
  align-items: stretch;
  margin-left: auto;
  border: 1px solid var(--line);
}

.sub input {
  width: 168px;
  min-height: 42px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--mist);
  border: 0;
}

.sub button {
  min-height: 42px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  cursor: pointer;
}

.copy {
  font-size: 16px;
  color: var(--mute);
  line-height: 1.6;
}

/* ---------- 动效 ---------- */
body[data-rv="on"] [data-reveal],
body[data-rv="on"] main section > article {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease, box-shadow .3s ease;
}

body[data-rv="on"] [data-reveal].in,
body[data-rv="on"] main section > article.in {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .prose > article:hover,
  body[data-rv="on"] .prose > article.in:hover {
    transform: translateY(-2px) scale(1.008);
    box-shadow: var(--shadow-hi);
  }
  .rail-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .bar { padding: 0 16px; gap: 10px; }
  .burger { display: inline-flex; }

  .panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 16px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-hi);
  }

  .topbar.nav-open .panel { display: flex; }

  .sitenav ul { flex-direction: column; align-items: stretch; gap: 0; }

  .sitenav a,
  .group-btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 6px;
    border-bottom: 1px solid var(--line);
  }

  .group-btn::after { margin-left: auto; }

  .sub {
    position: static;
    min-width: 0;
    padding: 0 0 0 12px;
    border-top: 0;
    box-shadow: none;
  }

  .group.open .sub { display: block; }

  .find { width: 100%; margin-top: 4px; }
  .find input { flex: 1; width: auto; }

  .hero { padding: 52px 20px 66px; min-height: 42vh; }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 0 16px;
    margin-top: 24px;
  }

  .rail { position: static; order: 2; }

  .prose > article,
  .prose > div { padding: 22px 20px; }

  .foot { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 16px; }
  .sub { margin-left: 0; width: 100%; }
  .sub input { flex: 1; width: auto; }
  footer { margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: .001ms !important; }
}

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