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

:root {
  --ink: #1f1f1f;
  --ink-soft: #4a4a4a;
  --ink-mute: #6b6b6b;
  --paper: #ffffff;
  --matte: #f5f5f5;
  --line: #e3e3e3;
  --line-strong: #cfcfcf;
  --serif: "EB Garamond", "Crimson Text", Georgia, "Songti SC", "Source Han Serif SC", "SimSun", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --r: 10px;
  --e1: 0 1px 2px rgba(31, 31, 31, 0.07);
  --e2: 0 2px 4px rgba(31, 31, 31, 0.06), 0 6px 14px rgba(31, 31, 31, 0.07);
  --e3: 0 4px 8px rgba(31, 31, 31, 0.06), 0 12px 28px rgba(31, 31, 31, 0.10);
  --e4: 0 8px 16px rgba(31, 31, 31, 0.07), 0 22px 48px rgba(31, 31, 31, 0.14);
}

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

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

body {
  margin: 0;
  background: var(--matte);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.006em;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 头部 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e1);
}

.head-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem 0.4rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-height: 44px;
  padding: 0.25rem 0;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: var(--ink);
}

.brand::before {
  content: "";
  width: 13px;
  height: 13px;
  background: var(--ink);
  box-shadow: 4px 4px 0 rgba(31, 31, 31, 0.22);
  transform: rotate(45deg);
}

.head-contact {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.85rem;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--e1);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.head-contact:hover {
  box-shadow: var(--e3);
  transform: translateY(-1px);
}

.site-nav {
  padding: 0.15rem 0 0.3rem;
}

.site-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 40px;
  padding: 0.3rem 0.7rem;
  font-size: 0.97rem;
  color: var(--ink-mute);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
  flex: none;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: var(--e2);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 70vh;
  display: grid;
  align-items: center;
  padding: 2.6rem 1.25rem 3rem;
  background: linear-gradient(180deg, var(--paper) 0%, var(--matte) 78%);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: -8vw;
  bottom: -14vw;
  width: 46vw;
  height: 46vw;
  min-width: 260px;
  min-height: 260px;
  border: 1px solid var(--line-strong);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: var(--e4);
  transform: rotate(12deg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  will-change: transform;
}

.hero-bg span {
  position: absolute;
  right: -3%;
  top: 52%;
  font-size: clamp(7rem, 25vw, 19rem);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: rgba(31, 31, 31, 0.055);
  opacity: 0;
  transform: translateY(-50%);
  animation: bgswap 11s ease-in-out infinite;
}

.hero-bg span:last-child {
  top: 34%;
  font-size: clamp(4.6rem, 15vw, 11rem);
  color: rgba(31, 31, 31, 0.045);
  animation-delay: 5.5s;
}

@keyframes bgswap {
  0%, 42% { opacity: 1; }
  58%, 100% { opacity: 0; }
}

.hero-in {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  justify-items: end;
  gap: 1.15rem;
  text-align: right;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--e3);
  transform: translateZ(0);
}

.hero h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.95rem, 5vw, 3.3rem);
  line-height: 1.26;
  font-weight: 700;
  letter-spacing: 0.012em;
  text-shadow: 0 1px 0 var(--paper);
}

/* ---------- 主体 ---------- */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.4rem 1.25rem 3.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.8rem;
}

.paper {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.5rem;
}

.paper > section {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--e2);
  padding: 1.5rem 1.35rem 1.7rem;
  scroll-margin-top: 165px;
  transition: box-shadow 0.28s ease;
}

.paper > section:target { box-shadow: var(--e4); }

.paper h2 {
  margin: 0 0 0.15rem;
  font-size: clamp(1.32rem, 2.6vw, 1.8rem);
  line-height: 1.34;
  font-weight: 700;
}

.paper h3 {
  margin: 1.55rem 0 0.35rem;
  font-size: 1.14rem;
  line-height: 1.45;
  font-weight: 700;
}

.paper hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 54px;
  margin: 0.6rem 0 1.05rem;
}

.paper p { margin: 0 0 1.05rem; }

.paper ul,
.paper ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.paper li { margin: 0.32rem 0; }

.paper blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1.05rem;
  background: var(--matte);
  border-left: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
}

.paper figure { margin: 1.3rem 0; }

.paper img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--e1);
}

.paper a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.paper strong { font-weight: 700; }

/* ---------- 侧栏 ---------- */
.rail {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 0.9rem;
}

.rail-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--e3);
  padding: 1.05rem 1.05rem 1.2rem;
}

.rail-card h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.09em;
}

.rail-card hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 40px;
  margin: 0.5rem 0 0.75rem;
}

.rail-list { display: grid; }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0;
  font-size: 0.97rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-strong);
}

.rail-list a:last-child { border-bottom: 0; }

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

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 2.4rem;
  padding: 2.6rem max(1.25rem, calc((100% - 1130px) / 2)) 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem 1.4rem;
  align-items: end;
  background: var(--ink);
  color: var(--paper);
}

.foot-brand {
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 4.4rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0.02em;
}

.foot-copy {
  grid-column: 1;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.62);
}

.foot-links {
  grid-column: 2;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.9rem;
  font-size: 0.92rem;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-links a:hover {
  color: var(--paper);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* ---------- 滚动显现 ---------- */
body.js .paper > section,
body.js .rail-card,
body.js .site-foot .foot-brand {
  opacity: 0;
  transform: translateY(20px);
}

body.js .paper > section.is-in,
body.js .rail-card.is-in,
body.js .site-foot .foot-brand.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.62s ease, transform 0.7s cubic-bezier(0.22, 0.72, 0.3, 1);
}

/* ---------- 断点 ---------- */
@media (min-width: 700px) {
  .head-in { padding: 0.65rem 1.6rem 0.5rem; }
  .stage { padding: 2.8rem 1.6rem 3.6rem; }
  .paper > section { padding: 1.9rem 2rem 2.1rem; }
  .site-nav p { gap: 0.3rem 0.55rem; }
}

@media (min-width: 1000px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 2.6rem;
    align-items: start;
  }

  .rail { margin-top: -1.1rem; }

  .rail-card:first-child { position: sticky; top: 172px; }

  .paper > section { scroll-margin-top: 150px; }
}

@media (max-width: 699px) {
  body { font-size: 16.5px; }
  .hero { min-height: 62vh; }
  .hero::before { border-radius: 28px; }
  .site-foot { grid-template-columns: 1fr; }
  .foot-links { grid-column: 1; justify-content: flex-start; }
  .paper > section { scroll-margin-top: 175px; }
}

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

  .hero-bg span { animation: none; opacity: 1; }
  .hero-bg span:last-child { opacity: 0.75; }

  body.js .paper > section,
  body.js .rail-card,
  body.js .site-foot .foot-brand {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .head-contact, .paper > section { transition: none; }
}

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