/* ============================================
   题库管理页面美化样式
   现代简约风格
   ============================================ */

/* ============================================
   页面标题
   ============================================ */
#questions h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

#questions h1::before {
    content: "📚";
    font-size: 32px;
}

/* ============================================
   添加题目区域
   ============================================ */
#questions .section {
    background: white;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#questions .section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#questions .section h3::before {
    content: "✏️";
}

/* ============================================
   表单行布局
   ============================================ */
.question-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.question-form-row .form-group {
    margin-bottom: 0;
}

.question-form-row .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.question-form-row .form-group label .icon {
    font-size: 16px;
}

/* ============================================
   下拉框美化
   ============================================ */
.question-form-row select,
.filter-row select {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: #334155;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.question-form-row select:hover,
.filter-row select:hover {
    border-color: #3b82f6;
}

.question-form-row select:focus,
.filter-row select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* ============================================
   富文本编辑区
   ============================================ */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.editor-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

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

.editor-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-panel-title .icon {
    font-size: 16px;
}

.latex-hint {
    font-size: 11px;
    color: #94a3b8;
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.editor-textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    resize: vertical;
    transition: all 0.25s ease;
}

.editor-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.editor-textarea::placeholder {
    color: #94a3b8;
}

/* ============================================
   预览区
   ============================================ */
.preview-panel {
    height: 100%;
    min-height: 180px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 14px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: #1e293b;
}

.preview-panel.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a8936a;
}

.preview-panel.empty .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* ============================================
   上传区域
   ============================================ */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.upload-card {
    padding: 28px 24px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-card.image-upload {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px dashed #3b82f6;
}

.upload-card.image-upload:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.upload-card.doc-upload {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px dashed #22c55e;
}

.upload-card.doc-upload:hover {
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.image-upload .upload-title {
    color: #1d4ed8;
}

.doc-upload .upload-title {
    color: #15803d;
}

.upload-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.upload-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   上传按钮
   ============================================ */
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn.primary {
    background: #3b82f6;
    color: white;
}

.upload-btn.primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.upload-btn.secondary {
    background: #7c3aed;
    color: white;
}

.upload-btn.secondary:hover {
    background: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.upload-btn.success {
    background: #22c55e;
    color: white;
}

.upload-btn.success:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ============================================
   答案区域
   ============================================ */
.answer-section {
    margin-bottom: 24px;
}

.answer-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
}

.answer-options {
    display: flex;
    gap: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.answer-option:hover {
    background: rgba(59, 130, 246, 0.1);
}

.answer-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
}

.answer-option span {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.answer-option input[type="text"] {
    width: 200px;
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.answer-option input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ============================================
   提交按钮
   ============================================ */
.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn.saving {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   筛选区域
   ============================================ */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #1d4ed8 100%);
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.3);
}

.filter-row .form-group label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-row select,
.filter-row input {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-row select:focus,
.filter-row input:focus {
    background: white;
    border-color: white;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn.search {
    background: white;
    color: #1e40af;
}

.filter-btn.search:hover {
    background: #fef08a;
    transform: translateY(-1px);
}

.filter-btn.reset {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* ============================================
   统计卡片
   ============================================ */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.stat-icon.yellow {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
}

/* ============================================
   题目卡片
   ============================================ */
.question-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.25s ease;
}

.question-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.tag {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag.subject {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}

.tag.grade {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #7c3aed;
}

.tag.type {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.tag.difficulty {
    color: white;
}

.tag.difficulty.easy {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.tag.difficulty.medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tag.difficulty.hard {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.tag.status {
    color: white;
}

.tag.status.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tag.status.approved {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.question-content {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.question-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

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

.option-label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #475569;
}

.option-item.correct .option-label {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.option-text {
    flex: 1;
    font-size: 14px;
    color: #334155;
}

.correct-badge {
    color: #22c55e;
    font-weight: 700;
    font-size: 18px;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 12px;
}

.question-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

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

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

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.action-btn.preview {
    background: #f1f5f9;
    color: #475569;
}

.action-btn.preview:hover {
    background: #e2e8f0;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.action-btn.edit:hover {
    background: #bfdbfe;
}

.action-btn.approve {
    background: #dcfce7;
    color: #15803d;
}

.action-btn.approve:hover {
    background: #bbf7d0;
}

.action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.delete:hover {
    background: #fecaca;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: #94a3b8;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 1fr;
    }

    .upload-container {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .question-form-row {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .answer-options {
        flex-direction: column;
        gap: 10px;
    }

    .question-options {
        grid-template-columns: 1fr;
    }
}
