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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mid: #767676;
  --soft: #f1f1f1;
  --u: 8px;
  --wide: 1240px;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.055) 1px, transparent 1px);
  background-size: 100px 100%;
  font-family: "Noto Sans Hebrew", Inter, Helvetica, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; }

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

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

figure { margin: 0; }

ol, ul { margin: 0 0 1em; padding-left: 1.2em; }

li { margin: 0 0 0.4em; }

hr { border: 0; border-top: 1px solid var(--ink); margin: 24px 0; }

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

/* ---------- 顶部 ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink);
}

.top.scrolled {
  box-shadow: 0 3px 0 0 var(--ink);
}

.strip {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip-mark {
  width: 8px;
  height: 8px;
  background: var(--ink);
  display: inline-block;
  flex: 0 0 auto;
}

.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 13px;
  height: 13px;
  background: var(--ink);
}

.drawer {
  position: relative;
}

.drawer > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition: background 0.16s linear, color 0.16s linear;
  user-select: none;
}

.drawer > summary::-webkit-details-marker { display: none; }

.drawer > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.drawer[open] > summary {
  background: var(--ink);
  color: var(--paper);
}

.drawer > menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  min-width: 190px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}

.drawer-r > menu { left: auto; right: 0; }

.drawer > menu li { margin: 0; }

.drawer > menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--paper);
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.drawer > menu li:last-child a { border-bottom: 0; }

.drawer > menu a:hover {
  background: var(--paper);
  color: var(--ink);
}

.anchors {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--ink);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 16px;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  transition: background 0.16s linear, color 0.16s linear, transform 0.16s ease;
  animation: chip-in 0.4s both;
}

.chip:nth-child(1) { animation-delay: 0.02s; }
.chip:nth-child(2) { animation-delay: 0.05s; }
.chip:nth-child(3) { animation-delay: 0.08s; }
.chip:nth-child(4) { animation-delay: 0.11s; }
.chip:nth-child(5) { animation-delay: 0.14s; }
.chip:nth-child(6) { animation-delay: 0.17s; }
.chip:nth-child(7) { animation-delay: 0.2s; }

.chip:hover,
.chip[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-content: start;
  min-height: 45vh;
  padding: 32px 16px 28px;
  border-bottom: 1px solid var(--ink);
}

.badge {
  position: absolute;
  top: 24px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  font-size: 20px;
  font-weight: 700;
  transform: rotate(-5deg);
  animation: badge-in 0.5s 0.1s both;
}

@keyframes badge-in {
  from { opacity: 0; transform: rotate(-14deg) scale(0.8); }
  to { opacity: 1; transform: rotate(-5deg) scale(1); }
}

.hero-text {
  grid-column: 1 / -1;
  text-align: right;
  padding-top: 8px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.lede {
  margin: 18px 0 0 auto;
  max-width: 54ch;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-size: 17px;
  line-height: 1.55;
  text-align: right;
}

.hero-fig {
  grid-column: 1 / -1;
  position: relative;
  margin-top: 20px;
  aspect-ratio: 24 / 9;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
}

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

.hero-void {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, #000 0 10px, #1a1a1a 10px 20px);
}

/* ---------- 正文骨架 ---------- */

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 40px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 40px 16px 56px;
}

.prose {
  min-width: 0;
  counter-reset: sec;
}

.prose > div {
  position: relative;
  counter-increment: sec;
  margin: 0 0 24px;
  padding: 28px 22px 30px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
  scroll-margin-top: 200px;
}

.prose > div::after {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--mid);
}

.prose h2 {
  margin: 0 0 14px;
  padding-right: 2.4rem;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.prose h3 {
  margin: 24px 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.prose p,
.prose li {
  line-height: 1.75;
}

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

.prose a:hover {
  background: var(--ink);
  color: var(--paper);
}

.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--ink);
  font-size: 17px;
}

.prose figure {
  margin: 20px 0;
  border: 1px solid var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

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

main div[id] { scroll-margin-top: 200px; }

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

.rail {
  position: sticky;
  top: 190px;
  align-self: start;
  padding-left: 20px;
  border-left: 1px solid var(--ink);
}

.rail h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 0.16em;
}

.rail hr {
  margin: 0 0 12px;
}

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

.rail li { margin: 0; }

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 0;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
  transition: padding-left 0.16s ease;
}

.rail a:hover { padding-left: 6px; }

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

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink);
  font-size: 16px;
}

.fmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-left: auto;
}

footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

footer nav a:hover { border-bottom-color: var(--paper); }

footer .copy {
  margin: 0;
  color: var(--paper);
  font-size: 16px;
}

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

@media (max-width: 980px) {
  .body-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .rail {
    position: static;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--ink);
    padding-top: 16px;
  }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .strip { letter-spacing: 0.1em; }
  .brand { font-size: 18px; }
  .hero { padding: 56px 16px 24px; min-height: 45vh; }
  .hero-fig { aspect-ratio: 16 / 9; }
  .prose > div { padding: 24px 16px 26px; }
  .body-grid { padding: 28px 16px 44px; }
  footer nav { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .chip:hover,
  .chip[aria-current="true"] { transform: none; }
}

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