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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --tint: #f1f1f1;
  --pad: clamp(1.15rem, 4vw, 3.25rem);
  --gut: clamp(1rem, 2.5vw, 2rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

/* ---------- 顶部两行品牌区 + 左侧导航栏 ---------- */

.frame { display: block; }

.mast {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.tape {
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  padding: 0.4rem var(--pad);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brandline { padding: 0.7rem var(--pad) 0; }

.brand {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  padding: 0.25rem 0;
}

.tabs ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.9rem;
  padding: 0.35rem var(--pad) 0.85rem;
}

.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.1rem;
  font-size: 1rem;
  transition: font-weight 0.2s ease;
}

.tabs a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.35rem;
  height: 2px;
  width: 0;
  background: var(--ink);
  transition: width 0.22s ease;
}

.tabs a:hover::after,
.tabs a:focus-visible::after,
.tabs a[aria-current]::after { width: 100%; }

.tabs a[aria-current] { font-weight: 600; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tabs li {
  opacity: 0;
  animation: rise 0.45s cubic-bezier(0.22, 0.7, 0.3, 1) forwards;
}

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

/* ---------- Hero ---------- */

.pane { min-width: 0; }
.wrap { max-width: 1200px; }

.hero { border-bottom: 1px solid var(--ink); }

.hero-in {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 1.25rem;
  min-height: 100vh;
  padding: var(--pad);
}

.badge {
  width: 3.25rem;
  height: 3.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  animation: float 4.5s ease-in-out infinite;
}

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

h1 {
  font-size: clamp(2.1rem, 6.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 22ch;
}

.dek {
  max-width: 46ch;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.hero-fig { margin-top: 0.25rem; }

.hero-media {
  width: 100%;
  height: 100%;
  max-height: 62vh;
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- 正文 ---------- */

.prose {
  display: grid;
  gap: 2rem;
  padding: var(--pad);
  max-width: 66rem;
}

.prose > h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.prose > hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 3.5rem;
  margin: -1.5rem 0 0;
}

.prose section {
  background: var(--tint);
  border-radius: 4px;
  padding: clamp(1.15rem, 3.2vw, 2.25rem);
}

.prose section[id] { scroll-margin-top: 1.25rem; }

.prose section h2 {
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.prose section h2 + hr {
  border: 0;
  border-top: 2px solid var(--ink);
  width: 2.5rem;
  margin: 1rem 0 1.5rem;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 1.5rem 0 0.6rem;
}

.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

.prose ul, .prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.45rem; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: opacity 0.2s ease;
}

.prose a:hover { opacity: 0.55; }

.prose img { border-radius: 4px; margin: 1.25rem 0; }

.prose blockquote {
  margin: 0 0 1.1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th, .prose td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

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

.foot {
  border-top: 1px solid var(--ink);
  padding: var(--pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.fcol { font-size: 1rem; line-height: 1.6; }

.fname { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }

.fdesc { max-width: 42ch; }

.fkeys { display: flex; flex-direction: column; }

.fkeys a,
.fnote a {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  width: fit-content;
  transition: opacity 0.2s ease;
}

.fkeys a:hover,
.fnote a:hover { opacity: 0.55; }

.fbar {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

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

@media (min-width: 640px) {
  .foot { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .tabs ul { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .frame {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    align-items: start;
  }

  .mast {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--ink);
    display: flex;
    flex-direction: column;
  }

  .brandline { padding: 1.25rem var(--gut) 0; }
  .brand { font-size: 1.5rem; }

  .tabs {
    margin-top: 1.75rem;
    border-top: 1px solid var(--ink);
    padding-top: 0.5rem;
    flex: 1 1 auto;
  }

  .tabs ul {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 var(--gut) 1.5rem;
  }

  .tabs a { min-height: 2.9rem; padding: 0.5rem 0; }

  .hero-in { padding: var(--pad); gap: 1.5rem; }
  .hero-media { max-height: 66vh; }

  .prose section[id] { scroll-margin-top: 2rem; }

  .foot { grid-template-columns: 1.4fr 2fr 1fr 1fr; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tabs li { opacity: 1; }
}

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