/* admin.css - 后台管理系统响应式增强（全后台页面共用） */
@media (max-width: 820px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .admin-brand {
    margin-bottom: 0;
    font-size: 1.05rem;
  }

  .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .admin-nav li {
    margin-bottom: 0;
  }

  .admin-nav a {
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
  }

  .admin-main {
    padding: 1.25rem 1rem;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-val {
    font-size: 1.35rem;
  }

  .card {
    padding: 1.1rem;
  }

  /* 数据表格在窄屏下横向滚动，避免挤压错位 */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 0.6rem 0.7rem;
    white-space: nowrap;
  }

  /* 防止 iOS 聚焦时自动放大 */
  .form-control {
    font-size: 16px;
  }

  select.form-control {
    width: 100% !important;
  }

  /* 章节编辑页排版微调 */
  .card form > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
