/* ===== 进销存商城 - 手机端通用样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #333;
  -webkit-font-smoothing: antialiased;
}

/* 手机外框 */
.mobile-wrap {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5f5f5;
  position: relative;
  padding-bottom: 60px;
}

/* ===== 顶部状态栏 ===== */
.mobile-header {
  background: linear-gradient(135deg, #2256A4, #1a3a5c);
  color: #fff;
  padding: 44px 16px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-header.simple {
  padding: 44px 16px 12px;
}
.header-back {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
}
.header-back i {
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.header-back .back-btn {
  cursor: pointer;
}

/* ===== 底部导航栏 ===== */
.bottom-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  height: 56px;
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-tabbar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #999;
  cursor: pointer;
  transition: color .15s;
  gap: 2px;
  text-decoration: none;
}
.bottom-tabbar .tab-item i {
  font-size: 20px;
}
.bottom-tabbar .tab-item.active {
  color: #2256A4;
}
.bottom-tabbar .tab-item .badge {
  background: #E74C3C;
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(16px);
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

/* ===== 通用卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  margin: 10px 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  font-weight: 600;
}
.card-body {
  padding: 14px 16px;
}
.card-footer {
  padding: 12px 16px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
}

/* ===== 按钮 ===== */
.btn-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-mobile:active { opacity: 0.8; }
.btn-mobile-primary {
  background: linear-gradient(135deg, #2256A4, #1a3a5c);
  color: #fff;
}
.btn-mobile-danger {
  background: #E74C3C;
  color: #fff;
}
.btn-mobile-outline {
  background: #fff;
  border: 1px solid #ddd;
  color: #666;
}
.btn-mobile-block {
  display: flex;
  width: 100%;
  margin: 10px 0;
}
.btn-mobile-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}
.btn-mobile-green {
  background: #07c160;
  color: #fff;
}

/* ===== 列表项 ===== */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item .item-left { flex-shrink: 0; }
.list-item .item-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.list-item .item-center { flex: 1; }
.list-item .item-title { font-size: 14px; font-weight: 500; color: #333; }
.list-item .item-desc { font-size: 12px; color: #999; margin-top: 3px; }
.list-item .item-price { font-size: 16px; font-weight: 700; color: #E74C3C; }
.list-item .item-arrow { color: #ccc; font-size: 14px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #ccc;
}
.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}
.empty-state p {
  font-size: 14px;
  color: #999;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color .2s;
}
.form-control:focus {
  border-color: #2256A4;
}
textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-red { background: #fce4ec; color: #c62828; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-gray { background: #f5f5f5; color: #999; }

/* ===== Toast ===== */
.toast-mobile {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99999;
  max-width: 80%;
  text-align: center;
  animation: toastFadeIn .2s ease;
  pointer-events: none;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== 确认弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-mask .modal-box {
  background: #fff;
  border-radius: 14px;
  width: 85%;
  max-width: 340px;
  overflow: hidden;
  animation: scaleIn .2s ease;
}
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-mask .modal-title {
  text-align: center;
  padding: 20px 16px 0;
  font-size: 17px;
  font-weight: 600;
}
.modal-mask .modal-body {
  padding: 12px 16px 20px;
  text-align: center;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}
.modal-mask .modal-actions {
  display: flex;
  border-top: 1px solid #eee;
}
.modal-mask .modal-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  color: #2256A4;
  font-weight: 500;
}
.modal-mask .modal-actions button:first-child {
  border-right: 1px solid #eee;
  color: #999;
  font-weight: 400;
}
.modal-mask .modal-actions button.danger {
  color: #E74C3C;
}
.modal-mask .modal-actions button:active {
  background: #f5f5f5;
}

/* ===== 页面切换动画 ===== */
.page-fade-in {
  animation: pageIn .25s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 底部安全区域 ===== */
.safe-bottom {
  height: 60px;
}

/* ===== 搜索栏 ===== */
.search-bar {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #999;
  font-size: 13px;
}
.search-bar i { color: #ccc; }

/* ===== 积分/等级徽章 ===== */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.level-vip { background: linear-gradient(135deg, #f6d365, #fda085); color: #fff; }
.level-gold { background: linear-gradient(135deg, #ffecd2, #fcb69f); color: #8B4513; }
.level-silver { background: #e0e0e0; color: #666; }

/* ===== 可滚动内容区 ===== */
.scroll-area {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== 数量选择器 ===== */
.qty-selector {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.qty-selector button {
  width: 30px;
  height: 30px;
  border: none;
  background: #f5f5f5;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-selector button:active { background: #e0e0e0; }
.qty-selector input {
  width: 44px;
  height: 30px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-size: 14px;
  outline: none;
}

/* ===== 状态时间线 ===== */
.timeline {
  padding: 0 0 0 20px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #e0e0e0;
}
.timeline-item {
  position: relative;
  padding: 0 0 20px 16px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2256A4;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #2256A4;
}
.timeline-item.active::before {
  background: #07c160;
  box-shadow: 0 0 0 2px #07c160;
}
.timeline-item .time {
  font-size: 12px;
  color: #999;
}
.timeline-item .text {
  font-size: 14px;
  color: #333;
  margin-top: 3px;
}
