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

/* 护眼浅绿色背景 */
body {
    background-color: #f1f8e9;
    color: #37474f;
    line-height: 1.6;
}

/* 绿色顶部栏 - 更紧凑 */
.header {
    background-color: #2E8B57;
    color: #f8f3e9;
    padding: 12px 15px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-bottom: 2px solid #3a7a47;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    font-weight: 700;
}

.header .version {
    font-size: 13px;
    opacity: 0.9;
}

/* 导航栏：水平显示，不换行 */
.nav {
    background-color: #FFF;
    padding: 8px 0;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border-bottom: 1px solid #d8cbb8;
    overflow-x: auto;
    white-space: nowrap;
}

.nav .container {
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
}

.nav a {
    color: #438e52;
    font-weight: 700;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav a:hover {
    text-decoration: underline;
    background-color: #f1ede3;
    color: #3a7a47;
    transform: translateY(-1px);
}

/* 容器：移动端自适应 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
}

/* 卡片样式 - 更紧凑 */
.card {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    border: 1px solid #d8cbb8;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: -3px;
    bottom: -3px;
    background: transparent;
    border: 1px solid #c8b9a8;
    z-index: -1;
    border-radius: 7px;
}

/* 帖子项仿贴吧设计 - 更紧凑 */
.post-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #d8cbb8;
}

.post-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d8cbb8;
}

.post-main {
    flex: 1;
}

.post-tags {
    margin-bottom: 5px;
}

.post-essence-tag {
    display: inline-block;
    padding: 2px 5px;
    margin-right: 4px;
    background-color: #FF8C00;
    color: white;
    font-size: 11px;
    border-radius: 3px;
    font-weight: bold;
}

.post-admin-tag {
    display: inline-block;
    padding: 2px 5px;
    background-color: #E74C3C;
    color: white;
    font-size: 11px;
    border-radius: 3px;
    margin-right: 4px;
}

.post-title {
    font-size: 17px;
    color: #438e52;
    margin-bottom: 5px;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 6px 0;
}

.post-title:hover {
    color: #3a7a47;
}

.post-image-tag {
    color: #3498DB;
    font-size: 11px;
    margin-left: 4px;
}

.post-meta {
    font-size: 12px;
    color: #8d7360;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-replies {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.post-content {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #5d4037;
    font-size: 13px;
}

/* 图片横向显示 - 始终不换行 */
.post-images {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.post-images::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.post-images img {
    height: 80px;
    width: auto;
    object-fit: cover;
    border-radius: 3px;
    border: 2px solid #f8f3e9;
    flex-shrink: 0;
}

.post-images-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

/* 搜索区域：紧凑布局 - 美化 */
.search-area {
    background-color: #FAFAFA;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #D4C8B8;
}

.search-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.search-input-group input {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #D4C8B8;
    border-radius: 20px;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    outline: none;
    border-color: #2E8B57;
    box-shadow: inset 0 1px 3px rgba(46,139,87,0.1), 0 0 5px rgba(46,139,87,0.2);
}

.search-history {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.history-item {
    display: inline-block;
    margin-right: 6px;
    cursor: pointer;
    color: #2E8B57;
    background-color: #f1f8e9;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #d8cbb8;
    transition: all 0.2s ease;
}

.history-item:hover {
    background-color: #e1f0d2;
    text-decoration: none;
}

/* 筛选面板样式 - 横向排列 */
.filter-panel {
    margin-top: 10px;
}

.filter-header {
    padding: 8px 10px;
    background-color: #F5F0E1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #333;
    border-radius: 4px;
}

.filter-toggle {
    transition: transform 0.3s ease;
}

.filter-content {
    padding: 10px;
    display: block;
}

.filter-panel.collapsed .filter-content {
    display: none;
}

.filter-panel.collapsed .filter-toggle {
    transform: rotate(180deg);
}

.filter-group {
    display: inline-flex;
    flex-direction: column;
    margin-right: 12px;
    margin-bottom: 6px;
    vertical-align: top;
    min-width: 120px;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.filter-group select {
    padding: 5px 8px;
    border: 1px solid #D4C8B8;
    border-radius: 3px;
    font-size: 13px;
    background: white;
}

.logic-options {
    display: flex;
    gap: 6px;
}

.logic-options label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.filter-btns {
    margin-top: 6px;
    text-align: right;
}

/* 精华帖子区 - 更紧凑 */
.essence-posts-bar {
    background-color: #FFF;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border: 1px solid #FF8C00;
}

.essence-posts-bar h3 {
    margin-bottom: 8px;
    color: #FF8C00;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.essence-posts-bar h3::before {
    content: "[精华]";
    margin-right: 6px;
    font-weight: bold;
}

.essence-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.essence-post-item {
    padding: 5px 0;
    border-bottom: 1px dashed #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.essence-post-title {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
    padding: 3px 0;
}

.essence-post-title:hover {
    color: #FF8C00;
    text-decoration: underline;
}

.essence-post-meta {
    font-size: 11px;
    color: #666;
}

.essence-more {
    margin-top: 8px;
    text-align: right;
}

.essence-more a {
    color: #FF8C00;
    text-decoration: underline;
}

.essence-empty {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* 结果统计 - 更紧凑 */
.result-stats {
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

/* 纠错提示 - 更紧凑 */
.correction-tip {
    padding: 6px 10px;
    background-color: #E8F5E9;
    border-left: 3px solid #2E8B57;
    margin-bottom: 10px;
    color: #2E7D32;
    font-size: 13px;
}

/* 分页 - 更紧凑 */
.pagination {
    text-align: center;
    margin: 12px 0;
}

.pagination a {
    display: inline-block;
    padding: 5px 8px;
    background-color: #FFF;
    border: 1px solid #D4C8B8;
    color: #2E8B57;
    text-decoration: none;
    margin: 0 3px;
    border-radius: 3px;
    font-size: 13px;
}

.pagination a.active {
    background-color: #2E8B57;
    color: white;
}

/* 底部栏 - 更紧凑 */
.footer {
    background-color: #2E8B57;
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: 16px;
    font-size: 13px;
}

/* 无结果样式 - 更紧凑 */
.no-results {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.no-results p {
    margin-bottom: 6px;
}

/* 按钮样式 - 美化 */
.btn {
    background-color: #438e52;
    font-weight: 700;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
    background-color: #3a7a47;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-clear {
    color: #D32F2F;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 3px;
}

.btn-clear:hover {
    background-color: #ffebee;
}

/* 搜索高亮 */
.search-highlight {
    background-color: #FFF3CD;
    color: #D35400;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

/* 移动端适配：屏幕小于768px时 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 22px;
    }

    .nav .container {
        gap: 6px;
        padding: 0 8px;
    }

    .nav a {
        padding: 4px 8px;
        font-size: 13px;
    }

    .container {
        padding: 0 8px;
    }

    .card {
        padding: 12px;
    }

    .post-item {
        flex-direction: column;
        gap: 6px;
    }

    .post-avatar {
        width: 38px;
        height: 38px;
    }

    .post-title {
        font-size: 15px;
    }

    .post-meta {
        font-size: 11px;
        gap: 4px;
    }

    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-group input {
        margin-bottom: 6px;
    }

    .filter-group {
        display: block;
        margin-right: 0;
        width: 100%;
        min-width: auto;
    }

    .logic-options {
        flex-direction: column;
        gap: 3px;
    }
    
    /* 移动端图片显示调整 */
    .post-images img {
        height: 70px;
    }
    
    .post-images-more {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 8px;
    }

    .card::before {
        top: 2px;
        left: 2px;
        right: -2px;
        bottom: -2px;
    }

    .post-images img {
        height: 60px;
    }

    .post-images-more {
        width: 60px;
        height: 60px;
    }
}
