@charset "utf-8";

/* =========================================
   0. CSS Variables (The Essential Dark Theme)
   ========================================= */
:root {
    /* Base Colors */
    --bg-body: #18181b;
    /* 딥 다크 배경 (Deep Dark) */
    --bg-surface: #27272a;
    /* 카드/표면 기본 (Surface) */
    --bg-surface-hover: #3f3f46;

    /* Typography */
    --text-primary: #e4e4e7;
    /* 주 텍스트 (Light Gray) */
    --text-secondary: #a1a1aa;
    /* 보조 텍스트 (Muted) */
    --text-tertiary: #71717a;
    /* 매우 흐린 텍스트 (Dim) */

    /* Brand/Accent Colors (포인트 컬러) */
    /* 기본은 터미널 민트(Terminal Mint)이지만 언제든 커스텀 가능 */
    --accent-color: #14b8a6;
    /* 메인 포인트 컬러 */
    --accent-color-hover: #2dd4bf;
    /* 호버 시 밝은 톤 */
    --accent-blue: #06b6d4;
    /* 보조 포인트 컬러 (청색/시안 연결 고리) */

    /* Layout Borders */
    --border-subtle: rgba(255, 255, 255, 0.05);
    /* 경계선만 살짝 (매우 연한 흰색 선) */
    --border-medium: rgba(255, 255, 255, 0.1);

    /* Shadows - 가벼운 엘리베이션 */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 15px -3px rgba(20, 184, 166, 0.15);
    /* 은은한 엑센트 글로우 */
}


/* =========================================
   1. Global Resets & Tistory Overrides
   ========================================= */
#tistory-toolbar,
.tt_toolbar_container,
.plugin_author,
div[data-tistory-react-app="Namecard"],
#tistorytoolbarid,
.tt_menubar,
#kakaoWrap #kakaoHead,
.tistoryProfileLayerTrigger {
    display: none !important;
}

/* Force Vertical Scrollbar to prevent layout shift */
html {
    overflow-y: scroll;
}

/* Guestbook Input Reset */
input[type="text"],
input[type="password"],
textarea {
    appearance: none;
    -webkit-appearance: none;
}

/* Mobile Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Syntax Highlighting */
/* Syntax Highlighting & Code Blocks */
.hljs,
pre,
code,
.prose pre,
.prose code {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    font-family: 'JetBrains Mono', monospace !important;
}

.hljs {
    display: block;
    overflow-x: auto;
    padding: 1.25rem !important;
    border-radius: 0.75rem !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
    border: 1px solid var(--border-subtle) !important;
    /* 약간의 구분선 추가 */
}

/* Custom Scrollbar for Code Blocks */
.hljs::-webkit-scrollbar {
    height: 6px;
    /* 더 얇고 미니멀하게 */
}

.hljs::-webkit-scrollbar-track {
    background: transparent;
}

.hljs::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 4px;
}

.hljs::-webkit-scrollbar-thumb:hover {
    background: #5c6370;
}

/* Atom One Dark Syntax Colors (Forced) */
.hljs-comment,
.hljs-quote {
    color: #5c6370 !important;
    font-style: normal !important;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula {
    color: #c678dd !important;
    /* Purple */
}

.hljs-built_in {
    color: #e5c07b !important;
    /* Soft Gold/Yellow for print(), etc. */
}

.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
    color: #e06c75 !important;
    /* Red */
}

.hljs-literal {
    color: #56b6c2 !important;
    /* Cyan */
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
    color: #98c379 !important;
    /* Green */
}

.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
    color: #d19a66 !important;
    /* Orange */
}

.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
    color: #60a5fa !important;
    /* Brighter Blue */
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

.hljs-link {
    text-decoration: underline;
}

/* Ensure contrast for inline code */
.prose pre code {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border: none !important;
}

/* Prose Image Radius */
.prose img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

/* Remove default P margins */
.tt_article_useless_p_margin p {
    margin: 1.5em 0;
}

/* -------------------------------------------------------------------------- */
/*                        Tistory Image Caption Styling                       */
/* -------------------------------------------------------------------------- */
.prose figure figcaption,
.prose figcaption,
figure[data-ke-type="image"] figcaption,
figure.imageblock figcaption,
figure.imagegridblock figcaption,
.tt_article_useless_p_margin figcaption,
.tt_article_useless_p_margin .cap1 {
    font-size: 0.75rem !important;
    /* Smaller than Body 3 (size14 = 0.875rem) */
    color: var(--text-muted) !important;
    margin-top: 0.25rem !important;
    /* Pull aggressively closer to the image */
    padding-top: 0 !important;
    text-align: center;
    line-height: 1.4;
}

/* -------------------------------------------------------------------------- */
/*                        Tistory Typography Overrides                        */
/* -------------------------------------------------------------------------- */
/* 1. Bold (볼드) - Reset Tailwind override */
.prose b,
.prose strong,
.tt_article_useless_p_margin b,
.tt_article_useless_p_margin strong,
p[data-ke-size] b,
p[data-ke-size] strong {
    font-weight: 700 !important;
    color: #ffffff !important;
    /* Make it pop in dark mode */
}

/* 2. Italic (기울임꼴) */
.prose i,
.prose em,
.tt_article_useless_p_margin i,
.tt_article_useless_p_margin em {
    font-style: italic !important;
}

/* 3. Underline (밑줄) */
.prose u,
.tt_article_useless_p_margin u {
    text-decoration: underline !important;
    text-underline-offset: 4px;
    text-decoration-color: var(--accent-color) !important;
    /* Mint underline */
}

/* 4. Strikethrough (취소선) */
.prose s,
.prose strike,
.prose del,
.tt_article_useless_p_margin s,
.tt_article_useless_p_margin strike,
.tt_article_useless_p_margin del {
    text-decoration: line-through !important;
    text-decoration-color: var(--text-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* 5. Tistory Body Sizes (본문 1, 2, 3) */
/* 본문 1 (큰 크기 - size18/size20) */
.prose p[data-ke-size="size18"],
.tt_article_useless_p_margin p[data-ke-size="size18"],
.prose p[data-ke-size="size20"],
.tt_article_useless_p_margin p[data-ke-size="size20"] {
    font-size: 1.15rem !important;
    line-height: 1.8 !important;
    color: var(--text-primary) !important;
}

/* 본문 2 (기본 크기 - size16) */
.prose p[data-ke-size="size16"],
.tt_article_useless_p_margin p[data-ke-size="size16"] {
    font-size: 1.0rem !important;
    line-height: 1.7 !important;
}

/* 본문 3 (작은 크기 - size14) */
.prose p[data-ke-size="size14"],
.tt_article_useless_p_margin p[data-ke-size="size14"] {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: var(--text-secondary) !important;
}

/* Headings Contrast Fixes */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.tt_article_useless_p_margin h1,
.tt_article_useless_p_margin h2,
.tt_article_useless_p_margin h3,
.tt_article_useless_p_margin h4 {
    color: #ffffff !important;
    font-weight: 700 !important;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.prose h2,
.tt_article_useless_p_margin h2 {
    border-left: 4px solid var(--accent-color);
    padding-left: 14px;
}

/* Tistory Editor Table Overrides for Dark Mode */
.prose table,
.prose table * {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-medium) !important;
}

.prose table th,
.prose table td {
    border: 1px solid var(--border-medium) !important;
    padding: 0.75rem !important;
}

.prose table th,
.prose table thead td,
.prose table [data-ke-style] th {
    background-color: var(--bg-surface-hover) !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.prose table [data-ke-style] td {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

/* Tistory OpenGraph Bookmark Hover Fix (Prevent Jitter) */
figure[data-ke-type="opengraph"] a,
figure[data-ke-type="opengraph"] a:hover {
    transform: none !important;
    text-decoration: none !important;
}

figure[data-ke-type="opengraph"] {
    border: 1px solid var(--border-medium) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

figure[data-ke-type="opengraph"]:hover {
    border-color: var(--accent-color) !important;
    box-shadow: var(--shadow-glow) !important;
}

figure[data-ke-type="opengraph"] .og-text {
    background-color: var(--bg-surface) !important;
}

figure[data-ke-type="opengraph"] .og-title,
figure[data-ke-type="opengraph"] .og-desc,
figure[data-ke-type="opengraph"] .og-host {
    color: var(--text-primary) !important;
    font-family: inherit !important;
}

/* =========================================
   2. Layout & Post Limits
   ========================================= */
/* Ensure desktop has height for 9 posts + pagination */
#main-layout main {
    position: relative !important;
    min-height: 1600px !important;
    padding-bottom: 120px !important;
}

@media (max-width: 1280px) {
    #main-layout main {
        min-height: 2000px !important;
    }
}

@media (max-width: 768px) {
    #main-layout main {
        min-height: auto !important;
        padding-bottom: 80px !important;
    }
}

/* Hide posts > 9 */
#main-layout main>article:nth-of-type(n+10) {
    display: none !important;
}

/* =========================================
   3. Pagination Design
   ========================================= */
.pagination {
    position: relative !important;
    /* Flow naturally after content */
    margin-top: 60px !important;
    /* Space from content */
    margin-bottom: 40px !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    gap: 8px;
    z-index: 10;
}

/* Anti-Flicker Cloak */
.cloak-until-loaded {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.cloak-until-loaded.loaded {
    opacity: 1;
}

.pagination a,
.pagination span {
    pointer-events: auto;
    padding: 8px 14px;
    /* 더 편안한 클릭 영역 */
    border-radius: 8px;
    /* 통일된 곡률 */
    background: transparent;
    /* 배경 날리고 텍스트만 */
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination .selected,
.pagination .current {
    background: transparent !important;
    color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    outline: none !important;
    backdrop-filter: none !important;
    /* 기본 상태에서는 어떤 종류의 빛 효과도 나지 않도록 모두 강제 제거 */
    font-weight: 700;
}

/* 호버 시에만 테마색(민트) 빛(glow)이 나도록 설정 */
.pagination a:hover,
.pagination span:hover {
    background: var(--bg-surface-hover) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
    box-shadow: var(--shadow-glow) !important;
    /* 테마색(민트) 글로우 */
}

/* =========================================
   6. Search Input Design (Global)
   ========================================= */
/* 4. FOUC Prevention (JS-Triggered Fade-In) */
#sidebar-desktop,
#toc-container,
#guestbook-container,
#guestbook-list,
#guestbook-form {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* State when JS adds this class */
#sidebar-desktop.is-loaded,
#toc-container.is-loaded,
#guestbook-container.is-loaded,
#guestbook-list.is-loaded,
#guestbook-form.is-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 5. Sleek Dark Tag Design (Reference Match) */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Compact gap */
    margin-top: 3rem;
    font-size: 0 !important;
}

.tag-container a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    /* 더 컴팩트하고 알리오 느낌 */
    padding: 0 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    /* 보더리스 미니멀리즘 */
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    /* 완전 둥근 Pill 스타일 */
    transition: all 0.2s ease;
    text-decoration: none;
}

/* Add Hash (#) Prefix */
.tag-container a::before {
    content: "#";
    margin-right: 4px;
    color: var(--accent-color);
    /* 엑센트로 포인트 */
    opacity: 0.7;
}

.tag-container a:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
    border-color: var(--accent-color-hover);
}

/* Hide the old icon if it exists in HTML, as reference doesn't emphasize it */
.tag-container i {
    display: none !important;
}

/* 6. HIDE Tistory Default Elements (Reset) */
/* Sympathy, Share, Stats, Etc */
.container_postbtn {
    display: none !important;
}

/* Related Articles (Another Category) */
.another_category {
    display: none !important;
}

/* Additional Tistory Injected Layers (Statistics, Etc) */
/* [Extended] 8. Modern Comment Section Styling */
/* Input Box Visibility Fix */
#comments-section textarea {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

#comments-section textarea:focus {
    background-color: var(--bg-body) !important;
    /* 약간 들어간 느낌 */
    border-color: var(--accent-color) !important;
}

/* Admin (Owner) Styling */
li.rp_admin .rp_admin-avatar {
    border: 2px solid var(--accent-color) !important;
}

li.rp_admin .flex-1 .flex span:first-child {
    color: var(--accent-color) !important;
}

/* Add Checkmark Badge for Owner */
li.rp_admin .flex-1 .flex span:first-child::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--accent-color);
}

/* Secret Comment Styling */
/* Secret Comment Styling - Clean Text Only */
li.rp_secret .text-zinc-300 {
    color: #a1a1aa !important;
    font-size: 0.95rem;
    /* Standard size */
    opacity: 0.8;
}

/* Remove the previous lock from content */
li.rp_secret .text-zinc-300::before {
    content: none !important;
}

/* Add Lock Icon to Header (Next to Date/Report) */
/* Lock Icon Removed as per preference */
li.rp_secret .flex.items-baseline::after {
    content: none !important;
}

/* Avatar Placeholder Random Colors (Simulation) */
/* Guest Avatars (DiceBear Enhanced) */
/* Only target images that are explicitly avatars */
li:not(.rp_admin) img.guest-avatar-enhanced,
li:not(.rp_admin) .profile-image img {
    background-color: #f4f4f5;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

li:not(.rp_admin):hover img.guest-avatar-enhanced {
    transform: scale(1.1) rotate(5deg);
}

/* Fix Emojis & Content Images */
/* Ensure emojis inside the comment text content do NOT get avatar styling */
.text-zinc-300 img {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 2px;
    box-shadow: none !important;
    transform: none !important;
}

/* Input Form Focus Effects */
textarea:focus {
    box-shadow: none !important;
}

/* Checkbox Customization */
input[type="checkbox"]:checked {
    background-color: transparent !important;
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%2314b8a6' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e") !important;
}

.another_category a {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 60vw;
    /* Prevent overflow */
}

.another_category tr:hover td a {
    color: var(--accent-color) !important;
}

/* Date */
.another_category td.date {
    font-size: 0.85rem !important;
    color: #71717a !important;
    /* text-zinc-500 */
    min-width: 80px;
    text-align: right;
}

/* -------------------------------------------------------------------------- */
/*                          Link Embed (OpenGraph) Styling                    */
/* -------------------------------------------------------------------------- */
figure[data-ke-type="opengraph"] {
    margin: 2rem 0;
    width: 100%;
}

figure[data-ke-type="opengraph"] a {
    display: flex !important;
    min-height: 140px !important;
    height: auto !important;
    border: 1px solid var(--border-subtle) !important;
    /* 선 얇게 */
    border-radius: 12px !important;
    background-color: transparent !important;
    /* 배경 날리고 보더리스화 */
    text-decoration: none !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    /* 그림자 삭제로 깔끔함 유지 */
}

figure[data-ke-type="opengraph"] a:hover {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-medium) !important;
    transform: translateY(-2px);
}

/* Image Section */
figure[data-ke-type="opengraph"] .og-image {
    width: 25% !important;
    min-width: 140px !important;
    max-width: 200px !important;
    height: 100% !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background-size: cover !important;
    background-position: center !important;
    position: relative;
    overflow: hidden;
}

/* Subtle overlay on image */
figure[data-ke-type="opengraph"] .og-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
}

/* Text Container */
figure[data-ke-type="opengraph"] .og-text {
    flex: 1 !important;
    padding: 1.25rem 1.5rem !important;
    /* Reverted padding */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    background: transparent !important;
    height: 100% !important;
    /* Ensure full height for margin-top: auto to work */
}

/* Title */
figure[data-ke-type="opengraph"] .og-title {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #f4f4f5 !important;
    /* zinc-100 */
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;

    /* Ellipsis */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* Description */
figure[data-ke-type="opengraph"] .og-desc {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 0.875rem !important;
    /* 14px */
    color: #a1a1aa !important;
    /* zinc-400 */
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
    /* Removed auto margin from desc */

    /* Multi-line ellipsis (2 lines) */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: keep-all !important;
    /* Prevent mid-word breaks for Korean */
}

/* Host/URL */
figure[data-ke-type="opengraph"] .og-host {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.75rem !important;
    color: var(--text-tertiary) !important;
    margin-top: 0 !important;
    position: absolute !important;
    bottom: -17px !important;
    left: 1.5rem !important;
    width: calc(100% - 3rem) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

figure[data-ke-type="opengraph"] .og-host::before {
    content: '\f0c1';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--accent-color);
    opacity: 0.7;
}

/* Mobile Adjustments */
/* Mobile Adjustments (Link Embed Card Style) */
@media (max-width: 1024px) {

    /* 0. Parent Figure: Flush Left Reset */
    html body figure[data-ke-type="opengraph"] {
        margin: 20px 0 !important;
        /* Mobile Vertical Spacing */
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 1. Container: Horizontal Flex Layout */
    html body figure[data-ke-type="opengraph"] a {
        display: flex !important;
        flex-direction: row !important;
        height: 80px !important;
        min-height: 80px !important;
        margin: 0 !important;
        padding: 0 !important;
        text-decoration: none !important;
        background: transparent !important;
        border: 1px solid var(--border-subtle) !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    /* 2. Image: Thumbnail Style (Left) */
    html body figure[data-ke-type="opengraph"] .og-image {
        display: block !important;
        width: 85px !important;
        /* Larger Thumbnail */
        min-width: 85px !important;
        height: 100% !important;
        margin: 0 !important;
        border: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding: 0 !important;
        object-fit: cover !important;
    }

    /* 3. Text Container: Flex Grow (Right) */
    html body figure[data-ke-type="opengraph"] .og-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex: 1 !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 1rem !important;
        /* Side Padding */
        text-align: left !important;
        background: transparent !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    /* 4. Title */
    html body figure[data-ke-type="opengraph"] .og-title {
        display: -webkit-box !important;
        /* Required for line-clamp */
        -webkit-box-orient: vertical !important;
        /* Required for line-clamp */
        font-size: 0.75rem !important;
        /* Compact Title */
        line-height: 1.35 !important;
        margin-bottom: 0.25rem !important;
        white-space: normal !important;
        word-break: break-all !important;
        color: #f4f4f5 !important;
        opacity: 1 !important;
        -webkit-line-clamp: 2 !important;
        /* Limit lines */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* 5. Description: Hidden */
    html body figure[data-ke-type="opengraph"] .og-desc {
        display: none !important;
    }

    /* 6. Host / URL */
    html body figure[data-ke-type="opengraph"] .og-host {
        display: block !important;
        position: static !important;
        margin: 0 !important;
        font-size: 0.7rem !important;
        /* Smaller Host */
        color: #a1a1aa !important;
        opacity: 0.8 !important;
    }
}

/* -------------------------------------------------------------------------- */
/*                        Refined Comment Form Styling                        */
/* -------------------------------------------------------------------------- */

/* 1. Comment Form Container */
.comment-form-box {
    background: transparent !important;
    /* 그라데이션 제거, 백그라운드와 통일하여 가볍게 */
    border: 1px solid var(--border-subtle) !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .comment-form-box {
        background: transparent !important;
        border-radius: 0;
        border-left: none !important;
        border-right: none !important;
    }
}

/* 2. Textarea Styling */
.comment-form-box textarea {
    background-color: var(--bg-surface) !important;
    border: none !important;
    /* 박스선 보이지 않도록 깔끔하게 */
    border-radius: 8px !important;
    padding: 1rem !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
    height: 100px !important;
}

.comment-form-box textarea::placeholder {
    color: var(--text-tertiary) !important;
    font-weight: 400;
}

.comment-form-box textarea:focus {
    background-color: var(--bg-body) !important;
    box-shadow: inset 0 0 0 1px var(--accent-color) !important;
    /* 보더 대신 내부 링으로 깔끔한 포커스 효과 */
}

/* 3. Submit Button Styling */
.comment-form-box button {
    background: transparent !important;
    color: var(--accent-color) !important;
    /* 플랫 디자인: 바탕색 없이 텍스트 포인트 */
    font-weight: 600 !important;
    border: 1px solid var(--border-medium) !important;
    padding: 0.5rem 1.75rem !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    cursor: pointer;
}

.comment-form-box button:hover {
    background: var(--bg-surface-hover) !important;
    border-color: var(--accent-color) !important;
    transform: none;
    box-shadow: none;
}

.comment-form-box button:active {
    transform: scale(0.98);
}

/* 4. Guest Input Fields - Completely Hidden (Logged-in only) */
.comment-form-box input[type="text"],
.comment-form-box input[type="password"] {
    display: none !important;
}

/* 5. Secret Checkbox Styling */
.comment-form-box label {
    margin-right: 1.5rem !important;
    /* More spacing after checkbox */
    display: flex !important;
    align-items: center !important;
}

.comment-form-box label span {
    font-size: 0.9rem !important;
    color: #a1a1aa !important;
    /* zinc-400 */
    font-weight: 500;
}

.comment-form-box label:hover span {
    color: var(--accent-color) !important;
}

.comment-form-box input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.1rem !important;
    height: 1.1rem !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
    margin-right: 8px !important;
}

.comment-form-box input[type="checkbox"]:checked {
    background-color: transparent !important;
    /* 체크박스 배경색 제거, 테두리 포인트 */
    border-color: var(--accent-color) !important;
}

.comment-form-box input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: var(--accent-color);
    /* 엑센트 아이콘 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.comment-form-box input[type="checkbox"]:hover {
    border-color: var(--accent-color) !important;
}

/* -------------------------------------------------------------------------- */
/*                          Blockquote / Quote Styling                        */
/* -------------------------------------------------------------------------- */

/* Common Blockquote Reset */
.prose blockquote,
.tt_article_useless_p_margin blockquote {
    margin: 2rem 0 !important;
    padding: 1.5rem 2rem !important;
    word-break: break-all;
    color: #e4e4e7 !important;
    /* zinc-200 */
}

.prose blockquote p,
.tt_article_useless_p_margin blockquote p {
    margin: 0 !important;
    line-height: 1.7 !important;
}

/* Remove Automatic Quotes (Tailwind Typography Reset) */
.prose blockquote p:first-of-type::before,
.prose blockquote p:last-of-type::after,
.tt_article_useless_p_margin blockquote p:first-of-type::before,
.tt_article_useless_p_margin blockquote p:last-of-type::after {
    content: none !important;
}

/* Style 1: Centered Quote (인용1) - Editor Style Adapted */
.prose blockquote[data-ke-style="style1"],
.tt_article_useless_p_margin blockquote[data-ke-style="style1"] {
    position: relative !important;
    text-align: center !important;
    background: transparent !important;
    /* No box, like editor */
    border: none !important;
    padding-top: 4rem !important;
    padding-bottom: 2rem !important;
    font-size: 1.15rem !important;
    font-weight: 500 !important;
    color: #f4f4f5 !important;
    /* Brighter text for focus */
}

/* Style 1 Icon (Replaces default BG image for better dark mode control) */
.prose blockquote[data-ke-style="style1"]::before,
.tt_article_useless_p_margin blockquote[data-ke-style="style1"]::before {
    content: '\f10d';
    /* FontAwesome Quote Left */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2.5rem;
    color: #71717a;
    /* zinc-500 (Gray like editor) */
    opacity: 0.5;
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
}

/* Style 2: Left Line (인용2) */
.prose blockquote[data-ke-style="style2"],
.tt_article_useless_p_margin blockquote[data-ke-style="style2"] {
    border-left: 3px solid var(--accent-color) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    background: transparent !important;
    /* 배경 날려서 본문과 녹아들게 */
    padding-left: 1.25rem !important;
    /* 약간의 들여쓰기만 유지 */
    border-radius: 0 !important;
}

/* Style 3: Box (인용3) */
.prose blockquote[data-ke-style="style3"],
.tt_article_useless_p_margin blockquote[data-ke-style="style3"] {
    border: 1px solid var(--border-subtle) !important;
    background: transparent !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

/* Fallback / Default Blockquote Styling */
.prose blockquote:not([data-ke-style]),
.tt_article_useless_p_margin blockquote:not([data-ke-style]) {
    border-left: 4px solid #71717a !important;
    /* Neutral for user blocks */
    background: rgba(255, 255, 255, 0.02) !important;
}

/* -------------------------------------------------------------------------- */
/*                          Content Link Styling                              */
/* -------------------------------------------------------------------------- */
.tt_article_useless_p_margin a,
.prose a {
    color: var(--accent-color) !important;
    text-decoration: none !important;
    border-bottom: 1px dashed var(--border-medium);
    /* 실선에서 점선으로 더 가볍게 */
    transition: all 0.2s ease;
}

.tt_article_useless_p_margin a:hover,
.prose a:hover {
    color: var(--accent-color-hover) !important;
    border-bottom: 1px solid var(--accent-color);
    background: transparent;
}

/* -------------------------------------------------------------------------- */
/*                        Post Navigation (Prev/Next)                         */
/* -------------------------------------------------------------------------- */
.nav-card {
    position: relative;
    background-color: transparent !important;
    /* 카드 배경 제거 */
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none !important;
    box-shadow: none !important;
}

.nav-card:hover {
    border-color: var(--border-medium) !important;
    background-color: var(--bg-surface) !important;
    /* 약간 떠오르는 느낌만 */
    transform: none;
}

/* Gradient Overlay - 완전히 날려서 깔끔하게 */
.nav-card .hover-gradient {
    display: none !important;
}

/* Content Layer */
.nav-card .relative {
    position: relative;
    z-index: 10;
}

/* Icon Circle */
.nav-card .icon-circle {
    display: none !important;
    /* 네비 카드 아이콘 원 제거 */
}

/* Text Styles */
.nav-card h4 {
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
    margin-top: 0.5rem !important;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-card:hover h4 {
    color: var(--accent-color) !important;
}

.nav-card .label {
    font-size: 0.75rem;
    font-weight: 500;
    /* 조금 덜 강하게 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.nav-card:hover .label {
    color: var(--text-secondary);
}

/* Custom Tag Styling - Subtle/Text Only */
.tag-container a {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 0.5rem 0 0 !important;

    color: var(--text-tertiary) !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    font-family: monospace, ui-monospace, SFMono-Regular !important;
    text-decoration: none !important;

    transition: color 0.2s ease !important;
    display: inline-block !important;
}

.tag-container a:hover {
    color: var(--accent-color) !important;
    background: transparent !important;
    text-decoration: none !important;
}

/* Optional: Add hash if missing (Visual flair) */
.tag-container a::before {
    /* ... previous content ... */
    content: "#";
    margin-right: 1px;
    opacity: 0.5;
}

/* =========================================
   7. Content Typography System (Theme Match)
   ========================================= */

/* Main Content Wrapper */
.tt_article_useless_p_margin,
.prose {
    color: var(--text-primary);
    line-height: 1.8;
}

/* Title 1 (H2) */
.tt_article_useless_p_margin h2,
.prose h2 {
    font-size: 1.6rem !important;
    /* 조금 더 담백한 크기 */
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-top: 3.5rem !important;
    margin-bottom: 1.25rem !important;
    letter-spacing: -0.01em !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    /* 밑줄을 은은하게 추가하여 구분 */
    padding-bottom: 0.5rem !important;
}

/* Title 2 (H3) */
.tt_article_useless_p_margin h3,
.prose h3 {
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.5 !important;
}

/* Title 3 (H4) */
.tt_article_useless_p_margin h4,
.prose h4 {
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.5 !important;
}

/* Body Text (P) - Default Paragraph */
.tt_article_useless_p_margin p,
.prose p {
    font-size: 1.0625rem !important;
    /* 17px - optimal reading size */
    color: #d4d4d8 !important;
    /* zinc-300 */
    margin-bottom: 1.5rem !important;
    line-height: 1.8 !important;
    /* Relaxed reading */
    word-break: break-all;
}

/* List Styling */
.tt_article_useless_p_margin ul,
.tt_article_useless_p_margin ol {
    margin-bottom: 1.5rem !important;
    padding-left: 1.5rem !important;
    color: #d4d4d8 !important;
}

.tt_article_useless_p_margin li {
    margin-bottom: 0.5rem !important;
    line-height: 1.7 !important;
}

.tt_article_useless_p_margin ul {
    list-style-type: disc !important;
}

/* ... previous content ... */
.tt_article_useless_p_margin ol {
    list-style-type: decimal !important;
}

/* =========================================
   8. Horizontal Rule (Divider) System
   ========================================= */
.tt_article_useless_p_margin hr,
.prose hr {
    display: block;
    border: 0;
    margin: 3rem auto !important;
    opacity: 1 !important;
}

/* Style 1: Dots (· · ·) */
.tt_article_useless_p_margin hr[data-ke-style="style1"],
.prose hr[data-ke-style="style1"] {
    background: transparent !important;
    height: 30px !important;
    width: 100% !important;
    position: relative;
}

.tt_article_useless_p_margin hr[data-ke-style="style1"]::after,
.prose hr[data-ke-style="style1"]::after {
    content: "· · ·";
    font-size: 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-tertiary);
    letter-spacing: 8px;
    text-indent: 8px !important;
}

/* Style 2: Thick Short Line (-) */
.tt_article_useless_p_margin hr[data-ke-style="style2"],
.prose hr[data-ke-style="style2"] {
    height: 3px !important;
    width: 50px !important;
    background-color: #a1a1aa !important;
    /* zinc-400 */
    border-radius: 99px;
}

/* Style 3: Zigzag (~) - Brighter & Clean SVG */
.tt_article_useless_p_margin hr[data-ke-style="style3"],
.prose hr[data-ke-style="style3"] {
    height: 15px !important;
    width: 110px !important;
    background-color: transparent !important;
    /* Stroke brighten to #e4e4e7 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M0 5L6 1L12 5' fill='none' stroke='%23e4e4e7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: repeat-x !important;
    background-size: 12px 6px !important;
    background-position: center !important;
    border: none !important;
    opacity: 1 !important;
}

/* Reset previous pseudo-element styling if any exists */
.tt_article_useless_p_margin hr[data-ke-style="style3"]::after,
.prose hr[data-ke-style="style3"]::after {
    display: none !important;
}

/* Style 4: Vertical Line (|) */
.tt_article_useless_p_margin hr[data-ke-style="style4"],
.prose hr[data-ke-style="style4"] {
    width: 2px !important;
    height: 50px !important;
    background-color: #a1a1aa !important;
    /* zinc-400 */
}

/* Style 5: Full Solid Line (─) */
.tt_article_useless_p_margin hr[data-ke-style="style5"],
.prose hr[data-ke-style="style5"] {
    height: 1px !important;
    width: 100% !important;
    background-color: #52525b !important;
    /* zinc-600 */
}

/* Style 6: Double Line (=) */
.tt_article_useless_p_margin hr[data-ke-style="style6"],
.prose hr[data-ke-style="style6"] {
    height: 6px !important;
    width: 100% !important;
    border-top: 1px solid #52525b !important;
    border-bottom: 1px solid #52525b !important;
    background: transparent !important;
}

/* Style 7: Diamond (-◇-) - Gradient Approach (Clean) */
.tt_article_useless_p_margin hr[data-ke-style="style7"],
.prose hr[data-ke-style="style7"] {
    border: none !important;
    height: 20px !important;
    width: 100% !important;
    position: relative;
    /* Gradient line with gap */
    background: linear-gradient(to right, #52525b 0%, #52525b 45%, transparent 45%, transparent 55%, #52525b 55%, #52525b 100%) !important;
    background-size: 100% 1px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.tt_article_useless_p_margin hr[data-ke-style="style7"]::after,
.prose hr[data-ke-style="style7"]::after {
    content: "◇";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent !important;
    color: #e4e4e7 !important;
    /* zinc-200 (Bright) */
    font-size: 16px;
    line-height: normal;
}

/* Style 8: Circle (-○-) - Gradient Approach (Clean) */
.tt_article_useless_p_margin hr[data-ke-style="style8"],
.prose hr[data-ke-style="style8"] {
    border: none !important;
    height: 20px !important;
    width: 100% !important;
    position: relative;
    /* Gradient line with gap */
    background: linear-gradient(to right, #52525b 0%, #52525b 45%, transparent 45%, transparent 55%, #52525b 55%, #52525b 100%) !important;
    background-size: 100% 1px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.tt_article_useless_p_margin hr[data-ke-style="style8"]::after,
.prose hr[data-ke-style="style8"]::after {
    content: "○";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent !important;
    color: #e4e4e7 !important;
    /* zinc-200 (Bright) */
    font-size: 16px;
    line-height: normal;
}

/* Custom Line Clamp for Dynamic Summaries */
.line-clamp-6 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

/* Guestbook Reply Fix */
#guestbook-list ul li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

#guestbook-list ul li .group\/reply {
    background: transparent !important;
}

/* Guestbook Reply Description Force */
.reply-desc {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #e4e4e7 !important;
    /* Zinc-200 */
    min-height: 20px;
    height: auto !important;
}

.reply-desc * {
    color: #e4e4e7 !important;
}

/* Guestbook Reply Meta Force */
.guest-reply-name {
    display: inline-block !important;
    color: #e4e4e7 !important;
    /* Zinc-200 */
    opacity: 1 !important;
    visibility: visible !important;
}

.guest-reply-date {
    display: inline-block !important;
    color: #71717a !important;
    /* Zinc-500 */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Styling Tistory 'Load More Comments' Button */
.tt_more_preview_comments_wrap {
    background-color: transparent !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    margin: 20px auto !important;
    width: fit-content !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}

.tt_more_preview_comments_wrap:hover {
    background-color: var(--bg-surface) !important;
}

.tt_more_preview_comments_text {
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.tt_more_preview_comments_wrap:hover .tt_more_preview_comments_text {
    color: var(--text-primary) !important;
}

/* -------------------------------------------------------------------------- */
/* TISTORY SYSTEM OVERRIDES (Anti-Wobble / CLS Fix) */
/* -------------------------------------------------------------------------- */

/* Hide Tistory Toolbar completely to prevent top-shift on load */
#tistorytoolbarid,
.tt_menubar,
.tt-menubar {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}

/* Ensure body doesn't possess padding from Tistory scripts */
body,
html {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Fix for potential margin collapse on Home Page */
#main-layout {
    padding-top: 3rem !important;
    /* Ensure consistent spacing */
}

/* -------------------------------------------------------------------------- */
/* ANTI-FLICKER / CLOAK STYLES (Fixes Scroll Shift) */
/* -------------------------------------------------------------------------- */
.cloak-until-loaded {
    /* Use visibility:hidden to PRESERVE SPACE during load */
    /* Do NOT use display:none, causing CLS/Wobble */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.cloak-until-loaded.loaded {
    visibility: visible;
    opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* MOBILE OPTIMIZATION: Separators & Blockquotes */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {

    /* Blockquote Adjustments */
    .prose blockquote,
    .tt_article_useless_p_margin blockquote {
        margin: 1.5rem 0 !important;
        padding: 1.25rem 1rem !important;
    }

    /* Style 1: Centered Quote (Icon) */
    .prose blockquote[data-ke-style="style1"] .tt_article_useless_p_margin blockquote[data-ke-style="style1"] {
        padding-top: 3rem !important;
        font-size: 1rem !important;
    }

    /* Style 1 Icon Resize */
    .prose blockquote[data-ke-style="style1"]::before,
    .tt_article_useless_p_margin blockquote[data-ke-style="style1"]::before {
        font-size: 1.75rem !important;
        top: 0.25rem !important;
    }

    /* Horizontal Rule (HR) Adjustments */
    .tt_article_useless_p_margin hr,
    .prose hr {
        margin: 2.5rem auto !important;
    }

    /* Style 1: Dots */
    .tt_article_useless_p_margin hr[data-ke-style="style1"]::after,
    .prose hr[data-ke-style="style1"]::after {
        font-size: 28px !important;
        font-size: 28px !important;
        letter-spacing: 8px !important;
        text-indent: 8px !important;
        /* Perfect center alignment */
        margin-right: 0 !important;
    }

    /* Style 3: Zigzag */
    .tt_article_useless_p_margin hr[data-ke-style="style3"],
    .prose hr[data-ke-style="style3"] {
        width: 80px !important;
        height: 12px !important;
        background-size: 10px 5px !important;
    }

    /* Style 4: Vertical Line */
    .tt_article_useless_p_margin hr[data-ke-style="style4"],
    .prose hr[data-ke-style="style4"] {
        height: 24px !important;
    }
}
.index-card .thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s ease !important;
    border-radius: 0 !important;
    margin: 0 !important;
    z-index: 2;
}

.index-card:hover .thumb-img {
    transform: scale(1.05);
}

/* 대표 이미지가 있을 때는 fallback을 덮도록 z-index 처리 */
.index-card .thumb-fallback {
    z-index: 1;
}

/* 제목 2줄 말줄임 */
.index-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em; /* 2줄 공간 확보로 카드 높이 일관성 */
}

/* 기존 .item-summary 관련 line-clamp 규칙이 충돌하지 않도록 무력화 (안전장치) */
.index-card .item-summary {
    display: none !important;
}
/* 11. Prev/Next Post Empty State Fallbacks */
#prev-post-container:empty,
#next-post-container:empty,
#prev-post-container.empty-nav,
#next-post-container.empty-nav {
    visibility: hidden;
    pointer-events: none;
}