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

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #eef3f8;
  --white: #ffffff;
  --line: 3px solid #000000;
  --sh: 6px 6px 0 #000000;
  --r: 28px;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  color: #0b0b0b;
  background: var(--paper);
  background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

/* ---------- 左侧固定导航 ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--white);
  border-bottom: 4px solid var(--ink);
  padding: 10px 12px 8px;
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  background: var(--blue);
  border: var(--line);
  box-shadow: 4px 4px 0 var(--ink);
}

.brand-mark {
  width: 13px;
  height: 13px;
  background: var(--ink);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.rail-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: var(--white);
  background: var(--red);
  border: var(--line);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.rail-cta:hover,
.rail-cta:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.rail-list {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0 0 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.rail-list li {
  flex: 0 0 auto;
}

.rail-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 13px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: var(--white);
  border: var(--line);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.rail-link:hover,
.rail-link:focus-visible {
  background: var(--blue);
  transform: translate(-1px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.rail-ico {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: var(--red);
  border: 2px solid var(--ink);
}

/* ---------- 骨架 ---------- */

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 0;
}

/* ---------- 侧栏 ---------- */

.side {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(7px);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px;
  margin-bottom: 22px;
}

.side-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  display: inline-block;
}

.side-title span {
  border-bottom: 3px solid var(--red);
  padding-bottom: 2px;
}

.side-list {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.side-list li {
  flex: 0 0 auto;
}

.side-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition: background 0.14s ease;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: var(--blue);
}

.side-list .num {
  font-weight: 700;
  font-size: 13px;
  color: var(--red);
}

.side-top {
  display: none;
  margin-top: 16px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-height: calc(100vh - 150px);
  padding: 26px 18px 86px;
  margin-bottom: 26px;
  border: 4px solid var(--ink);
  background-color: var(--blue);
  background-image: radial-gradient(rgba(0, 0, 0, 0.22) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  box-shadow: 8px 8px 0 var(--ink);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 62px;
  background: var(--paper);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(30px, 7vw, 58px);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-desc {
  margin: 18px 0 24px;
  max-width: 48ch;
  font-size: 17px;
  font-weight: 500;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 3px solid var(--ink);
  border-radius: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  color: var(--white);
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 var(--ink);
}

.hero-art {
  position: relative;
  z-index: 1;
  margin: 0;
}

.hero-img {
  width: 100%;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-1.2deg);
}

/* ---------- 正文 ---------- */

main {
  min-width: 0;
}

section > article[id] {
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(6px);
  border: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 24px 18px;
  margin-bottom: 26px;
  scroll-margin-top: 136px;
}

section > article[id] > *:first-child {
  margin-top: 0;
}

section > article[id] > *:last-child {
  margin-bottom: 0;
}

section h2 {
  font-size: clamp(23px, 4.4vw, 32px);
  font-weight: 700;
  margin: 0 0 16px;
}

section h2 > span {
  border-bottom: 4px solid var(--blue);
  padding-bottom: 2px;
}

section h3 {
  font-size: clamp(19px, 3.2vw, 23px);
  font-weight: 700;
  margin: 26px 0 12px;
}

section h3 > span {
  border-bottom: 3px solid var(--red);
  padding-bottom: 2px;
}

section h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 10px;
}

section p {
  margin: 0 0 1.05em;
}

section ul,
section ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

section li {
  margin-bottom: 0.5em;
}

section li::marker {
  color: var(--red);
  font-weight: 700;
}

section a {
  color: #0a5b8f;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

section a:hover {
  color: var(--red);
}

section strong {
  font-weight: 700;
  background: rgba(59, 177, 255, 0.32);
  padding: 0 3px;
}

section blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-left-width: 10px;
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}

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

section table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 16px;
  background: var(--white);
  border: 3px solid var(--ink);
}

section th,
section td {
  border: 2px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

section th {
  background: var(--blue);
  font-weight: 700;
}

section code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 1px 5px;
}

section hr {
  border: 0;
  border-top: 3px dashed var(--ink);
  margin: 26px 0;
}

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 12px;
  padding: 24px 16px 34px;
  background: var(--white);
  border-top: 4px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.foot-sec {
  width: 100%;
}

.foot-h {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.foot-h span {
  border-bottom: 3px solid var(--red);
  padding-bottom: 2px;
}

.foot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  background: var(--blue);
}

.foot-copy {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.foot-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

/* ---------- 滚动显现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ---------- 桌面 ---------- */

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    align-items: center;
    gap: 30px;
    min-height: calc(100vh - 60px);
    padding: 40px 38px 96px;
  }

  .hero-desc {
    margin: 20px 0 26px;
  }

  section > article[id] {
    padding: 34px 34px;
  }
}

@media (min-width: 1024px) {
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    border-bottom: 0;
    border-right: 4px solid var(--ink);
    background: var(--white);
  }

  .rail-top {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .brand {
    justify-content: flex-start;
  }

  .rail-cta {
    justify-content: center;
    padding: 14px 16px;
    font-size: 17px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .rail-list {
    flex-direction: column;
    overflow: visible;
    margin-top: 22px;
    gap: 10px;
    padding-bottom: 0;
  }

  .rail-link {
    width: 100%;
  }

  .shell {
    margin-left: 272px;
    margin-right: 0;
    padding: 24px 28px 0;
  }

  .shell {
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }

  .side {
    position: sticky;
    top: 24px;
    margin-bottom: 0;
  }

  .side-list {
    flex-direction: column;
    overflow: visible;
    padding: 0;
  }

  .side-list li {
    flex: 1 1 auto;
  }

  .side-list a {
    width: 100%;
    border-radius: 12px;
    justify-content: flex-start;
    border-width: 2px;
  }

  .side-top {
    display: block;
  }

  section > article[id] {
    scroll-margin-top: 24px;
  }

  main {
    max-width: 840px;
  }

  .foot {
    margin-left: 272px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 22px 28px 26px;
  }

  .foot-sec {
    width: auto;
  }

  .foot-links {
    justify-content: flex-start;
  }

  .foot-copy {
    margin-bottom: 8px;
  }
}

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

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

  .btn,
  .rail-cta,
  .rail-link,
  .rail-link:hover,
  .rail-cta:hover {
    transition: none;
  }
}

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