/* 姓名缘分测试样式 */

/* 姓名输入区域 */
.input-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 64, 129, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.name-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.name-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.name-input-group label {
    font-weight: bold;
    color: #333;
}

.input-control {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.input-control:focus {
    outline: none;
    border-color: #ff4081;
    box-shadow: 0 0 0 3px rgba(255, 64, 129, 0.1);
    transform: translateY(-2px);
}

.relation-type {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.type-label {
    font-weight: bold;
    color: #333;
}

.type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.type-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.test-action {
    text-align: center;
    margin-top: 10px;
}

.test-btn {
    padding: 12px 30px;
    background-color: #ff4081;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.test-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: left 0.5s;
}

.test-btn:hover::before {
    left: 100%;
}

.test-btn:hover {
    background-color: #e91e63;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 64, 129, 0.4);
}

.test-btn:active {
    transform: translateY(0);
}

.test-btn.loading {
    position: relative;
    color: transparent;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 测试结果区域 */
.result-section {
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.result-container {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.names-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.name-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 64, 129, 0.1), rgba(233, 30, 99, 0.1));
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 64, 129, 0.3);
}

.name-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background-color: #f0f0f0;
    border-radius: 50%;
    color: #ff4081;
}

.name-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.compatibility-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.compatibility-line {
    width: 100px;
    height: 2px;
    background-color: #ff4081;
}

.compatibility-heart {
    font-size: 28px;
    color: #ff4081;
    filter: drop-shadow(0 0 10px rgba(255, 64, 129, 0.5));
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.2);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.2);
    }
    70% {
        transform: scale(1);
    }
}

.compatibility-score {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4081, #e91e63);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
    position: relative;
    overflow: hidden;
    transform: scale(0);
    animation: scaleIn 0.8s ease-out 0.3s forwards;
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.score-value {
    font-size: 36px;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.score-label {
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.compatibility-details {
    margin-bottom: 20px;
}

.compatibility-details h4 {
    font-size: 18px;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.5s ease-out forwards;
}

.detail-item:nth-child(1) { animation-delay: 0.1s; }
.detail-item:nth-child(2) { animation-delay: 0.2s; }
.detail-item:nth-child(3) { animation-delay: 0.3s; }
.detail-item:nth-child(4) { animation-delay: 0.4s; }
.detail-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.detail-label {
    font-size: 14px;
    color: #666;
}

.detail-value {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.detail-score {
    font-size: 14px;
    color: #ff4081;
}

.compatibility-comment {
    background-color: #fff3f7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.compatibility-comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #ff4081, #e91e63);
    border-radius: 2px;
}

.compatibility-comment h4 {
    font-size: 18px;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
}

.compatibility-comment p {
    font-size: 16px;
    color: #444;
    line-height: 1.5;
    margin: 0;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.action-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 自定义提示框样式 */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.custom-alert.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-alert.alert-warning {
    background-color: #ff9800;
}

.custom-alert.alert-info {
    background-color: #2196f3;
}

.custom-alert.alert-success {
    background-color: #4caf50;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .names-display {
        flex-direction: column;
    }

    .compatibility-indicator {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .custom-alert {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }

    .custom-alert.show {
        transform: translateY(0);
    }
}
