/* 近义词页面样式 */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #c9d6ea;
    --accent-color: #3a5683;
    --light-bg: #f5f8fc;
    --dark-bg: #2c3e50;
    --text-color: #333;
    --light-text: #f5f8fc;
    --border-color: #c9d6ea;
    --shadow-color: rgba(74, 111, 165, 0.2);
    --hover-color: #e8f0fb;
}

/* 整体页面样式 */
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(74, 111, 165, 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 {
    margin-bottom: 20px;
    text-align: center;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 5px;
    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(--primary-color);
}

.section-header p {
    color: #666;
    font-size: 16px;
    margin-top: 15px;
}

/* 介绍部分样式 */
.intro-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 3px 10px var(--shadow-color);
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.intro-section p {
    margin-bottom: 15px;
    line-height: 1.8;
    font-size: 16px;
}

.intro-section p:last-child {
    margin-bottom: 0;
}

/* 热门近义词样式 */
.popular-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.popular-items a {
    background-color: white;
    color: var(--primary-color);
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.popular-items a:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.large-grid {
    max-width: 1000px;
    margin: 0 auto;
}

/* 拼音导航样式 */
.pinyin-index {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 3px 10px var(--shadow-color);
    margin-bottom: 40px;
}

.pinyin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.pinyin-nav a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pinyin-nav a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.pinyin-group {
    margin-bottom: 30px;
    padding-top: 10px;
}

.pinyin-group h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--secondary-color);
}

.dictionary-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.dictionary-list a {
    display: block;
    padding: 10px 15px;
    background-color: var(--light-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: center;
}

.dictionary-list a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 近义词对比卡片 */
.synonym-comparison {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 3px 10px var(--shadow-color);
}

.synonym-comparison h3 {
    color: var(--primary-color);
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.comparison-card {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
}

.comparison-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.word-card {
    flex: 1;
    min-width: 250px;
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.word-card h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.word-card p {
    margin: 0 0 10px 0;
    font-size: 15px;
}

.word-card .example {
    font-style: italic;
    color: #666;
    margin-top: 10px;
}

/* 学习工具部分 */
.learning-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.tool-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tool-card h4 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 18px;
}

.tool-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dictionary-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .learning-tools {
        grid-template-columns: 1fr;
    }
    
    .comparison-card {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 词语标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.tag-cloud a {
    display: inline-block;
    padding: 5px 12px;
    background-color: white;
    color: var(--primary-color);
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.tag-cloud a:hover {
    background-color: var(--primary-color);
    color: white;
}

.tag-size-1 { font-size: 12px; }
.tag-size-2 { font-size: 14px; }
.tag-size-3 { font-size: 16px; }
.tag-size-4 { font-size: 18px; }
.tag-size-5 { font-size: 20px; }

/* 收藏功能 */
.favorite-btn {
    background-color: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.favorite-btn:hover,
.favorite-btn.active {
    color: #f8d64e;
}

/* 词语卡片悬停效果 */
.word-card {
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 111, 165, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.word-card:hover::before {
    opacity: 1;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}