/* Wave Banner Animation */
@keyframes wave {
    0% { background-position-x: 1000px; }
    100% { background-position-x: 0; }
}
@keyframes wave2 {
    0% { background-position-x: 0px; }
    100% { background-position-x: 1000px; }
}
@keyframes tail {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}
.post-banner {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--gradient-night-sky);
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Night sky banners - uses .star-bg from base.css */
.post-banner.island-banner,
.post-banner.cat-banner {
    background: var(--gradient-night-sky);
}

/* Stars for island banner - extends star-bg with custom bottom offset */
.post-banner.island-banner::before {
    bottom: 60px;
}


.post-banner .wave {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: url('/static/img/wave.png');
    background-size: 1000px 80px;
    background-repeat: repeat-x;
}

.post-banner .wave-1 { opacity: 1; animation: wave 4s linear infinite; z-index: 13; }
.post-banner .wave-2 { opacity: 0.5; animation: wave2 4s linear infinite; z-index: 12; }
.post-banner .wave-3 { opacity: 0.2; animation: wave2 3s linear infinite; z-index: 11; }
.post-banner .wave-4 { opacity: 0.7; animation: wave 4s linear infinite; z-index: 10; }

.post-banner .island {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 170px;
    z-index: 9;
}

/* Moon and Rocket Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes fireflyFloat {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    25% { transform: translate(15px, -20px); opacity: 1; }
    50% { transform: translate(-10px, -10px); opacity: 0.6; }
    75% { transform: translate(20px, 5px); opacity: 1; }
}

@keyframes fireflyGlow {
    0%, 100% { box-shadow: 0 0 5px #ffeb3b, 0 0 10px #ffeb3b; }
    50% { box-shadow: 0 0 15px #ffeb3b, 0 0 25px #ffeb3b, 0 0 35px rgba(255, 235, 59, 0.5); }
}

@keyframes cloudFloat {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50px); }
}

/* Moon */
.night-scene .moon {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f5f5dc 0%, #ffd700 100%);
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.2),
        inset -8px -5px 0 rgba(0,0,0,0.05);
    top: 25px;
    right: 80px;
    z-index: 5;
    animation: float 4s ease-in-out infinite;
}

/* Moon craters */
.night-scene .moon::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: var(--radius-full);
    top: 15px;
    left: 12px;
}

.night-scene .moon::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(0,0,0,0.05);
    border-radius: var(--radius-full);
    top: 30px;
    right: 15px;
}

/* Clouds */
.night-scene .cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    animation: cloudFloat 8s ease-in-out infinite alternate;
}

.night-scene .cloud-1 {
    width: 100px;
    height: 30px;
    bottom: 50px;
    left: 60px;
}

.night-scene .cloud-1::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    top: -20px;
    left: 15px;
}

.night-scene .cloud-1::after {
    content: '';
    position: absolute;
    width: 35px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    top: -15px;
    left: 50px;
}

.night-scene .cloud-2 {
    width: 80px;
    height: 25px;
    bottom: 80px;
    right: 200px;
    animation-delay: -3s;
}

.night-scene .cloud-2::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 35px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    top: -18px;
    left: 20px;
}

/* Fireflies */
.night-scene .firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffeb3b;
    border-radius: var(--radius-full);
    z-index: 10;
    animation: fireflyFloat 6s ease-in-out infinite, fireflyGlow 2s ease-in-out infinite;
}

.night-scene .firefly-1 {
    top: 50px;
    left: 150px;
    animation-delay: 0s;
}

.night-scene .firefly-2 {
    top: 80px;
    left: 300px;
    animation-delay: -1s;
    width: 5px;
    height: 5px;
}

.night-scene .firefly-3 {
    top: 120px;
    left: 200px;
    animation-delay: -2s;
}

.night-scene .firefly-4 {
    top: 60px;
    left: 450px;
    animation-delay: -3s;
    width: 4px;
    height: 4px;
}

.night-scene .firefly-5 {
    top: 100px;
    left: 550px;
    animation-delay: -4s;
}

.night-scene .firefly-6 {
    top: 140px;
    left: 400px;
    animation-delay: -2.5s;
    width: 5px;
    height: 5px;
}

.night-scene .firefly-7 {
    top: 70px;
    left: 650px;
    animation-delay: -1.5s;
    width: 4px;
    height: 4px;
}

/* Post Container Layout */
.post-container {
    display: flex;
    gap: 2.5rem;
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.sidebar {
    width: 265px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 2rem;
    height: fit-content;
    align-self: flex-start;
}

/* Post page sidebar styles (scoped to avoid edit page conflicts) */
.post-container .sidebar-section {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.post-container .sidebar-section .sidebar-title {
    flex-shrink: 0;
}

.post-container .section-scroll {
    overflow-y: auto;
    flex: 1;
}

.post-container .category-section {
    max-height: 47vh;
}

.post-container .category-section .section-scroll {
    max-height: calc(47vh - 3rem);
}

.post-container .category-section .category-item {
    margin: 0.15rem 0;
}

.post-container .category-section.category-full {
    max-height: none;
    overflow-y: visible;
    padding: 0;
}

/* Post 목록 페이지에서 사이드바 높이 제한 해제 */
.post-container .sidebar:has(.category-full) {
    max-height: none;
    position: static;
    height: auto;
}

.post-container .sidebar:has(.category-full) .sidebar-section {
    max-height: none;
}

.toc-section {
    max-height: 50vh;
    padding: 0;
}

.toc-section .section-scroll {
    max-height: calc(50vh - 3rem);
}

/* Custom Scrollbar */
.section-scroll::-webkit-scrollbar {
    width: 5px;
}

.section-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.section-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary-alpha-30);
    border-radius: var(--radius-xl);
}

.section-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-alpha-50);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--color-primary);
    border-radius: var(--radius-xs);
}

/* Category Navigation */
.category-nav {
    display: flex;
    flex-direction: column;
}

.category-item {
    display: block;
}

.category-item.collapsed > .subcategories {
    display: none !important;
}

.category-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    cursor: pointer;
    color: var(--color-gray-600);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.category-toggle svg {
    width: 16px;
    height: 16px;
}

.category-item.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.category-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.5rem;
    color: var(--color-gray-900);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.category-link.level-1 {
    margin-top: 0.25rem;
}

.category-item:first-child > .category-link.level-1 {
    margin-top: 0;
}

.category-link:hover {
    background: var(--color-bg-hover);
    color: var(--color-primary);
}

.category-link.active,
.category-item.active > .category-link {
    background: var(--color-bg-active);
    color: var(--color-primary);
    font-weight: 600;
}

.category-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-hover);
    border-radius: var(--radius-md);
    padding: 4px;
}

.category-icon svg {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

.category-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.category-icon-img.sub {
    width: 18px;
    height: 18px;
}

.category-icon-img.subsub {
    width: 14px;
    height: 14px;
}

.sub-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-icon svg {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
    opacity: 0.7;
}

.category-link.level-2 {
    padding-left: 0.5rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-link.level-2 .post-count {
    margin-left: auto;
}

.category-link.level-3 {
    padding-left: 0.5rem;
    font-size: 0.88rem;
    color: var(--color-text);
    font-weight: 400;
}

.post-count {
    font-size: 0.8em;
    color: var(--color-gray-800);
    font-weight: 400;
}

.category-nav .subcategories {
    display: block !important;
    margin-left: 0.6rem !important;
    padding-left: 0.6rem !important;
    border-left: 2px solid var(--color-primary-alpha-20) !important;
    margin-top: 0.1rem;
}

.category-link.level-2:hover .sub-icon svg,
.category-link.level-2.active .sub-icon svg,
.category-item.active > .category-link.level-2 .sub-icon svg {
    opacity: 1;
}

/* TOC Section */
.toc {
    font-size: 0.85rem;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc ul ul {
    padding-left: 0.6rem;
    border-left: 2px solid var(--color-gray-500);
    margin-left: 0.3rem;
}

.toc ul ul a {
    font-size: 0.82rem;
    padding-left: 0.4rem;
}

.toc ul ul ul a {
    font-size: 0.78rem;
}

.toc li {
    margin: 0.1rem 0;
}

.toc a {
    color: var(--color-gray-900);
    text-decoration: none;
    display: block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-weight: 500;
}

.toc a:hover {
    color: var(--color-primary);
    background: var(--color-bg-hover);
}

.toc a.active {
    color: var(--color-primary);
    background: var(--color-bg-active);
    font-weight: 600;
}

/* Post Content Area */
.post-content {
    flex: 1;
    min-width: 0;
}

/* IMAGE Placeholder */
.post-body .image-placeholder {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--color-warning-bg);
    border: 2px dashed var(--color-warning-dark);
    border-radius: var(--radius-lg);
}
.post-body .image-placeholder .placeholder-icon {
    font-size: 1.5rem;
    float: left;
    margin-right: 0.75rem;
}
.post-body .image-placeholder .placeholder-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-warning-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.post-body .image-placeholder .placeholder-prompt {
    font-size: 0.85rem;
    color: var(--color-gray-800);
    line-height: 1.5;
}
.post-body .image-placeholder .placeholder-location {
    font-size: 0.8rem;
    color: var(--color-gray-600);
    margin-top: 0.5rem;
}

/* Top Categories (main page) */
.top-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.top-category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--gradient-light-bg);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-2xl);
    text-decoration: none;
    color: var(--color-gray-900);
    transition: var(--transition-fast);
    flex: 1;
    min-width: 220px;
    position: relative;
    overflow: hidden;
}

/* Background icon (legacy) */
.top-category-bg-icon {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.06;
    pointer-events: none;
}

.top-category-bg-icon svg {
    width: 80px;
    height: 80px;
    color: var(--color-primary);
}

/* Background image */
.top-category-bg-img {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    object-fit: contain;
    opacity: 0.1;
    pointer-events: none;
}

/* Icon image */
.top-category-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.top-category-card:hover {
    border-color: var(--color-primary-alpha-30);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.top-category-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    position: relative;
    z-index: 1;
}

.top-category-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.top-category-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-gray-600);
}

.top-category-desc {
    font-size: 0.85rem;
    color: var(--color-gray-700);
    line-height: 1.4;
}

/* Dark mode - Top category card */
body.dark-mode .top-category-card {
    background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
    border-color: var(--color-gray-300);
}

body.dark-mode .top-category-bg-icon {
    opacity: 0.08;
}

body.dark-mode .top-category-card:hover {
    border-color: var(--color-primary-alpha-40);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .top-category-name {
    color: var(--color-gray-200);
}

body.dark-mode .top-category-desc {
    color: var(--color-gray-600);
}

/* Category Overview (Main Page) */
.category-overview-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

.category-overview {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-overview-bg {
    position: absolute;
    right: -20px;
    top: 0;
    width: 200px;
    height: 200px;
    object-fit: contain;
    opacity: 0.12;
    pointer-events: none;
    filter: blur(1px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
}

.category-header:hover .category-header-title {
    color: var(--color-primary);
}

.category-header-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.category-header-title {
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.category-header-count {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.category-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    z-index: 1;
}

.subcategory-list {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subcategory-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: background 0.2s;
}

.subcategory-item:hover {
    background: var(--color-bg-secondary);
}

.subcategory-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.subcategory-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.category-posts {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 0.8rem;
    min-width: 0;
}

.category-post-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: background 0.2s;
    min-width: 0;
    position: relative;
    z-index: 1;
}

body.dark-mode .category-post-card {
    background: var(--color-bg-secondary);
}

.category-post-card:hover {
    background: var(--color-bg-secondary);
}

.category-post-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.3rem;
    background: var(--color-bg-tertiary);
}

.category-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-post-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.category-post-title {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.25;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-post-summary {
    font-size: 0.7rem;
    color: var(--color-muted);
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-post-meta {
    font-size: 0.65rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.category-post-meta .sep {
    opacity: 0.5;
}

.category-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.category-post-tags .card-tag {
    font-size: 0.6rem;
    padding: 0.05rem 0.3rem;
}

.category-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--color-muted);
    transition: var(--transition-fast);
}

.category-more:hover {
    color: var(--color-primary);
}

.category-more svg {
    width: 24px;
    height: 24px;
}

/* Subcategory Row Layout (A + Posts horizontal) */
.subcategory-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1rem;
    height: 290px;
}

.subcategory-row:last-child {
    margin-bottom: 0;
}

@keyframes subcategoryFlow {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

.subcategory-item-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100px;
    min-height: 120px;
    padding: 0.8rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--radius-lg);
    transition: transform 0.2s;
    flex-shrink: 0;
    --sub-c1: 200,200,200;
    --sub-c2: 180,180,180;
    --sub-c3: 160,160,160;
}

.subcategory-item-vertical.has-gradient {
    background: linear-gradient(
        135deg,
        rgba(var(--sub-c1), 0.2) 0%,
        rgba(var(--sub-c2), 0.1) 25%,
        rgba(var(--sub-c3), 0.15) 50%,
        rgba(var(--sub-c2), 0.1) 75%,
        rgba(var(--sub-c1), 0.2) 100%
    );
    background-size: 200% 200%;
    animation: subcategoryFlow 15s ease-in-out infinite;
}

.subcategory-item-vertical:hover {
    transform: translateY(-2px);
}

.subcategory-icon-lg {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.subcategory-item-vertical .subcategory-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.subcategory-posts {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 0.5rem;
    min-width: 0;
}

.subcategory-posts .home-card {
    flex-direction: row;
    align-items: stretch;
}

.subcategory-posts .home-card-thumb {
    width: 120px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
}

.subcategory-posts .home-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcategory-posts .home-card-body {
    padding: 0.5rem 0.8rem;
    justify-content: center;
}

.subcategory-posts .home-card-title {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    margin-bottom: 0.15rem;
}

.subcategory-posts .home-card-summary {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
}

.subcategory-posts .home-card-meta {
    margin-top: 0.2rem;
}

.subcategory-posts .home-card-footer {
    font-size: 0.65rem;
}

.subcategory-posts .home-card-tags {
    margin-top: 0.2rem;
}

.subcategory-posts .home-card-tags .card-tag {
    font-size: 0.6rem;
    padding: 0 0.25rem;
}


/* Dark mode */
body.dark-mode .subcategory-item-vertical.has-gradient {
    background: linear-gradient(
        135deg,
        rgba(var(--sub-c1), 0.25) 0%,
        rgba(var(--sub-c2), 0.15) 25%,
        rgba(var(--sub-c3), 0.2) 50%,
        rgba(var(--sub-c2), 0.15) 75%,
        rgba(var(--sub-c1), 0.25) 100%
    );
    background-size: 200% 200%;
}



/* Responsive */
@media (max-width: 900px) {
    .subcategory-row {
        flex-direction: column;
        gap: 0.5rem;
        height: auto;
    }

    .subcategory-item-vertical {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.5rem 1rem;
    }

    .subcategory-icon-lg {
        width: 36px;
        height: 36px;
    }

    .subcategory-posts .home-card {
        flex: 0 0 180px;
        min-width: 180px;
    }
}

/* Dark mode for category overview */
body.dark-mode .category-overview-bg {
    opacity: 0.15;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    background: transparent;
    padding: 0.5rem 0;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.breadcrumb-sep {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

/* Breadcrumb inside banner */
.post-banner .breadcrumb {
    position: absolute;
    top: 12px;
    left: 15px;
    z-index: 20;
    margin: 0;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}

/* Page Title */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    position: relative;
    padding-bottom: 0.7rem;
}

.page-title::after {
    display: none;
}

/* Subcategory Grid (for parent category pages) */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.subcategory-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.2rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-gray-900);
    transition: var(--transition-fast);
    border-left: 3px solid var(--color-primary);
}

.subcategory-card:hover {
    background: var(--color-gray-50);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-primary-alpha-10);
}

.subcategory-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subcategory-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-gray-900);
}

.subcategory-count {
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-xl);
    font-weight: 500;
}

.subcategory-desc {
    font-size: 0.85rem;
    color: var(--color-gray-700);
    margin: 0;
    line-height: 1.4;
}

/* Category Grid (legacy) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--color-gray-900);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px var(--color-primary-alpha-12);
    transform: translateY(-2px);
}

.category-card:hover::before {
    transform: scaleY(1);
}

.category-card-name {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-gray-900);
}

.category-card-count {
    font-size: 0.85rem;
    color: var(--color-gray-800);
}

/* Page Title Row */
.page-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.page-title-row .page-title {
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-list-intro {
    margin: 1rem 0 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-secondary);
    border-left: 3px solid var(--color-accent);
    border-radius: 4px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.post-list-intro p {
    margin: 0;
}

.post-list-intro strong {
    color: var(--color-text);
}

.category-title-icon {
    height: 1.8em;
    width: auto;
    vertical-align: bottom;
    margin-right: 0.4em;
    padding: 0.2em;
    background: var(--color-surface);
    border-radius: var(--radius-full);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Post Filter */
.post-filter {
    display: flex;
    gap: 0.3rem;
}

.filter-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.filter-btn:hover {
    color: var(--color-gray-800);
}

.filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
}

body.dark-mode .filter-btn {
    color: var(--color-gray-600);
}

body.dark-mode .filter-btn:hover {
    color: var(--color-code-text);
}

body.dark-mode .filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Post List */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-gray-900);
    transition: var(--transition-fast);
    overflow: hidden;
    height: 100%;
}

.post-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.post-card-thumbnail {
    width: 100%;
    height: 150px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}

.card-tag {
    padding: 0.05rem 0.35rem;
    background: transparent;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid currentColor;
}

/* Tag colors defined in base.css */

.post-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
    margin: 0;
}

.post-card-summary {
    font-size: 0.82rem;
    color: var(--color-gray-800);
    line-height: 1.4;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--color-gray-600);
    margin-top: auto;
}

.post-card-meta .sep {
    color: var(--color-gray-500);
    font-weight: 300;
}

.reading-time {
    font-size: 0.85rem;
    color: var(--color-gray-800);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reading-time::before {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
    background-size: contain;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    padding: 0.25rem 0.7rem;
    background: var(--color-bg-hover);
    color: var(--color-primary);
    border-radius: var(--radius-2xl);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--color-primary-alpha-30);
}

/* Empty Message */
.empty-message {
    color: var(--color-gray-700);
    font-style: italic;
    text-align: center;
    padding: 3rem;
    background: var(--color-gray-50);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--color-gray-400);
}

/* Post Article */
.post-article {
    max-width: 900px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--color-gray-800);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-gray-300);
}

.post-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 0;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.post-meta > span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.post-meta .separator {
    color: var(--color-gray-500);
    font-size: 0.9rem;
    font-weight: 300;
}

.post-date,
.post-reading-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--color-gray-800);
}

.post-tags-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

body.dark-mode .post-date,
body.dark-mode .post-reading-time {
    color: var(--color-gray-500);
}

.meta-tag {
    background: transparent;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid currentColor;
}

.meta-tag.color-1 { color: var(--color-tag-1); }
.meta-tag.color-2 { color: var(--color-tag-2); }
.meta-tag.color-3 { color: var(--color-tag-3); }
.meta-tag.color-4 { color: var(--color-tag-4); }
.meta-tag.color-5 { color: var(--color-tag-5); }
.meta-tag.color-6 { color: var(--color-tag-6); }
.meta-tag.color-7 { color: var(--color-tag-7); }
.meta-tag.color-8 { color: var(--color-tag-8); }

/* Post Body Content */
.post-body {
    line-height: 1.65;
    color: var(--color-gray-900);
    font-size: 1.05rem;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    margin: 2rem 0 1rem;
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.4;
}

.post-body > h1:first-child { display: none; }
.post-body h1 {
    font-size: 1.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-gray-300);
    position: relative;
    margin-top: 2.5rem;
}
.post-body h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-primary);
}
.post-body h2 {
    font-size: 1.25rem;
}
.post-body h3 { font-size: 1.1rem; }
.post-body h4 { font-size: 1rem; }

body.dark-mode .post-body h1,
body.dark-mode .post-body h2,
body.dark-mode .post-body h3,
body.dark-mode .post-body h4,
body.dark-mode .post-body h5,
body.dark-mode .post-body h6 {
    color: var(--color-gray-300);
}

body.dark-mode .post-body h1 {
    border-bottom-color: var(--color-gray-800);
}

.post-body p {
    margin: 0.8rem 0;
    text-align: justify;
}

.post-body ul,
.post-body ol {
    margin: 0.8rem 0;
    padding-left: 1.8rem;
}

.post-body li {
    margin: 0.25rem 0;
}

.post-body a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-primary-alpha-30);
    transition: border-color 0.2s;
}

.post-body a:hover {
    border-bottom-color: var(--color-primary);
}

.post-body img {
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.post-body blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--color-gray-50);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 10px 10px 0;
    color: var(--color-gray-800);
    font-style: italic;
    position: relative;
}

.post-body blockquote::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 3rem;
    color: var(--color-primary-alpha-15);
    font-family: Georgia, serif;
    line-height: 1;
}

.post-body code {
    background: var(--color-gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Fira Code', monospace;
    font-size: 0.9em;
    font-weight: 600;
    color: #c7254e;
}

.post-body pre {
    background: var(--color-editor-bg) !important;
    color: var(--color-code-text-light);
    padding: 2.5rem 1.5rem 1.5rem !important;
    border-radius: 10px !important;
    overflow-x: auto;
    margin: 2rem 0 !important;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.post-body pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 12px;
    height: 12px;
    background: #ff5f56;
    border-radius: var(--radius-full);
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27ca40;
}

.post-body pre code {
    background: none !important;
    padding: 0 !important;
    color: inherit;
    font-size: 0.9rem !important;
    line-height: 1.6;
    text-shadow: none !important;
}

/* Fix code comments styling */
.post-body pre code .token.comment,
.post-body pre code .token.prolog,
.post-body pre code .token.doctype,
.post-body pre code .token.cdata {
    color: #6a9955 !important;
    font-style: italic;
}

/* KaTeX 수식 스타일 */
.post-body .katex-display {
    margin: 1.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
}

.post-body .katex {
    font-size: 1.1em;
}

.post-body table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.9rem;
}

.post-body th,
.post-body td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--color-gray-400);
}

.post-body th {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
    font-weight: 600;
}

.post-body tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

.post-body tbody tr:hover {
    background: var(--color-gray-100);
}

/* Post Navigation (Previous/Next) */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 3rem 0 2rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--color-gray-300);
    border-bottom: 1px solid var(--color-gray-300);
}

.nav-prev, .nav-next {
    flex: 1;
    max-width: 45%;
}

.nav-prev a, .nav-next a {
    display: block;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    transition: background 0.2s;
}

.nav-prev a:hover, .nav-next a:hover {
    background: var(--color-gray-100);
}

.nav-next {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-gray-600);
    margin-bottom: 0.3rem;
}

.nav-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-primary);
    line-height: 1.4;
}

/* Dark mode */
body.dark-mode .post-navigation {
    border-color: var(--color-gray-900);
}
body.dark-mode .nav-prev a:hover,
body.dark-mode .nav-next a:hover {
    background: var(--color-bg-tertiary);
}
body.dark-mode .nav-label {
    color: var(--color-gray-600);
}
body.dark-mode .nav-title {
    color: var(--color-primary-lighter);
}

/* Dark mode - Post Cards */
body.dark-mode .post-card {
    background: var(--color-bg-secondary);
    border-color: var(--color-gray-200);
}

body.dark-mode .post-card:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-gray-400);
    box-shadow: var(--shadow-card-hover-dark);
}

body.dark-mode .post-card-thumbnail {
    background: var(--color-bg);
}

body.dark-mode .post-card-title {
    color: var(--color-text);
}

body.dark-mode .post-card-summary {
    color: var(--color-code-text);
}

body.dark-mode .post-card-meta {
    color: var(--color-gray-600);
}

body.dark-mode .post-card-meta .sep {
    color: var(--color-gray-800);
}

body.dark-mode .card-tag {
    opacity: 0.9;
}

/* Related Posts Section */
.related-posts-section,
.similar-posts-section {
    margin-top: 2rem;
}

.related-posts-section h2,
.similar-posts-section h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.related-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-post-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.related-post-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--color-bg);
}

.related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-info {
    padding: 0.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.related-post-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.related-post-meta {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-post-meta .meta-right {
    margin-left: auto;
    white-space: nowrap;
}

.related-post-meta i {
    vertical-align: -1px;
}

.related-tag {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: var(--radius-xs);
}

.related-tag:nth-child(1) { color: var(--color-tag-1); border: 1px solid var(--color-tag-1); }
.related-tag:nth-child(2) { color: var(--color-tag-2); border: 1px solid var(--color-tag-2); }
.related-tag:nth-child(3) { color: var(--color-tag-3); border: 1px solid var(--color-tag-3); }

body.dark-mode .related-post-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

body.dark-mode .related-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--color-border);
}

.comments-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.comments-section h2::before {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0392b' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    background-size: contain;
}

/* Comment Form */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.comment-form input,
.comment-form textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-gray-400);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.comment-form button {
    align-self: flex-end;
    padding: 0.7rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: var(--color-primary-dark);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comments-list > .comment {
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    background: var(--color-gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-gray-200);
}

.comments-list .comment-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.comment-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-600);
}

.comments-list .comment-author {
    font-weight: 600;
    color: var(--color-gray-900);
}

.comments-list .comment-date {
    font-size: 0.8rem;
    color: var(--color-gray-600);
}

.comments-list .comment-content {
    color: var(--color-gray-800);
    line-height: 1.6;
}

.comments-list .comment-delete {
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    background: transparent;
    border: 1px solid #d44;
    color: #d44;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.comments-list .comment-delete:hover {
    background: #d44;
    color: var(--color-white);
}

.login-prompt {
    padding: 1.5rem;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-top: 1.5rem;
}

.login-prompt a {
    color: var(--color-primary);
    font-weight: 600;
}

.comments-list .comment-replies {
    margin-top: 1rem;
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--color-gray-400);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.comments-list .comment.reply {
    background: var(--color-gray-100);
}

.no-comments {
    color: var(--color-gray-600);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1rem 0;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    background: var(--color-gray-100);
    border-radius: 50px;
    padding: 6px;
}

.page-bubble {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    background: var(--color-primary);
    border-radius: 50px;
    transition: left 0.2s ease-out, width 0.2s ease-out;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 99, 102, 241), 0.4);
    z-index: 0;
}

.page-num {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.4rem;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: var(--color-gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.15s, transform 0.2s;
}

.page-num:hover {
    transform: scale(1.05);
}

.page-num.bubble-hover {
    color: var(--color-white);
}

.page-num.active:not(.bubble-hover) {
    color: var(--color-primary);
    font-weight: 700;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 38px;
    color: var(--color-gray-400);
    font-size: 1rem;
    letter-spacing: 2px;
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--color-white);
    border: 2px solid var(--color-gray-200);
    border-radius: 50%;
    color: var(--color-gray-600);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-nav:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
}

.page-nav i {
    width: 20px;
    height: 20px;
}

/* Dark mode */
body.dark-mode .page-numbers {
    background: var(--color-gray-800);
}

body.dark-mode .page-num {
    color: var(--color-gray-400);
}

body.dark-mode .page-num:hover {
    color: var(--color-gray-100);
}

body.dark-mode .page-nav {
    background: var(--color-gray-800);
    border-color: var(--color-gray-700);
    color: var(--color-gray-400);
}

/* ===== Responsive: 1300px ===== */
@media (max-width: 1300px) {
    .category-post-card:nth-child(3) {
        display: none;
    }
}

/* ===== Responsive: 1100px ===== */
@media (max-width: 1100px) {
    .category-post-card:nth-child(2) {
        display: none;
    }
}

/* ===== Responsive: 600px ===== */
@media (max-width: 600px) {
    .category-overview-list {
        display: none;
    }
}

/* ===== Responsive: 900px (Tablet) Layout ===== */
@media (max-width: 900px) {
    .category-post-card:nth-child(2) {
        display: flex;
    }

    .post-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-section {
        flex: 1;
        min-width: 250px;
        max-height: 250px;
    }

    .top-categories {
        display: none;
    }


    .post-banner .island {
        height: 140px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .post-title {
        font-size: 1.6rem;
    }

    .post-banner {
        height: 160px;
        border-radius: var(--radius-lg);
        margin-bottom: 1rem;
    }

    .post-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0.6rem;
    }
}

/* ===== Responsive: 768px (Small Tablet) ===== */
@media (max-width: 768px) {
    .category-post-card:nth-child(2) {
        display: none;
    }

    .post-container {
        gap: 1rem;
    }

    /* Hide sidebar on post detail page */
    .post-article + .sidebar,
    .sidebar:has(.toc-section) {
        display: none;
    }

    /* Show only category section in post list */
    .sidebar {
        flex-direction: column;
    }

    .sidebar-section {
        min-width: 100%;
        max-height: 200px;
    }

    .category-section {
        max-height: 200px;
    }

    .toc-section {
        display: none;
    }

    .post-banner {
        height: 140px;
        margin-bottom: 1.25rem;
    }

    .post-banner .island {
        height: 120px;
    }

    .post-banner .breadcrumb {
        top: 8px;
        left: 10px;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .night-scene .moon {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 50px;
    }

    .night-scene .cloud-1,
    .night-scene .cloud-2 {
        transform: scale(0.7);
    }

    .post-title {
        font-size: 1.4rem;
    }

    .post-meta {
        font-size: 0.8rem;
        gap: 0.35rem;
        padding: 0.4rem 0;
    }

    .meta-tag {
        font-size: 0.75rem;
        padding: 0.1rem 0.4rem;
    }

    .post-body {
        font-size: 0.95rem;
    }

    .post-body h1 { font-size: 1.25rem; }
    .post-body h2 { font-size: 1.1rem; }
    .post-body h3 { font-size: 1rem; }

    .post-body pre {
        padding: 2rem 1rem 1rem !important;
        margin: 1.5rem -0.5rem !important;
        border-radius: 0 !important;
    }

    .post-navigation {
        flex-direction: column;
        gap: 1rem;
        margin: 2rem 0 1.5rem;
        padding: 1rem 0;
    }

    .nav-prev, .nav-next {
        max-width: 100%;
    }

    .nav-next {
        text-align: left;
    }

    .comments-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .post-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .post-card-thumbnail {
        height: 120px;
    }

    .subcategory-grid {
        grid-template-columns: 1fr;
    }

    .page-title-row {
        gap: 0.5rem;
    }
}

/* ===== Responsive: 600px (Large Phone) ===== */
@media (max-width: 600px) {
    .post-container {
        min-height: auto;
    }

    .post-content {
        width: 100%;
    }

    .post-banner {
        height: 120px;
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    .post-banner .island {
        height: 100px;
    }

    .post-banner .wave {
        height: 40px;
        background-size: 1000px 40px;
    }

    .post-banner .breadcrumb {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .night-scene .moon {
        width: 35px;
        height: 35px;
        top: 20px;
        right: 30px;
    }

    .night-scene .firefly {
        display: none;
    }

    .page-title {
        font-size: 1.2rem;
        padding-bottom: 0.5rem;
    }

    .page-title::after {
        width: 35px;
        height: 2px;
    }

    .post-title {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .post-meta {
        font-size: 0.75rem;
    }

    .post-meta .separator {
        display: none;
    }

    .post-meta > span {
        margin-right: 0.5rem;
    }

    .post-tags-inline {
        display: none;
    }

    .post-body {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .post-body p {
        text-align: left;
    }

    .post-body h1 { font-size: 1.15rem; margin-top: 2rem; }
    .post-body h2 { font-size: 1.05rem; }
    .post-body h3 { font-size: 0.95rem; }

    .post-body ul,
    .post-body ol {
        padding-left: 1.4rem;
    }

    .post-body blockquote {
        margin: 1.5rem 0;
        padding: 1rem 1.25rem;
    }

    .post-body blockquote::before {
        font-size: 2rem;
        top: 0.25rem;
        left: 0.5rem;
    }

    .post-body pre {
        padding: 1.8rem 0.75rem 0.75rem !important;
        margin: 1rem -0.75rem !important;
        font-size: 0.8rem !important;
    }

    .post-body pre code {
        font-size: 0.8rem !important;
    }

    .post-body table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
    }

    .post-body th,
    .post-body td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .post-body img {
        margin: 1.5rem auto;
        border-radius: var(--radius-md);
    }

    .post-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .post-card-thumbnail {
        height: 120px;
    }

    .post-card-body {
        padding: 0.4rem 0.6rem;
    }

    .post-card-title {
        font-size: 0.85rem;
    }

    .post-card-summary {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }

    .post-card-meta {
        font-size: 0.65rem;
    }

    .post-card-tags {
        display: none;
    }

    .nav-title {
        font-size: 0.9rem;
    }

    .comments-section h2 {
        font-size: 1.1rem;
    }

    .comment-form textarea {
        min-height: 80px;
    }

    .pagination {
        gap: 0.5rem;
    }

    .page-numbers {
        padding: 4px;
    }

    .page-num {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .page-nav {
        width: 36px;
        height: 36px;
    }

    .page-nav i {
        width: 16px;
        height: 16px;
    }
}

/* ===== Responsive: 480px (Small Phone) ===== */
@media (max-width: 480px) {
    .post-banner {
        height: 100px;
    }

    .post-banner .island {
        height: 80px;
    }

    .post-banner .wave {
        height: 40px;
        background-size: 1000px 40px;
    }

    .post-banner .breadcrumb {
        font-size: 0.65rem;
    }

    .night-scene .moon {
        width: 30px;
        height: 30px;
        top: 20px;
        right: 20px;
    }

    .night-scene .cloud-1,
    .night-scene .cloud-2 {
        display: none;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .post-meta {
        font-size: 0.7rem;
    }

    .post-body {
        font-size: 0.85rem;
    }

    .post-body h1 { font-size: 1.05rem; }
    .post-body h2 { font-size: 0.95rem; }
    .post-body h3 { font-size: 0.9rem; }

    .post-body pre {
        padding: 1.5rem 0.5rem 0.5rem !important;
        margin: 0.75rem -0.5rem !important;
    }

    .post-body pre::before {
        top: 8px;
        left: 8px;
        width: 8px;
        height: 8px;
        box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #27ca40;
    }

    .post-card-thumbnail {
        height: 100px;
    }

    .post-card-body {
        padding: 0.35rem 0.5rem;
        gap: 0.1rem;
    }

    .post-card-title {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .post-card-summary {
        display: none;
    }

    .post-card-meta {
        font-size: 0.6rem;
    }

    .post-navigation {
        margin: 1.5rem 0 1rem;
    }

    .nav-label {
        font-size: 0.7rem;
    }

    .nav-title {
        font-size: 0.85rem;
    }

    .comments-section {
        margin-top: 1.5rem;
    }

    .comments-section h2 {
        font-size: 1rem;
    }

    .comments-list > .comment {
        padding: 0.75rem 1rem;
    }

    .page-num {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
        padding: 0 0.2rem;
    }

    .page-nav {
        width: 32px;
        height: 32px;
    }

    .page-ellipsis {
        min-width: 20px;
    }
}

/* Highlight (==text==) */
.post-body mark.highlight {
    background: var(--gradient-sticky);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-xs);
    color: var(--color-gray-900);
}


/* Category Slide Panel */
.category-toggle-btn {
    position: fixed;
    left: 0;
    top: 20%;
    z-index: 100;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0.5rem 0.4rem;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.category-toggle-btn:hover {
    background: var(--color-bg-hover);
}

.category-toggle-btn svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

.category-toggle-btn span {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.category-slide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.category-slide-overlay.active {
    opacity: 1;
    visibility: visible;
}

.category-slide-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: var(--color-white);
    border-right: 2px solid var(--color-primary);
    z-index: 200;
    overflow-y: auto;
    padding: 1rem;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
}

.category-slide-panel.active {
    left: 0;
}

.category-slide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.category-slide-header .sidebar-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-slide-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.category-slide-close:hover {
    background: var(--color-bg-hover);
}

.category-slide-close svg {
    width: 20px;
    height: 20px;
    color: var(--color-gray-600);
}

/* Dark mode */
body.dark-mode .category-toggle-btn {
    background: var(--color-bg-secondary);
    border-color: var(--color-gray-300);
}

body.dark-mode .category-toggle-btn:hover {
    background: var(--color-bg-hover);
}

body.dark-mode .category-toggle-btn svg {
    color: var(--color-primary-light);
}

body.dark-mode .category-toggle-btn span {
    color: var(--color-primary-light);
}

body.dark-mode .category-slide-panel {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
}

body.dark-mode .category-slide-header {
    border-color: var(--color-gray-300);
}

body.dark-mode .category-slide-close:hover {
    background: var(--color-bg-hover);
}

body.dark-mode .category-slide-close svg {
    color: var(--color-gray-500);
}

/* Hide on mobile */
@media (max-width: 768px) {
    .category-toggle-btn {
        display: none;
    }
}

/* ==================== Unified Post Card Styles ==================== */
.home-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.home-cards-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.home-cards-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 0.75rem;
    row-gap: 2rem;
    grid-auto-rows: 1fr;
}

.home-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: var(--transition-fast);
}

.home-card:hover .home-card-thumb img {
    transform: scale(1.03);
}

.home-card:hover .home-card-title {
    color: var(--color-primary);
}

.home-card-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-gray-200);
}

.home-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.home-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f5 100%);
}

.home-card-placeholder span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-600);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-card-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-card-breadcrumb .breadcrumb-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    flex-shrink: 0;
}

.home-card-body {
    padding: 0.6rem 0.2rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.home-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.home-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin: 0 0 0.3rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-card-summary {
    font-size: 0.8rem;
    color: var(--color-gray-700);
    margin: 0 0 auto 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--color-gray-700);
    font-weight: 500;
}

.home-card-footer span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.home-card-footer svg {
    width: 12px;
    height: 12px;
}

.home-card-footer .sep {
    color: var(--color-gray-400);
}

.home-card-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.2rem;
    margin-top: 0.3rem;
    overflow: hidden;
}

.home-tag {
    padding: 0.05rem 0.35rem;
    background: transparent;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid currentColor;
}

.home-tag-more {
    font-size: 0.7rem;
    color: var(--color-gray-500);
}

/* Dark mode */
body.dark-mode .home-card-thumb {
    border-color: var(--color-gray-300);
}

body.dark-mode .home-card-placeholder {
    background: linear-gradient(135deg, #2d3436 0%, #3d4448 50%, #2d3436 100%);
}

body.dark-mode .home-card-placeholder span {
    color: var(--color-gray-400);
}

body.dark-mode .home-card:hover .home-card-title {
    color: var(--color-primary-light);
}

body.dark-mode .home-card-title {
    color: var(--color-gray-100);
}

body.dark-mode .home-card-summary {
    color: var(--color-gray-400);
}

body.dark-mode .home-card-footer {
    color: var(--color-gray-400);
}

body.dark-mode .home-card-footer .sep {
    color: var(--color-gray-800);
}

/* Responsive */
@media (max-width: 1024px) {
    .home-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .home-cards-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .home-cards-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .home-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .home-cards-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .home-cards-list {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .home-cards-list .home-card-body {
        flex: none;
    }
    .home-cards-list .home-card-summary {
        margin-bottom: 0;
    }
}
