:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: rgba(31, 31, 31, 0.1);
  --dim: #6a6a6a;
  --glass: rgba(255, 255, 255, 0.62);
  --shadow: 0 6px 22px rgba(17, 17, 17, 0.07);
  --bar: 64px;
}

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

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

body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--mist);
  background-image: radial-gradient(1100px 560px at 82% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 62%);
  background-attachment: fixed;
}

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

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

h1,
h2,
h3 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0 0 0.45em;
}

p {
  margin: 0 0 1em;
}

/* 顶部条 */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  font-family: "Noto Serif JP", serif;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.mark:hover {
  transform: scale(1.06);
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.burger:hover {
  background: rgba(31, 31, 31, 0.05);
}

.bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.bars::before,
.bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.bars::before {
  top: -5px;
}

.bars::after {
  top: 5px;
}

/* 全屏遮罩菜单 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  padding: calc(var(--bar) + 16px) 20px 34px;
  overflow-y: auto;
  background: rgba(248, 248, 248, 0.95);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.sheet.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.find {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 0 22px;
}

.find input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

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

.find button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 20px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

.find button:hover {
  background: #000;
}

.menu ol {
  counter-reset: m;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
}

.menu li {
  counter-increment: m;
}

.menu a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 54px;
  padding: 12px 4px;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(19px, 4.4vw, 26px);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.menu a::before {
  content: counter(m, decimal-leading-zero);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.menu a:hover,
.menu a[aria-current="true"] {
  background: linear-gradient(90deg, rgba(31, 31, 31, 0.06), rgba(31, 31, 31, 0));
  padding-left: 12px;
}

/* 主体 */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--bar) + 22px) 14px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 18px;
  align-items: start;
}

article.stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

article > section {
  min-width: 0;
  padding: 20px 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--bar) + 16px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

article > section:hover {
  transform: scale(1.012);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.11);
}

article > section:nth-child(3n + 1) {
  grid-column: span 2;
}

article > section:nth-child(3n) {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

article > section:nth-child(3n) h2,
article > section:nth-child(3n) h3 {
  color: #fff;
}

article > section:nth-child(3n) a {
  color: #fff;
}

article section h2 {
  font-size: clamp(20px, 3.4vw, 27px);
}

article section h3 {
  font-size: 19px;
  margin-top: 1.25em;
}

article section ul,
article section ol {
  padding-left: 1.25em;
}

article section li {
  margin-bottom: 0.35em;
}

article section a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

article section > *:last-child {
  margin-bottom: 0;
}

/* 首屏 */
.hero {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 40vh;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--ink);
  z-index: 2;
}

.hero-fig {
  margin: 0;
  order: -1;
}

.hero-fig img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}

.hero-txt {
  margin-left: auto;
  max-width: 36ch;
  padding: 26px 18px 30px;
  text-align: right;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 5.6vw, 50px);
  letter-spacing: 0.02em;
}

/* 侧栏 */
.rail {
  position: sticky;
  top: calc(var(--bar) + 16px);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rail-top {
  padding: 16px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rail-top h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--dim);
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rail-list a {
  display: block;
  min-height: 44px;
  padding: 11px 14px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

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

.rail-list a:hover {
  background: rgba(31, 31, 31, 0.05);
}

.totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.totop:hover {
  background: var(--ink);
  color: #fff;
}

/* 页脚 */
.foot {
  margin-top: 44px;
  padding: 38px 14px 22px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.foot-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 26px;
  align-items: start;
}

.foot-brand {
  font-style: normal;
}

.big {
  display: block;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(34px, 9vw, 72px);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.foot-brand p {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: 16px;
  color: var(--dim);
}

.foot-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 16px;
}

.foot-links a {
  display: block;
  min-height: 40px;
  padding: 8px 0;
  font-size: 16px;
  text-decoration: none;
}

.foot-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.copy {
  max-width: 1180px;
  margin: 28px auto 0;
  padding-top: 16px;
  font-size: 16px;
  color: var(--dim);
  text-align: center;
  border-top: 1px solid var(--line);
}

/* 滚动出现 */
.rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.rv.in {
  opacity: 1;
  transform: none;
}

/* 窄屏 */
@media (max-width: 860px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    padding-top: calc(var(--bar) + 16px);
  }

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

  article > section,
  article > section:nth-child(3n + 1) {
    grid-column: span 1;
  }

  .hero {
    grid-column: span 1;
    min-height: 0;
  }

  .hero-fig img {
    aspect-ratio: 4 / 3;
  }

  .rail {
    position: static;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

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

  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  article > section:hover,
  .mark:hover {
    transform: none;
  }
}

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