/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #88b899;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    margin-bottom: 30px;
}

.logo img {
    height: 60px;
    width: auto;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-msg {
    font-size: 14px;
    color: #666;
}

.btn-login, .btn-logout {
    padding: 8px 20px;
    border: 1px solid #88b899;
    color: #88b899;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-login:hover, .btn-logout:hover {
    background: #f0f7f3;
}

.btn-register {
    padding: 8px 20px;
    background: #88b899;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-register:hover {
    background: #76a687;
    color: #fff;
}

/* 点赞按钮样式 */
.like-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 2px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.like-btn.active {
    border-color: #ff4d4f;
    color: #ff4d4f;
    background-color: #fff1f0;
}

.like-btn .heart {
    font-size: 16px;
}

.like-btn:hover {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

/* 评论区域样式 */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.section-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.comment-form-wrapper {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.login-prompt {
    text-align: center;
    color: #666;
    padding: 10px;
}

.login-prompt a {
    color: #88b899;
    font-weight: 600;
}

.comment-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-body {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

/* 主体内容布局 */
.main-content {
    min-height: calc(100vh - 200px);
    padding-bottom: 40px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 30px;
    align-items: start;
}

/* 侧边栏通用样式 */
.sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #88b899;
}

/* 左侧分类导航 */
.category-nav ul {
    list-style: none;
}

.category-nav li {
    margin-bottom: 8px;
}

.category-nav a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    color: #666;
    font-size: 15px;
    transition: all 0.3s ease;
}

.category-nav a:hover {
    background: #f0f7f3;
    color: #88b899;
    transform: translateX(5px);
}

.category-nav a.active {
    background: linear-gradient(135deg, #88b899 0%, #9dc9a8 100%);
    color: #fff;
    font-weight: 500;
}

.back-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f7f3;
    color: #88b899;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #88b899;
    color: #fff;
}

/* 中间主内容区 */
.main-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    min-height: 600px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* 文章列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.post-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.post-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #88b899;
}

.post-thumbnail {
    flex-shrink: 0;
    width: 220px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-title a:hover {
    color: #88b899;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.post-meta span {
    display: flex;
    align-items: center;
}

.post-author {
    color: #88b899;
    font-weight: 500;
}

.post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #f0f0f0;
}

.pagination-btn,
.pagination-link {
    padding: 8px 16px;
    border-radius: 6px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-btn:hover,
.pagination-link:hover {
    background: #88b899;
    color: #fff;
}

.pagination-current {
    padding: 8px 16px;
    border-radius: 6px;
    background: #88b899;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* 右侧用户卡片 */
.user-card {
    text-align: center;
}

.user-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #f0f7f3;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 20px 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #88b899;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

.user-bio {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    text-align: left;
}

/* 文章详情页 */
.post-detail {
    max-width: 100%;
}

.post-header {
    margin-bottom: 30px;
}

.post-title-detail {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    margin-bottom: 20px;
}

.post-meta-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #999;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

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

.separator {
    color: #ddd;
}

.post-thumbnail-detail {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
}

.post-thumbnail-detail img {
    width: 100%;
    height: auto;
}

.post-content-detail {
    font-size: 16px;
    line-height: 2;
    color: #444;
}

.post-content-detail h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.post-content-detail p {
    margin-bottom: 20px;
}

.post-content-detail br {
    display: block;
    content: "";
    margin: 8px 0;
}

.post-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 15px;
    background: #f0f7f3;
    color: #88b899;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* 页脚 */
.footer {
    background: #fff;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.footer p {
    color: #999;
    font-size: 14px;
}

/* 空状态 */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 220px 1fr 260px;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .sidebar-left {
        order: -1;
    }
    
    .main-section {
        order: 0;
    }
    
    .sidebar-right {
        order: 1;
    }
}

@media (max-width: 768px) {
    .post-item {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .post-title-detail {
        font-size: 24px;
    }
    
    .logo img {
        height: 45px;
    }
}
