/* 测试问题页面 */
.test-questions {
    display: flex;
    flex-direction: column;
    min-height: 40vh;
    padding-bottom: 0; /* 完全移除底部内边距 */
    position: relative;
    overflow: visible; /* ✅ 不裁切向外溢出的内容 */
    margin-top: 0; /* 恢复默认值，移动端在mobile.css中单独设置 */
}

/* 确保紫色网格背景显示，覆盖所有CSS文件中的背景色设置 */
html body.mbti-page,
body.mbti-page {
    background-image: 
        linear-gradient(rgba(187, 134, 252, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(187, 134, 252, 0.15) 1px, transparent 1px) !important;
    background-size: 60px 60px !important;
    background-position: 0 0, 30px 30px !important;
    background-color: rgba(187, 134, 252, 0.02) !important;
    background-attachment: fixed !important;
}

/* 最高优先级选择器，确保覆盖所有可能的样式 */
html:not([class]) body.mbti-page,
html body.mbti-page:not([class]) {
    background-image: 
        linear-gradient(rgba(187, 134, 252, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(187, 134, 252, 0.15) 1px, transparent 1px) !important;
    background-size: 60px 60px !important;
    background-position: 0 0, 30px 30px !important;
    background-color: rgba(187, 134, 252, 0.02) !important;
    background-attachment: fixed !important;
}



/* 添加背景动效 - 与测试介绍页面相同的效果 */
.test-questions::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(187, 134, 252, 0.05) 0%,
        rgba(187, 134, 252, 0) 70%
    );
    z-index: -1;
    animation: rotate-bg 30s infinite linear;
}

/* 添加装饰元素 - 全局背景效果 */
.test-questions::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(187, 134, 252, 0.15) 0%, rgba(187, 134, 252, 0) 20%),
        radial-gradient(circle at 80% 70%, rgba(187, 134, 252, 0.1) 0%, rgba(187, 134, 252, 0) 20%);
    z-index: -1;
    pointer-events: none;
}

.question-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 0 80px 0; /* 增加底部内边距为按钮留出空间 */
    margin-top: 20px !important; /* 👈 增加你想要的间距值，比如 20px、40px 等 */
    min-height: 400px; /* 设置最小高度确保有足够空间 */
}

/* 装饰元素 - 更加微妙的设计 */
.question-decoration {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 60px 0;
    z-index: 0;
    opacity: 0.4; /* 降低整体不透明度 */
}

.question-decoration.left {
    left: 0;
}

.question-decoration.right {
    right: 0;
}

.decoration-circle {
    width: 8px; /* 减小圆点大小 */
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5); /* 改为更微妙的白色 */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.decoration-line {
    width: 1px; /* 减小线条宽度 */
    flex-grow: 1;
    margin: 10px 0;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.5) 100%); /* 改为更微妙的白色渐变 */
}

/* 在淡入淡出时隐藏装饰元素 */
.question-container.fade-out + .question-decoration,
.question-container.fade-in + .question-decoration {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* 问题卡片 */
.question-container {
    background: rgba(30, 30, 40, 0.7);
    border: 1px solid rgba(187, 134, 252, 0.2);
    border-radius: 24px;
    padding: 10px 20px; /* 减少内边距以降低高度 */
    margin: 0 auto 0 auto;
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 1;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(10px);
}

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

/* 问题头部 */
.question-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px; /* 减少底部边距以降低高度 */
    width: 100%;
}

/* 标题和音乐按钮容器 - 新布局 */
.question-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.question-category {
    display: none;
}

/* 音频播放提示 */
.audio-play-prompt {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 24px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.audio-play-prompt .prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-play-prompt i {
    font-size: 24px;
    color: var(--primary-color);
}

.audio-play-prompt p {
    margin: 0;
    font-size: 16px;
}

/* 问题内容 */
.question-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.question-text {
    width: 100%;
    font-size: 22px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.6;
    text-align: center;
}



/* 问题标题区域的图标样式 */
.question-title-container .question-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.question-title-container .illustration-icon {
    width: 60px;
    height: 60px;
    background: rgba(187, 134, 252, 0.1);
    border: 2px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 旧位置的图标样式 - 隐藏 */
.question-content .question-illustration {
    display: none;
}

.illustration-icon {
    width: 80px;
    height: 80px;
    background: rgba(187, 134, 252, 0.1);
    border: 2px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration-icon i {
    font-size: 40px;
    color: var(--primary-color);
}

/* 问题选项 - PC端水平排列 */
@media (min-width: 769px) {
    .question-options-container .option-grid {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        margin-bottom: 15px;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 800px;
        padding: 0 20px;
        box-sizing: border-box;
    }
}

@media (min-width: 769px) {
    .option-btn {
        padding: 20px 25px;
        background: rgba(30, 30, 40, 0.6);
        border: 2px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        color: var(--text-color);
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.1),
            0 1px 0 rgba(255, 255, 255, 0.05) inset;
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        height: 80px;
        min-height: 80px;
        max-height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: none;
    }
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

/* PC端选项表情图标 */
@media (min-width: 769px) {
    .option-emoji {
        font-size: 24px;
        margin-bottom: 4px;
    }

    /* PC端选项文本 */
    .option-text {
        font-size: 14px;
        line-height: 1.3;
    }
}

.option-btn:hover {
    background: rgba(40, 40, 50, 0.8);
    border-color: rgba(187, 134, 252, 0.3);
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.15),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.option-btn:hover::before {
    background: var(--primary-color);
}

.option-btn.selected {
    background: rgba(187, 134, 252, 0.15);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
    box-shadow:
        0 0 20px rgba(187, 134, 252, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.option-btn.selected::before {
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.8);
}

/* 选项波纹效果 */
.option-ripple {
    position: absolute;
    background: rgba(187, 134, 252, 0.4);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.7s linear;
    pointer-events: none;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    margin-left: -100px;
    margin-top: -100px;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 问题提示 */
.question-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px 20px;
    margin-top: 20px;
    border-left: 3px solid var(--primary-color);
}

.question-tip i {
    color: var(--primary-color);
    font-size: 18px;
}

/* 导航区域 - 吸附在问题卡片下方 */
@media (min-width: 769px) {
    .question-navigation {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px 30px;
        background: transparent;
        margin-top: 0px;
        z-index: 10;
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }
}



/* 圆形导航按钮 */
.nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* PC端导航按钮样式 */
@media (min-width: 769px) {
    /* 上一题按钮位于左下角 */
    #prevBtn {
        position: absolute;
        left: 20px;
        bottom: 20px;
        background: rgba(30, 30, 40, 0.8);
        border: 2px solid rgba(255, 255, 255, 0.1);
        color: var(--text-color);
    }

    /* 下一题按钮位于右下角 */
    #nextBtn {
        position: absolute;
        right: 20px;
        bottom: 20px;
        background: rgba(30, 30, 40, 0.8);
        border: 2px solid rgba(255, 255, 255, 0.1);
        color: var(--text-color);
    }
}

/* 上一题按钮 */
.prev-btn {
    background: rgba(30, 30, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.prev-btn:hover:not(:disabled) {
    background: rgba(40, 40, 50, 0.9);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.4);
}

.prev-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 内嵌禁用状态样式 */
.prev-btn.disabled-embedded {
    opacity: 0.15;
    cursor: not-allowed;
    background: rgba(30, 30, 40, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.85);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* 下一题按钮 */
.next-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A876E8 100%);
    color: white;
}

.next-btn:hover:not(:disabled) {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.4);
}

/* 禁用状态下移除悬停效果 */
.prev-btn:disabled:hover,
.next-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: rgba(30, 30, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    opacity: 0.3;
    cursor: not-allowed;
}

.next-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 内嵌禁用状态样式 */
.next-btn.disabled-embedded {
    opacity: 0.15;
    cursor: not-allowed;
    background: rgba(30, 30, 40, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.85);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* 提交结果按钮（最后一题时的下一题按钮） - 使用更高优先级选择器 */
button.next-btn.submit-btn,
.next-btn.submit-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #a876e8 100%) !important;
    color: white !important;
    border: 2px solid rgba(139, 92, 246, 0.3) !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4) !important;
}

button.next-btn.submit-btn i,
.next-btn.submit-btn i {
    font-size: 28px !important;
    color: white !important;
}

button.next-btn.submit-btn:hover:not(:disabled),
.next-btn.submit-btn:hover:not(:disabled) {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6) !important;
}

.navigation-indicators {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 300px;
    margin: 0 20px;
    overflow: hidden;
}

.indicator-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: var(--primary-color);
    box-shadow: 0 0 8px rgba(187, 134, 252, 0.6);
    transform: scale(1.2);
}

/* 音乐控制按钮样式 */
.music-control {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 240, 240, 0.9) 100%);
    border: 1px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 4个独立进度条容器 */
.progress-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* 单个进度条容器 - 水平排列 */
.stage-progress {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex: 1;
    margin-right: 0;
    margin-left: -2px;
}

/* 阶段标签 - 隐藏文字 */
.stage-label {
    width: 5px;
    font-size: 0;
    color: transparent;
    margin-right: 0;
    text-align: right;
}

/* 进度条包装器 */
.progress-bar-wrapper {
    flex: 1;
    height: 8px;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* 进度条填充 */
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(187, 134, 252, 1), rgba(139, 92, 246, 1));
    border-radius: 4px;
    transition: width var(--transition-normal);
    width: 0%;
}

/* 阶段指示器圆点 */
.stage-dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background-color: rgba(139, 92, 246, 0.1);
    margin-left: 2px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

/* 进度信息区域 */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 阶段描述文字 */
.stage-descriptions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stage-desc {
    text-align: center;
    flex: 1;
    padding: 0 5px;
}

/* 已完成状态 */
.stage-dot.completed,
.stage-desc.completed {
    color: var(--primary-color);
}

.stage-dot.completed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 当前状态 */
.stage-dot.current,
.stage-desc.current {
    color: var(--primary-color);
    font-weight: bold;
}

.stage-dot.current {
    border-color: var(--primary-color);
    background-color: transparent;
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.5);
}

@keyframes fillPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(187, 134, 252, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(187, 134, 252, 0.1); }
}

/* 进度信息区域 */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: var(--space-md);
}

.progress-text {
    font-weight: 500;
}

/* 阶段描述文字 */
.stage-descriptions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-md);
    padding: 0 var(--space-sm);
}

.stage-desc {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    transition: color var(--transition-normal);
}

.stage-desc.completed {
    color: var(--primary-color);
}

.stage-desc.current {
    color: var(--primary-color);
    font-weight: 500;
}

/* 音乐控制按钮基础样式 */
.music-control {
    position: absolute;
    top: 40px;
    right: 40px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(187, 134, 252, 0.5);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 10;
}

.music-control:hover {
    background: rgba(187, 134, 252, 0.1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.3);
}

.music-control:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.music-control.playing {
  box-shadow: 0 0 8px rgba(147, 51, 234, 0.3),
              0 0 12px rgba(147, 51, 234, 0.2),
              0 0 16px rgba(147, 51, 234, 0.1);
  animation: musicGlow 3s ease-in-out infinite;
}

@keyframes musicGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(147, 51, 234, 0.3),
                0 0 12px rgba(147, 51, 234, 0.2),
                0 0 16px rgba(147, 51, 234, 0.1);
  }
  50% {
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.4),
                0 0 18px rgba(147, 51, 234, 0.3),
                0 0 24px rgba(147, 51, 234, 0.2);
  }
}