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

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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --tint: #f3f3f3;
  --line: #d9d9d9;
  --soft: #333333;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Libre Bodoni", Georgia, "Songti SC", "SimSun", serif;
  --gut: clamp(1rem, 4vw, 4.5rem);
  --rail: 19rem;
  --r: 10px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5.4vw, 4rem); }

h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
  border-top: 2px solid var(--ink);
  padding-top: 0.7rem;
  margin: 0 0 1.1rem;
}

h2 > span { display: block; }

h2 > span::before {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-right: 0.5em;
  background: var(--ink);
  vertical-align: 0.08em;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  margin: 1.8rem 0 0.6rem;
}

p { margin: 0 0 1.05em; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r);
  text-decoration: none;
}

/* 顶部细条 */
.ticker {
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem var(--gut);
}

.ticker p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页头：角落图标 + 横向锚点条 */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 0.35rem var(--gut);
}

.mark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  text-decoration: none;
  overflow: hidden;
}

.mark-glyph {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
}

.mark-img { width: 100%; height: 100%; object-fit: cover; }

.anchors {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.anchors::-webkit-scrollbar { display: none; }

.anchors ol {
  display: flex;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.anchors a {
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  border-radius: var(--r);
  transition: background 0.22s ease, color 0.22s ease;
}

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

.num {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  min-height: min(70vh, 640px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gut);
  border-bottom: 2px solid var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.3rem;
  padding: 3.5rem 0.75rem;
  background-image: radial-gradient(var(--line) 1.6px, transparent 1.6px);
  background-size: 18px 18px;
}

.hero-lede {
  max-width: 34ch;
  margin: 0;
  font-size: 1.0625rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.55rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  text-decoration: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.hero-cta:hover { transform: translateY(-2px); opacity: 0.9; }

.hero-media {
  position: relative;
  overflow: hidden;
  border-left: 2px solid var(--ink);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero-plate {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 16rem;
  background: var(--ink);
  background-image: linear-gradient(135deg, #000000 0%, #000000 55%, #ffffff 55%, #ffffff 100%);
}

/* 正文 + 右栏 */
.post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  column-gap: 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem var(--gut) 4rem;
}

.post > section {
  grid-column: 1;
  padding: 2.6rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 6.5rem;
}

.post > section:last-of-type { border-bottom: 0; }

.post h3 { grid-column: 1; }

.post ul,
.post ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }

.post li { margin: 0.35rem 0; }

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

.post figure { margin: 1.6rem 0; }

.post figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--soft);
}

.post blockquote {
  margin: 1.6rem 0;
  padding: 0.3rem 0 0.3rem 1.15rem;
  border-left: 4px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.5;
}

.post table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 1rem;
}

.post th,
.post td {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.post code,
.post pre {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.post pre {
  overflow-x: auto;
  background: var(--tint);
  padding: 1rem;
  border-radius: var(--r);
}

/* 右栏 */
.rail {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 6.5rem;
  margin-top: 2.6rem;
  padding: 1.4rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
}

.rail h2 {
  font-size: 1.2rem;
  border-top: 0;
  padding-top: 0;
  margin: 0 0 0.9rem;
}

.rail h2 > span::before { background: var(--paper); }

.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.05rem;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.3rem 0;
  font-size: 1rem;
  text-decoration: none;
  color: var(--paper);
  border-bottom: 1px solid #2e2e2e;
  transition: padding-left 0.2s ease;
}

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

.rail a:hover { padding-left: 0.35rem; text-decoration: underline; }

/* 页脚 */
.foot {
  background: var(--ink);
  color: var(--paper);
}

.foot-cta {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem var(--gut) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.foot-cta h2 {
  border-top: 0;
  padding-top: 0;
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
}

.foot-cta h2 > span::before { background: var(--paper); }

.foot-top {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.5rem 1.3rem;
  border: 2px solid var(--paper);
  border-radius: var(--r);
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
}

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

.foot-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem var(--gut) 2.2rem;
  border-top: 1px solid #333333;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
}

.foot-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  text-decoration: none;
  overflow: hidden;
}

.foot-mark .mark-glyph { font-size: 1.25rem; }

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.3rem 0.55rem;
  font-size: 1rem;
  text-decoration: none;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.foot-nav a:hover { opacity: 1; text-decoration: underline; }

.copy {
  margin: 0;
  font-size: 1rem;
  opacity: 0.7;
}

/* 入场动效 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-cta:hover { transform: none; }
}

/* 移动端 */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-copy { padding: 2.6rem 0 3rem; }

  .hero-media {
    border-left: 0;
    border-top: 2px solid var(--ink);
    min-height: 13rem;
  }

  .post {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    padding-bottom: 2.5rem;
  }

  .rail {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin-top: 2.2rem;
  }
}

@media (max-width: 560px) {
  .masthead { padding-left: 0.6rem; padding-right: 0.6rem; }
  .ticker p { letter-spacing: 0.04em; }
  .foot-cta { padding-top: 2.5rem; }
  .foot-nav a { padding-left: 0.35rem; padding-right: 0.35rem; }
}

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