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

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #f4f4f1;
  --wash-blue: #e4f4ff;
  --wash-red: #ffecec;
  --line: 3px;
  --hard: 6px 6px 0 var(--ink);
  --serif: "EB Garamond", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Lato", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 99;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 4px;
}

.skip:focus {
  top: 12px;
}

/* ---------- 顶部栏 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px clamp(10px, 3vw, 26px);
  background: #fff;
  border-bottom: var(--line) solid var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.08);
}

.rail-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 4px 6px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.rail-mark {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: var(--red);
}

.rail-name {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.rail-list {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 3px 2px 5px;
  list-style: none;
}

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

.rail-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 12px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink);
}

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

.num {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--red);
  letter-spacing: 0.06em;
}

.rail-search {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
}

.rail-search input {
  width: 134px;
  height: 44px;
  padding: 0 10px;
  border: var(--line) solid var(--ink);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}

.rail-search input:focus {
  outline: 3px solid var(--blue);
  outline-offset: -6px;
}

.rail-search button {
  height: 44px;
  padding: 0 13px;
  border: var(--line) solid var(--ink);
  border-radius: 0 4px 4px 0;
  background: var(--red);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.rail-list li.hide,
.side-list li.hide {
  display: none;
}

/* ---------- 主体骨架 ---------- */
main {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 30px) clamp(11px, 3vw, 26px) 40px;
}

.sheet {
  min-width: 0;
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  gap: 16px;
  margin: 0 0 26px;
  padding: clamp(15px, 3vw, 26px);
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  box-shadow: var(--hard);
  background-color: #dcf2ff;
  background-image: radial-gradient(#0a0a0a 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  overflow: hidden;
}

.hero-copy {
  text-align: left;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(29px, 5.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.13);
}

.hero .subtitle {
  display: inline-block;
  margin: 0;
  padding: 8px 11px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: #fff;
  font-size: 16px;
  line-height: 1.6;
}

.hero-art {
  position: relative;
  height: 178px;
  will-change: transform;
}

.ph {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--blue);
}

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

.ph-1 {
  left: 0;
  top: 8%;
  width: 62%;
  height: 72%;
  transform: rotate(-3deg);
}

.ph-2 {
  right: 0;
  bottom: 0;
  width: 55%;
  height: 64%;
  transform: rotate(3deg);
  background: var(--red);
}

/* ---------- 正文头 ---------- */
.sheet-head {
  margin: 0 0 18px;
}

.sheet-head h2 {
  margin: 0;
  padding-left: 13px;
  border-left: 11px solid var(--blue);
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 31px);
  line-height: 1.24;
  letter-spacing: -0.01em;
}

.sheet-head .subtitle {
  margin: 9px 0 0;
  padding-left: 24px;
  font-size: 16px;
  line-height: 1.65;
  color: #1a1a1a;
}

/* ---------- 正文区块（来自正文） ---------- */
.sheet > section[id] {
  margin: 0 0 26px;
  padding: clamp(16px, 3vw, 28px);
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--hard);
  scroll-margin-top: 104px;
}

.sheet > section[id]:nth-of-type(even) {
  background: var(--wash-blue);
}

.sheet > section[id]:nth-of-type(3n) {
  background: var(--wash-red);
}

.sheet > section[id] > h2 {
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: var(--line) solid var(--ink);
  font-family: var(--serif);
  font-size: clamp(22px, 3.1vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sheet > section[id] h3 {
  margin: 22px 0 9px;
  font-size: 19px;
  line-height: 1.5;
}

.sheet p {
  margin: 0 0 14px;
}

.sheet p:last-child,
.sheet ul:last-child,
.sheet ol:last-child {
  margin-bottom: 0;
}

.sheet a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid var(--red);
}

.sheet a:hover {
  background: var(--red);
}

.sheet ul,
.sheet ol {
  margin: 0 0 14px;
  padding-left: 24px;
}

.sheet li {
  margin-bottom: 7px;
}

.sheet blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: var(--line) solid var(--ink);
  border-left: 10px solid var(--red);
  border-radius: 4px;
  background: #fff9c9;
}

.sheet img {
  height: auto;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
}

.sheet table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 16px;
}

.sheet th,
.sheet td {
  padding: 9px 11px;
  border: var(--line) solid var(--ink);
  text-align: left;
}

.sheet th {
  background: var(--blue);
}

/* ---------- 侧栏 ---------- */
.side {
  margin-top: 6px;
  padding: 16px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: var(--red);
  box-shadow: var(--hard);
}

.side h2 {
  margin: 0 0 11px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.02em;
}

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

.side-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 11px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: #fff9c9;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 页脚 ---------- */
.site-foot {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 34px;
  border-top: var(--line) solid var(--ink);
  background-color: #fff;
  background-image: radial-gradient(#d9d9d9 1.2px, transparent 1.2px);
  background-size: 16px 16px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(20px, 4vw, 34px) clamp(12px, 3vw, 36px);
  border-bottom: var(--line) solid var(--ink);
  background: var(--blue);
}

.cta-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 22px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--red);
}

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

.foot-brand,
.foot-links,
.foot-top {
  padding: 20px clamp(12px, 3vw, 36px);
  border-bottom: var(--line) solid var(--ink);
}

.foot-name {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
}

.foot-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
}

.foot-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot-links a:hover {
  border-bottom-color: var(--red);
}

.foot-top {
  display: flex;
  align-items: flex-start;
}

.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  border: var(--line) solid var(--ink);
  border-radius: 4px;
  background: var(--red);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.foot-base {
  padding: 14px clamp(12px, 3vw, 36px);
  background: var(--ink);
  color: #fff;
}

.foot-base p {
  margin: 0;
  font-size: 16px;
}

/* ---------- 中屏 ---------- */
@media (min-width: 700px) {
  .hero {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    min-height: 45vh;
    gap: 22px;
  }

  .hero-copy {
    text-align: right;
  }

  .hero .subtitle {
    text-align: left;
  }

  .hero-art {
    height: 300px;
  }
}

@media (min-width: 820px) {
  .site-foot {
    grid-template-columns: 1.35fr 1fr auto;
  }

  .cta,
  .foot-base {
    grid-column: 1 / -1;
  }

  .foot-links,
  .foot-top {
    border-left: var(--line) solid var(--ink);
  }
}

/* ---------- 大屏 ---------- */
@media (min-width: 940px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 28px;
    align-items: start;
  }

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

/* ---------- 窄屏 ---------- */
@media (max-width: 819px) {
  .rail {
    flex-wrap: wrap;
    gap: 8px;
  }

  .rail-nav {
    order: 3;
    flex: 1 0 100%;
  }

  .rail-search {
    order: 2;
    margin-left: auto;
  }

  .rail-search input {
    width: 104px;
  }

  .rail-name {
    font-size: 19px;
  }

  .hero-copy {
    order: 1;
  }

  .hero-art {
    order: 2;
  }

  .sheet > section[id] {
    box-shadow: 4px 4px 0 var(--ink);
  }
}

@media (max-width: 420px) {
  .rail-search input {
    width: 84px;
  }

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

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-copy,
  .js .sheet-head,
  .js .sheet > section[id] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

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

  .rail-list a,
  .side-list a,
  .btn,
  .foot-top a {
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
  }
}

@media print {
  .rail,
  .skip,
  .side {
    position: static;
  }

  .rail-search {
    display: none;
  }
}

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