/* ==========================================================================
   v8 · 全屏化 + Bug 修复层（追加在 skin.css 之后，优先级最高）
   ========================================================================== */

/* ---------------- 基础：整页铺满 ---------------- */
html,body{ height:100%; min-height:100%; }
body.sk-on{ background:#ffffff !important; }
body.sk-on #app,
body.sk-on #app-wrapper{ min-height:100vh !important; height:100% !important; }
body.sk-on .page-wrapper{ background:#ffffff !important; }

/* ======================================================================
   手机端（<1000px）：主页 / 所有子页 一律全屏铺满
   ====================================================================== */
@media (max-width:768px){

  body.sk-on .main-content{ padding-bottom:0 !important; background:#fff !important; }

  /* 主页：去卡片悬浮感，整屏白底铺满 */
  body.sk-on .content{
    margin:0 !important;
    padding:14px 16px calc(92px + env(safe-area-inset-bottom)) !important;
    border-radius:0 !important;
    box-shadow:none !important;
    background:#fff !important;
    width:100% !important; max-width:none !important;
    box-sizing:border-box !important;
    min-height:100vh !important;
  }

  /* 子页容器：固定占满整屏 */
  body.sk-on .share-page-overlay{
    position:fixed !important; inset:0 !important;
    width:100% !important; height:100% !important;
    background:#fff !important; z-index:120 !important;
  }
  body.sk-on .management-page{
    position:absolute !important; inset:0 !important;
    display:flex !important; flex-direction:column !important;
    width:100% !important; height:100% !important; max-width:none !important;
    margin:0 !important; padding:0 !important;
    border-radius:0 !important; background:#fff !important;
    min-height:0 !important;
  }

  /* 顶部标题栏：贴顶、通栏 */
  body.sk-on .management-header{
    margin:0 !important; border-radius:0 !important; flex:0 0 auto !important;
    padding:calc(12px + env(safe-area-inset-top)) 16px 12px !important;
    position:relative !important; top:auto !important;
    background:#fff !important;
    border-bottom:1px solid #f1f2f4 !important;
    box-shadow:none !important; z-index:5 !important;
    box-sizing:border-box !important;
  }

  /* 内容区：吃掉剩余高度、内部滚动、底部留出导航条高度 */
  body.sk-on .management-content{
    flex:1 1 auto !important; min-height:0 !important; height:auto !important; max-height:none !important;
    overflow-y:auto !important; -webkit-overflow-scrolling:touch !important;
    margin:0 !important; border-radius:0 !important; box-shadow:none !important;
    background:#fff !important;
    padding:12px 16px calc(96px + env(safe-area-inset-bottom)) !important;
    box-sizing:border-box !important;
  }
  /* 各业务块不再自带左右外边距（避免二次缩进） */
  body.sk-on .management-content > *{ max-width:100% !important; box-sizing:border-box !important; }

  /* 底部导航：贴底通栏 */
  body.sk-on .sk-tabbar,
  .sk-tabbar{
    left:0 !important; right:0 !important; bottom:0 !important;
    width:100% !important;
    border-radius:16px 16px 0 0 !important;
    padding:0 6px env(safe-area-inset-bottom) !important;
    height:auto !important; min-height:62px !important;
    box-sizing:border-box !important;
    box-shadow:0 -2px 18px rgba(17,20,26,.07) !important;
    background:rgba(255,255,255,.98) !important;
  }

  /* 设置页（独立组件）同样全屏 */
  body.sk-on .settings-page{
    margin:0 !important; border-radius:0 !important; box-shadow:none !important;
    background:#fff !important; min-height:100vh !important;
    padding-bottom:calc(96px + env(safe-area-inset-bottom)) !important;
    box-sizing:border-box !important;
  }
  body.sk-on .settings-page .nav-header{
    margin:0 !important; border-radius:0 !important;
    padding:calc(12px + env(safe-area-inset-top)) 16px 12px !important;
    border-bottom:1px solid #f1f2f4 !important;
  }

  /* 付款页 / 付款图 / 分享页等独立页全屏 */
  body.sk-on .payment-page,
  body.sk-on .fukuantu-page,
  body.sk-on .share-manage-page,
  body.sk-on .share-page-main,
  body.sk-on .merged-component-root{
    width:100% !important; max-width:100% !important;
    margin:0 !important; border-radius:0 !important; box-shadow:none !important;
    background:#fff !important; box-sizing:border-box !important;
  }

  /* 聊天页全屏 */
  body.sk-on .chat-content{ padding:0 0 calc(92px + env(safe-area-inset-bottom)) !important; }
  body.sk-on .chat-page{
    border-radius:0 !important; box-shadow:none !important;
    min-height:calc(100vh - 62px) !important; background:#fff !important;
  }
}

/* ======================================================================
   PC 端（>=1000px）：全屏铺满 + 修「手机卡片和表格同时出现」的重复渲染
   ====================================================================== */
@media (min-width:769px){

  /* ★ Bug 修复：原包的 .user-cards/.mobile-only 被同优先级规则覆盖，
     PC 上表格下方会重复渲染一整套手机卡片。这里强制隐藏手机版视图。 */
  body.sk-on .mobile-only,
  body.sk-on .user-cards,
  body.sk-on .card-list,
  body.sk-on .sk-tabbar{ display:none !important; }

  body.sk-on .desktop-only{ display:table !important; }
  body.sk-on .desktop-only.user-table,
  body.sk-on .desktop-only.license-table{ display:table !important; }

  /* 布局撑满整屏 */
  body.sk-on .admin-layout{
    display:flex !important; flex-direction:column !important;
    width:100% !important; min-height:100vh !important; height:100% !important;
    background:#f6f7f9 !important;
  }
  body.sk-on .topbar{
    position:sticky !important; top:0 !important; z-index:100 !important;
    width:100% !important; box-sizing:border-box !important;
    background:#fff !important; border-bottom:1px solid #eef0f3 !important;
    box-shadow:0 1px 2px rgba(17,20,26,.03) !important;
  }
  body.sk-on .main-content{
    flex:1 1 auto !important; min-height:0 !important;
    width:100% !important; max-width:none !important;
    overflow-y:auto !important; padding:0 !important;
    background:#f6f7f9 !important;
  }
  body.sk-on .content-body{
    width:100% !important; max-width:none !important;
    padding:20px 24px 40px !important;
    box-sizing:border-box !important; min-height:calc(100vh - 56px) !important;
    background:transparent !important;
  }

  /* 内容块：白底大圆角卡、铺满宽度 */
  body.sk-on .content-body .user-management,
  body.sk-on .content-body .license-management,
  body.sk-on .content-body .api-management,
  body.sk-on .content-body .order-management,
  body.sk-on .content-body .system-monitoring,
  body.sk-on .content-body .system-settings,
  body.sk-on .content-body .anti-red-management,
  body.sk-on .content-body .announcement-management,
  body.sk-on .content-body .red-envelope-management,
  body.sk-on .content-body .password-management{
    width:100% !important; max-width:none !important; box-sizing:border-box !important;
    background:#fff !important; border-radius:18px !important;
    padding:20px 22px !important; box-shadow:0 2px 14px rgba(17,20,26,.05) !important;
  }

  /* 表格：铺满、去直角、行高舒服 */
  body.sk-on .content-body table.data-table,
  body.sk-on .content-body .user-table,
  body.sk-on .content-body .license-table{ width:100% !important; }
  body.sk-on .content-body .data-table th{
    background:#fafbfc !important; color:#6b7280 !important;
    font-size:12px !important; font-weight:700 !important;
    padding:12px 14px !important; white-space:nowrap !important;
  }
  body.sk-on .content-body .data-table td{
    padding:13px 14px !important; font-size:13.5px !important; color:#1b1f26 !important;
    border-bottom:1px solid #f2f3f5 !important;
  }
  body.sk-on .content-body .data-table tr:hover td{ background:#fafbfc !important; }
  body.sk-on .content-body .table-container{
    border:1px solid #eef0f3 !important; border-radius:14px !important; overflow:hidden !important;
  }

  /* PC 工具条 */
  body.sk-on .content-body .toolbar{
    display:flex !important; align-items:center !important; justify-content:space-between !important;
    gap:12px !important; flex-wrap:wrap !important;
    padding:0 0 16px !important; margin:0 !important; border:0 !important;
  }
  body.sk-on .content-body .toolbar-left,
  body.sk-on .content-body .toolbar-right{
    display:flex !important; align-items:center !important; gap:8px !important; flex-wrap:wrap !important;
  }
  body.sk-on .content-body .search-bar,
  body.sk-on .content-body .search-box{
    width:260px !important; max-width:100% !important; margin:0 !important;
  }

  /* PC 统计卡 4 列铺满 */
  body.sk-on .content-body .stats-grid{
    grid-template-columns:repeat(4,1fr) !important; gap:16px !important; width:100% !important;
  }
  body.sk-on .content-body .section-card,
  body.sk-on .content-body .stats-card{
    background:#f8f9fb !important; border-radius:16px !important; padding:18px !important;
    margin:0 0 16px !important; width:100% !important; box-sizing:border-box !important;
  }
  body.sk-on .content-body .settings-card{
    background:#f8f9fb !important; border-radius:16px !important; padding:18px !important;
    margin:0 0 16px !important; box-sizing:border-box !important;
  }

  /* PC 弹窗：居中不贴边 */
  body.sk-on .modal .modal-content,
  body.sk-on .modal-content{
    max-width:min(720px, calc(100vw - 80px)) !important;
    max-height:calc(100vh - 80px) !important; overflow-y:auto !important;
  }
}

/* ---------------- 通用小修 ---------------- */
/* 空列表统一占位 */
.sk-empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; padding:48px 16px; color:#a8adb6; font-size:13.5px; text-align:center;
  background:#fafbfc; border-radius:16px; margin:4px 0 12px;
}
.sk-empty svg{ width:44px; height:44px; stroke:#ccd0d6; fill:none; stroke-width:1.4; }

/* 页面底部收尾文字：只在手机显示 */
@media (min-width:769px){ body.sk-on .sk-end{ display:none !important; } }

/* ==========================================================================
   v8.1 · 弹窗层级 / 独立页全屏 / 溢出修复
   ========================================================================== */

/* ★ Bug：弹窗被底部导航条压住，确定按钮点不到 */
body.sk-modal .sk-tabbar{ display:none !important; }
body.sk-on .modal-overlay,
body.sk-on .modal,
body.sk-on .dialog-overlay,
body.sk-on .confirm-overlay{ z-index:100000 !important; }
body.sk-on .modal-overlay .modal-content,
body.sk-on .modal .modal-content,
body.sk-on .modal-body,
body.sk-on .modal{ max-height:calc(100vh - 90px) !important; overflow-y:auto !important; box-sizing:border-box !important; }

@media (max-width:768px){
  /* 独立页（付款页/付款图/分享页/设置页）彻底全屏 */
  body.sk-on .payment-page,
  body.sk-on .fukuantu-page,
  body.sk-on .share-manage-page,
  body.sk-on .share-page-main{
    position:absolute !important; inset:0 !important;
    width:100% !important; max-width:100% !important;
    height:100% !important; margin:0 !important; border-radius:0 !important;
    display:flex !important; flex-direction:column !important;
    background:#fff !important; box-shadow:none !important; box-sizing:border-box !important;
  }
  body.sk-on .payment-page .main-container,
  body.sk-on .fukuantu-page .main-container,
  body.sk-on .share-manage-page .main-container{
    flex:1 1 auto !important; min-height:0 !important;
    overflow-y:auto !important; -webkit-overflow-scrolling:touch !important;
    padding:calc(12px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)) !important;
    box-sizing:border-box !important; background:#fff !important; width:100% !important;
  }
  /* 弹窗内部底部留白，避免贴到屏底 */
  body.sk-on .modal-content,
  body.sk-on .modal-body{ padding-bottom:calc(18px + env(safe-area-inset-bottom)) !important; }

  /* ★ Bug：系统监控里 domain-actions 定宽 200px 在窄屏溢出 */
  body.sk-on .domain-actions,
  body.sk-on .item-actions,
  body.sk-on .card-actions{ flex-wrap:wrap !important; width:auto !important; max-width:100% !important; }
  body.sk-on .domain-actions .action-btn,
  body.sk-on .domain-actions button{ flex:0 0 auto !important; }
  body.sk-on .domain-item,
  body.sk-on .section-card{ width:100% !important; max-width:100% !important; box-sizing:border-box !important; }
}

/* PC 上内容卡撑满剩余高度，避免底部灰底长条 */
@media (min-width:769px){
  body.sk-on .content-body{ display:flex !important; flex-direction:column !important; }
  body.sk-on .content-body > div{ flex:0 0 auto !important; }
}

/* v8.2 · 刘海屏安全区 + 细节 */
@media (max-width:768px){
  body.sk-on .content{
    padding-top:calc(14px + env(safe-area-inset-top)) !important;
  }
  body.sk-on .sk-tabbar{ padding-bottom:env(safe-area-inset-bottom) !important; }
  /* 顶部标题栏保持与内容同宽，不再二次缩进 */
  body.sk-on .management-header{ padding-left:16px !important; padding-right:16px !important; }
  /* 长列表最后一项不被底部导航压住 */
  body.sk-on .management-content > *:last-child{ margin-bottom:0 !important; }
}
/* PC 中等宽度也别挤 */
@media (min-width:769px) and (max-width:1200px){
  body.sk-on .content-body{ padding:16px !important; }
  body.sk-on .content-body .stats-grid{ grid-template-columns:repeat(2,1fr) !important; }
}
