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

:root {
  --ink: #141414;
  --ink-2: #1c1c1c;
  --amber: #E8A33D;
  --paper: #F2EDE6;
  --paper-dim: rgba(242, 237, 230, 0.68);
  --paper-faint: rgba(242, 237, 230, 0.42);
  --line: rgba(242, 237, 230, 0.14);
  --head: 152px;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.78;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

img { max-width: 100%; }

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--paper); }

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

/* ---------- 分层背景 ---------- */
.stage {
  position: fixed;
  inset: -30vh 0 -10vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.layer-1 { background: radial-gradient(115% 58% at 82% 6%, rgba(232, 163, 61, 0.18), transparent 62%); }
.layer-2 { background: radial-gradient(72% 48% at 10% 56%, rgba(232, 163, 61, 0.1), transparent 66%); }
.layer-3 {
  background:
    linear-gradient(180deg, rgba(20, 20, 20, 0) 52%, rgba(20, 20, 20, 0.94) 100%),
    radial-gradient(92% 42% at 50% 100%, rgba(232, 163, 61, 0.09), transparent 72%);
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.ticker {
  margin: 0;
  padding: 7px 18px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--amber);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}

.brandrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.mark-img { width: 26px; height: 26px; object-fit: contain; display: block; }

.brand {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.menubar { padding: 0 18px 11px; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.menu-btn:hover { border-color: var(--amber); color: var(--amber); }

.bars { display: inline-flex; flex-direction: column; gap: 4px; }
.bars i { display: block; width: 18px; height: 2px; background: currentColor; }

/* ---------- 全屏遮罩菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 32px;
  background: rgba(14, 14, 14, 0.975);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  visibility: hidden;
  transform: translateY(-101%);
  transition: transform 0.5s cubic-bezier(0.22, 0.7, 0.3, 1), visibility 0.5s;
}

.drawer.open { visibility: visible; transform: translateY(0); }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-brand { font-size: 18px; font-weight: 600; color: var(--amber); letter-spacing: 0.06em; }

.drawer-close {
  min-height: 44px;
  padding: 0 18px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.drawer-close:hover { border-color: var(--amber); color: var(--amber); }

.drawer-list { display: grid; gap: 0; padding: 12px 0; }

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 2px;
  font-size: 19px;
  color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.drawer-link:hover { color: var(--amber); }

.drawer-no {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--amber);
  min-width: 26px;
}

/* ---------- 首屏 ---------- */
main { position: relative; z-index: 1; }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--head) + 16px) 18px 0;
  text-align: right;
  overflow: hidden;
}

.hero-txt {
  width: 100%;
  max-width: 620px;
  margin-left: auto;
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 5px 14px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  background: rgba(232, 163, 61, 0.09);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(28px, 7vw, 58px);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.hero .lede {
  margin: 0 0 0 auto;
  max-width: 50ch;
  color: var(--paper-dim);
  font-size: 16px;
}

.hero-art {
  margin-top: auto;
  padding-top: 26px;
  width: 100%;
}

.hero-art:empty {
  min-height: 32vh;
  background: linear-gradient(180deg, rgba(232, 163, 61, 0.12), rgba(20, 20, 20, 0));
}

.hero-art img {
  display: block;
  width: 100%;
  height: clamp(170px, 36vh, 400px);
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  filter: saturate(0.86) contrast(1.04);
}

/* ---------- 主体骨架 ---------- */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 18px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.rail {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: rgba(28, 28, 28, 0.62);
}

.rail h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--amber);
}

.rail nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rail nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  color: var(--paper-dim);
}

.rail nav a:hover { border-color: var(--amber); color: var(--amber); }

.chapter { min-width: 0; }

section {
  max-width: 72ch;
  padding-bottom: 10px;
}

section article {
  padding: 38px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--head) + 16px);
}

section article:first-child { border-top: 0; padding-top: 0; }
section article:last-child { padding-bottom: 8px; }

section h2 {
  margin: 0 0 12px;
  font-size: clamp(23px, 3.6vw, 32px);
  line-height: 1.36;
  font-weight: 600;
  letter-spacing: -0.01em;
}

section h3 {
  margin: 26px 0 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--amber);
}

section p { margin: 0 0 16px; color: var(--paper-dim); }
section strong { color: var(--paper); font-weight: 600; }
section em { color: var(--paper); font-style: italic; }

section ul, section ol { margin: 0 0 16px; padding-left: 22px; color: var(--paper-dim); }
section li { margin: 0 0 9px; }

section blockquote {
  margin: 22px 0;
  padding: 12px 18px;
  border-left: 2px solid var(--amber);
  background: rgba(232, 163, 61, 0.06);
  color: var(--paper);
}

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

section a { border-bottom: 1px solid rgba(232, 163, 61, 0.5); }
section a:hover { border-bottom-color: var(--paper); }

section table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 16px; }
section th, section td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
section th { color: var(--amber); font-weight: 500; }

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

section h2 + hr,
section h3 + hr,
.rail h2 + hr {
  height: 2px;
  margin: 0 0 22px;
  background: linear-gradient(90deg, var(--amber), rgba(232, 163, 61, 0));
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  margin-top: 44px;
  padding: 34px 18px 26px;
  border-top: 1px solid var(--line);
  background: rgba(20, 20, 20, 0.72);
}

.foot-mark {
  margin: 0 0 22px;
  font-size: clamp(42px, 13vw, 118px);
  line-height: 0.94;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(242, 237, 230, 0.11);
  word-break: break-all;
}

.foot-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto 24px;
}

dl { margin: 0; }

dt {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 6px;
}

dd { margin: 0; font-size: 16px; color: var(--paper-faint); overflow-wrap: anywhere; }

.foot-nav dt a,
.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: var(--paper-dim);
}

.foot-nav dt a { color: var(--amber); }
.foot-nav dd a:hover { color: var(--amber); }

.copy {
  margin: 0;
  text-align: center;
  font-size: 16px;
  color: var(--paper-faint);
  letter-spacing: 0.06em;
}

/* ---------- 滚动揭示 ---------- */
html.js main section > article,
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.75s cubic-bezier(0.22, 0.7, 0.3, 1);
}

html.js main section > article.in,
html.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

html.js .rail nav a[data-reveal] { transition-delay: 0.05s; }

/* ---------- 断点 ---------- */
@media (min-width: 720px) {
  .drawer-list { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .foot-cols { grid-template-columns: 1fr 1fr 1fr; }
  .foot-nav dl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .foot-nav dt { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  :root { --head: 156px; }
  .wrap {
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 0 46px;
    padding: 62px 24px 48px;
  }
  .rail { position: sticky; top: calc(var(--head) + 16px); align-self: start; }
  .rail nav { flex-direction: column; flex-wrap: nowrap; }
  .rail nav a {
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .foot { padding: 48px 24px 30px; }
}

@media (max-width: 420px) {
  .hero { padding-left: 15px; padding-right: 15px; }
  .hero .lede { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js main section > article,
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .drawer { transition: none; }
  .layer { will-change: auto; }
}

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