@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');

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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --gray: #6d6d6d;
  --line: #e3e3e3;
  --soft: #f6f6f6;
  --serif: 'Noto Serif JP', 'Songti SC', 'SimSun', serif;
  --sans: 'Noto Sans JP', 'Hiragino Sans', 'PingFang SC', system-ui, sans-serif;
  --gut: clamp(1.25rem, 5.5vw, 6rem);
  --bar: 4.75rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.75;
  padding-bottom: calc(var(--bar) + 2.75rem);
  overflow-x: hidden;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}

small {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  color: var(--gray);
  margin-bottom: 0.6rem;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
  min-height: 45vh;
  padding: clamp(3.5rem, 11vh, 7rem) var(--gut) clamp(2rem, 5vh, 3.5rem);
}

.hero-copy { text-align: right; }

.hero h1 {
  font-size: clamp(3rem, 10vw, 12rem);
  letter-spacing: -0.05em;
  line-height: 0.9;
  word-break: break-word;
}

.hero-desc {
  margin: 1.4rem 0 0 auto;
  max-width: 34ch;
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ---------- 侧栏目录 ---------- */
.toc {
  border-top: 2px solid var(--ink);
  padding-top: 1.1rem;
}

.toc h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.toc ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.toc li + li { border-top: 1px solid var(--line); }

.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: padding-left 0.25s ease, color 0.25s ease;
}

.toc a:hover { padding-left: 0.45rem; }

/* ---------- 正文 ---------- */
.essay {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem var(--gut) 5rem;
}

.essay > article {
  border-top: 2px solid var(--ink);
  padding: clamp(2.4rem, 6vw, 4rem) 0;
  scroll-margin-top: 2rem;
}

.essay > article:first-child { border-top-width: 6px; }

.essay h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.06;
  margin-bottom: 1.4rem;
}

.essay h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  margin: 2.2rem 0 0.8rem;
}

.essay p {
  max-width: 64ch;
  margin: 0 0 1.25rem;
  line-height: 1.9;
}

.essay ul, .essay ol {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

.essay li { margin-bottom: 0.55rem; }

.essay figure {
  margin: 2rem 0;
  padding: 0.75rem;
  background: var(--soft);
  border-radius: 4px;
}

.essay figure img { border-radius: 4px; }

.essay figcaption {
  font-size: 0.85rem;
  color: var(--gray);
  padding-top: 0.65rem;
  line-height: 1.6;
}

.essay aside {
  margin: 1.9rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--ink);
  background: var(--soft);
  border-radius: 0 4px 4px 0;
  font-size: 0.98rem;
}

.essay aside p:last-child { margin-bottom: 0; }

.essay blockquote {
  margin: 1.9rem 0;
  padding-left: 1.2rem;
  border-left: 4px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.essay table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.6rem 0;
}

.essay th, .essay td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.essay pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--soft);
  border-radius: 4px;
  font-size: 0.9rem;
}

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

/* ---------- 页脚 ---------- */
.foot {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(2.6rem, 7vw, 5rem) var(--gut) 1.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.foot small { color: #9a9a9a; }

.foot-word {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin: 0;
  word-break: break-all;
}

.foot-links h2 {
  font-size: 1.05rem;
  color: var(--paper);
}

.foot-links ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.95rem;
  border-bottom: 1px solid #2a2a2a;
  transition: padding-left 0.25s ease, border-color 0.25s ease;
}

.foot-links a:hover {
  border-color: var(--paper);
  padding-left: 0.4rem;
}

.foot-base {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #2a2a2a;
  margin-top: 1rem;
  padding-top: 1.1rem;
  font-size: 0.85rem;
  color: #b5b5b5;
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  border-bottom: 1px solid transparent;
}

.foot-base a:hover { border-color: var(--paper); }

/* ---------- 底部胶囊导航 ---------- */
.dock {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 44rem;
  margin-inline: auto;
  padding: 0.5rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.mark:hover { transform: translateY(-2px); }

.mark-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.mark-ch {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}

.menus {
  position: relative;
  margin-left: auto;
}

.menus summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.15rem;
  border: 1px solid #4a4a4a;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

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

.menus menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.8rem);
  width: min(78vw, 19rem);
  max-height: 58vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.45rem;
  list-style: none;
  background: var(--ink);
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.menus menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--paper);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.menus menu a:hover {
  background: #1c1c1c;
  padding-left: 1.1rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.15rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.cta:hover { transform: translateY(-2px); }

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy h1,
  .hero-desc,
  .toc,
  .foot-word { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  .hero-desc { animation-delay: 0.1s; }
  .toc { animation-delay: 0.18s; }

  .toc li { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .toc li:nth-child(1) { animation-delay: 0.2s; }
  .toc li:nth-child(2) { animation-delay: 0.24s; }
  .toc li:nth-child(3) { animation-delay: 0.28s; }
  .toc li:nth-child(4) { animation-delay: 0.32s; }
  .toc li:nth-child(5) { animation-delay: 0.36s; }
  .toc li:nth-child(6) { animation-delay: 0.4s; }
  .toc li:nth-child(7) { animation-delay: 0.44s; }

  .essay > article { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}

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

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 45vh;
    padding-top: 3.5rem;
    gap: 2.25rem;
  }

  .hero h1 { font-size: clamp(2.7rem, 14vw, 4.5rem); }

  .essay { padding-bottom: 3.5rem; }

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

  .foot-word { font-size: clamp(2.4rem, 14vw, 5rem); }
}

@media (max-width: 400px) {
  .cta { padding: 0.4rem 0.9rem; }
  .menus summary { padding: 0.4rem 0.95rem; }
}

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