@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

:root {
  --ink: #000000;
  --blue: #3bb1ff;
  --red: #ff5252;
  --paper: #fbf6ec;
  --white: #ffffff;
  --line: 3px solid #000000;
}

*,
*::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: "Libre Baskerville", "Cormorant Garamond", Georgia, "Songti SC", SimSun, serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
}

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

.jump {
  position: fixed;
  left: 10px;
  top: -80px;
  z-index: 80;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  padding: 12px 18px;
  border: var(--line);
  box-shadow: 4px 4px 0 var(--red);
  transition: top 0.15s linear;
}

.jump:focus {
  top: 10px;
}

/* 骨架：左侧竖向轨道 + 右侧内容列 */
.frame {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.col {
  min-width: 0;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px 18px;
  background: var(--blue);
  border-right: var(--line);
  overflow-y: auto;
}

.mark {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.12s linear, box-shadow 0.12s linear;
}

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

.mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mark-t {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.rail nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rail nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  min-height: 44px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  border: var(--line);
  border-bottom-width: 8px;
  border-bottom-color: var(--red);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s linear, box-shadow 0.12s linear, background 0.12s linear;
}

.rail nav a:hover {
  background: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  border-bottom-color: var(--blue);
}

.rail nav a .n {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.55);
}

.cta {
  margin-top: auto;
  display: block;
  text-align: center;
  padding: 14px 10px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--red);
  border: var(--line);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.12s linear, box-shadow 0.12s linear;
}

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

/* 顶图 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  background-color: var(--blue);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.4) 0 16px,
    rgba(255, 255, 255, 0) 16px 32px
  );
  border-bottom: var(--line);
}

.hero.has-img {
  background-image: none;
  background-color: var(--ink);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  z-index: 0;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.46);
}

.hero:not(.has-img) .scrim {
  background: rgba(0, 0, 0, 0.1);
}

.ink {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(26px, 5vw, 66px);
}

.badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 7px 15px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--red);
  border: var(--line);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2deg);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--white);
  text-shadow: 5px 5px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink);
}

.cue {
  display: inline-block;
  margin: 26px 0 0;
  padding: 6px 13px;
  font-size: 16px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--white);
}

/* 正文 */
.sec-head {
  padding: clamp(24px, 4vw, 46px) clamp(18px, 4vw, 50px) 20px;
  background: var(--white);
  border-bottom: var(--line);
}

.sec-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  font-size: 17px;
  color: rgba(0, 0, 0, 0.72);
}

div {
  max-width: 940px;
  padding-bottom: 52px;
}

div > article {
  padding: 40px clamp(18px, 4vw, 50px);
  scroll-margin-top: 26px;
}

div > article:nth-of-type(even) {
  background: var(--white);
}

div > article + article {
  border-top: var(--line);
}

div h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  display: inline-block;
  border-bottom: 6px solid var(--red);
}

div h3 {
  margin: 24px 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
}

div p {
  margin: 0 0 15px;
  max-width: 64ch;
}

div ul,
div ol {
  margin: 0 0 16px;
  padding-left: 1.35em;
}

div li {
  margin: 8px 0;
}

div a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

div a:hover {
  background: var(--blue);
}

div img {
  display: block;
  margin: 20px 0;
  height: auto;
  border: var(--line);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
}

div blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  background: var(--white);
  border: var(--line);
  border-left-width: 10px;
  border-left-color: var(--blue);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
}

div blockquote p:last-child {
  margin: 0;
}

div table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  background: var(--white);
  font-size: 16px;
}

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

div th {
  background: var(--blue);
}

div code {
  padding: 1px 6px;
  font-size: 0.92em;
  color: var(--white);
  background: var(--ink);
  border-radius: 4px;
}

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

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

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

/* 页脚：仅 p 与 small */
footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 26px;
  align-items: end;
  padding: 28px clamp(18px, 4vw, 50px) 32px;
  background: var(--ink);
  color: var(--white);
  border-top: var(--line);
}

footer p {
  margin: 0;
}

.fbrand {
  font-size: 21px;
  letter-spacing: 0.05em;
}

.flinks {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: flex-end;
}

.flinks a {
  display: inline-block;
  padding: 10px 2px;
  min-height: 40px;
  color: var(--white);
  text-decoration: none;
  border-bottom: 3px solid var(--red);
}

.flinks a:hover {
  background: var(--red);
  color: var(--ink);
}

.fcopy {
  grid-column: 1;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 880px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: var(--line);
    overflow: visible;
  }

  .mark {
    width: 42px;
    height: 42px;
  }

  .rail nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .rail nav ul {
    flex-direction: row;
    gap: 8px;
  }

  .rail nav a {
    white-space: nowrap;
    padding: 10px 12px;
    border-bottom-width: 6px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .cta {
    margin-top: 0;
    flex: none;
    padding: 11px 12px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .hero {
    min-height: 58vh;
  }

  div > article {
    scroll-margin-top: 96px;
  }

  footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .flinks {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }

  .fcopy {
    grid-column: 1;
  }
}

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

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

  .hero-img {
    transform: none;
  }

  .mark,
  .rail nav a,
  .cta,
  .jump {
    transition: none;
  }
}

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