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

:root {
  --paper: #f5e6c8;
  --paper-2: #eed9b4;
  --paper-3: #fbf3e2;
  --brass: #d4a574;
  --brass-deep: #a9763f;
  --ink: #262117;
  --ink-2: #4b3f2f;
  --line: rgba(38, 33, 23, 0.26);
  --line-soft: rgba(38, 33, 23, 0.14);
  --font-head: "Orbitron", "Exo 2", system-ui, sans-serif;
  --font-body: "Exo 2", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 82% 6%, rgba(212, 165, 116, 0.5), transparent 58%),
    radial-gradient(ellipse at 8% 92%, rgba(169, 118, 63, 0.28), transparent 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23g)' opacity='0.55'/></svg>");
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(102deg, rgba(255, 214, 158, 0.42) 0%, transparent 26%),
    linear-gradient(260deg, rgba(255, 196, 140, 0.36) 0%, transparent 22%);
  animation: leak 14s ease-in-out infinite alternate;
}

@keyframes leak {
  0% { opacity: 0.32; transform: translate3d(0, 0, 0); }
  100% { opacity: 0.66; transform: translate3d(0, -12px, 0); }
}

img {
  max-width: 100%;
}

/* —— 顶栏 —— */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(245, 230, 200, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(7px) saturate(0.9);
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-3);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.mark:hover,
.mark:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-6deg);
}

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

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

.nav ol {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding: 11px 11px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--brass-deep);
}

.call {
  flex: 0 0 auto;
  padding: 11px 15px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.call:hover,
.call:focus-visible {
  background: var(--brass-deep);
  transform: translateY(-1px);
}

/* —— 骨架 —— */
main {
  position: relative;
  z-index: 2;
  padding-top: 64px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

.intro {
  display: block;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  padding: 84px 0 64px;
  text-align: right;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--ink);
  background: rgba(212, 165, 116, 0.55);
  border: 1px solid var(--ink);
  border-radius: 999px;
  transform: rotate(-3deg);
  animation: float 6.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-7px); }
}

.h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(42px, 9.4vw, 104px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  text-shadow: 3px 3px 0 rgba(212, 165, 116, 0.85);
}

.h1:hover {
  animation: track 0.5s steps(3) 1;
}

@keyframes track {
  0% { transform: skewX(0deg) translateX(0); }
  35% { transform: skewX(-2.4deg) translateX(-4px); }
  70% { transform: skewX(1.6deg) translateX(2px); }
  100% { transform: skewX(0deg) translateX(0); }
}

.lede {
  margin: 0;
  max-width: 40ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}

.hero-line {
  display: block;
  width: 172px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ink));
}

/* —— 正文 + 侧栏 —— */
.cols {
  display: flex;
  align-items: flex-start;
  gap: 46px;
  padding-bottom: 56px;
}

.body {
  flex: 1 1 auto;
  min-width: 0;
  counter-reset: sec;
}

.body section {
  position: relative;
  padding: 54px 0 8px;
  border-top: 1px dashed var(--line);
  scroll-margin-top: 92px;
}

.body section:first-child {
  border-top: 0;
  padding-top: 20px;
}

.body section::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--brass-deep);
}

.body h2 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0;
  color: var(--ink);
}

.body h3 {
  margin: 1.6em 0 8px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

hr {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 1px;
  margin: 12px 0 20px;
  border: 0;
  background: linear-gradient(90deg, var(--ink), rgba(38, 33, 23, 0));
}

.body p {
  margin: 0 0 1.05em;
  max-width: 64ch;
}

.body ul,
.body ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
  max-width: 64ch;
}

.body li {
  margin: 0.4em 0;
}

.body a {
  color: var(--brass-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.body a:hover,
.body a:focus-visible {
  color: var(--ink);
  background: rgba(212, 165, 116, 0.45);
}

.body strong {
  color: #1b1710;
}

.body blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--brass);
  background: rgba(212, 165, 116, 0.2);
}

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

.body img {
  display: block;
  width: auto;
  height: auto;
  margin: 1.5em 0;
  border: 9px solid var(--paper-3);
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(38, 33, 23, 0.24);
  transform: rotate(-0.7deg);
}

.body figure {
  margin: 0 0 1.4em;
}

.body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.4em;
  border-collapse: collapse;
  font-size: 16px;
}

.body th,
.body td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.body code {
  padding: 1px 5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.94em;
  background: rgba(38, 33, 23, 0.09);
  border-radius: 4px;
}

/* —— 侧栏 —— */
.rail {
  flex: 0 0 248px;
  position: sticky;
  top: 96px;
  padding-left: 22px;
  border-left: 1px dashed var(--line);
}

.rail h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li + li {
  border-top: 1px solid var(--line-soft);
}

.rail-list a {
  display: block;
  padding: 11px 2px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  text-decoration: none;
  transition: padding-left 0.2s ease, color 0.2s ease;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  padding-left: 8px;
  color: var(--brass-deep);
}

/* —— 页脚 —— */
.foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 44px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.foot p {
  margin: 0;
}

.f1 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.f2 {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.f2 a,
.f3 a {
  display: inline-block;
  padding: 8px 0;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.f2 a:hover,
.f3 a:hover,
.f2 a:focus-visible,
.f3 a:focus-visible {
  color: var(--brass-deep);
  border-bottom-color: var(--brass-deep);
}

.f3 {
  justify-self: end;
  font-size: 16px;
  color: var(--ink-2);
}

.f3 a {
  margin-left: 12px;
}

/* —— 滚动揭示 —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* —— 断点 —— */
@media (max-width: 900px) {
  .cols {
    display: block;
  }

  .rail {
    position: static;
    margin-top: 30px;
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px dashed var(--line);
  }

  .rail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .foot {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 6px;
  }

  .f2 {
    justify-content: flex-start;
    gap: 16px;
  }

  .f3 {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 17px;
  }

  .bar {
    gap: 6px;
    padding: 7px 12px;
  }

  .wrap,
  .foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 86vh;
    padding: 56px 0 44px;
    gap: 14px;
  }

  .h1 {
    font-size: clamp(40px, 13.5vw, 62px);
  }

  .lede {
    max-width: 32ch;
  }

  .body article {
    padding-top: 42px;
    scroll-margin-top: 84px;
  }

  .rail-list {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

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

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