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

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

#app {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.user-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 10px;
    min-width: 150px;
    z-index: 100;
}

.menu-btn {
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    text-align: left;
    transition: background 0.3s ease;
}

.menu-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

#userInfo p {
    margin: 0;
    padding: 10px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 12px;
    font-weight: 600;
}

nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.nav-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-btn:active {
    transform: scale(0.98);
}

main {
    padding: 20px;
    min-height: calc(100vh - 180px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.letter-filter {
    margin-bottom: 20px;
}

.letter-filter select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
}

.letter-filter select:focus {
    border-color: #667eea;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.word-index {
    background: #667eea;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.word-letter {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.card-body {
    text-align: center;
}

.meaning {
    font-size: 20px;
    font-weight: 500;
    color: #2d3436;
    margin-bottom: 15px;
    min-height: 40px;
    line-height: 1.5;
}

.speak-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.speak-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.6);
}

.speak-btn:active {
    transform: scale(0.95);
}

.input-field {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    border-color: #667eea;
}

.card-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn:active {
    transform: scale(0.98);
}

.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    display: block;
}

.feedback.wrong {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.feedback.answer {
    background: #d1ecf1;
    color: #0c5460;
    display: block;
}

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

.nav-arrow {
    width: 45px;
    height: 45px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-arrow:active {
    background: #667eea;
    color: #fff;
}

.nav-info {
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
}

.review-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.review-list p {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.review-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-word {
    font-weight: 600;
    color: #333;
}

.review-count {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

#progressChart {
    width: 100%;
    height: 200px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
}

.close-btn:hover {
    background: #e9ecef;
}

.modal-body {
    padding: 20px;
}

.auth-tip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #667eea;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

.form-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #6c757d;
}

.form-link a {
    color: #667eea;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

#authFeedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

#authFeedback.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

#authFeedback.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}