/* 重置样式 */
* {
    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-color: #f5f5f5;
}

/* 容器 */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1em;
}

/* 头部 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

.site-title {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.site-title:hover {
    color: #3498db;
}

/* 导航 */
.main-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #f8f9fa;
}

/* 主要内容 */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* 帖子列表 */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
}

/* 单个帖子卡片 */
.post-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1.2rem 1.5rem;
    transition: box-shadow 0.2s;
    border: 1px solid #f0f0f0;
}
.post-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #e0e0e0;
}

/* 帖子标题行 */
.post-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    word-break: break-all;
}

.post-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}
.post-title a:hover {
    color: #0078ff;
    text-decoration: underline;
}

/* 属性标签 */
.attribute-tag {
    color: #e74c3c;
    font-weight: 500;
    font-size: 0.95em;
    background: #fff0f0;
    border-radius: 3px;
    padding: 0 0.4em;
    margin-right: 0.2em;
}

/* 帖子元信息 */
.post-meta {
    font-size: 0.95em;
    color: #888;
    display: flex;
    gap: 1.2em;
    flex-wrap: wrap;
}
.post-meta .author {
    color: #0078ff;
}
.post-meta .views {
    color: #e67e22;
}

/* 帖子内容 */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 2rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-content .ubbimg {
    display: block;
    margin: 1rem auto;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* 搜索框 */
.search-form {
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

/* 搜索结果 */
.search-results {
    margin-top: 2rem;
}

.search-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.no-results p {
    color: #666;
    font-size: 1.1rem;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .search-container {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
}

/* 页脚 */
.footer {
    background-color: #fff;
    padding: 1rem 0;
    text-align: center;
    color: #666;
    border-top: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 附件样式 */
.attachment-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.attachment-icon {
    color: #666;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分页样式 */
.pagination {
    display: flex;
    gap: 0.5em;
    justify-content: center;
    margin: 2em 0 1em 0;
}
.page-link {
    display: inline-block;
    padding: 0.35em 1em;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: background 0.2s, color 0.2s;
}
.page-link.active, .page-link:hover {
    background: #0078ff;
    color: #fff;
    border-color: #0078ff;
}

/* 无帖子时的提示 */
.no-posts {
    text-align: center;
    color: #aaa;
    font-size: 1.1em;
    margin: 2em 0;
}

/* 帖子详情页样式 */
.post-detail {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.post-header .post-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.post-attachments {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.post-attachments h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.error-message {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.error-message p {
    color: #666;
    font-size: 1.1rem;
} 