/* 表格内容垂直居中 */
/* 全局重置和基础样式 */
* {
    box-sizing: border-box;
}

/* 整体样式优化 */
body {
    background-color: #f5f7fa;
    background-image: 
        radial-gradient(#e3f2fd 1px, transparent 1px),
        radial-gradient(#e3f2fd 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    padding: 20px;
    margin: 0 auto;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}

h2 {
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #6fa3ef);
    border-radius: 2px;
}

h5 {
    color: #34495e;
    font-size: 1.1rem;
}
/* 表格样式优化 */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    background-color: white;
}

.table th,
.table td {
    padding: 12px 15px;
    vertical-align: middle;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

/* 斑马纹效果 */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.7);
}

/* 悬停效果 */
.table-hover tbody tr:hover {
    background-color: #f0f9ff;
    transition: background-color 0.2s ease;
}

/* 结果区域样式 */
#pair-result, #colony-result {
    max-height: 500px;
    overflow-y: auto;
}

/* 按钮样式优化 */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn + .btn {
    margin-left: 10px;
}

/* 主要按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f6693);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 成功按钮样式 */
.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* 警告按钮样式 */
.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* 危险按钮样式 */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 信息按钮样式 */
.btn-info {
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #16a085, #148f77);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
}

/* 辅助按钮样式 */
.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c757d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* 表格按钮样式 */
.table .btn {
    width: 60px;
    height: 36px;
    padding: 4px 8px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table .btn:last-child {
    margin-right: 0;
}

/* 按钮容器样式 */
.buttons-nowrap-cell {
    white-space: nowrap;
    min-width: 150px;
    padding: 6px;
}

/* 卡片样式优化 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    background-color: white;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #3498db, #8e44ad);
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    font-weight: 600;
    color: #475569;
}

.card-body {
    padding: 24px;
}

/* 选择框样式优化 */
.form-select {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

/* 标签页样式优化 */
.nav-tabs {
    border-bottom: 3px solid #e2e8f0;
    margin-bottom: 0;
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-item {
    margin-right: 4px;
    flex-shrink: 0;
}

.nav-tabs .nav-link {
    color: #64748b;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    position: relative;
    top: 3px;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: #3498db;
    background-color: #f1f5f9;
    transform: translateY(-1px);
}

.nav-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 -3px 6px rgba(52, 152, 219, 0.2);
    top: 0;
}

/* 标签页内容面板样式 */
.tab-pane {
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* 树状图容器样式 */
#gene-tree-svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
}

#gene-tree-svg:active {
    cursor: grabbing;
}

/* 树状图操作按钮容器 */
.card-header .btn-group {
    display: flex;
    gap: 8px;
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 为结果表格添加交替行颜色 */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.7);
}

/* 警告提示框样式优化 */
.alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.alert-warning {
    background-color: #fff7ed;
    color: #9a3412;
}

.alert-warning .btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-header, .card-body {
        padding: 16px;
    }
    
    .table th, .table td {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .tab-pane {
        padding: 16px;
    }
}

/* 表格响应式处理 */
@media (max-width: 992px) {
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        min-width: 800px;
    }
}

/* 打印样式 */
@media print {
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .tab-pane {
        border: none;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

