/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

.container {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.page.active {
    display: block;
}

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

/* 欢迎页面 */
.welcome-content {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.welcome-content h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.intro-box {
    text-align: left;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.intro-box h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.intro-box p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.intro-box ul {
    list-style: none;
    margin: 20px 0;
}

.intro-box ul li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.intro-box ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.test-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 20px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 15px 50px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 测试页面 */
.progress-bar {
    background: white;
    border-radius: 50px;
    padding: 5px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.question-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.question-number {
    color: #667eea;
    font-size: 0.9em;
    margin-bottom: 20px;
    font-weight: 600;
}

.question-text {
    font-size: 1.5em;
    margin-bottom: 40px;
    line-height: 1.6;
    color: #333;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.option-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    text-align: center;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.option-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.option-label {
    font-weight: 500;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.navigation-buttons button {
    flex: 1;
}

/* 结果页面 */
.result-content {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-content h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.mbti-type {
    text-align: center;
    font-size: 5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: 5px;
}

.mbti-nickname {
    text-align: center;
    font-size: 1.8em;
    color: #666;
    margin-bottom: 50px;
    font-weight: 300;
}

.dimension-scores {
    margin-bottom: 50px;
}

.dimension-item {
    margin-bottom: 30px;
}

.dimension-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.dim-left {
    color: #667eea;
}

.dim-right {
    color: #764ba2;
}

.dimension-bar {
    background: #e9ecef;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.dimension-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    border-radius: 15px;
}

.dimension-percentage {
    text-align: center;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.type-description {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    line-height: 1.8;
}

.type-description h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
}

.type-description ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.type-description li {
    margin-bottom: 8px;
    color: #555;
}

.type-description p {
    color: #555;
    margin-bottom: 15px;
}

.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* 雷达图部分 */
.radar-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.radar-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.radar-chart {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.radar-chart svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* 性格特征标签 */
.traits-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.traits-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.traits-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.trait-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.trait-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

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

/* 名人同类型部分 */
.celebrities-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.celebrities-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.celebrities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.celebrity-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.celebrity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.celebrity-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.celebrity-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.celebrity-field {
    font-size: 0.85em;
    color: #666;
}

/* 相关类型匹配部分 */
.compatibility-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.compatibility-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.compatibility-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.compatibility-item:hover {
    transform: translateX(5px);
}

.compatibility-type {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
}

.compatibility-info {
    flex: 1;
}

.compatibility-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.compatibility-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

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

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-content {
        padding: 40px 20px;
    }

    .welcome-content h1 {
        font-size: 2em;
    }

    .question-container {
        padding: 20px;
    }

    .question-text {
        font-size: 1.2em;
    }

    .mbti-type {
        font-size: 3em;
    }

    .mbti-nickname {
        font-size: 1.3em;
    }

    .result-content {
        padding: 40px 20px;
    }

    .result-actions {
        flex-direction: column;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .intro-box {
        padding: 20px;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
