/* Custom styles for ThinkBlog */

:root {
    --bg-content-subtle: #fefefe;  /* 淡雅白背景色，用于文章内容区域 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.top-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 122, 204, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 122, 204, 0.08);
}

.top-menu .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-menu .left a {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007acc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-menu .left a:hover {
    color: #0056b3;
}

.top-menu .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.top-menu .menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.top-menu .menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #007acc, #0056b3);
    transition: width 0.3s ease;
}

.top-menu .menu a:hover::after,
.top-menu .menu li.active a::after {
    width: 100%;
}

.top-menu .menu a:hover {
    color: #007acc;
}

.top-menu .menu li.active a {
    color: #007acc;
    font-weight: 600;
}

.top-menu .menu a.search-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.top-menu .menu a.search-icon:hover {
    background-color: rgba(0, 122, 204, 0.1);
    transform: scale(1.1);
}

.top-menu .menu li.active a.search-icon {
    background-color: rgba(0, 122, 204, 0.15);
}

.top-menu .right .admin-link {
    color: #007acc;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #007acc;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.top-menu .right .admin-link:hover {
    background: #007acc;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007acc;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #007acc, #0056b3);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: #007acc;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Home page specific styles */
body.home-page main {
    padding-top: 80px; /* Account for fixed header */
}

/* Home page */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Posts */
.posts {
    display: grid;
    gap: 2rem;
}

.post-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.post-summary h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.post-summary h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.post-summary h2 a:hover {
    color: #007acc;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.post-meta time,
.post-meta span {
    margin-right: 1rem;
}

.read-more {
    display: inline-block;
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
    transition: color 0.3s;
}

.read-more:hover {
    color: #005999;
}

/* Article content - matching original Vue version */
.article-content .markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: 0 auto;
    padding: 45px;
    background-color: var(--bg-content-subtle);  /* 淡雅白背景色 */
}

@media (max-width: 767px) {
    .article-content .markdown-body {
        padding: 15px;
    }

    .post-header {
        margin-top: 4rem;  /* 移动端导航栏稍矮 */
        padding: 1.5rem 15px 2rem 15px;  /* 移动端添加上内边距 */
        background-color: var(--bg-content-subtle);  /* 移动端也使用淡雅白背景色 */
    }
}

.post-header {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: 0 auto;
    margin-top: 3rem;  /* 避免被导航栏遮挡 */
    padding: 2rem 45px 2rem 45px;  /* 添加上内边距 */
    background-color: var(--bg-content-subtle);  /* 淡雅白背景色 */
    border-bottom: 1px solid rgba(0, 122, 204, 0.1);
}

.post-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.post-tags {
    margin-top: 1rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 122, 204, 0.08);
    color: #007acc;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 122, 204, 0.15);
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag:hover {
    background: #007acc;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.2);
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Blog Posts List Styles */
.blog-posts {
    text-align: left;
}

.content-box {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.content-box:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.posts-default-img {
    position: relative;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;

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

    &:hover img {
        transform: scale(1.02);
    }

    .overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.1);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    &:hover .overlay {
        opacity: 1;
    }
}

.posts-default-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.posts-default-title {
    .post-entry-categories {
        margin-bottom: 8px;
    }

    .post-tag {
        display: inline-block;
        margin: 4px 6px 4px 0;
        padding: 4px 8px;
        background: #f0f0f0;
        color: #666;
        border-radius: 4px;
        font-size: 12px;
        text-decoration: none;
        transition: all 0.3s ease;

        &:hover {
            background: #007acc;
            color: #fff;
        }
    }

    .post-title {
        display: block;
        font-size: 24px;
        color: #000;
        text-decoration: none;
        line-height: 1.4;
        margin-bottom: 8px;
        transition: color 0.3s ease;

        &:hover {
            color: #007acc;
        }
    }
}

.posts-default-content {
    .posts-text {
        color: #606266;
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 12px;
    }

    .posts-default-info {
        margin-top: 6px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #909399;
        font-size: 14px;

        .left {
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .ico-warp {
            display: flex;
            align-items: center;
            gap: 4px;

            .icon {
                font-size: 14px;
            }

            a {
                color: #909399;
                text-decoration: none;
                transition: color 0.3s ease;

                &:hover {
                    color: #007acc;
                }
            }
        }

        .post-author {
            display: flex;
            align-items: center;
            gap: 6px;

            img {
                border-radius: 50%;
                width: 16px;
                height: 16px;
            }

            a {
                color: #909399;
                text-decoration: none;
                font-size: 14px;
                transition: color 0.3s ease;

                &:hover {
                    color: #007acc;
                }
            }
        }
    }
}

/* Page Container */
.page-container {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;

    h1 {
        font-size: 32px;
        color: #333;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .page-description {
        color: #666;
        font-size: 16px;
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 16px;
    font-size: 13px;
    text-decoration: none;
    color: #666;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    margin: 1px;

    &:hover {
        color: #007acc;
        background-color: rgba(0, 122, 204, 0.08);
        transform: translateY(-1px);
    }

    &.active {
        background-color: #007acc;
        color: #fff;
        font-weight: 600;

        &:hover {
            background-color: #0056b3;
            transform: none;
        }
    }

    &.prev, &.next {
        font-weight: 500;
        color: #888;
    }

    &.disabled {
        color: #ccc;
        cursor: not-allowed;

        &:hover {
            color: #ccc;
            background: transparent;
            transform: none;
        }
    }
}

/* Taxonomy (Categories & Tags) Button Styles */
.categories-list, .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-start;
    margin-top: 32px;
}

.category-item, .tag-item {
    display: inline-block;
}

.category-link, .tag-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 48px;
}

.category-link:hover, .tag-link:hover {
    background: #007acc;
    color: #fff;
    border-color: #007acc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.category-name, .tag-name {
    font-weight: 600;
}

.category-count, .tag-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.category-link:hover .category-count, .tag-link:hover .tag-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Taxonomy list styles */
.taxonomy-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 24px;
}

.taxonomy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 122, 204, 0.2);
    border-radius: 20px;
    text-decoration: none;
    color: #007acc;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.taxonomy-link:hover {
    background: #007acc;
    color: #fff;
    border-color: #007acc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.taxonomy-name {
    font-weight: 500;
}

.taxonomy-count {
    background: rgba(0, 122, 204, 0.1);
    color: #007acc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    border: 1px solid rgba(0, 122, 204, 0.2);
}

.taxonomy-link:hover .taxonomy-count {
    background: rgba(255, 255, 255, 0.9);
    color: #007acc;
    border-color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    nav ul, .top-menu .menu {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .post {
        padding: 1.5rem;
    }

    .post-header h1 {
        font-size: 1.8rem;
    }

    .post-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Article list responsive */
    .content-box {
        margin: 10px 0;
        padding: 15px;
    }

    .posts-default-img img {
        height: 200px;
    }

    .posts-default-title .post-title {
        font-size: 20px;
    }

    .posts-text {
        font-size: 13px;
    }

    .posts-default-info .left {
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-container {
        margin: 24px 0;
        gap: 1px;
    }

    .pagination-link {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 0 6px;
    }

    /* Taxonomy responsive */
    .categories-list, .tags-list, .taxonomy-list {
        gap: 6px;
        margin-top: 20px;
    }

    .category-link, .tag-link, .taxonomy-link {
        padding: 6px 12px;
        font-size: 12px;
        gap: 5px;
    }
}

/* Footer */
.footer {
    text-align: center;
    background: #303133;
    color: #909399;
    height: 120px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    justify-content: center;
    margin-top: 40px;
}

.footer .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.footer span {
    margin: 2px 0;
    display: block;
}

.footer .beian {
    margin-top: 8px;
}

.footer .beian a {
    color: #909399;
    text-decoration: none;
    font-size: 14px;
}

.footer .beian a:hover {
    color: #fff;
}

@media (max-width: 767px) {
    .footer {
        font-size: 12px;
        height: 100px;
    }
}
