/* ==================== 与062-074完全统一的样式（基于074） ==================== */
/* 找不同游戏 - 统一版 */

:root {
    --primary-color: #2196f3;
    --primary-light: #4caf50;
    --primary-dark: #1976d2;
    --primary-gradient: var(--primary-color);
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #95a5a6;
    --bg-primary: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e8f0fe;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f6f9fc 0%, #eef2f6 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.game-active { height: 100vh; overflow: hidden; position: fixed; width: 100%; }

.main-container { max-width: 900px; margin: 2rem auto; }

.card {
    background: rgba(255,255,255,.98); border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow); backdrop-filter: blur(10px);
    transition: var(--transition-normal); overflow: hidden; padding: 0; margin-bottom: 20px;
}
.card:hover { box-shadow: var(--box-shadow-hover); }

.hidden { display: none !important; }
.section { transition: opacity .3s ease; }

/* 蓝色头部 */
.card-header { padding: 1.75rem 2rem; background: var(--primary-gradient); text-align: center; border-bottom: none; }
.card-title { color: white; font-size: 1.5rem; font-weight: 600; letter-spacing: .5px; margin-bottom: .5rem; }
.card-desc { color: rgba(255,255,255,.85); font-size: .95rem; }
.card-body { padding: 2rem; }

/* 表单 */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.75rem; }
.form-select {
    width: 100%; padding: .875rem 1rem; font-size: 1rem;
    border: 2px solid var(--border-color); border-radius: var(--border-radius);
    background: white; cursor: pointer; transition: var(--transition-fast); appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}
.form-select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(33,150,243,.1); }

/* 训练说明（统一060标准样式） */
.instructions { background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); padding: 1.5rem; border-radius: var(--border-radius); margin: 1.5rem 0; border: 1px solid var(--border-color); border-left: 4px solid var(--primary-color); }
.instructions-title { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.instructions-list { list-style: none; padding-left: 0; }
.instructions-list li { padding: 0.625rem 0; padding-left: 2rem; position: relative; font-size: 0.95rem; color: var(--text-secondary); }
.instructions-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success-color); font-weight: 600; }

/* 按钮（统一060/074标准样式） */
.btn {
    padding: .875rem 2rem; font-size: 1rem; font-weight: 600; border: none;
    border-radius: var(--border-radius); cursor: pointer; transition: var(--transition-normal);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: inherit;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-icon { font-size: 1.125rem; }
.btn-large { width: 100%; padding: 1rem; font-size: 1.125rem; }
.btn-primary { background: linear-gradient(135deg,var(--primary-color) 0%,var(--primary-dark) 100%); color: white; box-shadow: 0 4px 12px rgba(33,150,243,.3); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg,var(--primary-dark) 0%,#1565c0 100%); box-shadow: 0 6px 16px rgba(33,150,243,.4); }
.btn-secondary { background: var(--success-color); color: white; box-shadow: 0 4px 12px rgba(76,175,80,.3); }
.btn-secondary:hover:not(:disabled) { background: #45a049; box-shadow: 0 6px 16px rgba(76,175,80,.4); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 2px solid var(--border-color); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); transform: translateY(-2px); }
.btn-danger { background: var(--error-color); color: white; }
.btn-danger:hover:not(:disabled) { background: #d32f2f; }
.btn-small { padding: .4rem .6rem; font-size: .78rem; white-space: nowrap; }

/* 按钮组（统一060标准样式） */
.button-group { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 480px) { .button-group { flex-direction: row; } }
.button-group .btn { flex: 1; }

/* ==================== 游戏页面头部（075特有） ==================== */
.game-header-bar {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: white; border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); margin-bottom: 12px;
    flex-wrap: wrap; gap: 10px; border: 2px solid var(--border-color);
}

.stats-bar { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--primary-color); }
.timer-value { font-family: 'Courier New', monospace; color: var(--primary-color); }
.timer-value.urgent { color: var(--error-color) !important; }
.action-buttons { display: flex; gap: 8px; }

.game-content-area {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 8px; position: relative; overflow: hidden; width: 100%;
}

/* ==================== 对比区域（075特有） ==================== */
.compare-container {
    display: flex; gap: 12px; width: 100%; max-width: 700px;
    justify-content: center; flex-wrap: wrap;
}
.compare-box {
    flex: 1; min-width: 240px; max-width: 340px;
    background: white; border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); border: 2px solid var(--border-color); overflow: hidden;
}
.compare-label {
    padding: 10px; text-align: center; font-size: 1rem; font-weight: 700;
    color: white; background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}
.compare-image {
    width: 100%; aspect-ratio: 1; display: grid; padding: 8px; gap: 4px; background: var(--bg-secondary);
}
.compare-image.difficulty-1 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
.compare-image.difficulty-2 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.compare-image.difficulty-3 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
.compare-image.clickable { cursor: crosshair; }
.compare-image.clickable:hover { background: #e3f2fd; }

.grid-cell {
    display: flex; justify-content: center; align-items: center;
    background: white; border-radius: 8px; font-size: 1.8rem; transition: all 0.2s ease;
}
.grid-cell.correct { background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%); box-shadow: 0 0 12px rgba(76, 175, 80, 0.4); animation: pulse 0.5s ease; }
.grid-cell.wrong { background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%); animation: shake 0.3s ease; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.scene-item {
    display: flex; justify-content: center; align-items: center; font-size: 1.6rem;
    width: 100%; height: 100%; background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Apple Color Emoji", "Helvetica Neue", Arial, sans-serif;
}

/* ==================== 反馈区域（075特有） ==================== */
.feedback-section {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; z-index: 100; background: white; padding: 28px 36px;
    border-radius: var(--border-radius-lg); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 280px; max-width: 90%; border: 3px solid var(--border-color);
}
.feedback-section.hidden { display: none !important; }
.feedback-icon { font-size: 4.5rem; margin-bottom: 8px; animation: bounceIn 0.4s ease; }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.feedback-text { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.feedback-answer { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; max-width: 300px; }
.feedback-icon.correct { color: var(--success-color); }
.feedback-icon.wrong { color: var(--error-color); }

/* ==================== 结果页面（完全参考061） ==================== */
.result-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.result-title { color: white; font-size: 2rem; font-weight: 700; }

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-primary);
}

.result-stats .stat-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition-normal);
}

.result-stats .stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-stats .stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.75rem; font-weight: 500; }
.result-stats .stat-value { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }
.time-highlight { color: var(--primary-color) !important; font-family: 'Courier New', monospace; }

.result-feedback {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.feedback-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feedback-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.result-actions {
    padding: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

.result-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* ==================== 记录页面（075特有） ==================== */
.records-list { max-height: 55vh; overflow-y: auto; padding: 8px; background: var(--bg-primary); border-radius: 12px; text-align: left; }
.record-item { padding: 14px; background: white; border-radius: 12px; margin-bottom: 10px; border: 2px solid var(--border-color); }
.record-item:last-child { margin-bottom: 0; }
.record-rank { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); margin-bottom: 6px; }
.record-info { display: flex; justify-content: space-between; margin-bottom: 6px; }
.record-name { font-weight: 600; color: var(--text-primary); }
.record-date { font-size: 0.8rem; color: var(--text-light); }
.record-stats { display: flex; justify-content: space-around; font-size: 0.9rem; }
.record-correct { color: var(--success-color); font-weight: 600; }
.record-accuracy { color: var(--primary-color); font-weight: 600; }
.record-time { color: var(--text-secondary); font-weight: 600; }
.loading, .empty, .error { text-align: center; padding: 24px; color: var(--text-secondary); font-size: 0.95rem; }
.empty-message { text-align: center; padding: 32px 16px; color: var(--text-light); font-size: 1rem; }

/* ==================== 模态框（统一074标准） ==================== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal.hidden { display: none !important; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,.45); z-index: 999; }
.modal-overlay.hidden { display: none !important; }
.modal-content { background-color: white; border-radius: var(--border-radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.2); width: 90%; max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: linear-gradient(135deg,#2196f3 0%,#1976d2 100%); color: white; }
.modal-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.btn-close { background: white; border: none; font-size: 1.4rem; cursor: pointer; color: var(--primary-color); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; transition: transform .2s; }
.btn-close:hover { transform: scale(1.15); }
.modal-body { padding: 16px 20px; }
.leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.leaderboard-table th,.leaderboard-table td { padding: 12px; text-align: center; border-bottom: 1px solid var(--border-color); }
.leaderboard-table th { background-color: var(--bg-primary); font-weight: 600; color: var(--text-primary); }
.leaderboard-table .rank { font-weight: bold; width: 60px; }
.leaderboard-content { max-height: 60vh; overflow-y: auto; }

/* ==================== 响应式（统一074标准+075特有调整） ==================== */
@media (max-width: 768px) {
    body.game-active { height: 100vh; height: 100dvh; overflow: hidden; }
    .main-container { margin: .5rem; }
    .card-header,.card-body { padding: 1rem; }
    .card-title { font-size: 1.15rem; }
    .btn-large { padding: .8rem; font-size: 1rem; }
    .game-header-bar { padding: .75rem 1rem; gap: 4px; }
    .stats-bar { gap: .6rem; }
    .stat-label { font-size: .65rem; }
    .stat-value { font-size: 1rem; }
    .timer-value { font-size: 1.2rem; }
    .compare-container { gap: 8px; }
    .compare-box { min-width: 150px; }
    .grid-cell { font-size: 1.3rem; }
    .scene-item { font-size: 1.2rem; }
    .result-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1.5rem; }
    .result-stats .stat-value { font-size: 1.25rem; }
    .result-actions { flex-wrap: wrap; }
    .result-actions .btn { min-width: 120px; flex: 1 1 45%; }
    .result-feedback { padding: 1.25rem; }
    .feedback-title { font-size: 1rem; }
    .feedback-section { padding: 1.5rem 2rem; }
    .feedback-icon { font-size: 4rem; }
    .feedback-text { font-size: 1.25rem; }
    .modal-content { width: 95%; max-height: 90vh; }
}

@media (max-width: 480px) {
    .card-header { padding: 1.25rem; }
    .card-title { font-size: 1.125rem; }
    .card-body { padding: 1.25rem; }
    .instructions { padding: 1rem; }
    .btn-large { padding: .875rem; font-size: 1rem; }
    .game-header-bar { padding: 10px 12px; }
    .stats-bar { gap: 8px; }
    .stat-label { font-size: .7rem; }
    .stat-value { font-size: 1rem; }
    .compare-box { min-width: 130px; }
    .grid-cell { font-size: 1.1rem; }
    .scene-item { font-size: 1rem; }
    .result-stats { grid-template-columns: 1fr; }
    .result-actions { flex-direction: column; }
    .result-actions .btn { flex: 1 1 100%; }
    .button-group { flex-direction: column; }
    .feedback-section { padding: 1.25rem 1.5rem; }
    .feedback-icon { font-size: 3rem; }
    .feedback-text { font-size: 1.15rem; }
}
