/* style.css - 完整优化版 */
:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --dark: #2D3436;
    --light: #F8F9FA;
    --gray: #9CA3AF;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--dark);
}

/* 工具类 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--secondary); }
    50% { box-shadow: 0 0 20px var(--secondary); }
}

@keyframes particleFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes matchGlow {
    0% { box-shadow: 0 0 5px var(--success); }
    50% { box-shadow: 0 0 20px var(--success), 0 0 40px var(--success); }
    100% { box-shadow: 0 0 5px var(--success); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 屏幕管理 */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 加载画面 */
#loading-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.loading-content {
    max-width: 300px;
}

.magic-circle {
    font-size: 80px;
    animation: pulse 2s infinite;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--warning));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 主菜单 */
#main-menu {
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px 40px;
}

.menu-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.menu-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 24px;
    background: white;
    color: var(--dark);
    font-size: 1.1em;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.menu-btn.primary {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
}

.menu-btn .icon {
    font-size: 1.5em;
}

.manual-entry {
    transition: var(--transition);
}

.manual-entry:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateX(5px);
}

.player-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 30px;
    width: 100%;
    max-width: 320px;
}

.avatar {
    font-size: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.info {
    flex: 1;
}

.level {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stars {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--warning);
}

/* 屏幕头部 */
.screen-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    color: white;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.screen-header h2 {
    font-size: 1.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* 游戏头部 */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.95);
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    min-height: 70px;
    position: relative;
}

.game-header .back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.game-header .back-btn:hover {
    transform: scale(1.1) rotate(-10deg);
}

.game-info {
    flex: 1;
    text-align: center;
    padding: 0 15px;
}

.level-name {
    display: block;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.1em;
}

.progress {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* 游戏区域 */
#game-screen {
    padding: 15px;
    background: linear-gradient(180deg, #81ECEC 0%, #74B9FF 100%);
}

.game-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* 记忆卡片网格 */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    perspective: 1000px;
}

.memory-card {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
}

.memory-card .card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched .card-inner {
    transform: rotateY(180deg) scale(0.95);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.card-face:hover {
    box-shadow: var(--shadow-lg);
}

.card-front {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.card-emoji {
    font-size: 3em;
    margin-bottom: 5px;
}

.card-hint {
    font-size: 0.9em;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 10px;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    border: 3px solid var(--secondary);
    padding: 10px;
    text-align: center;
}

.card-word {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 8px;
    word-break: break-all;
}

.card-meaning {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.card-speak {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: none;
}

.card-speak:hover {
    transform: scale(1.1);
}

.card-speak:active {
    transform: scale(0.95);
}

.memory-card.matched .card-back {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: var(--success);
    animation: matchGlow 0.6s ease;
}

.shake {
    animation: shake 0.5s;
}

/* 反馈区域 */
.feedback-area {
    margin-top: 20px;
    min-height: 60px;
    text-align: center;
}

.feedback-bubble {
    display: inline-block;
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: bold;
    animation: popIn 0.3s ease;
    margin: 5px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.feedback-bubble.success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.feedback-bubble.error {
    background: linear-gradient(135deg, #eb3349, #f45c43);
}

.feedback-bubble.hint {
    background: linear-gradient(135deg, var(--accent), #f5576c);
}

/* 模态框通用样式 */
.modal-overlay {
    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: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
    color: var(--danger);
}

/* 单词详情样式 */
.word-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.word-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.word-title h2 {
    font-size: 2.5em;
    color: var(--primary);
    margin: 0;
}

.speak-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.speak-btn:hover {
    transform: scale(1.1);
}

.phonetic {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 10px;
}

.pos-badge {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary-light);
    color: white;
    border-radius: 15px;
    font-size: 0.9em;
}

.detail-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.detail-section h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.syllable {
    font-size: 1.5em;
    color: var(--primary);
    font-weight: bold;
    letter-spacing: 2px;
}

.highlight {
    background: #fff3cd;
    padding: 8px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid var(--warning);
}

.scene-sentence-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2em;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--success);
}

.speak-btn-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collocation-list, .exam-tips-list {
    padding-left: 20px;
    margin: 0;
}

.collocation-list li {
    margin: 5px 0;
    color: #666;
}

.exam-section li {
    color: var(--danger);
    margin: 5px 0;
    font-size: 0.95em;
}

.fun-content p {
    margin: 8px 0;
    line-height: 1.6;
}

/* 单词图鉴与关卡选择 */
#collection-screen, #level-select {
    min-height: 100vh;
}

#level-select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 4px;
    border-radius: 20px;
}

.tab {
    padding: 8px 16px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.word-collection, .level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    perspective: 1000px;
    padding-bottom: 40px;
}

.level-card {
    padding: 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.level-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.8);
    background: linear-gradient(135deg, #b2bec3, #dfe6e9);
}

.level-card.current {
    border: 3px solid var(--secondary);
    animation: glow 2s infinite;
    transform: scale(1.05);
}

.level-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.level-name-card {
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.level-progress {
    font-size: 0.85em;
    color: #666;
}

.level-stars {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.9em;
}

/* 单词卡片 */
.word-card {
    padding: 15px;
    cursor: pointer;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    position: relative;
    border-left: 5px solid var(--warning);
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.word-card.mastered {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 5px solid var(--success);
}

.word-text {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.word-phonetic {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.word-meaning {
    font-size: 0.85em;
    color: #666;
}

/* 设置页面 */
#settings-screen {
    background: linear-gradient(135deg, #D5DBDB 0%, #AEB6BF 100%);
}

.settings-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item span {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--dark);
}

.setting-item[id^="btn-"], .setting-item.version-setting {
    cursor: pointer;
    transition: all 0.2s;
}

.setting-item[id^="btn-"]:hover, .setting-item.version-setting:hover {
    background: rgba(108, 92, 231, 0.05);
    transform: translateX(5px);
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray);
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.3);
}

.setting-divider {
    text-align: center;
    border-bottom: 1px dashed #CCCCCC;
    font-size: 1.5em;
    color: #777777;
    padding: 30px 0 15px;
    margin-bottom: 10px;
}

.version-setting .setting-value {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 500;
}

.version-icon-small {
    font-size: 20px;
}

.version-name-small {
    font-size: 14px;
}

.arrow {
    color: #b2bec3;
    font-size: 18px;
    margin-left: 5px;
}

select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    font-size: 1em;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: var(--primary);
}

/* ==================== 登录模态框优化样式 ==================== */
.login-modal {
    z-index: 2000;
    background: rgba(0,0,0,0.8);
}

.login-content {
    max-width: 420px;
    text-align: center;
    padding: 40px 35px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.login-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-header {
    margin-bottom: 30px;
}

.login-icon {
    font-size: 70px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
    display: block;
}

.login-header h2 {
    color: var(--dark);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.login-form {
    margin-bottom: 25px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.nickname-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    font-size: 18px;
    text-align: center;
    transition: all 0.3s;
    background: white;
    outline: none;
    color: var(--dark);
    font-weight: 500;
}

.nickname-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
    transform: translateY(-2px);
}

.nickname-input.error {
    border-color: var(--danger);
    animation: shake 0.5s;
}

.nickname-input.success {
    border-color: var(--success);
}

.input-hint {
    font-size: 13px;
    color: #999;
    margin: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.input-hint.error {
    color: var(--danger);
}

.input-hint.success {
    color: var(--success);
}

.char-counter {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #ccc;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
}

.btn-start {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-start:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-start:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #0066CC;
}

.btn-start.loading {
    color: transparent;
}

.btn-start.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-features {
    display: flex;
    justify-content: space-around;
    padding-top: 25px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.feature-item {
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.feature-item:hover {
    opacity: 1;
}

.feature-item span {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.feature-item p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.error-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--danger);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 导入导出样式优化 */
.import-content, .export-content, .conflict-content {
    max-width: 450px;
}

.import-warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #ffc107;
    text-align: left;
}

.import-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.import-option {
    flex: 1;
    padding: 25px 15px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.import-option:hover {
    border-color: var(--primary);
    background: #f0f0ff;
    transform: translateY(-2px);
}

.import-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.import-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

#import-textarea {
    resize: vertical;
    min-height: 120px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
}

#btn-confirm-import {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 16px;
}

#btn-confirm-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4);
}

.file-info {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1976d2;
    font-weight: 500;
}

/* 冲突对话框 */
.conflict-content {
    text-align: center;
}

.conflict-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.rename-area {
    margin-top: 15px;
}

.rename-area input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.rename-area input:focus {
    border-color: var(--primary);
}

/* 用户菜单 */
.user-menu-content {
    max-width: 400px;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
    padding-right: 5px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f5f5f5;
}

.user-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.user-item.current {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.user-avatar {
    font-size: 32px;
    margin-right: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.user-meta {
    font-size: 12px;
    color: #999;
}

.current-badge {
    background: #2196f3;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: auto;
}

.user-menu-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* 统计面板 */
.stats-content {
    max-width: 600px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 成就系统 */
.achievements-content {
    max-width: 600px;
}

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.achievements-progress {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.achievement-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border-color: var(--primary);
}

.achievement-card.locked {
    background: #f0f0f0;
    opacity: 0.7;
    filter: grayscale(0.5);
}

.achievement-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.achievement-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark);
}

.achievement-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.achievement-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.achievement-lock {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.5;
}

/* 每日目标设置 */
.goal-content {
    max-width: 400px;
}

.goal-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.goal-option {
    padding: 25px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.goal-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.goal-option.active {
    border-color: var(--primary);
    background: #f0f0ff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.goal-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.goal-option.active .goal-number {
    color: var(--primary);
}

.goal-unit {
    font-size: 14px;
    color: #999;
}

/* 庆祝动画 */
.celebration-content {
    text-align: center;
    padding: 50px 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 24px;
    max-width: 400px;
}

.celebration-animation {
    font-size: 70px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

/* 粒子效果 */
.particle {
    position: absolute;
    pointer-events: none;
    animation: particleFloat 1s ease-out forwards;
    border-radius: 50%;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

.toast-info {
    background: var(--primary);
    color: white;
}

/* 通关界面 */
.level-complete {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 24px;
}

.level-complete .trophy {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

.level-complete h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 28px;
}

.level-complete .stats {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.level-complete .stats p {
    margin: 10px 0;
    color: #4a5568;
    font-size: 16px;
}

/* 版本选择器 */
.version-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.version-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.version-option:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.version-option.selected {
    border-color: var(--success);
    background: #f0fff4;
}

.version-icon-big {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
}

.version-info {
    flex: 1;
    text-align: left;
}

.version-title {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
}

.version-desc {
    font-size: 13px;
    color: #718096;
}

.version-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 10px;
}

.version-option:not(.selected) .version-check {
    background: transparent;
    border: 2px solid #e0e0e0;
    color: transparent;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .word-collection, .level-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .login-content {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .menu-header h1 {
        font-size: 2em;
    }
    
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .card-word {
        font-size: 1em;
    }
    
    .card-meaning {
        font-size: 0.8em;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header .back-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    
    .goal-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .memory-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .word-collection, .level-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .word-collection, .level-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 专注模式提示 */
.focus-mode-badge {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 错误提示 */
.error-message {
    color: var(--danger);
    font-size: 1.2em;
    text-align: center;
    padding: 40px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}