* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f6fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  padding: 30px 0;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

/* ===== 导航栏 ===== */
.nav-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-bar .nav-item,
.nav-bar .nav-link {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #4A90E2;
  text-decoration: none;
  background: #f0f7ff;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.nav-bar .nav-item:hover,
.nav-bar .nav-link:hover {
  background: #e1edff;
  transform: translateY(-1px);
}

.nav-bar .nav-item.active {
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.nav-bar .nav-icon {
  font-size: 16px;
}

/* 错题本视图下，错题本卡片占满 */
#mistookBookCard {
  min-height: 60vh;
}

.header p {
  font-size: 14px;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
  padding-bottom: 12px;
  border-bottom: 2px solid #eee;
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #eee;
}

.card-icon {
  font-size: 24px;
  margin-right: 10px;
}

.card-header h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: #fff;
  color: #4A90E2;
  border: 2px solid #4A90E2;
}

.btn-secondary:hover {
  background-color: #f0f7ff;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  background-color: #fff;
  transition: all 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4A90E2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.toolbar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  font-size: 15px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.toolbar-toggle:hover {
  border-color: #4A90E2;
  background-color: #f0f7ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.1);
}

.toolbar-toggle:active {
  transform: translateY(0);
}

.toggle-arrow {
  font-size: 14px;
  font-weight: 300;
  color: #4A90E2;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-toggle.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.formula-toolbar {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #e8eaed;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  transition: all 0.35s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.formula-toolbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.formula-toolbar::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 3px;
}

.formula-toolbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.formula-toolbar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.formula-toolbar.collapsed {
  max-height: 0;
  padding: 0 20px;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #e0e0e0;
}

.toolbar-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.toolbar-label {
  font-size: 13px;
  color: #4A90E2;
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
  padding: 8px 12px;
  background-color: rgba(74, 144, 226, 0.08);
  border-radius: 8px;
  text-align: center;
  letter-spacing: 0.5px;
}

.toolbar-btn {
  padding: 10px 14px;
  border: 1.5px solid #e8eaed;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content !important;
  min-width: 56px;
  max-width: 100%;
  height: 44px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: visible;
  white-space: nowrap;
  flex: none !important;
}

.toolbar-btn mjx-container {
  display: inline-flex !important;
  font-size: 14px !important;
  text-align: center;
}

.toolbar-btn mjx-container svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.toolbar-btn:hover {
  border-color: #4A90E2;
  background-color: #f8fbff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.toolbar-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

.toolbar-btn:focus {
  outline: none;
  border-color: #4A90E2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.latex-input-wrapper {
  position: relative;
}

.latex-input-wrapper textarea {
  position: relative;
  z-index: 1;
  background-color: transparent;
}

.latex-placeholder {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 0;
  pointer-events: none;
  color: #999;
  font-size: 15px;
  line-height: 1.6;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.latex-placeholder.hidden {
  opacity: 0;
}

.preview-panel {
  margin-top: 16px;
  background: linear-gradient(135deg, #f8faff 0%, #f0f7ff 100%);
  border-radius: 12px;
  border: 1px solid #e8f0fe;
  overflow: hidden;
}

.preview-header {
  padding: 10px 16px;
  background-color: rgba(74, 144, 226, 0.08);
  border-bottom: 1px solid #e8f0fe;
  font-size: 13px;
  font-weight: 500;
  color: #4A90E2;
}

.preview-content {
  padding: 20px;
  font-size: 18px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-content:empty::before {
  content: '输入公式后在这里预览';
  color: #bbb;
  font-style: italic;
}

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auto-tag-hint {
  font-size: 13px;
  font-weight: 400;
  color: #888;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  background-color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  transition: all 0.25s ease;
  user-select: none;
}

.tag-option:hover {
  border-color: #4A90E2;
  background-color: #f0f7ff;
}

.tag-option input[type="radio"] {
  display: none;
}

.tag-option input[type="radio"]:checked + span {
  color: #fff;
}

.tag-option input[type="radio"]:checked + span::before {
  content: '✓ ';
  font-size: 12px;
}

.tag-option input[type="radio"]:checked ~ span {
  color: #fff;
}

.tag-option input[type="radio"]:checked ~ span::before {
  content: '✓ ';
  font-size: 12px;
}

.tag-option:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  border-color: #4A90E2;
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-right: 10px;
  margin-bottom: 10px;
}

.tag-chapter {
  background-color: #E3F2FD;
  color: #1976D2;
}

.tag-error {
  background-color: #FFF3E0;
  color: #E65100;
}

.tag-difficulty {
  background-color: #F3E5F5;
  color: #7B1FA2;
}

.mistake-item {
  padding: 24px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  background-color: #fff;
}

.mistake-item:hover {
  border-color: #4A90E2;
  background-color: #f8fbff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.08);
  transform: translateY(-1px);
}

.mistake-item .title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
  word-break: break-all;
}

.mistake-item .meta {
  font-size: 13px;
  color: #999;
}

.mistake-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.guide-btn {
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  border: none;
  cursor: pointer;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 2px 6px rgba(74,144,226,0.3);
}

.mistake-item:hover .guide-btn {
  opacity: 1;
}

.guide-btn:hover {
  transform: scale(1.04);
}

.guide-btn-sm {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.remind-bar {
  background-color: #FFF3E0;
  color: #E65100;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.remind-bar .icon {
  font-size: 20px;
  margin-right: 10px;
  font-weight: bold;
}

.tab-bar {
  display: flex;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 24px;
  border: 1.5px solid #e8eaed;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tab-item:hover {
  background-color: #eef2f7;
}

.tab-item.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
  transform: translateY(-1px);
}

.analysis-content {
  font-size: 15px;
  line-height: 1.9;
  color: #444;
  padding: 8px 0;
}

.analysis-content strong {
  color: #4A90E2;
  font-weight: 600;
}

.analysis-content p {
  margin-bottom: 12px;
}

.analysis-content p:last-child {
  margin-bottom: 0;
}

.guide-intro {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  text-align: center;
  padding: 20px 0;
}

.guide-intro p {
  margin-bottom: 12px;
}

.loading {
  text-align: center;
  padding: 60px;
  color: #999;
  font-size: 15px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: #4A90E2;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 24px;
  padding: 8px 0;
  transition: all 0.25s ease;
}

.back-link:hover {
  text-decoration: none;
  color: #357ABD;
  transform: translateX(-4px);
}

.back-link::before {
  content: '←';
  margin-right: 6px;
  font-size: 16px;
}

pre {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  color: #333;
  border: 1px solid #e8eaed;
  white-space: pre-wrap;
  word-wrap: break-word;
}

@media (max-width: 600px) {
  .container {
    padding: 10px;
  }
  
  .header {
    padding: 20px 15px;
  }
  
  .header h1 {
    font-size: 22px;
  }
  
  .card {
    padding: 16px;
  }
}

.progress-bar {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.progress-track {
  height: 8px;
  background: #e8eaed;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4A90E2 0%, #6BB3F1 100%);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #eee;
}

.step-number {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.step-question {
  font-size: 17px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border-left: 4px solid #4A90E2;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border: 2px solid #e8eaed;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
}

.option-btn:hover {
  border-color: #4A90E2;
  background: #f8fbff;
  transform: translateX(4px);
}

.option-btn:active {
  transform: translateX(2px);
}

.option-key {
  width: 32px;
  height: 32px;
  background: #f0f7ff;
  color: #4A90E2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-right: 14px;
  flex-shrink: 0;
}

.option-text {
  font-size: 15px;
  line-height: 1.6;
  color: #444;
  padding-top: 4px;
}

.explanation-box {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #fef9c3 0%, #fde047 30%);
  border-radius: 12px;
  border: 1px solid #facc15;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
  font-size: 15px;
  font-weight: 600;
  color: #854d0e;
  margin-bottom: 12px;
}

.explanation-content {
  font-size: 15px;
  line-height: 1.8;
  color: #78350f;
  margin-bottom: 16px;
}

.btn-next {
  width: 100%;
}

.conclusion-card {
  text-align: center;
}

.conclusion-content {
  font-size: 16px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 24px;
}

.conclusion-content p {
  margin-bottom: 12px;
}

.conclusion-content p:last-child {
  margin-bottom: 0;
}

.conclusion-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.conclusion-actions .btn {
  flex: 1;
  max-width: 200px;
}

/* ===== 收藏筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #e8eaed;
}

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

.filter-label {
  font-size: 13px;
  color: #888;
  font-weight: 500;
  margin-right: 4px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: #666;
  border: 1.5px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:hover {
  border-color: #4A90E2;
  color: #4A90E2;
  background: #f8fbff;
}

.filter-btn.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.filter-count {
  font-size: 13px;
  color: #f59e0b;
  font-weight: 500;
  padding: 4px 12px;
  background: #fffbeb;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

/* ===== 视图切换按钮 ===== */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 4px;
}

.view-btn {
  width: 36px;
  height: 34px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.view-btn:hover {
  border-color: #4A90E2;
  background: #f8fbff;
}

.view-btn.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

/* ===== 错题列表视图（表格） ===== */
.mistake-table {
  margin-top: 12px;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mistake-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mistake-table thead {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.mistake-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
  white-space: nowrap;
}

.mistake-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
}

.mistake-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mistake-table tbody tr:hover {
  background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
}

.mistake-table tbody tr.favorited-row {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.mistake-table tbody tr.favorited-row:hover {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
}

.mistake-table td.mjx-td mjx-container {
  font-size: 13px !important;
}

.col-idx { width: 40px; text-align: center; color: #888; font-weight: 500; }
.col-chapter { width: 70px; }
.col-error { width: 60px; }
.col-title { min-width: 0; }
.col-diff { width: 70px; text-align: center; }
.col-date { width: 120px; color: #888; font-size: 12px; }
.col-fav { width: 40px; text-align: center; font-size: 16px; }

.table-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.table-tag.chapter { background: #e3f2fd; color: #1565c0; }
.table-tag.error { background: #fce4ec; color: #c62828; }

.table-diff {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.table-diff.diff-1 { background: #e8f5e9; color: #2e7d32; }
.table-diff.diff-2 { background: #fff3e0; color: #e65100; }
.table-diff.diff-3 { background: #fff8e1; color: #f57f17; }
.table-diff.diff-4 { background: #fce4ec; color: #c62828; }
.table-diff.diff-5 { background: #ffebee; color: #b71c1c; }

/* ===== 错题卡片收藏状态 ===== */
.mistake-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.mistake-header .title {
  flex: 1;
  min-width: 0;
}

.favorite-star {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
  animation: starPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes starPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.mistake-favorited {
  border-color: #fbbf24 !important;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.mistake-favorited:hover {
  border-color: #f59e0b !important;
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%) !important;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.25);
}

/* ============================================================
   双视角分层解析 UI
   - 思路速览（layer-brief）：蓝色卡片，常显
   - 详细推导（layer-detail）：灰色卡片，可折叠
   - 衔接提示（layer-bridge）：橙色卡片，常显
   ============================================================ */

.analysis-layered {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layer-brief,
.layer-detail,
.layer-bridge {
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.25s ease;
}

.layer-brief {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
  border-left: 4px solid #4A90E2;
}

.layer-detail {
  background: #fafbfc;
  border: 1px solid #e8eaed;
}

.layer-bridge {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
  border-left: 4px solid #ff9800;
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.layer-brief .layer-header {
  color: #1565c0;
}

.layer-bridge .layer-header {
  color: #e65100;
}

.layer-icon {
  font-size: 18px;
  line-height: 1;
}

.layer-content {
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  word-break: break-word;
}

.layer-content strong {
  color: #4A90E2;
  font-weight: 600;
}

.toggle-icon {
  margin-left: auto;
  font-size: 12px;
  color: #888;
  transition: transform 0.25s ease;
}

/* 折叠状态 */
.layer-detail.collapsed .layer-content {
  display: none;
}

.layer-detail.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.layer-detail .layer-header:hover .toggle-icon {
  color: #4A90E2;
}

/* ============================================================
   答案显隐控制 UI
   - 模式开关 .mode-switch（答题模式 / 复习模式）
   - 答题模式提示条 .answer-prompt-bar
   - 显示答案/解析按钮 .btn-reveal
   - 组卷页逐题答案区 .q-answer
   ============================================================ */

.mode-switch {
  display: inline-flex;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 4px;
  border: 1.5px solid #e8eaed;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.mode-switch .mode-option {
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
}

.mode-switch .mode-option:hover {
  color: #4A90E2;
}

.mode-switch .mode-option.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(74, 144, 226, 0.35);
}

/* 答题模式提示条 */
.answer-prompt-bar {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
  border-left: 4px solid #ff9800;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.answer-prompt-bar .prompt-text {
  font-size: 15px;
  font-weight: 600;
  color: #e65100;
  margin-bottom: 14px;
}

.answer-prompt-bar .prompt-sub {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
  font-weight: 400;
}

/* 显示答案/解析按钮 */
.btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(74, 144, 226, 0.3);
  transition: all 0.25s ease;
}

.btn-reveal:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(74, 144, 226, 0.4);
}

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

.btn-reveal.secondary {
  background: #fff;
  color: #4A90E2;
  border: 2px solid #4A90E2;
  box-shadow: none;
}

.btn-reveal.secondary:hover {
  background: #f0f7ff;
}

.btn-reveal.disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

/* 组卷页逐题答案区 */
.q-answer {
  margin-top: 12px;
  border-top: 1px dashed #e8eaed;
  padding-top: 12px;
}

.q-answer-empty {
  font-size: 13px;
  color: #999;
  padding: 12px;
  background: #fafbfc;
  border-radius: 8px;
  text-align: center;
}

/* 答题模式下：隐藏带 .answer-hidden 的元素 */
.answer-hidden {
  display: none !important;
}

/* 组卷页题目卡片内的答案区在答题模式下默认折叠 */
.question-card .q-answer.collapsed .q-answer-content {
  display: none;
}

/* 组卷页答案区分析块 */
.analysis-block {
  margin-bottom: 18px;
}
.analysis-block:last-child {
  margin-bottom: 0;
}
.analysis-block h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #4A90E2;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8eaed;
}

/* 模式控制按钮显隐规则 */
/* 答题模式：未展开时显示"显示答案"按钮，展开后隐藏 */
.exam-mode .q-answer:not(.collapsed) > .btn-reveal {
  display: none;
}
/* 复习模式：隐藏所有"显示答案"按钮（答案直接可见） */
.review-mode .q-answer > .btn-reveal {
  display: none;
}

/* 组卷页模式开关在题目列表上方的间距 */
.exam-mode-switch {
  margin-bottom: 16px;
}

/* ============================================================
   详情页操作按钮 & 收藏 & 保存PDF
   - .btn-action 题目信息卡片头部的圆形操作按钮
   - .pdf-modal 导出内容选择模态框
   ============================================================ */

.btn-action {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #e8eaed;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #666;
}

.btn-action:hover {
  border-color: #4A90E2;
  color: #4A90E2;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.15);
}

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

.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 导出 PDF 模态框 */
.pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pdf-modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: pdfModalIn 0.2s ease;
}

@keyframes pdfModalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f0f0f0;
}

.pdf-modal-header h3 {
  font-size: 17px;
  color: #333;
}

.pdf-modal-close {
  border: none;
  background: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: background 0.2s;
}

.pdf-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.pdf-modal-body {
  padding: 18px 22px;
}

.pdf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #eef0f3;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-check:hover {
  background: #f0f7ff;
  border-color: #b3d4fc;
}

.pdf-check input {
  width: 17px;
  height: 17px;
  accent-color: #4A90E2;
  cursor: pointer;
}

.pdf-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #f0f0f0;
  background: #fafbfc;
}
/* ============================================================
   移动端适配（手机浏览器 / 微信内置浏览器）
   修复：导航与筛选栏在窄屏被挤压成竖排文字、卡片溢出
   ============================================================ */
@media (max-width: 640px) {
  .container {
    padding: 12px;
  }

  .header {
    padding: 18px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }
  .header h1 {
    font-size: 20px;
    line-height: 1.3;
  }
  .header p {
    font-size: 12px;
  }

  /* 导航：横向滑动，不再挤压换行 */
  .nav-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-bar::-webkit-scrollbar {
    display: none;
  }
  .nav-bar .nav-item,
  .nav-bar .nav-link {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 收藏筛选栏：改成上下两行，中文标签不再竖排 */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .filter-group {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-label {
    width: 100%;
    margin: 0;
    white-space: nowrap;
  }
  .filter-btn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
  .filter-count {
    align-self: flex-start;
    font-size: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 12px;
  }
  .mistake-item {
    padding: 14px;
  }
  .mistake-title {
    font-size: 15px;
  }

  /* 渲染后的公式与表格：允许横向滚动，避免撑破页面 */
  mjx-container,
  .MathJax {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
/* ============================================================
   学情看板 & 搜索筛选栏
   ============================================================ */
.stats-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-item {
  flex: 1;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 14px 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1f2d3d;
  line-height: 1.2;
}

.stat-warn { color: #f5a524; }
.stat-ok { color: #30a46c; }
.stat-star { color: #e8a33d; }

.stat-label {
  font-size: 12px;
  color: #8a94a6;
  margin-top: 4px;
}

.stats-sub {
  font-size: 13px;
  color: #5b6b7f;
  margin-bottom: 12px;
}

.chapter-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chapter-bar-row:hover {
  background: #f0f7ff;
}

.chapter-bar-name {
  width: 48px;
  font-size: 13px;
  color: #5b6b7f;
}

.chapter-bar-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.chapter-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4A90E2, #357ABD);
  border-radius: 999px;
}

.chapter-bar-count {
  width: 32px;
  text-align: right;
  font-size: 13px;
  color: #1f2d3d;
}

/* 搜索与多条件筛选 */
.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.search-input {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.search-input:focus {
  outline: none;
  border-color: #4A90E2;
}

.search-select {
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #1f2d3d;
  font-family: inherit;
}

/* 窄屏：看板两列、搜索栏整行 */
@media (max-width: 640px) {
  .stats-grid {
    flex-wrap: wrap;
    gap: 10px;
  }
  .stat-item {
    flex: 1 1 40%;
  }
  .search-input {
    flex: 1 1 100%;
  }
  .search-select {
    flex: 1 1 30%;
  }
}
/* 智能组卷：选卷思路说明 */
.exam-reason {
  margin-top: 10px;
  font-size: 13px;
  color: #2f6bd3;
  background: #eaf1ff;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.6;
}
/* ============================================================
   手动组卷
   ============================================================ */
.manual-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.manual-tab {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  color: #5b6b7f;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.manual-tab.active {
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: #fff;
  border-color: transparent;
}

.manual-count {
  font-size: 12px;
  opacity: 0.85;
}

.manual-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 6px;
  background: #fbfcfe;
}

.manual-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  margin-bottom: 6px;
  border: 1px solid #eef1f5;
}

.manual-row:hover {
  border-color: #bcd7f7;
  background: #f8fbff;
}

.manual-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex: none;
}

.manual-body {
  flex: 1;
  min-width: 0;
}

.manual-text {
  font-size: 15px;
  color: #1f2d3d;
  word-break: break-word;
  margin-bottom: 6px;
}

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

.manual-tag {
  font-size: 12px;
  color: #5b6b7f;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 2px 10px;
}

.manual-empty {
  text-align: center;
  color: #8a94a6;
  font-size: 14px;
  padding: 30px 0;
}

.manual-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.manual-name {
  flex: 1 1 200px;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.manual-selected {
  font-size: 13px;
  color: #f59e0b;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 12px;
}

.manual-footer .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
/* ============================================================
   学习趋势（最近 14 天）+ 批量操作
   ============================================================ */
.trend-title {
  font-size: 13px;
  color: #8a94a6;
  margin: 14px 0 8px;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  padding: 4px 2px 0;
  border-bottom: 1px solid #e8eaed;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  cursor: default;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.trend-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.bar-new { background: linear-gradient(180deg, #7fb3ef, #4A90E2); }
.bar-done { background: linear-gradient(180deg, #7ed6a5, #30a46c); }

.trend-label {
  font-size: 10px;
  color: #b0b8c4;
  margin-top: 4px;
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: #5b6b7f;
  margin-top: 10px;
}

.trend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

.dot-new { background: #4A90E2; }
.dot-done { background: #30a46c; }

.trend-empty {
  font-size: 13px;
  color: #b0b8c4;
  padding: 20px 0;
}

/* 批量操作 */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e8eaed;
  border-radius: 12px;
}

.bulk-count {
  font-size: 13px;
  color: #f59e0b;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 12px;
}

.bulk-danger {
  color: #cf1322;
  border-color: #ffccc7;
}

.bulk-danger:hover {
  background: #fff1f0;
  border-color: #ff7875;
  color: #a8071a;
}

.col-check {
  width: 36px;
  text-align: center;
}

.col-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
/* ============================================================
   历史对话面板（引导对话页）
   ============================================================ */
.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 45, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.history-box {
  width: 720px;
  max-width: 96vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.25);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f5;
  font-size: 16px;
  font-weight: 600;
  color: #1f2d3d;
}

.history-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: #8a94a6;
  cursor: pointer;
}

.history-body {
  padding: 16px 20px;
  overflow-y: auto;
}

.history-item {
  border: 1px solid #eef1f5;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: #bcd7f7;
  background: #f8fbff;
}

.history-item-title {
  font-size: 15px;
  color: #1f2d3d;
  margin-bottom: 6px;
  word-break: break-word;
}

.history-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #8a94a6;
}

.history-item-preview {
  margin-top: 6px;
  font-size: 13px;
  color: #5b6b7f;
}

.history-empty {
  text-align: center;
  color: #8a94a6;
  font-size: 14px;
  padding: 40px 0;
}

.history-transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hist-msg {
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 88%;
}

.hist-user {
  align-self: flex-end;
  background: #4A90E2;
  color: #fff;
}

.hist-ai {
  align-self: flex-start;
  background: #f4f7fb;
  color: #1f2d3d;
}

.hist-who {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.hist-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-back {
  margin-top: 16px;
  text-align: center;
}

.history-close-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #4A90E2;
  background: #fff;
  color: #4A90E2;
  font-size: 14px;
  cursor: pointer;
}
/* 数据导出入口 */
.export-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.export-label {
  font-size: 13px;
  color: #8a94a6;
}

.export-link {
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}
/* 列表卡片上的收藏按钮 */
.fav-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f4f7fb;
  color: #b0b8c4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-toggle:hover {
  background: #eaf1ff;
  color: #4A90E2;
  transform: scale(1.06);
}

.fav-toggle.fav-on {
  background: #fff7e6;
  color: #f5a524;
}
/* 键盘快捷键提示（复习页） */
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  margin: 0 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #1f2d3d;
  background: #fff;
  border: 1px solid #d6dbe3;
  border-bottom-width: 2px;
  border-radius: 5px;
}

.kbd-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #8a94a6;
}

.btn kbd {
  margin-left: 4px;
  color: inherit;
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(31, 45, 61, 0.18);
}
/* ============================================================
   手机端底部导航（≤640px 显示）
   ============================================================ */
.mb-bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .mb-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #e8eaed;
    box-shadow: 0 -2px 12px rgba(31, 45, 61, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mb-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    text-decoration: none;
    color: #8a94a6;
    font-size: 11px;
  }

  .mb-nav-item.active {
    color: #4A90E2;
    font-weight: 600;
  }

  .mb-nav-icon {
    font-size: 20px;
    line-height: 1.1;
  }

  /* 底部导航存在时，正文留出空间，并让登录状态条上移，避免互相遮挡 */
  body.has-bottom-nav {
    padding-bottom: 68px;
  }

  #mb-session-bar {
    bottom: 78px !important;
  }
}
