* {
    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;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #667eea;
    color: white;
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 设置区域 */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.settings-section h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* 表单元素 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="range"] {
    width: 100%;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input {
    width: auto;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.status-msg {
    margin-left: 1rem;
    color: #4caf50;
    font-weight: 500;
}

/* 词库信息 */
.wordbank-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wordbank-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.wordbank-name {
    font-weight: 500;
}

.wordbank-count {
    color: #667eea;
    font-weight: bold;
}

/* 词卡 */
.word-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.word-card .word {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.word-card .meaning {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.button-group .btn {
    min-width: 120px;
}

.btn-known {
    background: #4caf50;
    color: white;
}

.btn-known:hover {
    background: #45a049;
}

.btn-unknown {
    background: #f44336;
    color: white;
}

.btn-unknown:hover {
    background: #da190b;
}

/* 进度条 */
.progress-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-bar span {
    color: white;
    font-weight: 500;
}

/* 输入框 */
.input-box {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.input-box:focus {
    outline: none;
    border-color: #667eea;
}

/* 反馈区域 */
.feedback {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.feedback.correct {
    border-left: 4px solid #4caf50;
}

.feedback.incorrect {
    border-left: 4px solid #f44336;
}

.feedback h3 {
    margin-bottom: 0.5rem;
    color: #667eea;
}

/* 统计 */
.stats {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
}

.stat-item .value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-item .label {
    color: #666;
    margin-top: 0.5rem;
}

/* 响应式 */
@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        margin: 1rem auto;
    }
    
    .word-card .word {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
    }
}

/* 隐藏类 */
.hidden {
    display: none;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: white;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 正确答案显示 */
.correct-answer {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.correct-answer .label {
    color: #4caf50;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.correct-answer .answer {
    font-size: 1.5rem;
    color: #2e7d32;
    font-weight: bold;
}
