:root {
  --ink: #1b1b1b;
  --muted: #5c5c5c;
  --line: #d8d8d8;
  --bg: #fff;
  --side: #f4f7fb;
  --head: #152033;
  --accent: #1e6fe8;
  --code: #eef3fa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.65 "Noto Sans KR", "Malgun Gothic", sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }
code, kbd {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.9rem;
  background: var(--code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.site-head {
  background: var(--head);
  color: #fff;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-head a { color: #fff; text-decoration: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.brand img { width: 34px; height: 34px; display: block; border-radius: 8px; }
.brand .word { line-height: 1; }
.site-head nav { display: flex; gap: 1.1rem; font-size: 0.92rem; }
.site-head nav a { opacity: 0.88; }
.site-head nav a:hover,
.site-head nav a.current { opacity: 1; text-decoration: underline; }

.wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 58px);
}
.side {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 1.2rem 1rem 2rem;
}
.side h2 {
  margin: 0 0 0.6rem;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: 0.28rem 0.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
}
.side a:hover, .side a.current { background: #e4ecf7; }
.side a.current { font-weight: 700; }
.side a.school-banner {
  display: block;
  margin-top: 1.2rem;
  padding: 0.85rem 0.8rem;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #1e6fe8, #174ca8);
  box-shadow: 0 5px 14px rgba(30, 111, 232, 0.22);
}
.side a.school-banner:hover {
  color: #fff;
  background: linear-gradient(135deg, #2879ed, #1c58be);
  text-decoration: none;
  transform: translateY(-1px);
}
.school-banner strong,
.school-banner span { display: block; }
.school-banner strong { font-size: 1rem; }
.school-banner span {
  margin-top: 0.18rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  line-height: 1.45;
}

main {
  max-width: 52rem;
  padding: 2rem 2.2rem 4rem;
}
.manual-page { max-width: 74rem; }
h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.6rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.lead { font-size: 1.08rem; color: #333; }
.meta { color: var(--muted); font-size: 0.88rem; margin: 0 0 1.4rem; }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.28rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.55rem; text-align: left; vertical-align: top; }
th { background: var(--side); }
.note {
  border-left: 4px solid var(--accent);
  background: #f0f6ff;
  padding: 0.7rem 0.9rem;
  margin: 1.1rem 0;
}
.security-note {
  border: 1px solid #e5b657;
  border-left: 4px solid #c87d00;
  background: #fff8e8;
  padding: 0.75rem 0.9rem;
  margin: 1.1rem 0;
}
.manual-toc {
  margin: 1.4rem 0 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--side);
}
.manual-toc ol {
  margin: 0.55rem 0 0;
  columns: 2;
}
.manual-toc li { break-inside: avoid; }
.manual-section { scroll-margin-top: 1rem; }
.manual-checklist { margin-bottom: 1.3rem; }
.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.8rem;
}
.manual-shot {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 32, 51, 0.07);
}
.manual-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.54 / 1;
  object-fit: contain;
  background: #eef2f7;
}
.manual-shot figcaption {
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
  border-top: 1px solid var(--line);
}
.manual-shot figcaption span {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  margin-right: 0.3rem;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  line-height: 1;
}
.control-table th:first-child,
.control-table td:first-child { width: 12rem; }
.foot {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding: 1rem 1.4rem 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--side);
}
.foot a { color: inherit; }

.hero-shot {
  margin: 1.2rem 0 1.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  box-shadow: 0 8px 24px rgba(21, 32, 51, 0.08);
}
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-shot figcaption {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line);
}

.shot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.6rem;
}
.shot-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.shot-grid img {
  display: block;
  width: 100%;
  height: auto;
}
.shot-grid figcaption {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.shot-grid figure.wide {
  grid-column: 1 / -1;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.2rem 0 0.4rem;
}
.cta {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.95rem;
}
.cta.soft {
  background: #fff;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}

/* IU주식스쿨 */
.school-page { max-width: 76rem; }
.school-side a span {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.25rem;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}
.risk-note {
  border: 1px solid #dc9b9b;
  border-left: 4px solid #b53636;
  background: #fff3f3;
  padding: 0.8rem 0.95rem;
  margin: 1.2rem 0;
}
.study-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0;
  list-style: none;
  counter-reset: study;
}
.study-steps li {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  counter-increment: study;
}
.study-steps li::before {
  content: counter(study);
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}
.study-steps strong,
.study-steps span { display: block; }
.study-steps span { margin-top: 0.25rem; color: var(--muted); font-size: 0.88rem; }
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.course-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(21, 32, 51, 0.06);
}
.course-card h3 { margin-top: 0.1rem; }
.course-card .stage {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}
.course-card ul { flex: 1; }
.course-card .cta { margin-top: 0.5rem; }
.school-toc {
  margin: 1.3rem 0 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--side);
}
.school-toc ol {
  margin: 0.6rem 0 0;
  columns: 2;
}
.school-toc li { break-inside: avoid; }
.lesson {
  scroll-margin-top: 1rem;
  margin-top: 2.4rem;
  padding-top: 0.1rem;
}
.lesson > h2 { font-size: 1.45rem; }
.lesson-goal,
.example-box,
.misconception,
.self-check,
.practice-card,
.video-plan {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
}
.lesson-goal {
  border-left: 4px solid var(--accent);
  background: #f0f6ff;
}
.example-box {
  border: 1px solid #b9cee9;
  background: #f7faff;
}
.misconception {
  border-left: 4px solid #c87d00;
  background: #fff8e8;
}
.self-check {
  border: 1px solid #a8c7ac;
  background: #f2faf3;
}
.practice-card {
  border: 1px solid #aeb8d9;
  background: #f5f6fc;
}
.video-plan {
  border: 1px dashed #7a8799;
  background: #f7f8fa;
}
.video-plan::before {
  content: "영상 제작안";
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  background: #596579;
  font-size: 0.75rem;
  font-weight: 700;
}
.lesson-goal > :first-child,
.example-box > :first-child,
.misconception > :first-child,
.self-check > :first-child,
.practice-card > :first-child,
.video-plan > :first-child { margin-top: 0; }
.lesson-goal > :last-child,
.example-box > :last-child,
.misconception > :last-child,
.self-check > :last-child,
.practice-card > :last-child,
.video-plan > :last-child { margin-bottom: 0; }
.check-list li { margin-bottom: 0.5rem; }
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.source-list {
  font-size: 0.9rem;
  color: var(--muted);
}
.data-flow {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}
.data-flow li {
  position: relative;
  flex: 1;
  padding: 0.75rem 1.2rem 0.75rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--side);
  text-align: center;
}
.data-flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -0.55rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 800;
}
.order-book {
  max-width: 34rem;
  margin: 1rem auto;
  table-layout: fixed;
}
.order-book .ask { background: #fff1f1; }
.order-book .bid { background: #eef5ff; }

img.zoomable {
  cursor: zoom-in;
}
.hero-shot,
.shot-grid figure,
.manual-shot {
  position: relative;
}
.hero-shot::after,
.shot-grid figure::after,
.manual-shot::after {
  content: "클릭하여 확대";
  position: absolute;
  right: 0.55rem;
  bottom: 2.55rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(21, 32, 51, 0.72);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.hero-shot:hover::after,
.shot-grid figure:hover::after,
.manual-shot:hover::after {
  opacity: 1;
}
.shot-grid figure::after {
  bottom: 2.35rem;
}
.manual-shot::after { bottom: 3.4rem; }

body.lb-open {
  overflow: hidden;
}
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.2rem;
  background: rgba(10, 16, 28, 0.88);
  cursor: zoom-out;
}
.lb-overlay[hidden] {
  display: none !important;
}
.lb-img {
  max-width: min(1366px, 96vw);
  max-height: calc(100vh - 4.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: #111;
  cursor: zoom-out;
}
.lb-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.lb-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

@media (max-width: 800px) {
  .site-head { align-items: flex-start; }
  .site-head nav { flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem 0.8rem; }
  .wrap { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .side h2 { margin-bottom: 0.35rem; }
  .side a { display: inline-block; margin: 0.1rem; }
  main { padding: 1.5rem 1.1rem 3rem; }
  h1 { font-size: 1.7rem; }
  .shot-grid { grid-template-columns: 1fr; }
  .manual-grid { grid-template-columns: 1fr; }
  .manual-toc ol { columns: 1; }
  .school-toc ol { columns: 1; }
  .course-grid { grid-template-columns: 1fr; }
  .study-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-flow { flex-direction: column; }
  .data-flow li:not(:last-child)::after {
    content: "↓";
    right: auto;
    top: auto;
    left: 50%;
    bottom: -0.8rem;
    transform: translateX(-50%);
  }
  .control-table th:first-child,
  .control-table td:first-child { width: auto; }
  .hero-shot::after,
  .shot-grid figure::after,
  .manual-shot::after {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .site-head { padding: 0.65rem 0.9rem; }
  .brand .word { display: none; }
  .site-head nav { font-size: 0.84rem; }
  th, td { padding: 0.4rem; }
  .study-steps { grid-template-columns: 1fr; }
  .lesson-nav { flex-direction: column; }
}
