/* 错题管理页面样式 */

/* 搜索面板 */
.search-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 30px;
    margin-bottom: 20px;
}

.search-container {
    margin-bottom: 25px;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: white;
}

.search-btn,
.ai-search-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-btn {
    background: linear-gradient(135deg, #3182ce, #2c5aa0);
    color: white;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46a2);
    transform: translateY(-2px);
}

.ai-search-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.ai-search-btn:hover {
    background: linear-gradient(135deg, #ed7bfb, #f24968);
    transform: translateY(-2px);
}

/* 筛选选项 */
.filter-options {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.tags-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 400px;
}

.filter-tag {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.filter-tag.active {
    opacity: 1;
    transform: scale(1.05);
}

.filter-clear-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* 视图控制 */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.view-modes {
    display: flex;
    gap: 5px;
}

.view-mode-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #4a5568;
}

.view-mode-btn:hover {
    background: rgba(49, 130, 206, 0.1);
    border-color: #3182ce;
}

.view-mode-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

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

/* 内容区域 */
.content-area {
    display: block !important; /* 覆盖 main.css 的三列网格，防止只占左侧300px */
    grid-template-columns: none !important;
    grid-auto-columns: unset !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 30px;
    min-height: 500px;
    overflow: hidden;
    /* 占满可用宽度 */
    width: 100% !important;
}

/* 列表视图 */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.question-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3182ce;
}

.question-item.selected {
    border-color: #3182ce;
    background: rgba(49, 130, 206, 0.05);
}

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

.question-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.subject-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-stars {
    color: #fbbf24;
    font-size: 14px;
}

.mastery-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.mastery-new { background: #dbeafe; color: #1e40af; }
.mastery-learning { background: #fef3c7; color: #92400e; }
.mastery-reviewing { background: #ecfccb; color: #365314; }
.mastery-mastered { background: #d1fae5; color: #065f46; }

.question-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-edit {
    background: #e0f2fe;
    color: #0277bd;
}

.action-review {
    background: #fff3e0;
    color: #ef6c00;
}

.action-delete {
    background: #ffebee;
    color: #c62828;
}

.action-btn:hover {
    transform: scale(1.05);
}

.question-content {
    margin-bottom: 15px;
}

.question-text {
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    margin-bottom: 10px;
}

.question-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.question-tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.question-stats {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #718096;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 卡片视图 */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.question-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    height: fit-content;
}

.question-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #3182ce;
}

.question-card .question-content {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.question-card .question-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 30px;
    width: 100%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
}

/* 看板视图 */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    height: 600px;
}

.kanban-column {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    padding: 15px;
    border: 2px dashed #e2e8f0;
    transition: all 0.3s ease;
}

.kanban-column.drag-over {
    border-color: #3182ce;
    background: rgba(49, 130, 206, 0.05);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.column-header h3 {
    font-size: 16px;
    color: #2d3748;
}

.column-header .count {
    background: #3182ce;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.column-content {
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-question {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    cursor: move;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.kanban-question:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.kanban-question.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* 时间线视图 */
.timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    left: 50px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3182ce, #2c5aa0);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 80px;
}

.timeline-dot {
    position: absolute;
    left: 41px;
    top: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3182ce;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timeline-date {
    font-size: 12px;
    color: #3182ce;
    font-weight: 500;
    margin-bottom: 8px;
}

/* 思维导图视图 */
.mindmap-container {
    height: 600px;
    position: relative;
}

.mindmap-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.mindmap-canvas {
    width: 100%;
    height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.mindmap-node {
    position: absolute;
    background: white;
    border: 2px solid #3182ce;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mindmap-node:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mindmap-node.root {
    background: #3182ce;
    color: white;
    font-weight: bold;
}

.mindmap-connection {
    position: absolute;
    height: 2px;
    background: #3182ce;
    transform-origin: left center;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.page-btn:hover {
    background: #f7fafc;
    border-color: #3182ce;
}

.page-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #718096;
    font-size: 14px;
}

/* 批量操作面板 */
.batch-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 20px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.batch-info {
    color: #4a5568;
    font-weight: 500;
}

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

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

/* 题目详情模态框 */
.question-detail {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-content {
    color: #4a5568;
    line-height: 1.6;
    font-size: 14px;
}

.detail-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.detail-image {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.detail-image:hover {
    transform: scale(1.05);
}

.question-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* 聚类结果 */
.cluster-results {
    max-height: 60vh;
    overflow-y: auto;
}

.cluster-group {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.cluster-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cluster-count {
    background: #3182ce;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.cluster-questions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cluster-question {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cluster-question:hover {
    border-color: #3182ce;
    background: rgba(49, 130, 206, 0.02);
}

/* 复选框样式 */
.question-checkbox {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 18px;
    height: 18px;
    accent-color: #3182ce;
}

.batch-mode .question-item {
    padding-left: 50px;
}

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #718096;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-state .btn {
    margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .filter-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .questions-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
    }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .view-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .view-modes {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .batch-panel {
        left: 10px;
        right: 10px;
        transform: none;
        flex-direction: column;
        gap: 10px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-line {
        left: 30px;
    }
    
    .timeline-dot {
        left: 21px;
    }
}

/* 滚动条样式 */
.questions-list::-webkit-scrollbar,
.column-content::-webkit-scrollbar,
.question-detail::-webkit-scrollbar {
    width: 6px;
}

.questions-list::-webkit-scrollbar-track,
.column-content::-webkit-scrollbar-track,
.question-detail::-webkit-scrollbar-track {
    background: transparent;
}

.questions-list::-webkit-scrollbar-thumb,
.column-content::-webkit-scrollbar-thumb,
.question-detail::-webkit-scrollbar-thumb {
    background: rgba(49, 130, 206, 0.3);
    border-radius: 3px;
}

.questions-list::-webkit-scrollbar-thumb:hover,
.column-content::-webkit-scrollbar-thumb:hover,
.question-detail::-webkit-scrollbar-thumb:hover {
    background: rgba(49, 130, 206, 0.5);
} 
/* ===============================
   卡通浅蓝主题覆盖（Management）
   =============================== */
.search-panel {
    border: var(--ctn-outline);
    border-radius: 18px;
    box-shadow: var(--ctn-shadow-md);
}
.content-area {
    border: var(--ctn-outline);
    border-radius: 20px;
    box-shadow: var(--ctn-shadow-md);
}
.question-item,
.question-card {
    border: 2px solid rgba(44,123,229,0.15);
    border-radius: 16px;
    background: #ffffff;
}
.kanban-column {
    border: 2px dashed rgba(44,123,229,0.25);
    background: rgba(238, 246, 255, 0.35);
}
.column-header .count {
    background: var(--ctn-primary);
    border: 2px solid rgba(44,123,229,0.35);
}
.page-btn {
    border: 2px solid rgba(44,123,229,0.2);
    border-radius: 12px;
}
.batch-panel {
    border: var(--ctn-outline);
    box-shadow: var(--ctn-shadow-md);
}
