/* 全局样式 */
:root {
    --primary-color: #4299E1; /* TailwindCSS蓝色 */
    --primary-hover: #3182CE;
    --secondary-color: #48BB78; /* TailwindCSS绿色 */
    --accent-color: #F6AD55; /* TailwindCSS橙色 */
    --text-color: #2D3748;
    --light-text: #718096;
    --background-color: #EBF8FF;
    --card-background: #FFFFFF;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
}

/* 动画效果 */
.feature-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 120px;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.icon-container {
    transition: all 0.3s ease;
}

.feature-card:hover .icon-container {
    transform: scale(1.1);
}

/* 自定义样式覆盖Tailwind */
.book-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .feature-card {
        height: 100px;
    }
    
    .grid {
        gap: 0.5rem;
    }
    
    h3 {
        font-size: 0.875rem;
    }
}

/* 底部导航栏活跃状态 */
.nav-active {
    color: var(--primary-color);
}

/* 模态框动画 */
#bookSelectorModal {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#bookSelectorModal.show {
    opacity: 1;
    display: flex !important;
}

/* 儿童友好的按钮样式 */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

/* 进度条动画 */
.bg-green-500 {
    transition: width 1s ease-in-out;
}

/* 卡片翻转动画 (用于单词卡片) */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 功能卡片样式 */
.feature-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 图标容器过渡效果 */
.icon-container {
    transition: all 0.3s ease;
}

.feature-card:hover .icon-container {
    transform: scale(1.1);
}

/* 书籍图标样式 */
.book-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 教材选择弹窗动画 */
#bookSelectorModal {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#bookSelectorModal.show {
    opacity: 1;
}

/* 徽章样式 */
.count-badge {
    font-size: 10px;
}

/* 音频播放相关样式 */
.audio-item {
    transition: all 0.2s ease;
}

.audio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.play-btn, .audio-icon {
    transition: all 0.2s ease;
}

.play-btn:hover {
    background-color: rgba(244, 114, 182, 0.2);
    transform: scale(1.1);
}

/* 底部播放器滑动动画 */
#audio-player {
    transition: transform 0.3s ease;
}

/* 进度条滑动动画 */
#progress-bar {
    transition: width 0.1s linear;
}

/* 按钮交互效果 */
#play-pause-btn, #prev-btn, #next-btn, #repeat-btn {
    transition: all 0.2s ease;
}

#play-pause-btn:hover, #prev-btn:hover, #next-btn:hover, #repeat-btn:hover {
    transform: scale(1.1);
}

/* 分类选项卡交互效果 */
.category-tab {
    transition: all 0.2s ease;
    position: relative;
}

.category-tab:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: rgb(236, 72, 153);
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.category-tab:hover:after {
    width: 30%;
}

.category-tab.active:after {
    width: 100%;
}

/* 懒加载相关样式 */
.audio-item.loading {
    opacity: 0;
    transition: opacity 0.5s ease;
    position: relative;
}

.audio-item.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border-radius: 50%;
    border: 3px solid rgba(244, 114, 182, 0.2);
    border-top-color: rgba(244, 114, 182, 0.8);
    animation: spinner 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-item.loading:hover::before {
    opacity: 1;
}

@keyframes spinner {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.audio-item.loaded {
    opacity: 1;
}

/* 字母详情模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 0.5rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* 音标详情弹出层样式 */
.phonetic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phonetic-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.phonetic-modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 0.5rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.phonetic-modal-overlay.active .phonetic-modal-content {
    transform: scale(1);
} 