/* 图片占位、响应式断点、全局滚动条 —— 由 index.html 拆分而来，加载顺序见 index.html */
.img-fallback {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 6px, rgba(255,255,255,.02) 6px 12px);
  border: 1px dashed rgba(255,255,255,.16);
  box-sizing: border-box;
}

/* ─── 响应式外壳：侧栏 / 顶栏 / 统计卡 / 表格 ─── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
/* 侧栏收起时，给固定在左上角的展开按钮让出位置 */
body.sidebar-collapsed .topbar { padding-left: 46px; }

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* 侧栏改为抽屉：浮在内容之上，不再挤压主区 */
  .main { margin-left: 0; }
  .sidebar { box-shadow: 8px 0 28px rgba(0,0,0,.45); }
  body:not(.sidebar-collapsed) .sidebar-backdrop { display: block; }
  .topbar { height: auto; min-height: 56px; padding: 10px 14px 10px 46px; flex-wrap: wrap; }
  .topbar-right { width: 100%; flex-wrap: wrap; gap: 10px; }
  .search-wrap { flex: 1; min-width: 160px; }
  .top-search { width: 100%; }
  .content { padding: 16px 14px; }
  /* 宽表格改为横向滚动，而不是被 overflow:hidden 裁掉 */
  .table-card { overflow-x: auto; }
  .data-table { min-width: 720px; }
  .table-toolbar { min-width: 0; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .toolbar-actions { flex-wrap: wrap; }
  .table-foot { flex-wrap: wrap; gap: 10px; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
