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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --pencil: #4a4a4a;
  --line: rgba(26, 26, 26, 0.16);
  --hair: rgba(26, 26, 26, 0.08);
  --glass: rgba(255, 255, 255, 0.62);
  --tape: rgba(206, 203, 190, 0.72);
  --rail: 124px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.03) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 16% 10%, rgba(74, 74, 74, 0.08), transparent 44%),
    radial-gradient(circle at 84% 82%, rgba(74, 74, 74, 0.07), transparent 48%);
  color: var(--ink);
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
  overflow-wrap: break-word;
  word-break: break-word;
}

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

/* 顶部细条 */
.topline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.26em;
  border-bottom: 1px solid var(--ink);
}
.topline .dot {
  width: 7px;
  height: 7px;
  background: var(--paper);
  transform: rotate(18deg);
  flex: 0 0 auto;
}
.topline-t { line-height: 1; }

/* 左侧竖排胶囊导航 */
.rail {
  position: fixed;
  top: 36px;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 10px 26px;
  overflow-y: auto;
  background: var(--glass);
  border-right: 1px dashed var(--line);
  -webkit-backdrop-filter: blur(6px) grayscale(0.4);
  backdrop-filter: blur(6px) grayscale(0.4);
}

.mark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transform: rotate(-6deg);
  overflow: hidden;
}
.mark img { width: 100%; height: 100%; object-fit: cover; }
.mark-ch {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}
.mark:hover { transform: rotate(4deg) scale(1.04); }

.rail nav { width: 100%; }
.rail nav p {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.rail nav p a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: var(--pencil);
  transform: rotate(-0.6deg);
}
.rail nav p a:nth-child(even) { transform: rotate(0.7deg); }
.rail nav p a:hover,
.rail nav p a:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  background: #fff;
  transform: rotate(-1.6deg) translateX(2px);
}

/* 骨架 */
.shell { padding-left: var(--rail); }

.layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 26px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 62px 24px 0;
}

/* 左侧目录 */
.side {
  position: sticky;
  top: 62px;
  align-self: start;
  padding: 16px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.05);
}
.side-h {
  margin: 2px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--pencil);
}
.side-h > span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--ink);
}
.side ol {
  list-style: none;
  counter-reset: sec;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side li { counter-increment: sec; }
.side a {
  display: block;
  min-height: 40px;
  padding: 7px 4px;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  color: var(--pencil);
  border-bottom: 1px dashed var(--hair);
}
.side a::before {
  content: counter(sec, decimal-leading-zero);
  display: inline-block;
  margin-right: 7px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(26, 26, 26, 0.42);
}
.side a:hover,
.side a:focus-visible {
  color: var(--ink);
  background: rgba(26, 26, 26, 0.05);
}

/* 正文 */
.main { min-width: 0; }
.entry { max-width: 760px; }

.entry > article[id] { scroll-margin-top: 56px; }

/* 头图 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
  margin: 0 0 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(155deg, #eceae3, #d9d8d1 58%, #c9c8c1);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 20, 20, 0.88), rgba(20, 20, 20, 0.26) 56%, rgba(20, 20, 20, 0.06));
}
.hero::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  z-index: 3;
  background: repeating-linear-gradient(135deg, var(--ink) 0 10px, var(--paper) 10px 20px);
}
.hero-in {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 28px 26px 46px;
  color: var(--paper);
}
.hero h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 54px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.hero-sub {
  margin: 12px 0 0;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(250, 250, 248, 0.86);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

/* 正文卡片 */
.entry > article[id] {
  position: relative;
  margin: 0 0 24px;
  padding: 28px 24px 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.05);
}
.entry > article[id]::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 26px;
  width: 74px;
  height: 17px;
  background: var(--tape);
  border: 1px solid rgba(26, 26, 26, 0.08);
  transform: rotate(-2.2deg);
}
.entry > article[id]::after {
  content: '';
  position: absolute;
  top: -7px;
  right: 34px;
  width: 34px;
  height: 13px;
  background: var(--tape);
  transform: rotate(3deg);
}

.entry p { margin: 0 0 1em; }
.entry a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.38);
}
.entry a:hover { border-bottom-style: dashed; background: rgba(26, 26, 26, 0.05); }

.entry h2 {
  margin: 1.5em 0 0.65em;
  font-size: clamp(21px, 3.2vw, 29px);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.entry h2:first-child { margin-top: 0.1em; }
.entry h2 > span {
  position: relative;
  display: inline-block;
  padding: 0 2px 5px;
}
.entry h2 > span::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, rgba(26, 26, 26, 0.3), rgba(26, 26, 26, 0.05));
  transform: rotate(-0.7deg);
}

.entry h3 {
  margin: 1.35em 0 0.5em;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--ink);
}
.entry h3 > span { border-bottom: 1px dashed rgba(26, 26, 26, 0.4); }

.entry ul,
.entry ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}
.entry li { margin: 0.35em 0; }
.entry li::marker { color: rgba(26, 26, 26, 0.45); }

.entry blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--ink);
  border-radius: 0 16px 16px 0;
  background: rgba(26, 26, 26, 0.045);
  color: var(--pencil);
}
.entry blockquote p:last-child { margin-bottom: 0; }

.entry strong { font-weight: 700; }
.entry time {
  display: inline-block;
  margin-right: 10px;
  padding: 1px 8px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--pencil);
}

.entry img { border-radius: 18px; margin: 1em 0; }
.entry figure { margin: 1.2em 0; }
.entry figcaption { font-size: 14px; color: var(--pencil); margin-top: 6px; }

.entry table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 16px;
}
.entry th,
.entry td {
  border-bottom: 1px dashed var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}
.entry th { background: rgba(26, 26, 26, 0.05); font-weight: 700; }

/* 页脚 */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 26px;
  max-width: 1120px;
  margin: 44px auto 0;
  padding: 26px 24px 40px;
  border-top: 2px dashed var(--line);
}
.foot-brand h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}
.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 4px;
  font-size: 14px;
  text-decoration: none;
  color: var(--pencil);
  border-bottom: 1px solid transparent;
}
.foot-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.foot-copy { font-size: 13px; color: var(--pencil); }

/* 滚动显现 */
.js .rv {
  opacity: 0;
  transform: translateY(14px) rotate(-0.4deg);
  transition: opacity 0.32s steps(3), transform 0.32s steps(3);
}
.js .rv.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 780px) {
  .topline {
    position: static;
    height: auto;
    padding: 9px 14px;
    font-size: 13px;
    letter-spacing: 0.2em;
  }
  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px dashed var(--line);
  }
  .rail nav { flex: 1 1 auto; width: auto; }
  .rail nav p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .rail nav p a {
    min-height: 42px;
    padding: 10px 13px;
    font-size: 15px;
  }
  .shell { padding-left: 0; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px 14px 0;
  }
  .side { position: static; }
  .side ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .side a { min-height: 42px; padding: 8px 4px; }
  .hero { min-height: 58vh; border-radius: 22px; margin-bottom: 24px; }
  .hero-in { padding: 20px 16px 42px; }
  .entry > article[id] { padding: 22px 16px 24px; border-radius: 22px; }
  .entry > article[id]::before { left: 18px; }
  .entry > article[id]::after { right: 20px; }
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 16px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv,
  .js .rv.in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .mark:hover,
  .rail nav p a:hover { transform: none; }
}

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