* {
    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;
}

.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 20px;
}

.page.active {
    display: block;
}

.container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

#loginPage h1,
#registerPage h1 {
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-link {
    background: none;
    color: #667eea;
    text-decoration: underline;
    margin-top: 10px;
}

#loginPage .btn-link,
#registerPage .btn-link {
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
}

.btn-large {
    padding: 15px;
    font-size: 18px;
    margin: 10px 0;
}

.btn-back {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.info-separator {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 4px;
}

.points {
    opacity: 0.9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.3s;
    background: none;
    border: none;
    padding: 0;
}

.header-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.link-separator {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 4px;
}

.nav-tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: white;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.course-list,
.word-list,
.record-list,
.item-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 确保课程列表中 section 内的课程项也有间距 */
.course-list > div {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.course-item,
.word-item,
.record-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.item-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 20px;
}

@media (max-width: 600px) {
    .item-item {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .item-item .item-image {
        width: 100px;
        height: 100px;
    }
}

.item-item .item-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-item .item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.item-item .item-content h3 {
    color: #667eea;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.item-item .item-description {
    color: #666;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-item .item-points {
    color: #333;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.item-item .item-points .points-value {
    color: #667eea;
    font-weight: 600;
    font-size: 18px;
}

.item-item .item-action {
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.course-item:hover,
.word-item:hover,
.record-item:hover,
.item-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.course-item h3 {
    color: #667eea;
    margin-bottom: 5px;
}

.course-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.course-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.course-status-badge.status-not-started {
    background-color: #e9ecef;
    color: #6c757d;
}

.course-status-badge.status-in-progress {
    background-color: #fff3cd;
    color: #856404;
}

.course-status-badge.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-item .word {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.word-item .pronunciation {
    color: #666;
    font-size: 14px;
}

/* 单词卡片样式 */
.word-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: all 0.3s;
}

.word-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.word-title {
    flex: 1;
}

.word-card .word {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.word-card .pronunciation {
    color: #666;
    font-size: 16px;
    font-family: 'Arial Unicode MS', 'Lucida Sans Unicode', 'DejaVu Sans', sans-serif;
    font-style: italic;
}

.audio-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.audio-btn:active {
    transform: scale(0.95);
}

.word-content {
    margin-top: 15px;
}

.word-card .meaning {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
}

.word-card .meaning strong {
    color: #667eea;
    margin-right: 5px;
}

.word-card .example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.word-card .example strong {
    color: #667eea;
    display: block;
    margin-bottom: 8px;
}

.example-translation {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

.word-card .word-image {
    margin-top: 15px;
    text-align: center;
}

.word-card .word-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-buttons {
    padding: 20px;
}

.progress {
    color: white;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 20px;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.word-detail h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.pronunciation {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.meaning {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #333;
}

.example {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.example p {
    margin-bottom: 5px;
}

.word-image {
    margin-top: 15px;
}

.word-image img {
    width: 100%;
    border-radius: 8px;
}

.test-content {
    padding: 20px;
}

.test-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.test-item h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.test-option:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.test-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.test-option.correct {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.test-option.wrong {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.study-actions,
.test-actions {
    padding: 20px;
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.record-detail {
    padding: 20px;
}

.record-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.record-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.record-info p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.detail-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-item.correct {
    border-left: 4px solid #28a745;
}

.detail-item.wrong {
    border-left: 4px solid #dc3545;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state::before {
    content: "📚";
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

