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

:root {
  --paper: #fafaf8;
  --mid: #4a4a4a;
  --ink: #1a1a1a;
  --line: rgba(26, 26, 26, 0.16);
  --line-strong: rgba(26, 26, 26, 0.32);
  --soft: rgba(26, 26, 26, 0.05);
  --card: #fdfdfb;
  --dust: #8c8c88;
  --shadow: 0 14px 26px -20px rgba(26, 26, 26, 0.65), 0 2px 0 rgba(26, 26, 26, 0.06);
  --serif: "Bodoni Moda", "Songti SC", "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: break-word;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='170' height='170'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='170' height='170' filter='url(%23n)' opacity='0.3'/></svg>");
  background-repeat: repeat;
  background-blend-mode: multiply;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
iframe { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

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

/* ── 顶栏 ─────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 16px;
  max-width: 100%;
  padding: 6px clamp(12px, 3vw, 30px) 8px;
  background: rgba(250, 250, 248, 0.95);
  border-bottom: 1px dashed var(--line-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.25);
  transform: rotate(-4deg);
}

.brand__name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.navwrap {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.navwrap nav {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav {
  display: flex;
  width: max-content;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--mid);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.12s linear, border-color 0.12s linear;
}

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

/* ── 骨架 ─────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px clamp(12px, 3vw, 30px) 64px;
}

main { min-width: 0; order: 1; }

article {
  display: grid;
  gap: 26px;
  min-width: 0;
}

/* ── 左侧索引 ─────────────────────────── */

.index {
  order: 2;
  min-width: 0;
  position: relative;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.index h2 {
  margin: 0 0 2px;
  font-size: 21px;
  letter-spacing: 0.1em;
}

.subtitle {
  margin: 4px 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mid);
}

.idx {
  display: flex;
  gap: 2px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.idx a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 10px;
  font-size: 16px;
  color: var(--mid);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: color 0.12s linear, background-color 0.12s linear;
}

.idx a:hover {
  color: var(--ink);
  background: var(--soft);
}

.idx__n {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--dust);
  letter-spacing: 0.04em;
}

/* ── 纸张式正文块 ─────────────────────── */

article > section {
  position: relative;
  min-width: 0;
  padding: clamp(18px, 3.2vw, 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

article > section:nth-child(odd) { border-radius: 9px 13px 11px 12px; }
article > section:nth-child(even) { border-radius: 12px 9px 13px 10px; }

article > section h2 {
  margin: 0 0 0.45em;
  font-size: clamp(23px, 3.4vw, 31px);
  line-height: 1.3;
}

article > section h3 {
  margin: 1.4em 0 0.4em;
  font-size: 20px;
  line-height: 1.4;
}

article > section p + h2,
article > section ul + h2 { margin-top: 1.3em; }

article > section a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

article > section a:hover { text-decoration-color: var(--ink); }

article > section ul,
article > section ol {
  padding-left: 1.2em;
  margin: 0 0 1em;
}

article > section li { margin-bottom: 0.35em; }

article > section img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  filter: grayscale(1) contrast(1.06);
}

article > section blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 16px;
  border-left: 2px dashed var(--line-strong);
  color: var(--mid);
}

article > section code {
  font-size: 16px;
  padding: 1px 4px;
  background: var(--soft);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

article > section pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  background: var(--soft);
  border-radius: 10px;
}

article > section table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

article > section th,
article > section td {
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}

/* ── 首屏 ─────────────────────────────── */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 44vh;
  max-width: 100%;
  padding-top: clamp(24px, 4vw, 40px);
  overflow: hidden;
  background: var(--card);
}

.hero::before {
  content: "";
  position: absolute;
  top: -32%;
  right: -14%;
  width: 58%;
  height: 170%;
  background: var(--soft);
  transform: rotate(-9deg);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 10px;
  background: var(--ink);
  transform: rotate(-0.9deg);
  pointer-events: none;
}

.hero__text {
  position: relative;
  z-index: 1;
  flex: 1 1 190px;
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.16;
  letter-spacing: 0.01em;
}

.hero__art {
  position: relative;
  z-index: 1;
  flex: 0 1 220px;
  min-width: 0;
  max-width: 260px;
}

.hero__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.12);
  transform: rotate(1.6deg);
  box-shadow: var(--shadow);
}

.tape {
  position: absolute;
  top: 12px;
  right: 26px;
  z-index: 2;
  width: 76px;
  height: 20px;
  background: rgba(74, 74, 74, 0.14);
  border-left: 1px dashed rgba(26, 26, 26, 0.25);
  border-right: 1px dashed rgba(26, 26, 26, 0.25);
  transform: rotate(5deg);
}

/* ── 页脚 ─────────────────────────────── */

.foot {
  margin-top: 10px;
  padding: clamp(22px, 4vw, 46px) clamp(12px, 3vw, 30px) 28px;
  background: #f2f2ee;
  border-top: 1px solid var(--line-strong);
}

.foot__cta {
  max-width: 1080px;
  margin: 0 auto 26px;
}

.foot__cta-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  width: 100%;
  min-height: 52px;
  padding-bottom: 10px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px dashed var(--line-strong);
}

.foot__cta-k {
  font-size: 16px;
  color: var(--mid);
  letter-spacing: 0.12em;
}

.foot__cta-brand {
  font-family: var(--serif);
  font-size: clamp(26px, 7vw, 52px);
  line-height: 1.1;
  letter-spacing: 0.05em;
}

.foot__cta-link:hover .foot__cta-brand {
  color: var(--mid);
}

.foot__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
}

.foot__cols dl { margin: 0; }

.foot__cols dt {
  margin-bottom: 6px;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--dust);
}

.foot__cols dd { margin: 0; }

.foot__cols dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s linear;
}

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

.foot__copy {
  max-width: 1080px;
  margin: 24px auto 0;
  font-size: 16px;
  color: var(--mid);
  text-align: center;
}

/* ── 出现 ─────────────────────────────── */

.js article > div {
  opacity: 0;
  transform: translateY(14px);
}

.js article > div.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* ── 断点 ─────────────────────────────── */

@media (max-width: 800px) {
  .navwrap { flex-basis: 100%; }
  .nav { margin-left: 0; }
}

@media (min-width: 900px) {
  .shell {
    grid-template-columns: 214px minmax(0, 1fr);
    gap: 36px;
    padding-top: 30px;
  }
  .index {
    order: 1;
    position: sticky;
    top: 78px;
    align-self: start;
    padding-top: 0;
    border-top: 0;
    border-left: 1px dashed var(--line-strong);
    padding-left: 14px;
  }
  .idx {
    flex-direction: column;
    gap: 1px;
    overflow: visible;
  }
  .idx a {
    border: 0;
    border-radius: 0;
    padding: 2px 4px;
  }
}

@media (min-width: 700px) {
  .foot__cols { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

@media (max-width: 620px) {
  .hero { gap: 14px; }
  .hero__art { flex: 0 1 150px; max-width: 150px; }
  .hero__img { transform: rotate(1deg); }
  .tape { width: 58px; height: 17px; right: 14px; }
  .foot__cta-brand { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js article > div {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__img, .brand__mark, .tape, .hero::after, .hero::before {
    transform: none;
  }
}
</style>

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