/* 前端样式 */
.zft-family-tree {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.zft-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

/* 搜索框模块 */
.zft-search-container {
    margin-bottom: 40px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.zft-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#zft-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#zft-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

#zft-search-button {
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#zft-search-button:hover {
    background: #0069d9;
}

.zft-notice {
    color: #6c757d;
    font-size: 14px;
    margin: 15px 0 0 0;
    padding: 12px 15px;
    background: rgba(108, 117, 125, 0.1);
    border-left: 4px solid #6c757d;
    border-radius: 4px;
    line-height: 1.5;
}

#zft-search-results {
    margin-top: 20px;
}

.zft-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.zft-no-result {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.zft-no-result-content {
    position: relative;
    padding-right: 40px;
}

.zft-no-result-content p {
    color: #dc3545;
    margin: 0;
}

.zft-error {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.zft-error-content {
    position: relative;
    padding-right: 40px;
}

.zft-error-content p {
    color: #dc3545;
    margin: 0;
}

.zft-search-result-list {
    margin-top: 10px;
}

.zft-search-result-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.zft-search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.zft-search-result-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.zft-search-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.zft-search-close:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    transform: rotate(90deg);
}

.zft-no-result-content .zft-search-close,
.zft-error-content .zft-search-close {
    position: absolute;
    top: 0;
    right: 0;
}

/* 搜索结果详情 - 表格样式 */
.zft-search-result-details {
    margin-top: 25px;
    animation: fadeInUp 0.5s ease-out;
}

.zft-details-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
    animation: tableFadeIn 0.6s ease-out;
}

.zft-details-table tr {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: rowFadeIn 0.4s ease-out forwards;
}

.zft-details-table tr:nth-child(1) { animation-delay: 0.1s; }
.zft-details-table tr:nth-child(2) { animation-delay: 0.2s; }
.zft-details-table tr:nth-child(3) { animation-delay: 0.3s; }
.zft-details-table tr:nth-child(4) { animation-delay: 0.4s; }
.zft-details-table tr:nth-child(5) { animation-delay: 0.5s; }
.zft-details-table tr:nth-child(6) { animation-delay: 0.6s; }
.zft-details-table tr:nth-child(7) { animation-delay: 0.7s; }
.zft-details-table tr:nth-child(8) { animation-delay: 0.8s; }

.zft-details-table tr:hover {
    background: rgba(0,123,255,0.1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.zft-details-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.zft-details-table tr:last-child td {
    border-bottom: none;
}

.zft-details-table td:first-child {
    font-weight: 600;
    color: #212529;
    width: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 3px solid #007bff;
    position: relative;
}

.zft-details-table td:first-child::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #007bff, #6c757d);
}

.zft-details-table td:last-child {
    color: #495057;
    background: white;
    font-size: 14px;
    line-height: 1.4;
}

.zft-details-table tr:hover td:first-child {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-right-color: #0056b3;
}

.zft-details-table tr:hover td:last-child {
    background: rgba(0,123,255,0.05);
}

/* 动画效果 */
@keyframes tableFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        box-shadow: 0 0 0 rgba(0,0,0,0.1);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索结果相册独立显示在底部 */
.zft-search-result-images {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
    animation: fadeInUp 0.7s ease-out 0.2s both;
}

.zft-search-result-images h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.zft-search-result-images h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #6c757d);
    border-radius: 3px;
}

/* 人物信息卡模块 */
.zft-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .zft-cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.zft-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zft-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.zft-card-name {
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.zft-card-name:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-color: #007bff;
}

/* 统计模块 */
.zft-stats {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.zft-stats p {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.zft-stats-number {
    font-weight: 600;
    color: #007bff;
    font-size: 20px;
}

/* 申请模块样式 */
.zft-apply-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.zft-apply-btn {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-weight: 600;
}

.zft-apply-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.zft-apply-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.zft-apply-approved {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    padding: 12px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.zft-apply-pending {
    color: #ffc107;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    padding: 12px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    border-left: 4px solid #ffc107;
}

.zft-apply-disabled {
    color: #dc3545;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border-left: 4px solid #dc3545;
}

.zft-apply-login {
    color: #6c757d;
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    padding: 12px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 4px;
    border-left: 4px solid #6c757d;
}

.zft-apply-login a {
    color: #007bff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.zft-apply-login a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 图片预览模态框 */
.zft-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.zft-modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 10% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
}

.zft-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #6c757d);
}

.zft-modal-content h3 {
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    animation: fadeIn 0.4s ease-out;
}

.zft-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #666;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zft-modal-close:hover,
.zft-modal-close:focus {
    color: #007bff;
    transform: rotate(90deg);
    text-decoration: none;
    cursor: pointer;
}

.zft-modal-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .zft-family-tree {
        padding: 10px;
    }
    
    .zft-search-container {
        padding: 20px;
    }
    
    .zft-search-box {
        flex-direction: column;
    }
    
    #zft-search-button {
        width: 100%;
    }
    
    .zft-cards-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .zft-card {
        font-size: 14px;
    }
    
    .zft-card-name {
        padding: 15px 10px;
        height: 80px;
        font-size: 16px;
    }
    
    .zft-modal-content {
        width: 95%;
        margin: 20% auto;
    }
    
    .zft-search-result-details,
    .zft-member-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 人物详情弹窗样式 - 表格样式 */
.zft-member-details {
    margin-top: 25px;
    animation: fadeInUp 0.5s ease-out;
}

.zft-details-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
    animation: tableFadeIn 0.6s ease-out;
}

.zft-details-table tr {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: rowFadeIn 0.4s ease-out forwards;
}

.zft-details-table tr:nth-child(1) { animation-delay: 0.1s; }
.zft-details-table tr:nth-child(2) { animation-delay: 0.2s; }
.zft-details-table tr:nth-child(3) { animation-delay: 0.3s; }
.zft-details-table tr:nth-child(4) { animation-delay: 0.4s; }
.zft-details-table tr:nth-child(5) { animation-delay: 0.5s; }
.zft-details-table tr:nth-child(6) { animation-delay: 0.6s; }
.zft-details-table tr:nth-child(7) { animation-delay: 0.7s; }
.zft-details-table tr:nth-child(8) { animation-delay: 0.8s; }

.zft-details-table tr:hover {
    background: rgba(0,123,255,0.1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.zft-details-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.zft-details-table tr:last-child td {
    border-bottom: none;
}

.zft-details-table td:first-child {
    font-weight: 600;
    color: #212529;
    width: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 3px solid #007bff;
    position: relative;
}

.zft-details-table td:first-child::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #007bff, #6c757d);
}

.zft-details-table td:last-child {
    color: #495057;
    background: white;
    font-size: 14px;
    line-height: 1.4;
}

.zft-details-table tr:hover td:first-child {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-right-color: #0056b3;
}

.zft-details-table tr:hover td:last-child {
    background: rgba(0,123,255,0.05);
}

/* 动画效果 */
@keyframes tableFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        box-shadow: 0 0 0 rgba(0,0,0,0.1);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 相册独立显示在底部 */
.zft-member-images {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
    animation: fadeInUp 0.7s ease-out 0.2s both;
}

.zft-member-images h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.zft-member-images h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #6c757d);
    border-radius: 3px;
}

/* 图片网格样式 */
.zft-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.zft-image-item {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.zft-image-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.zft-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #f8f9fa;
}

.zft-image:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.zft-image-desc {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    font-weight: 500;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
