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

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

:root {
  --w: #ffffff;
  --g: #f5f5f5;
  --k: #1f1f1f;
  --mute: #666a6e;
  --line: #e4e4e4;
  --rail: 264px;
  --pad: clamp(16px, 4vw, 48px);
  --e1: 0 1px 2px rgba(31, 31, 31, 0.07);
  --e2: 0 6px 16px rgba(31, 31, 31, 0.09);
  --e3: 0 14px 36px rgba(31, 31, 31, 0.13);
  --e4: 0 30px 70px rgba(31, 31, 31, 0.2);
}

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

body {
  margin: 0;
  background: var(--g);
  color: var(--k);
  font-family: 'Noto Sans', 'Figtree', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: 'Figtree', 'Noto Sans', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

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

a {
  color: inherit;
}

/* 左侧竖栏 */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  max-width: 100%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  box-shadow: var(--e2);
  overflow-y: auto;
  overflow-x: hidden;
}

.mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--w);
  border: 1px solid var(--line);
  box-shadow: var(--e2);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  color: var(--k);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mark:hover,
.mark:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--e3);
}

.mark img {
  width: 26px;
  height: 26px;
  display: block;
}

.rail-id {
  min-width: 0;
}

.rail-id h2 {
  font-size: 20px;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.rail-nav {
  min-width: 0;
}

.rail-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rail-nav li {
  min-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  animation: railIn 0.45s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}

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

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.35;
  color: #3b3b3b;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease,
    color 0.18s ease, border-color 0.18s ease;
}

.rail-nav a span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rail-nav a::before {
  content: '';
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border: 1px solid #9a9a9a;
  background: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--w);
  border-color: var(--line);
  box-shadow: var(--e2);
  color: var(--k);
  transform: translateX(3px);
}

.rail-nav a:hover::before,
.rail-nav a.on::before {
  background: var(--k);
  border-color: var(--k);
  transform: rotate(45deg);
}

.rail-nav a.on {
  color: var(--k);
  font-weight: 500;
  background: var(--w);
  border-color: var(--line);
  box-shadow: var(--e1);
}

@keyframes railIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* 主区 */
main {
  margin-left: var(--rail);
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.stage {
  margin-inline: calc(var(--pad) * -1);
}

.hero {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--k);
  min-height: 100vh;
  min-height: 100svh;
}

.hero-media {
  position: absolute;
  inset: -15% 0;
  z-index: 0;
  will-change: transform;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}

.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.5) 0%, rgba(31, 31, 31, 0.64) 55%, rgba(31, 31, 31, 0.82) 100%);
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: clamp(24px, 6vw, 64px);
  text-align: center;
}

.hero h1 {
  color: var(--w);
  font-size: clamp(30px, 6.2vw, 60px);
  font-weight: 600;
  text-shadow: 0 10px 44px rgba(0, 0, 0, 0.38);
  overflow-wrap: anywhere;
}

.badge {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 4vw, 44px);
  bottom: clamp(20px, 5vw, 56px);
  padding: 9px 16px;
  font-size: 13.5px;
  letter-spacing: 0.18em;
  color: var(--k);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--e3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: floaty 5.5s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* 正文 */
.content {
  padding: clamp(36px, 6vw, 76px) 0 clamp(48px, 7vw, 96px);
}

.prose {
  display: block;
  max-width: 78ch;
  margin: 0 auto;
  min-width: 0;
}

.prose > div {
  position: relative;
  background: var(--w);
  border: 1px solid #ececec;
  padding: clamp(22px, 3.5vw, 44px);
  margin-bottom: clamp(20px, 3vw, 34px);
  box-shadow: var(--e2);
  scroll-margin-top: 92px;
  transition: box-shadow 0.22s ease;
}

.prose > div:hover {
  box-shadow: var(--e3);
}

.prose > div::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--k), rgba(31, 31, 31, 0));
}

.prose h2 {
  position: relative;
  font-size: clamp(22px, 3.2vw, 30px);
  padding-left: 16px;
  margin: 0 0 0.55em;
  overflow-wrap: anywhere;
}

.prose h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 5px;
  height: 0.92em;
  background: var(--k);
}

.prose h3 {
  font-size: clamp(18px, 2.2vw, 21px);
  margin: 1.4em 0 0.4em;
}

.prose p {
  color: #2c2c2c;
}

.prose a {
  color: var(--k);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose a:hover {
  background: #f0f0f0;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
  margin: 0 0 1em;
}

.prose li {
  margin: 0.3em 0;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  background: var(--g);
  border-left: 3px solid var(--k);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em 0;
  box-shadow: var(--e1);
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  background: var(--g);
  border: 1px solid var(--line);
  font-size: 15px;
}

.prose code {
  overflow-wrap: anywhere;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

/* 页脚 */
footer {
  margin-left: var(--rail);
  background: var(--w);
  border-top: 1px solid var(--line);
  padding: clamp(30px, 5vw, 56px) 0 clamp(20px, 3vw, 30px);
  box-shadow: 0 -10px 30px rgba(31, 31, 31, 0.05);
}

.f-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
}

.f-cols dl {
  margin: 0;
  min-width: 0;
}

.f-cols dt {
  font-weight: 600;
  font-size: 16px;
}

.f-cols dt a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 var(--line);
}

.f-cols dt a:hover,
.f-cols dt a:focus-visible {
  box-shadow: inset 0 -2px 0 var(--k);
}

.f-cols dd {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--mute);
  overflow-wrap: anywhere;
}

.copy {
  margin: clamp(24px, 4vw, 40px) 0 0;
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  color: #7a7a7a;
}

@media (max-width: 900px) {
  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--e2);
    overflow: visible;
  }

  .mark {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

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

  .rail-id h2 {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rail-id .subtitle {
    display: none;
  }

  .rail-nav {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
  }

  .rail-nav ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 2px;
  }

  .rail-nav li {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .rail-nav a {
    white-space: normal;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 15px;
  }

  .rail-nav a:hover,
  .rail-nav a:focus-visible {
    transform: none;
  }

  main,
  footer {
    margin-left: 0;
  }

  .hero {
    min-height: calc(100svh - 104px);
  }

  .badge {
    right: 12px;
    bottom: 14px;
    font-size: 12.5px;
    letter-spacing: 0.14em;
  }

  .prose > div {
    scroll-margin-top: 118px;
  }

  .f-cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .copy {
    letter-spacing: 0.06em;
  }
}

@media (max-width: 400px) {
  .rail-nav a {
    font-size: 14.5px;
    padding: 8px;
  }

  .hero-in {
    padding: 20px 16px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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