/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #4a6fa5;
}

.logo h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-top: 10px;
}

/* 卡片通用样式 */
.intro-card,
.test-card,
.result-card,
.types-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.intro-card:hover,
.test-card:hover,
.result-card:hover,
.types-card:hover {
    transform: translateY(-5px);
}

/* 介绍部分 */
.intro-section h2,
.test-section h2,
.result-section h2,
.types-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.intro-section h2 i,
.test-section h2 i,
.result-section h2 i,
.types-section h2 i {
    color: #4a6fa5;
}

.mbti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.mbti-dimension {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #4a6fa5;
}

.mbti-dimension h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dimension-item {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.type-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 10px;
    color: white;
}

.type-letter.E { background: #e74c3c; }
.type-letter.I { background: #3498db; }
.type-letter.S { background: #2ecc71; }
.type-letter.N { background: #9b59b6; }
.type-letter.T { background: #f39c12; }
.type-letter.F { background: #1abc9c; }
.type-letter.J { background: #34495e; }
.type-letter.P { background: #e67e22; }

/* 测试部分 */
.test-instructions {
    background: #e8f4fc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.progress-container {
    margin: 30px 0;
}

.progress-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.question-container {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.answer-options {
    display: grid;
    gap: 15px;
    margin: 30px 0;
}

.answer-option {
    padding: 15px 20px;
    background: white;
    border: 2px solid #eaeaea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.answer-option:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.answer-option.selected {
    border-color: #2ecc71;
    background: #f0fff4;
}

.option-number {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

/* 按钮样式 */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

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

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 结果部分 */
.result-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
}

.mbti-type-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.mbti-letter {
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mbti-letter.active {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#finalType {
    font-size: 2.5rem;
    color: #2c3e50;
    margin: 20px 0;
}

.type-description {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.detail-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-top: 4px solid #3498db;
}

.detail-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-section {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-share {
    background: white;
    color: #333;
    border: 2px solid #eaeaea;
}

.btn-share:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

/* 类型库 */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.type-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #4a6fa5;
    transition: all 0.3s ease;
}

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

.type-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.type-nickname {
    color: #7f8c8d;
    font-style: italic;
    margin: 5px 0;
}

.type-traits {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #ecf0f1;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-link {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 1.2rem;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .mbti-grid,
    .result-details,
    .types-grid {
        grid-template-columns: 1fr;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .mbti-type-display {
        flex-wrap: wrap;
    }
    
    .mbti-letter {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.2rem;
    }
    
    #finalType {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header,
    .intro-card,
    .test-card,
    .result-card,
    .types-card {
        padding: 20px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

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

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

/* 打印样式 */
@media print {
    .navigation-buttons,
    .share-section,
    .footer {
        display: none;
    }
    
    .result-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}