/* 小商超 AI 化 - 采购收货单 自定义样式
   基础样式来自 weui 1.1.3, 这里只补充业务相关
   2026-08-28
*/

:root {
  --color-primary: #1aad19;
  --color-warn: #e64340;
  --color-text: #191919;
  --color-text-secondary: #888;
  --color-bg: #efeff4;
  --color-card: #fff;
  --color-border: #e5e5e5;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 顶部条 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 500;
}
.app-header .back { color: #fff; text-decoration: none; font-size: 18px; }
.app-header .title { flex: 1; text-align: center; }
.app-header .right { font-size: 14px; opacity: 0.9; min-width: 40px; text-align: right; position: relative; }

/* === 用户栏 (2026-08-29 新增) === */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.user-chip:active { background: rgba(255, 255, 255, 0.28); }
.user-chip .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
}
.user-chip .meta { line-height: 1.1; max-width: 90px; overflow: hidden; }
.user-chip .name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .role { font-size: 10px; opacity: 0.85; }
.user-chip .caret { font-size: 10px; opacity: 0.7; }
.user-menu {
  position: absolute;
  top: 100%; right: 0;
  margin-top: 6px;
  background: #fff;
  color: var(--color-text);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 120px;
  z-index: 100;
  overflow: hidden;
}
.user-menu__item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}
.user-menu__item:active { background: #f0f0f0; }

/* 内容区 */
.app-body { padding: 12px 12px 80px; }
.app-card { background: var(--color-card); border-radius: 6px; padding: 12px; margin-bottom: 12px; }

/* 加载/空态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}
.empty-state .icon { font-size: 56px; opacity: 0.3; margin-bottom: 12px; }

/* 列表项 */
.session-item {
  background: #fff;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.session-item:active { background: #f5f5f5; }
.session-item .meta { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; }
.session-item .badge {
  display: inline-block;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  margin-right: 4px;
}
.session-item .arrow { color: #ccc; font-size: 18px; }

/* 供应商选择 */
.supplier-picker {
  background: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
}
.supplier-picker .label { color: var(--color-text-secondary); }
.supplier-picker .value { font-weight: 500; }
.supplier-picker .arrow { color: #ccc; margin-left: 8px; }

/* 上传预览缩略图 */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb {
  width: 80px; height: 80px; border-radius: 4px;
  background-size: cover; background-position: center; background-color: #ddd;
  position: relative;
}
.thumb .remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-warn); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
}

/* 详情页 - 大图 gallery */
.gallery {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9); z-index: 100;
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
.gallery.show { display: flex; }
.gallery img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.gallery .nav {
  color: #fff; position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 36px; padding: 12px; cursor: pointer; user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.gallery .nav.prev { left: 4px; }
.gallery .nav.next { right: 4px; }
.gallery .indicator { color: #fff; margin-top: 12px; font-size: 14px; }
.gallery .close-btn {
  position: absolute; top: 12px; right: 12px;
  color: #fff; font-size: 30px; cursor: pointer;
}

/* 详情页 - 行表格 */
.row-card {
  background: #fff;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.row-card.removed { opacity: 0.4; }
.row-card .seq {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-bg); color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.row-card .info { flex: 1; min-width: 0; }
.row-card .name {
  font-weight: 500; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-card .barcode { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; }
.row-card .meta {
  font-size: 11px; color: var(--color-text-secondary); margin-top: 4px;
}
.row-card .meta .plan { color: var(--color-primary); font-weight: 500; }
.row-card .qty-ctl {
  display: flex; align-items: center; gap: 4px;
}
.row-card .qty-ctl input {
  width: 50px; text-align: center; border: 1px solid var(--color-border);
  border-radius: 4px; padding: 4px; font-size: 14px;
}
.row-card .qty-ctl .step {
  width: 24px; height: 24px; border-radius: 4px;
  background: var(--color-bg); color: var(--color-text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}
.row-card .reject-btn {
  background: var(--color-warn); color: #fff;
  border: 0; border-radius: 4px; padding: 4px 8px;
  font-size: 12px; cursor: pointer;
}
.row-card .restore-btn {
  background: var(--color-primary); color: #fff;
  border: 0; border-radius: 4px; padding: 4px 8px;
  font-size: 12px; cursor: pointer;
}

/* 底部固定操作栏 */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--color-border);
  padding: 10px 12px; display: flex; gap: 10px;
  z-index: 10;
}
.bottom-bar .weui-btn { flex: 1; margin: 0; }

/* toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78); color: #fff;
  padding: 12px 20px; border-radius: 6px; font-size: 14px;
  z-index: 200; display: none; max-width: 80vw; text-align: center;
}
.toast.show { display: block; }

/* modal sheet (weui 风格简化) */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
  display: none; align-items: flex-end;
}
.modal-mask.show { display: flex; }
.modal-sheet {
  background: #fff; width: 100%;
  border-top-left-radius: 12px; border-top-right-radius: 12px;
  max-height: 80vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-sheet .sheet-title {
  padding: 14px; text-align: center; font-size: 14px;
  color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border);
}
.modal-sheet .sheet-option {
  padding: 14px; text-align: center; border-bottom: 1px solid var(--color-border);
  cursor: pointer; font-size: 16px;
}
.modal-sheet .sheet-option:active { background: #f5f5f5; }
.modal-sheet .sheet-cancel {
  margin-top: 8px; background: #f5f5f5;
  padding: 14px; text-align: center; color: var(--color-warn);
  font-size: 16px; cursor: pointer;
}

/* 阻止 weui 默认 button 样式干扰 */
button { -webkit-appearance: none; }
input, select, textarea { -webkit-appearance: none; }

/* 全站页脚用 weui 自带的 .weui-footer + .weui-footer__text, 见每个 HTML 末尾 */

/* 内容区给页脚留出空间 (避免被 bottom-bar 遮住) */
.app-body { padding-bottom: 80px; }


