/* 响应式布局样式 */

/* 汉堡菜单按钮（仅移动端显示） */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--k-text-main);
  margin: 4px 0;
  transition: all 0.3s;
}

/* 侧边栏遮罩层（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}

/* 768px 以下：移动端布局 */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
    padding: 0 16px 24px;
  }

  .header-bar {
    height: 60px;
    margin-bottom: 16px;
  }

  .view-title {
    font-size: 18px;
  }

  /* 统计网格：3列紧凑 */
  .stat-row {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
  }
  .stat-item {
    padding: 14px;
  }
  .stat-number {
    font-size: 20px;
  }

  /* 图表区域单列 */
  .tab-panel .chart-grid {
    grid-template-columns: 1fr;
  }

  /* 表格横向滚动 */
  .k-card-body {
    overflow-x: auto;
  }
  table {
    min-width: 600px;
  }

  /* 模态框全宽 */
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  /* 设置页两列变单列 */
  .tab-panel .settings-grid {
    grid-template-columns: 1fr;
  }

  /* 筛选栏换行 */
  .k-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* 480px 以下：小屏手机 */
@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-item {
    padding: 12px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-number {
    font-size: 18px;
  }
  .main-wrapper {
    padding: 0 12px 16px;
  }
}
