@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --yl: #FFD400;
  --ink: #111111;
  --paper: #F4F1EA;
  --edge: 3px solid #111111;
  --disp: 'Lexend Mega', 'Public Sans', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.7 var(--body);
  overflow-x: hidden;
}

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

a { color: inherit; }

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

/* ===== 顶部两行：品牌独占上行，工具行在下 ===== */
.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: var(--edge);
}

.bar-brand {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 2px solid var(--ink);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  text-decoration: none;
  color: var(--ink);
}

.mark img {
  display: block;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--yl);
}

.mark-tx {
  font: 800 clamp(19px, 3.4vw, 24px)/1.15 var(--disp);
  letter-spacing: .06em;
  padding: 4px 10px 5px;
  background: var(--yl);
  border: 2px solid var(--ink);
  border-radius: 4px;
  transform: skewX(-6deg);
}

.bar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 20px;
}

/* 汉堡 + 全屏遮罩菜单 */
.drawer summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--yl);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  font: 800 16px/1 var(--disp);
  letter-spacing: .16em;
}

.drawer summary::-webkit-details-marker { display: none; }

.drawer summary::before {
  content: '';
  display: block;
  width: 17px;
  height: 13px;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 3px no-repeat;
}

.drawer summary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.drawer[open] summary {
  position: relative;
  z-index: 80;
}

.drawer menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  margin: 0;
  padding: clamp(88px, 16vh, 150px) 24px 40px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  background: var(--ink);
  color: var(--paper);
  animation: veil .28s ease both;
}

.drawer menu li { border-bottom: 2px solid #333; }

.drawer menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--paper);
  font: 800 clamp(21px, 4.6vw, 32px)/1.2 var(--disp);
  transition: color .18s ease, transform .18s ease;
}

.drawer menu a:hover,
.drawer menu a:focus-visible { color: var(--yl); transform: translateX(8px); }

.no {
  font: 700 13px/1 var(--disp);
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--yl);
  padding: 5px 6px 6px;
  border-radius: 3px;
  flex: none;
}

.drawer menu .no { color: var(--yl); background: transparent; border: 2px solid #444; }

@keyframes veil {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* 搜索框 */
.find {
  display: flex;
  flex: 1 1 160px;
  max-width: 360px;
  min-width: 0;
  margin-left: auto;
}

.find input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  font: 400 16px/1 var(--body);
  color: var(--ink);
  background: #fff;
  border: var(--edge);
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.find button {
  min-height: 44px;
  padding: 0 15px;
  font: 800 16px/1 var(--body);
  color: var(--yl);
  background: var(--ink);
  border: var(--edge);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

/* ===== 首屏 ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(52px, 11vh, 104px) 20px 96px;
  color: var(--paper);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 58px));
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--yl) 1.5px, transparent 1.7px);
  background-size: 22px 22px;
  opacity: .35;
  pointer-events: none;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
  filter: grayscale(1) contrast(1.12);
  animation: drift 24s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1.04); }
  to { transform: scale(1.16); }
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: 940px;
}

.hero h1 {
  margin: 0;
  font: 800 clamp(38px, 8.6vw, 82px)/1.06 var(--disp);
  letter-spacing: .01em;
  color: var(--yl);
  text-shadow: 5px 5px 0 rgba(17, 17, 17, .85);
}

.hero h1 .lt {
  display: inline-block;
  animation: drop .62s cubic-bezier(.2, .9, .3, 1.35) both;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-.62em) rotate(-9deg); }
  to { opacity: 1; transform: none; }
}

.hero .lead {
  margin: 1.1em auto 0;
  max-width: 40ch;
  font-size: clamp(16px, 2.3vw, 19px);
  line-height: 1.7;
  color: var(--paper);
  opacity: .93;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  margin-top: 1.5em;
  padding: 0 24px;
  text-decoration: none;
  font: 800 17px/1 var(--disp);
  letter-spacing: .1em;
  color: var(--ink);
  background: var(--yl);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .65);
  transition: transform .16s ease, box-shadow .16s ease;
}

.cta:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 rgba(0, 0, 0, .7); }

/* ===== 主体：左栏目录 + 右栏正文 ===== */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) 20px 84px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 44px);
  align-items: start;
}

.index {
  position: sticky;
  top: 128px;
  border-top: 7px solid var(--ink);
  padding-top: 14px;
}

.index h2 {
  margin: 0;
  font: 800 18px/1.3 var(--disp);
  letter-spacing: .2em;
}

.index .subtitle {
  margin: .45em 0 1.1em;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .1em;
  color: #5b574c;
}

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

.toc li {
  animation: slide .5s ease both;
}

.toc li:nth-child(1) { animation-delay: .04s; }
.toc li:nth-child(2) { animation-delay: .09s; }
.toc li:nth-child(3) { animation-delay: .14s; }
.toc li:nth-child(4) { animation-delay: .19s; }
.toc li:nth-child(5) { animation-delay: .24s; }
.toc li:nth-child(6) { animation-delay: .29s; }
.toc li:nth-child(7) { animation-delay: .34s; }

@keyframes slide {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  border-bottom: 2px solid rgba(17, 17, 17, .22);
  border-radius: 4px;
}

.toc a:hover,
.toc a:focus-visible { background: var(--yl); }

.body-col { min-width: 0; }

/* ===== 正文排版 ===== */
article { max-width: 70ch; }

article section { scroll-margin-top: 132px; }

article section.in { animation: rise .55s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

article section + section {
  margin-top: clamp(36px, 6vw, 66px);
  padding-top: clamp(26px, 4vw, 42px);
  border-top: 3px dashed rgba(17, 17, 17, .32);
}

article h2 {
  position: relative;
  margin: 0 0 .55em;
  padding-left: .85em;
  font: 800 clamp(24px, 3.6vw, 33px)/1.28 var(--disp);
  letter-spacing: -.005em;
}

article h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: .22em;
  width: .34em;
  height: .82em;
  background: var(--yl);
  border: 2px solid var(--ink);
  transform: skewY(-14deg);
}

article h3 {
  margin: 1.6em 0 .5em;
  font: 800 20px/1.4 var(--disp);
}

article p {
  margin: 0 0 1.05em;
  font-size: 17px;
  line-height: 1.85;
}

article ul,
article ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

article li { margin-bottom: .45em; line-height: 1.75; }

article li::marker { color: #b89400; }

article strong {
  background: linear-gradient(transparent 62%, var(--yl) 62%);
  font-weight: 700;
}

article blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: #fff;
  border-left: 7px solid var(--yl);
  border-radius: 0 4px 4px 0;
  font-size: 17px;
}

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

article img { border-radius: 4px; display: block; margin: 1.4em 0; }

article a { text-decoration: underline; text-underline-offset: 3px; }

article hr { border: 0; border-top: 3px dashed rgba(17, 17, 17, .3); margin: 2em 0; }

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 16px;
}

article th,
article td {
  border: 2px solid var(--ink);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}

article th { background: var(--yl); }

/* ===== 页脚 ===== */
.foot {
  background: var(--ink);
  color: var(--paper);
  border-top: 7px solid var(--yl);
  padding: clamp(32px, 5vw, 60px) 20px 26px;
}

.foot-cols {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 52px);
}

.foot dl { margin: 0; }

.foot dt {
  margin-bottom: 14px;
  font: 800 15px/1 var(--disp);
  letter-spacing: .2em;
  color: var(--yl);
}

.foot dd {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.6;
}

.foot dd.host {
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: .04em;
  color: #cfcabc;
  word-break: break-all;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  color: var(--paper);
  border-bottom: 2px solid transparent;
}

.foot dd a:hover,
.foot dd a:focus-visible { color: var(--yl); border-bottom-color: var(--yl); }

.sub {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 260px;
  margin-top: 4px;
}

.sub input {
  min-height: 44px;
  padding: 0 11px;
  font: 400 16px/1 var(--body);
  color: var(--paper);
  background: transparent;
  border: 3px solid #6d695f;
  border-radius: 4px;
}

.sub input::placeholder { color: #a5a094; }

.sub button {
  min-height: 44px;
  font: 800 16px/1 var(--body);
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--yl);
  border: 3px solid var(--yl);
  border-radius: 4px;
  cursor: pointer;
}

.sub button:hover { background: var(--paper); border-color: var(--paper); }

.foot-base {
  max-width: 1160px;
  margin: clamp(26px, 4vw, 44px) auto 0;
  padding-top: 16px;
  border-top: 2px solid #3a3a3a;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  letter-spacing: .08em;
}

.foot-base p { margin: 0; }

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--yl);
  text-decoration: none;
  font-weight: 700;
}

/* ===== 断点 ===== */
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
    padding-top: 26px;
    padding-bottom: 60px;
  }

  .index { position: static; }

  .toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }

  .toc a { font-size: 15px; }

  .hero { min-height: 64vh; padding-bottom: 84px; }

  .foot-cols { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .bar-brand { padding: 9px 14px; }
  .bar-tools { padding: 8px 14px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .foot { padding-left: 14px; padding-right: 14px; }
  .hero { padding-left: 14px; padding-right: 14px; }
  .hero h1 { text-shadow: 3px 3px 0 rgba(17, 17, 17, .85); }
  .find { max-width: none; }
}

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

  .hero-img,
  .hero h1 .lt,
  .toc li,
  .drawer menu,
  article section.in {
    animation: none !important;
  }

  .toc li { opacity: 1; }
  .hero h1 .lt { opacity: 1; }
}

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