/**
 * 成语词典样式表
 */

/* 主题颜色 */
:root {
    --primary-color: #8e44ad;
    --secondary-color: #9b59b6;
    --accent-color: #d35400;
    --light-color: #f9f0ff;
    --dark-color: #4a235a;
    --border-color: #e1bee7;
    --text-color: #333;
    --bg-color: #fff;
    --hover-color: #7d3c98;
}

/* 成语词典特定样式 */
.search-container {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 40px 0;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 25px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.search-box h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.search-box button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: var(--hover-color);
}

.search-tips {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 分类网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.category-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.category-item h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.category-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 结构分类 */
.structure-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.structure-item {
    background-color: var(--light-color);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 15px;
    transition: background-color 0.3s, color 0.3s;
    border: 1px solid var(--border-color);
}

.structure-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 热门成语 */
.popular-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.popular-items a {
    background-color: #fff;
    padding: 12px 15px;
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.popular-items a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 拼音导航 */
.pinyin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background-color: var(--light-color);
    padding: 15px;
    border-radius: 8px;
    justify-content: center;
}

.pinyin-nav a {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
    border: 1px solid var(--border-color);
}

.pinyin-nav a:hover, .pinyin-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.pinyin-group {
    margin-bottom: 40px;
    padding-top: 15px;
}

.pinyin-group h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.dictionary-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.dictionary-list a {
    text-decoration: none;
    color: var(--text-color);
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    display: block;
    text-align: center;
    background-color: #f9f9f9;
}

.dictionary-list a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* 成语详情页样式 */
.idiom-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 40px 0;
    color: white;
    margin-bottom: 30px;
}

.idiom-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    text-align: center;
}

.idiom-pinyin {
    font-size: 18px;
    text-align: center;
    margin-bottom: 5px;
}

.idiom-type {
    font-size: 16px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    margin: 0 auto;
    display: table;
}

.idiom-content {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.idiom-section {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.idiom-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.idiom-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 15px;
}

.idiom-section h4 {
    color: var(--dark-color);
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.definition-list {
    padding-left: 0;
    list-style-type: none;
}

.definition-item {
    margin-bottom: 15px;
    padding-left: 20px;
    position: relative;
}

.definition-item:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 20px;
    line-height: 1;
}

.meaning {
    font-weight: bold;
    margin-bottom: 5px;
}

.example-list {
    padding-left: 20px;
    list-style-type: none;
    margin-top: 10px;
}

.example-item {
    margin-bottom: 8px;
    color: #555;
    position: relative;
}

.example-item:before {
    content: "◦";
    color: var(--secondary-color);
    position: absolute;
    left: -15px;
}

.toggle-examples {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 10px 0;
    transition: background-color 0.3s;
}

.toggle-examples:hover {
    background-color: var(--primary-color);
    color: white;
}

.synonym-list, .antonym-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.synonym-list a, .antonym-list a {
    text-decoration: none;
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.synonym-list a:hover, .antonym-list a:hover {
    background-color: var(--primary-color);
    color: white;
}

.related-idioms {
    background-color: var(--light-color);
    padding: 30px 0;
    margin-top: 30px;
}

.related-idioms h3 {
    text-align: center;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
}

.related-idioms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.related-idioms-list a {
    text-decoration: none;
    background-color: white;
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.related-idioms-list a:hover {
    background-color: var(--primary-color);
    color: white;
}

.idiom-story {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid var(--accent-color);
}

.idiom-story h4 {
    color: var(--accent-color);
    margin-top: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .popular-items {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .dictionary-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .idiom-title {
        font-size: 28px;
    }
    
    .idiom-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-box form {
        flex-direction: column;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .structure-grid {
        justify-content: center;
    }
    
    .dictionary-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}