/* 数独求解器样式 */
.tool-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.control-section {
    margin-bottom: 30px;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sudoku-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 2px;
    background-color: #333;
    border: 3px solid #333;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sudoku-cell {
    width: 40px;
    height: 40px;
    border: none;
    background-color: white;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sudoku-cell:focus {
    background-color: #e3f2fd;
    box-shadow: inset 0 0 0 2px #2196f3;
}

.sudoku-cell:hover {
    background-color: #f5f5f5;
}

.sudoku-cell.given {
    background-color: #f0f0f0;
    color: #666;
    font-weight: bold;
    cursor: not-allowed;
}

.sudoku-cell.solved {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.sudoku-cell.error {
    background-color: #ffebee;
    color: #d32f2f;
    animation: shake 0.5s ease-in-out;
}

.sudoku-cell.highlight {
    background-color: #fff3e0;
    color: #f57c00;
}

/* 3x3宫格分隔线 */
.sudoku-cell:nth-child(3n) {
    margin-right: 2px;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    margin-bottom: 2px;
}

.input-help {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.input-help h3 {
    margin-bottom: 15px;
    color: #333;
}

.input-help ul {
    margin: 0;
    padding-left: 20px;
}

.input-help li {
    margin-bottom: 8px;
    color: #666;
}

.solve-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.solve-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-item label {
    font-weight: 500;
    color: #333;
}

.status-item span {
    font-weight: bold;
    color: #007bff;
}

.solve-steps {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.solve-steps h3 {
    margin-bottom: 15px;
    color: #333;
}

.steps-list {
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.step-item {
    padding: 10px;
    border-left: 4px solid #007bff;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 0 6px 6px 0;
}

.step-item.current {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}

.step-number {
    font-weight: bold;
    color: #007bff;
    margin-right: 10px;
}

.step-description {
    color: #333;
}

.steps-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.statistics {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.statistics h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.sudoku-tips {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.sudoku-tips h3 {
    margin-bottom: 20px;
    color: #333;
}

.tips-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-item {
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tip-header {
    padding: 15px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.tip-header:hover {
    background-color: #0056b3;
}

.tip-arrow {
    transition: transform 0.3s ease;
}

.tip-content {
    padding: 15px;
    display: none;
    background-color: white;
    border-top: 1px solid #f0f0f0;
}

.tip-content.active {
    display: block;
}

.tip-content p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sudoku-cell {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .button-group .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .info-content,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sudoku-cell {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

/* 动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.solving {
    animation: pulse 1s ease-in-out infinite;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}