/* 锦鲤社区 - 样式表 */
* {
    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: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部 */
header {
    background-color: #ff6b6b;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

.toggle-style {
    border: 1px solid rgba(255,255,255,0.5);
}

/* 主体 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* 底部 */
footer {
    background-color: #333;
    color: #aaa;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

.form-group .required {
    color: #ff6b6b;
}

.form-group small {
    color: #999;
    font-size: 0.85rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox input {
    width: auto;
}

.checkbox label {
    margin: 0;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #d0d0d0;
}

.btn-primary {
    background-color: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background-color: #ff5252;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* 提醒框 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 登录页 */
.login-box {
    max-width: 500px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #ff6b6b;
}

.intro {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.features {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.feature-item {
    text-align: center;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 4px;
}

.feature-item strong {
    color: #ff6b6b;
}

.feature-item p {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar form {
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 分类导航 */
.category-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-nav a {
    padding: 0.4rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-nav a:hover,
.category-nav a.active {
    background-color: #ff6b6b;
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: white;
    border-radius: 8px;
}

.empty-state p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* 卡片网格布局 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.post-header {
    margin-bottom: 0.5rem;
}

.post-header h3 {
    font-size: 1.1rem;
    line-height: 1.4;
}

.post-header h3 a {
    color: #333;
    text-decoration: none;
}

.post-header h3 a:hover {
    color: #ff6b6b;
}

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #fff0f0;
    color: #ff6b6b;
    font-size: 0.8rem;
    border-radius: 3px;
    margin-top: 0.5rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.8rem;
}

.distance {
    color: #4caf50;
}

.post-excerpt {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-price {
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.post-card .btn {
    width: 100%;
    text-align: center;
}

/* 纯文本列表样式 */
.posts-list {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.post-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background-color: #fafafa;
}

.post-title a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

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

.post-meta-text {
    font-size: 0.85rem;
    color: #999;
}

/* 发布表单 */
.create-form {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.create-form h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* 详情页 */
.post-detail {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.post-header-detail h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #333;
}

.post-meta-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 1rem;
}

.post-price-detail {
    font-size: 1.4rem;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.post-contact-detail {
    background-color: #f5f5f5;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.post-content {
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin: 1.5rem 0 1rem 0;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 4px;
}

/* 评论区 */
.comments-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.comment-form {
    margin-bottom: 2rem;
}

.login-prompt {
    background-color: #f5f5f5;
    padding: 1rem;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.login-prompt a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
}

.comment-item {
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.comment-author {
    font-weight: 500;
    color: #ff6b6b;
}

.comment-time {
    color: #999;
}

.comment-content {
    color: #444;
    line-height: 1.5;
}

/* 响应式适配移动端 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-detail,
    .create-form,
    .login-box,
    .comments-section {
        padding: 1rem;
    }
    
    .post-header-detail h1 {
        font-size: 1.4rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}
