/* 다크모드를 기본값으로 사용합니다. 공개 화면과 로컬 작성기의 대비를 같은 색상 변수로 맞춥니다. */
:root {
  color-scheme: dark;
  --bg: #121517;
  --panel: #1a1f22;
  --ink: #e4e7e4;
  --muted: #a1aaa7;
  --line: #353e41;
  --accent: #dfa58a;
  --cyan: var(--accent);
  --blue: #a0bccb;
  --surface: #22292c;
  --code-bg: #1d272c;
  --code-ink: #c0dae7;
  --radius: 3px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: 'Pretendard', 'SUIT', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif; font-size: 15px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .6; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
::selection { background: #755543; color: #fff4e7; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted, small { color: var(--muted); }
.skip-link { position: fixed; z-index: 1000; top: 12px; left: 20px; padding: 10px 18px; color: var(--bg); background: var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

/* 상단 탐색: 대시보드 사이드바 대신 한 줄의 목차로 구성합니다. */
.site-header { max-width: 1240px; margin: 0 auto; min-height: 105px; display: flex; align-items: center; gap: 36px; padding: 22px 48px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand img { display: block; width: 40px; height: auto; max-height: 48px; object-fit: contain; }
.brand-word { display: flex; align-items: baseline; gap: 12px; font-size: 22px; font-weight: 750; letter-spacing: -.7px; line-height: 1; }
.brand-description { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: -.1px; }
#nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
#nav a { position: relative; font-size: 13px; font-weight: 500; padding: 13px 0; white-space: nowrap; color: var(--muted); }
#nav a:hover { color: var(--ink); }
#nav a.active { color: var(--ink); font-weight: 650; }
#nav a.active::after { position: absolute; content: ''; bottom: 3px; left: 0; width: 18px; height: 2px; background: var(--accent); }
#local-tools:empty { display: none; }
#local-tools { flex-shrink: 0; }
#local-tools button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 3px; background: transparent; font-size: 12px; }
#local-tools button:hover { border-color: var(--ink); }
main { max-width: 1120px; min-height: 65vh; margin: 0 auto; padding: 0 20px; }
main:focus { outline: 0; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-family: 'Segoe UI', sans-serif; font-size: 10px; font-weight: 650; letter-spacing: 1.8px; line-height: 1.5; color: var(--muted); }
.accent-line { display: inline-block; width: 30px; height: 2px; background: var(--accent); }

/* 소개 화면의 관심 분야는 숙련도나 성과를 의미하지 않습니다. */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 100px; align-items: end; padding: 82px 0 88px; }
.hero h1 { margin: 27px 0 25px; font-size: clamp(40px, 4.1vw, 56px); font-weight: 550; letter-spacing: -2.5px; line-height: 1.35; }
.hero h1 > span { color: var(--blue); }
.hero-description { color: var(--muted); font-size: 15px; line-height: 1.95; letter-spacing: -.15px; }
.text-link { display: inline-flex; align-items: center; gap: 18px; font-size: 12px; font-weight: 600; }
.text-link > span[aria-hidden] { font-size: 20px; line-height: 1; transition: transform .15s ease; }
.text-link:hover { color: var(--accent); }
.text-link:hover > span[aria-hidden] { transform: translate(2px, -2px); }
.hero-link { margin-top: 30px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); font-size: 13px; }
.interest-index { padding-top: 20px; }
.interest-index > .eyebrow { margin-bottom: 15px; letter-spacing: .8px; }
.interest-index > a { display: flex; gap: 20px; align-items: baseline; position: relative; border-top: 1px solid var(--line); padding: 20px 0 19px; }
.index-number { font-family: 'Segoe UI', sans-serif; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .5px; }
.interest-index strong { display: block; font-family: Georgia, 'Times New Roman', serif; font-size: 29px; font-weight: 400; letter-spacing: -.5px; line-height: 1.2; }
.interest-index small { display: block; margin-top: 7px; font-size: 11px; }
.interest-arrow { align-self: center; margin-left: auto; font-size: 20px; color: var(--muted); }
.interest-index a:hover strong, .interest-index a:hover .interest-arrow { color: var(--accent); }
.index-caption { margin-top: 13px; color: var(--muted); font-size: 10px; line-height: 1.7; }

/* 실제 승인 기록 목록은 테두리를 최소화한 문서 목차 형태로 표시합니다. */
.content-section { border-top: 1px solid var(--ink); padding-top: 25px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 23px; }
.section-heading h2 { display: flex; align-items: center; gap: 25px; font-size: 21px; font-weight: 550; letter-spacing: -.5px; }
.section-number { font-family: 'Segoe UI', sans-serif; font-size: 10px; font-weight: 500; color: var(--accent); letter-spacing: .8px; }
.record-list { border-top: 1px solid var(--line); }
.record-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.record-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 3px; }
.subject-label { color: var(--blue); font-size: 11px; font-weight: 650; letter-spacing: -.1px; }
time { color: var(--muted); font-size: 11px; font-family: 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.record-copy h3 { margin-bottom: 9px; font-size: 20px; font-weight: 600; line-height: 1.55; letter-spacing: -.5px; }
.record-copy p { max-width: 720px; font-size: 13px; line-height: 1.8; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.row-arrow { align-self: center; color: var(--muted); font-size: 25px; }
.record-row:hover h3, .record-row:hover .row-arrow { color: var(--accent); }
.empty-state { display: flex; align-items: flex-start; gap: 28px; padding: 62px 0 90px; }
.empty-state h2, .empty-state h3 { font-size: 18px; font-weight: 500; letter-spacing: -.4px; line-height: 1.6; }
.empty-state p { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-mark { display: inline-flex; justify-content: center; align-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 18px; }
.empty-state.compact { padding: 24px 0 49px; }
.empty-state.compact h3 { font-size: 15px; }
.empty-state.compact p { margin-top: 5px; font-size: 12px; }
.empty-state.compact .empty-mark { width: 30px; height: 30px; font-size: 14px; }
.approach-section { display: grid; grid-template-columns: 1fr 1.25fr; gap: 90px; background: var(--surface); padding: 42px 44px; margin: 22px 0 74px; }
.approach-section h2 { margin-top: 18px; font-size: 27px; font-weight: 500; letter-spacing: -.8px; line-height: 1.55; }
.approach-list { margin: 0; padding: 0; list-style: none; }
.approach-list li { display: flex; gap: 21px; border-top: 1px solid var(--line); padding: 17px 0; }
.approach-list li:first-child { padding-top: 0; border: 0; }
.approach-list li:last-child { padding-bottom: 0; }
.approach-list li > span { color: var(--muted); font-size: 10px; padding-top: 2px; font-family: 'Segoe UI', sans-serif; }
.approach-list h3 { font-size: 13px; font-weight: 650; }
.approach-list p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.last-section { margin-bottom: 40px; }

/* 대표 실습은 명시적으로 선택한 기록을 강조하고, 같은 글은 아래 일반 목록에서 중복 표시하지 않습니다. */
.featured-section { margin-bottom: 42px; }
.featured-practices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.featured-practice { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 27px 28px 23px; border: 1px solid var(--line); border-top-color: var(--blue); background: var(--panel); }
/* 1개만 선택한 경우 카드가 가로 공간 전체를 사용합니다. */
.featured-practice:only-child { grid-column: 1 / -1; }
.featured-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; margin-bottom: 19px; }
.featured-practice h3 { font-size: 23px; font-weight: 600; line-height: 1.5; letter-spacing: -.6px; }
.featured-description { margin-top: 13px; color: var(--muted); font-size: 13px; line-height: 1.8; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.featured-read { display: flex; align-items: center; gap: 16px; padding-top: 26px; margin-top: auto; font-size: 12px; font-weight: 600; }
.featured-read > span { font-size: 20px; line-height: 1; }
.featured-practice:hover { border-color: var(--blue); }
.featured-practice:hover h3, .featured-practice:hover .featured-read { color: var(--accent); }
.featured-empty { border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .featured-section { margin-bottom: 30px; }
  .featured-practices { grid-template-columns: 1fr; gap: 16px; }
  .featured-practice { padding: 22px; }
  .featured-meta { margin-bottom: 14px; }
  .featured-practice h3 { font-size: 20px; }
  .featured-description { font-size: 12px; }
}

/* 목록 화면: 선택 분야를 주소와 함께 유지하는 카테고리 필터입니다. */
.page-intro:not(.hero) { padding: 68px 0 42px; }
.page-intro:not(.hero) h1 { margin-top: 20px; font-size: clamp(32px, 4vw, 44px); font-weight: 550; letter-spacing: -1.5px; line-height: 1.4; }
.page-description { max-width: 680px; margin-top: 20px; color: var(--muted); line-height: 1.9; font-size: 14px; }
.category-filter { display: flex; flex-wrap: wrap; gap: 9px; border-top: 1px solid var(--ink); padding: 22px 0; }
.filter { padding: 7px 16px; border: 1px solid transparent; border-radius: 2px; color: var(--muted); font-size: 12px; }
.filter:hover { color: var(--ink); border-color: var(--line); }
.filter.active { color: var(--panel); background: var(--ink); border-color: var(--ink); }
.listing-section { min-height: 280px; padding-bottom: 60px; border-top: 1px solid var(--line); }
.listing-section .record-list { border-top: 0; }
.legacy-note { padding: 12px 0; margin-bottom: 20px; color: var(--muted); font-size: 12px; border-left: 2px solid var(--line); padding-left: 16px; }

/* 읽기 화면: 본문과 보조 정보를 분리하고 긴 명령어는 가로 스크롤합니다. */
.article-intro { max-width: 820px; margin-inline: auto; }
.back-link { margin-bottom: 36px; color: var(--muted); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.article-intro h1 { max-width: 820px; }
.article-layout { display: block; max-width: 820px; margin-inline: auto; padding-top: 34px; border-top: 1px solid var(--line); }
.article-body { min-width: 0; text-align: left; font-size: 15.5px; line-height: 1.78; padding-bottom: 50px; }
.article-body p { margin: 0 0 22px; }
.article-body h2 { margin: 44px 0 18px; font-size: 25px; font-weight: 600; letter-spacing: -.7px; line-height: 1.55; }
.article-body h3 { margin: 34px 0 15px; font-size: 20px; font-weight: 600; line-height: 1.5; }
.article-body h4, .article-body h5, .article-body h6 { margin: 25px 0 12px; font-size: 16px; }
.article-body > :first-child { margin-top: 0; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 18px 0 24px; }
.article-body li { margin: 8px 0; }
.article-body li::marker { color: var(--accent); }
.article-body code { padding: .13em .35em; border-radius: 2px; background: var(--code-bg); color: var(--code-ink); font-size: .88em; font-family: Consolas, 'Cascadia Code', monospace; word-break: break-word; }
.article-body pre { overflow-x: auto; margin: 24px 0; padding: 23px 25px; background: var(--code-bg); border-left: 2px solid #52666b; border-radius: 1px; line-height: 1.75; white-space: pre; }
.article-body pre code { padding: 0; background: transparent; color: var(--ink); word-break: normal; }
.article-body blockquote { padding: 3px 0 3px 22px; margin: 26px 0; border-left: 2px solid var(--accent); color: var(--muted); }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 38px 0; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.article-aside { padding-left: 24px; border-left: 1px solid var(--line); }
.article-aside dl { margin: 20px 0 26px; }
.article-aside dt { margin-top: 14px; color: var(--muted); font-size: 10px; }
.article-aside dd { margin: 2px 0 0; font-size: 12px; }
.article-aside .text-link { font-size: 11px; gap: 9px; }
.article-bottom { max-width: 820px; margin-inline: auto; border-top: 1px solid var(--line); padding: 25px 0 50px; }
.missing-page { min-height: 440px; }
.missing-page .button { margin-top: 28px; }

/* 버튼·입력 기본값은 로컬 글쓰기에서도 사용할 수 있도록 공유합니다. */
.button, button.primary { display: inline-flex; justify-content: center; align-items: center; gap: 14px; padding: 11px 17px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; }
.primary, button.primary { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.button:hover, button.primary:hover { background: var(--accent); border-color: var(--accent); color: #1a1715; }
input, textarea, select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); }
textarea { resize: vertical; }
label { color: var(--muted); font-size: 13px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); }
.notice { margin: 22px 0; padding: 14px 18px; background: #30251f; color: #e6b99a; font-size: 13px; border-left: 2px solid var(--accent); }
.site-footer { max-width: 1144px; margin: 0 auto; padding: 28px 32px 34px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 35px; }
.footer-brand { display: inline-flex; align-items: baseline; gap: 12px; font-size: 16px; font-weight: 750; letter-spacing: -.4px; }
.footer-brand span { font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.site-footer p { color: var(--muted); font-size: 10px; }
.back-top { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.back-top span { margin-left: 12px; font-size: 17px; }

/* 화면이 좁으면 목차·본문·개인 도구를 세로로 재배치합니다. */
@media (min-width: 1500px) {
  .hero { padding-top: 103px; padding-bottom: 103px; }
  .hero h1 { font-size: 60px; }
}
@media (max-width: 1050px) {
  .site-header { margin: 0 28px; padding: 20px 0; gap: 24px; }
  .brand-description { display: none; }
  main { padding: 0 40px; }
  .hero { gap: 65px; }
  .hero h1 { font-size: 45px; letter-spacing: -2px; }
  .approach-section { gap: 40px; }

  .site-footer { margin: 0 28px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 720px) {
  .site-header { min-height: auto; margin: 0 24px; padding: 19px 0 0; display: grid; grid-template-columns: 1fr auto; row-gap: 16px; }
  .brand-word { font-size: 21px; }
  .brand-description { display: inline; font-size: 10px; }
  .brand img { width: 34px; height: auto; }
  #local-tools { grid-row: 1; grid-column: 2; }
  #nav { grid-row: 2; grid-column: 1 / -1; margin-left: 0; gap: 26px; overflow-x: auto; scrollbar-width: none; }
  #nav a { font-size: 12px; padding: 11px 0 15px; }
  #nav a.active::after { bottom: 5px; }
  main { padding: 0 24px; }
  .hero { grid-template-columns: 1fr; gap: 42px; padding: 50px 0 50px; }
  .hero h1 { margin-top: 22px; font-size: 40px; letter-spacing: -1.8px; }
  .hero-description { font-size: 13px; }
  .hero-link { margin-top: 24px; font-size: 12px; }
  .interest-index { padding-top: 0; }
  .interest-index > .eyebrow { margin-bottom: 12px; }
  .interest-index > a { padding: 17px 0; gap: 17px; }
  .interest-index > a > span:nth-child(2) { display: flex; align-items: baseline; gap: 16px; }
  .interest-index strong { font-size: 24px; }
  .interest-index small { margin-top: 0; font-size: 10px; }
  .index-caption { display: none; }
  .section-heading { align-items: baseline; }
  .section-heading h2 { font-size: 18px; gap: 16px; }
  .section-heading .text-link { font-size: 10px; gap: 8px; }
  .empty-state { padding: 35px 0 55px; gap: 18px; }
  .empty-state h2, .empty-state h3 { font-size: 15px; }
  .empty-state p { font-size: 12px; }
  .empty-state.compact { padding: 16px 0 30px; }
  .empty-state.compact h3 { font-size: 14px; }
  .empty-mark { width: 30px; height: 30px; font-size: 14px; }
  .approach-section { grid-template-columns: 1fr; gap: 25px; margin: 20px 0 48px; padding: 27px 25px; }
  .approach-section h2 { margin-top: 12px; font-size: 23px; }
  .approach-list li { padding: 14px 0; }
  .last-section { margin-bottom: 12px; }
  .page-intro:not(.hero) { padding: 47px 0 32px; }
  .page-intro:not(.hero) h1 { font-size: 32px; letter-spacing: -1.2px; }
  .page-description { margin-top: 17px; font-size: 13px; }
  .category-filter { gap: 5px; padding: 16px 0; }
  .filter { padding: 7px 10px; font-size: 10px; }
  .listing-section { padding-bottom: 30px; }
  .record-row { grid-template-columns: 1fr 22px; gap: 9px 15px; padding: 22px 0; }
  .record-kind { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 17px; }
  .record-copy h3 { font-size: 18px; margin-bottom: 7px; }
  .record-copy p { font-size: 12px; }
  .row-arrow { font-size: 22px; }
  .back-link { margin-bottom: 26px; }
  .article-layout { padding-top: 24px; }
  .article-aside { display: none; }
  .article-body { font-size: 15px; }
  .article-body h2 { font-size: 23px; }
  .article-body h3 { font-size: 19px; }
  .article-body pre { margin-left: -9px; margin-right: -9px; padding: 18px; font-size: 13px; }
  .site-footer { margin: 0 24px; padding: 23px 0 30px; gap: 13px; flex-wrap: wrap; }
  .site-footer p { order: 3; flex-basis: 100%; font-size: 9px; }
  .footer-brand { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
/* 실습 폴더와 게시글 내부 항목은 native details를 사용해 키보드로도 접고 펼칩니다. */
.practice-folders { padding: 10px 0; }
.practice-folder { border-bottom: 1px solid var(--line); }
.practice-folder > summary { display: flex; align-items: center; gap: 13px; padding: 21px 0; cursor: pointer; list-style: none; }
.practice-folder > summary::-webkit-details-marker, .article-section > summary::-webkit-details-marker { display: none; }
.folder-icon { position: relative; display: block; width: 18px; height: 13px; margin-top: 4px; border: 1px solid var(--blue); border-radius: 2px; }
.folder-icon::before { position: absolute; content: ''; width: 8px; height: 3px; left: -1px; top: -4px; border: 1px solid var(--blue); border-bottom: 0; border-radius: 2px 2px 0 0; }
.folder-title { font-size: 16px; font-weight: 600; }
.folder-subject, .folder-count { color: var(--muted); font-size: 11px; }
.folder-count { margin-left: auto; }
.folder-toggle { color: var(--muted); line-height: 1; }
.practice-folder[open] > summary .folder-toggle, .article-section[open] > summary .section-toggle { transform: rotate(180deg); }
.practice-folder .record-list { padding-left: 31px; border-top: 1px solid var(--line); }
.practice-folder .record-row { padding: 24px 0; }
.practice-folder .record-row:last-child { border-bottom: 0; }
.practice-label { display: inline-block; margin-right: 10px; color: var(--blue); font-size: .76em; font-weight: 500; }
.practice-meta { font-size: 11px; color: var(--muted); }
#public-owner-actions:empty { display: none; }
/* 관리 버튼도 브라우저 기본 회색 대신 현재 다크 테마의 명암을 사용합니다. */
#public-owner-actions:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
#public-owner-actions button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font-size: 12px; }
#public-owner-actions button:hover { border-color: var(--blue); }
#public-owner-actions [data-writing-delete] { color: #edb0a3; }
.article-section { border-bottom: 1px solid var(--line); }
.article-section > summary { cursor: pointer; list-style: none; padding: 22px 0; }
.article-body .article-section > summary h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 20px; font-weight: 600; line-height: 1.5; letter-spacing: -.35px; }
.section-index { min-width: 24px; color: var(--blue); font-variant-numeric: tabular-nums; }
.section-toggle { margin-left: auto; padding-left: 14px; color: var(--muted); font-size: 17px; }
.section-body { padding: 0 0 25px; }
.section-body > :first-child { margin-top: 0; }
.section-body > :last-child { margin-bottom: 0; }

/* SQL 강조와 이미지 배치는 공개 본문·작성 미리보기에 동일하게 적용됩니다. */
.code-block { max-width: 100%; margin: 25px 0; overflow: hidden; border: 1px solid #3b4c53; border-radius: 4px; background: var(--code-bg); }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 13px 8px 18px; border-bottom: 1px solid #33444a; background: #202b30; }
.code-toolbar > span { color: #b0c6d1; font-size: 10px; font-weight: 650; letter-spacing: 1px; }
.article-body .code-block pre, .code-block pre { margin: 0; padding: 20px; overflow-x: auto; border: 0; background: var(--code-bg); color: var(--code-ink); font-size: 13px; line-height: 1.75; white-space: pre; text-align: left; }
.article-body .code-block pre code, .code-block pre code { display: block; padding: 0; background: transparent; color: var(--code-ink); font-family: Consolas, 'Cascadia Code', monospace; font-size: 1em; line-height: inherit; word-break: normal; }
.sql-keyword { color: #91bff1; font-weight: 600; }
.sql-string { color: #e6c194; }
.sql-comment { color: #94a79c; }
.sql-number { color: #c5b6ee; }
.sql-identifier { color: #b5d8bc; }
.content-image { width: var(--image-width, 100%); max-width: 100%; margin: 25px 0; }
.content-image.align-left { margin-left: 0; margin-right: auto; }
.content-image.align-center { margin-left: auto; margin-right: auto; }
.content-image.align-right { margin-left: auto; margin-right: 0; }
.content-image-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: zoom-in; }
.content-image-frame, .image-viewer-frame { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.content-image img, .image-viewer-frame img { display: block; width: 100%; height: auto; max-height: none; border: 0; border-radius: 0; }
/* 캔버스에서 읽은 투명 경계는 화면의 창에만 적용하며 첨부 원본에는 저장하지 않습니다. */
.content-image-frame.is-measured img, .image-viewer-frame.is-measured img { position: absolute; max-width: none; }
.content-image-open:hover .content-image-frame { border-color: var(--blue); }
.content-image-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }
.content-image-open:hover .content-image-hint { color: var(--blue); }
.content-image figcaption { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: left; }
/* native dialog의 최상위 레이어는 작성창 위에 열리고, 작은 화면에서는 화면 안에 맞춥니다. */
.image-viewer { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; background: transparent; color: var(--ink); align-items: center; justify-content: center; }
.image-viewer[open], .image-viewer.is-fallback { display: flex; }
.image-viewer::backdrop { background: rgb(4 7 9 / 88%); }
.image-viewer.is-fallback { z-index: 10000; background: rgb(4 7 9 / 88%); }
.image-viewer-panel { display: flex; flex-direction: column; width: min(1400px, 100%); height: min(1100px, 92vh); height: min(1100px, 92dvh); max-height: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: 0 20px 70px rgb(0 0 0 / 35%); overflow: hidden; }
.image-viewer-toolbar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.image-viewer-title { margin: 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 500; }
.image-viewer-actions { display: flex; flex-shrink: 0; gap: 8px; }
.image-viewer-actions button { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font-size: 12px; }
.image-viewer-actions button:hover { border-color: var(--blue); }
.image-viewer-scroll { display: flex; flex: 1; min-height: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; }
.image-viewer-frame { flex: none; align-self: flex-start; max-width: none; margin: auto; }
.image-viewer-help { flex-shrink: 0; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
@media (max-width: 720px) {
  .practice-folder > summary { gap: 10px; padding: 19px 0; }
  .folder-title { font-size: 14px; }
  .folder-subject, .folder-count { font-size: 10px; }
  .practice-folder .record-list { padding-left: 18px; }
  .practice-folder .record-row { padding: 20px 0; }
  .practice-label { display: block; margin-bottom: 3px; }
  .article-body .article-section > summary h2 { font-size: 18px; gap: 7px; }
  .section-index { min-width: 21px; }
  .article-body .code-block pre, .code-block pre { padding: 16px; margin: 0; }
  .code-block { margin: 21px 0; }
  .content-image { max-width: 100%; }
  .image-viewer { padding: 10px; }
  .image-viewer-panel { height: 96vh; height: 96dvh; }
  .image-viewer-toolbar { align-items: flex-start; gap: 10px; padding: 11px; }
  .image-viewer-title { padding-top: 7px; font-size: 12px; }
  .image-viewer-actions { gap: 5px; }
  .image-viewer-actions button { padding-inline: 8px; font-size: 11px; }
  .image-viewer-scroll { padding: 16px; }
  .image-viewer-help { padding: 9px 11px; font-size: 10px; }
}

/* HOME_SLIDES_BEGIN */
/* 소개 슬라이드는 같은 높이의 가로 트랙만 이동하며 다른 본문과 작성기는 다시 그리지 않습니다. */
.hero.hero-carousel { display: block; padding-top: 74px; padding-bottom: 62px; }
.hero-viewport { overflow: hidden; }
.hero-track { display: flex; align-items: stretch; transition: transform .62s cubic-bezier(.22,.65,.3,1); }
.hero-slide { flex: 0 0 100%; width: 100%; min-width: 0; display: grid; grid-template-columns: 1.55fr 1fr; gap: 76px; align-items: end; }
.hero-slide .hero-main { min-width: 0; min-height: 360px; }
.hero-slide-title { margin: 28px 0 23px; font-size: clamp(43px, 4.5vw, 60px); font-weight: 550; letter-spacing: -2.6px; line-height: 1.3; }
.hero-slide-title > span { color: var(--blue); }
/* Linux 터미널은 코드와 CSS로 그립니다. 창 아이콘과 커서는 장식이며 실제 명령은 실행하지 않습니다. */
.hero-terminal { margin: 28px 0 25px; width: 100%; max-width: 100%; overflow: hidden; border: 1px solid #3b4b50; border-radius: 7px; background: #101719; box-shadow: 0 10px 28px #0002; font-family: Consolas, 'Cascadia Code', 'Liberation Mono', monospace; }
.terminal-titlebar { display: flex; align-items: center; gap: 10px; min-height: 37px; padding: 0 14px; border-bottom: 1px solid #34434a; background: #202a2e; color: #aab9bf; font-size: 10px; line-height: 1.4; letter-spacing: .1px; }
.terminal-symbol { color: var(--blue); font-size: 13px; font-weight: 700; }
.terminal-window-controls { display: flex; align-items: center; gap: 15px; margin-left: auto; color: #8b9ba2; }
.terminal-window-controls i { display: block; position: relative; width: 7px; height: 7px; }
.terminal-window-controls i:first-child { border-bottom: 1px solid currentColor; }
.terminal-window-controls i:nth-child(2) { border: 1px solid currentColor; }
.terminal-window-controls i:last-child::before, .terminal-window-controls i:last-child::after { position: absolute; content: ''; top: 3px; width: 9px; height: 1px; background: currentColor; transform: rotate(45deg); }
.terminal-window-controls i:last-child::after { transform: rotate(-45deg); }
.terminal-body { min-height: 149px; padding: 21px 24px 25px; }
.terminal-command { color: #d6dfdf; font-size: clamp(10px, 1.05vw, 12px); line-height: 1.8; letter-spacing: -.15px; overflow-wrap: normal; word-break: normal; }
.terminal-user { color: #93c5ab; }
.terminal-path { color: #9fbed0; }
.terminal-prompt { color: #b7c5c8; padding-right: 4px; }
.terminal-output { display: flex; align-items: center; gap: 13px; margin-top: 20px; color: #e6eeec; font-family: inherit; font-size: clamp(29px, 3.5vw, 46px); font-weight: 500; letter-spacing: -1.7px; line-height: 1.25; white-space: nowrap; }
.terminal-cursor { width: .28em; height: .92em; flex-shrink: 0; background: #9fbed0; opacity: .8; }
.hero-slide .hero-description { min-height: 3.9em; }
.portfolio-index strong { font-family: inherit; font-size: 25px; font-weight: 500; letter-spacing: -.8px; }
.portfolio-index a.is-highlighted strong, .portfolio-index a.is-highlighted .interest-arrow { color: var(--blue); }
.hero-controls { display: flex; align-items: center; gap: 18px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.hero-pagination { display: flex; align-items: center; gap: 3px; }
.hero-dot { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 38px; padding: 0; border: 0; background: transparent; }
.hero-dot > span { display: block; width: 23px; height: 2px; background: #58636a; transition: background .2s ease, width .2s ease; }
.hero-dot[aria-current="true"] > span { width: 33px; background: var(--accent); }
.hero-dot:hover > span { background: var(--ink); }
.hero-counter { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.hero-navigation { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.hero-navigation button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); font-size: 20px; }
.hero-navigation button:hover { border-color: var(--blue); color: var(--blue); }
.hero-navigation .hero-pause { width: 82px; padding: 0 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
@media (min-width: 1500px) {
  .hero.hero-carousel { padding-top: 92px; padding-bottom: 76px; }
  .hero-slide-title { font-size: 65px; }
}
@media (max-width: 1050px) {
  .hero-slide { gap: 48px; }
  .hero-slide-title { font-size: 46px; letter-spacing: -2px; }
  .portfolio-index strong { font-size: 23px; }
}
@media (max-width: 720px) {
  .hero.hero-carousel { padding-top: 46px; padding-bottom: 43px; }
  .hero-slide { grid-template-columns: 1fr; gap: 28px; align-content: start; }
  .hero-slide .hero-main { min-height: 308px; }
  .hero-terminal { margin: 24px 0 20px; }
  .terminal-titlebar { min-height: 34px; padding-inline: 12px; font-size: 9px; }
  .terminal-window-controls { gap: 12px; }
  .terminal-body { min-height: 143px; padding: 21px 16px 24px; }
  .terminal-command { font-size: clamp(9px, 2.55vw, 12px); }
  .terminal-output { gap: 9px; font-size: clamp(26px, 7.2vw, 42px); letter-spacing: -1.3px; }
  .hero-slide-title { margin: 24px 0 20px; font-size: clamp(37px, 8.8vw, 49px); letter-spacing: -1.8px; }
  .hero-slide .hero-description { min-height: 3.9em; font-size: 13px; }
  .hero-slide .hero-link { margin-top: 24px; }
  .hero-slide .portfolio-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 0; }
  .hero-slide .portfolio-index > .eyebrow, .hero-slide .portfolio-index .index-caption, .hero-slide .portfolio-index small, .hero-slide .portfolio-index .interest-arrow { display: none; }
  .hero-slide .portfolio-index > a { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 9px; padding: 14px 0 0; }
  .hero-slide .portfolio-index > a > span:nth-child(2) { display: block; }
  .hero-slide .portfolio-index strong { font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: -.3px; }
  .hero-controls { gap: 10px; margin-top: 27px; padding-top: 13px; }
  .hero-counter { display: none; }
  .hero-dot { width: 32px; }
  .hero-dot > span { width: 19px; }
  .hero-dot[aria-current="true"] > span { width: 27px; }
  .hero-navigation { gap: 5px; }
  .hero-navigation button { width: 33px; height: 35px; }
  .hero-navigation .hero-pause { width: 74px; padding: 0 7px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-track, .hero-dot > span { transition: none; }
}
/* HOME_SLIDES_END */

/* 문제 번호부터 여러 줄 SQL과 직접 적은 해석까지 한 테두리 안에 묶어 읽습니다. */
.sql-problems { display: grid; gap: 20px; min-width: 0; margin: 22px 0; }
.sql-problem { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.sql-problem-heading { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; line-height: 1.5; }
.article-body .sql-problem-heading { margin: 0; font-size: 13px; }
.sql-problem-number { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; min-width: 28px; min-height: 25px; color: var(--accent); font-variant-numeric: tabular-nums; }
.sql-problem .code-block { min-width: 0; margin: 0; border: 0; border-radius: 0; }
.sql-problem .code-toolbar { background: transparent; }
.sql-problem .code-toolbar > span { color: var(--muted); }
.sql-problem .code-block pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.sql-problem-answer { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; min-width: 0; padding: 17px 20px; border-top: 1px solid var(--line); background: var(--panel); line-height: 1.8; }
.sql-answer-marker { color: var(--accent); font-weight: 650; font-family: Consolas, 'Cascadia Code', monospace; }
.sql-answer-content { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sql-answer-content > :first-child { margin-top: 0; }
.sql-answer-content > :last-child { margin-bottom: 0; }
.sql-problem-note, .sql-problem-archive { min-width: 0; color: var(--muted); line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.sql-problem-note { padding: 13px 18px; }
.sql-problem-archive { margin-top: 20px; padding: 16px 18px; border-left: 2px solid var(--line); }
@media (max-width: 720px) {
  .sql-problems { gap: 16px; margin: 19px 0; }
  .sql-problem-heading { padding: 11px 13px; }
  .sql-problem-answer { padding: 14px 16px; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; }
  .sql-problem-note, .sql-problem-archive { padding: 12px 14px; }
}