/* 词语词典页面样式 */
:root {
    --primary-color: #2c6aa0;
    --secondary-color: #a8d0e6;
    --accent-color: #3d8bcd;
    --light-bg: #f5f9fc;
    --dark-bg: #1a4971;
    --text-color: #333;
    --light-text: #f5f9fc;
    --border-color: #a8d0e6;
    --shadow-color: rgba(44, 106, 160, 0.2);
}

/* 整体页面样式 */
body {
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    line-height: 1.6;
}

/* 头部样式增强 */
.search-container {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.search-box {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.search-box h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.search-form {
    display: flex;
    margin-bottom: 10px;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 106, 160, 0.2);
}

.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background-color: var(--accent-color);
}

.search-tips {
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* 主内容区域样式 */
.main-content {
    padding: 20px 0 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.section-header p {
    color: #666;
    font-size: 16px;
}

/* 分类部分样式 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.category-item h4 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 20px;
}

.category-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 热门词语样式 */
.popular-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.popular-items a {
    background-color: white;
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.popular-items a:hover {
    background-color: var(--primary-color);
    color: white;
}

.large-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.large-grid a {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
}

/* 拼音导航样式 */
.pinyin-index {
    margin-bottom: 40px;
}

.pinyin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    justify-content: center;
}

.pinyin-nav a {
    background-color: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pinyin-nav a:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.pinyin-group {
    margin-bottom: 30px;
    padding-top: 20px;
}

.pinyin-group h3 {
    color: var(--primary-color);
    font-size: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.dictionary-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.dictionary-list a {
    background-color: white;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.dictionary-list a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

/* 词语详情页样式 */
.word-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
    text-align: center;
}

.word-title {
    font-size: 36px;
    margin-bottom: 10px;
}

.word-pinyin {
    font-size: 20px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.word-category {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.word-content {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 3px 15px var(--shadow-color);
    margin-bottom: 30px;
}

.word-section {
    margin-bottom: 25px;
}

.word-section:last-child {
    margin-bottom: 0;
}

.word-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.definition-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.definition-item {
    margin-bottom: 15px;
    padding-left: 20px;
    position: relative;
}

.definition-item:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.definition-item .meaning {
    font-weight: bold;
    margin-bottom: 5px;
}

.example-list {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.example-item {
    margin-bottom: 8px;
    color: #555;
    font-style: italic;
}

.example-item:before {
    content: "例：";
    color: #777;
    font-style: normal;
}

.synonym-list, .antonym-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.synonym-list a, .antonym-list a {
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.synonym-list a:hover, .antonym-list a:hover {
    background-color: var(--primary-color);
    color: white;
}

.word-usage {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.word-usage h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.word-usage p {
    margin: 0;
    line-height: 1.6;
}

.related-words {
    margin-top: 30px;
}

.related-words h3 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 15px;
}

.related-words-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.related-words-list a {
    background-color: white;
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.related-words-list a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .large-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .word-title {
        font-size: 30px;
    }
    
    .word-content {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 词语卡片样式 */
.word-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.word-card h4 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 18px;
}

.word-card .brief {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.word-card .view-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    margin-top: 5px;
}

.word-card .view-link:hover {
    text-decoration: underline;
}