/* Single Page — Dark Space Theme */

/* Main wrapper — dark background */
#signle-page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 140px 40px 80px;
    background: transparent;
}

/* Article container — light "island" for readability */
.single-page-container {
    background: #ffffff;
    padding: 60px;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-width: 860px;
    margin: 0 auto;
    position: relative;
}

.single-page-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0891b2, #2563eb, #4f46e5);
    border-radius: 16px 16px 0 0;
}

/* Title */
.page-detail__title {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 24px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Post meta inside article (light bg) */
.single-page-container .post-meta {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.single-page-container .post-meta time {
    font-weight: 500;
    color: #475569;
}

.single-page-container .category {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(8, 145, 178, 0.2);
    transition: all 0.2s ease;
}

.single-page-container .category:hover {
    background: rgba(8, 145, 178, 0.2);
    color: #0e7490;
}

/* Article body */
.page-detail__body {
    line-height: 1.9;
    color: #374151;
}

.page-content h2 {
    font-size: 1.4rem;
    color: #0f172a;
    margin: 56px 0 24px 0;
    padding-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

.page-content h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6);
    border-radius: 2px;
}

.page-content h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin: 40px 0 16px 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-content h4 {
    font-size: 1.05rem;
    color: #334155;
    margin: 32px 0 12px 0;
    font-weight: 600;
}

.page-content p {
    margin-bottom: 20px;
    line-height: 1.9;
}

.page-content ul,
.page-content ol {
    margin: 20px 0;
    padding-left: 28px;
}

.page-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.page-content a {
    color: #0891b2;
    text-decoration: none;
    border-bottom: 1px solid rgba(8, 145, 178, 0.2);
    transition: all 0.2s;
}

.page-content a:hover {
    color: #0e7490;
    border-bottom-color: #0e7490;
}

.page-content strong {
    font-weight: 700;
    color: #0f172a;
}

.page-content blockquote {
    border-left: 3px solid #22d3ee;
    padding: 16px 24px;
    margin: 24px 0;
    background: #f0fdfa;
    border-radius: 0 8px 8px 0;
    color: #475569;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
}

.page-content th,
.page-content td {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.page-content th {
    background: #f1f5f9;
    font-weight: 600;
    color: #1e293b;
}

/* TOC */
.toc {
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    border: 1px solid rgba(8, 145, 178, 0.2);
    padding: 28px;
    border-radius: 12px;
    margin: 32px 0;
}

.toc a {
    color: #0891b2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.toc a:hover {
    color: #0e7490;
}

/* Code blocks */
.code-block {
    background: #f6f8fa;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin: 28px 0;
    overflow-x: auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.code-block pre {
    margin: 0;
    padding: 28px;
    font-family: "JetBrains Mono", "Fira Code", "Monaco", "Menlo", monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #24292e;
}

.code-block code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
}

/* HCB (Highlighting Code Block) — plugin styles */
.hcb_wrap {
    margin: 28px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.hcb_wrap pre {
    border-radius: 0 !important;
    margin: 0 !important;
}

/* KaTeX display math in article */
.katex-display {
    margin: 28px 0;
    padding: 20px 0;
    overflow-x: auto;
}

/* Linkcard */
.lc_link {
    display: block;
    text-decoration: none;
    margin: 28px 0;
}

.lc_box {
    display: flex;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
}

.lc_box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #22d3ee, #3b82f6);
    opacity: 0;
    transition: opacity 0.3s;
}

.lc_link:hover .lc_box {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(8, 145, 178, 0.3);
}

.lc_link:hover .lc_box::before {
    opacity: 1;
}

.lc_thumb {
    flex-shrink: 0;
    width: 160px;
    height: 120px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lc_link:hover .lc_thumb img {
    transform: scale(1.05);
}

.lc_noimage {
    color: #94a3b8;
    font-size: 0.8rem;
}

.lc_content {
    flex: 1;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.lc_title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lc_description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Related Articles */
.related-articles {
    margin: 48px 0;
    padding: 40px 0;
    border-top: 1px solid #e5e7eb;
}

.related-articles h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 28px;
    font-weight: 700;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.related-articles h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6);
    border-radius: 2px;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.related-article {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.related-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6);
    opacity: 0;
    transition: opacity 0.3s;
}

.related-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.related-article:hover::before {
    opacity: 1;
}

.related-article h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 600;
}

.related-article h4 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.related-article h4 a:hover {
    color: #0891b2;
}

.related-article p {
    color: #64748b;
    line-height: 1.6;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.related-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.related-meta .category {
    background: rgba(8, 145, 178, 0.08);
    color: #0891b2;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(8, 145, 178, 0.15);
}

.related-meta time {
    color: #94a3b8;
}

/* Post Navigation */
.post-navigation {
    margin: 48px 0;
    padding: 40px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.nav-previous,
.nav-next {
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.nav-previous:hover,
.nav-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: rgba(8, 145, 178, 0.3);
}

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

.nav-subtitle {
    font-size: 0.78rem;
    color: #0891b2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: block;
}

.nav-previous h4,
.nav-next h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.nav-previous h4 a,
.nav-next h4 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-previous h4 a:hover,
.nav-next h4 a:hover {
    color: #0891b2;
}

/* Tags area */
.single-page-below-area {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.tags-area {
    font-size: 0.88rem;
    color: #64748b;
    text-align: center;
}

.tags {
    background: rgba(8, 145, 178, 0.08);
    color: #0891b2;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 20px;
    margin: 2px 3px;
    display: inline-block;
    border: 1px solid rgba(8, 145, 178, 0.15);
    transition: all 0.2s ease;
}

.tags:hover {
    background: rgba(8, 145, 178, 0.15);
    color: #0e7490;
    transform: translateY(-1px);
}

/* ========================================
   Responsive
   ======================================== */
@media screen and (max-width: 800px) {
    #signle-page-wrapper {
        padding: 120px 12px 40px;
    }

    .single-page-container {
        padding: 32px 20px;
        max-width: 100%;
        border-radius: 12px;
    }

    .page-detail__title {
        font-size: 1.5rem;
    }

    .page-content h2 {
        font-size: 1.25rem;
        margin-top: 40px;
    }

    .page-content h3 {
        font-size: 1.1rem;
    }

    .related-articles-grid {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    .lc_box {
        flex-direction: column;
    }

    .lc_thumb {
        width: 100%;
        height: 140px;
    }
}

@media screen and (max-width: 480px) {
    #signle-page-wrapper {
        padding: 110px 8px 24px;
    }

    .single-page-container {
        padding: 24px 16px;
    }

    .page-detail__title {
        font-size: 1.3rem;
    }

    .code-block pre,
    .hcb_wrap pre {
        padding: 16px;
        font-size: 0.8rem;
    }
}
