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

:root {
  --paper: #fafaf8;
  --gray: #4a4a4a;
  --ink: #1a1a1a;
  --soft: rgba(26, 26, 26, 0.16);
  --glass: rgba(255, 255, 255, 0.58);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(26, 26, 26, 0.06) 0.8px, transparent 0.9px),
    radial-gradient(rgba(26, 26, 26, 0.042) 0.7px, transparent 0.8px);
  background-size: 6px 6px, 19px 19px;
  background-position: 0 0, 4px 7px;
  font-family: "Poppins", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(74, 74, 74, 0.07), transparent 42%),
    linear-gradient(258deg, rgba(26, 26, 26, 0.06), transparent 46%);
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
  font-family: "Righteous", "Poppins", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.012em;
}

h1 {
  font-size: clamp(1.9rem, 5.2vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--ink);
}

:focus-visible {
  outline: 3px dashed var(--gray);
  outline-offset: 3px;
}

/* 顶部两行：品牌独占一行，菜单行在下 */
.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(4px);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 -2px rgba(26, 26, 26, 0.32);
}

.mast-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  min-width: 0;
  text-decoration: none;
  font-family: "Righteous", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.22rem;
  letter-spacing: 0.03em;
  transform: rotate(-0.8deg);
}

.brand-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--ink);
  border-radius: 8px 14px 6px 12px;
  background: repeating-linear-gradient(45deg, #fff, #fff 3px, transparent 3px, transparent 6px);
  transform: rotate(-9deg);
}

.brand-img {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.15);
}

.find {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.find input {
  width: clamp(7.5rem, 26vw, 12rem);
  min-height: 42px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 20px 8px 18px 10px;
}

.find input::placeholder {
  color: var(--gray);
}

.mast-menu {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.25rem 0.6rem;
}

.tabs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabs li {
  display: block;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.4rem 0.72rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 1.6px solid transparent;
  border-radius: 12px 20px 14px 22px;
  transform: rotate(-0.7deg);
}

.tabs li:nth-child(even) a {
  transform: rotate(0.8deg);
}

.tabs a::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 50% 40% 60% 45%;
  transform: rotate(-14deg);
}

.tabs a:hover,
.tabs a:focus-visible {
  background: #fff;
  border-color: var(--ink);
  transform: rotate(0);
}

main {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* 首屏 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.4rem;
  min-height: 45vh;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.7rem 1.25rem 3.4rem;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 28px;
  background: var(--ink);
  transform: rotate(-1.1deg);
  z-index: -1;
}

.hero-text {
  text-align: center;
  min-width: 0;
}

.hero-text h1 {
  margin-bottom: 0.7rem;
  transform: rotate(-0.5deg);
}

.hero-sub {
  max-width: 33rem;
  margin: 0 auto;
  color: var(--gray);
  font-size: 16px;
}

.hero-art {
  margin: 0;
  padding: 0.5rem 0.5rem 0.32rem;
  background: var(--glass);
  border: 2px dashed var(--ink);
  border-radius: 28px;
  backdrop-filter: blur(3px);
  transform: rotate(-2.5deg);
  box-shadow: 6px 7px 0 -2px rgba(26, 26, 26, 0.13);
}

.hero-art img,
.hero-doodle {
  display: block;
  width: clamp(88px, 16vw, 148px);
  max-width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.12);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.05) 0 1px, transparent 1px 4px);
}

/* 正文区：aside 在左，正文在右 */
.stage {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  align-items: start;
  gap: 2rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 2.7rem 1.25rem 4rem;
}

.rail {
  position: sticky;
  top: 7.6rem;
  padding: 1rem 1.1rem;
  background: var(--glass);
  border: 1.6px solid var(--ink);
  border-radius: 28px;
  backdrop-filter: blur(4px);
  transform: rotate(-0.6deg);
  box-shadow: 5px 6px 0 -1px rgba(26, 26, 26, 0.13);
  min-width: 0;
}

.kicker {
  display: inline-block;
  padding: 0.08rem 0.5rem;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gray);
  border: 1.4px dashed var(--gray);
  border-radius: 10px;
  transform: rotate(-1.4deg);
}

.rail-h {
  margin: 0.5rem 0 0.55rem;
  font-size: 1.25rem;
}

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

.rail-list li {
  counter-increment: rail;
  border-top: 1.4px dashed var(--soft);
}

.rail-list li:first-child {
  border-top: 0;
}

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.35rem 0;
  font-size: 16px;
  line-height: 1.45;
  text-decoration: none;
}

.rail-list a::before {
  content: counter(rail);
  flex: 0 0 auto;
  min-width: 1.1em;
  font-family: "Righteous", sans-serif;
  font-size: 0.85rem;
  color: var(--gray);
}

.rail-list a:hover {
  text-decoration: underline wavy;
  text-underline-offset: 3px;
}

.body-col {
  min-width: 0;
  max-width: 48rem;
}

.body-col div[id] {
  scroll-margin-top: 9.5rem;
  padding: 1.5rem 0 2.1rem;
  border-top: 2px dashed var(--soft);
}

.body-col div[id]:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.body-col h2 {
  padding-bottom: 0.35rem;
  border-bottom: 2.5px solid var(--ink);
  display: inline-block;
  max-width: 100%;
  transform: rotate(-0.35deg);
}

.body-col small {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gray);
}

.body-col h3 {
  margin-top: 1.2rem;
  color: var(--ink);
}

.body-col p,
.body-col li {
  color: #222;
}

.body-col ul,
.body-col ol {
  padding-left: 1.35rem;
  margin: 0 0 1rem;
}

.body-col li {
  margin: 0.35rem 0;
}

.body-col a {
  text-decoration: underline wavy;
  text-decoration-thickness: 1.2px;
  text-underline-offset: 3px;
}

.body-col img {
  max-width: 100%;
  height: auto;
  border-radius: 22px;
  filter: grayscale(1) contrast(1.08);
}

.body-col blockquote {
  margin: 1.2rem 0;
  padding: 0.65rem 1rem;
  background: rgba(26, 26, 26, 0.055);
  border-left: 5px solid var(--ink);
  border-radius: 0 18px 18px 0;
}

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

.body-col th,
.body-col td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border: 1.4px dashed var(--gray);
}

.body-col pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 0.7rem 0.9rem;
  background: rgba(26, 26, 26, 0.055);
  border-radius: 16px;
}

.body-col code {
  overflow-wrap: anywhere;
}

.body-col hr {
  border: 0;
  border-top: 2px dashed var(--soft);
  margin: 1.6rem 0;
}

.js .rev {
  opacity: 0;
  transform: translateY(16px) rotate(-0.5deg);
  transition: opacity 0.5s steps(6), transform 0.5s steps(7);
}

.js .rev.in {
  opacity: 1;
  transform: none;
}

/* 页脚：四栏，仅 p 与 small */
.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
  margin-top: 1rem;
  padding: 2.4rem max(1.25rem, calc((100vw - 76rem) / 2)) 1.6rem;
  background: rgba(26, 26, 26, 0.045);
  border-top: 2px solid var(--ink);
  overflow-x: hidden;
}

.foot-cta {
  grid-column: 1 / -1;
  margin: 0 0 0.7rem;
  font-family: "Righteous", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.5rem, 4.4vw, 2.3rem);
  line-height: 1.25;
  text-align: center;
}

.foot-cta a {
  display: inline-block;
  padding-bottom: 0.15rem;
  text-decoration: none;
  border-bottom: 4px solid var(--ink);
}

.foot-col {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

.foot-col a {
  display: block;
  min-height: 42px;
  padding: 0.4rem 0;
  text-decoration: none;
  border-bottom: 1.3px dashed var(--soft);
}

.foot-col a:hover {
  text-decoration: underline wavy;
  text-underline-offset: 3px;
}

.foot-copy {
  grid-column: 1 / -1;
  margin-top: 0.6rem;
  font-size: 16px;
  text-align: center;
  color: var(--gray);
}

.foot-note {
  grid-column: 1 / -1;
  font-size: 16px;
  text-align: center;
}

.foot-note a {
  display: inline-block;
  min-height: 42px;
  padding: 0.35rem 0.7rem;
  text-decoration: underline wavy;
  text-underline-offset: 3px;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 2.9rem;
    gap: 1rem;
  }

  .hero-art {
    justify-self: center;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 2.2rem;
  }

  .rail {
    position: static;
    transform: rotate(-0.4deg);
  }

  .rail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.9rem;
  }

  .rail-list li:nth-child(2) {
    border-top: 0;
  }

  .body-col {
    max-width: none;
  }

  .body-col div[id] {
    scroll-margin-top: 8rem;
  }
}

@media (max-width: 700px) {
  .foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mast-top {
    padding: 0.5rem 1rem;
  }

  .mast-menu {
    padding: 0 1rem 0.55rem;
  }

  .stage {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 420px) {
  .mast-top {
    flex-wrap: nowrap;
  }

  .brand {
    font-size: 1.1rem;
    gap: 0.4rem;
  }

  .find input {
    width: 6.8rem;
    padding: 0.3rem 0.55rem;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-col a {
    border-bottom: 1.3px dashed var(--soft);
  }
}

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

  .js .rev {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-art,
  .brand,
  .rail,
  .tabs a {
    transform: none;
  }
}

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