@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --grey: #4a4a4a;
  --wash: #ececE6;
  --edge: rgba(26, 26, 26, 0.2);
}

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

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

body {
  margin: 0;
  padding-bottom: 104px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Fira Code', 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace;
  font-size: 1.0625rem;
  line-height: 1.78;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.045) 0 1px, transparent 1px 3px),
    radial-gradient(rgba(26, 26, 26, 0.1) 0.6px, transparent 0.7px);
  background-size: auto, 5px 5px;
  mix-blend-mode: multiply;
}

h1, h2, h3, h4 {
  margin: 0 0 0.55em;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.1rem, 8.4vw, 4.4rem);
  letter-spacing: -0.035em;
}

h2 { font-size: clamp(1.45rem, 4.1vw, 2rem); }

h3 {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  color: var(--grey);
}

p { margin: 0 0 1.05em; }

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

small {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: var(--grey);
  margin-bottom: 0.4em;
  font-weight: 400;
}

ul, ol { padding-left: 1.25em; }

li { margin-bottom: 0.4em; }

img { max-width: 100%; }

/* ---------- 纸面主体 ---------- */
.sheet {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 10px;
}

.sheet > div {
  position: relative;
  padding: 34px 0;
  border-top: 1px solid var(--edge);
  scroll-margin-top: 18px;
}

.sheet > div:first-of-type { border-top: 0; }

.sheet > div:nth-of-type(even) {
  background: linear-gradient(90deg, rgba(26, 26, 26, 0.03), transparent 60%);
}

.sheet div figure {
  margin: 22px 0;
  padding: 10px;
  background: var(--wash);
  transform: rotate(-0.4deg);
}

.sheet div figure img {
  display: block;
  width: 100%;
  filter: grayscale(1) contrast(1.1);
}

.sheet div blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--ink);
  color: var(--paper);
  transform: rotate(0.35deg);
}

.sheet div blockquote p:last-child { margin-bottom: 0; }

.sheet div a {
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.sheet div a:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 头部拼贴 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(70vh, 540px);
  padding: 42px 0 26px;
  border-top: 0 !important;
}

.hero-word {
  position: absolute;
  left: -8px;
  top: 0.1em;
  z-index: 0;
  font-size: clamp(4.2rem, 23vw, 12rem);
  line-height: 0.78;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: rgba(26, 26, 26, 0.075);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.num {
  position: absolute;
  right: 4px;
  top: 20px;
  z-index: 2;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  padding: 4px 8px;
  border: 1.5px dashed var(--grey);
  color: var(--grey);
  transform: rotate(3deg);
}

.collage {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  height: clamp(170px, 30vh, 290px);
}

.ph {
  display: block;
  object-fit: cover;
  background: var(--wash);
  filter: grayscale(1) contrast(1.15);
  will-change: transform;
}

.ph-a {
  position: absolute;
  left: 0;
  top: 0;
  width: 58%;
  height: 100%;
  transform: rotate(-2.2deg) translateY(var(--py, 0px));
  box-shadow: 7px 8px 0 rgba(26, 26, 26, 0.13);
}

.ph-b {
  position: absolute;
  right: 3%;
  top: 11%;
  width: 40%;
  height: 78%;
  transform: rotate(2.6deg) translateY(var(--py, 0px));
  box-shadow: -5px 6px 0 rgba(26, 26, 26, 0.11);
}

.ph.empty {
  background-image: repeating-linear-gradient(45deg, #e9e9e3 0 9px, #dcdcd6 9px 18px);
}

.hero-copy { position: relative; z-index: 2; }

.hero-copy h1 { margin-bottom: 0.35em; }

.lede {
  max-width: 48ch;
  color: var(--grey);
  font-size: 1.0625rem;
  padding-left: 12px;
  border-left: 3px solid var(--ink);
}

/* ---------- 侧注 ---------- */
.rail {
  margin: 34px 0 10px;
  padding: 18px 16px 20px;
  background: var(--wash);
  transform: rotate(-0.5deg);
}

.rail h2 { font-size: 1.15rem; }

.rail ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 2px;
  text-decoration: none;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.28);
}

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

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 48px;
  background: var(--ink);
  color: var(--paper);
  border-top: 4px solid var(--paper);
  box-shadow: inset 0 6px 0 rgba(250, 250, 248, 0.12);
}

.foot-cta { padding: 44px 20px 34px; text-align: center; }

.foot-cta a {
  display: inline-block;
  font-size: clamp(1.5rem, 6.4vw, 2.5rem);
  line-height: 1.1;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: -0.02em;
  border-bottom: 3px solid var(--paper);
  padding-bottom: 6px;
}

.foot-cta a:hover {
  background: var(--paper);
  color: var(--ink);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  padding: 16px 20px 26px;
  border-top: 1px dashed rgba(250, 250, 248, 0.32);
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-2deg);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 12px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 2px;
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 2px solid transparent;
}

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

.copy {
  margin: 0;
  color: rgba(250, 250, 248, 0.72);
  font-size: 1rem;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--paper);
}

.dock-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-2.5deg);
}

.mark-img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: grayscale(1);
}

.mark-txt { font-size: 1.15rem; font-weight: 700; }

.dock details {
  position: relative;
  flex: 1 1 auto;
}

.dock summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--paper);
  letter-spacing: 0.24em;
  font-size: 1rem;
  text-transform: none;
  transition: background 0.12s linear, color 0.12s linear;
}

.dock summary::-webkit-details-marker { display: none; }

.dock details[open] summary {
  background: var(--paper);
  color: var(--ink);
}

.dock menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--ink);
  border: 2px solid var(--paper);
  box-shadow: 6px 6px 0 rgba(26, 26, 26, 0.25);
}

.dock menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px dashed rgba(250, 250, 248, 0.32);
}

.dock menu li:last-child a { border-bottom: 0; }

.dock menu a:hover,
.dock menu a:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 桌面 ---------- */
@media (min-width: 861px) {
  .dock { padding: 7px 20px; }

  .dock details {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
  }

  .dock summary { padding: 0 12px; letter-spacing: 0.16em; }

  .dock menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0 2px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .dock menu a {
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0 10px;
  }

  .dock menu a:hover,
  .dock menu a:focus-visible {
    background: transparent;
    color: var(--paper);
    border-bottom-color: var(--paper);
  }
}

@media (min-width: 940px) {
  .sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 248px;
    column-gap: 56px;
    align-items: start;
  }

  .sheet > * {
    grid-column: 1;
    min-width: 0;
  }

  .rail {
    grid-column: 2;
    grid-row: 1 / span 50;
    position: sticky;
    top: 22px;
    margin-top: 42px;
  }

  .hero { min-height: min(70vh, 600px); }

  .foot-row { justify-content: space-between; }
  .foot-nav { justify-content: flex-start; }
  .copy { margin-left: auto; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; padding-bottom: 96px; }
  .sheet { padding: 0 14px 8px; }
  .copy { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .ph { transform: none !important; }
}

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