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

:root {
  --ink: #000000;
  --pop: #3bb1ff;
  --hot: #ff5252;
  --paper: #ffffff;
  --tint: #e6f6ff;
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.7;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
button, input { font-family: inherit; }

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

::selection { background: var(--hot); color: #fff; }

[id] { scroll-margin-top: 26px; }

/* ---------- 头部：品牌行 + 菜单行 ---------- */

.site-head {
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
}

.brandbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  border-bottom: 3px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px 6px 8px;
  background: var(--pop);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.brand__name { font-size: 18px; font-weight: 900; letter-spacing: 0.03em; }

.mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  object-fit: cover;
}

.mark--text {
  display: grid;
  place-items: center;
  background: var(--hot);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.find {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  border: var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  transition: box-shadow 0.12s ease;
}

.find:focus-within { box-shadow: 4px 4px 0 var(--hot); }

.find__label {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 3px solid var(--ink);
  background: var(--tint);
  font-size: 15px;
  font-weight: 700;
}

.find__input {
  width: 118px;
  min-width: 0;
  border: 0;
  padding: 12px 10px;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.find__btn {
  min-height: 44px;
  border: 0;
  border-left: 3px solid var(--ink);
  padding: 0 14px;
  background: var(--pop);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.find__btn:hover { background: var(--hot); color: #fff; }

.menu {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
}

.menu p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  background: var(--paper);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.menu a:hover,
.menu a:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--tint);
}

.menu a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

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

.hero {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 70vh;
  padding: 32px 18px 48px;
  border-bottom: 4px solid var(--ink);
  background: var(--pop);
  text-align: center;
}

.hero__ghost {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1em;
  z-index: 0;
  color: rgba(0, 0, 0, 0.16);
  font-size: clamp(48px, 18vw, 168px);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.hero__art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  overflow: hidden;
  border: var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-4deg);
}

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

.hero__copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 14px;
  background: var(--paper);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero__title {
  font-size: clamp(32px, 7vw, 58px);
  text-shadow: 3px 3px 0 var(--paper);
}

.hero__desc {
  max-width: 580px;
  margin: 16px auto 0;
  padding: 10px 16px;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- 正文 + 侧栏 ---------- */

.stage {
  display: grid;
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.prose { min-width: 0; }

.prose > section {
  margin-bottom: 26px;
  padding: 22px 18px;
  background: var(--paper);
  border: var(--line);
  border-bottom-width: 10px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.prose > section:nth-of-type(odd) { border-bottom-color: var(--hot); }
.prose > section:nth-of-type(even) { border-bottom-color: var(--pop); }

.prose h2 { margin: 0 0 14px; font-size: clamp(24px, 3.4vw, 32px); }
.prose h3 { margin: 22px 0 10px; font-size: 21px; }

.prose h2 > span,
.prose h3 > span {
  display: inline-block;
  padding: 0 8px 2px;
  background: var(--pop);
  box-shadow: 4px 4px 0 var(--ink);
}

.prose ul,
.prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 900; }

.prose a {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.prose a:hover { background: var(--hot); color: #fff; }

.prose img {
  margin: 16px 0;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.prose figure,
.prose aside { margin: 16px 0; }

.prose figcaption {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
}

.prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--tint);
  border-left: 8px solid var(--ink);
  border-radius: 0 14px 14px 0;
}

.prose hr { height: 3px; margin: 22px 0; border: 0; background: var(--ink); }

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

.prose code {
  padding: 2px 6px;
  background: var(--tint);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-size: 0.92em;
}

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

.side {
  padding: 18px 16px;
  background: var(--tint);
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.side__title { margin: 0 0 14px; font-size: 20px; }

.side__title > span {
  display: inline-block;
  padding: 0 10px 2px;
  background: var(--hot);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}

.toc p {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--paper);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.toc a:hover,
.toc a:focus-visible,
.toc a.is-on {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--pop);
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 8px 12px;
  background: var(--pop);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.totop:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--hot);
  color: #fff;
}

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

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 18px max(16px, calc((100% - 1148px) / 2));
  border-top: 4px solid var(--ink);
  background: var(--pop);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
}

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--paper);
  border: var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.foot-nav a:hover { background: var(--ink); color: #fff; }

.foot-copy { font-size: 15px; font-weight: 700; }

/* ---------- 断点 ---------- */

@media (min-width: 900px) {
  .site-head { position: sticky; top: 0; z-index: 30; }

  [id] { scroll-margin-top: 176px; }

  .hero { padding: 64px 32px 72px; }

  .hero__art {
    position: absolute;
    top: 50%;
    right: 8%;
    z-index: 2;
    width: 150px;
    height: 150px;
    margin: 0;
    transform: translateY(-50%) rotate(-6deg);
  }

  .find__input { width: 168px; }
}

@media (min-width: 960px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
    gap: 30px;
    padding: 36px 16px 64px;
  }

  .side { position: sticky; top: 190px; }

  .prose > section { padding: 26px 26px 22px; }
}

/* ---------- 动效 ---------- */

@keyframes popIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .menu a,
  .toc a {
    animation: popIn 0.3s ease both;
  }

  .menu a:nth-child(2),
  .toc a:nth-child(2) { animation-delay: 0.05s; }
  .menu a:nth-child(3),
  .toc a:nth-child(3) { animation-delay: 0.1s; }
  .menu a:nth-child(4),
  .toc a:nth-child(4) { animation-delay: 0.15s; }
  .menu a:nth-child(5),
  .toc a:nth-child(5) { animation-delay: 0.2s; }
  .menu a:nth-child(6),
  .toc a:nth-child(6) { animation-delay: 0.25s; }
  .menu a:nth-child(7),
  .toc a:nth-child(7) { animation-delay: 0.3s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 小屏微调 ---------- */

@media (max-width: 420px) {
  body { font-size: 17px; }
  .hero__title { text-shadow: 2px 2px 0 var(--paper); }
  .find__input { width: 96px; }
  .menu a { font-size: 15px; padding: 8px 11px; }
  .foot-copy { width: 100%; }
}

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