/* Zaka 管理后台 — 移动端适配
 * 桌面端不变,<=991px 侧边栏改为抽屉 + 汉堡按钮
 */
:root {
  --zk-admin-side: 232px;
  --zk-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}
html, body {
  overflow-x: hidden !important;
  max-width: 100%;
}

/* 汉堡按钮(桌面端隐藏) */
.zk-burger {
  display: none;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  border-radius: 9px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #334155;
  flex: 0 0 36px;
  cursor: pointer;
}
.zk-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1030;
}
.zk-mask.on {
  display: block;
}

@media (max-width: 991px) {
  .zk-burger {
    display: inline-flex;
  }

  /* 侧边栏变抽屉 */
  .layout {
    display: block;
  }
  .side {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh !important;
    z-index: 1040;
    width: 250px !important;
    flex-basis: 250px !important;
    transform: translateX(-100%);
    transition: transform .22s ease;
    will-change: transform;
  }
  .side.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(2, 6, 23, .5);
  }
  .side nav {
    padding-bottom: calc(28px + var(--zk-safe-bottom));
  }

  .main {
    width: 100%;
  }
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .topbar .title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .sub {
    display: none;
  }
  .topbar .right {
    gap: 8px;
  }
  .topbar .right .pill {
    padding: 4px 9px;
    font-size: 11px;
  }
  .topbar .right .pill.zk-hide-sm {
    display: none;
  }

  .content {
    padding: 12px;
  }

  /* 卡片 / 统计 */
  .card-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body {
    padding: 14px;
  }
  .stat {
    padding: 13px 14px;
  }
  .stat .val {
    font-size: 19px;
  }

  /* 表格横向滚动 */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    font-size: 12.5px;
    min-width: 620px;
  }
  .table > thead th,
  .table > tbody td {
    padding: 9px 10px;
  }

  /* 表单按钮撑满 */
  .zk-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .zk-form-actions .btn {
    width: 100%;
  }

  /* 弹窗 */
  .modal-dialog {
    margin: 8px;
    max-width: calc(100vw - 16px) !important;
  }
  .modal-dialog-centered {
    min-height: calc(100% - 16px);
  }
  .modal-content {
    border-radius: 14px;
  }

  /* toast 适配 */
  .toast-wrap {
    left: 10px;
    right: 10px;
    top: 10px;
    align-items: stretch;
  }
  .tst {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 10px;
  }
  .card-body {
    padding: 12px;
  }
  .stat .val {
    font-size: 17px;
  }
  .zk-burger {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
}
