@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

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

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --fog: #f5f5f5;
  --mist: #ededed;
  --e1: 0 1px 2px rgba(31, 31, 31, .07);
  --e2: 0 4px 12px rgba(31, 31, 31, .10);
  --e3: 0 10px 26px rgba(31, 31, 31, .14);
  --e4: 0 20px 52px rgba(31, 31, 31, .20);
  --r: 10px;
  --rail: 248px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font: 400 17px/1.8 "Didact Gothic", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

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

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 90;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 8px; }

/* ===== 左侧固定书脊 ===== */
.masthead {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 26px;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--e3);
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--e2);
  overflow: hidden;
}
.brand img { display: block; width: 36px; height: 36px; object-fit: contain; }
.mark-txt {
  font-family: "Poiret One", "Didact Gothic", sans-serif;
  font-size: 17px;
  letter-spacing: .04em;
  padding: 0 8px;
  line-height: 44px;
}

.find {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: var(--fog);
  border-radius: 999px;
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(31, 31, 31, .05), var(--e1);
}
.find-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.find-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.find-input:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.find-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--e1);
}
.find-btn:hover { background: #000; }

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: var(--e1);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--e3);
}

/* ===== 版心 ===== */
.shell {
  margin-left: var(--rail);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  max-width: 1180px;
  padding: 26px 30px 70px;
}

.side {
  position: sticky;
  top: 24px;
  align-self: start;
  z-index: 3;
}
.side-t {
  margin: 0 0 8px;
  font-family: "Poiret One", "Didact Gothic", sans-serif;
  font-size: 16px;
  letter-spacing: .34em;
  font-weight: 400;
  color: #6a6a6a;
}
.side-rule {
  border: 0;
  border-top: 1px solid var(--mist);
  margin: 0 0 12px;
}
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-list a {
  display: block;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  color: #3a3a3a;
}
.side-list a:hover,
.side-list a:focus-visible { background: var(--paper); box-shadow: var(--e1); color: var(--ink); }

main { min-width: 0; }

section > article:not(.hero) {
  position: relative;
  z-index: 2;
  margin-top: -12px;
  background: var(--paper);
  border-radius: var(--r);
  padding: 26px 26px 30px;
  box-shadow: var(--e2);
}
section > article:not(.hero):hover { box-shadow: var(--e3); }

section > article[id] { scroll-margin-top: 18px; }

/* ===== 首屏 ===== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 58px 22px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  text-align: center;
  box-shadow: var(--e4);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(31, 31, 31, .34), rgba(31, 31, 31, .78));
}
.hero-media { position: absolute; inset: 0; }
.hero-pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-family: "Poiret One", "Didact Gothic", sans-serif;
  font-size: clamp(70px, 16vw, 190px);
  line-height: 1;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .14);
  white-space: nowrap;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 3; max-width: 30ch; }
.hero h1 {
  margin: 0 0 12px;
  font-family: "Poiret One", "Didact Gothic", "PingFang SC", sans-serif;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.24;
  letter-spacing: .03em;
  font-weight: 400;
  text-shadow: 0 6px 26px rgba(0, 0, 0, .45);
}
.hero-lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .86);
}

/* ===== 正文排版 ===== */
section h2 {
  margin: 6px 0 10px;
  font-family: "Poiret One", "Didact Gothic", "PingFang SC", sans-serif;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: .02em;
}
section h3 {
  margin: 22px 0 8px;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: .02em;
}
section h2 + hr,
section h3 + hr {
  border: 0;
  border-top: 1px solid var(--mist);
  margin: 0 0 16px;
}
section p { margin: 0 0 14px; }
section ul, section ol { margin: 0 0 16px; padding-left: 1.3em; }
section li { margin: 0 0 8px; }
section a { text-decoration: none; box-shadow: inset 0 -1px 0 var(--ink); }
section a:hover { box-shadow: inset 0 -2px 0 var(--ink); }
section strong { font-weight: 700; }
section blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--fog);
  box-shadow: var(--e1);
  color: #2c2c2c;
}
section blockquote p:last-child { margin-bottom: 0; }
section img { border-radius: var(--r); box-shadow: var(--e2); display: block; height: auto; }
section code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  background: var(--fog);
  border-radius: 6px;
  padding: 1px 6px;
}
section figure { margin: 0 0 16px; }
section figcaption { font-size: 15px; color: #5d5d5d; margin-top: 8px; }

mark.hit {
  background: #1f1f1f;
  color: #fff;
  border-radius: 4px;
  padding: 0 3px;
}

/* ===== 页脚 ===== */
.base {
  margin-top: 54px;
  padding: 42px 26px 28px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--e4);
}
.base-mark {
  font-family: "Poiret One", "Didact Gothic", sans-serif;
  font-size: clamp(46px, 12vw, 118px);
  line-height: .92;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .15);
  overflow: hidden;
  white-space: nowrap;
}
.base-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.base-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--e2);
}
.base-logo img { width: 34px; height: 34px; object-fit: contain; display: block; }
.base-logo .mark-txt { color: var(--ink); font-size: 15px; line-height: 44px; }
.base-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.base-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
  color: rgba(255, 255, 255, .76);
  text-decoration: none;
}
.base-nav a:hover,
.base-nav a:focus-visible { color: #fff; }
.base-copy {
  font-size: 15px;
  color: rgba(255, 255, 255, .6);
  text-align: center;
}

/* ===== 动效 ===== */
html.js section > article:not(.hero) {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease, box-shadow .2s ease;
}
html.js section > article:not(.hero).in { opacity: 1; transform: none; }

/* ===== 窄屏 ===== */
@media (max-width: 860px) {
  .masthead {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    box-shadow: var(--e2);
  }
  .brand { order: 1; }
  .find { order: 2; flex: 1 1 150px; }
  .rail {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .rail ol { flex-direction: row; gap: 8px; width: max-content; }
  .pill { white-space: nowrap; }

  .shell {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px 14px 46px;
  }
  .side { position: static; }
  .side-list { flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .side-list li { flex: 0 0 auto; }
  .side-list a { background: var(--paper); white-space: nowrap; box-shadow: var(--e1); }

  .hero { min-height: 38vh; padding: 42px 16px; }
  section > article:not(.hero) { padding: 20px 16px 24px; margin-top: -8px; }

  .base { padding: 32px 16px 22px; }
  .base-row { grid-template-columns: auto 1fr; gap: 10px; }
  .base-copy { grid-column: 1 / -1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js section > article:not(.hero) { opacity: 1; transform: none; transition: none; }
  .pill, .skip { transition: none; }
}

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