/* ==================== 模式选择界面 ==================== */
.mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    position: relative;
}

.settings-btn-home {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.settings-btn-home:hover {
    background: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mode-header {
    text-align: center;
    margin-bottom: 50px;
}

.mode-header h1 {
    font-size: 36px;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mode-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    max-width: 1200px;
    width: 100%;
}

.mode-card {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mode-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10B981;
}

.upload-icon {
    font-size: 80px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10B981;
}

.mode-title {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.mode-desc {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
}

/* ==================== 文件上传页面 ==================== */
.upload-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.upload-box {
    background: white;
    border-radius: 16px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
}



.upload-title {
    font-size: 24px;
    font-weight: bold;
    color: #111827;
    margin-bottom: 10px;
}

.upload-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 30px;
}

input[type="file"] {
    display: none;
}

.btn-upload {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    color: white;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-upload:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    filter: brightness(1.05);
}

/* ==================== 页面标题区域 ==================== */
.page-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    font-size: 14px;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.breadcrumb-item:hover {
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.breadcrumb-item.active {
    color: white;
    font-weight: 600;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    user-select: none;
}

.exam-count-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.exam-count-badge span {
    font-weight: 700;
    font-size: 16px;
}

/* ==================== 试卷列表/练习配置/自定义组卷容器 ==================== */
.exam-list-container,
.practice-config-container,
.custom-exam-container {
    padding: 25px 40px 40px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

.practice-config-container .breadcrumb,
.custom-exam-container .breadcrumb {
    margin-bottom: 20px;
}

.exam-list-header,
.custom-exam-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.exam-list-header::before,
.custom-exam-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #10B981 0%, #06B6D4 100%);
}

.exam-list-header h2,
.custom-exam-header h2 {
    font-size: 24px;
    color: #111827;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    margin-bottom: 10px;
}

.exam-list-info,
.custom-info {
    font-size: 14px;
    color: #6B7280;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #F0FDF4;
    border-radius: 20px;
    font-weight: 500;
}

.exam-list-info span,
.custom-info span {
    color: #059669;
    font-weight: 600;
}

/* ==================== 试卷列表 ==================== */
/* 工具栏 */
.exam-list-toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.exam-list-filters {
    display: flex;
    gap: 15px;
    flex: 1;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.filter-item label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-item select,
.filter-item input[type="text"] {
    padding: 8px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

.filter-item input[type="text"] {
    cursor: text;
}

.filter-item select:hover,
.filter-item input[type="text"]:hover {
    border-color: #10B981;
}

.filter-item select:focus,
.filter-item input[type="text"]:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* 视图切换按钮 */
.view-switcher {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding-left: 15px;
    border-left: 1px solid #E5E7EB;
}

.view-btn {
    padding: 8px 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #F9FAFB;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: #F3F4F6;
    color: #10B981;
    border-color: #E5E7EB;
}

.view-btn.active {
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    color: white;
    border-color: transparent;
}

.view-btn svg {
    display: block;
}

/* 网格视图 */
.exam-list-grid.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* 列表视图 */
.exam-list-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 试卷卡片 - 网格视图 */
.exam-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.exam-card:hover::before {
    opacity: 1;
}

.exam-card-header {
    margin-bottom: 0;
}

.exam-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
}

.exam-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.exam-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #F3F4F6;
}

.exam-card-question-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 500;
}

.exam-card-question-count .count-icon {
    font-size: 14px;
}

.exam-card-question-count .count-text {
    color: #6B7280;
    font-weight: 600;
}
    gap: 6px;
    white-space: nowrap;
}

/* 列表视图特殊样式 */
.view-list .exam-card {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px 25px;
}

.view-list .exam-card-header {
    flex: 1;
    margin-bottom: 0;
}

.view-list .exam-card-title {
    margin-bottom: 8px;
    -webkit-line-clamp: 1;
}

.view-list .exam-card-meta {
    margin-bottom: 0;
}

.view-list .exam-card-footer {
    padding-top: 0;
    border-top: none;
    min-width: 150px;
    justify-content: flex-end;
}

.view-list .exam-card:hover {
    transform: translateX(4px);
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 1024px) {
    .exam-list-grid.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .view-list .exam-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-list .exam-card-footer {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .settings-btn-home {
        width: 44px;
        height: 44px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
    
    .exam-list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .exam-list-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-item {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .filter-item label {
        font-size: 12px;
    }
    
    .view-switcher {
        padding-left: 0;
        border-left: none;
        padding-top: 15px;
        border-top: 1px solid #E5E7EB;
        width: 100%;
        justify-content: center;
    }
    
    .exam-list-grid.view-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-mode-tab {
        padding: 11px 14px;
        font-size: 13px;
    }
}

.custom-exam-config {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==================== 题库练习：统一白卡 ==================== */
.practice-config-body {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* 题库练习：顶部标题条 + 来源工具条 */
.practice-config-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 24px 16px;
    border-bottom: 1px solid #F3F4F6;
    position: relative;
}

.practice-config-topbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #10B981 0%, #06B6D4 100%);
    border-radius: 12px 12px 0 0;
}

.practice-config-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.practice-config-title svg {
    color: #10B981;
}

/* 来源工具条 */
.practice-source-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.source-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-filter-select {
    padding: 6px 10px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    max-width: 160px;
}

.source-filter-select:hover,
.source-filter-select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* 自定义多选下拉 */
.exam-multiselect {
    position: relative;
}

.exam-multiselect-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 220px;
    min-width: 140px;
}

.exam-multiselect-trigger:hover,
.exam-multiselect-trigger:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.exam-multiselect-trigger span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.exam-multiselect-trigger svg {
    flex-shrink: 0;
    color: #9CA3AF;
    transition: transform 0.2s;
}

.exam-multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 280px;
    max-width: 380px;
    background: white;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
}

.exam-multiselect-toolbar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #F3F4F6;
    background: #FAFAFA;
}

.exam-multiselect-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 8px;
}

.exam-multiselect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-multiselect-item:hover {
    background: #F0FDF4;
}

.exam-multiselect-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #10B981;
}

.exam-multiselect-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

@media (max-width: 768px) {
    .practice-config-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .practice-source-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .source-filter-item {
        width: 100%;
    }

    .source-filter-select,
    .exam-multiselect,
    .exam-multiselect-trigger {
        width: 100% !important;
        max-width: 100% !important;
    }

    .exam-multiselect-dropdown {
        width: 100%;
        right: auto;
        left: 0;
    }
}

/* 练习模式 Tab 导航 */
.practice-mode-tabs {
    display: flex;
    gap: 0;
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid #E5E7EB;
}

.practice-mode-tab {
    padding: 13px 22px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.practice-mode-tab:hover {
    color: #10B981;
    background: #F9FAFB;
}

.practice-mode-tab.active {
    color: #10B981;
    border-bottom-color: #10B981;
}

/* Tab 内容区（无嵌套白盒） */
.practice-mode-tab-content {
    /* 无独立阴影，融入外层卡片 */
}

.tab-settings {
    padding: 24px 24px 0;
}

.tab-footer {
    padding: 20px 24px 24px;
}

.tab-footer .btn-primary {
    width: 100%;
}

/* 紧凑配置行 */
.config-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.config-hint {
    font-size: 13px;
    color: #9CA3AF;
}

/* AI 生成提示区 */
.ai-generate-hint {
    background: linear-gradient(135deg, #F0FDF4 0%, #EFF6FF 100%);
    border: 1px solid #D1FAE5;
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 14px;
    color: #374151;
    line-height: 1.8;
}

.ai-generate-hint strong {
    color: #059669;
}

.ai-hint-note {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: #6B7280;
    background: rgba(255,255,255,0.6);
    border-radius: 6px;
    padding: 5px 10px;
}

/* AI 出题：题型勾选行 */
.ai-type-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.ai-type-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.ai-type-row:has(input[type="checkbox"]:checked) {
    border-color: #10B981;
    background: #F0FDF4;
}

.ai-type-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    min-width: 90px;
}

.ai-type-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #10B981;
    flex-shrink: 0;
}

.ai-type-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-type-count {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.ai-type-count input[type="number"] {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.2s;
}

.ai-type-count input[type="number"]:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* 未勾选时灰化数量输入 */
.ai-type-row:has(input[type="checkbox"]:not(:checked)) .ai-type-count {
    opacity: 0.35;
    pointer-events: none;
}

/* AI 生成状态消息 */
.ai-generate-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.ai-status-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.ai-status-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.config-group {
    margin-bottom: 20px;
}

.config-group:last-child {
    margin-bottom: 0;
}

.config-group input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
}

/* ==================== 自定义组卷 ==================== */
.config-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #E5E7EB;
}

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

.config-section h3 {
    font-size: 18px;
    color: #111827;
    margin-bottom: 15px;
}

.exam-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.practice-exam-hint {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
    margin-left: 4px;
}

.exam-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F9FAFB;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.exam-checkbox-item:hover {
    background: #F3F4F6;
}

.exam-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.quick-select {
    display: flex;
    gap: 10px;
}

.type-count-hint {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 15px;
    padding: 10px 12px;
    background: #F0FDF4;
    border-left: 3px solid #10B981;
    border-radius: 4px;
}

.question-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.type-count-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 2px solid transparent;
    white-space: nowrap;
}

.type-count-item:hover {
    background: #F3F4F6;
    border-color: #10B981;
}

.type-count-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.type-count-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.type-count-input {
    width: 55px;
    padding: 4px 6px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.type-count-item input[type="checkbox"]:not(:checked) ~ .type-count-input {
    opacity: 0.4;
    pointer-events: none;
}

#question-type-filters {
    display: block;
}

/* ==================== AI 历史记录列表 ==================== */

.ai-history-loading,
.ai-history-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9CA3AF;
}

.ai-history-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ai-history-empty .empty-text {
    font-size: 16px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 6px;
}

.ai-history-empty .empty-hint {
    font-size: 13px;
    color: #9CA3AF;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.6;
}

.ai-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E5E7EB;
}

.ai-history-count {
    font-size: 13px;
    color: #6B7280;
}

.ai-history-count strong {
    color: #374151;
}

.btn-danger-text {
    color: #EF4444 !important;
}

.btn-danger-text:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
}

.ai-history-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ai-history-item:hover {
    border-color: #10B981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.ai-history-item-main {
    flex: 1;
    min-width: 0;
}

.ai-history-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ai-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.ai-type-badge.badge-mcq {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
}

.ai-type-badge.badge-fill {
    background: linear-gradient(135deg, #FCE7F3, #FBCFE8);
    color: #BE185D;
}

.ai-type-badge.badge-mixed {
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
    color: #6D28D9;
}

.ai-history-title-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-history-item-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #9CA3AF;
    flex-wrap: wrap;
}

.ai-history-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    padding: 5px 8px !important;
    font-size: 14px;
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #9CA3AF;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #EF4444;
}

@media (max-width: 600px) {
    .ai-history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-history-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
