/* Number Memory Test 专用样式 */

/* 记忆状态显示 */
.memory-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--background-secondary) 0%, rgba(255, 149, 0, 0.05) 100%);
    border-radius: var(--border-radius-large);
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.status-item {
    text-align: center;
    padding: var(--spacing-md);
    background-color: var(--background-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-small);
    transition: transform 0.2s ease;
}

.status-item:hover {
    transform: translateY(-2px);
}

.status-label {
    display: block;
    font-size: var(--font-size-small);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    display: block;
    font-size: var(--font-size-xl);
    color: var(--warning-color);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(255, 149, 0, 0.1);
}

/* 数字测试容器 */
.number-test-container {
    max-width: 600px;
    margin: 0 auto;
}

/* 指示区域 */
.instruction-area {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-large);
    transition: all 0.3s ease;
}

.instruction-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-lg);
    color: var(--warning-color);
    opacity: 0.8;
}

.instruction-area h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.instruction-area p {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* 数字显示区域 */
.number-display-area {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-2xl);
    background: linear-gradient(135deg, var(--warning-color) 0%, #FFB84D 100%);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

.number-display-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.number-sequence {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.2em;
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 2;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 显示计时器 */
.display-timer {
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.timer-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.timer-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-radius: 3px;
    animation: timerProgress var(--display-duration, 3s) linear forwards;
}

@keyframes timerProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* 输入区域 */
.input-area {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-large);
    border: 2px solid var(--warning-color);
}

.input-area h3 {
    font-size: var(--font-size-large);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.number-input-container {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.number-input {
    flex: 1;
    max-width: 300px;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-large);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-align: center;
    border: 2px solid var(--background-tertiary);
    border-radius: var(--border-radius);
    background-color: var(--background-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    letter-spacing: 0.1em;
}

.number-input:focus {
    outline: none;
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.1);
    transform: translateY(-2px);
}

.number-input::placeholder {
    color: var(--text-tertiary);
    font-weight: normal;
}

.input-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--warning-color) 0%, #FFB84D 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.input-btn:hover {
    background: linear-gradient(135deg, #E8890B 0%, var(--warning-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.input-btn:active {
    transform: translateY(0);
}

.input-hint {
    color: var(--text-secondary);
    font-size: var(--font-size-small);
    margin: 0;
}

/* 反馈区域 */
.feedback-area {
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-large);
    text-align: center;
    transition: all 0.3s ease;
}

.feedback-area.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #28A745 100%);
    color: white;
    animation: correctFeedback 0.6s ease;
}

.feedback-area.incorrect {
    background: linear-gradient(135deg, var(--error-color) 0%, #DC3545 100%);
    color: white;
    animation: incorrectFeedback 0.6s ease;
}

@keyframes correctFeedback {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes incorrectFeedback {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(0);
    }
}

.feedback-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.feedback-content p {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

/* 数字对比 */
.number-comparison {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comparison-label {
    font-weight: 500;
    opacity: 0.8;
}

.comparison-value {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-large);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.comparison-value.correct {
    color: rgba(255, 255, 255, 0.9);
}

.comparison-value.incorrect {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: line-through;
}

/* 数字结果容器 */
.number-results-container {
    background: linear-gradient(135deg, var(--background-secondary) 0%, rgba(255, 149, 0, 0.05) 100%);
    border-radius: var(--border-radius-large);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.number-results-container h3 {
    text-align: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
}

.number-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--warning-color) 0%, #FFB84D 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: var(--shadow-large);
}

.result-card.highlight .result-icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.result-card.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-card.highlight .result-value {
    color: white;
    font-size: var(--font-size-2xl);
}

/* 记忆分析 */
.memory-analysis {
    border-top: 1px solid var(--background-tertiary);
    padding-top: var(--spacing-xl);
}

.memory-analysis h4 {
    font-size: var(--font-size-large);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    text-align: center;
}

.analysis-content {
    background-color: var(--background-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-small);
}

.analysis-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.analysis-content .highlight {
    color: var(--warning-color);
    font-weight: 600;
}

/* 记忆技巧 */
.memory-tips {
    background-color: var(--background-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-small);
}

.memory-tips h5 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.memory-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.memory-tips li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--background-secondary);
    color: var(--text-secondary);
    line-height: 1.5;
}

.memory-tips li:last-child {
    border-bottom: none;
}

.memory-tips strong {
    color: var(--warning-color);
    font-weight: 600;
}

/* 特殊效果 */
.memory-glow {
    animation: memoryGlow 1s ease-in-out;
}

@keyframes memoryGlow {
    0%, 100% {
        box-shadow: var(--shadow-medium);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 149, 0, 0.4), var(--shadow-large);
    }
}

.level-complete-effect {
    animation: levelCompleteEffect 1.2s ease-in-out;
}

@keyframes levelCompleteEffect {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(1deg);
    }
    50% {
        transform: scale(1.1) rotate(-1deg);
    }
    75% {
        transform: scale(1.05) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* 数字闪烁效果 */
.number-flash {
    animation: numberFlash 0.3s ease-in-out;
}

@keyframes numberFlash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .memory-status {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
    }
    
    .number-sequence {
        font-size: 3rem;
        letter-spacing: 0.15em;
    }
    
    .number-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .number-input {
        max-width: none;
        margin-bottom: var(--spacing-sm);
    }
    
    .input-btn {
        width: 100%;
    }
    
    .number-comparison {
        padding: var(--spacing-md);
    }
    
    .comparison-item {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .number-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .memory-status {
        grid-template-columns: 1fr;
    }
    
    .number-sequence {
        font-size: 2.5rem;
        letter-spacing: 0.1em;
    }
    
    .instruction-area,
    .input-area,
    .feedback-area {
        padding: var(--spacing-lg);
    }
    
    .number-results-container {
        padding: var(--spacing-lg);
    }
    
    .memory-tips li {
        font-size: var(--font-size-small);
    }
}

/* 无障碍支持 */
.number-input:focus {
    outline: 3px solid var(--warning-color);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .number-display-area {
        border: 3px solid var(--text-primary);
    }
    
    .number-input {
        border: 2px solid var(--text-primary);
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .number-sequence,
    .timer-bar::before,
    .feedback-area,
    .status-item {
        animation: none;
        transition: none;
    }
    
    @keyframes numberPulse,
    @keyframes timerProgress,
    @keyframes correctFeedback,
    @keyframes incorrectFeedback,
    @keyframes memoryGlow,
    @keyframes levelCompleteEffect,
    @keyframes numberFlash {
        animation-duration: 0.01ms;
    }
}
