html, body {
    height: 100%;
}
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', Arial, sans-serif;
    background: #f7f9fb;
    margin: 0;
    color: #222;
    /* 防止布局抖动 */
    overflow-x: hidden;
    /* 实现sticky footer布局 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    /* 确保导航栏稳定 */
    position: relative;
    z-index: 1000;
}
.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3b82f6;
    float: left;
}
.navbar nav {
    display: inline-block;
    margin-left: 2rem;
}
.navbar nav a {
    color: #222;
    text-decoration: none;
    margin-right: 1.5rem;
    font-size: 1rem;
    transition: color 0.2s;
}
.navbar nav a:hover {
    color: #3b82f6;
}
.user-profile {
    float: right;
}
.user-profile-box {
    display: flex;
    align-items: center;
}
.user-profile-box .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 2px solid #e5e7eb;
}
.user-info .nickname {
    font-weight: 600;
    font-size: 1rem;
}
.user-info .bio {
    font-size: 0.9rem;
    color: #666;
}
.main-content {
    flex: 1;
    margin-top: 2rem;
}
.intro-section {
    background: #e0f2fe;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}
.knowledge-section, .article-section {
    margin-bottom: 2.5rem;
}
.kb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.kb-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.2rem 1rem;
    width: 260px;
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.kb-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    color: #2563eb;
}
.kb-card p {
    flex: 1;
    color: #555;
    font-size: 0.98rem;
    margin-bottom: 1rem;
}
.kb-card .btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.4rem 1.2rem;
    text-decoration: none;
    font-size: 0.98rem;
    transition: background 0.2s;
}
.kb-card .btn:hover {
    background: #2563eb;
}
.article-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.article-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.2rem 1rem;
    width: 340px;
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}
.article-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #222;
}
.article-card .meta {
    font-size: 0.92rem;
    color: #888;
    margin-bottom: 0.5rem;
}
.article-card .excerpt {
    color: #444;
    font-size: 0.98rem;
    margin-bottom: 0.7rem;
}
.article-card .tags {
    margin-top: auto;
}
.article-card .tag {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 3px;
    padding: 0.15rem 0.6rem;
    font-size: 0.88rem;
    margin-right: 0.4rem;
    margin-bottom: 0.2rem;
}
.footer {
    background: #f1f5f9;
    color: #888;
    text-align: center;
    padding: 1.2rem 0 0.8rem 0;
    font-size: 0.98rem;
    border-top: 1px solid #e5e7eb;
    /* 确保footer始终在底部 */
    margin-top: auto;
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .kb-list, .article-list {
        flex-direction: column;
        gap: 1rem;
    }
    .kb-card, .article-card {
        width: 100%;
        min-width: 0;
    }
} 