.detail-page { background: #fff; }

.article-header { padding: 64px 20px 48px; }
.article-header-inner { width: min(100%, 720px); margin: 0 auto; text-align: left; }
.detail-category {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 5px 13px;
    color: #245fbc;
    background: #eef4fb;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
}
.article-header h1 {
    margin: 22px 0 0;
    color: #15161a;
    font-family: "IBM Plex Sans", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(34px, 4.2vw, 44px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.04em;
    word-break: keep-all;
}
.detail-summary { margin: 20px 0 0; color: #666b75; font-size: 18px; line-height: 1.7; }
.author-row { display: inline-flex; align-items: center; gap: 12px; margin-top: 30px; text-align: left; }
.author-mark { display: grid; width: 42px; height: 42px; place-items: center; color: #fff; background: #17191f; border-radius: 50%; font-size: 15px; font-weight: 800; }
.author-copy strong { display: block; color: #30323a; font-size: 13px; }
.author-copy p { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; color: #8a8d96; font-size: 12px; }
.author-copy b { font-weight: 600; }

.article-thumbnail-wrap { width: min(calc(100% - 40px), 768px); margin: 0 auto 58px; }
.article-cover { display: block; width: 100%; aspect-ratio: 120 / 63; object-fit: cover; border-radius: 8px; }

.article-layout {
    width: min(calc(100% - 40px), 1152px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin: 0 auto;
}
.article-content {
    grid-column: 2;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    color: #30343b;
    font-family: "IBM Plex Sans", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.95;
}
.article-content :where(p, li, a, blockquote, table, th, td) { font-family: inherit; }
.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }
.article-content h1, .article-content h2, .article-content h3 {
    color: #17191e;
    font-family: inherit;
    letter-spacing: -.04em;
    line-height: 1.4;
    scroll-margin-top: 105px;
}
.article-content h1 { margin: 58px 0 22px; font-size: 32px; }
.article-content h2 { margin: 54px 0 20px; font-size: 28px; }
.article-content h3 { margin: 43px 0 16px; font-size: 23px; }
.article-content p { max-width: 100%; margin: 0 0 25px; }
.article-content ul, .article-content ol { margin: 0 0 25px; padding-left: 1.45em; }
.article-content li { margin: 7px 0; }
.article-content blockquote { margin: 30px 0; padding: 5px 0 5px 22px; color: #515d6d; border-left: 4px solid #3c77bd; }
.article-content hr { width: 100%; height: 1px; margin: 48px 0; border: 0; background: #e1e3e7; }
.article-content a { color: #2168b4; text-decoration: underline; text-decoration-color: #a9c8e8; text-underline-offset: 4px; }
.article-content img { height: auto; margin: 36px auto; max-width: 100%; border-radius: 8px; }
.article-content pre { margin: 30px 0; border-radius: 10px; }
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }
.article-content .ql-font-pretendard-variable { font-family: "Pretendard Variable", Pretendard, sans-serif; }
.article-content .ql-font-ibm-plex-sans { font-family: "IBM Plex Sans", "Pretendard Variable", sans-serif; }
.article-content .ql-font-serif { font-family: Georgia, "Noto Serif KR", serif; }
.article-content .ql-font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content .ql-indent-1 { padding-left: 2.5em; }
.article-content .ql-indent-2 { padding-left: 5em; }
.article-content .ql-code-block-container { margin: 30px 0; padding: 18px 20px; border-radius: 10px; background: #282c34; color: #abb2bf; font: .88rem/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.article-content .ql-code-block { white-space: pre; }
.article-content .ql-code-block-container.syntax-highlighted .hljs { display: block; padding: 0; background: transparent; white-space: pre; }
.article-content pre code.hljs { padding: 18px 20px; border-radius: 10px; }
.article-content table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.article-content th, .article-content td { border: 1px solid #e0e2e7; padding: 10px 13px; }
.article-content th { background: #f6f7f8; }

.contents-panel {
    position: fixed;
    z-index: 4;
    top: clamp(96px, 15vh, 132px);
    left: max(20px, calc((100vw - 1152px) / 2));
    grid-column: 1;
    width: min(184px, calc((100vw - 824px) / 2));
    min-width: 0;
    max-height: calc(100vh - 132px);
    padding-right: 22px;
    border-right: 1px solid #e7e8eb;
}
.contents-panel > p, .related-panel > p { margin: 0 0 14px; color: #272a31; font-size: 15px; font-weight: 700; }
.contents-panel nav { display: grid; max-height: calc(100vh - 164px); gap: 9px; overflow-y: auto; scrollbar-width: thin; }
.contents-panel a { display: -webkit-box; overflow: hidden; color: #858891; font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.contents-panel a[data-level="3"] { padding-left: 12px; }
.contents-panel a:hover, .contents-panel a.active { color: #245fbc; }
.contents-panel.empty { display: none; }

.related-panel { position: sticky; grid-column: 3; top: 108px; min-width: 0; padding-left: 22px; border-left: 1px solid #e7e8eb; }
.related-panel.empty { display: none; }
.related-post-list { display: grid; gap: 18px; }
.related-post-card { display: grid; grid-template-columns: minmax(0, 1fr) 78px; gap: 11px; align-items: center; }
.related-post-copy { min-width: 0; }
.related-post-copy strong { display: -webkit-box; overflow: hidden; color: #42464e; font-size: 13px; font-weight: 600; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.related-post-copy small { display: block; margin-top: 5px; color: #9a9da5; font-size: 10px; }
.related-post-thumbnail { display: grid; width: 78px; height: 52px; place-items: center; overflow: hidden; color: #d8e8f7; background: #243f60; border-radius: 6px; font-size: 12px; }
.related-post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.related-post-card:hover strong { color: #245fbc; }

.article-bottom { width: min(calc(100% - 40px), 720px); margin: 52px auto 0; }
.section-kicker { margin: 0 0 7px; color: #3b73b7; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.detail-footer-nav { display: flex; align-items: center; justify-content: space-between; padding: 34px 0 15px; }
.detail-footer-nav a { color: #42464f; font-size: 13px; font-weight: 700; }
.detail-footer-nav a:hover { color: #245fbc; }
.copy-link-button { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 7px 11px; color: #656a74; border: 1px solid #e2e4e8; background: #fff; border-radius: 8px; font-size: 12px; font-weight: 650; cursor: pointer; }
.copy-link-button:hover { color: #245fbc; border-color: #aac8ec; background: #f5f9fd; }
.copy-link-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-link-button.copied span { display: none; }
.copy-link-button.copied::after { content: "복사됨"; }

@media (max-width: 1050px) {
    .article-layout { grid-template-columns: minmax(0, 720px); justify-content: center; gap: 40px; }
    .contents-panel, .related-panel { position: static; width: auto; max-height: none; }
    .contents-panel { grid-column: 1; order: 1; padding: 20px; border: 1px solid #e7e8eb; border-radius: 10px; }
    .contents-panel nav { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 190px; }
    .article-content { grid-column: 1; order: 2; }
    .related-panel { grid-column: 1; order: 3; padding: 28px 0 0; border-top: 1px solid #e7e8eb; border-left: 0; }
    .related-post-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .article-header { padding: 52px 20px 42px; }
    .article-header h1 { font-size: clamp(32px, 7vw, 40px); }
    .detail-summary { font-size: 16px; }
    .article-thumbnail-wrap { margin-bottom: 48px; }
    .article-layout { grid-template-columns: minmax(0, 1fr); }
    .contents-panel nav, .related-post-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .article-header { padding: 42px 14px 34px; }
    .article-header h1 { margin-top: 18px; font-size: 32px; }
    .detail-summary { margin-top: 18px; font-size: 15px; }
    .author-row { margin-top: 25px; }
    .article-thumbnail-wrap, .article-layout, .article-bottom { width: calc(100% - 28px); }
    .article-thumbnail-wrap { margin-bottom: 38px; }
    .article-cover { border-radius: 8px; }
    .article-content { font-size: 16px; line-height: 1.9; }
    .article-content h1 { font-size: 27px; }
    .article-content h2 { margin-top: 45px; font-size: 25px; }
    .article-content h3 { font-size: 21px; }
    .article-bottom { margin-top: 62px; }
    .detail-footer-nav { align-items: flex-start; flex-direction: column; gap: 18px; }
}
