/* 丫丫网购 · 伴手礼配礼档案系统 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F6F2EA; color: #2B2523; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hide { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; color: #2B2523; outline: none; }

/* ---------- 登录 ---------- */
#loginScreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; background: #652025; padding: 0 24px;
}
#loginScreen .brand {
  width: 74px; height: 74px; border-radius: 20px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #F0D9A8; margin-bottom: 18px; letter-spacing: -2px;
}
#loginScreen h1 { font-size: 21px; color: #fff; letter-spacing: 3px; font-weight: 500; }
#loginScreen .sub { font-size: 12px; color: rgba(255,255,255,.55); margin: 8px 0 32px; letter-spacing: 1px; }
.auth-box { width: 100%; max-width: 300px; }
.auth-box input {
  width: 100%; padding: 13px 14px; border: 1.5px solid rgba(255,255,255,.18); border-radius: 10px;
  background: rgba(255,255,255,.94); margin-bottom: 10px; text-align: center; font-size: 16px;
}
.auth-box input:focus { border-color: #E7781D; }
/* 密码框用 * 掩盖（不显示明文） */
#loginPass { -webkit-text-security: asterisk; letter-spacing: 3px; }
.auth-box .tip { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 10px; }
.auth-box button {
  width: 100%; padding: 13px 0; border-radius: 10px; background: #E7781D; color: #fff;
  font-size: 16px; letter-spacing: 6px; margin-top: 6px;
}
.auth-box button:active { background: #C9660F; }
#loginErr { font-size: 13px; color: #FFB3AB; margin-top: 12px; min-height: 18px; text-align: center; }

/* ---------- 顶部 ---------- */
.topbar {
  background: #652025; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
}
.topbar .tt { font-size: 16px; letter-spacing: 1px; font-weight: 500; }
.topbar .tt small { display: block; font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: 0; margin-top: 2px; font-weight: 400; }
.topbar .acts { display: flex; gap: 8px; align-items: center; }
.topbar .acts button {
  color: rgba(255,255,255,.82); font-size: 12px; padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.24); border-radius: 14px;
}
.topbar .acts button:active { background: rgba(255,255,255,.14); }

/* ---------- Tab ---------- */
.tabs { display: flex; background: #652025; padding: 0 8px; position: sticky; top: 57px; z-index: 29; }
.tabs .tab {
  flex: 1; text-align: center; padding: 11px 0 9px; color: rgba(255,255,255,.6);
  font-size: 14px; border-bottom: 2px solid transparent;
}
.tabs .tab.on { color: #fff; border-bottom-color: #E7781D; font-weight: 500; }

/* ---------- 布局 ---------- */
.wrap { max-width: 900px; margin: 0 auto; padding: 12px 12px 90px; }
.panel { display: none; }
.panel.on { display: block; }

/* ---------- 搜索与筛选 ---------- */
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input {
  flex: 1; padding: 11px 13px; border: 1px solid #E8E1D6; border-radius: 10px; background: #fff;
}
.searchbar input:focus { border-color: #C08A3E; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select {
  padding: 8px 10px; border: 1px solid #E8E1D6; border-radius: 9px; background: #fff; font-size: 13px;
}
.filters input[type=date] { min-width: 132px; }
.filters .clear {
  padding: 8px 12px; border: 1px solid #E8E1D6; border-radius: 9px; background: #fff; font-size: 13px; color: #8A817A;
}

/* ---------- 统计条 ---------- */
.statbar { display: flex; gap: 8px; margin-bottom: 12px; }
.statbar .s {
  flex: 1; background: #fff; border: 1px solid #EDE7DC; border-radius: 11px; padding: 10px 6px; text-align: center;
}
.statbar .s b { display: block; font-size: 18px; font-weight: 500; color: #652025; }
.statbar .s span { font-size: 11px; color: #9C938B; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid #EDE7DC; border-radius: 13px;
  padding: 13px; margin-bottom: 10px;
}
.card:active { border-color: #E0D3BC; }
.card .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card .title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.card .code { font-size: 11px; color: #A79D94; margin-top: 3px; letter-spacing: .5px; }
.card .meta { margin-top: 9px; font-size: 13px; color: #5C534D; line-height: 1.75; }
.card .body { display: flex; gap: 12px; align-items: flex-start; }
.card .body .meta { flex: 1 1 auto; min-width: 0; }
.card .body .thumbs { flex: 0 0 auto; flex-direction: column; margin-top: 9px; }
.card .meta i { color: #A79D94; font-style: normal; }
.card .meta .kv { color: #2B2523; }
.card .foot {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed #EFE9DE;
  display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8A817A;
}
.card .price { font-size: 15px; color: #652025; font-weight: 500; }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap;
  background: #F1EEE8; color: #7A716A;
}
.badge.b-待配置 { background: #FAEEDA; color: #854F0B; }
.badge.b-已下单 { background: #E6F1FB; color: #185FA5; }
.badge.b-已送达 { background: #EAF3DE; color: #3B6D11; }
.badge.b-已完成 { background: #E1F5EE; color: #0F6E56; }
.badge.b-已取消 { background: #F1EFE8; color: #888780; }

.thumbs { display: flex; gap: 8px; margin-top: 9px; overflow: hidden; align-items: center; }
.thumbs img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; border: 1px solid #EFE9DE; }
.thumbs .tn { font-size: 13px; color: #A79D94; }

.empty { text-align: center; color: #A79D94; font-size: 13px; padding: 44px 0; line-height: 2; }

/* ---------- 排期 ---------- */
.daygroup { margin-bottom: 14px; }
.dayhead {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5C534D; margin-bottom: 8px; padding-left: 2px;
}
.dayhead .d { font-size: 15px; font-weight: 500; color: #652025; }
.dayhead .today { background: #E7781D; color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 8px; }
.dayhead .n { font-size: 11px; color: #A79D94; }

/* ---------- 客户 ---------- */
.cu { background: #fff; border: 1px solid #EDE7DC; border-radius: 12px; padding: 12px; margin-bottom: 9px; }
.cu .n { font-size: 15px; font-weight: 500; }
.cu .c { font-size: 13px; color: #5C534D; margin-top: 5px; line-height: 1.7; }
.cu .st { font-size: 12px; color: #8A817A; margin-top: 5px; }
.cu .st b { color: #652025; font-weight: 500; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 11px 16px; border-radius: 10px; background: #652025; color: #fff;
  font-size: 14px; text-align: center;
}
.btn.ghost { background: #fff; color: #652025; border: 1px solid #E3D5BC; }
.btn.gold { background: #C08A3E; }
.btn.danger { background: #C0392B; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { display: block; width: 100%; }
.btn:active { opacity: .85; }
.btnrow { display: flex; gap: 8px; }

.fab {
  position: fixed; right: 18px; bottom: 26px; width: 56px; height: 56px; border-radius: 50%;
  background: #E7781D; color: #fff; font-size: 26px; line-height: 56px; text-align: center;
  z-index: 40; box-shadow: 0 4px 14px rgba(101,32,37,.28);
}

/* ---------- 编辑页 ---------- */
.sheet {
  position: fixed; inset: 0; background: #F6F2EA; z-index: 60; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet .head {
  background: #652025; color: #fff; padding: 12px 14px; display: flex;
  align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.sheet .head .t { font-size: 16px; font-weight: 500; }
.sheet .head button { color: rgba(255,255,255,.85); font-size: 13px; }
.sheet .body { max-width: 760px; margin: 0 auto; padding: 12px 12px 120px; }
.grp { background: #fff; border: 1px solid #EDE7DC; border-radius: 13px; padding: 13px; margin-bottom: 11px; }
.grp > h3 { font-size: 13px; color: #8A817A; font-weight: 500; margin-bottom: 10px; letter-spacing: .5px; }
.fld { margin-bottom: 9px; }
.fld:last-child { margin-bottom: 0; }
.fld label { display: block; font-size: 12px; color: #8A817A; margin-bottom: 5px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 10px 11px; border: 1px solid #E8E1D6; border-radius: 9px; background: #FCFAF6;
}
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: #C08A3E; background: #fff; }
.fld textarea { min-height: 66px; resize: vertical; line-height: 1.6; }
.grid2 { display: flex; gap: 9px; }
.grid2 > * { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 12px; border-radius: 15px; background: #F5F1E9; color: #6B625B; font-size: 13px;
  border: 1px solid #EDE7DC;
}
.chip.on { background: #652025; color: #fff; border-color: #652025; }

/* 品项行 */
.item {
  border: 1px solid #EDE7DC; border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #FCFAF6;
}
.item .hd { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.item .ititle { display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
.item .idx {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: #652025; color: #fff;
  font-size: 12px; line-height: 22px; text-align: center; margin-top: 1px;
}
.item .nm { font-size: 14px; font-weight: 500; line-height: 1.4; word-break: break-all; flex: 1 1 auto; min-width: 0; }
.item .del { color: #C0392B; font-size: 12px; padding: 3px 7px; border: 1px solid #F2D7D3; border-radius: 7px; background: #fff; flex: 0 0 auto; }
/* 货号与「数量 + 单位」同一行：货号在左，数量在右 */
.item .ctl { display: flex; gap: 8px; margin-top: 8px; align-items: center; justify-content: space-between; }
.item .ctl .code { font-size: 11px; color: #A79D94; min-width: 0; word-break: break-all; }
.item .ctl .code i { font-style: normal; color: #C6BCB0; margin-right: 3px; }
.item .ctl .qwrap { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.item .ctl input { width: 68px; padding: 7px 9px; border: 1px solid #E8E1D6; border-radius: 8px; background: #fff; font-size: 14px; text-align: center; }
.item .ctl .u { font-size: 12px; color: #A79D94; }

/* 商品搜索下拉 */
.poolbox { margin-bottom: 9px; }
.poolres { max-height: 250px; overflow-y: auto; border: 1px solid #EDE7DC; border-radius: 10px; background: #fff; margin-top: 7px; }
.poolres .p {
  padding: 10px 11px; border-bottom: 1px solid #F4F0E8; font-size: 13px; line-height: 1.5;
}
.poolres .p:last-child { border-bottom: none; }
.poolres .p:active { background: #FAF6EE; }
.poolres .p b { font-weight: 500; display: block; }
.poolres .p span { font-size: 11px; color: #A79D94; }
.poolres .tip { padding: 12px; font-size: 12px; color: #A79D94; text-align: center; }

/* 照片 */
.photogrid { display: flex; flex-wrap: wrap; gap: 8px; }
.photogrid .ph { position: relative; width: 86px; height: 86px; }
.photogrid .ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid #EDE7DC; }
.photogrid .ph .x {
  position: absolute; top: -6px; right: -6px; width: 21px; height: 21px; border-radius: 50%;
  background: #C0392B; color: #fff; font-size: 13px; line-height: 21px; text-align: center;
}
.phototip { width: 100%; font-size: 12px; color: #A79D94; padding: 10px 0; text-align: center; }
.phototip a { color: #652025; text-decoration: underline; }
/* 手机端唤起相册/相机：必须用 label 触发，且输入框不能 display:none（否则浏览器拒绝弹出选择器）
   用 position:fixed 而不是 left:-9999px，避免把弹层撑出横向滚动条 */
.filehide {
  position: fixed; top: 0; left: 0; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; border: none; padding: 0;
}
.photobtns { display: flex; gap: 8px; margin-top: 10px; }
.photobtns > button, .photobtns > .upwrap { flex: 1; }
/* 覆盖式上传：把真实的 file 框透明盖在按钮上，用户点到的就是原生控件，兼容性最好 */
.upwrap { position: relative; display: flex; }
.upwrap .btn { width: 100%; }
.ovfile {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; padding: 0; border: 0; z-index: 2;
}
/* 页面内相机弹层（getUserMedia，不依赖系统拍照意图） */
.cammodal {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.cammodal.hide { display: none; }
.caminner { width: 100%; height: 100%; display: flex; flex-direction: column; }
.caminner video { flex: 1; width: 100%; object-fit: contain; background: #000; }
.cambar { display: flex; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); justify-content: center; background: #000; }
.cambar .btn.ghost { color: #fff; border-color: #666; background: transparent; }

/* 扫码录入 */
.scanrow { display: flex; gap: 8px; margin-bottom: 10px; }
.scanrow input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #E8E1D6; border-radius: 9px;
  background: #fff; font-size: 14px;
}
.scanrow .btn { flex: 0 0 auto; padding: 10px 18px; }
/* 扫码取景框 */
.scanview { flex: 1; position: relative; overflow: hidden; background: #000; }
.scanview #scanView { position: absolute; inset: 0; }
.scanview video, .scanview canvas { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanview canvas.drawingBuffer { display: none !important; }
.scanframebox {
  position: absolute; left: 8%; right: 8%; top: 34%; height: 24%;
  border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px; pointer-events: none;
}
.scanline {
  position: absolute; left: 8%; right: 8%; top: 46%; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,60,60,0), #FF3C3C, rgba(255,60,60,0));
  animation: scansweep 2s linear infinite;
}
@keyframes scansweep {
  0%   { top: 34%; }
  100% { top: 58%; }
}
.scanhint { color: #E8E8E8; font-size: 13px; text-align: center; padding: 10px 16px 0; background: #000; }

.sheetfoot {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #EDE7DC;
  padding: 10px 12px; display: flex; gap: 9px; z-index: 61;
}
.sheetfoot .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 9px; width: 100%; }
.sheetfoot .btn { flex: 1; }

/* 详情块 */
.dtl { font-size: 13px; line-height: 2; color: #5C534D; }
.dtl b { color: #2B2523; font-weight: 500; }
.dtl .r { display: flex; gap: 8px; }
.dtl .r .k { color: #A79D94; min-width: 62px; }
.dtl b.saved { color: #B8860B; }

/* ---------- 分享页（给客人看，免登录） ---------- */
.share-page { background: #FBF8F3; min-height: 100vh; }
.share-hero {
  background: #652025; color: #fff; padding: 30px 20px 26px; text-align: center;
}
.share-hero .shop { font-size: 12px; letter-spacing: 3px; color: #E3C48C; }
.share-hero h1 { font-size: 21px; font-weight: 500; margin: 12px 0 8px; line-height: 1.45; }
.share-hero .tag {
  display: inline-block; font-size: 12px; padding: 3px 12px; border-radius: 11px;
  background: rgba(255,255,255,.14); color: #F0D9A8;
}
.share-hero .sub { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 12px; }
.share-body { max-width: 700px; margin: -14px auto 0; padding: 0 14px 40px; }
.share-card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(101,32,37,.06); }
.share-card h3 { font-size: 13px; color: #8A817A; font-weight: 500; margin-bottom: 11px; letter-spacing: .5px; }
.sitem { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #F1EDE4; font-size: 14px; }
.sitem:last-child { border-bottom: none; }
.sitem .n { line-height: 1.45; display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
.sitem .n .idx {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: #652025; color: #fff;
  font-size: 11px; line-height: 20px; text-align: center; font-weight: 400; margin-top: 1px;
}
.sitem .n .nm2 { word-break: break-all; }
.sitem .n > div > span { display: block; font-size: 11px; color: #A79D94; margin-top: 2px; }
.sitem .q { color: #652025; white-space: nowrap; }
.share-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.share-photos img { width: 100%; border-radius: 10px; display: block; border: 1px solid #F1EDE4; }
.share-total { display: flex; justify-content: space-between; font-size: 15px; padding-top: 4px; }
.share-total b { color: #652025; }
.share-saved { margin-top: 8px; font-size: 13px; color: #B8860B; }
/* 划线原价：有优惠时显示 */
.price-old { color: #B3A794; font-weight: 400; font-size: 12px; margin-right: 5px; text-decoration: line-through; }
.share-foot { text-align: center; font-size: 12px; color: #B3A794; padding: 6px 0 20px; line-height: 2; }

/* 看大图 */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .94);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.lightbox.hide { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lbclose {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 14px; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.lbnav {
  position: fixed; top: 50%; transform: translateY(-50%); width: 42px; height: 62px;
  border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 26px;
  align-items: center; justify-content: center; z-index: 2;
}
.lbprev { left: 10px; }
.lbnext { right: 10px; }
.lbcount {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.75); font-size: 12px; z-index: 2;
}
.photogrid .ph img { cursor: zoom-in; }
.share-photos img { cursor: zoom-in; }

/* 案例页标语 */
.share-slogan {
  background: #fff; border-radius: 14px; padding: 20px 18px 18px; margin-bottom: 12px;
  text-align: center; box-shadow: 0 2px 10px rgba(101,32,37,.06);
}
.share-slogan .ln { font-size: 15px; color: #652025; letter-spacing: 2px; line-height: 1.7; }
.share-slogan .ln2 { font-size: 12px; color: #A79D94; letter-spacing: 3px; margin-bottom: 2px; }
.share-slogan .divider { display: flex; align-items: center; gap: 10px; margin: 13px 0; }
.share-slogan .divider span { flex: 1; height: 1px; background: #EFE7D8; }
.share-slogan .divider i { color: #D9C08A; font-size: 11px; font-style: normal; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: rgba(43,37,35,.9); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 20px; z-index: 200; max-width: 80vw; text-align: center;
}
