/* ============================================
   知行案例库 — 全局样式（蓝紫主题）
   ============================================ */

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --sidebar-from: #0f172a;
  --sidebar-to: #1e1b4b;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --title: #1e293b;
  --text: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;

  --tag-video: #6366f1;
  --tag-video-bg: #eef2ff;
  --tag-shop: #ec4899;
  --tag-shop-bg: #fdf2f8;
  --tag-ai: #10b981;
  --tag-ai-bg: #ecfdf5;

  --sidebar-width: 260px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* --- 布局 --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- 侧边栏 --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
  color: #fff;
  padding: 32px 20px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 36px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
}

.sidebar .course-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.75);
  width: 100%;
  text-align: left;
  font-family: inherit;
  margin-bottom: 2px;
}

.sidebar .course-filter:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar .course-filter.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
}

.course-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-stats {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.sidebar-stats .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.sidebar-stats .stat-val {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

/* 侧边栏图表触发器 */
.sidebar-chart-trigger {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--transition);
}

.sidebar-chart-trigger:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-chart-trigger .trigger-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

/* 图表弹窗 */
.chart-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.chart-modal-overlay.show {
  display: flex;
}

.chart-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.chart-modal-header h2 {
  font-size: 18px;
  color: var(--title);
}

.chart-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  padding: 0 4px;
  line-height: 1;
}

.chart-modal-close:hover {
  color: var(--title);
}

.chart-modal .chart-container {
  flex: 1;
  min-height: 420px;
  padding: 16px;
}

/* --- 主内容区 --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 36px;
  min-height: 100vh;
}

/* --- 顶部栏 --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  background: var(--card-bg);
  transition: border var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
}

.topbar-btn {
  padding: 10px 20px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text);
  white-space: nowrap;
}

.topbar-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.topbar-btn.admin-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 500;
}

.topbar-btn.admin-btn:hover {
  background: var(--primary-dark);
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
}

/* --- 卡片网格 --- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.case-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #e0e7ff 0%, #e8eaf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--primary-light);
}

.card-body {
  padding: 18px 20px;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
}

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

.tag-video {
  background: var(--tag-video-bg);
  color: var(--tag-video);
}

.tag-shop {
  background: var(--tag-shop-bg);
  color: var(--tag-shop);
}

.tag-ai {
  background: var(--tag-ai-bg);
  color: var(--tag-ai);
}

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

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

.empty-state p {
  font-size: 15px;
}

/* --- 时间轴区域 --- */
.timeline-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.timeline-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 16px;
}

.timeline-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.timeline-toggle:hover {
  color: var(--primary);
}

.toggle-arrow {
  font-size: 14px;
  color: var(--text-light);
  transition: transform 0.3s ease;
}

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

.chart-container {
  width: 100%;
  height: 400px;
}

/* --- 详情页 --- */
.detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 20px;
  cursor: pointer;
}

.back-link:hover {
  text-decoration: underline;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.detail-body {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-body h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.thoughts-content {
  white-space: pre-wrap;
  line-height: 1.9;
  color: var(--text);
}

/* 图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.image-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition);
}

.image-grid img:hover {
  transform: scale(1.03);
}

/* 灯箱 */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
}

.lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
}

/* 视频 */
.detail-video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* 附件列表 */
.file-list {
  list-style: none;
  margin-top: 8px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.file-list li:hover {
  background: #e2e8f0;
}

.file-list .file-icon {
  font-size: 20px;
}

.file-list .file-name {
  flex: 1;
  font-size: 14px;
  color: var(--title);
}

.file-list .file-size {
  font-size: 12px;
  color: var(--text-light);
}

/* --- ZIP 预览弹窗 --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0;
  width: 90%;
  max-width: 650px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-size: 16px;
  color: var(--title);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .zip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}

.modal-body .zip-item:hover {
  background: var(--bg);
}

.zip-preview-content {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  max-height: 350px;
  overflow: auto;
}

.zip-preview-content img {
  max-width: 100%;
  border-radius: 6px;
}

.zip-preview-content pre {
  white-space: pre-wrap;
  font-size: 13px;
  font-family: "SF Mono", "Consolas", monospace;
}

/* --- 管理员登录 --- */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-overlay.hidden {
  display: none;
}

.login-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-box h2 {
  font-size: 20px;
  color: var(--title);
  margin-bottom: 8px;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-align: center;
  font-family: inherit;
  letter-spacing: 4px;
}

.login-box input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.login-error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 8px;
  min-height: 20px;
}

/* --- Admin 页面 --- */
.admin-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.admin-page h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 24px;
}

.admin-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.admin-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* 课程编辑表 */
.course-edit-table {
  width: 100%;
  border-collapse: collapse;
}

.course-edit-table th,
.course-edit-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.course-edit-table th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
}

.course-edit-table input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}

.course-edit-table input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.course-edit-table th:last-child,
.course-edit-table td:last-child {
  width: 80px;
  text-align: center;
}

.course-edit-table .course-id-input {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 13px;
  background: #f8fafc;
}

.course-edit-table .delete-course-btn:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

/* 表单 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--title);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-hint.warn {
  color: #ef4444;
}

/* 文件输入美化 */
.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input-wrapper input[type="file"] {
  flex: 1;
}

.file-preview-list {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
}

.file-preview-list span {
  display: inline-block;
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 12px;
  margin: 2px 4px 2px 0;
  font-size: 12px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-save {
  background: #10b981;
  color: #fff;
}

.btn-save:hover {
  background: #059669;
}

/* 生成的代码区域 */
.code-output {
  margin-top: 16px;
}

.code-output pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
}

.copy-btn {
  margin-top: 8px;
}

/* --- 案例列表（管理页） --- */
.case-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.case-list-table th,
.case-list-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.case-list-table th {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
}

.case-list-table td {
  vertical-align: middle;
}

.case-list-table .cell-title {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-list-table .cell-actions {
  white-space: nowrap;
  text-align: right;
}

.case-list-table .btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-family: inherit;
  margin-left: 4px;
  transition: all var(--transition);
}

.case-list-table .btn-edit:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #eef2ff;
}

.case-list-table .btn-del:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

/* --- 拖拽上传区 --- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafbfc;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary-light);
  background: #eef2ff;
}

.drop-zone.drag-over {
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.drop-zone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.drop-zone-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.drop-zone-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.drop-zone-hint.warn {
  color: #ef4444;
  font-weight: 500;
}

/* 文件预览列表 */
.file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  position: relative;
}

.file-preview-item img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.file-preview-item .remove-file {
  cursor: pointer;
  color: #ef4444;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.file-preview-item .remove-file:hover {
  color: #dc2626;
}

.file-preview-item .file-size {
  font-size: 11px;
  color: var(--text-light);
}

.file-preview-item.size-warn {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* --- 响应式 --- */
@media (max-width: 1199px) {
  .case-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }
  .case-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .search-box {
    max-width: 100%;
    order: -1;
    flex: 0 0 100%;
  }
  .menu-toggle {
    display: flex !important;
  }
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
}

/* 移动端遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-overlay.show {
  display: block;
}

/* 图片上传预览 */
.upload-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.upload-preview .preview-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
