/* 模式识别测试页面特有样式 */
/* 页面特定变量 */
:root {
    --pattern-primary: #8b5cf6; /* 紫色作为主色调 */
    --pattern-secondary: #6366f1;
    --pattern-success: #10b981;
    --pattern-warning: #f59e0b;
    --pattern-danger: #ef4444;
    --pattern-light: #a78bfa;
    --pattern-dark: #7c3aed;
}

/* 测试区域样式 */
.pattern-test-area {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 进度条样式 */
.test-progress-bar {
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    transition: margin 0.3s ease, height 0.3s ease;
}

.progress-track {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(139, 92, 246, 0.2);
    border-radius: 4px;
    margin-right: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--pattern-primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
    white-space: nowrap;
}

/* 测试盒子样式 - 不要覆盖全局样式 */
/* 全局样式已经定义了基本的测试盒子样式，这里只添加特定于模式识别的样式 */
.test-box {
    min-height: 500px; /* 使用min-height而不是固定height */
    margin: 0;
    position: relative;
}

.test-box .test-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

.test-box .test-status {
    margin-bottom: 10px; /* 减小下边距 */
    text-align: center;
    width: 100%;
}

.test-box .status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0; /* 移除下边距 */
}

.test-box .pattern-test-area {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    box-sizing: border-box;
    position: relative;
}

/* 模式显示区域 */
.pattern-display {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0; /* 减小上下边距 */
    position: relative;
    border-radius: 8px;
    background-color: rgba(139, 92, 246, 0.05);
    padding: 15px;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.test-box .start-btn {
    margin-top: 10px; /* 减小上边距 */
    padding: 10px 20px;
    font-size: 1rem;
}

/* 测试状态样式 */
/* 等待状态 */
.test-box.waiting .pattern-test-area {
    opacity: 0.5;
    display: none;
}

.test-box.waiting .pattern-display {
    display: none;
}

.test-box.waiting .start-btn {
    display: block;
}

.test-box.waiting .result-text,
.test-box.waiting .share-container {
    display: none !important; /* 使用!important确保优先级 */
}

.test-box.waiting .test-progress-bar {
    display: none;
    margin: 0; /* 移除边距 */
    height: 0; /* 移除高度 */
    overflow: hidden; /* 隐藏溢出内容 */
}

.test-box.waiting .status-text {
    margin-bottom: 5px; /* 减小下边距 */
}

/* 活动状态 */
.test-box.active .pattern-test-area {
    opacity: 1;
    display: flex;
}

.test-box.active .pattern-display {
    display: flex;
    margin: 15px 0; /* 恢复正常边距 */
}

.test-box.active .start-btn {
    display: none;
}

.test-box.active .result-text,
.test-box.active .share-container {
    display: none !important; /* 使用!important确保优先级 */
}

.test-box.active .test-progress-bar {
    display: flex;
    margin-bottom: 15px; /* 恢复正常边距 */
}

/* 完成状态 */
.test-box.completed .pattern-test-area {
    display: none; /* 完全隐藏整个测试区域 */
}

.test-box.completed .pattern-display {
    display: none;
}

.test-box.completed .start-btn {
    display: block;
    margin-top: 10px; /* 减小上边距 */
}

.test-box.completed .result-text,
.test-box.completed .share-container {
    display: block;
    animation: fadeIn 0.5s forwards;
}

.test-box.completed .test-progress-bar {
    display: none;
    margin: 0; /* 移除边距 */
    height: 0; /* 移除高度 */
    overflow: hidden; /* 隐藏溢出内容 */
}

.test-box.completed .status-text {
    margin-bottom: 5px; /* 减小下边距 */
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 结果反馈样式 */
.result-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: var(--space-3);
    border-radius: var(--border-radius);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards; /* 只有透明度变化的动画 */
    background-color: rgba(255, 255, 255, 0.8);
    width: 80%;
    max-width: 300px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.dark-theme .result-feedback {
    background-color: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.result-feedback.correct {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--pattern-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-feedback.error {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--pattern-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-feedback i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.reaction-time {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* 结果文本样式 */
.result-text {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 15px 0;
    text-align: center;
    color: var(--text-primary);
    width: 100%;
}

/* 准确率样式 */
.result-accuracy {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 5px;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

.result-accuracy.correct {
    color: var(--pattern-success);
}

.result-accuracy.incorrect {
    color: var(--pattern-danger);
}

/* 分享按钮样式 */
.share-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--pattern-success) 0%, #0d9668 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    margin-top: 10px;
}

.share-btn:hover {
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #0fb37d 0%, #0a8057 100%);
}

/* 暗色主题下的分享按钮 */
.dark-theme .share-btn {
    background: linear-gradient(135deg, var(--pattern-success) 0%, #0d9668 100%);
}

.dark-theme .share-btn:hover {
    background: linear-gradient(135deg, #0fb37d 0%, #0a8057 100%);
}

/* 反应类型统计样式 */
.reaction-stats {
    padding: 15px;
    background-color: #f9fafb;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.reaction-stats h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.reaction-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.reaction-stat-item {
    text-align: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.5); /* 修改背景色 */
    border-radius: 8px;
    transition: all 0.3s ease;
}

.reaction-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--pattern-primary);
    margin-bottom: 5px;
}

/* 添加颜色区分 */
.reaction-stat-item.correct .reaction-stat-value {
    color: var(--pattern-success);
}

.reaction-stat-item.error .reaction-stat-value {
    color: var(--pattern-danger);
}

.reaction-stat-item.accuracy .reaction-stat-value {
    color: var(--pattern-primary);
}

.reaction-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 游戏化样式 */
.gamification-area {
}

.gamification-content {
    padding: 0;
}

.level-section {
    padding: 15px;
    background-color: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
}

.level-info {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.level-badge {
    position: relative;
    background-color: var(--pattern-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
}

.level-badge i {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.level-badge span {
    font-size: 1.1rem;
}

.level-details {
    flex-grow: 1;
}

.level-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.level-details .progress-bar {
    height: 6px;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.level-details .progress {
    height: 100%;
    background-color: var(--pattern-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.level-details .progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

/* 成就部分 */
.achievements-section {
}

/* 成就样式 */
.achievements-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.achievement-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
}

.achievement-tab.active {
    color: var(--pattern-primary);
    font-weight: 500;
}

.achievement-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--pattern-primary);
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 两列布局 */
    gap: 10px;
    margin-top: 10px;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    background-color: rgba(139, 92, 246, 0.05);
    transition: all 0.2s ease;
}

.achievement-item.locked {
    opacity: 0.6;
}

.achievement-item.unlocked {
    background-color: rgba(139, 92, 246, 0.1);
}

.achievement-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: var(--pattern-primary);
    font-size: 0.9rem;
}

.achievement-item.unlocked .achievement-icon {
    background-color: var(--pattern-primary);
    color: white;
}

.achievement-info h4 {
    margin: 0 0 3px 0;
    font-size: 0.9rem;
}

.achievement-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* 挑战样式 */
.challenges-section {
}

.challenge-item {
    padding: 12px;
    border-radius: 6px;
    background-color: rgba(139, 92, 246, 0.05);
    margin-bottom: 10px;
}

.challenge-info h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--pattern-primary);
}

.challenge-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.75rem;
}

.challenge-reward {
    color: var(--pattern-success);
}

.challenge-info p {
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.challenge-info .progress-bar {
    height: 6px;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.challenge-info .progress {
    height: 100%;
    background-color: var(--pattern-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 历史记录样式 */
.history-section {
    margin-top: 10px;
}

.history-section h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.history-container {
    position: relative;
    min-height: 222px;
}

.history-list {
    max-height: 300px;
    min-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: var(--border-radius);
    padding: var(--space-1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(249, 250, 251, 0.6) 100%);
    box-shadow: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.history-item {
    display: flex;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.history-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    transform: translateX(0);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.history-item:hover {
    background-color: rgba(249, 250, 251, 0.7);
}

.history-item:hover::after {
    transform: translateX(200%);
}

.dark-theme .history-item:hover {
    background-color: rgba(31, 41, 55, 0.7);
}

.dark-theme .history-list {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
    border: 1px solid rgba(55, 65, 81, 0.5);
}

.dark-theme .history-item {
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
}

.dark-theme .history-item::after {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.05), 
        transparent);
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 100px;
    flex-shrink: 0;
}

.history-item .history-time.correct {
    color: var(--pattern-success);
}

.history-item .history-time.incorrect {
    color: var(--pattern-danger);
}

.history-mode, .history-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-mode {
    flex: 1;
    padding-right: 10px;
}

.history-date {
    width: 90px;
    text-align: right;
    flex-shrink: 0;
}

.empty-history {
    text-align: center;
    color: var(--text-quaternary);
    font-size: 0.875rem;
    font-style: italic;
    display: none;
    align-items: center;
    justify-content: center;
    height: 300px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(249, 250, 251, 0.6) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0;
    box-sizing: border-box;
    flex-direction: column;
}

.empty-history.show {
    display: flex;
}

.dark-theme .empty-history {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
    border: 1px solid rgba(55, 65, 81, 0.5);
    color: rgba(156, 163, 175, 0.8);
}

.empty-history i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.clear-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.clear-btn i {
    font-size: 0.9rem;
}

.clear-btn:hover {
    color: var(--danger-color);
    background-color: rgba(220, 38, 38, 0.1);
}

.dark-theme .clear-btn {
    color: var(--text-secondary-dark);
}

.dark-theme .clear-btn:hover {
    color: var(--danger-color-dark);
    background-color: rgba(220, 38, 38, 0.2);
}

/* 图表样式 */
.charts-container {
    width: 100%;
    position: relative;
}

.chart-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.chart-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
}

.chart-tab.active {
    color: var(--pattern-primary);
    font-weight: 500;
}

.chart-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--pattern-primary);
}

.chart-content {
    width: 100%;
    position: relative;
    height: 400px;
}

.chart-wrapper {
    height: 100%;
    width: 100%;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

#performance-chart-wrapper {
    display: block;
}

/* 通知样式 */
.achievement-notification,
.level-up-notification,
.challenge-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 通知容器和样式 */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.achievement-notification,
.level-up-notification,
.challenge-notification {
    position: relative;
    top: auto;
    right: auto;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-bottom: 0;
    width: 280px;
}

.achievement-notification.show,
.level-up-notification.show,
.challenge-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-notification i,
.level-up-notification i,
.challenge-notification i {
    font-size: 1.5rem;
}

.achievement-notification div,
.level-up-notification div,
.challenge-notification div {
    display: flex;
    flex-direction: column;
}

.level-up-notification .notification-icon,
.challenge-notification .notification-icon {
    display: none;
}

/* 分享模态框样式 */
.share-preview {
    margin-bottom: 20px;
}

.share-card {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-header {
    background-color: var(--pattern-primary);
    color: white;
    padding: 15px;
    text-align: center;
}

.share-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.share-body {
    padding: 20px;
    text-align: center;
}

.share-result {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--pattern-primary);
    margin-bottom: 10px;
}

.share-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.share-accuracy {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--pattern-success);
}

.share-mode, .share-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.share-footer {
    background-color: #f9fafb;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.share-app-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.share-options h3 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.share-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.share-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.download-btn {
    background-color: var(--pattern-primary);
    color: white;
}

.copy-btn {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.share-platform-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #f3f4f6;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.share-platform-btn i {
    font-size: 1.2rem;
}

.share-platform-btn[data-platform="wechat"] i {
    color: #07c160;
}

.share-platform-btn[data-platform="weibo"] i {
    color: #e6162d;
}

.share-platform-btn[data-platform="qq"] i {
    color: #12b7f5;
}

.share-platform-btn[data-platform="twitter"] i {
    color: #1da1f2;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .test-box {
        min-height: 400px;
    }
    
    .pattern-display {
        height: 280px;
    }
    
    .grid-container {
        max-width: 240px;
        height: 240px;
        gap: 6px;
    }
    
    .grid-item {
        border-radius: 6px;
    }
    
    .oddone-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        max-height: 180px;
        gap: 6px;
    }
    
    .oddone-item {
        min-width: 20px;
        min-height: 20px;
        max-width: 45px;
        max-height: 45px;
    }
    
    .sequence-container {
        max-height: 220px;
        padding: 5px;
    }
    
    .sequence-items {
        gap: 8px;
        margin-bottom: 25px;
        padding: 5px 0;
    }
    
    .sequence-item,
    .sequence-option {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .sequence-option {
        font-size: 1.1rem;
        border-width: 1.5px;
    }
    
    .result-feedback {
        font-size: 0.9rem;
        padding: 15px;
        max-width: 250px;
    }
    
    .result-feedback i {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .reaction-time {
        font-size: 1.2rem;
    }
    
    .chart-content {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .test-box {
        min-height: 350px;
    }
    
    .pattern-display {
        height: 240px;
        padding: 10px;
    }
    
    .grid-container {
        max-width: 200px;
        height: 200px;
        gap: 4px;
    }
    
    .grid-item {
        border-radius: 4px;
    }
    
    .oddone-container {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        max-height: 160px;
        gap: 5px;
    }
    
    .oddone-item {
        min-width: 18px;
        min-height: 18px;
        max-width: 35px;
        max-height: 35px;
    }
    
    .sequence-container {
        max-height: 180px;
    }
    
    .sequence-items {
        gap: 6px;
        margin-bottom: 20px;
        padding: 3px 0;
    }
    
    .sequence-item,
    .sequence-option {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .sequence-option {
        font-size: 1rem;
        border-width: 1px;
    }
    
    .pattern-shape {
        width: 80%;
        height: 80%;
    }
    
    .pattern-shape.star::before {
        font-size: 20px;
    }
    
    .pattern-shape.triangle {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 20px solid currentColor;
    }
    
    .result-feedback {
        font-size: 0.85rem;
        padding: 12px;
        max-width: 200px;
    }
    
    .result-feedback i {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }
    
    .result-text {
        font-size: 1.5rem;
    }
    
    .result-accuracy {
        font-size: 1rem;
    }
    
    .chart-content {
        height: 300px;
    }
}

/* 暗色主题适配 */
.dark-theme .reaction-stat-item {
    background-color: rgba(139, 92, 246, 0.2);
}

/* 分享容器样式 */
.share-container {
    margin-top: 20px;
    display: none !important; /* 默认隐藏，使用!important确保优先级 */
    width: 100%;
    text-align: center;
}

.test-box.completed .share-container {
    display: block !important; /* 只在完成状态显示，使用!important确保优先级 */
    animation: fadeIn 0.3s ease forwards;
}

/* 网格模式样式 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 280px;
    height: 280px;
    margin: 0 auto;
    box-sizing: border-box;
}

.grid-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible; /* 改为visible，确保三角形和星形不被裁剪 */
}

.grid-item:hover {
    background-color: rgba(139, 92, 246, 0.2);
    transform: scale(1.05);
    z-index: 1;
}

/* 移除目标元素的特殊背景色，只保留data属性用于功能识别 */
.grid-item.target {
    /* 不再设置特殊背景色 */
}

.dark-theme .grid-item {
    background-color: rgba(139, 92, 246, 0.2);
}

/* 序列模式样式 */
.sequence-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 400px;
    height: 280px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px;
}

.sequence-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
}

.sequence-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.sequence-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
    gap: 15px;
    width: 100%;
}

.sequence-option {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(139, 92, 246, 0.4);
    margin: 0 5px;
}

.sequence-option:hover {
    background-color: rgba(139, 92, 246, 0.3);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 92, 246, 0.6);
}

.dark-theme .sequence-item,
.dark-theme .sequence-option {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
}

.dark-theme .sequence-option {
    background-color: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
}

.dark-theme .sequence-option:hover {
    background-color: rgba(139, 92, 246, 0.35);
    border-color: rgba(139, 92, 246, 0.7);
}

/* 奇异模式样式 */
.oddone-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 280px;
    height: 280px;
    margin: 0 auto;
    box-sizing: border-box;
}

.oddone-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.oddone-item:hover {
    transform: scale(1.05);
    z-index: 1;
}

.dark-theme .oddone-item {
    filter: brightness(0.8);
}

/* 图案容器样式 */
.pattern-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 图案点样式 */
.pattern-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    top: 50%;
    left: 50%;
}

/* 形状样式 */
.pattern-shape {
    width: 60%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.pattern-shape.circle {
    border-radius: 50%;
}

.pattern-shape.square {
    border-radius: 0;
}

.pattern-shape.triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid currentColor;
    background-color: transparent !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pattern-shape.diamond {
    transform: rotate(45deg);
}

.pattern-shape.star {
    position: relative;
    background-color: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-shape.star::before {
    content: "★";
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
    color: currentColor;
}

/* 确保在小屏幕上形状也能正确显示 */
@media (max-width: 480px) {
    .pattern-shape {
        width: 80%;
        height: 80%;
    }
    
    .pattern-shape.star::before {
        font-size: 20px;
    }
    
    .pattern-shape.triangle {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 20px solid currentColor;
    }
}

/* 测试模式选择器禁用状态 */
#test-mode:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(229, 231, 235, 0.3);
    border-color: rgba(209, 213, 219, 0.5);
}

.dark-theme #test-mode:disabled {
    background-color: rgba(55, 65, 81, 0.5);
    border-color: rgba(75, 85, 99, 0.5);
}
