/* 移动端优化（魔改新增） */

/* ===== 全局触摸优化 ===== */
*{ -webkit-tap-highlight-color: rgba(0,150,136,.1); }
body{ -webkit-text-size-adjust: 100%; }

/* ===== 小屏适配 ===== */
@media (max-width: 768px) {
  .container { padding-left: 10px; padding-right: 10px; }
  
  /* 表格横滚 */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.filelist { min-width: 600px; }
  
  /* 隐藏次要列 */
  table.filelist th:nth-child(5),
  table.filelist td:nth-child(5),
  table.filelist th:nth-child(7),
  table.filelist td:nth-child(7) { display: none; }
  
  /* 大按钮 */
  .btn { min-height: 40px; }
  .btn-lg { min-height: 48px; font-size: 15px; }
  
  /* 输入框防缩放 */
  input, select, textarea { font-size: 16px !important; }
  
  /* 卡片式列表 */
  .well { padding: 14px 12px; border-radius: 12px; }
  
  /* 分页换行 */
  .pagination { flex-wrap: wrap; }
  .pagination > li > a { padding: 8px 11px; }
}

/* ===== 超小屏 ===== */
@media (max-width: 400px) {
  table.filelist th:nth-child(6),
  table.filelist td:nth-child(6) { display: none; }
  h2 { font-size: 18px; }
}

/* ===== 底部安全区（iPhone 刘海屏）===== */
@supports (padding: max(0px)) {
  .footer, #chat-btn, .fab {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== 触摸滑动优化 ===== */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
.scroll-x::-webkit-scrollbar { height: 4px; }
.scroll-x::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ===== 图片自适应 ===== */
img { max-width: 100%; height: auto; }
.image_view img.image { max-height: 70vh; object-fit: contain; }

/* ===== 触控友好的操作按钮 ===== */
@media (hover: none) {
  .table a { padding: 6px 4px; display: inline-block; }
  .dropdown-menu > li > a { padding: 12px 20px; }
}

/* ===== 底部固定操作栏（移动端）===== */
.mobile-actionbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #eee;
  padding: 8px 12px; z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.mobile-actionbar .btn { flex: 1; margin: 0 4px; }
@media (max-width: 768px) {
  .mobile-actionbar { display: flex; }
  body.has-actionbar { padding-bottom: 64px; }
}

/* ===== 加载骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: sk 1.5s infinite;
  border-radius: 6px;
}
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ===== 下拉刷新提示 ===== */
.pull-refresh {
  text-align: center; padding: 12px; color: #999; font-size: 13px;
  transition: opacity .2s;
}

/* ===== 悬浮上传进度 ===== */
#upload-float {
  position: fixed; right: 16px; bottom: 84px; width: 320px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 9998; overflow: hidden; display: none;
}
#upload-float .uf-head {
  padding: 11px 15px; background: linear-gradient(135deg,#009688,#00796b); color: #fff;
  font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
#upload-float .uf-head .uf-min { cursor: pointer; opacity: .85; }
#upload-float .uf-body { max-height: 300px; overflow-y: auto; padding: 10px; }
#upload-float.min .uf-body { display: none; }
.uf-item { padding: 9px 10px; border-radius: 9px; background: #f8fafc; margin-bottom: 8px; }
.uf-item .uf-name { font-size: 13px; font-weight: 500; word-break: break-all; margin-bottom: 5px; }
.uf-item .uf-bar { height: 6px; background: #e5e9f0; border-radius: 3px; overflow: hidden; }
.uf-item .uf-fill { height: 100%; background: linear-gradient(90deg,#4f8cff,#2563eb); transition: width .3s; }
.uf-item .uf-stat { font-size: 11px; color: #888; margin-top: 4px; display: flex; justify-content: space-between; }
.uf-item.done .uf-fill { background: #16a34a; }
.uf-item.fail .uf-fill { background: #dc2626; }
