/* ============================================================
   资产管理系统 - 自定义样式
   兼容钉钉内置浏览器 + 移动端 + 桌面端
   ============================================================ */

/* 全局 */
body {
  font-size: 14px;
  background-color: #f5f6fa;
}

/* Navbar */
.navbar {
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.navbar-brand {
  font-weight: 700;
  letter-spacing: .5px;
}

/* 手机端汉堡菜单展开后确保蓝底白字（部分 WebView 不继承 bg-primary） */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #0d6efd !important;
    padding: 0.25rem 0.5rem 0.5rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
    margin-top: 0.25rem;
  }
  .navbar-collapse .nav-link {
    color: rgba(255,255,255,.9) !important;
    padding: .5rem .75rem;
  }
  .navbar-collapse .nav-link:hover,
  .navbar-collapse .nav-link.active {
    color: #fff !important;
    background-color: rgba(255,255,255,.1);
    border-radius: 6px;
  }
  .navbar-collapse .dropdown-menu {
    background-color: #0b5ed7;
    border: none;
  }
  .navbar-collapse .dropdown-item {
    color: rgba(255,255,255,.85);
  }
  .navbar-collapse .dropdown-item:hover {
    background-color: rgba(255,255,255,.15);
    color: #fff;
  }
}

/* 内容区域适配钉钉顶栏高度 */
main, .container-fluid {
  padding-top: 0.75rem;
  padding-bottom: 2rem;
}

/* 状态徽章颜色统一 */
.badge-status-available { background-color: #198754; color:#fff; }
.badge-status-out       { background-color: #ffc107; color:#000; }
.badge-status-repair    { background-color: #dc3545; color:#fff; }
.badge-status-retired   { background-color: #6c757d; color:#fff; }

/* 卡片阴影一致 */
.card { border: none; }
.card.shadow-sm { box-shadow: 0 1px 6px rgba(0,0,0,.08) !important; }

/* 表格 */
.table th { font-weight: 600; white-space: nowrap; }
.table td { vertical-align: middle; }

/* 快速录入表单 — 设备录入页 */
.fast-input-row .form-control,
.fast-input-row .form-select {
  border-radius: 6px;
}
.fast-input-row:focus-within {
  background-color: #fffff0;
  border-radius: 8px;
}

/* 最近录入列表 */
#recentList .list-group-item {
  padding: .4rem .75rem;
  font-size: .85rem;
}

/* 结账规划页 — 设备选择面板 */
.equipment-item {
  cursor: pointer;
  transition: background .15s;
}
.equipment-item:hover { background-color: #e8f4fd; }
.equipment-item.checked { background-color: #cfe2ff; }
.equipment-item.unavailable {
  opacity: .5;
  cursor: not-allowed;
  text-decoration: line-through;
}
.equipment-item.unavailable:hover { background-color: inherit; }

/* 选中计数浮动条 */
#selectedBar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  padding: .6rem 1rem;
  background: #0d6efd;
  color: #fff;
  font-size: .9rem;
  display: none;
  box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}

/* 标签打印样式 — 仅打印时生效 */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .label-page {
    width: 50mm;
    height: 30mm;
    page-break-after: always;
    overflow: hidden;
  }
}

/* 移动端适配 */
@media (max-width: 576px) {
  h5 { font-size: 1rem; }
  .card-body { padding: .75rem; }
  .table { font-size: .82rem; }
  .btn-sm { font-size: .78rem; }
  /* 主导航折叠时撑开 */
  .navbar-collapse { background: #fff; padding: .5rem 1rem; border-top: 1px solid #dee2e6; }
  /* 隐藏桌面端列 */
  .desktop-only { display: none !important; }
}

/* 覆写钉钉 webview 默认字体放大 */
input, select, textarea {
  font-size: 16px !important; /* 防止 iOS 自动缩放 */
}
@media (min-width: 768px) {
  input, select, textarea { font-size: 14px !important; }
}

/* 加载占位 */
.skeleton {
  background: linear-gradient(90deg,#e9ecef 25%,#dee2e6 50%,#e9ecef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
  height: 1em;
  display: inline-block;
  width: 100%;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toast 通知 */
#toastContainer {
  position: fixed;
  top: 70px; right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
