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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --green: #00ff80;
  --blue: #0000ff;
  --line: 3px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Figtree", "Noto Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.66;
  overflow-x: hidden;
}

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

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  background: var(--green);
  color: var(--ink);
}

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

hr {
  border: 0;
  height: var(--line);
  background: var(--ink);
  margin: 10px 0 18px;
}

/* ---------- 顶部细条 ---------- */
.annbar {
  background: var(--ink);
  color: var(--green);
}

.annbar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  max-width: 1240px;
  margin: 0 auto;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  background: var(--green);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  animation: blink 2.6s steps(1, end) infinite;
}

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

.markimg {
  width: 30px;
  height: 30px;
}

.marktxt {
  display: block;
  max-width: 5em;
}

.ann {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

@keyframes blink {
  0%, 72% { opacity: 1; }
  73%, 100% { opacity: 0.5; }
}

/* ---------- 胶囊导航 ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
  padding: 8px 12px;
}

.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 auto;
  padding: 0;
  max-width: 1240px;
}

.pills a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.pills a:hover,
.pills a.on {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--paper);
}

/* ---------- 大图首屏 ---------- */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  background: var(--green);
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 56%, rgba(0, 0, 0, 0.12) 100%);
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 16px 24px;
}

h1 {
  margin: 0;
  max-width: 22ch;
  color: #ffffff;
  font-size: clamp(30px, 6.2vw, 60px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* ---------- 版心 ---------- */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 16px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 42px;
  align-items: start;
}

.col {
  min-width: 0;
}

.body {
  font-size: 17px;
}

.body article {
  margin-top: 36px;
  padding-top: 26px;
  border-top: var(--line) solid var(--ink);
  scroll-margin-top: 96px;
}

.body article:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.body h2 {
  display: inline-block;
  margin: 0 0 2px;
  padding: 4px 10px;
  background: var(--green);
  box-shadow: 6px 6px 0 var(--ink);
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.body h3 {
  margin: 28px 0 8px;
  padding-left: 10px;
  border-left: 6px solid var(--blue);
  font-size: 20px;
  line-height: 1.35;
}

.body p {
  margin: 15px 0;
}

.body ul,
.body ol {
  margin: 15px 0;
  padding-left: 24px;
}

.body li {
  margin: 7px 0;
}

.body strong {
  background: var(--green);
  padding: 0 3px;
}

.body blockquote {
  margin: 22px 0;
  padding: 14px 16px;
  border-left: 6px solid var(--ink);
  background: #f2f2f2;
}

.body blockquote p:first-child {
  margin-top: 0;
}

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

.body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 16px;
}

.body th,
.body td {
  border: 2px solid var(--ink);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.body th {
  background: var(--green);
  font-weight: 700;
}

.body code {
  background: #f2f2f2;
  border: 1px solid var(--ink);
  padding: 0 4px;
  font-size: 15px;
}

/* ---------- 右侧目录 ---------- */
.rail {
  position: sticky;
  top: 78px;
  border: var(--line) solid var(--ink);
  padding: 16px;
  background: var(--paper);
  scroll-margin-top: 96px;
}

.rail-h {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.rail hr {
  margin: 8px 0 12px;
}

.index {
  list-style: none;
  counter-reset: ix;
  margin: 0;
  padding: 0;
}

.index li {
  counter-increment: ix;
  border-bottom: 2px dashed var(--ink);
}

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

.index a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 8px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.index a::before {
  content: counter(ix, decimal-leading-zero);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.index a:hover {
  background: var(--green);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 14px;
  padding: 6px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

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

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  gap: 30px;
  background: var(--ink);
  color: var(--paper);
  padding: 38px max(16px, calc(50vw - 620px)) 0;
}

footer > article {
  min-width: 0;
}

footer h2 {
  margin: 0;
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

footer hr {
  height: 2px;
  max-width: 130px;
  margin: 8px 0 12px;
  background: var(--paper);
}

.fmark {
  animation: none;
}

.fbrandtxt {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.fnav {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 18px;
}

.fnav a {
  display: block;
  min-height: 40px;
  padding: 8px 0;
  color: var(--paper);
  font-size: 16px;
  text-decoration: none;
}

.fnav a:hover {
  background: var(--green);
  color: var(--ink);
}

footer .to-top {
  margin-top: 0;
  border-color: var(--paper);
  color: var(--paper);
}

footer .to-top:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.footbar {
  grid-column: 1 / -1;
  margin-top: 26px;
  padding: 16px 0 26px;
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  text-align: center;
}

.footbar p {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .navbar {
    position: static;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-bottom: 52px;
  }

  .rail {
    position: static;
    order: 2;
  }

  .body article {
    scroll-margin-top: 24px;
  }

  footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .fnav {
    columns: 1;
  }

  .fmark {
    width: auto;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .hero {
    min-height: 45vh;
  }

  .hero-in {
    padding: 24px 14px 20px;
  }

  .wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .body h2 {
    box-shadow: 4px 4px 0 var(--ink);
  }
}

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

  * {
    animation: none !important;
  }
}

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