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

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: #000000;
  font-family: 'Noto Sans KR', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
}

a { color: inherit; }

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

:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

/* ---------- 顶部细条 ---------- */

.topbar {
  grid-column: 2;
  grid-row: 1;
  border-bottom: 1px solid #000;
  padding: 0.45rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
}

.topbar-txt {
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 左侧竖排导航 ---------- */

.rail {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid #000;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #fff;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}

.mark-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.nav-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #000;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  font-weight: 500;
  user-select: none;
}

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

.nav-details summary::after {
  content: "+";
  font-size: 0.9rem;
  letter-spacing: 0;
}

.nav-details[open] summary::after { content: "–"; }

.nav-details menu,
.toc-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
}

.nav-details menu { display: flex; flex-direction: column; }

.nav-details menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid #e2e2e2;
  transition: background 0.16s ease, padding-left 0.16s ease;
}

.nav-details menu li:first-child a { border-top: 1px solid #e2e2e2; }

.nav-details menu a:hover {
  background: rgba(0, 0, 0, 0.05);
  padding-left: 1.05rem;
}

/* ---------- 主区 ---------- */

main {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: 1180px;
  padding: 0 clamp(1.25rem, 4vw, 4rem) 4rem;
}

.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding: 3rem 0 2.75rem;
  border-bottom: 1px solid #000;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.13;
  pointer-events: none;
  border-radius: 0;
}

.hero-txt,
.hero-art { position: relative; z-index: 1; }

.hero h1 {
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 16ch;
}

.lead {
  margin: 0;
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.65;
  color: #222;
}

.hero-art {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 0.75rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.dotgrid {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background-image: radial-gradient(#000 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.35;
}

.wrap {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding-top: 2.5rem;
}

/* ---------- 侧栏目录 ---------- */

.toc {
  position: sticky;
  top: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  padding: 0.95rem 0.85rem 0.7rem;
}

.toc-title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.5;
}

.subtitle {
  margin: 0.3rem 0 0.85rem;
  font-size: 0.74rem;
  line-height: 1.55;
  color: #555;
  letter-spacing: 0.02em;
}

.toc-list { display: flex; flex-direction: column; margin-top: 0; }

.toc-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.2rem;
  font-size: 0.85rem;
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px solid #e4e4e4;
  transition: color 0.16s ease, transform 0.16s ease;
}

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

.toc-list a:hover { transform: translateX(3px); }

/* ---------- 正文 ---------- */

.body-sec { min-width: 0; }

.prose {
  max-width: 70ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.prose > section {
  padding: 2.4rem 0;
  border-top: 1px solid #d9d9d9;
  scroll-margin-top: 1.25rem;
}

.prose > section:first-child { border-top: 0; padding-top: 0; }

.prose h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.prose h3 {
  margin: 1.6rem 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 700;
}

.prose p { margin: 0 0 1rem; }

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li { margin: 0.4rem 0; }

.prose a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid #000;
  color: #222;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
}

.prose th,
.prose td {
  border: 1px solid #d5d5d5;
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.prose th { background: #f2f2f2; font-weight: 700; }

/* ---------- 页脚 ---------- */

.foot {
  grid-column: 2;
  grid-row: 3;
  border-top: 1px solid #000;
  padding: 2rem clamp(1.25rem, 4vw, 4rem) 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 1rem 2rem;
}

.f-brand {
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.f-copy {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #444;
}

.f-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  justify-content: flex-end;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s ease;
}

.f-nav a:hover { border-bottom-color: #000; }

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-txt { animation: rise 0.55s ease both; }
  .hero-art { animation: rise 0.55s ease 0.08s both; }

  .prose > section { animation: rise 0.5s ease both; }
  .prose > section:nth-child(1) { animation-delay: 0.02s; }
  .prose > section:nth-child(2) { animation-delay: 0.06s; }
  .prose > section:nth-child(3) { animation-delay: 0.1s; }
  .prose > section:nth-child(4) { animation-delay: 0.14s; }
  .prose > section:nth-child(5) { animation-delay: 0.18s; }
  .prose > section:nth-child(6) { animation-delay: 0.22s; }
  .prose > section:nth-child(7) { animation-delay: 0.26s; }

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

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  body { display: block; }

  .topbar {
    padding: 0.4rem 1.1rem;
    border-bottom: 1px solid #000;
  }

  .topbar-txt { font-size: 0.68rem; letter-spacing: 0.16em; }

  .rail {
    position: static;
    height: auto;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-right: 0;
    border-bottom: 1px solid #000;
    padding: 0.6rem 1.1rem;
  }

  .mark,
  .mark-img { width: 40px; height: 40px; border-radius: 12px; }

  .nav-details { margin-left: auto; }

  .nav-details[open] { flex-basis: 100%; }

  .nav-details[open] menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 0.4rem;
    margin-top: 0.6rem;
  }

  .nav-details menu li:first-child a { border-top: 0; }

  .nav-details menu a {
    border-bottom: 0;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }

  .nav-details menu a:hover { padding-left: 0.75rem; }

  main { padding: 0 1.1rem 3rem; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 1.6rem 0 2rem;
    gap: 1.4rem;
  }

  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); max-width: none; }

  .hero-art { aspect-ratio: 16 / 9; }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    padding-top: 1.6rem;
  }

  .toc { position: static; }

  .toc-list { flex-direction: row; flex-wrap: wrap; gap: 0 0.4rem; }

  .toc-list a {
    border-bottom: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }

  .toc-list a:hover { transform: none; background: rgba(0, 0, 0, 0.1); }

  .prose { font-size: 17px; }

  .prose > section { padding: 1.9rem 0; }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1.6rem 1.1rem 2rem;
  }

  .f-nav { justify-content: flex-start; }
}

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