/* 全局样式 */
:root{
  --primary:#165DFF;--success:#00B42A;--warning:#FF7D00;--danger:#F53F3F;
  --text:#1D2129;--muted:#4E5969;--bg:#F2F3F5;--card:#fff
}
body{background:var(--bg);color:var(--text)}
.sidebar{width:240px}
.card{box-shadow:0 2px 8px rgba(0,0,0,.06);border-radius:8px}

/* 移动端 offcanvas 侧边栏宽度优化（进一步收窄） */
#mobileMenu{--bs-offcanvas-width:180px}
@media (min-width:576px){#mobileMenu{--bs-offcanvas-width:180px}}
@media (max-width:360px){#mobileMenu{--bs-offcanvas-width:80vw}}

/* 移动端去除页面边距，让内容占满全屏 */
@media (max-width:991px){
  main.py-4{padding-top:0.5rem!important;padding-bottom:0.5rem!important}
  .container-fluid{padding-left:0!important;padding-right:0!important}
  .card{border-radius:0;margin-left:0;margin-right:0}
  /* 移动端顶部导航栏标题左侧留白 */
  .navbar .container-fluid{padding-left:1rem!important}
  .navbar-brand{padding-left:0.25rem}
  /* 移动端仪表盘统计卡片内容居中 */
  .card .text-muted, .card .display-6{text-align:center}
  /* 移动端卡片内边距更紧凑，便于四卡并排 */
  .card.p-3{padding:0.75rem!important}
}

/* 移动端：域名管理页隐藏批量删除按钮、选择勾、ID列 */
@media (max-width:576px){
  /* 仅在域名管理页工具栏中隐藏批量删除表单，避免影响其他页面 */
  .dm-toolbar #batchForm{display:none!important}
  /* 隐藏第一列(复选框)与第二列(ID) */
  table.domain-table th:nth-child(1),
  table.domain-table td:nth-child(1),
  table.domain-table th:nth-child(2),
  table.domain-table td:nth-child(2){
    display:none!important;
  }
}

/* 工具栏与搜索框的响应式布局 */
.dm-toolbar .search-box{width:200px}
@media (max-width:576px){
  .dm-toolbar{justify-content:flex-start!important;gap:.5rem}
  .dm-toolbar .search-form{flex:1 1 auto}
  .dm-toolbar .search-box{width:100%!important}
}

/* 被封域名页：移动端隐藏批量按钮与勾选/ID列 */
@media (max-width:576px){
  /* 隐藏顶部批量按钮（删除/误报） */
  .bd-toolbar [form="batchForm"][name="delete_selected"],
  .bd-toolbar [form="batchForm"][name="mark_false"]{display:none!important}
  /* 隐藏第一列(复选框)与第二列(ID) */
  table.blocked-table th:nth-child(1),
  table.blocked-table td:nth-child(1),
  table.blocked-table th:nth-child(2),
  table.blocked-table td:nth-child(2){display:none!important}
}

/* 复制成功提示样式（更轻巧） */
.copy-toast-container{top:0.75rem!important; text-align:center}
.copy-toast{border-radius:999px; box-shadow:0 8px 24px rgba(0,0,0,.12); display:inline-block; width:auto; max-width:unset; --bs-toast-max-width:220px}
.copy-toast .toast-body{padding:.35rem .85rem; font-size:.9rem; white-space:nowrap}

/* 误报域名页：移动端隐藏ID列 */
@media (max-width:576px){
  table.fp-table th:nth-child(1),
  table.fp-table td:nth-child(1){display:none!important}
}

/* 检测日志页：移动端隐藏ID列 */
@media (max-width:576px){
  table.detection-logs-table th:nth-child(1),
  table.detection-logs-table td:nth-child(1){display:none!important}
}

/* 执行日志页：移动端隐藏ID列 */
@media (max-width:576px){
  table.detection-trace-table th:nth-child(1),
  table.detection-trace-table td:nth-child(1){display:none!important}
}

/* 现代化分页样式 */
.pagination-wrapper{align-items:center}
.pagination-modern{margin:0}
.pagination-modern .page-link{
  border:1px solid #d1d5db;
  color:#374151;
  padding:0.375rem 0.75rem;
  margin:0 0.125rem;
  border-radius:0.375rem;
  font-size:0.875rem;
  transition:all 0.15s;
}
.pagination-modern .page-item:first-child .page-link,
.pagination-modern .page-item:last-child .page-link{
  padding:0.375rem 1rem;
  font-weight:500;
}
.pagination-modern .page-item.active .page-link{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
  font-weight:500;
}
.pagination-modern .page-link:hover:not(.active .page-link):not(.disabled .page-link){
  background:#f3f4f6;
  border-color:#9ca3af;
  color:#111827;
}
.pagination-modern .page-item.disabled .page-link{
  color:#9ca3af;
  background:#fff;
  border-color:#e5e7eb;
  cursor:not-allowed;
  opacity:0.6;
}

/* 紧凑按钮：防止换行并略微缩小字号，适合“二维码/首页”等短标签 */
.btn-compact{white-space:nowrap;font-size:.82rem;line-height:1.1;padding:.3rem .55rem}

/* 开关样式（使用成功绿） */
.switch-success.form-switch .form-check-input:checked{
  background-color: var(--success);
  border-color: var(--success);
}
.form-switch .form-check-input{cursor:pointer}

/* 放大版开关（更易点按） */
.form-switch.switch-lg .form-check-input{
  width:2.6rem; /* 默认 2em，这里略放大 */
  height:1.4rem;
}
.form-switch.switch-lg .form-check-label{font-size:.95rem}
@media (max-width:576px){
  .form-switch.switch-lg .form-check-input{width:2.8rem;height:1.5rem}
}

/* 移动端分页：隐藏常规分页，显示加载提示 */
@media (max-width:576px){
  .pagination-wrapper{display:none!important}
  .mobile-load-more{
    display:block;
    text-align:center;
    padding:1rem;
    color:#6b7280;
    font-size:0.9rem;
  }
  .mobile-load-more.loading::after{
    content:'';
    display:inline-block;
    width:16px;
    height:16px;
    margin-left:8px;
    border:2px solid #e5e7eb;
    border-top-color:var(--primary);
    border-radius:50%;
    animation:spin 0.6s linear infinite;
  }
}
@media (min-width:577px){
  .mobile-load-more{display:none!important}
}
@keyframes spin{
  to{transform:rotate(360deg)}
}

/* 移动端：固定顶部导航栏，滚动时不隐藏 */
@media (max-width:576px){
  nav.navbar{
    position: sticky;
    top: 0;
    z-index: 1030; /* 盖住页面内容，低于 offcanvas(1045) */
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
  }
}
