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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.home-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.home-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.home-footer a:hover {
    color: white;
    text-decoration: underline;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.4;
}

.category-count {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
}

/* 学习页样式 */
.study-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-2px);
}

.breadcrumb {
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.study-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.word-card {
    margin-bottom: 40px;
}

.word-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.word-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.word-nav-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-nav-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.word-nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.english-word {
    font-size: 4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.pronunciation-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pronunciation-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pronunciation-btn:disabled {
    background: #5a6fd8;
    cursor: not-allowed;
    opacity: 0.7;
}

.chinese-meaning {
    font-size: 1.5rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-weight: 500;
}

.example-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.example-header {
    margin-bottom: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.example-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.example-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.example-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.example-number {
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.example-pronunciation-btn {
    background: #28a745;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.example-pronunciation-btn:hover {
    background: #218838;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.example-pronunciation-btn:disabled {
    background: #218838;
    cursor: not-allowed;
    opacity: 0.7;
}

.english-example {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-style: italic;
}

.chinese-example {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.navigation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.nav-btn {
    background: #667eea;
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.nav-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress-indicator {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.modal-text {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.modal-btn.primary {
    background: #667eea;
    color: white;
}

.modal-btn.primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.modal-btn.secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-btn.secondary:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.category-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    text-align: left;
}

.category-item {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.category-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .study-content {
        padding: 25px;
    }
    
    .english-word {
        font-size: 3rem;
    }
    
    .word-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .word-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .word-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .english-word {
        font-size: 2.5rem;
    }
    
    .word-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .study-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .example-header {
        text-align: center;
    }
    
    .example-item {
        padding: 12px;
    }
    
    .example-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .example-pronunciation-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .english-example {
        font-size: 1.1rem;
    }
    
    .chinese-example {
        font-size: 1rem;
    }
}
