@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --paper: #ffffff;
  --ash: #f5f5f5;
  --ink: #1f1f1f;
  --line: #e3e3e3;
  --line-soft: #efefef;
  --brass: #ac8952;
  --brass-pale: #dfcba6;
  --mute: #6b6b6b;
  --serif: 'Cormorant Garamond', 'Crimson Pro', 'Songti SC', 'Noto Serif CJK SC', 'Times New Roman', Georgia, serif;
  --el-1: 0 1px 2px rgba(31, 31, 31, .07);
  --el-2: 0 4px 12px rgba(31, 31, 31, .09), 0 1px 2px rgba(31, 31, 31, .06);
  --el-3: 0 14px 32px rgba(31, 31, 31, .12), 0 4px 9px rgba(31, 31, 31, .07);
  --el-4: 0 28px 64px rgba(31, 31, 31, .19), 0 9px 20px rgba(31, 31, 31, .09);
}

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

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

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(31, 31, 31, .055) 1px, transparent 0),
    linear-gradient(180deg, #ffffff 0%, #f7f7f7 55%, #ffffff 100%);
  background-size: 22px 22px, 100% 100%;
  overflow-x: hidden;
}

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

/* ---------- 顶部 ---------- */
.masthead {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  box-shadow: var(--el-1);
}

.topline {
  margin: 0;
  padding: .5rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: .78rem;
  line-height: 1.6;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
}

.brandrow {
  display: flex;
  align-items: center;
  padding: .55rem clamp(1rem, 4vw, 2.2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 46px;
  padding: .2rem .1rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: auto;
  height: 34px;
  filter: drop-shadow(0 2px 3px rgba(31, 31, 31, .18));
}

.brand-word {
  font-size: 1.34rem;
  letter-spacing: .12em;
  font-weight: 600;
  border-bottom: 1px solid var(--brass-pale);
  padding-bottom: .1rem;
}

/* 粘性锚点条：header > nav > p > a */
.anchors {
  position: sticky;
  top: 0;
  z-index: 4;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .93);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--el-2);
  transition: box-shadow .3s ease;
}

.anchors.is-stuck { box-shadow: var(--el-3); }

.anchors p {
  display: flex;
  gap: .1rem;
  margin: 0;
  padding: .28rem clamp(.6rem, 3vw, 1.6rem);
  overflow-x: auto;
  scrollbar-width: thin;
}

.anchors p::-webkit-scrollbar { height: 3px; }
.anchors p::-webkit-scrollbar-thumb { background: var(--brass-pale); }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: .5rem .7rem;
  font-size: .96rem;
  letter-spacing: .04em;
  color: #454545;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
  transition: color .25s ease, background-color .25s ease, transform .25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: .7rem;
  right: .7rem;
  bottom: .32rem;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
  background: var(--ash);
  transform: translateY(-1px);
}

.nav-link:hover::after,
.nav-link.is-on::after { transform: scaleX(1); }
.nav-link.is-on { color: var(--ink); }

.nav-ico {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--brass);
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px rgba(172, 137, 82, .16);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  min-height: 70vh;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(31, 31, 31, .14) 1px, transparent 0),
    linear-gradient(160deg, #f5f5f5 0%, #ffffff 62%, #f2f2f2 100%);
  background-size: 18px 18px, 100% 100%;
}

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

.hero-media .hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  will-change: transform;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, .97) 0%, rgba(255, 255, 255, .86) 40%, rgba(255, 255, 255, .38) 74%, rgba(31, 31, 31, .16) 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 44rem;
  padding: clamp(2rem, 6vw, 4.6rem) clamp(1.1rem, 5vw, 4rem) clamp(2.2rem, 6vw, 4.2rem);
}

.hero-copy::before {
  content: "";
  display: block;
  width: 76px;
  height: 2px;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--brass), var(--brass-pale));
}

.hero h1 {
  margin: 0 0 1.6rem;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: .015em;
  overflow-wrap: break-word;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: .65rem 1.6rem;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  letter-spacing: .18em;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: var(--el-3);
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--el-4);
  background: #000;
}

/* ---------- 主区：aside 在左 ---------- */
main {
  display: block;
  padding: clamp(1.4rem, 4vw, 3rem) 0 clamp(2rem, 6vw, 3.6rem);
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 262px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.1rem, 3vw, 2.6rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.rail {
  position: sticky;
  top: 4.6rem;
  z-index: 3;
  padding: 1.15rem 1.05rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--el-2);
}

.rail-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: .32em;
}

.rail .subtitle {
  margin: .3rem 0 .95rem;
  font-size: .88rem;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--mute);
}

.rail-nav {
  display: grid;
  gap: .05rem;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  padding: .3rem .35rem;
  font-size: .97rem;
  line-height: 1.5;
  color: #3a3a3a;
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .2s ease, color .2s ease, padding-left .2s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  padding-left: .6rem;
  color: #000;
  background: var(--ash);
}

.rail::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: .9rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brass), var(--brass-pale));
}

.rail-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: .5rem;
  font-size: .88rem;
  letter-spacing: .1em;
  color: var(--mute);
  text-decoration: none;
}

.rail-top:hover { color: var(--ink); }

.body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* 纸片堆叠 */
.prose {
  position: relative;
  z-index: 1;
  padding: clamp(1.2rem, 4vw, 2.9rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--el-3);
}

.prose::before,
.prose::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  pointer-events: none;
}

.prose::before { z-index: -1; transform: translate(7px, 7px); box-shadow: var(--el-1); }
.prose::after { z-index: -2; transform: translate(14px, 14px); opacity: .72; }

.prose h2 {
  margin: 2.2rem 0 .5rem;
  font-size: clamp(1.4rem, 3.1vw, 2rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: .02em;
  scroll-margin-top: 7.5rem;
}

.prose h2::after {
  content: "";
  display: block;
  width: 54px;
  height: 1px;
  margin-top: .68rem;
  background: var(--brass);
}

.prose h3 {
  margin: 1.7rem 0 .4rem;
  font-size: 1.16rem;
  line-height: 1.45;
  font-weight: 600;
}

.prose p { margin: 0 0 1.05rem; font-size: 1.02rem; }

.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-pale);
  transition: border-color .2s ease, background-color .2s ease;
}

.prose a:hover { border-bottom-color: var(--brass); background: #fbf8f2; }

.prose ul,
.prose ol { margin: 0 0 1.15rem; padding-left: 1.25rem; }

.prose li { margin: .3rem 0; }

.prose blockquote {
  margin: 1.4rem 0;
  padding: .85rem 1.1rem;
  background: var(--ash);
  border-left: 3px solid var(--brass);
  border-radius: 4px;
  box-shadow: var(--el-1);
}

.prose figure { margin: 1.4rem 0; }
.prose img { border-radius: 4px; box-shadow: var(--el-2); }
.prose figcaption { margin-top: .45rem; font-size: .86rem; color: var(--mute); }

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .95rem;
}

.prose th,
.prose td { padding: .5rem .7rem; border: 1px solid var(--line); }

/* 正文区块分隔 */
article div[id] { scroll-margin-top: 7.8rem; }

article div[id] + div[id] {
  margin-top: 2.1rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: .4rem 1rem;
  margin-top: clamp(2rem, 6vw, 3.6rem);
  padding: clamp(1.5rem, 4vw, 2.4rem) clamp(1rem, 4vw, 3rem) 1.3rem;
  background: var(--ash);
  border-top: 1px solid var(--line);
}

.foot-brand {
  grid-column: 1 / -1;
  margin: 0 0 .5rem;
  font-size: clamp(2.1rem, 11vw, 5.6rem);
  line-height: .98;
  font-weight: 500;
  letter-spacing: .02em;
  overflow-wrap: break-word;
}

.foot-note,
.foot-link {
  font-size: .84rem;
  line-height: 1.6;
  letter-spacing: .08em;
  color: var(--mute);
}

.foot-link { text-align: right; }

.foot-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-pale);
}

.foot-link a:hover { border-bottom-color: var(--brass); }

/* ---------- 断点 ---------- */
@media (max-width: 860px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .body { order: 1; }
  .rail { position: static; order: 2; top: auto; }
  .rail::after { display: none; }
  .hero { min-height: 64vh; }
  .prose::after { transform: translate(9px, 9px); }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .topline { letter-spacing: .18em; }
  .hero h1 { font-size: clamp(1.75rem, 8.4vw, 2.4rem); }
  .prose { padding: 1.15rem 1rem; }
  .prose::before { transform: translate(5px, 5px); }
  .prose::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

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