/**
 * Personal Site Theme - 前端主样式
 * 设计理念：极简、优雅、现代
 */

/* ========== CSS变量 ========== */
:root {
    /* 主色调 */
    --primary-color: #2d3748;
    --primary-dark: #1a202c;
    --primary-light: #4a5568;
    
    /* 点缀色 */
    --accent-color: #c4a57b;
    --accent-light: #d4b896;
    --accent-dark: #a08558;
    
    /* 背景色 */
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-lighter: #f5f5f5;
    
    /* 边框色 */
    --border-color: #e8e8e8;
    --border-light: #f1f1f1;
    
    /* 文字色 */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #9ca3af;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    
    /* 过渡 */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 全局样式 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-secondary);
    background: var(--bg-lighter);
    line-height: 1.7;
}

/* ========== 前台管理条（登录后顶部工具栏）- 全站统一显示与样式 ========== */
/* 强制所有页面（含说说）都显示且置于最顶层，避免被遮挡 */
#wpadminbar {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    visibility: visible !important;
    display: block !important;
}
body.admin-bar #wpadminbar {
    top: 0;
    z-index: 999999;
    min-height: 32px;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
body.admin-bar #wpadminbar .ab-item,
body.admin-bar #wpadminbar a.ab-item {
    color: var(--text-secondary) !important;
    font-size: 13px;
}
body.admin-bar #wpadminbar .ab-item:hover,
body.admin-bar #wpadminbar a.ab-item:hover {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
}
body.admin-bar #wp-admin-bar-site-name > .ab-item {
    color: var(--text-primary) !important;
    font-weight: 600;
}
body.admin-bar #wpadminbar .ab-submenu {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
@media screen and (max-width: 782px) {
    body.admin-bar #wpadminbar {
        min-height: 46px;
    }
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-dark);
}

/* ========== 导航栏 - 透明玻璃态 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 20px 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 20px !important;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: var(--bg-light);
    color: var(--text-primary) !important;
}

/* ========== 页面标题 ========== */
.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 16px;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

/* ========== 博客卡片 - 悬浮设计 ========== */
.blog-post {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 28px;
    margin-bottom: 32px;
}

.blog-post:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.blog-post .post-thumbnail {
    margin: -28px -28px 20px -28px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.blog-post .post-thumbnail img {
    width: 100%;
    height: auto;
    transition: var(--transition);
}

.blog-post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.blog-post .post-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.blog-post .post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.blog-post .post-title a:hover {
    color: var(--accent-color);
}

.blog-post .post-meta {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.blog-post .post-meta i {
    color: var(--accent-color);
    margin-right: 4px;
}

.blog-post .post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ========== 按钮 ========== */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-light);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* ========== 侧边栏小工具 ========== */
.widget {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: none;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-lighter);
    transition: var(--transition);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li:hover {
    padding-left: 8px;
}

.widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.widget ul li a:hover {
    color: var(--accent-color);
}

/* ========== 说说时间线 ========== */
.moments-timeline {
    position: relative;
}

.moment-item {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.moment-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.moment-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.moment-author {
    color: var(--text-primary);
    font-weight: 600;
}

.moment-date {
    font-size: 13px;
    color: var(--text-tertiary);
}

.moment-mood {
    font-size: 18px;
}

.moment-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.moment-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

.moment-image {
    border-radius: 8px;
    overflow: hidden;
}

/* ========== 工具卡片 ========== */
.tool-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.tool-thumbnail {
    overflow: hidden;
    height: 200px;
}

.tool-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

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

.tool-title a:hover {
    color: var(--accent-color);
}

.tool-excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.tool-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.tool-meta i {
    color: var(--accent-color);
}

/* ========== 工具下载盒子 ========== */
.tool-download-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    border: 2px dashed var(--border-color);
}

/* ========== 单个博客文章 ========== */
.blog-single {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.blog-single h1 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.blog-single .post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.blog-single .post-content h2 {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 16px;
}

.blog-single .post-content h3 {
    font-size: 22px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.blog-single .post-content p {
    margin-bottom: 20px;
}

.blog-single .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.blog-single .post-content code {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-dark);
}

.blog-single .post-content pre {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
}

.blog-single .post-tags {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* ========== 评论区 ========== */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-body {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.comment-avatar img {
    border-radius: 50%;
}

.comment-author {
    color: var(--text-primary);
    font-weight: 600;
}

.comment-date {
    color: var(--text-tertiary);
    font-size: 13px;
}

.comment-content {
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.7;
}

.comment-reply {
    margin-top: 12px;
}

.comment-reply a {
    font-size: 13px;
    font-weight: 500;
}

/* ========== 分页 ========== */
.pagination {
    margin-top: 40px;
}

.pagination .page-link {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 10px 18px;
    margin: 0 4px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination .page-link:hover {
    background: var(--bg-light);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: transparent;
    color: #fff;
}

/* ========== 页脚样式 ========== */
.site-footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color)) !important;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.03)"/></svg>');
    opacity: 0.5;
}

.site-footer .container {
    position: relative;
    z-index: 1;
}

.site-footer a {
    transition: var(--transition);
}

.site-footer a:hover {
    opacity: 1 !important;
    color: var(--accent-light) !important;
}

.icp-info {
    padding: 8px 0;
}

.icp-info a {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.icp-info a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.footer-menu li {
    display: inline-block;
    margin: 0 12px;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 14px;
    transition: var(--transition);
}

.footer-menu a:hover {
    color: #fff !important;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
    }
    
    .blog-post {
        padding: 20px;
    }
    
    .blog-post .post-thumbnail {
        margin: -20px -20px 16px -20px;
    }
    
    .blog-single {
        padding: 24px;
    }
    
    .blog-single h1 {
        font-size: 28px;
    }
    
    .footer-menu li {
        display: block;
        margin: 8px 0;
    }
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-post,
.moment-item,
.tool-card,
.widget {
    animation: fadeInUp 0.6s ease-out;
}

/* ========== 滚动条优化 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ========== 首页粒子背景 ========== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#particles-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 首页主内容在粒子之上 */
.site-main-home {
    position: relative;
    z-index: 1;
}

/* 首页内容区域略加背景，保证文字可读 */
.site-main-home .homepage-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

/* 首页正文区域居中 */
.site-main-home .content-wrapper {
    text-align: center;
}
