/* --- 全局和动画定义 --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- 主应用容器 --- */
#suffix-learner-app { 
    font-family: 'Roboto', sans-serif; 
    padding: 25px; 
    background: #161b22; 
    border: 1px solid #30363d; 
    border-radius: 10px; 
    color: #c9d1d9; 
}
.prefix-header { text-align: center; margin-bottom: 20px; }
.audio-player-container { margin-bottom: 30px; text-align: center; }
.audio-player-container audio { width: 100%; max-width: 400px; margin: 0 auto; }
.audio-tip { font-size: 12px; color: #8b949e; margin-top: 8px; background-color: rgba(88, 166, 255, 0.1); padding: 5px; border-radius: 4px; display: inline-block; }

/* --- 网格列表 --- */
.prefix-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }
.prefix-item { background: #21262d; border: 1px solid #30363d; border-radius: 8px; padding: 20px 10px; cursor: pointer; transition: all 0.2s ease-in-out; font-weight: bold; text-align: center; font-size: 1.1em; position: relative; overflow: hidden; }
.prefix-item:hover { transform: translateY(-5px) scale(1.05); border-color: #58a6ff; box-shadow: 0 0 15px rgba(88, 166, 255, 0.5); color: #fff; }
.prefix-item.current-item { border: 2px solid #e70441; color: #f0f6fc; box-shadow: 0 0 15px rgba(231, 4, 65, 0.6); }
.prefix-item.current-item::before { content: '当前'; position: absolute; top: -1px; right: -1px; background: #e70441; color: white; padding: 2px 6px; font-size: 10px; font-weight: bold; border-bottom-left-radius: 8px; }

/* --- 弹窗 (Modal) 样式 --- */
.prefix-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); display: flex; justify-content: center; align-items: center; z-index: 1001; animation: fadeIn 0.3s ease; }
.prefix-modal-content { background: #21262d; color: #c9d1d9; padding: 0; border: 1px solid #30363d; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); width: 90%; max-width: 500px; position: relative; max-height: 85vh; overflow-y: auto; animation: scaleUp 0.3s ease; }
.prefix-modal-close { position: absolute; top: 12px; right: 15px; font-size: 24px; font-weight: bold; cursor: pointer; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); transition: transform 0.2s; z-index: 10; }
.prefix-modal-close:hover { transform: scale(1.2); }

/* --- 弹窗内部样式 --- */
.modal-main-title { background-color: #0d6efd; color: #ffffff; padding: 12px 20px; font-size: 1.2em; font-weight: bold; }
.modal-section-divider { background-color: #e9ecef; color: #212529; padding: 6px 20px; margin: 20px 0 15px 0; font-size: 0.9em; font-weight: bold; }
.modal-meaning { padding: 0 20px; font-size: 1.1em; line-height: 1.6; }
.modal-examples-list { padding: 0 20px 20px 20px; }

/* --- 示例单词详情样式 --- */
.example-word-item { background-color: rgba(0,0,0,0.2); border-radius: 6px; padding: 12px 15px; margin-bottom: 15px; border-left: 3px solid #30363d; transition: border-color 0.3s; }
.example-word-item:hover { border-left-color: #58a6ff; }
.example-word-main { display: flex; align-items: center; justify-content: space-between; font-size: 1.1em; color: #c9d1d9; font-weight: bold; }
.word-text { flex-grow: 1; }
.example-word-details { margin-top: 10px; padding-top: 10px; border-top: 1px solid #30363d; font-size: 0.95em; color: #8b949e; line-height: 1.6; }
.example-word-details strong { color: #58a6ff; font-weight: bold; }
.composition, .literal-meaning { margin-bottom: 5px; }

/* --- 英/美发音按钮样式 --- */
.audio-buttons-container { display: flex; gap: 8px; margin-left: 15px; }
.wsp-accent-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 8px; border: 1px solid; border-radius: 6px; background-color: #f8f9fa; cursor: pointer; font-size: 14px; font-weight: bold; transition: background-color 0.2s, transform 0.2s; }
.wsp-accent-btn:hover { transform: scale(1.05); }
.wsp-accent-btn.uk { border-color: #dc3545; color: #dc3545; }
.wsp-accent-btn.uk:hover { background-color: #ffebee; }
.wsp-accent-btn.us { border-color: #0d6efd; color: #0d6efd; }
.wsp-accent-btn.us:hover { background-color: #e7f1ff; }

/* --- 【新增】导航按钮区域样式 --- */
.modal-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    margin-top: 15px;
    border-top: 1px solid #30363d;
    background-color: #161b22; /* 使用更深的背景色作为页脚 */
}

/* 【新增】导航按钮的独立样式，以匹配暗黑主题 */
.modal-navigation .wsp-accent-btn {
    background-color: #21262d; /* 按钮背景色 */
    border: 1px solid #30363d; /* 边框颜色 */
    color: #c9d1d9; /* 默认文字颜色 */
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 6px;
    min-width: 120px;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* 导航按钮的悬停效果 */
.modal-navigation .wsp-accent-btn:not(:disabled):hover {
    transform: translateY(-3px);
    border-color: #58a6ff; /* 高亮边框 */
    color: #58a6ff; /* 高亮文字 */
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.3); /* 添加辉光效果 */
    background-color: #21262d; /* 保持背景色不变 */
}

/* 导航按钮的禁用状态 */
.modal-navigation .wsp-accent-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none; /* 禁用时移除所有变换效果 */
    background-color: #21262d;
}