/* 基础样式 */
:root {
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  min-height: 100vh;
}

/* 登录页 */
.login-container {
  max-width: 400px;
  margin: 10vh auto 0;
  padding: 0 16px;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar .nav-link {
  border-radius: 6px;
  margin-bottom: 2px;
  padding: 10px 14px;
  font-size: 14px;
  transition: background 0.2s;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.1);
}

.sidebar .nav-link.active {
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}

#page-content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* 导航栏顶部条 */
.navbar { height: 56px; }

/* 卡片与表格 */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.table th {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  background: #f8f9fa;
}

.table td {
  font-size: 13px;
  vertical-align: middle;
}

/* 按钮触碰优化（移动端） */
.btn {
  min-height: 38px;
  touch-action: manipulation;
}

.btn-lg {
  min-height: 48px;
}

/* 表单控件 */
.form-control, .form-select {
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  #page-content-wrapper {
    margin-left: 0 !important;
  }

  .table-responsive { -webkit-overflow-scrolling: touch; }

  .btn { min-height: 44px; font-size: 14px; }

  .pagination { flex-wrap: wrap; justify-content: center; }
}

/* 打印样式 */
@media print {
  .sidebar, .navbar, .btn, #sidebarToggle, .no-print { display: none !important; }
  #page-content-wrapper { margin-left: 0 !important; }
  .card { box-shadow: none; border: none; }
  body { background: #fff; }

  .print-only { display: block !important; }
}

.print-only { display: none; }

/* 来源颜色 */
.source-wechat   { color: #28a745; font-weight: 600; }
.source-taobao   { color: #fd7e14; font-weight: 600; }
.source-douyin   { color: #000000; font-weight: 600; }
.source-xianyu   { color: #cc9900; font-weight: 600; }
.source-jingdong { color: #dc3545; font-weight: 600; }

/* 镜架品牌分组 */
.frame-brand-top    { color: #0d6efd; }
.frame-brand-middle { color: #6f42c1; }
.frame-brand-bottom { color: #dc3545; }

/* 快递公司背景色 */
.courier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}

/* 扫码区域 */
#scanner-container {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

#scanner-container video {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}
