/* 游戏页面基础样式 */
.game-page {
    margin-top: 70px;
}

/* 游戏导航区 */
.game-navigation {
    background-color: #f1f5f9;
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.game-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 10px;
}
  .sudoku-cell.error {
            color: #ff0000 !important;
            background-color: #ffe6e6 !important;
            font-weight: bold;
        }

        .sudoku-cell.error::after {
            content: "×";
            position: absolute;
            top: 3px;
            right: 3px;
            font-size: 12px;
            color: #ff0000;
        }
.game-tab {
    padding: 10px 20px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.game-tab.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.game-tab:hover:not(.active) {
    border-color: #3498db;
    color: #3498db;
}

/* 游戏内容区 */
.game-content {
    padding: 40px 0;
}

.game-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.game-header {
    padding: 20px 30px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    margin-bottom: 0;
}

.game-controls {
    display: flex;
    gap: 15px;
}

.game-control-btn {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-control-btn:hover {
    background-color: #f1f5f9;
}

/* 数独游戏样式 */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: #ccc;
    margin: 30px auto;
    max-width: 540px;
}

.sudoku-cell {
    width: 60px;
    height: 60px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sudoku-cell.fixed {
    background-color: #f8fafc;
    color: #2c3e50;
}

.sudoku-cell.user-input {
    color: #3498db;
}

.sudoku-cell:hover:not(.fixed) {
    background-color: #e8f4fd;
}

.sudoku-cell.error {
    background-color: #ffebee;
    color: #e74c3c;
}

.sudoku-controls {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 540px;
    margin: 0 auto 30px;
}

.number-btn {
    padding: 10px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-btn:hover {
    background-color: #e8f4fd;
    border-color: #3498db;
}

.number-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}
 .challenge-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.challenge-description {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.answer-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.answer-section label {
    font-weight: 500;
}

#user-answer {
    width: 80px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.feedback-message {
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 500;
}

.feedback-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.circuit-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.circuit-wrapper svg {
    max-width: 100%;
    height: auto;
}
.game-tips-section,
.game-benefits-section {
   width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-top: 35px;
}

.game-tips-section h3,
.game-benefits-section h3 {
    text-align: center;
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 700;
    position: relative;
}

.game-tips-section h3::after,
.game-benefits-section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    margin: 10px auto;
    border-radius: 2px;
}

/* 技巧部分样式 */
.tips-content {
    display: grid;
    gap: 25px;
}

.tip-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #3498db;
}

.tip-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.tip-item h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-item p {
    color: #555;
    line-height: 1.7;
    font-size: 16px;
}

/* 益处部分样式 */
.benefits-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.benefit-item {
    display: flex;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #27ae60;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.benefit-icon {
    font-size: 32px;
    color: #27ae60;
    flex-shrink: 0;
    align-self: flex-start;
}

.benefit-text h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 10px;
}

.benefit-text p {
    color: #555;
    line-height: 1.6;
    font-size: 16px;
}
/* 图形推理游戏样式 */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px auto;
    max-width: 600px;
}

.pattern-item {
    aspect-ratio: 1/1;
    background-color: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.pattern-question {
    border: 2px dashed #3498db;
    position: relative;
}

.pattern-question::after {
    content: '?';
    color: #3498db;
    font-size: 2rem;
    font-weight: bold;
}

.pattern-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 30px auto;
}

.pattern-option {
    aspect-ratio: 1/1;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pattern-option:hover {
    border-color: #3498db;
    background-color: #e8f4fd;
}

.pattern-option.selected {
    border-color: #3498db;
    background-color: #e8f4fd;
}

/* 逻辑电路演示样式 */
.circuit-container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circuit-diagram {
    width: 100%;
    max-width: 800px;
    height: 300px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.circuit-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.input-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3498db;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.circuit-output {
    text-align: center;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
}

.output-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

/* 游戏说明样式 */
.game-instructions {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.game-instructions h4 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-instructions ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.game-instructions li {
    margin-bottom: 10px;
}

/* 难度选择样式 */
.difficulty-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.difficulty-btn {
    padding: 5px 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 游戏结果样式 */
.game-result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-result.show {
    opacity: 1;
    visibility: visible;
}

.result-modal {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.game-result.show .result-modal {
    transform: translateY(0);
}

.result-icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 20px;
}

.result-message {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.result-stats {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.result-stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.result-stat-item:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sudoku-cell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pattern-grid {
        gap: 10px;
    }
    
    .circuit-diagram {
        height: 200px;
    }
     .game-tips-section,
    .game-benefits-section {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .game-tips-section h3,
    .game-benefits-section h3 {
        font-size: 24px;
    }
    
    .tips-content {
        gap: 20px;
    }
    
    .tip-item {
        padding: 20px;
    }
    
    .tip-item h4 {
        font-size: 18px;
    }
    
    .benefits-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .benefit-item {
        padding: 20px;
    }
    
    .benefit-text h4 {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .sudoku-cell {
        width: 35px;
        height: 35px;
    }
    
    .pattern-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .difficulty-selector {
        flex-wrap: wrap;
    }
    
    .circuit-controls {
        flex-direction: column;
        align-items: center;
    }
     .game-tips-section h3,
    .game-benefits-section h3 {
        font-size: 22px;
    }
    
    .tip-item h4 {
        font-size: 16px;
    }
    
    .tip-item p,
    .benefit-text p {
        font-size: 14px;
    }
    
    .benefit-icon {
        font-size: 24px;
    }
}
