/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 'auto';
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.2s ease-out;
    border: 1px solid #e5e7eb;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.close {
    font-size: 20px;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    padding: 4px;
}

.close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
    border-radius: 0 0 12px 12px;
}

#auth-overlay {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.8rem;
}

.checkbox-wrapper-14 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-group .checkbox-wrapper-14 label {
    display: inline;
    margin: 0;
}

.form-group .checkbox-wrapper-14 input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* 文件上传样式 */
input[type="file"] {
    padding: 8px 12px !important;
    background-color: #f8f9fa;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    min-height: 400px;
    width: 100%;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 20px;
    max-width: 400px;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1001;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 8px;
    background-color: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: #e1e5e9;
    color: #333;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 2px;
}

.tag.primary {
    background-color: #667eea;
    color: white;
}

.tag.success {
    background-color: #28a745;
    color: white;
}

.tag.warning {
    background-color: #ffc107;
    color: #333;
}

.tag.danger {
    background-color: #dc3545;
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    background-color: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #764ba2;
}

.breadcrumb-separator {
    color: #ccc;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1001;
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 导航用户头像下拉菜单：避免遮挡头像，向下偏移 */
#nav-user-dropdown {
    right: 0;
    top: calc(100% - 6px) !important;
}

/* 通知消息 */
.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 10001;
    transform: translateX(-400px);
    transition: transform 0.3s ease;
    max-width: 280px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: rgba(39, 174, 96, 0.85);
    border-left: 3px solid rgba(30, 132, 73, 0.9);
}

.notification.error {
    background: rgba(231, 76, 60, 0.85);
    border-left: 3px solid rgba(169, 50, 38, 0.9);
}

.notification.warning {
    background: rgba(243, 156, 18, 0.85);
    color: white;
    border-left: 3px solid rgba(214, 137, 16, 0.9);
}

.notification.info {
    background: rgba(52, 152, 219, 0.85);
    border-left: 3px solid rgba(36, 113, 163, 0.9);
}

/* 文件拖拽上传区域 */
.file-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-drop-zone:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.file-drop-zone.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.drop-zone-content {
    pointer-events: auto;
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.file-drop-zone p {
    margin: 0.5rem 0;
    color: #666;
}

.file-types {
    font-size: 0.875rem;
    color: #999;
}

.file-drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* 文件预览 */
.file-preview {
    margin-top: 1rem;
}

.selected-file {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.selected-file .file-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.selected-file .file-info {
    flex: 1;
}

.selected-file .file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.selected-file .file-size {
    font-size: 0.875rem;
    color: #666;
}

.btn-remove-file {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-file:hover {
    background: #dc3545;
    color: white;
}

.multiple-files .files-header {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #495057;
}

/* 模板预览模态框 */
.template-preview-modal {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.preview-header h3 {
    margin: 0;
}

.close-preview {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem;
}

.close-preview:hover {
    color: #000;
}

.preview-body {
    padding: 1.5rem;
}

.preview-body .file-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.preview-body .file-info p {
    margin: 0.5rem 0;
}

.preview-body .description {
    margin-top: 1rem;
}

.preview-body .description p {
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 12px 16px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* 模态框按钮样式优化 */
.modal-footer .btn {
    padding: 8px 20px;
    font-size: 0.85rem;
    min-width: 70px;
}
