
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}






body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    flex-direction: column;
}

.container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.game-section {
    flex: 3;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.ad-section {
    flex: 1;
    background-color: #f0f0f0;
    padding: 20px;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.ad-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    margin-bottom: 20px;
    border: 2px dashed #ff6b6b;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ad-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ff6b6b;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-box {
    text-align: center;
    padding: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.difficulty, .settings {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    background-color: #3498db;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: #3498db;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-info {
    background-color: #1abc9c;
}

.btn-purple {
    background-color: #9b59b6;
}

.difficulty button.active {
    background-color: #2c3e50;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #2c3e50;
}

.game-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 20px;
    align-items: flex-start;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    border: 3px solid #2c3e50;
    width: 500px;
    height: 500px;
    background-color: #f8f9fa;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.cell {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: white;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    position: relative;
}

.cell .notes {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    pointer-events: none;
}

.cell .note {
    font-size: 0.7rem;
    font-weight: normal;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.7;
}

.cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 2px solid #2c3e50;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #2c3e50;
}

.cell.fixed {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 800;
}

.cell.selected {
    background-color: #d6eaf8;
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.cell.highlighted {
    background-color: #e8f4f8;
}

.cell.error {
    color: #e74c3c;
    animation: pulseError 0.5s;
}

.cell.highlight-number {
    background-color: #ffb74d !important;
    animation: pulse 0.3s;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    z-index: 2;
}

.cell.highlight-area {
    background-color: #f3e6d2 !important;
    transition: background-color 0.2s;
}


.cell.completed {
    background-color: #2ecc71 !important;
    animation: completedAnimation 1.5s ease;
}

.cell.completed-row {
    /*background-color: rgba(52, 152, 219, 0.2) !important;*/
    background-color: rgba(103, 194, 58, 0.5) !important;
    animation: completedAnimation 1.5s ease;
}

.cell.completed-col {
    /*background-color: rgba(155, 89, 182, 0.2) !important;*/
    background-color: rgba(103, 194, 58, 0.5) !important;
    animation: completedAnimation 1.5s ease;
}

.cell.completed-box {
    /*background-color: rgba(241, 196, 15, 0.2) !important;*/
    background-color: rgba(103, 194, 58, 0.5) !important;
    animation: completedAnimation 1.5s ease;
}

.cell:hover {
    background-color: #e8f4fc;
}

/* Updated Vertical Number Pad */
.number-pad {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 500px;
    width: 100px; /* Slimmer design */
    flex-shrink: 0;
    gap: 8px;
}

.number-pad button {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0;
    height: 100%;
    width: 100%;
    border-radius: 8px;
}

.number-pad button.num-btn {
    flex: 1;
}

.number-pad button.active {
    background-color: #2c3e50;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalIn 0.4s;
}

.modal h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Sudoku Intro Styling */
.sudoku-intro {
    background: white;
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.sudoku-intro h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.sudoku-intro p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #34495e;
}

.sudoku-intro ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.sudoku-intro li {
    margin-bottom: 8px;
    color: #34495e;
}

.sudoku-intro .history {
    font-style: italic;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #bdc3c7;
}

/* 新增动画效果 */
@keyframes completedAnimation {
    0% {
        background-color: #fff;
        transform: scale(1);
    }
    20% {
        background-color: #2ecc71;
        transform: scale(1.05);
    }
    40% {
        background-color: #3498db;
        transform: scale(1.03);
    }
    60% {
        background-color: #9b59b6;
        transform: scale(1.05);
    }
    80% {
        background-color: #f1c40f;
        transform: scale(1.03);
    }
    100% {
        background-color: #fff;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseError {
    0% { background-color: white; }
    50% { background-color: rgba(231, 76, 60, 0.2); }
    100% { background-color: white; }
}

@keyframes modalIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .ad-section {
        border-left: none;
        border-top: 1px solid #ddd;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .ad-placeholder {
        width: 45%;
        height: 150px;
        margin: 10px;
    }

    .sudoku-intro {
        width: 100%;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .sudoku-grid {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 1/1;
    }

    .number-pad {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        max-width: 500px;
        height: auto;
        justify-content: center;
        margin-top: 20px;
    }

    .number-pad button {
        width: 70px;
        height: 60px;
    }
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }

    .difficulty, .settings {
        width: 100%;
        justify-content: center;
    }

    .ad-section {
        flex-direction: column;
    }

    .ad-placeholder {
        width: 100%;
    }

    .cell {
        font-size: 1.2rem;
    }

    h1 {
        font-size: 2rem;
    }

    .number-pad {
        max-width: 300px;
    }

    .number-pad button {
        width: 60px;
        height: 50px;
        font-size: 1rem;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 30px;
    }
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    margin-top: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: #3498db;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.footer-section h4 {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.footer-bottom {
    background: #1a252f;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    margin: 0;
    color: #95a5a6;
    font-size: 0.9rem;
}







.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

h1 {
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

.language-switcher {
    position: absolute;
    right: 0;
}

.language-switcher select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #3498db;
    background-color: #f8f9fa;
    color: #2c3e50;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.language-switcher select:hover {
    background-color: #e8f4fc;
    border-color: #2980b9;
}

.language-switcher select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}




