/* ===== 团队竞赛答题页面 - QuizApp风格 ===== */
.quiz-play-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #FFF;
    overflow: hidden;
    z-index: 99999;
    box-sizing: border-box;
}

.quiz-play-page > .status-bar {
    position: relative;
    z-index: 200;
    background: linear-gradient(180deg, #D32F2F 0%, #B71C1C 100%);
}

/* Top Red Background */
.quiz-red-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(to bottom, #D32F2F 0%, #B71C1C 100%);
    z-index: 0;
}

/* Main Content */
.quiz-main-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

/* Navigation Bar */
.quiz-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: 56px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.quiz-nav-back {
    background: none;
    border: none;
    padding: 4px;
    margin-left: -4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.quiz-nav-title {
    color: #FFF;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.quiz-nav-spacer {
    width: 24px;
}

/* Score Panel */
.quiz-score-panel {
    margin: 8px 16px 32px;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    background: #e23c36;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,80,80,0.3);
}

/* Left Side: My Score */
.quiz-my-score {
    flex: 0.4;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(120,20,20,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(180,40,40,0.3);
}

.quiz-user-name {
    color: #FFF;
    font-weight: bold;
    font-size: 16px;
}

.quiz-score-display-box {
    flex: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px 6px;
    margin-top: 4px;
    background: #B71C1C;
    position: relative;
}

.quiz-score-numbers {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.quiz-personal-score {
    color: #FFF;
    font-weight: bold;
    font-size: 36px;
    line-height: 1;
}

.quiz-score-max {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

/* Right Side: Leaderboard */
.quiz-leaderboard {
    flex: 0.6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 9999px;
    padding: 6px 12px;
    background: #d42e29;
}

.leaderboard-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.leaderboard-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(139,0,0,0.5);
}

.leaderboard-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.leaderboard-avatar-sm svg {
    width: 14px;
    height: 14px;
}

.leaderboard-name {
    color: #FFF;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    color: #FFF;
    font-weight: bold;
    font-size: 14px;
}

/* Quiz Content Container */
.quiz-content-area {
    flex: 1;
    background: #FFF;
    border-radius: 20px 20px 0 0;
    margin-top: 16px;
    position: relative;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 400px;
    overflow-x: visible;
}

/* Timer Badge (Overlapping) */
.quiz-timer-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 4px;
    z-index: 100;
    border-radius: 9999px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FF8F00;
    box-shadow: 0 3px 12px rgba(255,143,0,0.4);
    border: 2px solid rgba(255,255,255,0.95);
}

.quiz-timer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    width: 24px;
    height: 24px;
}

.quiz-timer-icon svg {
    background: transparent !important;
    border: none !important;
    width: 24px;
    height: 24px;
}

.quiz-timer-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.quiz-timer-value,
.quiz-timer-unit {
    color: #FFF;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 1px;
    line-height: 1;
}

.quiz-timer-value {
    font-size: 20px;
}

.quiz-timer-unit {
    font-size: 16px;
}

.quiz-timer-value.warning,
.quiz-timer-unit.warning {
    color: #FFF;
    animation: pulse 0.5s ease-in-out infinite;
}

.quiz-timer-badge.warning {
    background: #FF6F00;
    box-shadow: 0 4px 20px rgba(255,111,0,0.5);
}

.quiz-timer-icon.warning {
    animation: iconPulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Question Area */
.quiz-question-area {
    padding: 58px 20px 24px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.quiz-question-text {
    color: #212121;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Image Area for image questions */
.quiz-image-area {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    max-height: 180px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F8F8;
    flex-shrink: 0;
}

.quiz-question-image {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    display: block;
    background: #F8F8F8;
}

/* Options Area */
.quiz-options-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.quiz-option-btn-new {
    width: 100%;
    text-align: left;
    border-radius: 12px;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid #E0E0E0;
    background: #F5F5F5;
    -webkit-tap-highlight-color: transparent;
}

.quiz-option-btn-new:hover:not(:disabled) {
    transform: scale(0.98);
    border-color: #BDBDBD;
}

.quiz-option-btn-new:active:not(:disabled) {
    transform: scale(0.97);
}

.quiz-option-btn-new:disabled {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.option-text-new {
    color: #333333;
    font-size: 16px;
    font-weight: 500;
}

/* ===== 退出确认弹窗样式 ===== */
.exit-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.exit-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.exit-confirm-modal {
    background: linear-gradient(180deg, #FFF9F0 0%, #FFFFFF 100%);
    border-radius: 20px;
    padding: 30px 24px;
    width: 85%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.exit-confirm-overlay.show .exit-confirm-modal {
    transform: scale(1);
}

.exit-confirm-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.exit-confirm-title {
    font-size: 19px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.exit-confirm-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.exit-confirm-buttons {
    display: flex;
    gap: 12px;
}

.exit-btn-cancel,
.exit-btn-confirm {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exit-btn-cancel {
    background: #F5F5F5;
    color: #666;
}

.exit-btn-cancel:hover {
    background: #EEEEEE;
}

.exit-btn-confirm {
    background: linear-gradient(180deg, #E83C25 0%, #CC2310 100%);
    color: #FFF;
}

.exit-btn-confirm:hover {
    filter: brightness(1.05);
}

/* ===== 倒计时结束→结算弹窗 过渡动画 ===== */

/* 时间到冲击效果 - 全屏闪光 */
.quiz-timeup-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(255,143,0,0.2) 50%, transparent 70%);
    z-index: 9999;
    pointer-events: none;
    animation: timeUpFlash 0.6s ease-out forwards;
}

@keyframes timeUpFlash {
    0% { opacity: 0; transform: scale(0.5); }
    30% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.3); }
}

/* 过渡加载遮罩层 */
.quiz-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(183,28,28,0.95) 0%, rgba(211,47,47,0.95) 50%, rgba(229,57,53,0.95) 100%);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-transition-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 加载动画容器 */
.transition-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

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

/* 圆形进度环 */
.transition-progress-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.transition-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.transition-progress-ring .ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 6;
}

.transition-progress-ring .ring-fill {
    fill: none;
    stroke: #FFD54F;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: progressRingFill 1.5s ease-in-out forwards;
    filter: drop-shadow(0 0 8px rgba(255,213,79,0.6));
}

@keyframes progressRingFill {
    0% { stroke-dashoffset: 226; }
    100% { stroke-dashoffset: 0; }
}

/* 中心图标/文字 */
.transition-center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: centerIconPulse 1s ease-in-out infinite;
}

@keyframes centerIconPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

/* 加载文字 */
.transition-text {
    color: #FFF;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.transition-text .dot-animation {
    display: inline-block;
    animation: dotBounce 1.4s infinite;
}

.transition-text .dot-animation:nth-child(2) { animation-delay: 0.2s; }
.transition-text .dot-animation:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* 分数预览区域 */
.transition-score-preview {
    display: flex;
    gap: 32px;
    margin-top: 16px;
    padding: 16px 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.preview-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.preview-score-label {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
}

.preview-score-value {
    color: #FFD54F;
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(255,213,79,0.4);
    animation: scoreCountUp 1s ease-out 0.5s both;
}

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

/* 装饰粒子效果 */
.transition-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD54F;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 2s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 85%; top: 15%; animation-delay: 0.3s; }
.particle:nth-child(3) { left: 25%; top: 75%; animation-delay: 0.6s; }
.particle:nth-child(4) { left: 75%; top: 70%; animation-delay: 0.9s; }
.particle:nth-child(5) { left: 50%; top: 10%; animation-delay: 1.2s; }
.particle:nth-child(6) { left: 90%; top: 45%; animation-delay: 0.15s; }
.particle:nth-child(7) { left: 5%; top: 50%; animation-delay: 0.45s; }
.particle:nth-child(8) { left: 60%; top: 85%; animation-delay: 0.75s; }

@keyframes particleFloat {
    0% { 
        opacity: 0; 
        transform: translateY(0) scale(0); 
    }
    20% { 
        opacity: 0.8; 
        transform: translateY(-20px) scale(1); 
    }
    80% { 
        opacity: 0.6; 
        transform: translateY(-40px) scale(0.8); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-60px) scale(0); 
    }
}

/* 计时器时间到动画增强 */
.quiz-timer-badge.timeup {
    animation: timerTimeUp 0.5s ease-out forwards !important;
}

@keyframes timerTimeUp {
    0% { transform: translateX(-50%) scale(1); background: #E53935; }
    30% { transform: translateX(-50%) scale(1.3); background: #FF5722; }
    60% { transform: translateX(-50%) scale(0.9); background: #FF9800; }
    100% { transform: translateX(-50%) scale(1); background: #FFC107; }
}
