/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* 登录页面 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-info {
    margin-bottom: 1rem;
    color: #666;
}

.login-form {
    margin-top: 1.5rem;
}

/* 仪表盘 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.dashboard-actions {
    margin-bottom: 2rem;
}

.dashboard-actions .btn {
    margin-right: 1rem;
}

/* 文件表格 */
.file-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-table th,
.file-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.file-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 学习页面 */
.study-container {
    max-width: 800px;
    margin: 0 auto;
}

.mode-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.word-card {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.word-card:hover {
    background-color: #f0f0f0;
}

.word-card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.chinese {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.english {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
}

.progress {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.1rem;
    color: #666;
}

.study-actions {
    text-align: center;
    margin-top: 2rem;
}

.study-actions .btn {
    margin: 0 0.5rem;
}

.draw-input {
    text-align: center;
    margin: 1rem 0;
}

.draw-input input {
    width: 100px;
    margin: 0 0.5rem;
}

/* 易错词列表 */
.fault-words-list {
    margin: 2rem 0;
}

.fault-word-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-content {
    flex-grow: 1;
}

.word-meta {
    font-size: 0.9rem;
    color: #666;
    margin-right: 1rem;
}

.fault-words-actions {
    text-align: center;
    margin-top: 2rem;
}

/* 消息样式 */
.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 上传页面 */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.upload-info ul {
    margin-left: 1.5rem;
}

.upload-result {
    margin-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        margin-top: 1rem;
    }

    .mode-buttons {
        flex-direction: column;
    }

    .fault-word-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .word-meta {
        margin: 0.5rem 0;
    }
}

/* 预置单词表样式 */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.preset-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.preset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.preset-card h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.preset-card p {
    margin: 0.5rem 0;
    color: #666;
}

/* 进度输入框样式 */
#currentProgress {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.9rem;
    margin: 0 2px;
}

#currentProgress:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.progress-jump-btn {
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.progress-jump-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}


/* 进度输入框样式 */
.progress-input {
    width: 60px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 4px;
    transition: var(--transition);
    background: white;
}

.progress-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.progress-jump-btn {
    margin-left: 10px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-jump-btn:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.progress-jump-btn:active {
    transform: translateY(0);
}