* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90D9;
    --primary-light: #E8F4FD;
    --primary-dark: #357ABD;
    --accent-color: #5CB85C;
    --text-primary: #333;
    --text-secondary: #666;
    --bg-light: #F8FAFC;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.2rem 0;
    margin-bottom: 1.2rem;
}

.header .title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-align: center;
}

.header .title i {
    margin-right: 10px;
}

.language-switcher {
    text-align: center;
}

.switcher-label {
    font-size: 1rem;
    margin-right: 1rem;
    font-weight: 500;
}

.language-buttons {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.lang-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

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

.lang-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    box-shadow: var(--card-shadow);
}

.tab-btn i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.tab-btn span {
    font-size: 0.85rem;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--card-shadow-hover);
}

.phrases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.phrase-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
}

.phrase-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
}

.phrase-chinese {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.phrase-target {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    direction: ltr;
}

.phrase-romanization {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-style: italic;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-pronounce {
    background: var(--primary-light);
    color: var(--primary-color);
}

.btn-pronounce:hover {
    background: var(--primary-color);
    color: white;
}

.btn-copy {
    background: #f0f0f0;
    color: var(--text-primary);
}

.btn-copy:hover {
    background: var(--accent-color);
    color: white;
}

.btn-copy.copied {
    background: var(--accent-color);
    color: white;
}

.footer {
    background: var(--primary-light);
    padding: 1.5rem 0 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.2rem;
    text-align: left;
}

.footer-section {
    padding: 0 1rem;
}

.footer-section h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.3rem;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.footer-bottom .disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .header .title {
        font-size: 1.5rem;
    }
    
    .language-buttons {
        gap: 5px;
    }
    
    .lang-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
        min-width: 70px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        min-width: 70px;
    }
    
    .tab-btn i {
        font-size: 1.2rem;
    }
    
    .tab-btn span {
        font-size: 0.75rem;
    }
    
    .phrases-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .phrase-target {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .header .title {
        font-size: 1.3rem;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-width: 65px;
    }
    
    .category-tabs {
        justify-content: flex-start;
    }
    
    .tab-btn {
        min-width: 65px;
        padding: 10px 10px;
    }
    
    .tab-btn span {
        font-size: 0.7rem;
    }
}