/* 归鸿AI课后拓展复习网 - 全局样式 */

/* 基础样式 */
:root {
    --primary-color: #1890ff;
    --secondary-color: #0050b3;
    --success-color: #52c41a;
    --danger-color: #ff4d4f;
    --warning-color: #faad14;
    --info-color: #13c2c2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: #333;
}

/* 课程卡片 */
.course-card {
    overflow: hidden;
}

.course-card img {
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s;
}

.course-card:hover img {
    transform: scale(1.05);
}

/* 功能卡片 */
.feature-card {
    border-radius: 16px;
}

.feature-icon {
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* 统计数字 */
.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #40a9ff 0%, #096dd9 100%);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination .current {
    background: var(--primary-color);
    color: #fff;
}

.pagination .prev, .pagination .next {
    background: #f8f9fa;
}

.pagination .ellipsis {
    color: #999;
}

/* 积分显示 */
.points-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    color: #333;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

.page-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    opacity: 0.9;
}

/* 侧边栏 */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.sidebar-menu a i {
    width: 24px;
    margin-right: 10px;
}

/* 题目卡片 */
.question-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.question-content {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.question-option {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.question-option:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.question-option.selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.question-option.correct {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

.question-option.wrong {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

/* AI对话样式 */
.chat-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    gap: 10px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.user .avatar {
    background: var(--primary-color);
    color: white;
}

.chat-message.ai .avatar {
    background: var(--secondary-color);
    color: white;
}

.chat-message .content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    line-height: 1.5;
}

.chat-message.user .content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.ai .content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 2px;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #eee;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stat-item h3 {
        font-size: 1.8rem;
    }
    
    .page-header {
        padding: 1.5rem 0;
        border-radius: 0 0 12px 12px;
    }
    
    .chat-message .content {
        max-width: 85%;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* 表格样式 */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #333;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 徽章 */
.badge {
    padding: 4px 8px;
    font-weight: 500;
}

.badge-easy {
    background: #28a745;
}

.badge-medium {
    background: #ffc107;
    color: #333;
}

.badge-hard {
    background: #dc3545;
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
