/*
Theme Name: 知我主题
Theme URI: https://suyinggang.cn
Author: 苏英刚
Author URI: https://suyinggang.cn
Description: 现代风格的 WordPress 主题，简洁优雅，专注于内容展示
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zhiwo
Tags: modern, responsive, clean, minimalist, content-focused, bootstrap

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* 自定义颜色变量 */
:root {
    --primary-color: #6c5ce7;
    --primary-dark: #a29bfe;
    --gray-500: #95a5a6;
    --gray-600: #636e72;
    --gray-700: #2d3436;
}

/* 基础样式 */
body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--gray-700);
    background-color: #f8f9fa;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1.2rem;
    color: var(--gray-700);
    font-family: 'Noto Serif SC', serif;
}

/* 段落样式 */
p {
    margin-bottom: 1.2rem;
    color: var(--gray-600);
}

/* 布局样式 */
.content-container {
    padding: 2rem 0;
}

/* 头部样式 */
.header {
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-branding {
    flex: 0 0 auto;
    max-width: 80px;
}

.logo-wrapper img {
    max-width: 100%;
    height: auto;
}

.site-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--primary-color);
}

.site-title a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.site-description {
    font-style: italic;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* 导航菜单 */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align::left;
}

.nav-menu li {
    position: relative;
}

#primary-menu {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#primary-menu .nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
}

#primary-menu .nav-link:hover {
    background-color: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

#primary-menu .nav-link:hover::after {
    display: none;
}

#mobile-primary-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 搜索框样式 */
.search-box .form-control {
    border-radius: 20px;
    width: 200px;
    transition: all 0.3s ease;
}

.search-box .form-control:focus {
    width: 250px;
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

/* 通知按钮 */
.notification-btn {
    position: relative;
}

.notification-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 用户头像 */
.user-avatar img {
    transition: transform 0.3s ease;
}

.user-avatar:hover img {
    transform: scale(1.05);
}

/* 移动端菜单 */
#mobile-menu {
    margin-bottom: 1rem;
}

/* 搜索按钮 */
.search-toggle {
    transition: all 0.3s ease;
}

.search-toggle:hover {
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .search-box .form-control {
        width: 180px;
    }
    
    .search-box .form-control:focus {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions button {
        padding: 0.25rem;
    }
    
    .user-avatar img {
        width: 28px;
        height: 28px;
    }
    
    .mobile-search-box .form-control {
        border-radius: 20px;
    }
}

@media (max-width: 576px) {
    .site-title {
        font-size: 1.125rem;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
}

/* 搜索弹出框 */
.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(108, 92, 231, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.search-popup-content {
    background-color: white;
    padding: 50px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6c5ce7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-close:hover {
    transform: rotate(90deg);
}

.search-form-content {
    display: flex;
    gap: 15px;
}

.search-field {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.search-submit {
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.search-submit:hover {
    background-color: #a29bfe;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.4);
}

/* 面包屑导航 */
.breadcrumb {
    font-size: 14px;
}

.breadcrumb a {
    color: #6c5ce7;
}

.breadcrumb a:hover {
    color: #a29bfe;
}

/* 文章卡片 */
.post-card {
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.post-thumbnail {
    overflow: hidden;
}

.thumbnail-img {
    transition: transform 0.5s ease;
}

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

.post-category {
    background-color: rgba(108, 92, 231, 0.9);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.post-title {
    font-family: 'Noto Serif SC', serif;
}

.post-title a {
    transition: all 0.3s ease;
}

.post-title a:hover {
    color: #6c5ce7;
    text-decoration: none;
}

.post-meta span {
    transition: color 0.3s ease;
}

.post-meta span:hover {
    color: #6c5ce7;
}

/* 分页导航 */
.pagination .page-item .page-link {
    transition: all 0.3s ease;
}

.pagination .page-item .page-link:hover {
    background-color: #6c5ce7;
    color: white;
    border-color: #6c5ce7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.pagination .page-item.active .page-link {
    background-color: #6c5ce7;
    color: white;
    border-color: #6c5ce7;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

/* 侧边栏 */
.widget {
    transition: all 0.3s ease;
}

.widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.widget-title {
    font-family: 'Noto Serif SC', serif;
    border-bottom: 2px solid #6c5ce7;
}

/* 单篇文章 */
.single-post {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.single-post .post-title {
    font-family: 'Noto Serif SC', serif;
}

.single-post .post-thumbnail {
    border-radius: 12px;
    overflow: hidden;
}

.single-post .post-thumbnail .thumbnail-img {
    transition: transform 0.5s ease;
}

.single-post .post-thumbnail:hover .thumbnail-img {
    transform: scale(1.02);
}

.single-post .post-content h2, .single-post .post-content h3 {
    font-family: 'Noto Serif SC', serif;
}

.single-post .post-content img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 相关文章 */
.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.related-post-item {
    transition: transform 0.3s ease;
}

.related-post-item:hover {
    transform: translateY(-5px);
}

.related-post-title a {
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: #6c5ce7;
}

/* 评论区域 */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.comment-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comment-reply-link {
    color: #6c5ce7;
    transition: color 0.3s ease;
}

.comment-reply-link:hover {
    color: #a29bfe;
}

/* 小工具样式 */
.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.widget li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget a {
    color: #333;
    transition: color 0.3s ease;
}

.widget a:hover {
    color: #6c5ce7;
}

/* 搜索小工具 */
.widget_search .search-form {
    display: flex;
    gap: 10px;
}

.widget_search .search-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.widget_search .search-submit {
    padding: 8px 16px;
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.widget_search .search-submit:hover {
    background-color: #a29bfe;
}

/* 分类小工具 */
.widget_categories li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget_categories .count {
    color: #7f8c8d;
    font-size: 12px;
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 标签云 */
.widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.widget_tag_cloud a {
    display: inline-block;
    padding: 4px 12px;
    background-color: #f5f5f5;
    border-radius: 15px;
    font-size: 12px !important;
    transition: all 0.3s ease;
}

.widget_tag_cloud a:hover {
    background-color: #6c5ce7;
    color: white;
}

/* 最新文章小工具 */
.widget_recent_entries li {
    display: flex;
    gap: 10px;
}

.widget_recent_entries .post-date {
    font-size: 12px;
    color: #7f8c8d;
    flex-shrink: 0;
}

/* 代码块样式 */
pre {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 引用样式 */
blockquote {
    border-left: 4px solid #6c5ce7;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background-color: #f9f9f9;
}

/* 404页面增强 */
.error-404 .error-code {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 过渡效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 55px;
    height: 55px;
    line-height: 55px;
    text-align: center;
    background-color: #6c5ce7;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    display: none;
    font-size: 20px;
}

.back-to-top:hover {
    background-color: #a29bfe;
    transform: translateY(-8px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .site-title {
        font-size: 24px;
    }
    
    .nav-menu {
        justify-content: center;
        gap: 15px;
    }
    
    .nav-menu a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .post-thumbnail {
        height: 180px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-title {
        font-size: 18px;
    }
    
    .single-post {
        padding: 30px;
    }
    
    .single-post .post-title {
        font-size: 26px;
    }
    
    .footer {
        padding: 40px 0;
        margin-top: 60px;
    }
    
    .footer-nav {
        justify-content: center;
        gap: 15px;
    }
    
    .footer-nav a {
        padding: 6px 12px;
    }
    
    .footer-social a {
        margin: 0 5px;
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 16px;
    }
    
    .back-to-top {
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-menu a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .post-meta span {
        font-size: 13px;
    }
    
    .single-post {
        padding: 20px;
    }
    
    .single-post .post-title {
        font-size: 22px;
    }
    
    .related-posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .related-thumbnail {
        height: 80px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 16px;
    }
}