/* 在线数独游戏插件样式 */
:root {
    --primary-color: #5A9BD5; /* 中性蓝色主色调 */
    --primary-light: #E3F0FF;
    --primary-dark: #3A7CB5;
    --secondary-color: #6BCEFF; /* 蓝色系辅助色 */
    --secondary-light: #E0F4FF;
    --secondary-dark: #3AABFF;
    --success-color: #7ED957; /* 更明亮的绿色 */
    --error-color: #FF7070; /* 更柔和的红色 */
    --border-color: #C5DCEF;
    --bg-color: #F5FAFF;
    --text-color: #5F5F7F;
    --text-muted: #9E9EB3;
    --cell-size: 45px; /* 加宽单元格尺寸 */
    --board-border: 3px solid var(--primary-color);
    --cell-border: 1px solid var(--border-color);
    --thick-border: 2px solid var(--primary-color);
    --thin-border: 1px solid var(--border-color);
    --font-family: 'Comic Sans MS', 'Marker Felt', cursive, sans-serif; /* 卡通字体 */
}

/* 容器样式 */
.sudoku-game-container {
    font-family: var(--font-family);
    max-width: 700px; /* 加宽容器 */
    margin: 0 auto 40px;
    padding: 25px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(90, 155, 213, 0.15);
    border: 3px solid var(--primary-light);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="10" cy="10" r="2" fill="%23E3F0FF"/><circle cx="30" cy="10" r="2" fill="%23E3F0FF"/><circle cx="50" cy="10" r="2" fill="%23E3F0FF"/><circle cx="70" cy="10" r="2" fill="%23E3F0FF"/><circle cx="90" cy="10" r="2" fill="%23E3F0FF"/><circle cx="10" cy="30" r="2" fill="%23E3F0FF"/><circle cx="30" cy="30" r="2" fill="%23E3F0FF"/><circle cx="50" cy="30" r="2" fill="%23E3F0FF"/><circle cx="70" cy="30" r="2" fill="%23E3F0FF"/><circle cx="90" cy="30" r="2" fill="%23E3F0FF"/><circle cx="10" cy="50" r="2" fill="%23E3F0FF"/><circle cx="30" cy="50" r="2" fill="%23E3F0FF"/><circle cx="50" cy="50" r="2" fill="%23E3F0FF"/><circle cx="70" cy="50" r="2" fill="%23E3F0FF"/><circle cx="90" cy="50" r="2" fill="%23E3F0FF"/><circle cx="10" cy="70" r="2" fill="%23E3F0FF"/><circle cx="30" cy="70" r="2" fill="%23E3F0FF"/><circle cx="50" cy="70" r="2" fill="%23E3F0FF"/><circle cx="70" cy="70" r="2" fill="%23E3F0FF"/><circle cx="90" cy="70" r="2" fill="%23E3F0FF"/><circle cx="10" cy="90" r="2" fill="%23E3F0FF"/><circle cx="30" cy="90" r="2" fill="%23E3F0FF"/><circle cx="50" cy="90" r="2" fill="%23E3F0FF"/><circle cx="70" cy="90" r="2" fill="%23E3F0FF"/><circle cx="90" cy="90" r="2" fill="%23E3F0FF"/></svg>');
}

.sudoku-game-container h2 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 2.2rem;
    text-shadow: 2px 2px 0 var(--primary-light), 3px 3px 0 var(--border-color);
    letter-spacing: 1px;
}

.sudoku-description {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
    background-color: var(--primary-light);
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 3px 0 var(--border-color);
}

/* 游戏控制区样式 */
.sudoku-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.sudoku-difficulty {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.difficulty-indicator {
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
}

.difficulty-progress {
    display: flex;
    height: 30px;
    background-color: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.difficulty-level {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 12px;
    opacity: 0.5;
}

.difficulty-level.active {
    background-color: var(--primary-color);
    color: white;
    opacity: 1;
}

.difficulty-level .btn-text {
    display: none;
}

.difficulty-level.active .btn-text {
    display: block;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.difficulty-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.difficulty-btn {
    padding: 12px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.difficulty-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.difficulty-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.difficulty-btn .btn-text {
    color: #000000;
    display: block;
    text-shadow: none;
    font-size: 16px;
    font-weight: bold;
    padding: 2px 5px;
}

.difficulty-btn.active .btn-text {
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.sudoku-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timer-label {
    font-weight: 600;
    color: var(--text-color);
}

.timer-display {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 60px;
}

/* 音效按钮样式 */
.sound-btn {
    min-width: 45px;
    height: 45px;
    border-radius: 50px;
    padding: 0 15px;
    background-color: var(--secondary-color);
    box-shadow: 0 4px 0 var(--secondary-dark);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn:hover {
    background-color: var(--secondary-dark);
}

.sound-icon {
    font-size: 1.3rem;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.btn-text {
    font-size: 14px;
    font-weight: bold;
    color: white;
    font-family: var(--font-family);
    display: block;
    white-space: nowrap;
    overflow: visible;
}

.difficulty-btn .btn-text {
    color: var(--text-color);
    display: block;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: bold;
}

.difficulty-btn.active .btn-text {
    color: white;
}

.number-btn .btn-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    display: block;
}

.sound-on {
    opacity: 1;
}

.sound-off {
    opacity: 0;
}

.sound-btn.muted .sound-on {
    opacity: 0;
}

.sound-btn.muted .sound-off {
    opacity: 1;
}

/* 按钮样式 */
.sudoku-btn {
    padding: 10px 18px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 var(--primary-dark);
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sudoku-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-dark);
}

.sudoku-btn:active {
    top: 4px;
    box-shadow: 0 0 0 var(--primary-dark);
}

.sudoku-btn:disabled {
    background-color: var(--border-color);
    box-shadow: 0 4px 0 #ccc;
    cursor: not-allowed;
}

.new-game-btn {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 0 var(--secondary-dark);
    padding: 12px 20px;
    font-size: 1.1rem;
}

.new-game-btn:hover {
    background-color: var(--secondary-dark);
    box-shadow: 0 6px 0 var(--secondary-dark);
}

.new-game-btn:active {
    box-shadow: 0 0 0 var(--secondary-dark);
}

/* 游戏区域样式 */
.sudoku-game-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

/* 数独网格样式 */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    border: var(--board-border);
    background-color: white;
    box-shadow: 0 8px 15px rgba(90, 155, 213, 0.2);
    border-radius: 10px;
    overflow: hidden;
    padding: 3px;
    background-color: var(--primary-light);
}

.sudoku-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border: var(--cell-border);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
    border-radius: 5px;
    margin: 1px;
}

/* 设置3x3宫格的粗边框 */
.sudoku-cell[data-col="2"],
.sudoku-cell[data-col="5"] {
    border-right: var(--thick-border);
}

.sudoku-cell[data-row="2"],
.sudoku-cell[data-row="5"] {
    border-bottom: var(--thick-border);
}

/* 单元格状态样式 */
.sudoku-cell.selected {
    background-color: var(--primary-light);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(90, 155, 213, 0.5);
    z-index: 2;
}

.sudoku-cell.highlighted {
    background-color: var(--secondary-light);
}

.sudoku-cell.same-number {
    background-color: rgba(107, 206, 255, 0.3);
}

.sudoku-cell.error {
    color: var(--error-color);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

.sudoku-cell.hint {
    color: var(--success-color);
    animation: pop 0.3s ease-in-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.sudoku-cell.fixed {
    color: var(--text-color);
    font-weight: 700;
    background-color: var(--bg-color);
}

/* 单元格内容样式 */
.cell-value {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell-notes {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 2px;
}

.note-value {
    font-size: 0.7rem;
    font-weight: normal;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    visibility: hidden;
}

.note-value.visible {
    visibility: visible;
}

/* 数字选择器样式 */
.sudoku-number-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
}

.number-btn {
    height: 50px;
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 var(--border-color);
    color: var(--text-color);
    position: relative;
    top: 0;
}

.number-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--border-color);
}

.number-btn:active {
    top: 4px;
    box-shadow: 0 0 0 var(--border-color);
}

.number-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 0 var(--primary-dark);
}

.erase-btn {
    background-color: var(--error-color);
    color: white;
    box-shadow: 0 4px 0 #e05050;
}

.erase-btn:hover {
    background-color: #ff8585;
    box-shadow: 0 6px 0 #e05050;
}

.erase-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 工具栏样式 */
.sudoku-toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 15px;
}

.sudoku-toolbar .sudoku-btn {
    min-width: 90px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
}

.notes-icon, .hint-icon, .check-icon, .undo-icon {
    font-size: 20px;
    color: white;
    margin-right: 5px;
}

.sudoku-toolbar .btn-text {
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.notes-icon::before {
    content: '✏️';
}

.hint-icon::before {
    content: '💡';
}

.check-icon::before {
    content: '✓';
}

.undo-icon::before {
    content: '↩️';
}

.notes-btn.active {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 0 var(--secondary-dark);
}

.notes-btn.active:hover {
    background-color: var(--secondary-dark);
    box-shadow: 0 6px 0 var(--secondary-dark);
}

.notes-btn.active:active {
    box-shadow: 0 0 0 var(--secondary-dark);
}

/* 加载中样式 */
.sudoku-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    display: none;
    border-radius: 10px;
}

.sudoku-loading.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 15px;
}

.loading-spinner:before,
.loading-spinner:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.6;
    top: 0;
    left: 0;
    animation: pulse 2s ease-in-out infinite alternate;
}

.loading-spinner:after {
    background-color: var(--secondary-color);
    animation-delay: 1s;
}

@keyframes pulse {
    0%, 100% { transform: scale(0.2); opacity: 0.6; }
    50% { transform: scale(1); opacity: 0.2; }
}

.sudoku-loading p {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 1px 1px 0 white;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 暂停覆盖层样式 */
.sudoku-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    display: none;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.sudoku-pause-overlay.active {
    display: flex;
}

.pause-message {
    text-align: center;
    padding: 25px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(90, 155, 213, 0.2);
    border: 3px solid var(--primary-light);
    transform: scale(0);
    animation: zoomIn 0.5s forwards;
}

@keyframes zoomIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pause-message h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 var(--primary-light);
}

.pause-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 游戏完成消息样式 */
.sudoku-completion-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(90, 155, 213, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: none;
    backdrop-filter: blur(5px);
}

.sudoku-completion-message.active {
    display: flex;
}

.completion-content {
    background-color: white;
    padding: 35px;
    border-radius: 25px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(90, 155, 213, 0.3);
    border: 5px solid var(--primary-light);
    animation: celebrate 0.7s ease-out;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%23E3F0FF"/><circle cx="40" cy="80" r="4" fill="%23E3F0FF"/><circle cx="80" cy="40" r="3" fill="%23E3F0FF"/><circle cx="70" cy="70" r="2" fill="%23E3F0FF"/><circle cx="10" cy="90" r="2" fill="%23E3F0FF"/><circle cx="90" cy="10" r="2" fill="%23E3F0FF"/><circle cx="30" cy="50" r="3" fill="%23E3F0FF"/><circle cx="60" cy="30" r="4" fill="%23E3F0FF"/></svg>');
}

@keyframes celebrate {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

.completion-content h3 {
    color: var(--success-color);
    margin-bottom: 15px;
    font-size: 2rem;
    text-shadow: 2px 2px 0 var(--secondary-light);
    position: relative;
    display: inline-block;
}

.completion-content h3:before,
.completion-content h3:after {
    content: '🎉';
    position: absolute;
    top: 0;
    font-size: 1.5rem;
}

.completion-content h3:before {
    left: -30px;
    animation: swing 2s ease infinite;
}

.completion-content h3:after {
    right: -30px;
    animation: swing 2s ease infinite reverse;
}

@keyframes swing {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.completion-content p {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.completion-time {
    margin: 25px 0;
    font-size: 1.3rem;
    background-color: var(--primary-light);
    padding: 15px;
    border-radius: 50px;
    display: inline-block;
    min-width: 200px;
    box-shadow: 0 4px 0 var(--border-color);
}

.play-again-btn {
    font-size: 1.2rem;
    padding: 12px 25px;
    margin-top: 10px;
}

.time-label {
    font-weight: 600;
}

.time-value {
    font-family: monospace;
    font-weight: 600;
}

/* 游戏说明样式 */
.sudoku-instructions {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.sudoku-instructions h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.sudoku-instructions h4 {
    margin: 15px 0 10px;
    color: var(--text-color);
}

.sudoku-instructions ul {
    padding-left: 20px;
}

.sudoku-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 响应式样式 */
@media (max-width: 700px) {
    :root {
        --cell-size: 40px;
    }
    
    .sudoku-game-container {
        max-width: 95%;
        padding: 15px;
    }
    
    .sudoku-game-container h2 {
        font-size: 1.8rem;
    }
    
    .sudoku-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sudoku-number-selector {
        grid-template-columns: repeat(5, 1fr);
        max-width: 100%;
    }
    
    .sudoku-toolbar {
        flex-wrap: wrap;
    }
    
    .sudoku-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .sudoku-toolbar .sudoku-btn {
        min-width: 80px;
    }
    
    .sudoku-toolbar .sudoku-btn::before {
        left: 8px;
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 500px) {
    :root {
        --cell-size: 35px;
    }
    
    .sudoku-game-container h2 {
        font-size: 1.6rem;
    }
    
    .sudoku-description {
        font-size: 0.9rem;
    }
    
    .number-btn {
        height: 45px;
        width: 45px;
        font-size: 1.2rem;
    }
    
    .sudoku-toolbar {
        gap: 8px;
    }
    
    .sudoku-toolbar .sudoku-btn {
        min-width: 70px;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .sound-btn {
        min-width: 40px;
        padding: 0 10px;
    }
    
    .btn-text {
        font-size: 12px;
        display: block;
    }
    
    .difficulty-btn .btn-text {
        font-size: 12px;
        display: block;
    }
}

@media (max-width: 400px) {
    :root {
        --cell-size: 32px;
    }
    
    .sudoku-number-selector {
        gap: 5px;
    }
    
    .number-btn {
        height: 40px;
        width: 40px;
        font-size: 1.1rem;
    }
    
    .sudoku-toolbar .sudoku-btn {
        min-width: auto;
        padding: 8px;
        flex-direction: column;
    }
    
    .notes-icon, .hint-icon, .check-icon, .undo-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .sound-btn {
        flex-direction: column;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        padding: 0;
    }
    
    .sound-icon {
        margin-right: 0;
        margin-bottom: 2px;
    }
    
    .difficulty-btn {
        padding: 10px 15px;
    }
    
    .difficulty-btn .btn-text {
        font-size: 11px;
        white-space: nowrap;
        display: block;
    }
}. d i f f i c u l t y - b t n   . b t n - t e x t   {   d i s p l a y :   b l o c k   ! i m p o r t a n t ;   v i s i b i l i t y :   v i s i b l e   ! i m p o r t a n t ;   o p a c i t y :   1   ! i m p o r t a n t ;   c o l o r :   # 0 0 0 0 0 0   ! i m p o r t a n t ;   f o n t - s i z e :   1 6 p x   ! i m p o r t a n t ;   f o n t - w e i g h t :   b o l d   ! i m p o r t a n t ;   } 
 
 