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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

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

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

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

/* 头部导航 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.site-logo h1 {
    font-size: 24px;
    color: #2563eb;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    color: #4b5563;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: 0.3s;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
}

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

.search-btn {
    padding: 12px 30px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #1d4ed8;
}

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

.page-title {
    font-size: 32px;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-description {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 30px;
}

/* 卡片样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    gap: 15px;
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 12px;
}

.card-excerpt {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* 列表样式 */
.topic-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.topic-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.topic-item:hover {
    background: #f9fafb;
}

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

.topic-info {
    flex: 1;
}

.topic-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.topic-meta {
    display: flex;
    gap: 20px;
    color: #9ca3af;
    font-size: 13px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 15px;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 页脚 */
.site-footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 40px 0 20px;
    margin-top: 60px;
}

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

.footer-section h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
    font-size: 14px;
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }
}
