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

:root {
  --paper: #f5e6c8;
  --paper-warm: #f0dcb7;
  --plate: #262117;
  --accent: #d4a574;
  --ink: #262117;
  --ink-mid: rgba(38, 33, 23, 0.62);
  --line: rgba(38, 33, 23, 0.3);
  --rail: 196px;
  --font: 'Noto Sans Hebrew', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 6%, rgba(212, 165, 116, 0.5), transparent 44%),
    radial-gradient(circle at 10% 94%, rgba(191, 138, 92, 0.32), transparent 48%),
    linear-gradient(158deg, #f8ecd4 0%, var(--paper-warm) 58%, #ecdcbd 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(closest-side at 86% 14%, rgba(255, 198, 122, 0.6), transparent 72%),
    radial-gradient(closest-side at 6% 80%, rgba(255, 148, 106, 0.32), transparent 72%);
  animation: leak 19s ease-in-out infinite alternate;
}

@keyframes leak {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.5; }
  to { transform: translate3d(-3%, 2%, 0) scale(1.09); opacity: 0.92; }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.34;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.44'/%3E%3C/svg%3E");
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: sepia(0.24) contrast(1.03) saturate(0.88);
}

a { color: inherit; }

/* ---------- 左侧竖导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: var(--rail);
  padding: 22px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f2e0bc 0%, var(--paper) 62%, #f2e4c6 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.45) inset;
}

.rail-mark {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
}

.rail-mark img { width: 46px; height: 46px; object-fit: cover; filter: none; }

.rail-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

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

.rail-nav li { border-top: 1px solid rgba(38, 33, 23, 0.22); }
.rail-nav li:last-child { border-bottom: 1px solid rgba(38, 33, 23, 0.22); }

.rail-nav a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 42px;
  padding: 10px 2px;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.22s ease, color 0.22s ease, padding-left 0.22s ease;
}

.rail-nav a::before {
  counter-increment: railnum;
  content: counter(railnum, decimal-leading-zero);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #8b7a58;
  transition: color 0.22s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  padding-left: 8px;
  outline: none;
}

.rail-nav a:hover::before,
.rail-nav a:focus-visible::before { color: var(--accent); }

.rail-contact {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-mid);
  word-break: break-all;
}

.rail-key {
  display: block;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: #8b7a58;
  margin-bottom: 3px;
}

/* ---------- 主体 ---------- */
main {
  position: relative;
  z-index: 2;
  max-width: 1080px;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 64px 52px;
  overflow: hidden;
}

.hero-ghost {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: clamp(56px, 15vh, 138px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: rgba(38, 33, 23, 0.09);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  animation: vhs 7.5s steps(3, end) infinite;
}

@keyframes vhs {
  0%, 100% { transform: translateY(-50%) skewX(0deg); }
  44% { transform: translateY(-50%) skewX(-1.2deg) translateX(2px); }
  72% { transform: translateY(-50%) skewX(0.6deg); }
}

.pol {
  position: relative;
  z-index: 3;
  margin: 0;
  width: min(560px, 100%);
  padding: 13px;
  border: 1px solid rgba(38, 33, 23, 0.42);
  background: #fbf3e2;
  box-shadow: 13px 15px 0 rgba(38, 33, 23, 0.12);
  transform: rotate(-1.4deg);
  transition: box-shadow 0.3s ease;
}

.pol:hover { animation: shake 0.55s ease-in-out; }

@keyframes shake {
  0%, 100% { transform: rotate(-1.4deg); }
  30% { transform: rotate(-0.5deg) translateY(-4px); }
  70% { transform: rotate(-2.1deg) translateY(2px); }
}

.pol-plate {
  padding: 30px 26px 34px;
  background: var(--plate);
  color: var(--paper);
  text-align: right;
}

.pol-kicker {
  margin: 0 0 11px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.pol hr {
  border: 0;
  border-top: 1px solid rgba(245, 230, 200, 0.45);
  margin: 0 0 20px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5.2vw, 64px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: var(--paper);
}

/* ---------- 正文章节 ---------- */
main > article:not(.hero) {
  position: relative;
  z-index: 2;
  max-width: 830px;
  padding: 60px 52px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 26px;
}

main > article:not(.hero):last-of-type { padding-bottom: 76px; }

main h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.3vw, 36px);
  line-height: 1.26;
  letter-spacing: 0.02em;
  font-weight: 700;
}

main h3 {
  margin: 32px 0 10px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
}

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

main h2 + hr { margin-bottom: 26px; }

p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.85;
  max-width: 64ch;
}

ul, ol { margin: 0 0 20px; padding-left: 22px; }
li { margin: 0 0 9px; font-size: 17px; line-height: 1.8; }

main > article:not(.hero) a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

main > article:not(.hero) a:hover { background: rgba(212, 165, 116, 0.42); }

main > article:not(.hero) figure {
  margin: 26px 0;
  padding: 10px;
  border: 1px solid rgba(38, 33, 23, 0.32);
  background: #fbf3e2;
  transform: rotate(-0.4deg);
}

main > article:not(.hero) figure img { width: 100%; }

blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: #3d3527;
  font-size: 17px;
}

table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 16px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }

strong { font-weight: 700; }

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 1080px;
  margin-top: 8px;
  padding: 40px 52px 30px;
  border-top: 1px solid var(--line);
}

.foot dl { margin: 0; }

.foot dt {
  font-size: 15px;
  letter-spacing: 0.24em;
  color: #8b7a58;
  margin-bottom: 6px;
}

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

.foot dd a {
  display: inline-block;
  min-height: 40px;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.foot dd a:hover { border-bottom-color: var(--accent); color: #6d4d24; }

.foot-host { word-break: break-all; }

.colophon {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(38, 33, 23, 0.18);
  font-size: 15px;
  color: var(--ink-mid);
}

/* ---------- 入场 ---------- */
.js main > article:not(.hero) {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.js main > article:not(.hero).in { opacity: 1; transform: none; }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  body { padding-left: 0; padding-top: 64px; }

  .rail {
    inset: 0 0 auto 0;
    width: auto;
    height: 64px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-mark { width: 42px; height: 42px; }
  .rail-mark img { width: 42px; height: 42px; }

  .rail-nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

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

  .rail-nav li { border: 0; }
  .rail-nav li:last-child { border-bottom: 0; }

  .rail-nav a {
    min-height: 44px;
    padding: 11px 10px;
    white-space: nowrap;
    font-size: 16px;
  }

  .rail-nav a::before { display: none; }
  .rail-contact { display: none; }

  .hero {
    min-height: calc(100svh - 64px);
    padding: 34px 16px 46px;
  }

  .hero-ghost { font-size: clamp(44px, 12vh, 96px); }

  .pol { padding: 10px; box-shadow: 9px 10px 0 rgba(38, 33, 23, 0.12); }
  .pol-plate { padding: 22px 16px 26px; }
  .pol-kicker { font-size: 15px; letter-spacing: 0.22em; }

  h1 { font-size: clamp(30px, 8.4vw, 46px); }

  main > article:not(.hero) {
    padding: 44px 16px 0;
    scroll-margin-top: 74px;
  }

  .foot {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 32px 16px 26px;
  }

  .foot dd a { min-height: 44px; padding: 11px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; }
  .js main > article:not(.hero) { opacity: 1; transform: none; }
}

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