/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #2563eb;
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* 主内容区域 */
.main-content {
    padding: 40px 0;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 35px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #fefefe;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: white;
}

.form-group input[type="submit"] {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="submit"]:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 听写设置区域 */
.dictation-settings {
    margin-bottom: 40px;
}

.setting-group {
    margin-bottom: 35px;
    padding: 25px;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.setting-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #fefefe;
    box-sizing: border-box;
}

.setting-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: white;
}

.setting-group h3 {
    margin-bottom: 20px;
    color: #2563eb;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-buttons, .order-buttons {
    display: flex;
    gap: 18px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.mode-buttons .btn,
.order-buttons .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
}

/* 学习统计样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 42px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 18px;
    font-weight: 500;
    color: white;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 滑块样式 */
.slider-container {
    margin: 25px 0 30px;
    padding: 0 10px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #2563eb 0%, #60a5fa 100%);
    outline: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    position: relative;
}

.slider:hover {
    opacity: 1;
    height: 10px;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 听写界面 */
.dictation-area {
    text-align: center;
    margin-bottom: 40px;
    background-color: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.word-display {
    font-size: 56px;
    font-weight: bold;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.word-display:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

.answer-input {
    margin-bottom: 30px;
}

.answer-input input {
    padding: 20px;
    font-size: 28px;
    width: 90%;
    max-width: 600px;
    text-align: center;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.answer-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e5e7eb;
    border-radius: 12px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* 成绩展示 */
.score-display {
    text-align: center;
    margin: 40px 0;
    background-color: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.score-display h2 {
    color: #10b981;
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: bold;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.3s ease;
}

.table th {
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background-color: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

/* 错误和成功消息 */
.error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
    font-weight: 500;
}

.success {
    background-color: #f0fdf4;
    color: #059669;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1);
    font-weight: 500;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1f2937, #374151);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
        padding: 10px 20px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    nav ul {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-wrap: nowrap;
        justify-content: center;
        overflow-x: auto;
    }
    
    nav ul li {
        border-right: none;
    }
    
    nav ul li a {
        font-size: 14px;
        padding: 6px 10px;
        white-space: nowrap;
    }
    
    .mode-buttons, .order-buttons {
        flex-direction: column;
    }
    
    .word-display {
        font-size: 36px;
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .answer-input input {
        width: 100%;
        font-size: 22px;
        padding: 16px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .card {
        padding: 25px;
    }
    
    .stat-card {
        padding: 25px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .table th,
    .table td {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dictation-area {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 6px;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        justify-content: center;
        overflow-x: auto;
    }
    
    nav ul li {
        border-right: none;
    }
    
    nav ul li a {
        font-size: 12px;
        padding: 5px 8px;
        white-space: nowrap;
    }
    
    .word-display {
        font-size: 28px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .answer-input input {
        font-size: 18px;
        padding: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}