/* 重置样式和全局设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索区域样式 */
.search-container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.search-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
}

.search-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 200px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

/* 过滤器样式 */
.filters {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1.5rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* 主内容区域 */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1.5rem;
    flex: 1;
}

/* 列表头部样式 */
.list-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
    gap: 0.8rem;
}

.list-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.sort-options {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sort-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.sort-btn:hover, .sort-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* 词典卡片网格 */
.words-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.word-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.word {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.4rem;
}

.phonetic {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: block;
}

.definition {
    color: #666;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.part-of-speech {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.example {
    font-style: italic;
    color: #888;
    border-left: 2px solid #667eea;
    padding-left: 0.8rem;
    margin-top: 0.8rem;
    font-size: 0.9rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.page-btn:hover, .page-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* 词典详情页样式 */
.word-detail {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
}

.word-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 0.8rem;
}

.word-info {
    width: 100%;
}

.word-detail .word {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.word-detail .phonetic {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 0.8rem;
    display: block;
}

.audio-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.audio-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.part-of-speech-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.definitions-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #f0f0f0;
}

.definition-item {
    margin-bottom: 1.2rem;
    padding-left: 1rem;
    border-left: 3px solid #667eea;
}

.definition {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.4rem;
}

.example-detail {
    font-style: italic;
    color: #888;
    margin-top: 0.4rem;
    padding: 0.6rem;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 0.9rem;
}

.synonyms-section {
    margin-bottom: 1.5rem;
}

.synonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.synonym {
    padding: 0.4rem 0.8rem;
    background: #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.synonym:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.antonyms-section {
    margin-bottom: 1.5rem;
}

.antonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.antonym {
    padding: 0.4rem 0.8rem;
    background: #ffebee;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.antonym:hover {
    background: #f44336;
    color: white;
}

.related-words {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.related-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.related-word {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.4rem;
}

.related-def {
    font-size: 0.85rem;
}

.pronunciation-guide {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #e8f4fd;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .header {
        padding: 0.6rem 0.8rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .search-container {
        margin: 1rem auto;
        padding: 0 0.8rem;
    }
    
    .search-input {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
    
    .search-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .content {
        padding: 0 0.8rem 1rem;
    }
    
    .word-card {
        padding: 1rem;
    }
    
    .word {
        font-size: 1.2rem;
    }
    
    .phonetic {
        font-size: 0.85rem;
    }
    
    .definition {
        font-size: 0.9rem;
    }
    
    .example {
        font-size: 0.85rem;
    }
    
    .word-detail {
        padding: 1.2rem;
    }
    
    .word-detail .word {
        font-size: 1.8rem;
    }
    
    .word-detail .phonetic {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .definition {
        font-size: 0.95rem;
    }
    
    .example-detail {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .related-word {
        font-size: 1rem;
    }
    
    .related-def {
        font-size: 0.8rem;
    }
}

/* 大屏优化 */
@media (min-width: 769px) {
    .header-content {
        flex-direction: row;
    }
    
    .search-box {
        flex-direction: row;
        align-items: center;
    }
    
    .search-input {
        max-width: 500px;
    }
    
    .word-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .word-info {
        flex: 1;
        min-width: 300px;
    }
    
    .word-detail .word {
        font-size: 3rem;
    }
    
    .word-detail .phonetic {
        font-size: 1.5rem;
    }
    
    .word-detail {
        padding: 3rem;
    }
    
    .related-words {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .list-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .sort-options {
        justify-content: flex-end;
    }
}