﻿/* 成语页面样式 */
:root {
    --primary-color: #4e8cbb;
    --primary-dark: #3a7cb2;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #f5f5f5;
    --border-color: #e6d8b6;
    --hover-color: #b89b5b;
    --section-bg: #f9f6ec;
    --card-shadow: 0 2px 12px rgba(180,160,100,0.10);
}

.g-bd {
    background-color: var(--bg-color);
}

/* 筛选区域样式 */
.filter-section {
    border-radius: 14px;
    padding: 5px 8px 8px 8px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.filter-header {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header h2 {
    font-size: 19px;
    color: #7c5c1e;
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 筛选按钮样式 */
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4e8cbb, #3a7cb2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-toggle-btn:hover {
    background: linear-gradient(135deg, #3a7cb2, #2d5a8a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filter-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-btn-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* 折叠/展开状态 */
.filter-section.collapsed .filter-content {
    display: none;
}

.filter-section.expanded .filter-content {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.filter-section.collapsed .filter-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 5px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.filter-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.filter-label {
    color: var(--text-light);
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
    min-width: 60px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
}

.filter-options a {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f9f7f0, #f3f0e9);
    color: var(--text-light);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e0d9c8;
}

.filter-options a:hover {
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
    color: var(--text-color);
}

.filter-options a.active {
    background: linear-gradient(to right, #8b6b4a, #d5b788);
    color: #fff;
}

/* 成语列表样式 */
.topic-section {
    background: var(--section-bg);
    border-radius: 14px;
    padding: 5px 8px 8px 8px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 19px;
    color: #7c5c1e;
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.section-info {
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 14px;
}

#categoryTitle {
    color: #7c5c1e;
    font-weight: 500;
    padding: 2px 8px;
    background-color: rgba(184, 155, 91, 0.1);
    border-radius: 4px;
}

#totalCount {
    color: var(--text-lighter);
}

.topic-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.topic-item {
    background: linear-gradient(135deg, #f9f7f0, #f3f0e9);
    border: 1px solid #e0d9c8;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: relative;
}

.topic-item:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #8b6b4a, #d5b788, #8b6b4a);
}

.topic-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
}

.topic-cover {
    height: 100px;
    background: #fcf9f3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chengyu-cover {
    text-align: center;
    padding: 10px;
}

.chengyu-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #d5b788, #8b6b4a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.chengyu-icon span {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.chengyu-cover h3 {
    margin: 5px 0 0;
    font-size: 14px;
    color: #5a442e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.chengyu-cover h3 a {
    color: #5a442e;
    text-decoration: none;
    transition: color 0.3s;
}

.chengyu-cover h3 a:hover {
    color: var(--hover-color);
}

.topic-info {
    padding: 8px;
}

.chengyu-meta {
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-light);
}

.pinyin {
    display: block;
    margin-bottom: 3px;
    color: var(--text-lighter);
    font-size: 11px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.tag {
    display: inline-block;
    padding: 1px 4px;
    background: linear-gradient(135deg, #f9f7f0, #f3f0e9);
    color: var(--text-light);
    border-radius: 2px;
    text-decoration: none;
    font-size: 10px;
    border: 1px solid #e0d9c8;
}

.tag:hover {
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
    color: var(--text-color);
}

.topic-info p {
    margin: 0 0 5px;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta {
    color: var(--text-lighter);
    font-size: 10px;
}

.topic-meta i {
    margin-right: 5px;
}

/* 分页样式 */
.pagination {
    text-align: center;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #e0d9c8;
    border-radius: 4px;
    color: var(--text-light);
    transition: all 0.3s;
    background: linear-gradient(135deg, #f9f7f0, #f3f0e9);
    font-size: 14px;
    line-height: 22px;
}

.pagination a:hover {
    border-color: #d5b788;
    color: #8b6b4a;
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
    transform: translateY(-2px);
}

.pagination span.current {
    background: linear-gradient(to right, #8b6b4a, #d5b788);
    border-color: #8b6b4a;
    color: #fff;
    font-weight: 500;
}

.pagination .ellipsis {
    border: none;
    background: none;
    box-shadow: none;
    padding: 8px 0;
}

.pagination .prev,
.pagination .next {
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .topic-list {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 992px) {
    .topic-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .topic-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .topic-cover {
        height: 90px;
    }
    
    .chengyu-icon {
        width: 40px;
        height: 40px;
    }
    
    .chengyu-icon span {
        font-size: 18px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        margin-bottom:3px;
    }
    
    .filter-label {
        line-height: 1.5;
    }
    
    /* 移动端筛选按钮样式 */
    .filter-toggle-btn {
        padding: 6px 12px;
        font-size: 13px;
        gap: 4px;
    }
    
    .filter-header h2 {
        font-size: 16px;
    }
    
    .filter-section {
        padding: 8px 12px;
    }
    
    .filter-options a {
        padding: 3px;
    }
    
    .section-header {
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-info {
        gap: 5px;
    }
}



/* 拼音筛选样式 */
.pinyin-filter {
    width: 100%;
}

.pinyin-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.letter-btn {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    background: linear-gradient(135deg, #f9f7f0, #f3f0e9);
    color: var(--text-light);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e0d9c8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.letter-btn:first-child {
    width: auto;
    padding: 0 12px;
    min-width: 48px;
}

.letter-btn:hover {
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.letter-btn.active {
    background: linear-gradient(to right, #8b6b4a, #d5b788);
    color: #fff;
    border-color: #8b6b4a;
    box-shadow: 0 2px 6px rgba(139, 107, 74, 0.3);
}

.letter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 107, 74, 0.4);
}

.pinyin-input {
    background: rgba(249, 247, 240, 0.6);
    border: 1px solid #e0d9c8;
    border-radius: 6px;
    padding: 8px 12px;
}

.selected-letters {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.input-label {
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.selected-text {
    color: #8b6b4a;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    min-width: 30px;
}

.clear-btn {
    color: #d73527;
    text-decoration: none;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
    background: rgba(215, 53, 39, 0.1);
    border: 1px solid rgba(215, 53, 39, 0.3);
}

.clear-btn:hover {
    background: rgba(215, 53, 39, 0.2);
    color: #b02920;
    text-decoration: none;
}

/* 拼音筛选响应式设计 */
@media (max-width: 768px) {
    .pinyin-letters {
        gap: 4px;
    }
    
    .letter-btn {
        width: 28px;
        height: 28px;
        line-height: 26px;
        font-size: 12px;
    }
    
    .letter-btn:first-child {
        min-width: 40px;
        padding: 0 8px;
    }
    
    .selected-text {
        font-size: 14px;
        letter-spacing: 1px;
    }
}

@media (max-width: 576px) {
    .pinyin-letters {
        gap: 3px;
    }
    
    .letter-btn {
        width: 26px;
        height: 26px;
        line-height: 24px;
        font-size: 14px;
    }
    
    .letter-btn:first-child {
        min-width: 36px;
        padding: 0 6px;
    }
    
    .pinyin-input {
        padding: 6px 8px;
    }
    
    .selected-letters {
        gap: 6px;
        font-size: 12px;
    }
    
    .selected-text {
        font-size: 13px;
        letter-spacing: 1px;
    }
}