
/* 整体页面美化 */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: calc(100vh - 80px); /* 减去导航栏高度 */
    height: auto;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    .sidebar {
        max-height: 280px;
    }
}

/* 侧边栏样式 */
.sidebar {
    display: none;
}

/* 导航分类按钮 */
#categoryNav {
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#categoryNav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

#categoryNav .category-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    font-size: 80%;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#categoryNav .category-item:hover {
    background: #c7d2fe;
    color: #312e81;
}

#categoryNav .category-item.active {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}


.sidebar h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.sidebar h2 i {
    margin-right: 0.5rem;
    color: #6366f1;
}

/* 侧边栏分类项目样式（已隐藏，已有nav样式） */
.sidebar .category-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
}

.sidebar .category-item:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(99, 102, 241, 0.2);
}

.sidebar .category-item.active {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-left: 4px solid #4f46e5;
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.2);
    transform: translateX(5px);
}

/* 内容区域样式 */
.content-area {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow-y: auto; /* 允许垂直滚动 */
    max-height: 100%;
    /* scroll-margin-top: 90px; */
}

.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.category-description {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

/* 题目卡片样式 */
.question-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.question-card .question-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-content {
    flex: 1 1 auto;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
    font-weight: 500;
}

.difficulty-badge {
    flex: 0 0 auto;
    min-width: auto;
    margin-left: 1rem;
}

.question-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: #d1d5db;
}

.question-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
    /* margin-bottom: 1.5rem; */
    font-weight: 500;
}

/* 选项样式 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.option-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-item.selected {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 600;
}

.option-item.correct {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #16a34a;
    color: #166534;
}

.option-item.incorrect {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    border-color: #dc2626;
    color: #991b1b;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 1000px;
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 难度标签样式 */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
}

.badge-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.badge-medium {
    background: linear-gradient(135deg, #dcfce7 0%, #fed7aa 100%);
    color: #9a3412;
    border: 1px solid #fdba74;
}

.badge-danger {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

/* 解析面板样式 */
.analysis-panel {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    transition: all 0.2s ease;
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
}

.analysis-panel h4 {
    margin: 0 0 0.5rem;
    color: #1f2937;
}

.analysis-panel .analysis-content {
    color: #334155;
}

.analysis-panel .answer-pill {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    border-left: 4px solid #16a34a;
    background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    font-weight: 600;
}


/* 进度条样式 */
.progress-bar {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

@media (max-width: 768px) {
    .sticky {
        position: relative;
        top: 0;
    }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.back-to-top i {
    font-size: 1.2rem;
}

table, th, td {
  border: 1px solid black;
  text-align: center;
  font-size: 14px;
}
