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

:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --rule: #e0e0e0;
  --rule-2: #ecebe6;
  --mute: #6a665f;
  --serif: 'Noto Serif JP', 'Songti SC', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --sans: 'Noto Sans JP', 'Hiragino Sans', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.lock { overflow: hidden; }

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }

p { margin: 0 0 1.1em; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: #bcb6a9;
  transition: background-color .12s linear, text-decoration-color .12s linear;
}
a:hover { text-decoration-color: var(--ink); background-color: var(--paper-2); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 18px 0;
}
.content h2 + hr, .content h3 + hr {
  border-top-color: var(--ink);
  width: 52px;
  margin: 12px 0 20px;
}

button { font-family: var(--sans); color: var(--ink); }

/* ---------- 左侧竖排导轨 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 8px 22px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}

.brand {
  writing-mode: vertical-rl;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .26em;
  line-height: 1;
  padding: 10px 4px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.brand:hover { background: transparent; text-decoration: none; color: var(--mute); }

.rail-contact {
  writing-mode: vertical-rl;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: .22em;
  padding: 14px 6px;
  min-height: 44px;
  margin-top: auto;
  border: 1px solid var(--rule);
}

.burger {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color .12s linear;
}
.burger i { display: block; width: 16px; height: 1px; background: var(--ink); }
.burger:hover { background: var(--ink); }
.burger:hover i { background: var(--paper); }

/* ---------- 全屏遮罩菜单 ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  visibility: hidden;
  transform: translateX(-101%);
  transition: transform .2s linear, visibility 0s linear .2s;
  overflow-y: auto;
  padding: 22px 22px 40px;
}
.menu.is-open {
  visibility: visible;
  transform: translateX(0);
  transition: transform .2s linear, visibility 0s linear 0s;
}

.menu-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.menu-brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .24em;
}
.menu-close {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 16px;
  letter-spacing: .16em;
  cursor: pointer;
}
.menu-close:hover { background: var(--paper-2); border-color: var(--ink); }

.site-nav { padding-top: 8px; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: navidx;
}
.nav-list li { counter-increment: navidx; border-bottom: 1px solid var(--rule-2); }
.nav-list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 52px;
  padding: 13px 6px;
  text-decoration: none;
  font-size: clamp(20px, 4.6vw, 28px);
  font-family: var(--serif);
  letter-spacing: .04em;
  transition: transform .12s linear, background-color .12s linear;
}
.nav-list a::before {
  content: counter(navidx, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--mute);
  letter-spacing: .1em;
  flex: none;
}
.nav-list a:hover { background: var(--paper-2); transform: translateX(6px); }

/* ---------- 主体 ---------- */
main {
  margin-left: 84px;
  padding: 48px 40px 56px;
}

article {
  max-width: 1060px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 44px 56px;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 30px;
  padding: 10px 0 4px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(29px, 5.2vw, 54px);
  line-height: 1.32;
  letter-spacing: .05em;
  max-width: 20ch;
}

.hero-fig {
  margin: 0;
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.hero-fig img { width: 100%; }

.content {
  min-width: 0;
  border-top: 1px solid var(--ink);
  padding-top: 34px;
}

.content section[id] {
  scroll-margin-top: 26px;
  padding-bottom: 30px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--rule-2);
}
.content section[id]:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px; }

.content h2 {
  margin: 0;
  font-size: clamp(21px, 3.4vw, 28px);
  line-height: 1.45;
}
.content h3 { font-size: 19px; margin: 26px 0 10px; }
.content p { margin: 0 0 1.15em; }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.content li { margin-bottom: .4em; }
.content blockquote {
  margin: 0 0 1.15em;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--ink);
  color: #3a3733;
}
.content figure { margin: 0 0 1.2em; }
.content figure img { border: 1px solid var(--rule); }
.content table { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 1.2em; }
.content th, .content td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; }

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 28px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: rgba(253, 251, 247, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 16px 16px 10px;
}

.side-h {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--mute);
}

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-top: 1px dotted var(--rule); }
.side-list li:first-child { border-top: 0; }
.side-list a {
  display: block;
  padding: 9px 2px;
  min-height: 40px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  transition: padding-left .12s linear, background-color .12s linear;
}
.side-list a:hover { padding-left: 8px; background: var(--paper-2); }

/* ---------- 页脚 ---------- */
.foot {
  margin-left: 84px;
  border-top: 1px solid var(--ink);
  background: var(--paper-2);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px 28px;
  padding: 26px 40px;
  font-family: var(--sans);
  font-size: 16px;
}

.f-logo {
  text-decoration: none;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .2em;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.foot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}
.foot-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 8px;
  text-decoration: none;
  color: #38352f;
  border-bottom: 1px solid transparent;
  transition: border-color .12s linear, color .12s linear;
}
.foot-list a:hover { border-bottom-color: var(--ink); color: var(--ink); background: transparent; }

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  font-size: 16px;
}
.to-top:hover { border-color: var(--ink); background: var(--paper); }

.f-copy { text-align: center; }
.f-copy p { margin: 0; color: var(--mute); font-size: 16px; }

/* ---------- 滚动显现 ---------- */
.js .hero,
.js .content > section { opacity: 0; transform: translateY(10px); }
.js .hero.in,
.js .content > section.in {
  opacity: 1;
  transform: none;
  transition: opacity .2s linear, transform .2s linear;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 899px) {
  .rail {
    right: 0;
    bottom: auto;
    width: auto;
    height: 60px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .brand {
    writing-mode: horizontal-tb;
    font-size: 18px;
    letter-spacing: .18em;
    padding: 0 6px;
  }
  .rail-contact {
    writing-mode: horizontal-tb;
    letter-spacing: .12em;
    padding: 10px 14px;
    margin-top: 0;
    margin-left: auto;
  }
  .burger { padding: 0; }

  main {
    margin-left: 0;
    padding: 78px 18px 44px;
  }
  article { grid-template-columns: minmax(0, 1fr); gap: 30px; }

  .hero { min-height: 42vh; gap: 22px; }
  .hero h1 { letter-spacing: .03em; }

  .content section[id] { scroll-margin-top: 74px; }

  .side {
    position: static;
    order: 2;
  }

  .foot {
    margin-left: 0;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 18px;
  }
  .foot-list { justify-content: center; }
  .nav-list a { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .hero, .js .content > section { opacity: 1; transform: none; }
  .nav-list a:hover { transform: none; }
}

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