/* 原有所有CSS样式代码保持不变 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
@font-face {
    font-family: "Jolly";
    src: url('https://www.xiaozhangyu.vip/fonts/jollyregular.woff') format('woff');
}

@font-face {
    font-family: "Jolly";
    src: url('https://www.xiaozhangyu.vip/fonts/jollybold.woff') format('woff');
    font-weight: bold;
}

@font-face {
    font-family: "Jolly";
    src: url('https://www.xiaozhangyu.vip/fonts/jollyitalic.woff') format('woff');
    font-style: italic;
}
body {
    font-family: Jolly,'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 15px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 顶部导航栏样式 */
.top-navbar {
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: fixed;
    top: 15px;
    left: 15px;
    right: 15px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.top-navbar.scrolled {
    flex-direction: column;
    width: auto;
    right: 15px;
    left: auto;
    padding: 10px;
    align-items: flex-end;
    gap: 5px;
}

.top-navbar.scrolled .nav-left, 
.top-navbar.scrolled .nav-right {
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.top-navbar.scrolled .nav-left a, 
.top-navbar.scrolled .nav-right a {
    justify-content: flex-end;
    padding: 8px 10px;
}

.top-navbar.scrolled .nav-left a span, 
.top-navbar.scrolled .nav-right a span {
    display: none;
}

.top-navbar.scrolled .nav-left {
    order: 2;
}

.top-navbar.scrolled .nav-right {
    order: 1;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-left a, .nav-right a {
    color: #f0f8ff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
}

.nav-left a:hover, .nav-right a:hover {
    color: #ffd700;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nav-left a.active {
    background: rgba(71, 180, 125, 0);
}

.nav-icon {
    font-size: 22px;
    width: 20px;
    text-align: center;
}
/* 翻页按钮样式 */
.page-nav-buttons {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 999;
    pointer-events: none;
}

.page-nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    background: linear-gradient(145deg, #47b47d, #3a9c69);
}

.page-nav-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.page-nav-btn a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
/* 难度下拉菜单样式 */
.difficulty-dropdown {
    position: relative;
    z-index: 1002;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 150px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1003;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    color: #000;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: rgba(71, 180, 125, 0.3);
    color: #fff;
}

.dropdown-item.active {
    background-color: rgba(29, 183, 153, 0.3);
    color: #1DB799;
    font-weight: bold;
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item.disabled:hover {
    background: transparent;
    color: #e0e0e0;
}

.current-difficulty {
    font-size: 12px;
    opacity: 0.8;
    margin-left: auto;
}

.game-container {
    max-width: 700px;
    width: 100%;
    background-color: hsl(147deg 30.77% 84.71%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    margin: 80px auto 20px;
    padding: 20px;
    position: relative;
}

   /* 区域装饰点 */
        .game-container::before,
        .game-container::after {
            content: '';
            position: absolute;
            width: 25px;
            height: 25px;
            border-radius: 5px 15px 5px 15px;
            z-index: 1;
            opacity: 0.8;
            filter: blur(0.5px);
            animation: float 6s ease-in-out infinite;
        }

        .game-container::before {
            top: -8px;
            right: -8px;
            background: #ffd700;
        }

        .game-container::after {
            bottom: -8px;
            left: -8px;
            background: #ff6b6b;
            border-radius: 5px 15px 5px 15px;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0) scale(1);
            }
            50% {
                transform: translateY(-3px) scale(1.1);
            }
        }


.h5p-task-description {
    font-family: 'Jolly Lodger', Arial, sans-serif;
    color: #1a73d9;
    font-size: 1.125em;
    line-height: 1.125em;
    padding: 1em;
    border-bottom: 1px solid rgba(221, 228, 234, 0.5);
    background: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    border-radius: 8px;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(30, 40, 50, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-display, .current-number {
    font-size: 20px;
    font-weight: bold;
    color: #e0e0e0;
}

.time-display span, .current-number span {
    color: #4dabf7;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 3x3网格样式 */
.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 5x5网格样式 */
.grid-5x5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid {
    display: grid;
    grid-gap: 12px;
    margin-bottom: 30px;
    position: relative;
}

.cell {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: #ecf0f1;
    font-size: 40px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 
        0 8px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    border: 2px solid rgba(52, 73, 94, 0.8);
    font-family: "Jolly";
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.7;
    filter: grayscale(0.5);
    background: linear-gradient(145deg, #34495e, #2c3e50);
}

.cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 50%);
    border-radius: 12px;
    pointer-events: none;
}

.cell:not(.disabled):hover {
    box-shadow: 
        0 12px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}

.cell:not(.disabled):active {
    transform: translateY(4px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.cell.correct {
    background: linear-gradient(145deg, #27ae60, #219653);
    box-shadow: 
        0 4px 8px rgba(39, 174, 96, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
    color: #e0ffe0;
    border-color: rgba(39, 174, 96, 0.8);
}

.cell.correct:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 15px rgba(39, 174, 96, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
    background: linear-gradient(145deg, #2dbd6e, #25a65b);
}

.cell.active {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    animation: pulse 0.3s ease;
    box-shadow: 
        0 4px 8px rgba(231, 76, 60, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
    color: #ffe0e0;
    border-color: rgba(231, 76, 60, 0.8);
}

.cell.eye-cell {
    background: linear-gradient(145deg, #8e44ad, #9b59b6);
    color: #f0f8ff;
    cursor: default;
    border-color: rgba(142, 68, 173, 0.8);
}

.eye-cell i {
    font-size: 35px;
    color: #f0f8ff;
}

/* 难度4的旋转数字样式 */
.cell.rotated .number {
    transform: rotate(180deg);
    display: inline-block;
}

/* 难度4的标记点样式 - 随数字一起旋转 */
.cell .number-dot {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: #8b5cf6;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    opacity: 1 !important;
}

.cell.show-dot .number-dot {
    display: block;
}

/* 难度4的干扰点样式 */
.cell.interference-dot::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background-color: #ff6b6b;
    border-radius: 50%;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 0 1em 1em;
    flex-wrap: wrap;
}

button {
    padding: 14px 24px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    font-family: 'Jolly Lodger', sans-serif;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

button:hover:before {
    left: 100%;
}

#startBtn {
    background: linear-gradient(145deg, #47b47d, #3a9c69);
    color: white;
}

#startBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(26, 115, 217, 0.3);
}

#startBtn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#restartBtn {
    background: linear-gradient(145deg, #47b47d, #3a9c69);
    color: white;
}

#restartBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(71, 180, 125, 0.3);
}

#restartBtn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#demoBtn {
    background: linear-gradient(145deg, #47b47d, #3a9c69);
    color: white;
}

#demoBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(71, 180, 125, 0.3);
}

#demoBtn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 6px;
    background-color: rgba(60, 70, 80, 0.1);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* 弹出层样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
    padding: 30px;
    border-radius: 18px;
    width: 100%;
    max-width: 750px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalFadeIn 0.3s ease-out;
    overflow: hidden;
    font-family: 'Jolly Lodger', sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content h2 {
    color: #ffd700;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #f0f8ff;
}

.close-help {
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 80px;
    cursor: pointer;
    color: #f0f8ff;
    transition: color 0.3s;
    font-family: "Jolly";
}

.close-help:hover {
    color: #ffd700;
}

.copyright {
    text-align: center;
    color: #3F786B;
    font-size: 20px;
    margin-top: 20px;
    font-family: Jolly;
}

.bianhao {
    text-align: left;
    color: #f0f8ff;
    font-size: 16px;
    font-family: Jolly;
}
/* 图表容器样式 */
.chart-container {
    background: linear-gradient(135deg, rgba(71, 180, 125, 0.1), rgba(58, 156, 105, 0.2));
    border: 1px solid rgba(71, 180, 125, 0.3);
    box-shadow: 0 4px 15px rgba(71, 180, 125, 0.2);
    border-radius: 8px;
    height: 320px;
    position: relative;
    overflow: hidden;
}

.chart-container::-webkit-scrollbar-track {
    background: rgba(71, 180, 125, 0.2);
}

.chart-container::-webkit-scrollbar-thumb {
    background: #47b47d;
}

.chart-container::-webkit-scrollbar-thumb:hover {
    background: #3a9c69;
}

/* 图表样式 */
#progressChart {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* 难度筛选器样式 */
.difficulty-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.difficulty-filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #e0e0e0;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.difficulty-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.difficulty-filter-btn.active {
    background: rgba(71, 180, 125, 0.5);
    color: #fff;
    border-color: rgba(71, 180, 125, 0.7);
}

/* 隐藏难度按钮文字 */
.difficulty-text {
    display: none;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    display: none;
    z-index: 10;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.history-section {
    margin-top: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 10px;
    background: rgba(40, 50, 60, 0);
    border-radius: 10px;
    transition: background 0.3s;
}

.history-header:hover {
    background: rgba(50, 60, 70, 0.7);
}

.history-title {
    font-size: 20px;
    color: #ffffff;
    margin: 0;
}

.toggle-history {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    display: none;
}

.history-table.show {
    display: table;
}

.history-table th {
    background: rgba(40, 50, 60, 0.3);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table tr:hover {
    background: rgba(50, 60, 70, 0.5);
}

/* 添加空状态提示样式 */
.history-table .no-records {
    text-align: center;
    color: #e0e0e0;
    font-style: italic;
    padding: 20px;
}

/* 图表滚动条样式 */
.chart-container::-webkit-scrollbar {
    height: 8px;
}

.chart-container::-webkit-scrollbar-track {
    background: rgba(60, 70, 80, 0.5);
    border-radius: 4px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: #4dabf7;
    border-radius: 4px;
}

.chart-container::-webkit-scrollbar-thumb:hover {
    background: #3a8fd4;
}

/* 成功弹窗样式 */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.success-content {
    background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    transition: transform 0.5s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.success-overlay.active .success-content {
    transform: scale(1);
}

.success-checkmark {
    margin: 0 auto 20px;
    width: 100px;
    height: 100px;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #fff;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-text {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: bold;
}

.success-subtext {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #e0ffe0;
}

.success-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #fff;
}

.success-stats div {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
}

.success-close {
    background: linear-gradient(to right, #00b09b, #96c93d);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.success-close:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 自动关闭倒计时 */
.auto-close-timer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 粒子效果 */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0;
    z-index: 2001;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .top-navbar {
        padding: 10px 15px;
    }
    
    .nav-left a span, .nav-right a span {
        display: none;
    }
    
    .nav-left a, .nav-right a {
        padding: 10px;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
    
    .nav-left, .nav-right {
        gap: 10px;
    }
    
    .game-container {
        margin-top: 70px;
        padding: 15px;
    }
    
    .grid {
        grid-gap: 8px;
    }
    
    .cell {
        font-size: 40px;
    }
    
    .controls {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
    
    button {
        width: auto;
        padding: 12px 16px;
        border-radius: 50px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .dropdown-menu {
        min-width: 140px;
        left: -50px;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        padding: 8px 10px;
    }
    
    .nav-left a, .nav-right a {
        padding: 8px;
        width: 40px;
        height: 40px;
    }
    
    .game-container {
        margin-top: 60px;
        padding: 10px;
    }
    
    .cell {
        font-size: 18px;
    }
    
    .info-panel {
        padding: 15px;
    }
    
    .controls {
        gap: 10px;
    }
    
    button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    #refreshBtn,#downloadBtn,#soundToggle{
        display: none;
    }
}

/* 提高单元格触摸灵敏度 */
@media (hover: none) and (pointer: coarse) {
    .cell {
        min-height: 70px;
        min-width: 70px;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        tap-highlight-color: rgba(255, 255, 255, 0.2);
        touch-action: manipulation;
    }
    
    .cell:active {
        transform: scale(0.92);
        transition: transform 0.1s ease;
    }
    
    /* 增大单元格触摸区域 */
    .cell::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        z-index: -1;
    }
}

/* 防止按钮文字选中 */
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* 按钮触摸状态优化 */
button {
    touch-action: manipulation;
}

/* 防止iOS Safari的双击缩放 */
button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

/* 加载动画样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 18px;
    font-family: "Jolly";
}

.loading-progress {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.5s;
    border-radius: 5px;
}