:root {
  --ink: #000;
  --paper: #fff;
  --rail: 220px;
  --r: 28px;
  --grid: 32px;
}

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

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

body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.055) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1rem;
}

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

/* ---------- 左侧竖排栏 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--ink);
  overflow-y: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 1;
}

.rail nav p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.3rem 0.45rem;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 12px;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.ico {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  fill: currentColor;
}

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

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5rem 1.5rem 6.5rem;
  margin-bottom: 2.5rem;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border-radius: 0 0 50% 50% / 0 0 88px 88px;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.hero-in {
  position: relative;
  max-width: 46rem;
}

.badge {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.3rem 0.9rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: rotate(-1.5deg);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
}

.hero-lead {
  max-width: 34rem;
  margin: 0 auto;
  opacity: 0.9;
}

/* ---------- 主体网格 ---------- */
.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* 侧栏 */
.side {
  align-self: start;
  padding: 1.15rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.side h2 {
  margin: 0;
  font-size: 1.2rem;
}

.side .subtitle {
  margin: 0.15rem 0 0.85rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

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

.side li + li {
  border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.side a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 1rem;
  text-decoration: none;
}

.side a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 正文卡 */
.copy {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow-wrap: break-word;
}

.copy > section {
  scroll-margin-top: 1.5rem;
}

.copy > section + section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.copy h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
}

.copy h3 {
  font-size: 1.15rem;
}

.copy p,
.copy li {
  font-size: 1.0625rem;
}

.copy ul,
.copy ol {
  padding-left: 1.25rem;
}

.copy li {
  margin: 0.35rem 0;
}

.copy a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy img {
  margin: 1rem 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 18px;
}

.copy blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--ink);
}

.copy code,
.copy pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 4rem;
  padding: 3.5rem clamp(1.25rem, 5vw, 3.5rem) 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r) var(--r) 0 0;
}

.f-name {
  margin: 0 0 0.7rem;
  font-weight: 700;
  font-size: 1.15rem;
}

.f-sub {
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.f-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.f-form input {
  flex: 1 1 12rem;
  min-height: 46px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
}

.f-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.f-form button {
  min-height: 46px;
  padding: 0.6rem 1.6rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.f-form button:hover {
  color: var(--paper);
  background: transparent;
}

.f-desc {
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.78);
}

.f-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.2rem 0;
  font-size: 1rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.f-links a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.f-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.2rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.f-bottom p {
  margin: 0;
}

.f-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
}

.f-bottom a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 动效 ---------- */
@keyframes navIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.js .hero-in {
  animation: heroIn 0.6s ease both;
}

.js .rail nav a {
  animation: navIn 0.4s ease both;
}

.js .rail nav a:nth-child(1) { animation-delay: 0.05s; }
.js .rail nav a:nth-child(2) { animation-delay: 0.1s; }
.js .rail nav a:nth-child(3) { animation-delay: 0.15s; }
.js .rail nav a:nth-child(4) { animation-delay: 0.2s; }
.js .rail nav a:nth-child(5) { animation-delay: 0.25s; }
.js .rail nav a:nth-child(6) { animation-delay: 0.3s; }
.js .rail nav a:nth-child(7) { animation-delay: 0.35s; }

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

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

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

  .js .rail nav a,
  .js .hero-in {
    animation: none;
  }

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

/* ---------- 断点 ---------- */
@media (min-width: 960px) {
  body {
    padding-left: var(--rail);
  }

  div {
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }

  .side {
    position: sticky;
    top: 1.5rem;
  }
}

@media (min-width: 720px) {
  footer {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
  }

  .f-sub {
    grid-column: 1 / -1;
  }
}

@media (max-width: 959px) {
  .rail {
    position: static;
    width: auto;
    gap: 0.9rem;
    padding: 1rem 1rem 0.9rem;
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    overflow: visible;
  }

  .rail nav p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 0.35rem;
  }

  .rail nav a {
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
  }

  .hero {
    min-height: 62vh;
    padding: 3.5rem 1.25rem 4.5rem;
    margin-bottom: 2rem;
    border-radius: 0 0 50% 50% / 0 0 48px 48px;
  }

  .page-main {
    padding: 0 1rem;
  }

  .copy {
    padding: 1.25rem;
  }

  footer {
    margin-top: 2.5rem;
  }
}

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