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

body {
    font-family: 'Inter', sans-serif;
    background-color: #F5F7FA; /* 主背景色 */
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

/* 页面通用样式 */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 12px; /* 小圆角 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
}

/* 欢迎页面 */
.icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background-color: #F5F7FA;
    border-radius: 50%;
    margin: 0 auto 30px;
    color: #7C8BD0;
    font-size: 36px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: #333;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 1rem;
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
}

.hint {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    color: #888;
    font-size: 0.95rem;
}

.hint i {
    margin-right: 8px;
    color: #7C8BD0;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-width: 180px;
}

.btn-primary {
    background-color: #4C6EF5; /* 主色蓝 */
    color: white;
}

.btn-primary:hover {
    background-color: #3a56d4;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 110, 245, 0.2);
}

.btn-secondary {
    background-color: #F5F7FA;
    color: #4C6EF5;
    border: 1px solid #4C6EF5;
}

.btn-secondary:hover {
    background-color: #eef1f9;
}

.btn-submit {
    background-color: #7C8BD0; /* 辅助色紫 */
    color: white;
}

.btn-submit:hover {
    background-color: #6a7ac0;
}

/* 答题页面 */
.quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.quiz-header h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: #F5F7FA;
    border-radius: 4px;
    margin: 0 auto 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #4C6EF5;
    width: 10%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* 问题样式 */
.quiz-content {
    margin-top: 30px;
}

.question-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.question-group:last-child {
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.question-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background-color: #F5F7FA;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option:hover {
    background-color: #eef1f9;
    border-color: #7C8BD0;
}

.option.selected {
    background-color: #eef5ff;
    border-color: #4C6EF5;
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e0e0e0;
    margin-right: 16px;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.option.selected .option-marker {
    background-color: #4C6EF5;
    color: white;
}

/* 导航按钮 */
.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    gap: 20px;
}

.navigation button {
    min-width: 200px;
}

/* 结果页面 */
.result-card {
    padding: 50px;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-icon {
    background-color: #F5F7FA;
    color: #7C8BD0;
    margin-bottom: 25px;
}

.result-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

#result-subtitle {
    color: #666;
    font-size: 1rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .result-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

.result-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.result-details {
    flex: 2;
}

.mbti-badge {
    display: inline-block;
    background-color: #4C6EF5;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

#result-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.result-role {
    font-size: 1rem;
    color: #7C8BD0;
    margin-bottom: 20px;
    font-weight: 500;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tag {
    background-color: #F5F7FA;
    color: #4C6EF5;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.analysis h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis h4 i {
    color: #7C8BD0;
}

#result-analysis {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

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

.result-actions button {
    min-width: 160px;
}

/* 分享按钮样式 */
#share-btn {
    background-color: #F5F7FA;
    color: #4C6EF5;
    border: 1px solid #4C6EF5;
}

#share-btn:hover {
    background-color: #eef1f9;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        max-width: 100%;
    }

    .card {
        padding: 24px 16px;
        margin-bottom: 16px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
        line-height: 1.7;
    }

    .hint {
        margin-top: 20px;
        font-size: 0.9rem;
    }

    .icon-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 25px;
    }

    .btn-primary, .btn-secondary, .btn-submit {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-width: 120px;
    }

    /* 答题页优化 */
    .quiz-header h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .progress-container {
        height: 6px;
    }

    .question-group {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .question-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .options {
        gap: 12px;
    }

    .option {
        padding: 14px 16px;
    }

    .option-label {
        font-size: 0.95rem;
    }

    .option-marker {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
        margin-right: 12px;
    }

    .navigation {
        margin-top: 40px;
        gap: 15px;
    }

    .navigation button {
        min-width: 160px;
    }

    /* 结果页优化 */
    .result-card {
        padding: 30px 16px;
    }

    .result-header h2 {
        font-size: 1.6rem;
    }

    #result-subtitle {
        font-size: 0.95rem;
    }

    .result-content {
        gap: 30px;
        margin-bottom: 30px;
    }

    .result-image img {
        max-height: 200px;
    }

    .mbti-badge {
        font-size: 0.95rem;
        padding: 6px 14px;
        margin-bottom: 15px;
    }

    #result-title {
        font-size: 1.3rem;
    }

    .result-role {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .tags {
        gap: 8px;
        margin-bottom: 25px;
    }

    .tag {
        font-size: 0.85rem;
        padding: 5px 12px;
    }

    .analysis h4 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    #result-analysis {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .result-actions {
        margin-top: 30px;
        gap: 15px;
    }

    .result-actions button {
        min-width: 140px;
    }

    /* 图片加载区域优化 */
    .image-loading {
        min-height: 150px;
        font-size: 0.9rem;
    }

    .image-loading .spinner {
        width: 30px;
        height: 30px;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .card {
        padding: 20px 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .question-title {
        font-size: 1.05rem;
    }

    .option-label {
        font-size: 0.9rem;
    }

    .result-image img {
        max-height: 180px;
    }

    .navigation button,
    .result-actions button {
        width: 100%;
        min-width: unset;
    }
}

/* 李尔图片样式 */
.lier-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* 图片加载状态 */
.image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: #F5F7FA;
    border-radius: 12px;
    color: #666;
    font-size: 0.95rem;
    gap: 15px;
}

.image-loading p {
    margin: 0;
}

.image-loading .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-color: #7C8BD0 rgba(124, 139, 208, 0.3) rgba(124, 139, 208, 0.3) rgba(124, 139, 208, 0.3);
    border-top-color: #7C8BD0;
    margin-right: 0;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}