/* category.css */
.category-header-section {
    background: linear-gradient(135deg, rgba(58, 123, 213, 0.8), rgba(0, 210, 255, 0.8));
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.category-header-section h1 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.category-header-section h1 i {
    margin-right: 15px;
    font-size: 2rem;
}

.category-tools {
    display: flex;
    gap: 15px;
}

.create-post-btn {
    background-color: #ffffff;
    color: #3a7bd5;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.create-post-btn:hover {
    background-color: #f2f2f2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.create-post-btn i {
    margin-right: 8px;
}

/* 帖子列表样式 */
.posts-container {
    margin-bottom: 40px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

/* 帖子卡片样式 */
.post-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    height: 140px;
    text-decoration: none;
    color: inherit;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.post-thumbnail {
    width: 200px;
    height: 140px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-meta {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.post-author {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-size: 0.85rem;
    color: #666;
}

.post-stats {
    display: flex;
    gap: 15px;
    margin-left: auto;
    color: #888;
    font-size: 0.85rem;
}

.post-stats span {
    display: flex;
    align-items: center;
}

.post-stats i {
    margin-right: 5px;
}

/* 帖子标签样式 */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.tag {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    text-decoration: none;
}

.tag:hover {
    background: linear-gradient(135deg, #4a8be6, #00e0ff);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.tag-more {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

/* 加载动画 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(58, 123, 213, 0.2);
    border-radius: 50%;
    border-top-color: #3a7bd5;
    animation: spin 1s ease-in-out infinite;
}

.loading-text {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 分页样式 */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination-item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    text-decoration: none;
}

.pagination-item:hover {
    background-color: #f0f7ff;
}

.pagination-item.active {
    background-color: #3a7bd5;
    color: white;
}

.pagination-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-header-section {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .post-item {
        flex-direction: column;
        height: auto;
    }

    .post-thumbnail {
        width: 100%;
        height: 180px;
    }

    .post-stats {
        margin-top: 10px;
        margin-left: 0;
    }
}

/* 无内容提示 */
.no-posts {
    text-align: center;
    padding: 40px 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.no-posts p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.no-posts .icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

/* 帖子标记样式 */
.post-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    text-transform: uppercase;
    vertical-align: middle;
}

.post-badge.featured {
    background-color: #ff5722;
    color: white;
}

.post-badge.sticky {
    background-color: #4caf50;
    color: white;
}

/* 图标样式 */
.post-stats span {
    display: flex;
    align-items: center;
    color: #777;
}

.post-stats span i {
    margin-right: 4px;
    font-size: 1.1em;
}

.icon-view:before {
    content: "👁️";
}

.icon-reply:before {
    content: "💬";
}

.icon-like:before {
    content: "👍";
}

/* 搜索相关图标 */
.icon-search:before {
    content: "🔍";
}

.icon-time:before {
    content: "🕒";
}

/* 增强可点击区域的样式 */
.post-stats span {
    padding: 5px;
    transition: color 0.2s ease;
}

.post-stats span:hover {
    color: #3a7bd5;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-element {
    opacity: 0;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 搜索输入框样式 */
.search-container {
    margin: 20px auto 40px;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #3a7bd5, #00d2ff);
}

.search-input-group {
    display: flex;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px 0 0 6px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #3a7bd5;
    box-shadow: 0 0 10px rgba(58, 123, 213, 0.2);
}

.search-button {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 0 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-button:hover {
    background: linear-gradient(135deg, #4a8be6, #00e0ff);
    box-shadow: 0 0 15px rgba(58, 123, 213, 0.3);
}

/* 搜索错误状态 */
.search-error {
    animation: shake 0.6s ease;
    border-color: #ff5858;
    box-shadow: 0 0 10px rgba(255, 88, 88, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Logo Styles */
.logo a {
    display: inline-block;
    text-decoration: none;
}

.logo-image {
    height: 70px; /* 根据你的图片比例调整 */
    width: auto; /* 保持图片原始比例 */
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(58, 123, 213, 0.7));
}

/* 移除原来的文字渐变样式 */
.logo a::after {
    display: none;
}

@media (max-width: 768px) {
    .logo-image {
        height: 65px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 70px;
    }
}

.logo-image {
    /* 添加发光效果 */
    filter: drop-shadow(0 0 5px rgba(58, 123, 213, 0.5));
    transition: all 0.3s ease;
}

.logo-image:hover {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        filter: drop-shadow(0 0 5px rgba(58, 123, 213, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(58, 123, 213, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(58, 123, 213, 0.5));
    }
}