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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.16);
  --soft: #4a4a4a;
  --pad: 1.25rem;
}

*,
*::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: "Lexend", "Source Sans 3", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

figure {
  margin: 0;
}

a {
  color: var(--ink);
}

h1,
h2,
h3 {
  font-family: "Lexend", "Source Sans 3", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  scroll-margin-top: 0;
}

.bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem var(--pad);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.15rem;
  text-decoration: none;
  order: 0;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: contain;
}

.mark-text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.nav {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.nav-list > li > a,
.more-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 0.6rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}

.nav-list > li > a:hover,
.nav-list > li > a:focus-visible,
.more-btn:hover,
.more-btn:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.nav-more {
  position: relative;
}

.nav-more.open .more-btn {
  background: var(--ink);
  color: var(--paper);
}

.submenu {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.3rem;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 210px;
  max-width: calc(100vw - 2rem);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
  display: none;
  z-index: 50;
}

.nav-more.open .submenu {
  display: block;
}

.submenu li a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 0.6rem;
  font-size: 0.94rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 4px;
  transition: background-color 200ms ease, color 200ms ease;
}

.submenu li a:hover,
.submenu li a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.search {
  order: 2;
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}

.search input {
  font: inherit;
  font-size: 0.9rem;
  border: 0;
  padding: 0 0.6rem;
  min-height: 40px;
  width: 7.5rem;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
}

.search input:focus {
  outline: none;
}

.search button {
  font: inherit;
  font-size: 0.88rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0 0.7rem;
  min-height: 40px;
  cursor: pointer;
  transition: opacity 200ms ease;
}

.search button:hover {
  opacity: 0.78;
}

/* ---------- 巨幅开篇 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: end;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 58px), 0 100%);
}

.hero-media {
  position: absolute;
  top: -12%;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  will-change: transform;
}

.hero-media:empty {
  display: none;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  opacity: 0.55;
}

.hero-badge {
  position: absolute;
  top: 1.4rem;
  right: var(--pad);
  margin: 0;
  z-index: 2;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem var(--pad) 6rem;
  text-align: right;
}

.hero-copy h1 {
  font-size: clamp(2rem, 7.5vw, 4.6rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}

/* ---------- 主体网格 ---------- */

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem var(--pad) 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 3rem;
  align-items: start;
}

.doc {
  min-width: 0;
}

.doc-head {
  border-top: 3px solid var(--ink);
  padding-top: 1.1rem;
  margin-bottom: 2rem;
}

.doc-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin: 0 0 0.6rem;
}

.doc-head .subtitle {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--soft);
  max-width: 46ch;
}

.doc-media {
  margin: 0 0 2.5rem;
}

.doc-media:empty {
  display: none;
}

.doc-img {
  width: 100%;
  border-radius: 4px;
}

.doc-body div {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.doc-body div:first-child {
  border-top: 0;
  padding-top: 0.25rem;
}

.doc-body div:target h2 {
  box-shadow: inset 0 -0.42em 0 var(--ink);
  box-shadow: inset 0 -0.42em 0 rgba(0, 0, 0, 0.12);
}

.doc-body h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  margin: 0.5rem 0 0.9rem;
}

.doc-body h3 {
  font-size: 1.12rem;
  margin: 1.8rem 0 0.5rem;
}

.doc-body p,
.doc-body li {
  font-size: 1.04rem;
  line-height: 1.78;
  max-width: 66ch;
}

.doc-body p {
  margin: 0 0 1.05rem;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
}

.doc-body li {
  margin-bottom: 0.4rem;
}

.doc-body ul li::marker {
  color: var(--ink);
}

.doc-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.doc-body a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.doc-body img {
  border-radius: 4px;
  margin: 1.2rem 0;
}

.doc-body figure {
  margin: 1.6rem 0;
}

.doc-body figcaption {
  font-size: 0.86rem;
  color: var(--soft);
  padding-top: 0.5rem;
}

.doc-body blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--ink);
  font-size: 1.05rem;
}

.doc-body blockquote p {
  margin-bottom: 0.5rem;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.98rem;
}

.doc-body th,
.doc-body td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.doc-body th {
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
}

.doc-body strong {
  font-weight: 600;
}

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

.side {
  position: sticky;
  top: 92px;
  align-self: start;
  font-size: 0.95rem;
}

.side-title {
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  border-top: 3px solid var(--ink);
  padding-top: 0.8rem;
  margin: 0 0 0.6rem;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.6rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background-color 200ms ease, color 200ms ease, padding-left 200ms ease;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  padding-left: 0.95rem;
}

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

.foot {
  background: var(--ink);
  color: var(--paper);
  margin-top: 1rem;
}

.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.6rem var(--pad) 2rem;
}

.sub-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 460px;
}

.sub-form input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 46px;
  padding: 0 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--paper);
  background: transparent;
  border: 2px solid var(--paper);
  border-radius: 4px;
}

.sub-form input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.sub-form input:focus {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.sub-form button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 46px;
  padding: 0 1.3rem;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 200ms ease;
}

.sub-form button:hover {
  opacity: 0.8;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.4rem;
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.foot-address {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.copy {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}

.foot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 0.6rem;
  font-size: 0.9rem;
  color: var(--paper);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background-color 200ms ease, color 200ms ease;
}

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

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

@media (max-width: 940px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 2.2rem;
  }

  .side {
    position: static;
    top: auto;
  }

  .side-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .side-list a {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  :root {
    --pad: 1rem;
  }

  .bar-inner {
    gap: 0.45rem;
    padding-bottom: 0.6rem;
  }

  .nav-list > li > a,
  .more-btn {
    padding: 0 0.5rem;
    font-size: 0.9rem;
  }

  .search {
    order: 3;
    width: 100%;
  }

  .search input {
    width: 100%;
    flex: 1 1 auto;
  }

  .submenu {
    right: auto;
    left: 0;
  }

  .hero-copy {
    padding: 5rem var(--pad) 5.5rem;
  }

  .hero-badge {
    top: 1rem;
  }

  .doc-body p,
  .doc-body li {
    font-size: 1rem;
  }

  .foot-row {
    flex-direction: column;
    gap: 0.8rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

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