@keyframes movingStars {
    from {
        transform: translateZ(-2000px);
        opacity: 0;
    }
    to {
        transform: translateZ(1000px);
        opacity: 1;
    }
}


body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #000033;
    min-height: 100vh;
    color: white;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}

.stats-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    max-height: 50vh;
    overflow-y: auto;
}

.stats-container h2 {
    color: #FFD700;
    margin-bottom: 15px;
}

/* 开始界面样式 */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 51, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.start-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2001;
    pointer-events: auto;
}

.logo-container {
    margin-bottom: 0;
    text-align: center;
    order: 1;
}

.logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.settings {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 2002;
    pointer-events: auto;
    order: 3;
}

.toggle-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 10px 0;
    position: relative;
    z-index: 2003;
    pointer-events: auto;
}

.setting-item {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.setting-item select {
    padding: 8px 15px;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
}

.setting-item select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.start-button {
    background: #e0af00;
    color: #e9e9e9;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 150px;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.toggle-btn {
    width: 180px;
    height: 45px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    box-sizing: border-box;
    transform-origin: center;
    border: 1px solid transparent;
}

.toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* 各个按钮的特定样式 */
.toggle-btn.pinyin {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.toggle-btn.sound {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.toggle-btn.stars {
    background: linear-gradient(135deg, #1A237E, #3949AB);
}

/*
.toggle-btn.music {
    background: linear-gradient(135deg, #ffffff5e, #ffffff20);
}
*/

/* 按钮激活状态的高级效果 */
.toggle-btn.active {
    background: linear-gradient(135deg, #26c000, #a5ff9c);
    box-shadow: 
        inset 0 0 8px rgba(255, 255, 255, 0.314);
    transform: scale(1.05);
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.75); }
    50% { opacity: 1.2; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(0.75); }
}

/* 音乐按钮的特殊激活状态 */
/*
.toggle-btn.music.active {
    background: linear-gradient(135deg, #00c8ff, #007bff);
    box-shadow: 
        0 0 15px rgba(0, 159, 255, 0.5),
        0 0 30px rgba(0, 119, 255, 0.3),
        inset 0 0 8px rgba(255, 255, 255, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
*/

/* 为每种类型的按钮提供不同的激活颜色 */
.toggle-btn.pinyin.active {
    background: linear-gradient(135deg, #2196F3, #64b5f6);
}

.toggle-btn.sound.active {
    background: linear-gradient(135deg, #9C27B0, #ce93d8);
}

.toggle-btn.stars.active {
    background: linear-gradient(135deg, #1A237E, #5c6bc0);
}

/* 添加右上角按钮样式 */
.corner-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 40px;
    font-size: 14px;
    z-index: 2002;
    box-sizing: border-box;
    transform-origin: center;
    border: 1px solid transparent;
}

/*
.music-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 40px;
    font-size: 18px;
    z-index: 2002;
    box-sizing: border-box;
    transform-origin: center;
    border: 1px solid transparent;
}
*/

.corner-btn .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.corner-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* 添加小箭头 */
.corner-btn .tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
}

/* 调整其他按钮容器的样式 */
.toggle-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 10px 0;
    position: relative;
    z-index: 2003;
    pointer-events: auto;
}

/* 通用 tooltip 样式 */
.tooltip {
    visibility: hidden;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-line;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2100;
    pointer-events: none;
}

/* 为不同类型的按钮调整 tooltip 位置 */
.difficulty-btn .tooltip {
    bottom: -45px;
    width: max-content;
    font-size: 14px;
    white-space: nowrap;
    z-index: 2500;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 10px 15px;
}

.toggle-btn .tooltip {
    bottom: -60px;
    width: max-content;
    z-index: 2400;
}

.crazy-switch .tooltip {
    bottom: -30px;
    width: max-content;
    z-index: 2300;
}

/* 显示 tooltip */
.difficulty-btn:hover .tooltip,
.toggle-btn:hover .tooltip,
.crazy-switch:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* tooltip 箭头 */
.tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
}


/* 修复按钮位移问题 - 只添加必要的规则 */
.toggle-btn {
    box-sizing: border-box; /* 确保边框包含在尺寸内 */
    transform-origin: center; /* 确保从中心缩放 */
    border: 1px solid transparent; /* 预先添加透明边框 */
}


/* 确保激活状态按钮固定位置 */
.corner-btn.active {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    margin: 0 !important;
}

/*
.music-btn.active {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    margin: 0 !important;
}
*/

/* 时间模式按钮样式 */
.toggle-btn.time {
    background-color: #14a41e;
}

/* 强调激活状态 */
.toggle-btn.time.active {
    background-color: #33cc33;
    color: white;
    box-shadow: 0 0 15px rgba(51, 204, 51, 0.6);
}

/* 新的极简时间模式样式 */
.time-mode-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    background: rgba(0, 0, 33, 0.92); /* 调整透明度以便星星可见 */
}

/* 渐变色计时条 */
.time-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8a2be2);
    transform-origin: left;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    transition: transform 0.5s linear;
}

/* 当计时条接近结束时增加动画效果 */
.time-progress-bar.ending {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.9);
}

/* 退出按钮 */
.time-exit-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.time-exit-button:hover {
    background: rgba(255, 0, 0, 0.5);
    transform: scale(1.1);
}



/* 自定义词库通知样式 */
.time-custom-words-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 3000;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 250px;
}

.time-custom-words-notification.show {
    transform: translateX(-50%) translateY(0);
}

.time-custom-words-notification.success {
    border-left: 4px solid #4CAF50;
}

.time-custom-words-notification.error {
    border-left: 4px solid #F44336;
}

.notification-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.notification-details {
    font-size: 14px;
    opacity: 0.8;
}

/* 时间模式陨石容器样式 */
.time-meteors-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 950;
    overflow: hidden;
}

/* 时间模式陨石样式 */
.time-meteor {
    position: absolute;
    top: -90px;
    width: 120px; /* 增加宽度以适应泰语字符 */
    height: 120px; /* 增加高度以适应泰语字符 */
    background: linear-gradient(135deg, rgba(80, 80, 80, 0.8), rgba(30, 30, 30, 0.9));
    color: white;
    font-size: 36px; /* 减小字体以适应更多字符 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(255, 150, 30, 0.6),
        0 0 40px rgba(255, 100, 0, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.4);
    pointer-events: none;
    border: 1px solid rgba(255, 200, 150, 0.6);
    transform-style: preserve-3d;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    font-weight: bold;
    text-align: center; /* 文本居中 */
    padding: 10px; /* 添加内边距 */
    word-break: break-word; /* 允许在任意字符间换行 */
    box-sizing: border-box; /* 确保内边距不增加元素总宽度 */
}

/* 字母显示区域样式 */
.time-letters-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 300px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 0 20px rgba(205, 158, 3, 0.737);
    pointer-events: none;
    z-index: 1001;
    font-family: "Arial", sans-serif;
    letter-spacing: 10px;
    width: 100%;
    text-align: center;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 生命值 - 扁形发光绿灯 */
.time-lives-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 为扁形绿灯添加向下照射的光线效果 */
.time-life-icon {
    width: 30vw; /* 设置为视口宽度的30% */
    height: 10px;
    border-radius: 10px;
    background-color: #32CD32; /* 亮绿色 */
    box-shadow: 0 0 10px #32CD32, 0 0 20px #32CD32, inset 0 0 8px rgba(255, 255, 255, 0.8);
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 添加向下照射的光线效果 */
.time-life-icon::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, rgba(50, 205, 50, 0.6), rgba(50, 205, 50, 0));
    pointer-events: none;
    filter: blur(5px);
    border-radius: 0 0 20px 20px;
    z-index: -1;
    display: block;
    animation: lightBeam 3s infinite alternate;
}

/* 红色状态的光线 */
.time-life-icon.inactive::after {
    background: linear-gradient(to bottom, rgba(255, 0, 0, 0.6), rgba(255, 0, 0, 0));
}

/* 光线动画效果 */
@keyframes lightBeam {
    0% { 
        opacity: 0.7;
        height: 30px;
    }
    100% { 
        opacity: 0.9;
        height: 50px;
    }
}

/* 失活状态 - 变为红色 */
.time-life-icon.inactive {
    background-color: #FF0000; /* 红色 */
    box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000, inset 0 0 8px rgba(255, 255, 255, 0.5);
    opacity: 0.7;
}

/* 已失去生命的灯的闪烁效果 */
.time-life-icon.life-lost-flash {
    animation: lifeFlash 0.8s ease-in-out forwards;
}

/* 修改闪烁动画包含光线变化 */
@keyframes lifeFlash {
    0% { 
        background-color: #32CD32; 
        box-shadow: 0 0 10px #32CD32, 0 0 20px #32CD32;
    }
    50% { 
        background-color: #FFFF00; /* 黄色过渡 */
        box-shadow: 0 0 15px #FFFF00, 0 0 25px #FFFF00;
        transform: scaleX(1.2);
    }
    100% { 
        background-color: #FF0000; 
        box-shadow: 0 0 10px #FF0000, 0 0 15px #FF0000;
    }
}

/* 动画时也修改光线颜色 */
.time-life-icon.life-lost-flash::after {
    animation: lightBeamFlash 0.8s ease-in-out forwards;
}

@keyframes lightBeamFlash {
    0% { 
        background: linear-gradient(to bottom, rgba(50, 205, 50, 0.6), rgba(50, 205, 50, 0));
    }
    50% { 
        background: linear-gradient(to bottom, rgba(255, 255, 0, 0.6), rgba(255, 255, 0, 0));
        height: 60px;
    }
    100% { 
        background: linear-gradient(to bottom, rgba(255, 0, 0, 0.6), rgba(255, 0, 0, 0));
        height: 40px;
    }
}

/* 陨石内部火焰效果 */
.time-meteor::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    background: radial-gradient(
        circle, 
        rgba(255, 200, 50, 0.8) 10%, 
        rgba(255, 120, 20, 0.6) 40%, 
        rgba(200, 40, 5, 0.4) 70%, 
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(5px);
    animation: meteorPulse 2s infinite alternate;
    z-index: -1;
}

/* 火焰脉动动画 */
@keyframes meteorPulse {
    0% { opacity: 0.6; transform: scale(0.8); }
    100% { opacity: 0.9; transform: scale(1.1); }
}

/* 改进陨石消除动画 */
@keyframes meteorDestroy {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 150, 30, 0.6);
    }
    20% {
        transform: scale(1.2);
        opacity: 0.9;
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.9);
    }
    100% {
        transform: scale(0.1);
        opacity: 0;
        box-shadow: 0 0 80px rgba(255, 255, 255, 0);
    }
}

.time-meteor-destroyed {
    animation: meteorDestroy 0.7s ease-out forwards;
}

/* 字母弹出动画 */
@keyframes letterPop {
    0% { transform: scale(0.5); opacity: 0.3; }
    50% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1); opacity: 0.7; }
}

.time-letter {
    display: inline-block;
    animation: letterPop 0.3s forwards;
}

/* 添加随机陨石颜色变化 */
.time-meteor.color1 {
    background: linear-gradient(135deg, rgba(80, 80, 150, 0.8), rgba(30, 30, 80, 0.9));
    box-shadow: 
        0 0 20px rgba(100, 150, 255, 0.6),
        0 0 40px rgba(30, 100, 255, 0.4),
        inset 0 0 15px rgba(200, 200, 255, 0.4);
    border-color: rgba(150, 180, 255, 0.6);
}

.time-meteor.color2 {
    background: linear-gradient(135deg, rgba(150, 80, 80, 0.8), rgba(80, 30, 30, 0.9));
    box-shadow: 
        0 0 20px rgba(255, 100, 100, 0.6),
        0 0 40px rgba(255, 50, 50, 0.4),
        inset 0 0 15px rgba(255, 200, 200, 0.4);
    border-color: rgba(255, 150, 150, 0.6);
}

.time-meteor.color3 {
    background: linear-gradient(135deg, rgba(80, 150, 80, 0.8), rgba(30, 80, 30, 0.9));
    box-shadow: 
        0 0 20px rgba(100, 255, 100, 0.6),
        0 0 40px rgba(50, 255, 50, 0.4),
        inset 0 0 15px rgba(200, 255, 200, 0.4);
    border-color: rgba(150, 255, 150, 0.6);
}

.time-meteor.color4 {
    background: linear-gradient(135deg, rgba(150, 80, 150, 0.8), rgba(80, 30, 80, 0.9));
    box-shadow: 
        0 0 20px rgba(255, 100, 255, 0.6),
        0 0 40px rgba(255, 50, 255, 0.4),
        inset 0 0 15px rgba(255, 200, 255, 0.4);
    border-color: rgba(255, 150, 255, 0.6);
}

/* 时间模式成功动画 */
.time-letters-container.time-success {
    animation: timeSuccess 0.5s ease-out;
}

@keyframes timeSuccess {
    0% { text-shadow: 0 0 20px rgba(205, 158, 3, 0.737); }
    50% { text-shadow: 0 0 30px rgba(50, 255, 50, 0.8); }
    100% { text-shadow: 0 0 20px rgba(205, 158, 3, 0.737); }
}

/* 词库管理器样式 */
.word-library-manager {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(to bottom, rgba(40, 40, 60, 0.95), rgba(20, 20, 40, 0.95));
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    z-index: 3000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 100px rgba(51, 204, 51, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(70, 230, 70, 0.3);
}

.word-library-manager.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.library-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: linear-gradient(to right, rgba(20, 80, 20, 0.5), rgba(10, 40, 10, 0.7));
    border-bottom: 1px solid rgba(51, 204, 51, 0.3);
}

.library-manager-header h2 {
    color: #eeffee;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.library-manager-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-manager-close:hover {
    color: white;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.library-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.library-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 自定义滚动条 */
.library-list::-webkit-scrollbar {
    width: 8px;
}

.library-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.library-list::-webkit-scrollbar-thumb {
    background: rgba(51, 204, 51, 0.4);
    border-radius: 4px;
}

.library-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 204, 51, 0.6);
}

/* 词库条目样式 */
.library-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: rgba(40, 40, 60, 0.4);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(80, 80, 120, 0.3);
    overflow: hidden;
}

.library-item:hover {
    background: rgba(60, 60, 100, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(51, 204, 51, 0.4);
}

.library-item-content {
    flex: 1;
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.library-item-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(51, 204, 51, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.library-item-content:hover::after {
    opacity: 1;
}

.library-item.active {
    background: linear-gradient(to right, rgba(20, 60, 20, 0.7), rgba(30, 90, 30, 0.5));
    border-left: 4px solid #33cc33;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

.library-name {
    flex: 1;
    font-weight: bold;
    color: white;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.library-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-left: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.library-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 15px;
}

.library-current-tag {
    background: #33cc33;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 删除按钮 */
.library-delete {
    background: transparent;
    color: rgba(255, 100, 100, 0.8);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.library-delete:hover {
    background: rgba(255, 50, 50, 0.2);
    color: rgba(255, 120, 120, 1);
    border-color: rgba(255, 100, 100, 0.5);
}

/* 美化上传区域 */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 200, 100, 0.2);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library-name-input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(100, 200, 100, 0.3);
    background: rgba(40, 40, 60, 0.4);
    color: white;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.library-name-input:focus {
    border-color: #33cc33;
    background: rgba(40, 60, 40, 0.5);
    box-shadow: 0 0 10px rgba(51, 204, 51, 0.3);
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-button {
    padding: 10px 18px;
    background: linear-gradient(to bottom, #2196F3, #1976D2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.file-upload-button:hover {
    background: linear-gradient(to bottom, #1E88E5, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.file-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* 美化导入/导出区域 */
.import-export-section {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 200, 100, 0.2);
}

.export-button, .import-button {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.export-button {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.export-button:hover {
    background: linear-gradient(135deg, #AB47BC, #8E24AA);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.import-button {
    background: linear-gradient(135deg, #3F51B5, #303F9F);
    color: white;
}

.import-button:hover {
    background: linear-gradient(135deg, #5C6BC0, #3949AB);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

/* 改进上传按钮样式 */
.upload-button {
    align-self: flex-end;
    padding: 12px 22px;
    background: linear-gradient(135deg, #33cc33, #1a991a);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.upload-button:hover:not([disabled]) {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.upload-button[disabled] {
    background: linear-gradient(135deg, #999, #777);
    color: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

/* 时间模式星星背景 */
.time-mode-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 901;
    pointer-events: none;
    overflow: hidden;
}

.time-mode-star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0.7;
    animation: starTwinkle 5s infinite alternate ease-in-out;
}

@keyframes starTwinkle {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

/* 新的按钮组容器样式 */
.start-actions-group {
    display: flex;
    align-items: center; /* 垂直居中按钮 */
    justify-content: center; /* 水平居中整个组 */
    order: 2; /* 确保它在 logo 之后，settings 之前 */
    margin-top: 30px; /* 与 logo 的间距 */
    margin-bottom: 30px; /* 与 settings 的间距 */
}

.tutorial-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: absolute;
    left: -20px;
    top: -15px;
}

.tutorial-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* 教学模态窗口样式 */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.tutorial-title {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.tutorial-image-container {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tutorial-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.tutorial-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tutorial-nav-button:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.4);
}

.tutorial-nav-button[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.tutorial-nav-button.prev {
    left: -60px;
}

.tutorial-nav-button.next {
    right: -60px;
}

.tutorial-close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tutorial-close-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 教学选项卡样式 */
.tutorial-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
    width: 80%;
    max-width: 800px;
}

.tutorial-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    flex: 1;
    max-width: 200px;
    position: relative;
    border-bottom: 3px solid transparent;
}

.tutorial-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.tutorial-tab.active {
    background: rgba(106, 17, 203, 0.4);
    border-bottom: 3px solid #6a11cb;
    font-weight: bold;
}

/* 调整模态窗口的间距 */
.tutorial-modal {
    padding-top: 40px;
}

/* 无限生命模式设置区域样式 */
.infinite-life-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(30, 30, 50, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(100, 100, 150, 0.3);
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.switch-label {
    color: white;
    font-size: 16px;
}

.switch-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 5px;
    font-style: italic;
}

/* 开关样式 */
.infinite-life-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.infinite-life-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.infinite-life-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.infinite-life-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .infinite-life-slider {
    background-color: #8e44ad;
}

input:focus + .infinite-life-slider {
    box-shadow: 0 0 1px #8e44ad;
}

input:checked + .infinite-life-slider:before {
    transform: translateX(30px);
}

/* 无限生命图标样式 */
.time-life-icon.infinite {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #32CD32;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px #32CD32, 0 0 20px #32CD32;
    width: 70px;
}

/* 时间模式游戏结束界面样式 */
.time-game-over {
    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: 1000;
}

.time-game-over-content {
    background: linear-gradient(to bottom, rgba(30, 50, 30, 0.95), rgba(15, 35, 15, 0.95)); /* 深绿色渐变背景 */
    border-radius: 20px;
    padding: 40px; /* 增加内边距 */
    text-align: center;
    width: 70%; /* 使用具体宽度百分比 */
    max-width: 800px; /* 设定一个最大像素宽度 */
    min-width: 500px; /* 设定一个最小像素宽度，防止过窄 */
    max-height: 85vh; /* 略微增加最大高度 */
    overflow-y: auto;
    backdrop-filter: blur(5px); /* 轻微模糊效果 */
    box-shadow: 0 0 20px rgba(51, 204, 51, 0.7); /* 绿色阴影 */
    border: 1px solid rgba(51, 204, 51, 0.3); /* 绿色边框 */
}

.time-game-over h1 {
    color: #eeffee; /* 词库管理器标题颜色 */
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(51, 204, 51, 0.4); /* 绿色文字阴影 */
}

.time-wrong-words {
    margin: 20px auto; /* 水平居中 */
    max-height: 45vh; /* 略微增加最大高度 */
    overflow-y: auto;
    padding-right: 10px; /* 为滚动条留出空间，避免内容遮挡 */
    width: 90%; /* 使其宽度相对于父容器 */
    max-width: 600px; /* 但不要过宽 */
}

/* 为错误词汇部分的标题添加样式 */
.time-wrong-words > h3 {
    color: #cccccc; /* 浅灰色，与深绿色背景对比 */
    font-size: 20px;
    margin-bottom: 15px;
    text-align: left;
    padding-left: 5px; /* 与列表项对齐 */
}

.time-wrong-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px; /* 在列表项之间添加间距 */
}

.time-wrong-item {
    background: rgba(255, 255, 255, 0.03); /* 非常淡的背景，接近透明但有区分 */
    padding: 12px 15px; /* 增加内边距 */
    border-radius: 6px; /* 添加圆角 */
    text-align: left;
    font-size: 16px;
    word-break: break-word;
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.2); (移除) */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 使用细微的亮色边框 */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.time-wrong-item:hover {
    background: rgba(255, 255, 255, 0.07); /* 悬停时背景变亮一些 */
    border-color: rgba(255, 255, 255, 0.2);
}

/* 新增：标记到错字本的条目样式 */
.time-wrong-item.marked-wrong {
    color: #ff6b6b; /* 显眼的红色 */
    font-weight: bold;
    background-color: rgba(255, 107, 107, 0.1); /* 淡红色背景 */
    border-color: rgba(255, 107, 107, 0.4);
}

.time-wrong-item.marked-wrong:hover {
    background-color: rgba(255, 107, 107, 0.2); /* 悬停时更深的淡红色背景 */
    border-color: rgba(255, 107, 107, 0.6);
}

.time-wrong-list .time-wrong-item:last-child {
    /* border-bottom: none; (移除，因为现在每个item都有自己的边框或背景) */
}

.time-restart-btn {
    background: linear-gradient(135deg, #33cc33, #1a991a); /* 词库管理器按钮绿色渐变 */
    border: none;
    color: white;
    padding: 15px 45px; /* 增加按钮的padding使其更大一些 */
    border-radius: 30px;
    font-size: 20px; /* 增大字体 */
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px; /* 增加与上方元素的间距 */
    min-width: 200px; /* 给按钮一个最小宽度 */
    box-shadow: 0 0 15px rgba(51, 204, 51, 0.7); /* 悬停时更亮的绿色阴影 */
}

.time-restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(51, 204, 51, 0.7); /* 悬停时更亮的绿色阴影 */
}

/* 游戏结束界面的按钮容器 */
.game-over-buttons-container {
    display: flex;
    justify-content: center; /* 居中按钮 */
    align-items: center; /* 垂直对齐，如果按钮高度不一 */
    flex-wrap: wrap; /* 允许按钮在空间不足时换行 */
    gap: 15px; /* 按钮之间的间距，略微减小以适应三个按钮 */
    margin-top: 30px; /* 与上方元素的间距 */
}

/* 排行榜按钮样式 - 与重启按钮类似 */
.time-leaderboard-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800); /* 橙色渐变 */
    border: none;
    color: white;
    padding: 15px 45px;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.time-leaderboard-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.7);
}

/* 提交分数按钮样式 - 可以用一种新的颜色，例如蓝色系 */
.time-submit-score-btn {
    background: linear-gradient(135deg, #007bff, #0056b3); /* 蓝色渐变 */
    border: none;
    color: white;
    padding: 15px 45px;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.time-submit-score-btn:hover:not([disabled]) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.7);
}

.time-submit-score-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 时间模式分数显示 */
.time-score-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffdd00;
    font-size: 42px;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 20px;
    z-index: 1010;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.time-score-display span {
    min-width: 80px;
    text-align: center;
}

/* 分数更新动画 */
@keyframes scoreUpdated {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

.time-score-display.score-updated {
    animation: scoreUpdated 0.4s ease-out;
}

/* 浮动分数动画 */
@keyframes floatUp {
    0% { 
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    20% { 
        opacity: 1;
        transform: translateY(0) scale(1.2);
    }
    80% { 
        opacity: 1;
        transform: translateY(-40px) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 浮动分数样式 */
.floating-points {
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 1020;
}

/* 得分显示 - 绿色 */
.floating-points.gain {
    color: #4eff4e;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* 失分显示 - 红色 */
.floating-points.loss {
    color: #ff4e4e;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* Combo文本样式 */
.combo-text {
    font-size: 22px;
    color: #ffdd00;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    margin-left: 8px;
    font-style: italic;
    display: block;
    margin-top: 5px;
}
/* 词典管理器图标按钮样式 */
/*
img.dictionary-manager-icon {
    width: 32px; 
    height: 32px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    position: absolute; 
    bottom: -10px; 
    left: -10px;
}

img.dictionary-manager-icon:hover {
    transform: scale(1.1);
}
*/

/* 新增：主操作按钮垂直排列容器 */
.main-actions-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    order: 2;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* 新增：顶部操作按钮组 (开始按钮 + 教程按钮) */
.top-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* 新增：词库管理按钮样式 (使其类似开始按钮) */
.dictionary-manager-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 150px;
}

.dictionary-manager-button:hover {
    background: #5a6268;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.4);
}

/* 确保 start-button, tutorial-container, dictionary-manager-button 在新的布局中正确显示 */
.start-button {
    /* 可能不需要大改动，原样式应该适用 */
    /* padding: 15px 40px; */
    /* font-size: 24px; */
}

.tutorial-container {
    /* 之前是绝对定位，现在它在flex容器中，可能需要调整 */
    position: static;
    margin: 0;
    /* display: inline-block; 已经在 styles.css 中 */
}

/* settings 图标样式 - 保持不变 */
.settings-icon {
    width: 50px; 
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
    opacity: 0.8;

    position: absolute;
    bottom: 595px;
    right: 120px;  
}

.settings-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* 设置面板 - 复用词库管理器大部分样式 */
.settings-panel {
    /* 与 .word-library-manager 共享大部分样式，如背景、边框、位置等 */
    /* 如果有特定于设置面板的调整，可以在这里添加 */
}

.settings-panel .library-manager-header h2 {
    font-size: 1.8em;
}

/* 设置面板中的区域特定样式 */
.settings-section {
    padding: 15px;
    border-bottom: 1px solid #444;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section .section-title {
    font-size: 1.3em;
    color: #eee;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #555;
}

/* 通用开关样式 (用于无限生命等) */
.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.switch-label {
    font-size: 1.1em;
    color: #ccc;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* 圆形滑块 */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 自定义通知样式 (如果 showSettingsNotification 使用不同的类名) */
.custom-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
    font-size: 1.1em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.custom-notification.show {
    opacity: 1;
    top: 40px;
}

.custom-notification .notification-title {
    font-weight: bold;
}

.custom-notification.success {
    background-color: rgba(40, 167, 69, 0.9);
}

.custom-notification.error {
    background-color: rgba(220, 53, 69, 0.9);
}

.custom-notification.info {
    background-color: rgba(23, 162, 184, 0.9);
}

/* 教学按钮样式 - 修改定位方式 */
.tutorial-container {
    display: inline-block;
    position: absolute;
    margin-bottom: 730px;
    margin-left: 300px;
}

/* settingsPanel.js 新增元素样式 */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.slider-label {
    margin-right: 10px;
    color: #ccc;
}

.volume-control-container {
    /* 可以为音量控制容器添加特定样式，如果 settings-item 不够用 */
}

#volumeSlider {
    flex-grow: 1;
    max-width: 200px;
    margin-right: 10px;
    accent-color: #4CAF50;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-value-display {
    min-width: 40px;
    text-align: right;
    color: #fff;
}

/* Language Selector Styles in Settings Panel */
.language-settings-section {
    /* Similar to other sections if needed */
}

.select-label {
    margin-right: 10px;
    line-height: 38px;
    font-size: 16px;
    color: #e0e0e0;
}

#languageSelector {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgba(255, 255, 255, 0.1);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27292.4%27%20height%3D%27292.4%27%3E%3Cpath%20fill%3D%27%23ffffff%27%20d%3D%27M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-13z%27%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 0 35px 0 15px;
    font-size: 16px;
    cursor: pointer;
    height: 38px;
    line-height: 38px;
    min-width: 180px;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#languageSelector:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.7);
}

#languageSelector:focus {
    outline: none;
    border-color: #e0af00;
    box-shadow: 0 0 8px rgba(224, 175, 0, 0.3);
}

#languageSelector option {
    background-color: #2c2c54;
    color: white;
    padding: 10px 15px;
}

/* Ensure the settings item container for language selector aligns well */
.language-settings-section .settings-item {
    display: flex;
    align-items: center;
}

/* 最终得分容器样式 */
.time-final-score-container {
    font-size: 28px; /* 增大标签的字号 */
    color: #cccccc; /* 标签颜色调整为浅灰 */
    margin-top: 30px;
    margin-bottom: 30px; /* 增加与下方错误列表的间距 */
}

/* 最终分数值样式 */
.time-final-score-value {
    font-size: 60px; /* 显著增大分数值的字号 */
    font-weight: bold;
    color: #ffdd00; /* 游戏内得分常用的黄色 */
    text-shadow: 0 0 10px rgba(255, 221, 0, 0.7); /* 黄色辉光效果 */
    margin-left: 10px; /* 与标签稍微分开 */
}

/* --- Leaderboard Styles --- */
.leaderboard-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500; /* 确保在其他界面之上，但可能需要低于设置面板等 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.leaderboard-screen.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.leaderboard-content {
    background: linear-gradient(to bottom, rgba(25, 45, 25, 0.98), rgba(10, 30, 10, 0.98));
    border-radius: 15px;
    padding: 30px 40px;
    width: 90%;
    max-width: 550px; /* 比游戏结束界面稍窄一些 */
    max-height: 80vh;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5), 0 0 80px rgba(51, 180, 51, 0.2);
    border: 1px solid rgba(51, 204, 51, 0.4);
    display: flex;
    flex-direction: column;
    color: #e0e0e0;
}

#leaderboardTitle {
    color: #eeffee;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(51, 204, 51, 0.3);
    text-shadow: 0 0 8px rgba(51, 204, 51, 0.3);
}

.leaderboard-score-list {
    list-style-type: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1;
    overflow-y: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 204, 51, 0.4) rgba(0,0,0,0.2);
}

.leaderboard-score-list::-webkit-scrollbar {
    width: 8px;
}
.leaderboard-score-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.leaderboard-score-list::-webkit-scrollbar-thumb {
    background: rgba(51, 204, 51, 0.4);
    border-radius: 4px;
}
.leaderboard-score-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 204, 51, 0.6);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 17px;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

.leaderboard-rank {
    flex-basis: 10%;
    font-weight: bold;
    color: #a0a0a0;
}

.leaderboard-name {
    flex-grow: 1;
    text-align: left;
    padding-left: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    flex-basis: 20%;
    text-align: right;
    font-weight: bold;
    color: #ffdd00; /* 与最终得分颜色一致 */
}

.leaderboard-no-scores {
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
}

.leaderboard-close-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268); /* 灰色渐变，与词库管理器的导出/导入按钮类似 */
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    align-self: center; /* 按钮居中 */
    min-width: 150px;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.4);
}

.leaderboard-close-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.6);
}

/* 错字本按钮样式 - 基于词库管理按钮 */
.wrong-char-log-btn {
    background: #ff6347; /* 番茄色/珊瑚色，与红色系错误提示呼应但又不同 */
    /* 其他样式如 padding, font-size, border-radius, cursor, transition, text-align, min-width 已从 .dictionary-manager-button 继承 */
}

.wrong-char-log-btn:hover {
    background: #e55337; /* 悬停时深一点 */
    transform: scale(1.05); /* 继承或重写 */
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.5); /* 相应颜色的阴影 */
    min-width: 150px;
}

/* 新增：首页排行榜按钮样式 */
.menu-leaderboard-btn {
    background: #285ad9; /* 紫罗兰色 */
    /* 其他样式如 padding, font-size, border-radius, cursor, transition, text-align, min-width 已从 .dictionary-manager-button 继承 */
}

.menu-leaderboard-btn:hover {
    background: #2138ab; /* 悬停时深一点的紫色 */
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(76, 43, 226, 0.5); /* 紫色阴影 */
}

/* --- Wrong Character Log Styles --- */
.wrong-char-log-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* 比排行榜更深一点的背景，强调模态 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600; /* 比排行榜高一级 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.wrong-char-log-screen.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.wrong-char-log-content {
    background: linear-gradient(to bottom, rgba(30, 55, 30, 0.98), rgba(15, 35, 15, 0.98)); /* 深绿色调 */
    border-radius: 15px;
    padding: 30px 35px;
    width: 90%;
    max-width: 600px; 
    max-height: 85vh;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6), 0 0 90px rgba(71, 180, 51, 0.25);
    border: 1px solid rgba(61, 204, 51, 0.45);
    display: flex;
    flex-direction: column;
    color: #e8e8e8;
}

#wrongCharLogTitle {
    color: #f0f0f0;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(61, 204, 51, 0.35);
    text-shadow: 0 0 7px rgba(61, 204, 51, 0.3);
}

.wrong-char-list-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px; /* 为滚动条留出空间 */
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(61, 204, 51, 0.5) rgba(0,0,0,0.25);
}

.wrong-char-list-container::-webkit-scrollbar {
    width: 8px;
}
.wrong-char-list-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
}
.wrong-char-list-container::-webkit-scrollbar-thumb {
    background: rgba(61, 204, 51, 0.5);
    border-radius: 4px;
}
.wrong-char-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(61, 204, 51, 0.7);
}

.wrong-char-log-empty-msg {
    text-align: center;
    padding: 50px 20px;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
}

.wrong-char-items-ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.wrong-char-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.wrong-char-item:last-child {
    border-bottom: none;
}

.wrong-char-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.wrong-char-item-text {
    flex-grow: 1;
    color: #f0f0f0;
}

.wrong-char-item-remove-btn {
    background: transparent;
    color: #ff8a80; /* 浅红色，用于移除操作 */
    border: 1px solid #ff8a80;
    border-radius: 5px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 15px;
    transition: all 0.2s ease;
}

.wrong-char-item-remove-btn:hover {
    background: rgba(255, 138, 128, 0.2);
    color: #ff5252; /* 悬停时更深的红色 */
    border-color: #ff5252;
}

.wrong-char-log-close-btn {
    background: linear-gradient(135deg, #868e96, #5a6268); /* 中性灰色 */
    border: none;
    color: white;
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    align-self: center;
    min-width: 160px;
    box-shadow: 0 0 12px rgba(134, 142, 150, 0.4);
}

.wrong-char-log-close-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(134, 142, 150, 0.6);
}

/* 时间模式分数显示 */
.time-score-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffdd00;
    font-size: 42px;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 20px;
    z-index: 1010;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.time-score-display span {
    min-width: 80px;
    text-align: center;
}

/* 分数更新动画 */
@keyframes scoreUpdated {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

.time-score-display.score-updated {
    animation: scoreUpdated 0.4s ease-out;
}

/* 浮动分数动画 */
@keyframes floatUp {
    0% { 
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    20% { 
        opacity: 1;
        transform: translateY(0) scale(1.2);
    }
    80% { 
        opacity: 1;
        transform: translateY(-40px) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 浮动分数样式 */
.floating-points {
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 1020;
}

/* 得分显示 - 绿色 */
.floating-points.gain {
    color: #4eff4e;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* 失分显示 - 红色 */
.floating-points.loss {
    color: #ff4e4e;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* Combo文本样式 */
.combo-text {
    font-size: 22px;
    color: #ffdd00;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    margin-left: 8px;
    font-style: italic;
    display: block;
    margin-top: 5px;
}

/* 错题本 (Collection / Wrong Character Log) UI */
.wrong-char-log-screen {
    /* ... */
}

/* 新增：游戏结束界面提示文本样式 */
.time-game-over-hint {
    font-size: 0.85em;
    color: #c0c0c0; /* 浅灰色，不那么突出 */
    text-align: center;
    margin-top: 10px; /* 与上方错字列表的间距 */
    margin-bottom: 15px; /* 与下方按钮的间距 */
    padding: 0 10px; /* 左右内边距 */
    font-style: italic;
}

/* 时间模式 - 陨石 */
.time-mode-meteor {
    /* ... */
}

/* 新增：排行榜选项卡容器 */
.leaderboard-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px; /* 与下方列表的间距 */
    border-bottom: 2px solid rgba(51, 204, 51, 0.2); /* 容器底部边框 */
}

/* 新增：排行榜选项卡按钮 */
.leaderboard-tab {
    flex-grow: 1; /* 让两个按钮平分宽度 */
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent; /* 非激活状态的底部边框 */
    color: rgba(238, 238, 238, 0.7); /* 较暗的文本颜色 */
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    margin-bottom: -2px; /* 使激活的border与容器border重叠 */
}

.leaderboard-tab:hover {
    color: #eeffee;
    background-color: rgba(51, 204, 51, 0.1);
}

.leaderboard-tab.active {
    color: #eeffee; /* 激活时更亮的文本颜色 */
    font-weight: 600;
    border-bottom: 3px solid #33cc33; /* 激活状态的绿色底部边框 */
    background-color: rgba(51, 204, 51, 0.05); /* 非常轻微的背景色 */
}

.leaderboard-score-list {
    list-style-type: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1;
    overflow-y: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 204, 51, 0.4) rgba(0,0,0,0.2);
}

.leaderboard-score-list::-webkit-scrollbar {
    width: 8px;
}
.leaderboard-score-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.leaderboard-score-list::-webkit-scrollbar-thumb {
    background: rgba(51, 204, 51, 0.4);
    border-radius: 4px;
}
.leaderboard-score-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 204, 51, 0.6);
}

