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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --radius: 28px;
  --pad: clamp(1rem, 4vw, 3rem);
  --head-h: 128px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Rubik", "Outfit", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

@media (min-width: 960px) {
  body { font-size: 1.125rem; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.2rem; }
ul, ol { margin: 0; }

h1, h2, h3, h4 {
  font-family: "Outfit", "Rubik", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0;
}

hr {
  border: 0;
  height: 4px;
  background: var(--ink);
  width: 100%;
  margin: 0 0 1.6rem;
}

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

/* ---------- 顶部细条 ---------- */
.strip {
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.strip span {
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.55rem var(--pad);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

/* ---------- 头部 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.6rem var(--pad);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: "Outfit", "Rubik", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-logo { height: 30px; width: auto; }

.pills {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.15rem 0;
  scrollbar-width: none;
}

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

.pills a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pills a:hover,
.pills a:focus-visible,
.pills a.is-on {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

@media (max-width: 800px) {
  .pills { width: 100%; margin-left: 0; }
}

/* ---------- 英雄区 ---------- */
.lead { position: relative; }

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem) var(--pad);
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 4vw));
}

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

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12) brightness(0.7);
  transform: scale(1.06);
  will-change: transform;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.12) 62%);
}

.hero-txt {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: min(100%, 940px);
}

.hero h1 {
  font-size: clamp(2.6rem, 10vw, 9rem);
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-badge {
  position: absolute;
  z-index: 3;
  top: clamp(1rem, 3vw, 2rem);
  right: var(--pad);
  padding: 0.45rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--paper);
}

/* ---------- 正文网格 ---------- */
.body-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(3rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 900px) {
  .body-grid { grid-template-columns: minmax(0, 1fr); }
}

.prose { min-width: 0; }

.prose div {
  scroll-margin-top: calc(var(--head-h) + 12px);
  padding-block: clamp(2rem, 5vw, 4rem);
}

.prose div:first-child { padding-top: 0; }
.prose div + div { border-top: 1px solid var(--ink); }

.prose h2 {
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  padding-bottom: 0.7rem;
}

.prose h3 {
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  letter-spacing: -0.03em;
  margin: 2rem 0 0.8rem;
}

.prose h4 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  margin: 1.5rem 0 0.6rem;
}

.prose h2 + hr { margin-top: 0.2rem; }

.prose p { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { background: var(--ink); color: var(--paper); }
.prose strong { font-weight: 700; }

.prose img { border-radius: var(--radius); margin: 1.5rem 0; }

.prose figure {
  margin: 1.8rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.prose figcaption {
  padding: 0.8rem 0;
  font-size: 1rem;
  line-height: 1.6;
  border-bottom: 3px solid var(--ink);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  border-left: 6px solid var(--ink);
  font-weight: 500;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin: 1.2rem 0;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0.7rem;
  text-align: left;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
  border-bottom: 2px solid var(--ink);
}

/* ---------- 侧栏 ---------- */
.side {
  position: sticky;
  top: calc(var(--head-h) + 12px);
  align-self: start;
  border-top: 4px solid var(--ink);
  padding-top: 0.8rem;
}

.side h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.side hr { height: 3px; margin: 0.6rem 0 0.9rem; }

.side ol { list-style: none; padding: 0; display: flex; flex-direction: column; }

.side a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.side a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .side { position: static; }
  .side ol { flex-direction: row; flex-wrap: wrap; gap: 0 1.2rem; }
  .side a { border-bottom: 0; }
}

/* ---------- 页脚 ---------- */
.site-foot {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(2.5rem, 6vw, 5rem) var(--pad) 1.5rem;
}

.foot-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
}

.foot-brand a {
  display: inline-block;
  font-family: "Outfit", "Rubik", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 6vw, 4.2rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.foot-brand a:hover { text-decoration: underline; }

.foot-nav dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 1rem;
}

.foot-nav dt { margin: 0; }
.foot-nav dd { margin: 0; opacity: 0.5; line-height: 1.6; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.15rem 0;
}

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

.foot-note a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  font-weight: 600;
}

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

.foot-base {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  text-align: center;
}

.foot-base p { margin: 0; font-size: 1rem; line-height: 1.6; }

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero-media img { transform: none; }
}

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