/* === 全局重置与基础设置 === */
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-height: 100%;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'YouYuan', 'Microsoft YaHei', sans-serif;
    /* 背景升级：清爽的蓝天渐变 */
    background: linear-gradient(180deg, #E0F7FA 0%, #E3F2FD 100%);
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* 游戏页禁止滚动，管理页允许滚动 */
body.page-game {
    overflow: hidden;
    overscroll-behavior-y: contain;
}
body.page-manage {
    overflow-y: auto;
}

/* === 主容器卡片风格 === */
.game-container {
    background-color: rgba(255, 255, 255, 0.95);
    width: 95%; /* 移动端默认留边 */
    max-width: 1180px; 
    margin: 0 auto; 
    padding: 20px 30px; 
    border-radius: 30px; 
    box-shadow: 0 15px 35px rgba(3, 169, 244, 0.15), 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box; 
    border: 4px solid #FFFFFF;
}

/* 游戏页特定布局 */
body.page-game .game-container {
    height: 94vh;
    margin-top: 3vh;
    justify-content: center;
    position: relative; /* 确保内部定位准确 */
}

/* 管理页特定布局 */
body.page-manage .game-container {
    min-height: 90vh;
    height: auto;
    margin-top: 30px;
    margin-bottom: 30px;
    align-items: stretch; /* 让内容撑满宽度 */
}

/* === 标题与文字 === */
h1 {
    text-align: center;
    color: #0277BD;
    margin: 10px 0 20px 0;
    text-shadow: 0 2px 0 rgba(255,255,255,0.5);
}

h2 {
    color: #039BE5;
    margin-top: 0;
    font-size: 1.5em;
    border-left: 5px solid #29B6F6;
    padding-left: 12px;
    margin-bottom: 20px;
}

a {
    color: #0288D1;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}
a:hover {
    color: #01579B;
    text-decoration: underline;
}

/* === 管理后台布局优化 (Sections) === */
section {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #E1F5FE;
}

/* === 表单与输入框美化 === */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form label {
    font-weight: bold;
    color: #546E7A;
    margin-bottom: 5px;
    font-size: 0.95em;
}

input[type="text"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #CFD8DC;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    background-color: #FAFAFA;
}

input[type="text"]:focus,
textarea:focus {
    border-color: #29B6F6;
    background-color: #FFF;
    box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.1);
}

/* === 按钮系统：3D 糖果风格 (全局通用) === */
button, 
.button-style { 
    padding: 10px 24px;
    cursor: pointer;
    border: none;
    border-radius: 50px; 
    color: white;
    font-size: 1em; 
    background-color: #29B6F6; 
    box-shadow: 0 4px 0 #0288D1; 
    font-weight: bold;
    transition: all 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

button:hover {
    background-color: #4FC3F7;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #0288D1;
}

button:active {
    transform: translateY(4px) !important;
    box-shadow: 0 0 0 #0288D1 !important;
}

button:disabled {
    background-color: #B0BEC5;
    box-shadow: none;
    color: #ECEFF1;
    cursor: not-allowed;
    transform: translateY(4px);
}

/* 特殊颜色按钮 */
.warning-button, .delete-button {
    background-color: #FF7043;
    box-shadow: 0 4px 0 #D84315;
}
.warning-button:hover, .delete-button:hover {
    background-color: #FF8A65;
    box-shadow: 0 6px 0 #D84315;
}

.success-button, .save-button {
    background-color: #66BB6A;
    box-shadow: 0 4px 0 #388E3C;
}
.success-button:hover, .save-button:hover {
    background-color: #81C784;
}

.edit-button {
    background-color: #FFA726;
    box-shadow: 0 4px 0 #F57C00;
}
.edit-button:hover {
    background-color: #FFB74D;
}

.reset-button, .cancel-button {
    background-color: #90A4AE;
    box-shadow: 0 4px 0 #546E7A;
}

/* === 表格样式 (Card Table) === */
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    margin-top: 15px; 
    background-color: #fff; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    border: 1px solid #E1F5FE;
}

th { 
    background-color: #E1F5FE; 
    color: #0277BD; 
    padding: 15px; 
    text-align: left; 
    font-weight: 800;
    border-bottom: 2px solid #B3E5FC;
}

td { 
    padding: 12px 15px; 
    border-bottom: 1px solid #F1F8E9; 
    vertical-align: middle;
}

/* 斑马纹 */
tbody tr:nth-child(even) {
    background-color: #FAFAFA;
}
tbody tr:hover {
    background-color: #F1F8E9;
}

/* 表格里的按钮要小一点 */
table button {
    padding: 6px 12px;
    font-size: 0.85em;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2); /* 影子稍微浅一点 */
    margin: 2px;
}

/* 状态图标 */
.status-icon { font-size: 1.2em; display: inline-block; width: 24px; text-align: center;}
.status-icon.mastered { color: #66BB6A; }
.status-icon.not-mastered { color: #E0E0E0; }
.status-icon.has-sentence { color: #29B6F6; }
.status-icon.no-sentence { color: #E0E0E0; }

/* === 管理页筛选栏优化 === */
.word-list-controls-wrapper {
    background-color: #F9FAFB;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #ECEFF1;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.control-row:last-child { margin-bottom: 0; }

.search-group, .view-options-group, .selection-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-group input {
    width: auto;
    min-width: 200px;
}

/* === 模式选择界面样式 === */
.mode-selection-group {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #E1F5FE;
    border-radius: 12px;
    background-color: #F9FAFB;
    width: 100%;
}

.mode-selection-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #0277BD;
    font-weight: bold;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.mode-option:hover {
    background-color: #F5F5F5;
    border-color: #B3E5FC;
}

.mode-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 4px;
}

.mode-option.selected {
    border-color: #29B6F6;
    background-color: #E1F5FE;
}

.mode-label {
    display: flex;
    flex-direction: column;
    margin-left: 5px;
}

.mode-label strong {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.mode-label small {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 820px) {
    .mode-selection-group {
        padding: 12px;
    }
    
    .mode-option {
        padding: 10px;
    }
    
    .mode-label strong {
        font-size: 13px;
    }
    
    .mode-label small {
        font-size: 11px;
    }
}

/* === 游戏页核心 (Game Page) === */

.main-game-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* === 顶部导航栏 (优化对称性) === */
.game-header-bar {
    width: 100%;
    min-height: 60px; /* 给一个最小高度 */
    display: flex;
    align-items: center;
    /* justify-content: space-between;  <-- 不再依赖 flex 布局中间文字 */
    margin-bottom: 20px;
    position: relative; /* 关键：为绝对定位提供参考 */
    z-index: 10;
}

/* 左侧功能区 (绝对定位 -> 改为全宽分布容器，实现左右对称) */
.header-left-group {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 关键：让子元素两端对齐 */
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 20; 
    padding: 0 10px; /* 左右留出安全边距 */
    box-sizing: border-box;
    pointer-events: none; /* 关键：让这个全宽容器不遮挡中间文字的点击 */
}

.achievement-entry {
    font-size: 2.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    pointer-events: auto; /* 恢复点击交互 */
    order: 2; /* 放到右边 */
}
.achievement-entry:active { transform: scale(0.9); }

/* 金币胶囊样式 */
.coin-display {
    background-color: #FFF;
    border: 2px solid #FFD700;
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: #F57F17;
    font-size: 1.1rem;
    box-shadow: 0 3px 0 #FBC02D;
    white-space: nowrap; /* 防止金币数太长换行 */
    pointer-events: auto; /* 恢复点击交互 */
    order: 1; /* 放到左边 */
}
.coin-icon { font-size: 1.2rem; }

/* 金币增加动画 */
.coin-pop {
    animation: coinPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes coinPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 核心释义 (绝对居中) */
.definition-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* 完美的绝对居中 */
    width: 60%; /* 限制宽度防止遮挡两边 */
    text-align: center;
    z-index: 10;
    pointer-events: none; /* 防止遮挡下层点击 */
}

#definition-text {
    font-size: 2.4rem;
    font-weight: 800; 
    color: #263238; 
    text-shadow: 2px 2px 0 #FFF;
    display: block;
    width: 100%;
    pointer-events: auto; /* 恢复文字可选中 */
}

.header-spacer { display: none; } /* 占位符不再需要 */


/* 答题区 */
#current-answer { 
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0; 
    min-height: 70px; 
}

.answer-letter { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 60px;
    background-color: #ECEFF1; 
    border: 3px dashed #B0BEC5; 
    border-radius: 12px;
    font-size: 2em;
    font-weight: bold;
    color: #455A64;
    cursor: default;
}

/* 填入内容后变实心 */
.answer-letter:not(:empty):not(:contains('_')) {
    background-color: #FFF;
    border: 3px solid #29B6F6; 
    color: #0277BD;
    box-shadow: 0 4px 0 #81D4FA; 
    transform: translateY(-4px); 
}

.answer-letter.last-letter {
    border-color: #FF7043;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* 乱序字母区 */
#jumbled-letters { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 12px; 
    padding: 10px;
    width: 100%;
} 

#jumbled-letters button { 
    background: #FFFFFF; 
    padding: 0;      
    font-size: 2em;          
    min-width: 65px;         
    min-height: 70px;        
    border-radius: 14px;     
    border: 2px solid #4FC3F7; 
    box-shadow: 0 5px 0 #039BE5; 
    color: #0277BD; 
    margin: 0; 
}

#jumbled-letters button:not(:disabled):active {
    transform: translateY(5px); 
    box-shadow: 0 0 0 #039BE5; 
}

#jumbled-letters button:disabled { 
    background-color: #CFD8DC; 
    color: #B0BEC5; 
    border-color: #B0BEC5;
    box-shadow: none; 
    transform: translateY(5px); 
    opacity: 0.6; 
}

/* 底部操作区 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* 特定游戏按钮颜色 */
#hint-button { background-color: #FFCA28; box-shadow: 0 5px 0 #FFA000; }
#hint-button:hover { background-color: #FFD54F; }

#pronounce-button { background-color: #42A5F5; box-shadow: 0 5px 0 #1E88E5; }
#pronounce-button:hover { background-color: #64B5F6; }

#skip-button { background-color: #AB47BC; box-shadow: 0 5px 0 #8E24AA; }
#skip-button:hover { background-color: #BA68C8; }

.retry-button { background-color: #FF7043 !important; box-shadow: 0 5px 0 #E64A19 !important; }

/* 提示信息 */
.hint-area {
    min-height: 1.5em;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #0288D1;
    margin: 10px 0;
}
.feedback-negative { color: #FF5252; }
.feedback-positive { color: #4CAF50; }

/* === 火箭进度条 (全息仪表盘风格升级) === */
.rocket-progress {
    position: fixed !important;
    top: 50%; /* 垂直居中 */
    right: 30px; /* 稍微靠里一点 */
    transform: translateY(-50%); /* 垂直居中修正 */
    width: 90px; /* 宽度加大 */
    height: 350px; /* 高度加大 */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 99;
    /* 增加一个半透明胶囊背景，像仪表盘 */
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 15px 0;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px); /* 磨砂玻璃效果 */
    transition: opacity 0.3s, transform 0.3s; /* 增加过渡动画 */
}

/* 新增：隐藏火箭的工具类 (用于句子挑战时) */
body.hide-rocket .rocket-progress {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(200px); /* 往右飞出屏幕 */
}

/* 移动端下的隐藏动画修正 */
@media (max-width: 820px) {
    body.hide-rocket .rocket-progress {
        transform: translateX(100px); /* 移动端不需要垂直居中修正，直接往右飞 */
    }
}

.rocket-star { 
    font-size: 2.5em; /* 星星加大 */
    margin-bottom: 10px; 
    filter: drop-shadow(0 0 8px gold);
    animation: twinkle 2s ease-in-out infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.rocket-earth { 
    font-size: 2.2em; /* 地球加大 */
    margin-top: 10px; 
}

.rocket-text { 
    font-size: 1.2em; 
    font-weight: 900; 
    color: #0277BD;
    background: #FFF; 
    padding: 4px 12px; 
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 10px;
    white-space: nowrap;
}

.rocket-track {
    position: relative;
    width: 20px; /* 轨道加宽 */
    flex-grow: 1;
    background: linear-gradient(to bottom, #FFD54F, #4FC3F7);
    border-radius: 10px;
    border: 3px solid #FFF; /* 增加白边 */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.rocket {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5em; /* 超大火箭 */
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性动画 */
    filter: drop-shadow(0 5px 15px rgba(255, 165, 0, 0.5)); /* 火箭发光投影 */
    z-index: 2;
}

/* === 句子挑战屏 (核心修复) === */
.sentence-scramble-screen { 
    display: none; 
    flex-direction: column !important; /* 强制垂直排列 */
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px 0;
} 

.sentence-scramble-screen h2 {
    color: #039BE5;
    text-shadow: none;
    font-size: 2em;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    border-left: none; /* 移除导致排版奇怪的左边框 */
    padding-left: 0;
}

.sentence-word-info {
    font-size: 1.5rem;
    color: #546E7A;
    margin-bottom: 15px;
    background-color: #E1F5FE;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
}

.sentence-assembly-area {
    width: 100%; 
    max-width: 800px;
    min-height: 120px;
    background-color: #FAFAFA;
    border: 4px dashed #B0BEC5; /* 虚线加粗 */
    border-radius: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.sentence-assembly-area.correct {
    border-color: #66BB6A;
    background-color: #E8F5E9;
}

.sentence-assembly-area.incorrect {
    border-color: #FF7043;
    background-color: #FBE9E7;
}

.scrambled-words-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 80px; 
}

.word-block {
    background-color: #29B6F6;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 0 #0288D1;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.1s;
}

.word-block:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #0288D1;
}

.word-block.hidden {
    opacity: 0;
    pointer-events: none;
}

/* === Excel 风格表格容器 (支持左右滑动) === */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #CFD8DC;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-top: 10px;
    position: relative;
}

/* 表格布局细节优化：回归自适应逻辑 */
    .word-table {
        table-layout: auto; /* 改为自动布局，实现真正的自适应 */
        width: 100%;
        min-width: 800px; /* 增加最小总宽度，确保横向滑动体验 */
        border-collapse: collapse;
    }

    /* 列宽分配：使用 width 控制基础宽度，使用 white-space 保护内容 */
    .col-check { 
        width: 45px; 
        text-align: center; 
    }
    .col-word { 
        width: 120px; 
        text-align: left;
        font-weight: bold;
    }
    .col-trans { 
        text-align: left;
        max-width: 200px; /* 关键：限制翻译列最大宽度，防止挤压其他列 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .col-tag {
        text-align: left;
        width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #607D8B; /* 标签使用稍淡的颜色 */
        font-size: 0.9em;
    }
    .col-status, .col-sentence { 
        width: 60px; 
        text-align: center; 
    }
    .col-actions { 
        width: 180px; /* 增加到 180px，确保三个按钮不拥挤 */
        text-align: center;
        white-space: nowrap; /* 强制按钮不换行 */
    }

    .word-table th, 
    .word-table td {
        padding: 12px 10px; /* 进一步优化行高，增加点击感 */
        line-height: 1.4;
        border-bottom: 1px solid #ECEFF1;
        vertical-align: middle;
    }

    /* 针对移动端的横向滑动容器优化 */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #E2E8F0;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    /* 保持表头固定 */
    .word-table th {
        position: sticky;
        top: 0;
        background-color: #F8FAFC;
        z-index: 10;
        box-shadow: inset 0 -2px 0 #EDF2F7; /* 表头下划线 */
    }

/* 复选框垂直居中对齐 */
.col-check input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

/* 状态文字颜色增强 */
.status-yes, .status-has { color: #10B981; font-weight: bold; }
.status-no, .status-empty { color: #94A3B8; }

/* 操作按钮微调 */
.col-actions button {
    padding: 4px 8px;
    margin: 0 2px;
    font-size: 0.8em;
    border-radius: 4px;
    box-shadow: none; /* 移除 3D 影子使界面更清爽 */
}
.col-actions button:hover {
    transform: translateY(-1px);
}

/* 移动端/iPad 适配修复 */
@media (max-width: 820px) {
    /* 容器调整 */
    .game-container {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        height: 100vh;
        margin: 0;
    }
    
    /* 字体调整 */
    #definition-text { font-size: 1.8rem; }
    
    /* 火箭进度条缩小并靠边，防止遮挡内容 */
    .rocket-progress {
        top: 20px; /* 移动端还是放右上角 */
        right: 10px;
        transform: none; /* 取消垂直居中 */
        width: 50px;
        height: 200px;
        background-color: rgba(255, 255, 255, 0.6);
        padding: 10px 0;
    }
    .rocket-star, .rocket-earth { font-size: 1.5em; }
    .rocket { font-size: 2em; }
    .rocket-track { width: 12px; }
    
    /* 字母按键适配 */
    #jumbled-letters button {
        min-width: 50px;
        min-height: 55px;
        font-size: 1.6em;
    }
    
    /* 表格在小屏幕上允许横向滚动 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* 管理页布局变为垂直堆叠 */
    .control-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-group input { min-width: 0; }
}

/* 震动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
.shake-effect .answer-letter {
    border-color: #FF5252 !important;
    background-color: #FFEBEE !important;
}

/* === 管理后台 Tab 系统 === */
.tab-container {
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #E1F5FE;
    padding-bottom: 10px;
    align-items: center;
}

.tab-btn {
    background: transparent;
    color: #546E7A;
    box-shadow: none;
    border-radius: 12px;
    padding: 8px 20px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.tab-btn:hover {
    background: #E1F5FE;
    box-shadow: none;
    transform: none;
}

.tab-btn.active {
    background: #29B6F6;
    color: white;
    box-shadow: 0 4px 0 #0288D1;
}

.tab-actions {
    margin-left: auto;
}

.export-link {
    font-size: 0.9em;
    padding: 6px 15px;
    background: #F5F5F5;
    border-radius: 8px;
    color: #666;
    border: 1px solid #DDD;
    text-decoration: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === 表单增强布局 === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.primary-btn {
    background-color: #039BE5;
    box-shadow: 0 4px 0 #0277BD;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
}

.hint-text {
    font-size: 0.9em;
    color: #78909C;
    margin-bottom: 10px;
}

.success { color: #43A047; font-weight: bold; font-size: 0.9em; }
.error { color: #E53935; font-weight: bold; font-size: 0.9em; }

/* === 移动端响应式适配 (iPad & 手机) === */
@media (max-width: 768px) {
    .game-container {
        width: 100%;
        padding: 15px;
        border-radius: 0;
        border: none;
    }

    h1 { font-size: 1.5rem; }

    /* Tab 头部滚动 */
    .tab-header {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    .tab-btn {
        flex: 0 0 auto;
        padding: 10px 15px;
    }

    /* === 核心：保持表格布局 (支持横向滑动) === */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #E2E8F0;
        border-radius: 8px;
    }

    #word-list-table {
        display: table;
        min-width: 700px;
        table-layout: auto;
    }

    #word-list-table thead {
        display: table-header-group;
    }

    #word-list-table tr {
        display: table-row;
    }

    #word-list-table td, 
    #word-list-table th {
        display: table-cell;
    }
    #word-list-table td:last-child::before { display: none; }
}

/* === 更新提示条样式 === */
#update-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
    font-size: 14px;
    text-align: center;
}