body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Microsoft JhengHei', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    display: flex;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 800px;
    min-width: 1000px; /* 避免右側區域被壓縮 */
    max-width: 95%;
    /* height: 600px; ← 拿掉這行 */
    /* overflow: hidden; ← 拿掉這行 */
    margin-bottom: 50px; /* 預防底部緊貼邊緣，可選 */
}


.sidebar {
    width: 240px;          /* 或你希望的寬度 */
    height: 100vh;         /* 讓它佔滿視窗高度 */
    overflow-y: auto;      /* ✅ 允許垂直捲動 */
    overflow-x: hidden;    /* 避免橫向出現 */
}

#word-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#word-list li {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

#word-list li:hover {
    background-color: #e9ecef;
}

#word-list li.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.content {
    flex-grow: 1;
    padding: 25px;
    /* height: 100%; ← 拿掉這行 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}


.word-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#selected-word {
    font-size: 2.5em;
    margin: 0 15px 0 0;
    color: #333;
}

#word-definition {
    font-size: 1.4em;            /* 字體變大 */
    color: #2c3e50;              /* 顏色加深，帶點藍灰更穩重 */
    margin-bottom: 30px;
    font-weight: 500;            /* 稍微加粗 */
    line-height: 1.6;            /* 行距拉開更好讀 */
    font-style: normal;          /* 拿掉斜體，看起來更正式清晰 */
    background-color: #f0f4f8;   /* 背景淡藍色，美觀又不搶眼 */
    padding: 15px 20px;          /* 內距讓內容更有呼吸感 */
    border-left: 5px solid #3498db; /* 左邊加個藍色指示條，有設計感 */
    border-radius: 8px;          /* 邊角圓潤 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* 微陰影更立體 */
}

#example-sentences {
    /* overflow-y: auto; ← 拿掉這行 */
    flex-grow: 1;
    padding-right: 5px;
}


.example {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.example-number {
    font-weight: bold;
    margin-right: 15px;
    color: #666;
    align-self: flex-start;
    font-size: 0.9em;
    min-width: 20px;
    text-align: right;
}

.example-text {
    flex-grow: 1;
}

.example-text .en {
    font-size: 1.1em;
    color: #222;
    display: block;
    margin-bottom: 5px;
}

.example-text .zh {
    font-size: 0.95em;
    color: #777;
    display: block;
}

.speak-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: #007bff;
    padding: 5px;
    line-height: 1;
    margin-left: 10px;
}

.speak-btn:hover {
    color: #0056b3;
}

.example .speak-btn {
    font-size: 1.2em;
    margin-left: 15px;
    color: #555;
}

.example .speak-btn:hover {
    color: #222;
}

/* 滾動條樣式 */
.sidebar::-webkit-scrollbar,
#example-sentences::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
#example-sentences::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
#example-sentences::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
#example-sentences::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 
#speak-word-btn {
    display: none;
}
*/

/* 平滑顯示/隱藏中文翻譯 */
.zh-container {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#word-definition {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 圖片區（固定右側） */
#voice-container {
    position: fixed;
    top: 12px;
    right: 20px;
    width: min(500px, calc(100vw - 40px));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 102;
}

#voice-container label {
    flex: none;
    white-space: nowrap;
}

#voice-select {
    flex: 1;
    min-width: 0;
    padding: 5px;
}

#settings-panel {
    z-index: 101;
}

#import-vocab-btn {
    z-index: 110;
}

#image-container {
    position: fixed;
    top: 100px; /* 調整位置 */
    right: 20px;
    width: 250px;
    display: block; /* 確保初始是顯示的 */
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

#image-container img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
