:root {
  --ink: #1B1F3B;
  --hot: #FF5A5F;
  --cream: #F7F2E8;
  --line: rgba(27, 31, 59, 0.18);
  --soft: rgba(27, 31, 59, 0.06);
  --glass: rgba(255, 255, 255, 0.58);
  --bar-h: 64px;
}

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

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

body {
  margin: 0;
  padding-top: var(--bar-h);
  background: var(--cream);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--hot);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 120;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.18s ease;
}

.skip:focus {
  top: 8px;
}

/* 顶栏 */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
  z-index: 60;
}

.burger {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.burger:hover {
  background: var(--ink);
  color: var(--cream);
}

.burger-ico {
  display: block;
  width: 18px;
}

.burger-ico i {
  display: block;
  height: 2px;
  background: currentColor;
  margin: 0 0 4px;
}

.burger-ico i:last-child {
  margin-bottom: 0;
}

.brand {
  justify-self: center;
  padding: 10px 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  border-bottom: 3px solid var(--hot);
}

.bar-link {
  justify-self: end;
  padding: 11px 12px;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.bar-link:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

/* 全屏菜单 */
.menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 84px 18px 60px;
  background: var(--ink);
  color: var(--cream);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.menu.open {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  color: var(--cream);
  border: 2px solid var(--cream);
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.menu-close:hover {
  background: var(--hot);
  border-color: var(--hot);
}

.menu-nav {
  width: 100%;
  max-width: 780px;
}

.menu-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 40px;
  counter-reset: m;
}

.menu-nav li {
  counter-increment: m;
}

.menu-nav a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.menu-nav a::before {
  content: counter(m, decimal-leading-zero);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--hot);
}

.menu-nav a:hover,
.menu-nav a:focus-visible {
  color: var(--hot);
  border-left-color: var(--hot);
}

/* 首屏 */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--bar-h));
  background: var(--ink);
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: rgba(27, 31, 59, 0.68);
}

.hero-box {
  position: relative;
  max-width: 860px;
  padding: 56px 22px;
  text-align: center;
}

.hero-box::before {
  content: "";
  display: block;
  width: 64px;
  height: 6px;
  margin: 0 auto 24px;
  background: var(--hot);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.85rem, 6vw, 3.6rem);
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: var(--cream);
}

.hero-lead {
  margin: 0 auto;
  max-width: 620px;
  font-size: 1rem;
  color: rgba(247, 242, 232, 0.86);
}

/* 版心 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.side {
  position: sticky;
  top: calc(var(--bar-h) + 18px);
  display: grid;
  gap: 14px;
}

.side-box {
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 14px 16px 16px;
}

.side h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.side h2 span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 3px solid var(--hot);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: t;
}

.toc li {
  counter-increment: t;
}

.toc a {
  display: block;
  padding: 9px 2px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.toc a::before {
  content: counter(t, decimal-leading-zero) " ";
  color: var(--hot);
  font-weight: 700;
}

.toc a:hover {
  color: var(--hot);
  padding-left: 6px;
}

.side-rule h2 {
  margin-bottom: 0;
}

.body {
  min-width: 0;
}

.prose {
  min-width: 0;
}

.prose > div {
  padding: 34px 0;
  border-top: 2px solid var(--line);
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

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

.prose > div:nth-child(even) {
  background: var(--soft);
  border-radius: 18px;
  padding-left: 20px;
  padding-right: 20px;
}

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  line-height: 1.35;
}

.prose h2 > span {
  padding-bottom: 2px;
  border-bottom: 4px solid var(--hot);
}

.prose h3 {
  margin: 22px 0 12px;
  font-size: 1.12rem;
  line-height: 1.45;
}

.prose h3 > span {
  padding-bottom: 2px;
  border-bottom: 3px solid rgba(255, 90, 95, 0.55);
}

.prose p {
  margin: 0 0 15px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.35em 0;
  line-height: 1.6;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--hot);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--hot);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--cream);
  border-left: 5px solid var(--hot);
  border-radius: 0 4px 4px 0;
}

.prose img {
  border: 2px solid var(--ink);
  border-radius: 4px;
}

/* 页脚 */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 26px;
  padding: 22px 20px;
  background: var(--cream);
  border-top: 3px solid var(--ink);
}

.foot div {
  margin: 0;
}

.foot h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.foot h2 span {
  padding-bottom: 2px;
  border-bottom: 3px solid var(--hot);
}

.foot a {
  display: inline-block;
  padding: 11px 15px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.foot a:hover {
  background: var(--hot);
  border-color: var(--hot);
  color: var(--cream);
}

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

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

@media (max-width: 880px) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 18px 52px;
  }

  .side {
    position: static;
  }

  .toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }

  .menu-nav ol {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .menu-nav a {
    font-size: 1.08rem;
    padding: 11px 8px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .bar {
    padding: 0 10px;
  }

  .brand {
    font-size: 0.98rem;
    letter-spacing: 0.08em;
  }

  .burger-txt,
  .bar-link {
    font-size: 0.9rem;
  }

  .hero-box {
    padding: 44px 18px;
  }

  .hero-lead {
    font-size: 0.98rem;
  }

  .prose > div:nth-child(even) {
    padding-left: 14px;
    padding-right: 14px;
  }

  .foot {
    gap: 6px 16px;
  }
}

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

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

  .menu,
  .burger,
  .menu-close,
  .skip {
    transition: none;
  }
}

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