:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --fog: #f5f5f5;
  --fog-2: #ebebeb;
  --line: #e6e6e6;
  --line-2: #d3d3d3;
  --mute: #6b6b6b;
  --rad: 10px;
  --e1: 0 1px 2px rgba(31, 31, 31, 0.06), 0 2px 6px rgba(31, 31, 31, 0.05);
  --e2: 0 2px 8px rgba(31, 31, 31, 0.08), 0 10px 20px rgba(31, 31, 31, 0.06);
  --e3: 0 6px 16px rgba(31, 31, 31, 0.1), 0 20px 38px rgba(31, 31, 31, 0.1);
  --e4: 0 14px 30px rgba(31, 31, 31, 0.14), 0 34px 68px rgba(31, 31, 31, 0.12);
  --shell: 1120px;
  --bar: 84px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16.5px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: -0.005em;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 9;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--rad);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.skip:focus {
  top: 12px;
}

/* 顶栏 */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e1);
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 4px 4px 0 0 var(--line-2);
}

.primary {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.primary::-webkit-scrollbar {
  display: none;
}

.primary ul,
.chips ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

.primary a:hover,
.primary a:focus-visible {
  background: var(--fog);
}

.find {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--e1);
}

.find-in {
  width: 128px;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  font: inherit;
  font-size: 16px;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}

.find-in:focus {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.find-btn {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--fog);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.find-btn:hover {
  background: var(--fog-2);
}

/* 粘性锚点条 */
.stickybar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 clamp(10px, 3vw, 30px);
}

.stickybar::-webkit-scrollbar {
  display: none;
}

.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--mute);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.chips a:hover,
.chips a:focus-visible,
.chips a.on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* 布局 */
.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 30px) clamp(16px, 4vw, 32px) clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 22px;
}

/* 视觉层 */
.hero {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  padding: clamp(14px, 2.4vw, 24px) clamp(10px, 2vw, 20px) clamp(30px, 4vw, 42px);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 13px;
  border: 1px solid var(--line-2);
}

.hero::before {
  z-index: 1;
  left: clamp(20px, 3vw, 30px);
  right: clamp(20px, 3vw, 30px);
  top: 40px;
  bottom: 22px;
  background: var(--fog-2);
}

.hero::after {
  z-index: 0;
  left: clamp(32px, 5vw, 46px);
  right: clamp(32px, 5vw, 46px);
  top: 56px;
  bottom: 12px;
  background: var(--fog);
}

.hero-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 40px);
  min-height: 45vh;
  padding: clamp(22px, 3.4vw, 46px);
  border: 1px solid var(--ink);
  border-radius: var(--rad);
  background: var(--ink);
  color: var(--paper);
  text-align: right;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

.hero-mark {
  width: clamp(64px, 9vw, 108px);
  height: auto;
  flex: 0 0 auto;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(27px, 4.6vw, 50px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.lead {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  color: #d9d9d9;
}

/* 正文卡片 */
.deck {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--paper);
}

.deck-h {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.subtitle {
  margin: 8px 0 22px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--mute);
}

.content {
  overflow-x: clip;
}

.content div {
  padding-block: clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--bar);
}

.content div:first-child {
  border-top: 0;
  padding-top: 4px;
}

.content h2 {
  margin: 0 0 0.45em;
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.content h3 {
  margin: 1.5em 0 0.4em;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.content p {
  margin: 0 0 1em;
}

.content p:last-child {
  margin-bottom: 0;
}

.content a {
  color: var(--ink);
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}

.content a:hover {
  text-decoration-color: var(--ink);
}

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

.content li {
  margin-bottom: 0.4em;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1em 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 16px;
}

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

.content th {
  background: var(--fog);
    font-weight: 600;
}

.content blockquote {
  margin: 1.1em 0;
  padding: 12px 16px;
  background: var(--fog);
  border-left: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

.content .flash {
  animation: flash 1.5s ease-out 1;
}

@keyframes flash {
  from {
    background-color: #fdf3d3;
  }
  to {
    background-color: transparent;
  }
}

/* 右侧栏 */
.rail {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  position: sticky;
  top: 66px;
  z-index: 2;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--paper);
  box-shadow: var(--e2);
}

.rail-h {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--mute);
}

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

.rail-nav li + li {
  border-top: 1px solid var(--fog-2);
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 9px;
  font-size: 16px;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.16s ease;
}

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

/* 页脚 */
.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1.1fr;
  gap: clamp(16px, 3vw, 36px);
  padding: clamp(28px, 4vw, 46px) clamp(16px, 4vw, 40px) clamp(16px, 3vw, 24px);
  border-top: 1px solid var(--line);
  background: var(--fog);
  box-shadow: var(--e1);
}

.foot dl {
  margin: 0;
  min-width: 0;
}

.foot dt {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--mute);
}

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

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 8px;
  font-size: 16px;
  text-decoration: none;
  border-radius: 8px;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  background: var(--fog-2);
}

.sub-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 260px;
}

.sub-form input {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  font: inherit;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}

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

.sub-form button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--rad);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.sub-form button:hover {
  background: #000;
}

.copy {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  font-size: 14px;
  color: var(--mute);
}

.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--e3);
}

.totop:hover {
  box-shadow: var(--e4);
}

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

  .hero,
  .deck,
  .rail {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .rail {
    position: static;
    order: 3;
  }

  .deck {
    order: 2;
  }

  .hero {
    order: 1;
  }

  .rail-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .rail-nav li + li {
    border-top: 0;
  }

  .rail-nav a {
    padding: 8px 12px;
    background: var(--fog);
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .find-in {
    width: 100%;
  }

  .find {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .hero-card {
    flex-direction: column-reverse;
    align-items: flex-end;
    text-align: right;
    min-height: 45vh;
  }

  .hero-mark {
    width: 62px;
    align-self: flex-end;
  }

  .lead {
    font-size: 16px;
  }

  .deck {
    padding: 16px;
  }
}

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

  .hero-card {
    transform: none;
  }

  .content .flash {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

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