/* ==========================================================================
   管理后台
   ========================================================================== */
.admin-body { background: #F6F7F4; }
.adm { display: flex; min-height: 100vh; }
.adm-side {
  width: 224px; flex: 0 0 auto; background: #16211C; color: #C8D2CC; padding: 18px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.adm-brand { display: flex; align-items: center; gap: 9px; padding: 0 6px 16px; color: #fff; }
.adm-brand b { display: block; font-size: 14.5px; letter-spacing: .3px; }
.adm-brand i { font-size: 10.5px; color: #7E8C84; letter-spacing: 1.4px; }
#admNav { flex: 1; overflow-y: auto; }
#admNav::-webkit-scrollbar { width: 0; }
.nav-group { font-size: 10.5px; color: #5E6B64; padding: 14px 10px 6px; letter-spacing: 1px; }
#admNav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: #B7C1BB; cursor: pointer; margin-bottom: 1px; transition: all .15s;
}
#admNav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
#admNav a.on { background: #2F9C6B; color: #fff; font-weight: 500; }
#admNav a span { font-size: 14px; width: 18px; text-align: center; }
.badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: #E8523F; color: #fff; font-size: 10.5px; display: none; place-items: center; font-weight: 600;
}
.badge.show { display: grid; }
.adm-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.adm-foot a { font-size: 12.5px; color: #8A968F; padding: 6px 10px; border-radius: 6px; }
.adm-foot a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.adm-main { flex: 1; min-width: 0; padding: 22px 26px 50px; }
.adm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 14px; flex-wrap: wrap; }
.adm-head h1 { font-size: 21px; letter-spacing: -.3px; }
.adm-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* 卡片与表格 */
.grid-kpi { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 17px; position: relative; overflow: hidden;
}
.stat .lb { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.stat .vv { font-family: var(--num); font-size: 27px; font-weight: 650; letter-spacing: -.8px; margin-top: 6px; }
.stat .vv small { font-family: var(--font); font-size: 12px; color: var(--ink-3); margin-left: 3px; font-weight: 500; }
.stat .df { font-size: 11.5px; margin-top: 3px; color: var(--ink-3); }
.stat .df.up { color: #1F9D62; } .stat .df.down { color: #D9534F; }
.stat.accent { background: linear-gradient(135deg, #1F7A56, #2F9C6B); color: #fff; border-color: transparent; }
.stat.accent .lb, .stat.accent .vv small, .stat.accent .df { color: rgba(255, 255, 255, .78); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.panel-h b { font-size: 14.5px; }

table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11.5px; padding: 9px 10px; background: #FAFBF9; white-space: nowrap; }
.tb th:first-child { border-radius: 8px 0 0 8px; } .tb th:last-child { border-radius: 0 8px 8px 0; }
.tb td { padding: 11px 10px; border-bottom: 1px solid #F2F4F1; vertical-align: middle; }
.tb tr:last-child td { border-bottom: 0; }
.tb tbody tr:hover { background: #FCFDFB; }
.tb .nm { font-weight: 500; }
.tb-wrap { overflow-x: auto; margin: 0 -6px; }
.avs { display: flex; align-items: center; gap: 8px; }
.avs .avatar { width: 30px; height: 30px; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 500; background: #F2F4F1; color: var(--ink-2); white-space: nowrap;
}
.chip.g { background: #E8F5EC; color: #1F7A56; }
.chip.o { background: #FFF1E6; color: #C2601F; }
.chip.b { background: #EAF0FE; color: #3B5BCC; }
.chip.r { background: #FDECEA; color: #C0392B; }
.chip.p { background: #F3EDFD; color: #7048C7; }

.seg { display: flex; gap: 4px; background: #F2F4F1; padding: 3px; border-radius: 9px; }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.spark i { flex: 1; background: #D9EFE4; border-radius: 3px 3px 1px 1px; min-height: 2px; }
.spark i:last-child { background: var(--brand); }

.hbar { height: 7px; border-radius: 99px; background: #F0F3EF; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4FC08D, #1F7A56); }

/* 客服工作台 */
.cs-console { display: grid; grid-template-columns: 290px 1fr; gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.cs-list-wrap { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cs-filter { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.cs-filter button { flex: 1; border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-2); padding: 6px 0; border-radius: 7px; cursor: pointer; transition: background .14s, color .14s; }
.cs-filter button:hover { background: #F5F8F5; }
.cs-filter button.on { background: var(--brand); color: #fff; font-weight: 600; }
.cs-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.cs-unread { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #F5733A; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 600; display: inline-grid; place-items: center; }
.cs-item { padding: 12px 14px; border-bottom: 1px solid #F3F5F2; cursor: pointer; transition: background .14s; }
.cs-item:hover { background: #FAFBF9; }
.cs-item.on { background: #F0F8F3; border-left: 3px solid var(--brand); padding-left: 11px; }
.cs-thread { background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.cs-thread .hd { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cs-thread .bd { flex: 1; overflow-y: auto; padding: 16px; background: #FAFBF9; display: flex; flex-direction: column; gap: 10px; }
.cs-thread .ft { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(3, 1fr); }
  .adm-side { width: 190px; }
  .cs-console { grid-template-columns: 1fr; height: auto; }
  .cs-list { max-height: 220px; }
  .cs-thread { height: 520px; }
}
@media (max-width: 720px) {
  .adm { flex-direction: column; }
  .adm-side { width: 100%; height: auto; position: static; }
  #admNav { display: flex; overflow-x: auto; gap: 4px; }
  .nav-group { display: none; }
  #admNav a { white-space: nowrap; font-size: 12.5px; }
  .badge { display: none; }
  .adm-main { padding: 16px; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .adm-head h1 { font-size: 18px; }
}

/* ---------------- 商品池 / 选品相关 ---------------- */
.pick-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick-row:hover { background: #F7F9F7; }
.pick-row input[type="checkbox"], .check-inline input[type="checkbox"] { width: 15px; height: 15px; accent-color: #2F9C6B; cursor: pointer; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.link-b { color: #2F9C6B; font-weight: 600; cursor: pointer; border-bottom: 1px dashed rgba(47, 156, 107, .5); }
.link-b:hover { color: #1F7A56; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- 商家选品中心 ---------------- */
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.pool-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; position: relative; transition: box-shadow .2s, border-color .2s; }
.pool-card:hover { box-shadow: 0 6px 18px rgba(20, 40, 30, .07); }
.pool-card.on { border-color: #2F9C6B; background: #FBFEFC; }
.pool-card .pc-top { display: flex; gap: 10px; align-items: flex-start; }
.pool-card .pc-ico { width: 40px; height: 40px; border-radius: 10px; background: #FFF6E9; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.pool-card .pc-nm { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.pool-card .pc-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.pool-card .pc-price { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.pool-card .pc-price b { font-family: var(--num); font-size: 17px; color: #C2471B; }
.pool-card .pc-price s { font-size: 11.5px; color: var(--ink-3); }
.pool-card .pc-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.pool-card .pc-pick { position: absolute; top: 10px; right: 10px; }
.pool-card .pc-pick input { width: 18px; height: 18px; accent-color: #2F9C6B; cursor: pointer; }
.pool-card .pc-done { position: absolute; top: 9px; right: 9px; font-size: 11px; background: #E8F5EC; color: #1F7A56; padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.pool-bar { position: sticky; bottom: 0; margin-top: 12px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 16px rgba(20, 40, 30, .06); }
.pool-bar .pb-n { font-size: 13px; }
.pool-bar .pb-n b { font-family: var(--num); color: #C2471B; font-size: 16px; }

/* 字段编辑行 */
.xf { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.xf .input, .xf .select { height: 34px; font-size: 12px; }

/* ============================ 登录层 ============================ */
.adm-login {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 600px at 25% 10%, #EAF6EF 0%, #F6F7F4 55%, #EFF2ED 100%);
}
.adm-login[hidden] { display: none; }
.lg-card {
  width: 380px; max-width: calc(100vw - 32px); background: #fff;
  border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px 20px;
  box-shadow: 0 18px 50px -18px rgba(20, 60, 40, .22);
}
.lg-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.lg-brand b { display: block; font-size: 16px; letter-spacing: .2px; }
.lg-brand i { font-size: 11px; color: var(--ink-3); font-style: normal; letter-spacing: 2px; }
.lg-err { min-height: 18px; font-size: 12px; color: #C0392B; margin: 2px 0 10px; }
.lg-err.ok { color: #1F7A56; }
.btn-block { width: 100%; height: 42px; justify-content: center; font-size: 14px; }
.lg-demo { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.lg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chips button {
  border: 1px solid var(--line); background: #FAFBF9; color: var(--ink-2);
  font-size: 11.5px; padding: 5px 9px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.lg-chips button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 顶栏身份卡 */
.adm-user {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 99px;
}
.au-av {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 600;
}
.au-info { line-height: 1.15; padding-right: 2px; }
.au-info b { display: block; font-size: 12px; font-weight: 600; }
.au-info i { display: block; font-size: 10px; color: var(--ink-3); font-style: normal; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-out {
  border: 0; background: #F4F5F2; color: var(--ink-3); font-size: 11px;
  padding: 5px 10px; border-radius: 99px; cursor: pointer;
}
.au-out:hover { background: #FDECEA; color: #C0392B; }

/* 权限化：隐藏无权元素 */
[hidden] { display: none !important; }
[data-denied] { display: none !important; }

/* 订单信息保护 */
.pt-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px;
  padding: 2px 7px; border-radius: 99px; background: #FFF4E8; color: #C2471B;
  border: 1px solid #F8DCC4; white-space: nowrap;
}
.pt-chip b { font-family: var(--num); font-weight: 600; }
.pt-box {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  background: #FFF9F2; border: 1px solid #F8E3CE; border-radius: 10px; margin-top: 12px;
}
.pt-box .pi { font-size: 16px; line-height: 1.2; }
.pt-box .pt-t { font-size: 12px; color: #8A5A2B; }
.pt-box .pt-t b { font-family: var(--num); color: #C2471B; }
.pt-box .pt-s { font-size: 10.5px; color: #A98562; margin-top: 2px; }
.pt-done { background: #F2F6F2; border-color: #DDE7DE; }
.pt-done .pt-t { color: var(--ink-2); }

/* 管理员与权限 */
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.perm-grp { font-size: 11px; color: var(--ink-3); margin: 10px 0 5px; letter-spacing: .5px; }
.perm-grp:first-child { margin-top: 0; }
.perm-item {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer;
  padding: 5px 8px; border-radius: 8px; border: 1px solid transparent;
}
.perm-item:hover { background: #FAFBF9; }
.perm-item input { accent-color: var(--brand); }
.cm-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-pick label {
  display: flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer;
  padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff;
}
.cm-pick input { accent-color: var(--brand); }
.cm-pick label.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.role-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; }
.role-tag.super { background: #FFF0E8; color: #C2471B; }
.role-tag.community { background: var(--brand-soft); color: var(--brand); }

/* 客服实时连接徽标 */
.cs-live {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-size: 10.5px; padding: 1px 7px; border-radius: 9px;
  background: #F2F4F1; color: var(--ink-3); font-weight: 400;
  vertical-align: middle; transition: background .2s, color .2s;
}
.cs-live.g { background: #E8F6ED; color: #1F7A56; }
.cs-live.g::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: #2FA36B;
  animation: csPulse 1.6s ease-in-out infinite;
}
.cs-live.w { background: #FFF4E2; color: #A9701A; }
@keyframes csPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------------------------------------------------------------- 生日申领审核 */
.tb img.bshot {
  width: 46px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line);
  cursor: zoom-in; transition: transform .16s, box-shadow .16s; background: #f3f5f3;
}
.tb img.bshot:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(0,0,0,.14); }

/* 证件放大对照：两张图并排，看不清号码时点开详情看原图 */
.bzoom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .bzoom { grid-template-columns: 1fr; } }
.bzoom img {
  width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--line); background: #F7F9F7;
}
.field label em.req { color: #C2471B; font-style: normal; margin-left: 2px; }

/* ---------------------------------------------------------------- 支付方式开关 */
.pms-row:last-child { border-bottom: 0; }
.sw { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 44px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw span {
  position: absolute; inset: 0; border-radius: 99px; background: #D9DEDA;
  transition: background .2s;
}
.sw span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .2s;
}
.sw input:checked + span { background: var(--brand, #1F7A56); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw input:disabled + span { opacity: .5; }
.sw input:focus-visible + span { box-shadow: 0 0 0 3px rgba(31,122,86,.18); }
