@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mist: #ededed;
  --soft: rgba(0, 0, 0, 0.45);
  --shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.5);
  --pad: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus { left: 0.8rem; top: 0.6rem; }

/* 顶栏 */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem var(--pad);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  overflow: hidden;
}
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rail {
  flex: 1 1 auto;
  display: flex;
  gap: 0.1rem;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 44px;
  padding: 0.7rem 0.72rem;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.rail a:hover { border-bottom-color: var(--ink); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  flex: 0 0 auto;
}

/* 头图 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  min-height: 45vh;
  padding: clamp(1.6rem, 4vw, 3rem) var(--pad) clamp(3.4rem, 7vw, 5.4rem);
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 44px));
}

.stack {
  position: relative;
  height: clamp(180px, 26vh, 290px);
}

.shot {
  position: absolute;
  overflow: hidden;
  border-radius: 28px;
  background: #191919;
  box-shadow: 0 30px 60px -32px #000;
}
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
}
.shot.one { left: 0; top: 0; width: 62%; height: 74%; z-index: 1; }
.shot.two { right: 0; bottom: 0; width: 56%; height: 66%; z-index: 2; outline: 2px solid var(--paper); }

.shout { text-align: right; }

.tag {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: #b8b8b8;
}

.hero h1 {
  margin: 0.25em 0 0.32em;
  font-size: clamp(2.5rem, 8.6vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.93;
  word-break: break-word;
}

.sub {
  margin: 0;
  margin-left: auto;
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.55;
  color: #cfcfcf;
}

/* 主体 */
.wrap {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 4rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.6rem, 7vw, 6rem) var(--pad) clamp(2rem, 6vw, 4rem);
}

.side {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 0.95rem;
}

.side h2 {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

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

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.05rem;
}
.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.55rem 0;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--mist);
  transition: padding-left 0.18s ease;
}
.toc a:hover { padding-left: 0.35rem; }

.core { min-width: 0; }

.prose > section {
  background: var(--paper);
  border: 1px solid var(--mist);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 3.2rem);
  margin-bottom: clamp(2.4rem, 6vw, 5rem);
  scroll-margin-top: 110px;
}

.prose h2,
.prose h3 {
  letter-spacing: -0.03em;
  line-height: 1.14;
  margin: 0 0 0.6rem;
}
.prose h2 { font-size: clamp(1.65rem, 4.2vw, 2.7rem); font-weight: 800; }
.prose h3 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 800; }
.prose h2 + hr,
.prose h3 + hr {
  border: 0;
  border-top: 2px solid var(--ink);
  margin: 0 0 1.5rem;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--mist);
  margin: 1.6rem 0;
}
.prose p { margin: 0 0 1.05rem; }
.prose ul,
.prose ol { margin: 0 0 1.2rem; padding-left: 1.15rem; }
.prose li { margin-bottom: 0.42rem; }
.prose a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: #555; }
.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  border-left: 4px solid var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

/* 页脚 */
.foot {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3.4rem, 8vw, 6rem) var(--pad) 1.4rem;
  margin-top: clamp(2.4rem, 7vw, 5rem);
  clip-path: polygon(0 44px, 100% 0, 100% 100%, 0 100%);
}

.bill {
  margin: 0 0 clamp(1.6rem, 5vw, 3rem);
  font-size: clamp(2.1rem, 11.5vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  word-break: break-word;
}

.cols {
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  padding-top: clamp(1.4rem, 4vw, 2.2rem);
}

.fnav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.cols dl { margin: 0; }
.cols dt {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #8d8d8d;
  margin-bottom: 0.7rem;
}
.cols dd { margin: 0 0 0.1rem; }
.cols a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0;
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}
.cols a:hover { text-decoration: underline; text-underline-offset: 4px; }

.base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1.8rem, 5vw, 3rem);
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.86rem;
}
.base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0;
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
}
.base a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 动效 */
.js .prose > section,
.js .side,
.js .shot,
.js .shout,
.js .foot {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .prose > section,
  .js .side,
  .js .shot,
  .js .shout,
  .js .foot {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 窄屏 */
@media (max-width: 860px) {
  .rail { justify-content: flex-start; }
  .bar { border-bottom-width: 2px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 3.6rem;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 28px));
  }
  .shout { order: 1; }
  .stack { order: 2; height: 200px; margin-top: 0.6rem; }
  .hero h1 { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .sub { margin-left: auto; max-width: 100%; }

  .wrap { grid-template-columns: minmax(0, 1fr); }
  .core { order: 1; }
  .side {
    position: static;
    order: 2;
    border-top: 2px solid var(--ink);
    padding-top: 0.9rem;
    margin-top: clamp(1.6rem, 5vw, 3rem);
  }
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }

  .fnav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill { font-size: clamp(2rem, 13vw, 4rem); }
}

@media (max-width: 420px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  .fnav { grid-template-columns: minmax(0, 1fr); }
  .base { flex-wrap: wrap; }
}

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