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

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #fdfaf3;
  --edge: 3px solid var(--ink);
  --drop: 6px 6px 0 var(--ink);
  --pad: clamp(14px, 4vw, 34px);
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", "Rubik", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.16; }
p { margin: 0; }
ul, ol { margin: 0; }
small { font-size: 16px; }

:focus-visible { outline: 4px solid var(--red); outline-offset: 3px; }

/* 顶栏：品牌缩成纯图标 */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--pad);
  background: #fff;
  border-bottom: var(--edge);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--blue);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.brand-mark img { width: 30px; height: 30px; object-fit: contain; }
.brand-mark:hover { background: var(--red); }

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--red);
}

.cta:hover { background: var(--red); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }

/* 二级粘性锚点条 */
.anchorbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  border-bottom: var(--edge);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.anchorbar ul {
  display: flex;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 8px var(--pad);
  list-style: none;
}

.anchorbar a {
  display: block;
  min-height: 42px;
  padding: 9px 13px;
  border: 2px solid #fff;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.anchorbar a:hover { background: var(--blue); border-color: var(--ink); color: var(--ink); }

/* Hero：左图右文，文案右对齐 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(16px, 4vw, 44px);
  align-items: center;
  min-height: 45vh;
  padding: clamp(22px, 4vw, 40px) var(--pad) clamp(34px, 5vw, 52px);
  background: var(--blue);
  border-bottom: var(--edge);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -12px;
  height: 26px;
  background: var(--red);
  border-top: var(--edge);
  transform: skewY(-1.6deg);
}

.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  margin: 0;
  border: var(--edge);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.hero-shot { width: 100%; height: 100%; object-fit: cover; }

.decor-word {
  padding: 0 12px;
  color: var(--ink);
  font-size: clamp(1.7rem, 6.4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  transform: rotate(-3deg);
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.hero h1 {
  font-size: clamp(2rem, 6.2vw, 3.7rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.lead {
  margin-top: 14px;
  max-width: 44ch;
  padding: 10px 14px;
  border: var(--edge);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 16px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 20px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--red);
}

.hero-cta:hover { background: var(--red); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }

/* 主体：左侧目录 + 右侧正文 */
.wrap {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px) var(--pad);
  align-items: start;
}

.side {
  position: sticky;
  top: 76px;
  padding: 14px;
  border: var(--edge);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--drop);
}

.side h2 { font-size: 18px; letter-spacing: 0.04em; }
.side hr { border: 0; border-top: 3px solid var(--ink); margin: 10px 0 12px; }

.side ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }

.side a {
  display: block;
  min-height: 42px;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.side a:hover { background: var(--blue); box-shadow: 3px 3px 0 var(--ink); }

.content { min-width: 0; }

/* 正文：分区做成贴纸格子 */
.prose { display: grid; gap: clamp(16px, 3vw, 26px); min-width: 0; }

.prose > section {
  padding: clamp(16px, 3vw, 26px);
  border: var(--edge);
  border-top-width: 12px;
  border-top-color: var(--blue);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--drop);
  scroll-margin-top: 88px;
  transition: box-shadow 0.16s ease-out, border-top-color 0.16s ease-out;
}

.prose > section:nth-child(even) { border-top-color: var(--red); }
.prose > section:hover { box-shadow: 9px 9px 0 var(--ink); }
.prose > section:target { box-shadow: 9px 9px 0 var(--red); }

.prose h2 { margin-bottom: 0.55em; font-size: clamp(1.35rem, 3.2vw, 1.9rem); letter-spacing: -0.01em; }
.prose h3 { margin: 1.1em 0 0.5em; font-size: clamp(1.12rem, 2.4vw, 1.38rem); }
.prose h4 { margin: 1em 0 0.4em; font-size: 17px; }

.prose p { margin: 0 0 0.9em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 0.9em; padding-left: 1.3em; }
.prose li { margin: 0.32em 0; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
  text-decoration-color: var(--blue);
}

.prose a:hover { background: var(--blue); text-decoration-color: var(--ink); }

.prose strong { padding: 0 3px; background: #ffe680; font-weight: 700; }

.prose blockquote {
  margin: 0 0 1em;
  padding: 10px 16px;
  border-left: 8px solid var(--red);
  background: #fff4f4;
  font-weight: 500;
}

.prose hr { border: 0; border-top: 3px solid var(--ink); margin: 1.2em 0; }

.prose table { width: 100%; margin: 0 0 1em; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 8px 10px; border: 2px solid var(--ink); text-align: left; }
.prose th { background: var(--blue); }

.prose img {
  margin: 0 0 1em;
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
}

.prose code {
  padding: 1px 5px;
  border: 2px solid var(--ink);
  background: #f1f1f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
}

/* 页脚：三栏，仅 p + small */
.site-foot {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 14px 22px;
  align-items: end;
  margin-top: clamp(18px, 4vw, 42px);
  padding: clamp(26px, 6vw, 54px) var(--pad) 24px;
  border-top: var(--edge);
  background: var(--ink);
  color: #fff;
}

.foot-brand {
  color: var(--blue);
  font-size: clamp(2rem, 8.4vw, 4.8rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.foot-mid { align-self: center; line-height: 1.5; }
.foot-copy { text-align: center; line-height: 1.5; }

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.to-top:hover { background: var(--blue); }

/* 动效 */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .prose > section, .js .reveal { transition: none; }
}

/* 中屏 */
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .side ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-foot { grid-template-columns: 1fr; align-items: start; }
  .foot-copy { text-align: left; }
}

/* 小屏 */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 20px;
    padding-bottom: 34px;
  }
  .hero-media { min-height: 170px; aspect-ratio: 16 / 10; }
  .hero-text { align-items: flex-start; text-align: left; }
  .lead { max-width: none; }
  .side ul { grid-template-columns: minmax(0, 1fr); }
  .prose > section { scroll-margin-top: 76px; }
  .to-top { right: 10px; bottom: 10px; }
}

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