* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(90deg, #4a6fa5 0%, #2c3e50 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.subtitle {
    opacity: 0.9;
    font-weight: 300;
}

.search-container {
    padding: 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
}

#searchInput:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

#searchBtn {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#searchBtn:hover {
    background-color: #3a5a80;
}

.search-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

#searchType {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.results-info {
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
}

.dictionary-content {
    display: flex;
    min-height: 500px;
}

.sidebar {
    width: 250px;
    background-color: #f5f5f5;
    padding: 20px;
    border-right: 1px solid #eaeaea;
    overflow-y: auto;
    max-height: 600px;
}

.alphabet-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 25px;
}

.alphabet-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.alphabet-btn:hover {
    background-color: #e9ecef;
}

.alphabet-btn.active {
    background-color: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
}

.category-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.9rem;
}

.category-btn:hover {
    background-color: #e9ecef;
}

.category-btn.active {
    background-color: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* 增加卡片间距 */
}

.word-card {
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* 基本释义区块 */
.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eef2f7;
}

.word-and-pos {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.word {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.pronunciation {
    color: #7f8c8d;
    font-style: italic;
    font-size: 1rem;
    font-weight: normal;
}

.part-of-speech {
    display: inline-block;
    background-color: #e8f4fd;
    color: #4a6fa5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 5px;
}

.meaning {
    font-size: 1.2rem;
    color: #2c3e50;
    line-height: 1.5;
    margin-top: 5px;
}

/* 例句区块 */
.examples-section {
    margin-top: 20px;
}

.section-title {
    font-size: 1rem;
    color: #4a6fa5;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "💬";
    font-size: 0.9em;
}

.example-item {
    background-color: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #4a6fa5;
}

.example-original {
    font-size: 0.95rem;
    color: #2c3e50;
    line-height: 1.5;
}

.example-translation {
    font-size: 0.9rem;
    color: #5d6d7e;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #e0e6ed;
    font-style: italic;
}

/* 语法/原始信息区块 */
.grammar-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.grammar-section .section-title::before {
    content: "🔧";
}

.grammar-content {
    background-color: #fffdf6;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #636e72;
    line-height: 1.5;
    word-break: break-all;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eaeaea;
    background-color: #f8f9fa;
}

.status {
    margin-top: 10px;
    color: #4a6fa5;
    font-weight: 500;
}

/* 多词性释义区域样式 */
.senses-section {
    margin-top: 15px;
    margin-bottom: 15px;
}

.senses-section .section-title {
    font-size: 1rem;
    color: #4a6fa5;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.senses-section .section-title::before {
    content: "📖";
    font-size: 0.9em;
}

.senses-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sense-item {
    display: flex;
    align-items: flex-start;
    line-height: 1.5;
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.sense-item:last-child {
    border-bottom: none;
}

.sense-pos {
    display: inline-block;
    background-color: #e8f4fd;
    color: #4a6fa5;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.sense-explanation {
    flex: 1;
    color: #2c3e50;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .dictionary-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }

    .alphabet-filter {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .alphabet-btn {
        width: 35px;
        height: 35px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .word-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .word {
        font-size: 1.6rem;
    }
}