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

:root {
  --paper: #fdfbf7;
  --paper2: #f5f5f5;
  --ink: #1a1a1a;
  --ink2: #4b4b48;
  --ink3: #77776f;
  --rule: #e0e0e0;
  --glass: rgba(255, 255, 255, 0.55);
  --max: 1080px;
  --font: 'Nunito Sans', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font2: 'Rubik', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; transition: none; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}

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

a { color: var(--ink); }

/* 页头 */
.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(253, 251, 247, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar {
  margin: 0;
  padding: 0.4rem 1rem;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.2em;
  color: var(--ink2);
  background: var(--paper2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.nav p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.nav--l p { justify-content: flex-start; }
.nav--r p { justify-content: flex-end; }

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.85rem;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  outline: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.25rem 0.7rem;
  font-family: var(--font2);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  filter: grayscale(1) contrast(1.2);
}

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  min-height: 70vh;
  border-bottom: 1px solid var(--rule);
}

.hero--solo { grid-template-columns: minmax(0, 1fr); }

.hero__mark {
  position: absolute;
  right: -0.06em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font2);
  font-weight: 700;
  font-size: clamp(9rem, 26vw, 21rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26, 26, 26, 0.14);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero__fig {
  margin: 0;
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper2);
}

.hero__fig:empty { display: none; }

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  filter: grayscale(1) contrast(1.05);
}

.hero__img.is-on { display: block; }

.hero__txt {
  position: relative;
  z-index: 1;
  text-align: right;
}

h1 {
  margin: 0;
  font-family: var(--font2);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* 主体 */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.rail {
  position: sticky;
  top: 110px;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rail h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font2);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.24em;
}

.rail hr {
  height: 0;
  border: 0;
  border-top: 2px solid var(--ink);
  width: 48px;
  margin: 0 0 0.9rem;
}

.rail p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.55rem;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink2);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 8px;
}

.rail a:hover,
.rail a:focus-visible {
  background: var(--paper2);
  color: var(--ink);
  border-left-color: var(--ink);
  outline: none;
}

.doc > section {
  scroll-margin-top: 110px;
  margin: 0 0 1.75rem;
  padding: 1.75rem 1.5rem 2rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.doc > section:last-child { margin-bottom: 0; }

.doc h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font2);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.4;
}

.doc h3 {
  margin: 1.75rem 0 0.45rem;
  font-family: var(--font2);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.5;
}

.doc hr {
  height: 0;
  border: 0;
  border-top: 2px solid var(--ink);
  width: 56px;
  margin: 0 0 1.2rem;
}

.doc p { margin: 0 0 1.05rem; }
.doc p:last-child { margin-bottom: 0; }

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

.doc a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.doc ul,
.doc ol { margin: 0 0 1.05rem; padding-left: 1.3rem; }
.doc li { margin-bottom: 0.4rem; }

.doc blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 3px solid var(--ink);
  background: var(--paper2);
  color: var(--ink2);
}

.doc strong { font-weight: 700; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.05rem;
  font-size: 16px;
}

.doc th,
.doc td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.doc code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 15px;
  background: var(--paper2);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* 页脚 */
footer {
  border-top: 1px solid var(--rule);
  background: var(--paper2);
  padding: 2.5rem 1.25rem 1.75rem;
}

.foot-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.foot-grid dl { margin: 0; }

.foot-grid dt {
  font-family: var(--font2);
  font-size: 16px;
  letter-spacing: 0.22em;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.5rem;
}

.foot-grid dd {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.foot-grid dd a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: var(--ink2);
  text-decoration: none;
}

.foot-grid dd a:hover { color: var(--ink); text-decoration: underline; }

.foot-mark {
  max-width: var(--max);
  margin: 2.25rem auto 0;
  font-family: var(--font2);
  font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-align: center;
  color: #e6e3db;
  user-select: none;
}

.foot-copy {
  max-width: var(--max);
  margin: 1.25rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 16px;
  color: var(--ink3);
}

.foot-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-left: 0.9rem;
  padding: 0 0.75rem;
  font-size: 16px;
  color: var(--ink2);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.foot-top:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (max-width: 820px) {
  .site-head { position: static; }

  .bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.6rem 1rem 0.75rem;
  }

  .brand { order: -1; justify-self: center; }

  .nav p { justify-content: center; }
  .nav--l p,
  .nav--r p { justify-content: center; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    min-height: 0;
    padding: 1.75rem 1.15rem 2.25rem;
  }

  .hero__txt { text-align: left; order: -1; }

  .hero__mark {
    font-size: clamp(7rem, 34vw, 12rem);
    right: -0.05em;
    opacity: 0.85;
  }

  .hero__fig { aspect-ratio: 3 / 2; }

  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.75rem 1.15rem 2.5rem;
  }

  .rail { position: static; }

  .rail p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .rail a {
    border-left: 0;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
  }

  .doc > article { scroll-margin-top: 16px; padding: 1.4rem 1.15rem 1.6rem; }

  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

  .foot-grid dd a { min-height: 40px; }
}

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

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