/* 頂部與搜尋框設計 */
.vocab-header-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 35px; /* 這裡的 35px 就是用來把文字往右推，讓出空間給放大鏡 */
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #002395;
    box-shadow: 0 0 8px rgba(0, 35, 149, 0.1);
}

/* 卡片網格佈局 (CSS Grid) */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 單字卡片設計 */
.vocab-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.vocab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #002395;
}

/* 卡片上半部：單字與發音按鈕 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 2px dashed #eee;
    padding-bottom: 1rem;
}

.word-info {
    display: flex;
    flex-direction: column;
}

.french-word {
    font-size: 1.5rem;
    font-weight: bold;
    color: #002395;
    margin-bottom: 0.2rem;
}

.word-type {
    font-size: 0.8rem;
    background-color: #f1f4f9;
    color: #555;
    padding: 2px 8px;
    border-radius: 10px;
    align-self: flex-start;
}

/* 發音按鈕 */
.audio-btn {
    background: #f1f4f9;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    color: #002395;
}

.audio-btn:hover {
    background: #002395;
    color: white;
}

/* 卡片下半部：中文與例句 */
.card-body {
    flex-grow: 1;
}

.translation {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.8rem;
}

.example {
    font-size: 0.95rem;
    color: #666;
    background-color: #fafafa;
    padding: 10px;
    border-left: 3px solid #ed2939;
    border-radius: 0 4px 4px 0;
    font-style: italic;
}