/**
 * 隐形性格评估探针 - 现代化卡片UI样式
 * 文件名: ynm-disc.css
 * 功能: 卡片式极简设计、丝滑过渡动画
 */

/* 主容器 */
.ynm-disc-quiz-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    /* 自驾游主题背景 - 模拟通往远方的道路和山脉 */
    background:
        /* 顶部天空渐变 */
        linear-gradient(180deg,
            rgba(102, 126, 234, 0.1) 0%,
            rgba(118, 75, 162, 0.05) 50%,
            rgba(255, 255, 255, 0.95) 100%
        ),
        /* 道路线条装饰 */
        linear-gradient(90deg,
            transparent 0%,
            rgba(102, 126, 234, 0.1) 20%,
            transparent 40%,
            transparent 60%,
            rgba(118, 75, 162, 0.1) 80%,
            transparent 100%
        );
    background-attachment: fixed;
    background-position: center;
    background-size: 100% 100%;
}

/* 卡片基础样式 */
.ynm-quiz-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 欢迎页面图标 */
.ynm-quiz-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

/* 欢迎页面图标 */
.ynm-quiz-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* SVG图标样式 */
.ynm-quiz-icon svg {
    width: 48px;
    height: 48px;
    fill: white;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 标题样式 */
.ynm-quiz-title,
.ynm-question-text,
.ynm-success-title {
    color: #2D3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 欢迎页面标题特殊优化 */
#ynm-quiz-intro .ynm-quiz-title {
    margin-bottom: 24px;
    color: #2D3748;
}

/* 题目文本特殊样式 - 左对齐 */
.ynm-question-text {
    text-align: left;
}

/* 答题页面特殊样式 - 内容左对齐 */
#ynm-quiz-questions {
    text-align: left;
}

/* 描述文本 */
.ynm-quiz-description,
.ynm-success-description {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
}

/* 欢迎页面描述容器 */
#ynm-quiz-intro .ynm-quiz-description {
    margin-bottom: 40px;
    text-align: left;
}

/* 欢迎页面中的段落样式 */
#ynm-quiz-intro .ynm-quiz-description p {
    margin-bottom: 16px;
    color: #4a5568;
    line-height: 1.8;
    font-size: 16px;
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

/* 第一个段落添加特殊效果 */
#ynm-quiz-intro .ynm-quiz-description p:first-child {
    font-size: 17px;
    margin-bottom: 20px;
}

/* 最后一个段落去掉下边距，添加强调效果 */
#ynm-quiz-intro .ynm-quiz-description p:last-child {
    margin-bottom: 0;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #2d3748;
    font-weight: 500;
}

/* 段落中的加粗文本优化 */
#ynm-quiz-intro .ynm-quiz-description p strong {
    color: #764ba2;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

/* 段落hover效果 */
#ynm-quiz-intro .ynm-quiz-description p:hover {
    color: #2d3748;
    transform: translateX(4px);
}

/* 描述文本中的重点词汇优化（全局） */
.ynm-quiz-description strong {
    color: #764ba2;
    font-weight: 600;
}

/* 按钮样式 */
.ynm-quiz-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 按钮箭头图标 */
.ynm-quiz-button::after {
    content: '→';
    font-size: 20px;
    transition: transform 0.3s ease;
}

.ynm-quiz-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c8ef8 0%, #8a5eb8 100%);
    opacity: 0.95;
}

.ynm-quiz-button:hover::after {
    transform: translateX(4px);
}

.ynm-quiz-button:active {
    transform: translateY(0);
}

/* 进度条样式 */
.ynm-quiz-progress {
    margin-bottom: 30px;
}

.ynm-progress-bar {
    background: #e9ecef;
    border-radius: 3px;
    height: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

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

/* 进度条末端的小圆点 */
.ynm-progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px #fff;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
    }
}

.ynm-progress-text {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* 选项容器 */
.ynm-options-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

/* 确保答题页面中所有内容都左对齐 */
#ynm-quiz-questions .ynm-options-container {
    text-align: left;
}

/* 答题页面装饰元素 */
.ynm-question-content {
    position: relative;
}

.ynm-question-content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 选项的额外装饰效果 */
.ynm-option::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ynm-option:hover::after {
    opacity: 0.5;
}

/* 选项样式 */
.ynm-option {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #4a5568;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    backdrop-filter: blur(5px);
}

/* 选项前的装饰线条 */
.ynm-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ynm-option:hover::before {
    opacity: 1;
}

/* 选项序号样式 */
.ynm-option-number {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', sans-serif;
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
    line-height: 1;
    text-shadow: 1px 1px 0 rgba(102, 126, 234, 0.1);
    user-select: none;
    transition: all 0.3s ease;
}

/* 选项文本样式 */
.ynm-option-text {
    flex: 1;
    line-height: 1.8;
}

.ynm-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ynm-option:hover .ynm-option-number {
    color: #764ba2;
    transform: scale(1.1);
}

.ynm-option:active {
    transform: translateX(4px);
}

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

.ynm-option-selected .ynm-option-number {
    color: #fff;
    text-shadow: none;
}

.ynm-option-selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: white;
}

/* 加载动画 */
.ynm-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.ynm-loading-text {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* 成功页面图标 */
.ynm-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: celebrate 0.6s ease-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

/* SVG图标样式 */
.ynm-success-icon svg {
    width: 48px;
    height: 48px;
    fill: white;
    stroke: white;
}

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

/* 错误提示 */
.ynm-quiz-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    margin: 20px 0;
}

/* 过渡动画类 */
.ynm-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.ynm-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* 入场动画 */
.ynm-entrance-animation {
    animation: entranceSlide 0.6s ease-out forwards;
}

.ynm-entrance-delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.ynm-entrance-delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.ynm-entrance-delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

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

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .ynm-disc-quiz-wrapper {
        padding: 15px;
        margin: 20px auto;
        min-height: auto;
    }

    .ynm-quiz-card {
        padding: 30px 20px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    }

    .ynm-quiz-icon,
    .ynm-success-icon {
        width: 60px;
        height: 60px;
    }

    .ynm-quiz-icon svg,
    .ynm-success-icon svg {
        width: 36px;
        height: 36px;
    }

    .ynm-quiz-title,
    .ynm-question-text,
    .ynm-success-title {
        font-size: 18px;
        line-height: 1.5;
    }

    .ynm-quiz-description,
    .ynm-success-description {
        font-size: 14px;
        line-height: 1.7;
    }

    .ynm-quiz-button {
        padding: 14px 28px;
        font-size: 16px;
    }

    .ynm-option {
        padding: 16px 18px;
        font-size: 14px;
        gap: 12px;
    }

    .ynm-option-number {
        font-size: 24px;
        min-width: 35px;
    }

    .ynm-option-text {
        line-height: 1.6;
    }

    /* 移动端简化装饰 */
    .ynm-question-content::before {
        display: none;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 防止选择文本影响用户体验 */
.ynm-quiz-card {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 焦点样式提升可访问性 */
.ynm-quiz-button:focus,
.ynm-option:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* 打印样式优化 */
@media print {
    .ynm-disc-quiz-wrapper {
        box-shadow: none;
    }
    
    .ynm-quiz-card {
        page-break-inside: avoid;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .ynm-quiz-card {
        border: 2px solid #000;
    }
    
    .ynm-option {
        border: 2px solid #000;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .ynm-quiz-card {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .ynm-quiz-title,
    .ynm-question-text,
    .ynm-success-title {
        color: #ecf0f1;
    }
    
    .ynm-quiz-description,
    .ynm-success-description {
        color: #bdc3c7;
    }
    
    .ynm-option {
        background: #34495e;
        border-color: #4a6572;
        color: #ecf0f1;
    }
    
    .ynm-option:hover {
        background: #4a6572;
        border-color: #667eea;
    }
    
    .ynm-progress-bar {
        background: #4a6572;
    }
}