/* 全局样式设置 */
:root {
    /* 主色调 - 明快活泼的色彩 */
    --primary-color: #FF6B6B;       /* 珊瑚色 */
    --secondary-color: #4ECDC4;     /* 薄荷绿 */
    --accent-color: #FFD700;        /* 金黄色 */
    --light-color: #F7FFF7;         /* 浅白色 */
    --dark-color: #566270;          /* 深灰色 */
    
    /* 新增颜色 */
    --english-color: #FF90BC;       /* 英文区域主色 */
    --chinese-color: #4ECDC4;       /* 中文区域主色 */
    --highlight-color: #FFE55C;     /* 高亮色 */
    --progress-color: linear-gradient(90deg, #FF9A5A, #FFD166); /* 进度条渐变 */
    --danger-color: #FF5252;        /* 危险/删除按钮 */
    --edit-color: #4E94FF;          /* 编辑按钮 */
    --leaderboard-color: #9C27B0;   /* 排行榜颜色 */
    --countdown-color: #F44336;     /* 倒计时提醒颜色 */
    
    /* 卡片渐变色 */
    --english-card-gradient: linear-gradient(135deg, #FF90BC, #FFC2D1);
    --chinese-card-gradient: linear-gradient(135deg, #3BCEAC, #0EAD69);
    
    /* 单词卡片丰富色系 */
    --card-color-1: linear-gradient(135deg, #FF9A8B, #FF6B6B);  /* 珊瑚红 */
    --card-color-2: linear-gradient(135deg, #90CAF9, #4FC3F7);  /* 天蓝色 */
    --card-color-3: linear-gradient(135deg, #B39DDB, #9575CD);  /* 淡紫色 */
    --card-color-4: linear-gradient(135deg, #FFCC80, #FFB74D);  /* 琥珀色 */
    --card-color-5: linear-gradient(135deg, #A5D6A7, #66BB6A);  /* 薄荷绿 */
    --card-color-6: linear-gradient(135deg, #F48FB1, #EC407A);  /* 粉红色 */
    --card-color-7: linear-gradient(135deg, #81D4FA, #29B6F6);  /* 清澈蓝 */
    --card-color-8: linear-gradient(135deg, #FFF176, #FFEE58);  /* 柠檬黄 */
    
    /* 字体设置 */
    --main-font: 'Nunito', sans-serif;
}

/* 整体页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    font-family: var(--main-font);
    background-color: var(--light-color);
    /* 临时移除背景图片，实际项目中应添加实际图片 */
    /* background-image: url('../assets/images/bg-pattern.png'); */
    color: var(--dark-color);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* 卡通背景和元素 */
.cartoon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--light-color);
    background-image: radial-gradient(#fff 10%, transparent 10%),
                      radial-gradient(#fff 10%, transparent 10%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    opacity: 0.6;
}

.cartoon-element {
    position: absolute;
    background-repeat: no-repeat;
    background-size: contain;
}

.cartoon-cloud {
    top: 10%;
    left: 5%;
    width: 150px;
    height: 80px;
    background-color: white;
    border-radius: 50px;
    box-shadow: 0 8px 5px rgba(0, 0, 0, 0.1);
    animation: float 20s infinite ease-in-out;
}

.cartoon-cloud:before {
    content: '';
    position: absolute;
    top: -30px;
    left: 30px;
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 50%;
}

.cartoon-cloud:after {
    content: '';
    position: absolute;
    top: -20px;
    right: 30px;
    width: 70px;
    height: 70px;
    background-color: white;
    border-radius: 50%;
}

.cartoon-star {
    top: 15%;
    right: 10%;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: twinkle 3s infinite alternate;
}

.cartoon-cat {
    bottom: 5%;
    right: 5%;
    width: 100px;
    height: 100px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="%23FFD166"/><circle cx="35" cy="40" r="5" fill="%23000"/><circle cx="65" cy="40" r="5" fill="%23000"/><path d="M40 60 Q50 70 60 60" stroke="%23000" stroke-width="3" fill="none"/><path d="M30 30 L15 10" stroke="%23000" stroke-width="3"/><path d="M70 30 L85 10" stroke="%23000" stroke-width="3"/></svg>');
    animation: bounce 5s infinite alternate;
}

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

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

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

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 游戏标题 */
.game-title {
    font-size: 3.5rem;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 var(--accent-color);
    letter-spacing: 2px;
    animation: bounce 1.5s ease infinite;
}

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

/* 得分面板 */
.score-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--secondary-color);
}

.score-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--secondary-color);
}

.score, .timer {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

#score-value {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* 进度条 */
.progress-bar-container {
    flex: 1;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 20px;
    border: 2px solid var(--accent-color);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--progress-color);
    border-radius: 8px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* 控制面板 */
.control-panel {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
}

.game-btn {
    flex: 1;
    min-width: 140px;
    min-height: 50px;
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: var(--main-font);
    font-size: 1.1rem;
    font-weight: bold;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.2);
    background: var(--highlight-color);
}

.game-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.game-btn i {
    margin-right: 8px;
}

/* 游戏容器 - 左右两栏布局 */
.game-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 单词面板 */
.word-board {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;
    min-height: 400px;
}

#english-board {
    border: 3px solid var(--english-color);
}

#chinese-board {
    border: 3px solid var(--chinese-color);
}

.board-title {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 15px 15px 0 0;
    margin: 0;
}

#english-board .board-title {
    background: var(--english-color);
}

#chinese-board .board-title {
    background: var(--chinese-color);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
    overflow-y: auto;
    align-content: start;
    flex: 1;
}

/* 单词卡片 */
.card {
    width: calc(33.33% - 15px); /* 一行三个卡片 */
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    aspect-ratio: 4/3; /* 设置4:3的宽高比 */
    margin-bottom: 5px;
}

.english-card {
    background: var(--english-card-gradient);
    color: white;
}

.chinese-card {
    background: var(--chinese-card-gradient);
    color: white;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 增强消除特效 */
@keyframes matchSuccess {
    0% { transform: scale(1); opacity: 1; }
    20% { transform: scale(1.2); opacity: 1; }
    50% { transform: scale(1.2) rotate(5deg); opacity: 0.9; box-shadow: 0 0 20px var(--highlight-color); }
    100% { transform: scale(0); opacity: 0; }
}

.card.matched {
    animation: matchSuccess 0.8s forwards;
    z-index: 10;
}

/* 选中卡片的强化效果 */
.card.selected {
    box-shadow: 0 0 0 4px var(--highlight-color), 0 0 20px rgba(255, 213, 0, 0.7);
    transform: scale(1.05);
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: white;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--primary-color);
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px dashed var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    color: var(--primary-color);
    margin: 0;
}

.close-sidebar-btn {
    color: var(--dark-color);
    font-size: 28px;
    cursor: pointer;
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 单词列表 */
.word-lists {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    padding: 12px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.list-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(3px);
}

.list-item.active {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border-left: 4px solid var(--accent-color);
    color: var(--dark-color);
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

.list-name {
    font-weight: bold;
    flex: 1;
}

.list-actions {
    display: flex;
    gap: 10px;
}

.list-actions i {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.list-actions .fa-play {
    color: var(--secondary-color);
    background: rgba(78, 205, 196, 0.1);
}

.list-actions .fa-edit {
    color: var(--edit-color);
    background: rgba(78, 148, 255, 0.1);
}

.list-actions .fa-trash {
    color: var(--danger-color);
    background: rgba(255, 82, 82, 0.1);
}

.list-actions i:hover {
    transform: scale(1.2);
}

/* 文件上传区域 */
.import-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 10px;
}

.import-section h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.file-upload {
    margin-bottom: 15px;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.file-label:hover {
    background: var(--primary-color);
}

input[type="file"] {
    display: none;
}

#file-name {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
}

.file-format {
    margin: 15px 0;
    font-size: 0.9rem;
    color: #666;
}

.file-format p {
    margin: 5px 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s;
    position: relative;
    border: 4px solid var(--primary-color);
}

.modal-header {
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
    margin: 0;
}

.close-btn {
    color: var(--dark-color);
    font-size: 28px;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 15px;
}

#word-input, #edit-word-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 1rem;
    resize: vertical;
    line-height: 1.5;
    transition: border 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

#word-input:focus, #edit-word-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.modal-footer {
    text-align: center;
}

.result {
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.result p {
    margin: 5px 0;
    font-size: 1.2rem;
}

#final-score, #final-time {
    font-weight: bold;
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 画布样式 */
#animation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .control-panel {
        flex-direction: column;
    }
    
    .game-container {
        grid-template-columns: 1fr;
    }
    
    .word-board {
        min-height: 300px;
    }
    
    .sidebar {
        width: 85%;
    }
    
    .card {
        width: calc(50% - 15px); /* 小屏幕一行两个卡片 */
    }
    
    .word-card {
        width: calc(50% - 20px); /* 小屏幕一行两个卡片 */
    }
    
    .game-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%; /* 最小屏幕一行一个卡片 */
    }
    
    .word-card {
        width: 100%; /* 最小屏幕一行一个卡片 */
        height: 80px; /* 稍微降低高度 */
    }
}

@media (max-width: 992px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .card-container {
        grid-template-columns: 1fr;
    }
}

/* 导入单词模态框样式增强 */
.import-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--dark-color);
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active:after {
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 1rem;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

/* 倒计时样式 */
.countdown-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.countdown-option {
    padding: 12px;
    background-color: white;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.countdown-option:hover {
    background-color: rgba(78, 205, 196, 0.2);
    transform: translateY(-2px);
}

.countdown-option.active {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

/* 倒计时警告效果 */
.timer.warning {
    color: var(--countdown-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 排行榜样式增强 */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--accent-color);
}

.leaderboard-header h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0;
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.danger-btn:hover {
    background-color: #ff3333;
    transform: translateY(-2px);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left-color: var(--accent-color);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: var(--dark-color);
    margin-right: 15px;
}

.leaderboard-rank-1 {
    background-color: gold;
    color: #333;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.leaderboard-rank-2 {
    background-color: silver;
    color: #333;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.6);
}

.leaderboard-rank-3 {
    background-color: #CD7F32; /* 铜色 */
    color: white;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.6);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.leaderboard-score {
    color: var(--dark-color);
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.leaderboard-date {
    color: #777;
    font-size: 0.85rem;
    font-style: italic;
}

.delete-score-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.delete-score-btn:hover {
    background-color: rgba(255, 82, 82, 0.1);
    transform: scale(1.2);
    opacity: 1;
}

/* 挑战者列表样式 */
.challenger-list-item {
    padding: 12px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.challenger-list-item:hover {
    background: #f0f0f0;
}

.challenger-list-item.active {
    background: var(--accent-color);
    color: white;
}

.challenger-list-name {
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenger-list-name i {
    transition: transform 0.3s ease;
}

.challenger-list-name.expanded i {
    transform: rotate(180deg);
}

.challenger-names-container {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.challenger-names-container.show {
    display: block;
}

.challenger-name {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.challenger-name:hover {
    background: #eee;
}

.challenger-name.selected {
    background: var(--secondary-color);
    color: white;
}

/* 导入挑战者模态框 */
#challenger-import-modal .modal-content {
    max-width: 550px;
}

/* 空白状态提示信息 */
.empty-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
    color: #aaa;
    font-size: 1.2rem;
    padding: 20px;
}

.empty-message p {
    margin: 5px 0;
}

/* 单词输入框的样式增强 */
#challenger-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 1rem;
    resize: vertical;
    line-height: 1.5;
    transition: border 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

#challenger-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

/* 游戏结束面板样式优化 */
#game-over-modal .modal-content {
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

#game-over-modal .modal-header {
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    color: white;
    padding: 15px 20px;
    text-align: center;
}

#game-over-modal .modal-header h2 {
    font-size: 28px;
    margin: 0;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#game-over-modal .modal-body {
    padding: 25px;
    background-color: white;
}

#game-over-modal p {
    text-align: center;
    font-size: 20px;
    margin-bottom: 20px;
}

#final-result-text {
    font-weight: bold;
    color: var(--highlight-color);
}

.result {
    background-color: #f8f8f8;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.result p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 !important;
    font-size: 18px !important;
    text-align: left !important;
}

.result span {
    font-weight: bold;
    color: var(--accent-color);
}

.challenger-form {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
}

.challenger-form label {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

#player-name {
    padding: 12px 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 16px;
    background-color: #f9f9f9;
    margin-bottom: 20px;
    transition: border 0.3s, box-shadow 0.3s;
}

#player-name:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

#game-over-modal .modal-footer {
    padding: 15px 25px 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

#game-over-modal .game-btn {
    padding: 12px 25px;
    font-size: 16px;
    min-width: 140px;
}

/* 挑战者侧边栏样式完善 */
#challenger-sidebar {
    z-index: 1001; /* 确保在其他侧边栏之上 */
}

#challenger-sidebar .import-section {
    margin: 0 0 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    text-align: center;
    border: 1px dashed var(--accent-color);
}

#import-challenger-btn {
    width: 100%;
    margin: 0;
    padding: 12px 15px;
    background: var(--primary-color);
    font-weight: bold;
}

#import-challenger-btn:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.empty-challenger-message {
    margin-top: 30px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 10px;
    border: 1px dashed var(--primary-color);
}

.empty-challenger-message i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.7;
}

.empty-challenger-message p {
    margin: 5px 0;
    color: #888;
}

.challenger-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#challenger-sidebar .sidebar-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

#challenger-sidebar .sidebar-header h2 {
    color: white;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#challenger-sidebar .close-sidebar-btn {
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s;
}

#challenger-sidebar .close-sidebar-btn:hover {
    transform: scale(1.1);
}

/* 添加选择挑战者确认对话框样式 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.confirm-dialog-content {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: popup 0.3s ease-out;
}

@keyframes popup {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.confirm-dialog h3 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
}

.confirm-dialog p {
    margin: 10px 0;
    color: #333;
}

.confirm-dialog strong {
    color: var(--primary-color);
    font-weight: bold;
}

.confirm-tip {
    font-size: 0.9rem;
    color: #666 !important;
    font-style: italic;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 15px;
}

.confirm-actions button {
    padding: 8px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.cancel-btn {
    background-color: #f0f0f0;
    color: #555;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.confirm-btn {
    background-color: var(--primary-color);
    color: white;
}

.confirm-btn:hover {
    background-color: var(--primary-darker);
    transform: translateY(-2px);
}

/* Toast消息样式 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 10000;
    font-size: 16px;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 挑战者列表操作按钮样式 */
.challenger-list-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--card-bg);
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.challenger-list-name:hover {
    background-color: var(--card-hover);
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-list-btn, .delete-list-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-list-btn {
    color: var(--accent-color);
}

.edit-list-btn:hover {
    background-color: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

.delete-list-btn {
    color: var(--danger-color);
}

.delete-list-btn:hover {
    background-color: rgba(255, 82, 82, 0.2);
    transform: scale(1.1);
}

/* 选中挑战者的样式 */
.challenger-name.selected {
    background-color: var(--primary-light);
    color: var(--primary-darker);
    font-weight: bold;
    border-left: 3px solid var(--primary-color);
}

/* 挑战者名称容器样式 */
.challenger-names-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.challenger-names-container.show {
    max-height: 500px; /* 足够大的值以显示内容 */
}

/* 确保下拉箭头在展开状态下旋转 */
.challenger-list-name.expanded .fa-angle-down {
    transform: rotate(180deg);
}

.fa-angle-down {
    transition: transform 0.3s ease;
}

/* 帮助文本样式 */
.help-text {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
    border: 1px dashed var(--secondary-color);
    font-size: 0.9rem;
    color: var(--dark-color);
    text-align: center;
}

.help-text p {
    margin: 0;
    line-height: 1.5;
}

/* 强调按钮点击动效 */
.list-actions i:active {
    transform: scale(0.9);
}

/* 倒计时设置样式增强 */
#countdown-modal .modal-body h3 {
    margin: 15px 0 10px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.custom-time-group {
    background-color: rgba(78, 205, 196, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.custom-time-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#custom-minutes {
    width: 70px;
    padding: 10px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
}

#time-unit {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    background-color: white;
    cursor: pointer;
}

.time-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* 预设选项样式改进 */
.countdown-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.countdown-option {
    padding: 12px;
    background-color: white;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.countdown-option:hover {
    background-color: rgba(78, 205, 196, 0.2);
    transform: translateY(-2px);
}

.countdown-option.active {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

/* 卡片样式优化 - 支持长内容显示 */
.word-card {
    position: relative;
    width: 100%;
    min-height: 70px;
    height: 100px; /* 固定高度 */
    padding: 15px;
    background-color: #ffffff;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    font-size: 18px;
    line-height: 1.4;
    word-break: break-word;
}

/* 卡片色彩样式 */
.word-card.color-1 {
    background: var(--card-color-1);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-2 {
    background: var(--card-color-2);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-3 {
    background: var(--card-color-3);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-4 {
    background: var(--card-color-4);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-5 {
    background: var(--card-color-5);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-6 {
    background: var(--card-color-6);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-7 {
    background: var(--card-color-7);
    color: white;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.word-card.color-8 {
    background: var(--card-color-8);
    color: #333;
    text-shadow: 0px 1px 2px rgba(255, 255, 255, 0.3);
}

/* 长内容自动调整字体大小 */
.word-card.long-content {
    font-size: 16px;
}

.word-card.very-long-content {
    font-size: 14px;
}

/* 极长内容处理 */
.word-card.extra-long-content {
    font-size: 12px;
}

/* 悬停放大效果 */
.word-card:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 卡片选中效果增强 */
.word-card.selected {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px var(--highlight-color), 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 20;
}

/* 卡片内装饰样式 */
.word-card .decoration-circle-1 {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    z-index: -1;
}

.word-card .decoration-circle-2 {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
}

/* 卡片匹配动画增强 */
.word-card.matched {
    animation: matchCard 0.8s forwards;
}

@keyframes matchCard {
    0% { transform: scale(1); opacity: 1; }
    20% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 30px var(--highlight-color); }
    50% { transform: scale(1.2) rotate(5deg); opacity: 0.9; }
    100% { transform: scale(0); opacity: 0; }
}

/* 长内容悬停预览 */
.word-card.long-content:hover::after,
.word-card.very-long-content:hover::after {
    content: attr(data-full-text);
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background-color: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    width: auto;
    max-width: 300px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-size: 16px;
    white-space: normal;
    text-align: left;
    color: #333;
}

/* 内容预览提示 */
.word-card .tooltip {
    display: none;
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
}

.word-card.long-content .tooltip,
.word-card.very-long-content .tooltip {
    display: block;
}

/* 英文和中文卡片标识 */
.word-card[data-type="english"]::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 10px;
    z-index: 1;
}

.word-card[data-type="chinese"]::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 10px;
    z-index: 1;
}

/* 触摸反馈效果 */
.word-card.touch-active {
    transform: scale(0.95);
    opacity: 0.9;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

/* 返回首页按钮 */
.back-btn {
    position: absolute;
    left: 0;
    top: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    z-index: 100;
}

.back-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.back-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .back-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
} 