@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

/* ===== THEME VARIABLES ===== */
:root,
[data-theme="dark"] {
    --bg-body: #13141b;
    --bg-sidebar: #1a1b26;
    --bg-card: #1e1f2e;
    --bg-card-hover: #252638;
    --bg-input: #1e1f2e;
    --bg-badge: rgba(255, 255, 255, 0.06);
    --text: #cccce0;
    --text-secondary: #8888a4;
    --text-muted: #55556e;
    --accent: #7c6cf0;
    --accent-hover: #9d8eff;
    --red: #d04848;
    --green: #3daa60;
    --border: rgba(255, 255, 255, 0.06);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --radius: 6px;
}

[data-theme="light"] {
    --bg-body: #fdfcff;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5fa;
    --bg-input: #f0f1f5;
    --bg-badge: rgba(0, 0, 0, 0.05);
    --text: #1a1a2e;
    --text-secondary: #5a5a78;
    --text-muted: #9898b0;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd6;
    --red: #e04050;
    --green: #30a060;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --radius: 10px;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
    font-family: 'Google Sans', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.preload * {
    transition: none !important;
}

a {
    text-decoration: none;
    color: inherit
}

img {
    max-width: 100%;
    display: block
}

ul,
ol {
    list-style: none
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

::selection {
    background: var(--accent);
    color: #fff
}

/* ===== APP LAYOUT ===== */
:root {
    --header-h: 52px
}

.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-h)
}

.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
    flex: 1;
    padding: 24px 40px 100px;
    /* Increased bottom padding */
    max-width: 1400px;
    width: 100%;
    margin: 0 auto
}

#content {
    min-width: 0
}

.sidebar-right {
    min-width: 0;
    border-left: 1px solid var(--border);
    padding-left: 28px
}

/* About page: full width, no sidebar */
[data-page="about"] .content-wrapper {
    grid-template-columns: 1fr;
    max-width: 1000px
}

[data-page="about"] .sidebar-right {
    display: none
}

/* ===== LEFT SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 250px;
    height: calc(100vh - var(--header-h));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width .3s ease, transform .3s ease;
    overflow: hidden
}

/* Collapsed sidebar: icon-only */
.sidebar.collapsed {
    width: 64px
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap
}

.sidebar.collapsed .sidebar-nav-link {
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 10px
}

.sidebar.collapsed .sidebar-nav-link i {
    width: auto
}

.sidebar.collapsed .sidebar-footer {
    display: none
}

.sidebar.collapsed .sidebar-sep {
    margin: 8px 10px
}

/* Collapse toggle button */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    border-top: 1px solid var(--border);
    transition: color .2s, background .2s
}

.sidebar-collapse-btn:hover {
    color: var(--accent);
    background: rgba(124, 108, 240, 0.06)
}

/* Main area responds to collapsed sidebar */
.main-area {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-h));
    transition: margin-left .3s ease
}

.main-area.sidebar-collapsed {
    margin-left: 64px
}

.sidebar-nav {
    flex: 1;
    padding: 8px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all .2s;
    white-space: nowrap;
    overflow: hidden
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: rgba(124, 108, 240, 0.08);
    color: var(--accent)
}

.sidebar-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px
}

.sidebar-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 14px
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
    width: 250px;
    flex-shrink: 0;
}

.sidebar-footer-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: nowrap;
    overflow: hidden
}

.sidebar-footer-links a {
    color: var(--text-secondary);
    transition: color .2s;
}

.sidebar-footer-links a:hover {
    color: var(--accent);
}

.sidebar-footer-links span {
    color: var(--text-muted);
}

.sidebar-footer-social {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    color: var(--text-muted);
    font-size: 15px;
    transition: color .2s;
}

.sidebar-footer-social a:hover {
    color: var(--accent);
}

.sidebar.collapsed .sidebar-footer-social {
    opacity: 0;
    pointer-events: none;
}

/* ===== SITE HEADER (sticky horizontal) ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 200;
    gap: 16px
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0
}

.header-hamburger {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 16px;
    cursor: pointer
}

.header-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent)
}

.header-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
    white-space: nowrap
}

.header-search {
    position: relative;
    width: 400px
}

.header-search>i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px
}

.header-search input {
    width: 100%;
    padding: 8px 32px 8px 34px;
    /* Increased right padding for clear btn */
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 13px;
    /* Slightly larger for readability */
    outline: none;
    transition: border-color .2s
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: none;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    z-index: 2;
}

.search-clear-btn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: var(--text);
    background: var(--bg-badge);
}

.header-search input:focus {
    border-color: var(--accent)
}

.header-search input::placeholder {
    color: var(--text-muted)
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0
}

.header-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all .2s
}

.header-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(124, 108, 240, 0.08);
}

.header-bookmarks {
    position: relative;
    display: flex;
    align-items: center;
}

.bookmark-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    pointer-events: none;
}

.bookmark-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s;
    z-index: 1000;
    overflow: hidden;
}

.bookmark-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bookmark-dropdown-header {
    padding: 14px 16px;
    font-weight: 500;
    font-size: 14.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.bookmark-dropdown-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-bookmarks {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.bookmark-item:last-child {
    border-bottom: none;
}

.bookmark-item:hover {
    background: var(--bg-card-hover);
}

.bookmark-item-link {
    display: flex;
    flex: 1;
    gap: 12px;
    text-decoration: none;
    align-items: center;
    min-width: 0;
}

.bookmark-item-link img {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.bookmark-item-info {
    flex: 1;
    min-width: 0;
}

.bookmark-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.bookmark-item-meta {
    font-size: 12.5px;
    color: var(--text-muted);
}

.bookmark-remove-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--red);
    background: rgba(224, 64, 80, 0.1);
    font-size: 14px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bookmark-remove-btn:hover {
    background: var(--red);
    color: #fff;
    transform: scale(1.05);
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99
}

.sidebar-overlay.active {
    display: block
}

/* ===== CONTENT SEARCH ===== */
.content-search {
    position: relative;
    max-width: 400px;
    margin-bottom: 24px
}

.content-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px
}

.content-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s
}

.content-search input:focus {
    border-color: var(--accent)
}

.content-search input::placeholder {
    color: var(--text-muted)
}

/* Mobile labels: hidden on desktop, shown when sidebar-right is hidden */
.mobile-labels {
    display: none;
    margin-bottom: 24px
}

/* Mobile banner: hidden on desktop */
.mobile-banner {
    display: none;
    margin-bottom: 24px
}

.mobile-banner img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover
}

/* Sidebar banner (desktop) */
.sidebar-banner {
    margin-bottom: 20px
}

.sidebar-banner img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover
}

.sidebar-description {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px
}

.site-footer {
    display: none !important;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    text-align: center
}

/* ===== RESPONSIVE ===== */
@media(max-width:1100px) {
    .sidebar-right {
        display: none !important
    }

    .content-wrapper {
        grid-template-columns: 1fr
    }

    .mobile-labels {
        display: block
    }

    .mobile-banner {
        display: block
    }

    /* On non-home pages, move mobile sidebar sections to bottom */
    [data-page="post"] #content,
    [data-page="label"] #content,
    [data-page="search"] #content {
        display: flex;
        flex-direction: column;
    }

    [data-page="post"] #content>.mobile-banner,
    [data-page="post"] #content>.mobile-labels,
    [data-page="label"] #content>.mobile-banner,
    [data-page="label"] #content>.mobile-labels,
    [data-page="search"] #content>.mobile-banner,
    [data-page="search"] #content>.mobile-labels {
        order: 99;
        margin-top: 32px;
        margin-bottom: 0;
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px !important
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .main-area,
    .main-area.sidebar-collapsed {
        margin-left: 0
    }

    .header-hamburger {
        display: flex
    }

    .sidebar-collapse-btn {
        display: none
    }

    .content-wrapper {
        padding: 16px 16px 80px;
        /* Increased bottom padding on mobile */
    }

    /* Sidebar should not be collapsed in mobile view */
    .sidebar.collapsed {
        width: 250px !important
    }

    .sidebar.collapsed .nav-label {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        white-space: normal !important
    }

    .sidebar.collapsed .sidebar-nav-link {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 14px !important;
        width: auto !important;
        margin: 0 !important
    }

    .sidebar.collapsed .sidebar-footer {
        display: block !important
    }

    .site-footer {
        display: block !important
    }

    .sidebar-footer-social {
        display: none !important
    }

    .sidebar-footer-links {
        display: none !important
    }

    .sidebar-footer>div:last-child {
        display: none !important
    }

    .bookmark-dropdown {
        display: none !important;
    }
}

/* ===== SECTION TITLE ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px
}

.section-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap
}

.section-dots {
    display: flex;
    gap: 4px
}

.section-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted)
}

/* ===== POST CARDS GRID ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px 18px;
}

@media(max-width:1100px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:600px) {
    .posts-grid {
        grid-template-columns: 1fr
    }
}

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 40px 0;
    text-align: center;
    grid-column: 1 / -1
}

.post-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .25s;
    position: relative;
}

.post-card:hover {
    transform: translateY(-3px)
}

.post-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-card)
}

.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.bookmark-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all .2s;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.bookmark-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

.bookmark-btn.active {
    color: var(--accent);
}

.post-card-info {
    padding: 14px 2px 0;
    flex: 1;
    display: flex;
    flex-direction: column
}

.post-card-cat {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px
}

.post-card-cat .cat-link {
    color: var(--text-secondary);
    transition: color .2s
}

.post-card-cat .cat-link:hover {
    color: var(--accent);
    text-decoration: underline
}

.post-card-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.post-card-title:hover {
    text-decoration: underline
}

.post-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.post-card-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff
}

.badge-red {
    background: var(--red)
}

.badge-green {
    background: var(--green)
}

.post-card-date {
    font-size: 13px;
    color: var(--text-muted)
}

.read-more-link {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
    margin-left: auto;
    transition: all .2s;
}

.read-more-link:hover {
    color: var(--accent-hover);
}

/* ===== POPULAR POSTS (Right Sidebar) ===== */
.popular-featured {
    margin-bottom: 20px
}

.popular-featured .pop-img {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 10px;
    position: relative
}

.popular-featured .pop-img img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.popular-featured .pop-rank {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px
}

.popular-featured .pop-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px
}

.popular-featured .pop-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px
}

.popular-featured .pop-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.popular-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--border)
}

.popular-item .pop-thumb {
    width: 80px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative
}

.popular-item .pop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.popular-item .pop-num {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px
}

.popular-item .pop-info {
    flex: 1;
    min-width: 0
}

.popular-item .pop-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px
}

.popular-item .pop-meta {
    font-size: 11px;
    color: var(--text-muted)
}


/* ===== LABELS SIDEBAR ===== */
.labels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px
}

.label-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap
}

.label-item i {
    font-size: 11px;
    color: var(--text-muted)
}

.label-item:hover {
    border-color: var(--accent);
    background: rgba(124, 108, 240, 0.06);
    color: var(--accent)
}

.label-item:hover i {
    color: var(--accent)
}

.label-name {
    font-weight: 500
}

.label-count {
    color: var(--text-muted);
    font-size: 12px
}

/* ===== ARTICLE PAGE ===== */
.article-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 8px 0 40px;
    overflow: hidden;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 20px;
    gap: 0
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color .2s;
    white-space: nowrap
}

.breadcrumb a:hover {
    color: var(--accent)
}

.breadcrumb-sep {
    margin: 0 8px;
    color: var(--text-muted);
    font-size: 14px
}

.breadcrumb-current {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(400px, 80vw);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px
}

.article-meta img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent)
}

.article-meta-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text)
}

.article-meta-date {
    font-size: 12px;
    color: var(--text-muted)
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
    margin-bottom: 28px;
    color: var(--text);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.8em 0 .6em
}

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.5em 0 .5em
}

.article-content p {
    margin-bottom: 1em
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px
}

.article-content img {
    border-radius: var(--radius);
    margin: 1.2em 0;
    box-shadow: var(--shadow)
}

.article-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    margin: 1.2em 0;
    font-size: 13px
}

.article-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: .9em
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 1.2em 0;
    color: var(--text-muted);
    font-style: italic
}

.article-content ul,
.article-content ol {
    padding-left: 20px;
    margin-bottom: 1em
}

.article-divider {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border)
}

.article-divider a {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s
}

.article-divider a:hover {
    background: var(--accent);
    color: #fff
}

.back-to-posts-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.back-to-posts-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: all .2s;
    text-decoration: none;
}

.back-to-posts-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.back-to-posts-btn i {
    font-size: 12px;
}

/* ===== ABOUT PAGE ===== */
.about-container {
    max-width: 780px;
    padding: 8px 0 40px
}

.about-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px
}

.about-avatar-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--accent), #e74c8e);
    flex-shrink: 0
}

.about-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-body)
}

.about-nickname {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text)
}

.about-name {
    font-size: 14px;
    color: var(--text-secondary)
}

.about-username {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px
}

.about-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px
}

.about-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted)
}

.about-detail i {
    color: var(--accent);
    font-size: 12px
}

.about-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px
}

.about-bio {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 32px
}

.about-bio p {
    margin-bottom: .8em
}

.about-social-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.about-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all .2s
}

.about-social-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

/* ===== ERROR ===== */
.error-container {
    text-align: center;
    padding: 60px 20px
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 12px
}

.error-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px
}

.error-message {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px
}

.error-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: 20px;
    transition: all .2s
}

.error-link:hover {
    opacity: .85
}

/* ===== FOOTER ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto
}

.footer-links {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted)
}

.footer-links a {
    transition: color .2s
}

.footer-links a:hover {
    color: var(--accent)
}

.footer-links .sep {
    color: var(--text-muted)
}

.footer-social {
    display: flex;
    gap: 10px
}

.footer-social a {
    color: var(--text-muted);
    font-size: 13px;
    transition: color .2s
}

.footer-social a:hover {
    color: var(--accent)
}

/* ===== LOADING ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    gap: 12px
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite
}

.loading-text {
    font-size: 13px;
    color: var(--text-muted)
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    color: var(--accent);
}

.scroll-to-top i {
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    z-index: 1;
}

.progress-circle path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
}

@media(max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 14px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.fade-in {
    animation: fadeIn .4s ease forwards;
    opacity: 0
}

.fade-in:nth-child(1) {
    animation-delay: .03s
}

.fade-in:nth-child(2) {
    animation-delay: .06s
}

.fade-in:nth-child(3) {
    animation-delay: .09s
}

/* ===== SEARCH DROPDOWN & MODAL ===== */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media(max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 1px;
}

.search-dropdown.active {
    display: block;
}

.search-header-info {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.search-header-info span {
    color: var(--text);
    font-weight: 500;
}

.search-result-item {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-card-hover);
    outline: none
}

mark {
    background: rgba(124, 108, 240, 0.2);
    /* var(--accent) with opacity */
    color: var(--accent);
    padding: 0;
    border-radius: 2px;
}

.search-result-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.search-result-meta span {
    color: var(--text-secondary);
}

/* Mobile Search Modal */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.mobile-search-modal.active {
    display: flex;
}

body:has(.mobile-search-modal.active) {
    overflow: hidden;
}

.mobile-search-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.mobile-search-header .header-search {
    flex: 1;
    margin-bottom: 0;
}

.mobile-search-close {
    font-size: 20px;
    color: var(--text-secondary);
    padding: 4px;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Ensure header search doesn't have margin in modal */
.mobile-search-header .header-search {
    width: 100%;
}

.fade-in:nth-child(4) {
    animation-delay: .12s
}

.fade-in:nth-child(5) {
    animation-delay: .15s
}

.fade-in:nth-child(6) {
    animation-delay: .18s
}

/* ===== SEARCH SHOW MORE ===== */
.search-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.2s;
    border-top: 1px solid var(--border);
}

.search-show-more:hover {
    background: var(--bg-card-hover);
}

.search-show-more i {
    font-size: 11px;
    transition: transform 0.2s;
}

.search-show-more:hover i {
    transform: translateX(3px);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.pagination-btn:hover:not(.disabled) {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(124, 108, 240, 0.08);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.pagination-number:hover:not(.active) {
    color: var(--accent);
    border-color: var(--accent);
}

.pagination-number.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination-ellipsis {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== BOOKMARK TOAST ===== */
.bookmark-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.bookmark-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .pagination {
        gap: 4px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 12.5px;
    }

    .pagination-number {
        min-width: 32px;
        height: 32px;
        font-size: 12.5px;
    }

    .pagination-btn span {
        display: none;
    }
}

/* ===== ARTICLE ACTION BUTTONS ===== */
.article-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all .2s;
}

.article-action-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(124, 108, 240, 0.08);
}

.article-action-btn.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== SHARE MODAL ===== */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.share-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
}

.share-modal.active .share-modal-content {
    transform: translateY(0);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.share-modal-header h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: var(--text);
}

.share-modal-close {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}

.share-modal-close:hover {
    color: var(--text);
}

.share-modal-preview {
    display: flex;
    padding: 16px 20px;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.share-modal-preview img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.share-preview-info {
    flex: 1;
    min-width: 0;
}

.share-preview-title {
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    line-height: 1.4;
}

.share-preview-domain {
    font-size: 13px;
    color: var(--text-muted);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px 12px;
    padding: 24px 20px;
}

.share-btn-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.share-btn-option:hover {
    transform: translateY(-2px);
}

.share-btn-option i {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 20px;
    color: var(--text);
    transition: background 0.2s, border-color 0.2s;
}

.share-btn-option:hover i {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.share-btn-option span {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.share-link-section {
    padding: 0 20px 20px;
}

.share-link-text {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text);
}

.share-copy-container {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
}

.share-link-icon {
    color: var(--accent);
    margin-right: 12px;
    font-size: 14px;
    flex-shrink: 0;
}

#share-link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    outline: none;
    min-width: 0;
    font-family: inherit;
}

#share-copy-btn {
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    margin-left: 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}

#share-copy-btn:hover {
    color: var(--text);
}

/* Mobile: bottom sheet style */
@media (max-width: 768px) {
    .share-modal {
        align-items: flex-end;
        padding: 0;
    }

    .share-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        max-height: 85vh;
        overflow-y: auto;
    }

    .share-modal.active .share-modal-content {
        transform: translateY(0);
    }

    .share-options {
        grid-template-columns: repeat(4, 1fr);
    }
}