/* Blog Specific Styles */

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    animation: slideInRight 0.3s ease-out;
    white-space: pre-line;
    line-height: 1.5;
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notification button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.notification button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* New Post Styles */
.post-card.new-post {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    position: relative;
}

.post-card.new-post::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    z-index: -1;
    animation: pulse 2s infinite;
}

.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8rem 0 4rem;
    text-align: center;
}

.blog-header-content h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-header-content p {
    font-size: var(--font-size-xl);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.blog-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.blog-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-lg);
}

.blog-stats .stat i {
    font-size: var(--font-size-xl);
    opacity: 0.8;
}

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-logo i {
    font-size: 2rem;
}

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

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--gray-600);
}

.lang-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    transition: all 0.3s ease;
}

/* Blog Categories */
.blog-categories {
    background: var(--white);
    padding: 2rem 0;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 80px;
    z-index: 100;
}

/* Blog Controls */
.blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 400px;
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-size: var(--font-size-sm);
    background: transparent;
}

.search-input::placeholder {
    color: var(--gray-500);
}

.search-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.publish-container {
    display: flex;
    align-items: center;
}

.categories-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--font-size-sm);
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Blog Posts */
.blog-posts {
    padding: 4rem 0;
    background: var(--gray-50);
}

/* 加载指示器样式 */
.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 无文章提示样式 */
.no-posts-message {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.no-posts-content {
    text-align: center;
    color: var(--gray-600);
}

.no-posts-content i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.no-posts-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.no-posts-content p {
    font-size: 1rem;
    margin: 0;
    max-width: 400px;
}

.loading-indicator p {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.post-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.post-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-excerpt {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.post-read-time {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.read-more-btn {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    gap: 0.5rem;
}

/* Load More Button */
.load-more-container {
    text-align: center;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1rem;
}

.newsletter-text p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: var(--font-size-base);
}

.newsletter-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Article Page Styles */
.article-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8rem 0 4rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.article-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-excerpt {
    font-size: var(--font-size-xl);
    opacity: 0.9;
    line-height: 1.6;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: var(--white);
}

.article-content h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--gray-800);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.article-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--gray-700);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.article-content blockquote {
    background: var(--gray-50);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--gray-700);
}

.article-content code {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--gray-900);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-header {
        padding: 6rem 0 3rem;
    }
    
    .blog-header-content h1 {
        font-size: var(--font-size-3xl);
    }
    
    .blog-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categories-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .article-title {
        font-size: var(--font-size-3xl);
    }
    
    .article-content {
        padding: 2rem 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* 发布模态框样式 */
.publish-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.publish-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.publish-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.publish-modal-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.publish-modal-body {
    padding: 2rem;
}

.publish-instructions {
    line-height: 1.6;
}

.publish-instructions h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.publish-instructions ol {
    margin-bottom: 2rem;
}

.publish-instructions li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.publish-instructions code {
    background: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.quick-links {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.quick-links h4 {
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.link-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.link-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.contact-info {
    background: var(--blue-50);
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.contact-info p {
    margin: 0.5rem 0;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.loading-skeleton {
    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;
    }
}

/* 发布文章表单样式 */
.publish-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-group textarea#content {
    min-height: 200px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-dark), #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* 文章管理按钮样式 */
.article-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .article-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edit-btn {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* 发布表单响应式设计 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .publish-form {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .article-actions {
        opacity: 1; /* 在移动设备上始终显示 */
    }
}