@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 {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: #e0e0e0;
  --soft: #6e6e6e;
  --r: 28px;
  --rail: 264px;
  --serif: "Noto Serif JP", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Noto Sans JP", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: 0.01em;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

main section div {
  scroll-margin-top: 88px;
}

/* ---------- 左侧竖排导航 ---------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 34px 26px 28px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.rail-nav p {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 2px;
  font-size: 16px;
  color: var(--soft);
  border-bottom: 1px solid var(--mist);
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.rail-nav a:first-child {
  color: var(--ink);
  font-weight: 500;
}

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

.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 18px;
  border-top: 1px solid var(--mist);
  font-size: 15px;
}

.rail-key {
  color: var(--soft);
}

.rail-val {
  font-family: var(--serif);
  word-break: break-all;
}

/* ---------- 主体 ---------- */
main {
  margin-left: var(--rail);
}

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 72px 48px;
}

.hero-copy {
  max-width: 30ch;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 700;
}

.hero-lede {
  margin: 0;
  font-size: 17px;
  color: var(--soft);
  line-height: 1.85;
}

.hero-art {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--mist);
  aspect-ratio: 4 / 5;
  max-height: 76vh;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 32px;
  padding: 0 48px 96px;
  align-items: start;
}

/* ---------- 卡片错落 ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.bento > div {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 30px 30px 26px;
  grid-column: span 2;
  transition: transform 0.28s ease, background-color 0.28s ease;
}

.bento > div:nth-of-type(1),
.bento > div:nth-of-type(4),
.bento > div:nth-of-type(6) {
  grid-column: span 4;
}

.bento > div:hover {
  transform: scale(1.012);
  background: var(--mist);
}

.bento > div > small,
.side > small,
.foot-links > small {
  display: block;
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--soft);
  margin-bottom: 8px;
}

.bento h2,
.bento h3 {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
}

.bento p {
  margin: 0 0 14px;
}

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

.bento ul,
.bento ol {
  margin: 0 0 14px;
  padding-left: 1.25em;
}

.bento li {
  margin-bottom: 8px;
}

.bento a {
  border-bottom: 1px solid var(--line);
}

.bento a:hover {
  border-color: var(--ink);
}

.bento blockquote {
  margin: 0 0 14px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--ink);
  color: var(--soft);
}

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

.bento th,
.bento td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.bento code {
  font-size: 15px;
  background: var(--mist);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 32px;
  padding: 24px;
  background: var(--mist);
  border-radius: var(--r);
}

.side h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.side ol {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: side;
}

.side li {
  counter-increment: side;
  border-top: 1px solid #e6e6e6;
}

.side li a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  font-size: 16px;
  color: var(--soft);
}

.side li a::before {
  content: counter(side, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  flex: none;
}

.side li a:hover,
.side li a:focus-visible {
  color: var(--ink);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  background: var(--paper);
}

.to-top:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-left: var(--rail);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  padding: 64px 48px 32px;
  background: var(--mist);
  border-top: 1px solid var(--line);
}

.mega {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.foot-desc {
  margin: 0;
  max-width: 42ch;
  font-size: 16px;
  color: var(--soft);
}

.foot-links h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.foot-nav {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  color: var(--soft);
}

.foot-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.foot-legal {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 15px;
  color: var(--soft);
}

.foot-legal p {
  margin: 0;
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bento > div {
    animation: rise 0.52s ease-out both;
  }

  .bento > div:nth-child(1) { animation-delay: 0.02s; }
  .bento > div:nth-child(2) { animation-delay: 0.06s; }
  .bento > div:nth-child(3) { animation-delay: 0.1s; }
  .bento > div:nth-child(4) { animation-delay: 0.14s; }
  .bento > div:nth-child(5) { animation-delay: 0.18s; }
  .bento > div:nth-child(6) { animation-delay: 0.22s; }
  .bento > div:nth-child(7) { animation-delay: 0.26s; }

  .hero-copy > * {
    animation: rise 0.6s ease-out both;
  }

  .hero-copy > *:nth-child(2) {
    animation-delay: 0.1s;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 1080px) {
  .body-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 32px 72px;
  }

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

  .hero {
    padding: 56px 32px;
    gap: 32px;
  }
}

@media (max-width: 860px) {
  .rail {
    position: sticky;
    top: 0;
    width: auto;
    inset: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .brand {
    flex: none;
  }

  .brand-name {
    font-size: 17px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .rail-nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }

  .rail-nav p {
    flex-direction: row;
    gap: 18px;
    white-space: nowrap;
  }

  .rail-nav a {
    border-bottom: 0;
    min-height: 44px;
    padding: 4px 0;
  }

  .rail-foot {
    display: none;
  }

  main,
  .foot {
    margin-left: 0;
  }

  main section div {
    scroll-margin-top: 74px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 36px 20px 32px;
    gap: 24px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .hero-art {
    aspect-ratio: 16 / 11;
    max-height: none;
  }

  .body-grid {
    padding: 0 20px 56px;
    gap: 20px;
  }

  .bento {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .bento > div,
  .bento > div:nth-of-type(1),
  .bento > div:nth-of-type(4),
  .bento > div:nth-of-type(6) {
    grid-column: span 1;
    padding: 24px 22px;
    border-radius: 22px;
  }

  .bento > div:hover {
    transform: none;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 44px 20px 28px;
  }

  .foot-legal {
    padding-top: 14px;
  }
}

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