/* 学习通作业助手 - 样式文件 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.login-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.login-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.cookie-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

.cookie-notice p {
    color: #f57c00;
    margin-bottom: 10px;
}

.cookie-notice details {
    margin-top: 10px;
}

.cookie-notice summary {
    color: #667eea;
    cursor: pointer;
    font-weight: 500;
}

.cookie-notice ol {
    margin-top: 10px;
    padding-left: 20px;
    color: #555;
}

.cookie-notice li {
    margin: 5px 0;
}

.login-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: #e0e0e0;
    box-shadow: none;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
}

.homework-list {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.homework-list h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    font-size: 13px;
    padding: 8px 16px;
}

.homework-item {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.homework-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.homework-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.homework-course {
    font-size: 13px;
    color: #667eea;
    background: #f0f2ff;
    padding: 4px 10px;
    border-radius: 20px;
}

.homework-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.homework-actions {
    display: flex;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-done {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-overdue {
    background: #ffebee;
    color: #c62828;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    display: block;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.answer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.question-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.question-box h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.question-box p {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.answer-box {
    background: #f0f2ff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.answer-box h4 {
    font-size: 14px;
    color: #667eea;
    margin-bottom: 10px;
}

.answer-box p {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.answer-actions {
    display: flex;
    gap: 10px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.error {
    color: #c62828;
    text-align: center;
    padding: 20px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .login-form {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .homework-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .homework-actions {
        flex-wrap: wrap;
    }
}
