/* 通用样式 */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin: 30px auto;
    padding: 40px;
    max-width: 800px;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    background: white;
    color: #6c757d;
    font-weight: 500;
    text-decoration: none;
    display: block;
}

.nav-tab:hover {
    background: #e9ecef;
}

.nav-tab.active {
    background: #667eea;
    color: white;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #e9ecef;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e9ecef;
}

/* 图片预览 */
.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

/* 文章内容区域 */
.article-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    line-height: 2;
    min-height: 200px;
}

/* 单词链接 */
.word-link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.word-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* 音标 */
.phonetic {
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

/* 单词弹窗 */
.word-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    justify-content: center;
    align-items: center;
}

/* 记录详情弹窗 */
#record-modal {
    z-index: 1050;
}

/* 单词详情弹窗 - 更高的z-index */
#word-modal {
    z-index: 1060;
}

.word-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.word-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.word-phonetic {
    font-size: 20px;
    color: #6c757d;
    margin-bottom: 15px;
    text-align: center;
}

.word-meaning {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.word-example {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear-infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 收藏按钮 */
.favorite-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
}

.favorite-btn:hover {
    opacity: 0.9;
}

/* 状态徽章 */
.status-badge {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 15px;
}

/* 收藏区域 */
.favorite-section {
    background: #fff3cd;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.favorite-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* API地址显示 */
.api-url-display {
    background: #e9ecef;
    padding: 15px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 14px;
    color: #666;
    word-break: break-all;
    margin-top: 20px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.toast-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-container {
        margin: 15px;
        padding: 20px;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .word-title {
        font-size: 24px;
    }
}
