/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', '微软雅黑', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 头部样式 */
.header {
    background: transparent;
    padding: 10px 20px;
    box-shadow: none;
    z-index: 100;
}

.header h1 {
    text-align: center;
    color: white;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 管理员入口样式 */
.admin-trigger {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-dot {
    width: 5px;
    height: 5px;
    background: #764ba2;
    border-radius: 50%;
}

/* 管理员模态框 */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.admin-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.admin-modal h3 {
    color: #764ba2;
    margin-bottom: 20px;
    font-size: 18px;
}

.admin-password-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
}

.admin-password-input:focus {
    border-color: #764ba2;
}

.admin-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.admin-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-btn-confirm:hover {
    transform: scale(1.05);
}

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

.admin-btn-cancel:hover {
    background: #d0d0d0;
}

/* 进度条 */
.progress-bar {
    background: #e0e0e0;
    height: 6px;
    border-radius: 3px;
    margin: 8px 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 主容器 */
.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 10px calc(10px - 38px);
    position: relative;
}

/* 卡片容器 */
.card-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 65vh;
    min-height: 400px;
    perspective: 1000px;
    z-index: 10;
    margin-top: 20px;
    margin-bottom: 0;
}

/* 单词卡片 */
.word-card {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.5s ease;
    transform: translateY(-19px);
}

/* 卡片滑入动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* 单词序号 */
.word-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

/* 主单词部分 */
.word-main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.word-main {
    font-size: 42px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0;
    line-height: 1.1;
}

.word-type {
    font-size: 16px;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* 音标部分 */
.phonetic-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.phonetic-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.phonetic-container:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.phonetic {
    font-size: 18px;
    color: white;
    font-weight: 500;
}

.audio-icon {
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #f5576c;
    animation: pulse 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 翻译部分 */
.translation-section {
    text-align: center;
}

.translation {
    font-size: 22px;
    color: #34495e;
    background: linear-gradient(135deg, #c3e8fa 0%, #d9f0ff 100%);
    padding: 12px 30px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    max-width: 90%;
}

/* 词形变化部分 */
.word-forms-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    padding: 0 40px;
}

.word-form {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    padding: 10px 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.word-form:hover {
    transform: translateY(-3px);
}

.word-form-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.word-form-value {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
}

/* 导航控制 */
.navigation {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    position: absolute;
    bottom: 50px;
    padding: 0 30px;
}

.nav-arrow {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.nav-arrow:active {
    transform: scale(0.95);
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    padding-bottom: 10px;
}

.control-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #764ba2;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-btn.favorite.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 旋转动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-container {
        height: 70vh;
        min-height: 350px;
    }
    
    .word-main {
        font-size: 36px;
    }
    
    .translation {
        font-size: 20px;
    }
    
    .word-forms-section {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }
    
    .phonetic {
        font-size: 16px;
    }
    
    .word-form {
        padding: 8px 12px;
    }
    
    .word-form-label {
        font-size: 11px;
    }
    
    .word-form-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .word-main {
        font-size: 28px;
    }
    
    .translation {
        font-size: 18px;
        padding: 10px 20px;
    }
    
    .word-forms-section {
        gap: 10px;
        padding: 0 15px;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}