Generated css
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    padding: 10px;
    color: #fff;
}
html {
    font-size: 16px;
}
.header {
    text-align: center;
    margin-top: 0px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 500px;
}
h1 {
    font-size: 1.8rem;
    margin-bottom: 15px; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: #fff;
    letter-spacing: 3px;
    opacity: 0.99;
    background: none;
    -webkit-background-clip: text;
    -webkit-text-fill-color: initial;
}
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    padding: 3px;
    position: relative;
    overflow: visible;
}
.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 0 10px;
}
/* 难度选择器 */
.difficulty-selector {
    display: flex;
    gap: 15px;
    flex-grow: 1;
    overflow-x: auto;
    padding-bottom: 5px;
	align-items: center; /* 垂直居中对齐 */
}
.difficulty-selector::-webkit-scrollbar {
    display: none;
}
.difficulty-btn {
    padding: 6px 9px;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.difficulty-btn.active {
    background: #4a69bd;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.share-btn {
    flex: 1;
    min-width: 40px;
    width: 50px;
    height: 50px;
    padding: 5px 0;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #2c3e50;
    background: #f8f8f8;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}
    
.share-btn i {
    color: #2c3e50 !important;
    font-size: 1.3rem;
}
    
.share-btn span {
    color: #2c3e50 !important;
    font-size: 0.9rem;
    text-align: center;
}
.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 8px 15px;
    border-radius: 8px;
    background: #f8f8f8;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    max-height: 30px;
    min-height: 30px;
}
.timer span {
    margin-left: 3px;

}

/* 九宫格包装容器 */
.sudoku-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1px 0;
    /* 确保包装容器保持正方形 */
    aspect-ratio: 1/1;
}

/* 九宫格容器 */
.sudoku-container {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    grid-gap: 0;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1/1;
    border: 3px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-sizing: border-box;
    position: relative;
    margin: 0 auto;
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 300;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
}

/* 移除最右边列的右边框 */
.cell:nth-child(9n) {
    border-right: none;
}

/* 移除最下面行的底边框 */
.cell:nth-child(n+73):nth-child(-n+81) {
    border-bottom: none;
}

/* 添加九宫格粗线 */
/* 每个3x3宫格的右边框 */
.cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 3px solid #333;
}

/* 每个3x3宫格的底边框 */
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54),
.cell:nth-child(n+73):nth-child(-n+81) {
    border-bottom: 3px solid #333;
}

.cell.given {
    color: #000000;
    font-weight: 400;
}
.cell.user-input.correct {
    color: #000099;
}
.cell.user-input.wrong {
    color: #e74c3c;
}
.cell.highlighted {
    background: rgba(173, 216, 230, 0.3);
}
.cell.selected {
    background: #ccff33;
    box-shadow: inset 0 0 0 2px #4a69bd;
}
.cell.notes {
    overflow: hidden;
    font-size: 0.6rem;
    color: #718096;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    align-items: center;
    justify-items: center;
}
.controls {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 8px 0;
    flex-wrap: nowrap;
    gap: 30px;
    padding: 2px 2px 5px 2px;
    border: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.controls::-webkit-scrollbar {
    display: none;
}
.control-btn {
    flex: 1;
    min-width: 40px;
    width: 50px;
    height: 50px;
    padding: 5px 0;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #2c3e50;
    background: #f8f8f8;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}
.control-btn i {
    font-size: 1.3rem;
}
.control-btn:hover {
    background: #90EE90;
    transform: translateY(-2px);
}
.control-btn.active {
    background: #4a69bd;
    color: white;
}
.number-pad {
    display: flex;
    width: 100%;
    padding: 5px 0;
    height: auto;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    margin-bottom: 3px;
    overflow: hidden;
}
.number-buttons-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    padding: 0 5px;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

/* 大屏端特殊处理 - 使用网格布局并调整X按钮位置 */
@media (min-width: 1200px) {
    .number-buttons-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 10px;
        justify-content: center;
        overflow-x: visible;
    }
    
    /* 确保X按钮在原来8的位置（第1列第4行） */
    .number-buttons-container .number-btn:nth-child(10) {
        grid-column: 1;
        grid-row: 4;
    }
    
    /* 调整其他按钮的位置 */
    .number-buttons-container .number-btn:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }
    
    .number-buttons-container .number-btn:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }
    
    .number-buttons-container .number-btn:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
    }
    
    .number-buttons-container .number-btn:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .number-buttons-container .number-btn:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }
    
    .number-buttons-container .number-btn:nth-child(6) {
        grid-column: 3;
        grid-row: 2;
    }
    
    .number-buttons-container .number-btn:nth-child(7) {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* 将原来的数字8移动到X按钮原来的位置（第2列第3行） */
    .number-buttons-container .number-btn:nth-child(8) {
        grid-column: 2;
        grid-row: 3;
    }
    
    .number-buttons-container .number-btn:nth-child(9) {
        grid-column: 3;
        grid-row: 3;
    }
}

.number-buttons-container::-webkit-scrollbar {
    display: none;
}

.number-buttons-container {
    scrollbar-width: none;
}
.copyright {
    margin-top: 0px;
    font-size: 0.8rem;
    color: #4a69bd;
    text-align: center;
    padding: 5px;
}
.share-button-container {
    margin-left: 20px;
    flex-shrink: 0;
}
.number-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f8f8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 40px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0;
    flex-shrink: 0;
}
.number-btn[data-value="X"] {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ff0000 !important; /* 红色字体 */
    width: 30px;
    height: 40px;
    line-height: 1;
    padding: 0;
}

.number-btn:hover {
    transform: translateY(-3px);
    background: #e0f7fa;
}
.number-btn:active {
    transform: translateY(1px);
}

/* 合并按钮的相同样式 */
.control-btn, .number-btn, .share-btn {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn, .share-btn {
    font-weight: 600;
    flex-direction: column;
    gap: 3px;
    color: #2c3e50;
    background: #f8f8f8;
    font-size: 0.9rem;
    position: relative;
}

.number-btn {
    font-weight: 600;
    color: #2c3e50;
    background: #f8f8f8;
    padding: 0;
    flex-shrink: 0;
}

.control-btn i, .share-btn i {
    font-size: 1.3rem;
}

.control-btn:hover, .share-btn:hover {
    background: #90EE90;
    transform: translateY(-2px);
}

.number-btn:hover {
    transform: translateY(-3px);
    background: #e0f7fa;
}

.number-btn:active {
    transform: translateY(1px);
}

.info-container {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    margin-bottom: 5px;
    flex-wrap: nowrap;
    gap: 1px;
}
.message {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a69bd;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    pointer-events: none;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.8);
    padding: 3px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    scrollbar-width: none;
}
.message::-webkit-scrollbar {
    display: none;
}
/* 数据库选择器 */
.database-selector {
    display: flex;
    gap: 5px;
    margin-right: 15px;
    position: relative;
    align-items: center; /* 垂直居中对齐 */
	margin-top: -5px; /* 向上移动5px（根据需要调整） */
}
.database-btn {
    padding: 6px 12px; /* 调整内边距与难度按钮一致 */
    border: none;
    border-radius: 8px;
    background: #4a69bd; /* 修改背景色（示例：蓝色） */
    color: white; /* 文字颜色改为白色 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 140px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    top: 100%;
    left: 0;
    margin-top: 5px;
}
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
}
.dropdown-content a:hover {
    background-color: #4a69bd;
    color: white;
}
.database-btn:hover .dropdown-content {
    display: block;
}
.cell.notes  div {
    font-size: 0.7rem;
    line-height: 1;
    font-weight: bold;
    color: #3498db;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sudoku-container {
    border-collapse: collapse;
}
.cell {
    border: 1px solid #ddd;
}
.same-number-highlight {
    background: rgba(204, 255, 51, 0.7);
    box-shadow: inset 0 0 0 2px #4a69bd;
}
.database-btn.active {
    background: #3a5999; /* 激活状态的背景色（稍深） */
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.notes-btn {
    position: relative;
    overflow: visible;
}

.hint-btn {
    position: relative;
    overflow: visible;
}

.undo-btn {
    position: relative;
    overflow: visible;
}

.notes-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10000; /* 大幅提高层级 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    overflow: visible; /* 确保内容不被裁剪 */
}

.hint-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #FF9800;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10000; /* 大幅提高层级 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    overflow: visible; /* 确保内容不被裁剪 */
}

.undo-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10000; /* 大幅提高层级 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    overflow: visible; /* 确保内容不被裁剪 */
}
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}
.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    animation: fireworkAnimation 1.5s ease-out forwards;
}

@keyframes fireworkAnimation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}
.number-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.custom-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 30px;
    pointer-events: none;
    z-index: 10000;
    left: 0;
    top: 0;
    transform: translate(30%, 30%);
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
    transition: transform 0.1s ease, background 0.2s;
}
.cell.conflict {
    animation: blink 0.5s 3;
}
@keyframes blink {
    0% { background-color: #ffcccc; }
    50% { background-color: #ff9999; }
    100% { background-color: #ffcccc; }
}
.cell.hint-highlight {
    animation: hintBlink 0.5s 3;
}
@keyframes hintBlink {
    0% { background-color: #ccff33; }
    50% { background-color: #99cc00; }
    100% { background-color: #ccff33; }
}

/* 移动端优化 - 改进的媒体查询 */
@media (max-width: 768px) {
    body {
        padding: 5px;
        overflow-x: hidden; /* 防止横向滚动 */
        margin: 0;
    }
    
    .header {
        margin-bottom: 5px;
        width: 100%;
        text-align: center;
    }
    
    h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
        margin: 5px 0;
    }
    
    .game-container {
        padding: 2px;
        width: 100%;
        max-width: 100vw;
        flex-direction: column;
        gap: 5px;
        overflow: hidden;
    }
    
    .left-column, .right-column {
        width: 100%;
        max-width: 100%;
    }
    
    .sudoku-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 1px 0;
        /* 确保包装容器保持正方形 */
        aspect-ratio: 1/1;
        /* 在移动端添加最大宽度限制以防止溢出 */
        max-width: calc(100vw - 10px);
        justify-self: center;
        align-self: center;
        contain: layout style;
    }
    
    .sudoku-container {
        width: 100%;
        aspect-ratio: 1/1;
        margin: 0;
        /* 确保在移动端也能正确显示 */
        max-width: 100%;
        max-height: 100%;
        /* 移除可能导致问题的min-width和min-height设置 */
        border: 3px solid #333;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
        box-sizing: border-box;
        position: relative;
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        grid-template-rows: repeat(9, 1fr);
        grid-gap: 0;
    }
    
    /* 确保每个单元格都是正方形，但保持字体大小一致 */
    .cell {
        aspect-ratio: 1/1;
        font-size: 2.2rem; /* 增大移动端字体大小以提高可读性 */
        /* 确保内容居中 */
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
    }
    
    /* 修正右边和下边的边框 */
    .cell:nth-child(9n) {
        border-right: none;
    }

    .cell:nth-child(n+73):nth-child(-n+81) {
        border-bottom: none;
    }
    
    .game-info {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 5px;
        gap: 5px;
        width: 100%;
    }
    
    .difficulty-selector {
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .difficulty-btn {
        font-size: 14px;
        padding: 5px 8px;
        min-width: auto;
    }
    
    #tutorial-btn {
        font-size: 14px;
        padding: 5px 8px;
        min-width: auto;
    }
    
    .database-btn {
        font-size: 14px;
        padding: 5px 8px;
    }
    
    .info-container {
        padding: 0 5px;
        gap: 5px;
        width: 100%;
    }
    
    .message {
        font-size: 0.8rem;
        padding: 2px 4px;
        max-height: 28px;
        flex: 1;
    }
    
    .timer {
        font-size: 1rem;
        padding: 6px 10px;
        min-height: 30px;
    }
    
    .controls {
        gap: 15px;
        padding: 0 5px 5px;
        justify-content: center;
        width: 100%;
        /* 增加上边距和内边距，为角标提供更多空间 */
        margin: 25px 0 5px 0;
        padding: 12px 3px;
    }
    
    .control-btn {
        flex: 1;
        min-width: 40px;
        width: 45px;
        height: 45px;
        font-size: 0.8rem;
        padding: 5px;
        /* 增加按钮的外边距，为角标提供更多空间 */
        margin: 0 6px;
    }
    
    .control-btn i {
        font-size: 1.1rem;
    }
    
    .number-pad {
        padding: 3px 0;
        width: 100%;
    }
    
    .number-buttons-container {
        gap: 5px;
        justify-content: center;
        padding: 0 5px;
        width: 100%;
    }
    
    .number-btn {
        width: 28px;
        height: 38px;
        font-size: 2.4rem;
        flex-shrink: 0;
    }
    
    .copyright {
        font-size: 0.7rem;
        padding: 3px;
        text-align: center;
        width: 100%;
    }
    
    .share-button-container {
        margin-left: 10px;
    }
    
    .share-btn {
        flex: 1;
        min-width: 40px;
        width: 40px;
        height: 40px;
        padding: 5px 0;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #2c3e50;
        background: #f8f8f8;
        font-size: 0.8rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        position: relative;
    }
    
    .share-btn i {
        color: #2c3e50 !important;
        font-size: 1.1rem;
    }
    
    .share-btn span {
        color: #2c3e50 !important;
        font-size: 0.8rem;
    }
    
    /* 移动端下拉菜单优化 */
    .dropdown-content {
        min-width: 100px;
        font-size: 12px;
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
        margin-top: 5px;
    }
    
    .dropdown-content a {
        padding: 10px 12px;
    }
    
    /* 确保按钮角标在移动端也能完整显示 */
    .notes-btn, .hint-btn, .undo-btn {
        position: relative;
        overflow: visible;
    }
    
    .notes-badge, .hint-badge, .undo-badge {
        position: absolute;
        top: -8px; /* 调整位置 */
        right: -8px; /* 调整位置 */
        background: #e74c3c;
        color: white;
        border-radius: 50%;
        width: 25px; /* 稍微增大尺寸 */
        height: 25px; /* 稍微增大尺寸 */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: bold;
        z-index: 10000; /* 大幅提高层级 */
        box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* 增强阴影效果 */
        overflow: visible;
    }
    
    .notes-badge {
        background-color: red;
    }
    
    .hint-badge {
        background-color: #FF9800;
    }
    
    .undo-badge {
        background-color: #e74c3c;
    }
}

/* 中等屏幕设备优化 (769px - 1199px) */
@media (min-width: 769px) and (max-width: 1199px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }
    
    .header {
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }
    
    h1 {
        font-size: 1.6rem;
        letter-spacing: 2px;
        margin: 8px 0;
    }
    
    .game-container {
        padding: 10px;
        width: 100%;
        max-width: 100vw;
        flex-direction: column;
        gap: 10px;
        overflow: hidden;
    }
    
    .left-column, .right-column {
        width: 100%;
        max-width: 100%;
    }
    
    .sudoku-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 5px 0;
        /* 确保包装容器保持正方形 */
        aspect-ratio: 1/1;
        /* 添加最大宽度限制以防止溢出 */
        max-width: min(calc(100vw - 20px), calc(100vh - 200px));
        justify-self: center;
        align-self: center;
        contain: layout style;
    }
    
    .sudoku-container {
        width: 100%;
        aspect-ratio: 1/1;
        margin: 0 auto;
        /* 确保能正确显示 */
        max-width: 100%;
        max-height: 100%;
        /* 添加额外的约束确保正方形 */
        min-width: min(calc(100vw - 30px), calc(100vh - 220px));
        min-height: min(calc(100vw - 30px), calc(100vh - 220px));
        contain: layout style;
    }
    
    /* 确保每个单元格都是正方形 */
    .cell {
        aspect-ratio: 1/1;
        font-size: 2.6rem;
        /* 确保内容居中 */
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .game-info {
        flex-wrap: wrap;
        padding: 0 10px;
        gap: 10px;
        width: 100%;
    }
    
    .difficulty-selector {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .difficulty-btn {
        font-size: 15px;
        padding: 6px 10px;
    }
    
    #tutorial-btn {
        font-size: 15px;
        padding: 6px 10px;
    }
    
    .database-btn {
        font-size: 15px;
        padding: 6px 10px;
    }
    
    .info-container {
        padding: 0 10px;
        gap: 10px;
        width: 100%;
    }
    
    .message {
        font-size: 0.9rem;
        padding: 3px 5px;
        min-height: 32px;
        flex: 1;
    }
    
    .timer {
        font-size: 1.1rem;
        padding: 7px 12px;
        min-height: 32px;
    }
    
    .controls {
        gap: 20px;
        padding: 0 10px 10px;
        justify-content: center;
        width: 100%;
        /* 增加上边距和内边距，为角标提供更多空间 */
        margin: 30px 0 10px 0;
        padding: 15px 5px;
    }
    
    .control-btn {
        flex: 1;
        min-width: 45px;
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
        padding: 6px;
        /* 增加按钮的外边距，为角标提供更多空间 */
        margin: 0 8px;
    }
    
    .control-btn i {
        font-size: 1.2rem;
    }
    
    .number-pad {
        padding: 5px 0;
        width: 100%;
    }
    
    .number-buttons-container {
        gap: 8px;
        justify-content: center;
        padding: 0 10px;
        width: 100%;
    }
    
    .number-btn {
        width: 32px;
        height: 42px;
        font-size: 2.6rem;
        flex-shrink: 0;
    }
    
    .copyright {
        font-size: 0.8rem;
        padding: 5px;
        text-align: center;
        width: 100%;
    }
    
    /* 确保按钮角标在中等屏幕设备上也能完整显示 */
    .notes-btn, .hint-btn, .undo-btn {
        position: relative;
        overflow: visible;
    }
    
    .notes-badge, .hint-badge, .undo-badge {
        position: absolute;
        top: -10px; /* 调整位置 */
        right: -10px; /* 调整位置 */
        background: #e74c3c;
        color: white;
        border-radius: 50%;
        width: 25px; /* 稍微增大尺寸 */
        height: 25px; /* 稍微增大尺寸 */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: bold;
        z-index: 10000; /* 大幅提高层级 */
        box-shadow: 0 2px 6px rgba(0,0,0,0.3); /* 增强阴影效果 */
        overflow: visible;
    }
    
    .notes-badge {
        background-color: red;
    }
    
    .hint-badge {
        background-color: #FF9800;
    }
    
    .undo-badge {
        background-color: #e74c3c;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    body {
        padding: 2px;
    }
    
    h1 {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }
    
    .game-container {
        padding: 1px;
    }
    
    .sudoku-wrapper {
        max-width: calc(100vw - 4px);
    }
    
    .cell {
        font-size: 1.8rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }
    
    .number-btn {
        width: 25px;
        height: 35px;
        font-size: 2rem;
    }
}

/* 触摸设备样式 */
@media (hover: none) and (pointer: coarse) {
    .custom-cursor {
        display: none !important;
    }
    
    .database-btn:active .dropdown-content,
    .database-btn:focus .dropdown-content {
        display: block;
    }
}

/* 新增下拉菜单激活样式 */
.dropdown-open .dropdown-content {
    display: block;
}

/* 大屏模式下的两列布局 (最小宽度1200px) */
@media (min-width: 1200px) {
    .game-container {
        flex-direction: row;
        max-width: 1200px;
        padding: 20px;
        gap: 20px;
        overflow: hidden; /* 防止内容溢出 */
        /* 确保容器在缩放时正确显示 */
        contain: layout style;
        /* 添加相对定位，作为右列容器绝对定位的参考 */
        position: relative;
    }
    
    .left-column {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* 缩放左列以适应可视区域 */
        transform-origin: top center;
        max-height: calc(100vh - 100px); /* 保留一些边距 */
        overflow: hidden;
        width: 100%;
        /* 确保缩放时正确显示 */
        contain: layout style;
        /* 确保九宫格显示完整并顶部对齐 */
        align-self: flex-start;
        /* 添加右侧间距，确保与右列容器保持20px间距 */
        margin-right: 20px;
    }
    
    .right-column {
        width: 280px;
        display: flex;
        flex-direction: column;
        gap: 20px; /* 增加间距 */
        /* 顶部对齐，与左侧九宫格上边框线完全对齐 */
        align-self: flex-start;
        max-height: calc((100vw - 400px) * 0.8);
        /* 添加边框和阴影效果 */
        border: 2px solid #ddd;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        background: rgba(255, 255, 255, 0.95);
        padding: 20px; /* 增加内边距 */
        box-sizing: border-box;
        /* 计算九宫格上方元素的高度，使右列与九宫格外框线对齐 */
        margin-top: 140px; /* 增加顶部边距，确保按钮向下移动后仍对齐 */
        /* 使用绝对定位和变换来精确控制位置，与九宫格边框线保持20px间距 */
        position: absolute;
        right: 20px; /* 与.game-container的padding保持一致 */
        transform: translateX(20px); /* 向右移动60px，确保与九宫格边框线保持20px间距 */
    }
    
    .header {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .game-info {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .info-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .sudoku-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 1px 0;
        /* 确保包装容器保持正方形 */
        aspect-ratio: 1/1;
        /* 优化九宫格显示，确保完整显示 */
        max-width: min(100%, calc(100vh - 250px));
        /* 增加外边距，为角标提供更多空间 */
        margin: 20px 0 30px 0; /* 增大上下边距 */
        padding: 10px; /* 增加内边距 */
    }
    
    .sudoku-container {
        width: 100%;
        aspect-ratio: 1/1;
        margin: 0;
        border: 3px solid #333;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
        box-sizing: border-box;
        position: relative;
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        grid-template-rows: repeat(9, 1fr);
        grid-gap: 0;
        /* 确保容器保持正方形 */
        max-width: 100%;
        max-height: 100%;
    }
    
    .cell {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.8rem; /* 固定字体大小，不使用clamp函数 */
        font-weight: 300;
        background: #fff;
        position: relative;
        cursor: pointer;
        transition: all 0.2s ease;
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    /* 移除最右边列的右边框 */
    .cell:nth-child(9n) {
        border-right: none;
    }

    /* 移除最下面行的底边框 */
    .cell:nth-child(n+73):nth-child(-n+81) {
        border-bottom: none;
    }

    /* 添加九宫格粗线 */
    /* 每个3x3宫格的右边框 */
    .cell:nth-child(3n):not(:nth-child(9n)) {
        border-right: 3px solid #333;
    }

    /* 每个3x3宫格的底边框 */
    .cell:nth-child(n+19):nth-child(-n+27),
    .cell:nth-child(n+46):nth-child(-n+54),
    .cell:nth-child(n+73):nth-child(-n+81) {
        border-bottom: 3px solid #333;
    }
    
    .cell.highlighted {
        background: rgba(173, 216, 230, 0.3) !important;
    }
    
    .cell.selected {
        background: #ccff33 !important;
        box-shadow: inset 0 0 0 2px #4a69bd !important;
    }
    
    .cell.conflict {
        animation: blink 0.5s 3 !important;
    }
    
    .cell.hint-highlight {
        animation: hintBlink 0.5s 3 !important;
    }
    
    .same-number-highlight {
        background: rgba(204, 255, 51, 0.7) !important;
        box-shadow: inset 0 0 0 2px #4a69bd !important;
        z-index: 10;
        position: relative;
    }
    
    .controls-wrapper {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-height: calc((100vw - 400px) * 0.4);
        align-self: center;
        width: 100%;
    }
    
    .controls {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 20px; /* 增大按钮间距 */
        justify-content: center;
        width: 100%;
        margin: 5px 0 0 0; /* 增大上边距，为角标提供更多空间 */
        padding: 15px 0; /* 增大内边距 */
        align-self: center;
        position: relative;
        z-index: 1;
        /* 增加外边距和内边距，为角标提供更多空间 */
        margin: 10px 0 10px 0; /* 进一步增大上边距 */
        padding: 20px 20px; /* 显著增加左右内边距，特别是右边内边距 */
    }
    
    /* 大屏端按钮位置定义 */
    .controls .undo-btn {
        grid-column: 1;
        grid-row: 1;
    }
    
    .controls .trash-btn {
        grid-column: 2;
        grid-row: 1;
    }
    
    .controls .notes-btn {
        grid-column: 1;
        grid-row: 2;
    }
    
    .controls #one-click-notes-btn {
        grid-column: 2;
        grid-row: 2;
    }
    
    .controls .hint-btn {
        grid-column: 1;
        grid-row: 3;
    }
    
    .controls .clear-btn {
        grid-column: 2;
        grid-row: 3;
    }
    
    .controls .share-btn {
        grid-column: 1 / span 2; /* 跨越两列 */
        grid-row: 4;
    }
    
    .control-btn {
        width: 100%;
        min-width: auto;
        margin: 0;
        padding: 15px 8px; /* 增大内边距确保内容完整显示 */
        /* 增加按钮的外边距，为角标提供更多空间 */
        margin: 30 0px; /* 增加水平外边距，特别是右边距 */
    }
    
    /* 确保按钮角标在大屏端也能完整显示 */
    .notes-btn, .hint-btn, .undo-btn {
        position: relative;
        overflow: visible;
    }
    
    .notes-badge, .hint-badge, .undo-badge {
        position: absolute;
        top: -12px; /* 调整位置，进一步向外移动 */
        right: -12px; /* 调整位置，进一步向外移动 */
        background: #e74c3c;
        color: white;
        border-radius: 50%;
        width: 25px; /* 稍微增大尺寸 */
        height: 25px; /* 稍微增大尺寸 */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: bold;
        z-index: 10000; /* 大幅提高层级，确保不会被遮挡 */
        box-shadow: 0 2px 8px rgba(0,0,0,0.4); /* 增强阴影效果 */
        overflow: visible;
    }
    
    .notes-badge {
        background-color: red;
    }
    
    .hint-badge {
        background-color: #FF9800;
    }
    
    .undo-badge {
        background-color: #e74c3c;
    }
}

/* 弹出面板样式 */
.hint-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.hint-popup-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: auto;
}

.hint-popup-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.hint-popup-panel .technique-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a69bd;
}

.hint-popup-panel .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.hint-popup-panel .panel-content {
    margin-bottom: 20px;
}

.hint-popup-panel .position-info {
    margin-bottom: 10px;
    font-size: 1rem;
}

.hint-popup-panel .technique-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.hint-popup-panel .panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint-popup-panel .nav-buttons {
    display: flex;
    gap: 10px;
}

.hint-popup-panel .nav-btn {
    background: #4a69bd;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hint-popup-panel .nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hint-popup-panel .step-indicators {
    display: flex;
    gap: 5px;
}

.hint-popup-panel .step-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
}

.hint-popup-panel .step-indicator.active {
    background: #4a69bd;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .hint-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        pointer-events: none;
        padding-top: 20px;
    }
    
    .hint-popup-panel {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 400px;
        max-height: 40vh;
        pointer-events: auto;
        margin: 0 auto;
        box-sizing: border-box;
    }
}

/* 中等屏幕设备样式 */
@media (min-width: 769px) and (max-width: 1199px) {
    .hint-popup-panel {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 400px;
        max-height: 40vh;
        pointer-events: auto;
        margin: 0 auto;
        box-sizing: border-box;
        z-index: 1001;
    }
}

/* 大屏端样式 */
@media (min-width: 1200px) {
    .hint-popup-panel {
        position: fixed;
        max-height: 70vh;
        margin: 0;
        z-index: 1001;
        box-sizing: border-box;
    }
}

/* 半透明遮罩样式 */
.cell.dimmed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95); /* 增加不透明度到95% */
    z-index: 999;
    pointer-events: none;
}

/* 为需要显示的行添加背景色 */
.cell.row-highlight {
    background-color: rgba(144, 238, 144, 0.3) !important; /* 淡绿色 */
}

/* 为需要显示的列添加背景色 */
.cell.col-highlight {
    background-color: rgba(144, 238, 144, 0.3) !important; /* 淡绿色 */
}

/* 为需要显示的宫添加背景色 */
.cell.box-highlight {
    background-color: rgba(144, 238, 144, 0.3) !important; /* 淡绿色 */
}

.sudoku-dim-overlay {
    background-color: rgba(255, 255, 255, 0.8); /* 增加不透明度到80% */
    z-index: 999;
    pointer-events: none;
}

.dim-overlay.full {
    position: fixed;
    z-index: 998;
}

.dim-overlay-cell {
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    pointer-events: none;
}

.right-dim-overlay {
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 999;
    pointer-events: none;
}
