/* ============ 布局 ============ */
body {
  background-color: #f5f6fa;
}

.main-content {
  padding-top: 72px; /* 固定导航栏高度补偿 */
  min-height: 100vh;
}

.main-content.no-navbar {
  padding-top: 0;
}

.content-area {
  padding: 0 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.login-wrapper {
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

/* ============ 面包屑 ============ */
.breadcrumb-container {
  padding: 16px 0 8px;
}

.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #6c757d;
}

.breadcrumb-custom a {
  color: #6c757d;
  text-decoration: none;
}

.breadcrumb-custom a:hover {
  color: #0d6efd;
}

.breadcrumb-separator {
  color: #adb5bd;
}

/* ============ 系统消息 ============ */
.flash-messages {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  min-width: 320px;
  max-width: 600px;
}

/* ============ 题目展示:卡片视图 ============ */
.question-card,
.question-card-item {
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.question-card:hover,
.question-card-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.question-card.selected,
.question-card-item.selected,
tr.selected {
  border-color: #0d6efd;
  background-color: #f0f6ff;
}

.question-card-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.question-card-view .question-card-item {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* ============ 题目展示:表格视图 ============ */
.question-table {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.question-table th {
  white-space: nowrap;
  background: #f8f9fb;
}

.question-table .latex-content {
  max-height: 120px;
  overflow: hidden;
  cursor: pointer;
}

/* ============ 公式渲染 ============ */
.latex-code {
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: #f6f8fa;
  border-radius: 6px;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.latex-content {
  line-height: 1.7;
  overflow-x: auto;
}

.latex-content mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.latex-preview {
  min-height: 60px;
  background: #fff;
  border: 1px dashed #ced4da;
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  overflow-x: auto;
}

/* ============ 难度标签 ============ */
.difficulty-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.difficulty-badge.difficulty-easy {
  background: #d1e7dd;
  color: #0f5132;
}

.difficulty-badge.difficulty-medium {
  background: #fff3cd;
  color: #856404;
}

.difficulty-badge.difficulty-hard {
  background: #f8d7da;
  color: #842029;
}

/* ============ 交互:批量工具栏 ============ */
.batch-toolbar {
  position: sticky;
  top: 60px;
  z-index: 1020;
  background: #fff;
  border: 1px solid #0d6efd;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.12);
}

/* ============ 交互:视图切换 ============ */
.view-toggle {
  display: inline-flex;
  border: 1px solid #ced4da;
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle-btn {
  border: none;
  background: #fff;
  padding: 6px 14px;
  color: #495057;
  cursor: pointer;
}

.view-toggle-btn.active {
  background: #0d6efd;
  color: #fff;
}

/* ============ 标签 ============ */
.tag-badge {
  display: inline-block;
  background: #e7f1ff;
  color: #0a58ca;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 2px;
}

/* ============ 书签 ============ */
.bookmark-btn {
  cursor: pointer;
  color: #adb5bd;
  transition: color 0.15s;
}

.bookmark-btn:hover {
  color: #fd7e14;
}

.bookmark-btn.bookmarked {
  color: #fd7e14;
}

/* ============ 上下文菜单 ============ */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 6px 0;
  display: none;
}

.context-menu .context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu .context-menu-item:hover {
  background: #f0f6ff;
}

.context-menu .context-menu-item.text-danger:hover {
  background: #fff0f1;
}

/* ============ 统计卡片 ============ */
.stat-card {
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0d6efd;
}

.stat-card .stat-label {
  color: #6c757d;
  font-size: 0.9rem;
}

/* ============ CodeMirror ============ */
.CodeMirror {
  border: 1px solid #ced4da;
  border-radius: 6px;
  height: auto;
  min-height: 120px;
  font-size: 0.9rem;
}

/* ============ 图片预览 ============ */
.image-preview-thumb {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
}

.question-detail-image {
  max-width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}
