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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rule: #d5d5d5;
  --u: 8px;
}

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

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

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

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 45vh;
  padding: calc(var(--u) * 4) calc(var(--u) * 2.5) calc(var(--u) * 4);
  overflow: hidden;
  background: #000;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12);
  opacity: 0.58;
  transform: scale(1.08);
  will-change: transform;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.68) 58%, rgba(0, 0, 0, 0.94) 100%);
}

.hero-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  margin: 0 0 calc(var(--u) * 2);
  padding: 5px 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.14em;
}

.hero-h1 {
  max-width: 22ch;
  margin: 0;
  font-family: Newsreader, Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(2.1rem, 6.4vw, 4.2rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero-lead {
  max-width: 52ch;
  margin: calc(var(--u) * 2) 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #e8e8e8;
}

/* ---------- 主区网格 ---------- */

main {
  display: block;
}

.wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--u) * 5);
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--u) * 4) calc(var(--u) * 2.5) 0;
}

.stage {
  min-width: 0;
}

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: calc(var(--u) * 7);
    padding: calc(var(--u) * 8) calc(var(--u) * 4) 0;
  }
}

/* ---------- 侧栏 ---------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.5);
  padding: calc(var(--u) * 2);
  border: 1px solid var(--ink);
  border-radius: 18px;
}

@media (min-width: 900px) {
  .rail {
    position: sticky;
    top: calc(var(--u) * 4);
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow: auto;
  }
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 40px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

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

.mark img {
  display: block;
  width: 32px;
  height: 32px;
}

.mark-txt {
  font-family: Newsreader, Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rail-head {
  margin-top: calc(var(--u) * 1);
  padding-top: calc(var(--u) * 2);
  border-top: 1px solid var(--rule);
}

.rail-h2 {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  color: #444;
}

.rail-nav ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
}

.rail-nav li:first-child a {
  border-top: 0;
}

.rail-nav a::before {
  content: "";
  width: 0;
  height: 2px;
  margin-right: 0;
  background: var(--ink);
  transition: width 0.18s ease, margin-right 0.18s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-nav a.is-on {
  font-weight: 700;
}

.rail-nav a:hover::before,
.rail-nav a:focus-visible::before,
.rail-nav a.is-on::before {
  width: 14px;
  margin-right: 8px;
}

/* ---------- 正文 ---------- */

.prose {
  max-width: 68ch;
}

.prose article {
  padding: calc(var(--u) * 4) 0;
  border-top: 1px solid var(--ink);
  scroll-margin-top: calc(var(--u) * 2);
}

.prose > article:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  margin: 0 0 0.55em;
  font-family: Newsreader, Georgia, "Songti SC", serif;
  font-size: clamp(1.55rem, 3.4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.prose h3 {
  margin: 1.6em 0 0.5em;
  font-family: Newsreader, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.05em;
  padding-left: 1.2em;
}

.prose li {
  margin: 0.35em 0;
}

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

.prose a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: calc(var(--u) * 2) calc(var(--u) * 2.5);
  border: 1px solid var(--ink);
  border-radius: 18px;
  font-style: normal;
}

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

.prose figure {
  margin: 1.6em 0;
}

.prose img {
  border: 1px solid var(--ink);
  border-radius: 18px;
}

.prose figcaption {
  margin-top: 0.5em;
  font-size: 13px;
  color: #444;
}

.prose code {
  padding: 0.1em 0.35em;
  background: #f2f2f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.prose pre {
  margin: 1.5em 0;
  padding: calc(var(--u) * 2);
  overflow: auto;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.prose table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 15px;
}

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

.prose th {
  border-bottom-color: var(--ink);
  font-weight: 700;
}

.prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--ink);
}

/* ---------- 页脚 ---------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(var(--u) * 3) calc(var(--u) * 5);
  max-width: 1180px;
  margin: calc(var(--u) * 10) auto 0;
  padding: calc(var(--u) * 4) calc(var(--u) * 2.5) calc(var(--u) * 5);
  border-top: 1px solid var(--ink);
}

.f-brand {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--u) * 2);
  min-width: 0;
}

.f-word {
  font-family: Newsreader, Georgia, "Songti SC", serif;
  font-size: clamp(2.5rem, 11vw, 5.2rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.mark-sm {
  align-self: flex-start;
}

.f-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

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

.f-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}

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

@media (max-width: 599px) {
  .site-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--u) * 3);
  }

  .f-nav ul {
    gap: 0;
  }

  .f-nav a {
    padding: 6px 8px 6px 0;
    border-radius: 0;
    border-color: transparent;
  }

  .f-nav a:hover {
    border-color: transparent;
    background: var(--ink);
    color: var(--paper);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

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