/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #2563eb;
    transition: color 0.3s;
}

a:hover {
    color: #1d4ed8;
}

/* 顶部导航栏 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 5%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

.search-box {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #2563eb;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.login-btn {
    border: 1px solid #e5e7eb;
    background-color: transparent;
    color: #333;
}

.login-btn:hover {
    background-color: #f3f4f6;
}

.register-btn {
    background-color: #2563eb;
    color: white;
    border: 1px solid #2563eb;
}

.register-btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* 用户信息卡片 */
.user-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 5% 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6b7280;
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6b7280;
}

.user-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 帖子列表 */
.main-content {
    padding: 0 5% 40px;
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
}

.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.article-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-content {
    padding: 15px;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.article-status {
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-normal {
    color: #10b981;
    background-color: #ecfdf5;
}

.status-offline {
    color: #ef4444;
    background-color: #fef2f2;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    background-color: #f3f4f6;
}

.page-btn.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* 帖子描述 */
.article-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* 元信息容器 */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #f3f4f6;
    border-radius: 4px;
    color: #4b5563;
    margin-right: 6px;
}

/* 图标样式 */
.icon-calendar,
.icon-tag,
.icon-school {
    font-size: 12px;
    color: #9ca3af;
}

/* 修复标题颜色 */
.article-card-link {
    text-decoration: none;
    color: inherit;
}

.article-card-link:hover {
    color: inherit;
}
/*用户信息样式 */
 .user-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
        }
/* 作者信息样式 */
.article-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-default {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6b7280;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 14px;
    font-weight: 500;
}

.author-uid {
    font-size: 12px;
    color: #6b7280;
}

/* 横向展示学校列表样式 */
.schools-container-horizontal {
    background-color: #fff;
    padding: 15px 5%;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.schools-header {
    margin-bottom: 15px;
}

.schools-list-horizontal {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #3B82F6 #f0f0f0;
}

.schools-list-horizontal::-webkit-scrollbar {
    height: 6px;
}

.schools-list-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.schools-list-horizontal::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.school-card-horizontal {
    flex: 0 0 280px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.school-card-horizontal:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.school-card-header-horizontal {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #f8f9fa;
}

.school-image-horizontal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    margin-right: 12px;
}

.school-image-default-horizontal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    margin-right: 12px;
}

.school-info-horizontal {
    flex: 1;
}

.school-name-horizontal {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.view-school-btn {
    display: inline-block;
    padding: 4px 8px;
    background-color: #3B82F6;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.view-school-btn:hover {
    background-color: #2563EB;
}

.school-jianjie-horizontal {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 为交友盲盒添加特殊样式 */
.blind-box-card {
    background-color: #fff8f8;
    border: 1px solid #ffd6d6;
}

.blind-box-card .school-image-default-horizontal {
    background-color: #ffeef0;
    color: #ff6b8b;
    font-size: 24px;
}

.blind-box-card .view-school-btn {
    background-color: #ff6b8b;
}

.blind-box-card .view-school-btn:hover {
    background-color: #e64a70;
}

/* 弹窗基础样式 */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    opacity: 1;
}

/* 弹窗内容区域 */
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

/* 弹窗头部 */
.modal-header {
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/* 关闭按钮 */
.close-btn {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #666;
}

/* 弹窗主体内容 */
.modal-body {
    padding: 20px;
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}

/* 弹窗底部按钮 */
.modal-footer {
    padding: 12px 20px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

.confirm-btn {
    padding: 8px 16px;
    background-color: #3B82F6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.confirm-btn:hover {
    background-color: #2563EB;
}

/* 动画效果 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -52%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 响应式设计 - 移动端一行显示两个帖子 */
@media (max-width: 768px) {
    .article-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .article-card {
        min-width: 0;
        margin: 0;
    }
    
    .article-image {
        height: 120px;
    }
    
    .article-title {
        font-size: 16px;
        -webkit-line-clamp: 1;
        margin-bottom: 5px;
    }
    
    .article-description {
        display: none;
    }
    
    .article-meta {
        flex-wrap: nowrap;
        overflow: hidden;
        gap: 5px;
    }
    
    .meta-item {
        display: none;
    }
    
    /* 只显示日期和状态 */
    .meta-item:first-child,
    .article-status {
        display: flex !important;
        font-size: 11px;
    }
    
    .article-content {
        padding: 10px;
    }
    
    .article-author {
        margin-bottom: 5px;
    }
    
    .author-avatar, 
    .author-avatar-default {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .author-name {
        font-size: 12px;
    }
    
    .author-uid {
        display: none;
    }
    
    .article-status {
        font-size: 11px;
        padding: 2px 5px;
    }
    
    /* 学校卡片在移动端的调整 */
    .school-card-horizontal {
        flex: 0 0 240px;
    }
}

/* 更小的移动设备优化 */
@media (max-width: 480px) {
    .article-list {
        grid-template-columns: 1fr;
    }
    
    .article-image {
        height: 150px;
    }
    
    .article-title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }
    
    .article-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
    }
    
    .article-meta {
        flex-wrap: wrap;
    }
    
    .meta-item {
        display: flex;
    }
}