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

:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #777;
    --background-color: #f9f9f9;
    --white: #fff;
    --gray: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.publish-btn {
    margin-right: 10px;
    display: none; /* 默认隐藏，登录后显示 */
}

.login-btn {
    margin-right: 10px;
}

.register-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.register-btn:hover {
    background-color: var(--secondary-color);
}

/* 头部样式 */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.logo p {
    font-size: 0.9rem;
    color: var(--light-text);
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 80px 0;
    margin-bottom: 40px;
    border-radius: 8px;
}

.hero-content {
    max-width: 600px;
    text-align: center;
    margin: 0 auto;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.hero-content .primary-btn {
    padding: 12px 24px;
    font-size: 1rem;
}

/* 话题区域样式 */
.topics-section,
.activities-section,
.resources-section {
    margin-bottom: 60px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

.topic-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.category-card p {
    color: var(--light-text);
}

.posts-container,
.activities-container,
.resources-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.post-card,
.activity-card,
.resource-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover,
.activity-card:hover,
.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-card img,
.activity-card img,
.resource-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-content,
.activity-content,
.resource-content {
    padding: 20px;
}

.post-content h3,
.activity-content h3,
.resource-content h3 {
    margin-bottom: 10px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--light-text);
}

.post-excerpt,
.activity-excerpt,
.resource-excerpt {
    color: var(--text-color);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--light-text);
}

.post-actions span {
    margin-right: 15px;
}

.loading,
.no-data,
.error {
    text-align: center;
    padding: 30px 0;
    color: var(--light-text);
}

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

.error {
    color: var(--accent-color);
}

/* 底部样式 */
footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-info p {
    color: #ccc;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links a,
.footer-contact p {
    color: #ccc;
    margin-bottom: 10px;
    display: block;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    margin-right: 10px;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

.auth-section {
    padding: 40px 0;
}

.auth-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
    max-width: 400px;
    margin: 0 auto;
}

.auth-card h2 {
    margin-bottom: 20px;
    text-align: center;
}

.auth-card h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    width: auto;
    margin-right: 10px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 15px;
    }

    .logo {
        text-align: center;
        margin-bottom: 15px;
    }

    .nav-links {
        margin-bottom: 15px;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 5px 10px;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .topic-categories,
    .posts-container,
    .activities-container,
    .resources-container {
        grid-template-columns: 1fr;
    }
}`}}}