/* 搜索页面样式 */
.search-section {
    margin: 40px auto;
    max-width: 800px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-section h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.search-input-group {
    display: flex;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px 0 0 6px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #ff7b54;
}

.search-button {
    background: #ff7b54;
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 0 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-button:hover {
    background: #ff6b3d;
}

.advanced-search {
    margin-top: 15px;
    text-align: left;
}

.advanced-search-toggle {
    color: #666;
    cursor: pointer;
    display: inline-block;
    padding: 5px 0;
    font-size: 14px;
}

.advanced-search-toggle:hover {
    color: #ff7b54;
}

.toggle-icon {
    display: inline-block;
    width: 18px;
    text-align: center;
}

.advanced-search-panel {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #eee;
}

.search-row {
    display: flex;
    margin-bottom: 15px;
}

.search-field {
    flex: 1;
    margin-right: 15px;
}

.search-field:last-child {
    margin-right: 0;
}

.search-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.search-field input,
.search-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 搜索结果页样式 */
.search-summary {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.search-summary p {
    margin: 5px 0;
}

.search-summary strong {
    color: #ff7b54;
}

.search-filter {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.search-filter span {
    font-size: 14px;
    color: #666;
    margin-right: 10px;
}

.filter-option {
    margin-right: 15px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
}

.filter-option:hover {
    color: #ff7b54;
}

.filter-option.active {
    background: #ff7b54;
    color: white;
}

/* 用户搜索结果样式 */
.users-section {
    margin-top: 30px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #333;
}

.users-container {
    margin-top: 15px;
}

.users-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.user-card {
    flex: 0 0 calc(25% - 15px);
    max-width: calc(25% - 15px);
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.user-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.user-link {
    display: flex;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.user-avatar {
    flex: 0 0 60px;
    margin-right: 15px;
}

.avatar-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #333;
}

.user-title {
    font-size: 13px;
    color: #ff7b54;
    margin-bottom: 5px;
}

.user-signature {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-users {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

/* 错误信息样式 */
.error-message {
    background: #fff0f0;
    color: #d32f2f;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.error-details {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

/* 响应式布局 */
@media (max-width: 992px) {
    .user-card {
        flex: 0 0 calc(33.33% - 15px);
        max-width: calc(33.33% - 15px);
    }
}

@media (max-width: 768px) {
    .user-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
}

@media (max-width: 576px) {
    .user-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====== 修复帖子样式，解决标题和标签重叠问题 ====== */

/* 帖子项样式 */
.post-item {
    display: flex;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    height: auto;
    min-height: 140px;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.post-thumbnail {
    width: 200px;
    min-width: 200px;
    height: 140px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
    position: relative;
}

/* 修复标题样式，确保不被覆盖 */
.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    padding: 0;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 45px; /* 大约2行文字高度 */
    position: relative;
    z-index: 2; /* 提高层级，确保在标签上方 */
}

/* 修复标签布局，确保不与标题重叠 */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    margin: 8px 0;
    gap: 6px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.tag {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    text-decoration: none;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-more {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

/* 修复其他元素样式，确保正确布局 */
.post-meta {
    display: flex;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.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-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.post-cover {
    height: 180px;
    overflow: hidden;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.post-card:hover .post-cover img {
    transform: scale(1.05);
}

.post-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #ff7b54;
}

.post-category {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.post-category a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.post-category a:hover {
    color: #ff7b54;
}

.post-time {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* 分页样式 */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: white;
    color: #666;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f0f0f0;
}

.page-link.current {
    background: #ff7b54;
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.page-ellipsis {
    padding: 8px 12px;
    color: #666;
}

/* 修复标题和标签重叠的问题（移动端适配） */
@media (max-width: 768px) {
    .post-item {
        flex-direction: column;
        height: auto;
    }

    .post-thumbnail {
        width: 100%;
        height: 180px;
    }

    .post-content {
        padding: 15px;
    }

    .post-title {
        margin-bottom: 10px;
    }

    .post-tags {
        margin: 10px 0;
    }

    .post-meta {
        flex-wrap: wrap;
    }
}

/* 页面加载动画 */
.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;
}

/* 无帖子提示 */
.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;
}