/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 英雄区域 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 2rem;
}

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

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

/* 文章卡片样式 */
.post-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.post-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.post-image-placeholder {
    height: 200px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

/* 渐变缩略图样式 */
.post-image-gradient {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.post-image-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.gradient-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.gradient-text {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: block;
}

.post-featured-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
}

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

.post-tags .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* 文章详情页样式 */
.post-detail {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.post-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.post-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

/* 分享按钮 */
.share-buttons .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 评论区样式 */
.comments-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.comment {
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.comment:hover {
    background: #f8f9fa !important;
}

.comment-form textarea {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 侧边栏样式 */
.sidebar .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.sidebar .card:hover {
    transform: translateY(-2px);
}

.sidebar .card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

.sidebar-post-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* 分页样式 */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 页脚样式 */
.footer {
    margin-top: auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
}

.footer-content {
    padding: 3rem 0 2rem;
    position: relative;
}

.footer-section {
    height: 100%;
}

.footer-title {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-subtitle {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-description {
    color: #b8b8b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* 社交链接 */
.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    background: #007bff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* 页脚链接 */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #b8b8b8;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
    position: relative;
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateX(5px);
}

.footer-links a:hover::before {
    width: 100%;
}

/* 联系信息 */
.contact-info {
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    color: #b8b8b8;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.contact-item i {
    color: #007bff;
    width: 20px;
}



/* 页脚底部 */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    color: #b8b8b8;
    font-size: 0.9rem;
}

.footer-bottom-links a {
    color: #b8b8b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: #007bff;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #007bff, #00d4ff, #007bff);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rotate 3s linear infinite;
}

.back-to-top:hover::before {
    opacity: 1;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    animation: bounceIn 0.6s ease-out;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.5);
}

.back-to-top:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.back-to-top i {
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* 回到顶部按钮动画 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-5px);
    }
    70% {
        transform: scale(0.95) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* 回到顶部按钮脉冲效果 */
.back-to-top::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.3);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.back-to-top:hover::after {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
}

/* 回到顶部按钮文字 */
.back-to-top-text {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(0, 123, 255, 0.9);
    padding: 2px 6px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.back-to-top:hover .back-to-top-text {
    opacity: 1;
    bottom: -30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer-content {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-title {
        font-size: 1.1rem;
    }
    
    .footer-subtitle {
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1.5rem;
    }
    
    .newsletter-form .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    .footer-bottom-links {
        text-align: center !important;
        margin-top: 1rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 576px) {
    .footer-content {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-section {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .footer-links a {
        display: block;
        padding: 0.25rem 0;
    }
    
    .contact-item {
        justify-content: center;
    }
}

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

.footer-section {
    animation: fadeInUp 0.6s ease-out;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }
.footer-section:nth-child(4) { animation-delay: 0.4s; }

.social-links a {
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        margin-top: 70px;
        padding: 1rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .post-title {
        font-size: 1.8rem;
    }
    
    .post-detail,
    .comments-section {
        padding: 1rem;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
}

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

.post-card {
    animation: fadeInUp 0.6s ease forwards;
}

.post-card:nth-child(2) {
    animation-delay: 0.1s;
}

.post-card:nth-child(3) {
    animation-delay: 0.2s;
}

.post-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 工具提示样式 */
.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 6px;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--dark-color);
}

/* 表单样式增强 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* 标签云样式 */
.badge {
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* 图片懒加载占位符 */
.img-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}