:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --success-color: #4ade80;
    --warning-color: #facc15;
    --danger-color: #f87171;
    --sidebar-width: 5%;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    height: 100vh;
    background-color: var(--light-bg);
    overflow: hidden;
}

/* 左侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    transition: var(--transition-speed);
    z-index: 100;
}

.sidebar-item {
    width: 100%;
    text-align: center;
    padding: 15px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
    background-color: var(--primary-color);
}

.sidebar-item i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-item span {
    font-size: 0.8rem;
    display: block;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

/* 模块容器 */
.module {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 25px;
    display: none;
}

.module.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.module-header i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.module-header h2 {
    color: var(--dark-bg);
    font-weight: 600;
}

/* 搜索区域样式 */
.search-container {
    display: flex;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--secondary-color);
}

/* 选项区域样式 */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.option-group {
    display: flex;
    align-items: center;
    background: #f0f4ff;
    padding: 8px 15px;
    border-radius: 6px;
}

.option-group label {
    margin-right: 8px;
    font-size: 0.9rem;
    color: #555;
}

/* 语料库表格样式 */
.corpora-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.corpora-table th, .corpora-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.corpora-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.corpora-table tbody tr:hover {
    background-color: #f8f9ff;
}

/* 结果表格样式 */
.results-container {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.back-btn i {
    margin-right: 5px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th, .results-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.results-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.result-row {
    transition: background 0.2s;
    cursor: pointer;
}

.result-row:hover {
    background-color: #f8f9ff;
}

.entry-container {
    display: flex;
    flex-direction: column;
}

.entry-ch, .entry-en {
    padding: 5px 0;
}

.entry-ch {
    color: #333;
    font-weight: 500;
}

.entry-en {
    color: #666;
    font-size: 0.9rem;
}

.detail-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

/* 详情侧边栏（修改部分） */
.detail-sidebar {
    position: fixed;
    top: 0;
    right: -450px; /* 原400px改为450px */
    width: 450px; /* 原400px改为450px */
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right var(--transition-speed);
    padding: 25px;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: flex-start; /* 改为左对齐 */
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    margin-right: auto; /* 标题占据剩余空间，使关闭按钮在最左侧 */
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    order: -1; /* 调整顺序到最前面 */
    margin-right: 15px; /* 增加右侧间距 */
}

.detail-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.detail-label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.detail-content {
    padding-left: 26px;
    color: #333;
}

.photo-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.photo-placeholder {
    width: 100px;
    height: 100px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
}

/* 上传区域样式 */
.upload-container {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
    transition: border-color 0.3s;
}

.upload-container:hover {
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: 500;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: var(--secondary-color);
}

/* 管理表格样式 */
.management-table {
    width: 100%;
    border-collapse: collapse;
}

.management-table th, .management-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.management-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 操作按钮样式扩展 */
.action-btn {
    margin-right: 5px; /* 统一按钮间距 */
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.action-btn:last-child {
    margin-right: 0; /* 最后一个按钮取消右间距 */
}

.action-btn.export-btn {
    background: var(--primary-color); /* 蓝色（与主题色一致） */
    color: white;
}

.action-btn.upload-pic-btn {
    background: var(--success-color); /* 绿色（成功色） */
    color: white;
}

.action-btn.delete-btn {
    background: var(--danger-color); /* 红色（危险色，保持原有） */
    color: white;
}

.action-btn.rename {
    background: var(--warning-color); /* 黄色（警告色） */
    color: white;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-item span {
        font-size: 0.7rem;
    }
    
    .detail-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 768px) {
    .options-container {
        flex-direction: column;
    }
    
    .option-group {
        width: 100%;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input {
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .search-btn {
        border-radius: 6px;
        padding: 12px;
    }
}


/* 所有CSS保持不变，只需添加少量动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading {
    display: inline-block;
    animation: pulse 1.5s infinite;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: var(--danger-color);
}

/* 详情页照片样式（新增） */
.photo-image {
    width: 360px; /* 固定宽度 */
    height: 300px; /* 固定高度 */
    object-fit: cover; /* 压缩图片并保持比例 */
    border-radius: 6px;
}

/* 图片预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.modal-image {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: -30px;
    right: -30px;
    color: #ffffff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

/* 在文件末尾添加以下样式 */
/* 自定义confirm按钮样式 */
.custom-confirm {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.confirm-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    width: 400px;
    max-width: 90%;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-message {
    padding: 30px;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.confirm-buttons {
    display: flex;
}

.confirm-btn {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-ok {
    background-color: #4361ee;
    color: white;
}

.confirm-ok:hover {
    background-color: #3a56d4;
}

.confirm-cancel {
    background-color: #f8f9fa;
    color: #495057;
}

.confirm-cancel:hover {
    background-color: #e9ecef;
}

/* 美化确认上传按钮 */
#confirm-upload {
    background-color: #4361ee;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s;
}

#confirm-upload:hover {
    background-color: #3a56d4;
}