/* 地址库 · 登录 / 注册 / 后台 共用样式 */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f2f2f2;
  color: #141414;
}

a { color: #8a5a00; }

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #f6fbff;
  border: 2px solid #141414;
  border-radius: 16px;
  box-shadow: 6px 6px 0 #141414;
  padding: 30px 26px 24px;
}

/* 登录 / 注册页：白色卡片，无粗边框与投影 */
body:not(.admin-body) .auth-card {
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}
body:not(.admin-body) .field input {
  border: 1px solid #d6d6d6;
  border-radius: 10px;
}
body:not(.admin-body) .btn {
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}
body:not(.admin-body) .btn:hover,
body:not(.admin-body) .btn:active,
body:not(.admin-body) .btn:disabled {
  transform: none;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand .logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: #7dd3fc;
  border: 2px solid #141414;
  border-radius: 10px;
}

.brand h1 { font-size: 20px; margin: 0; letter-spacing: 1px; }

.sub {
  font-size: 13px;
  color: #5b6b7a;
  line-height: 1.7;
  margin: 8px 0 18px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #141414;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 9px;
  outline: none;
  transition: box-shadow .15s;
}

.field input:focus { box-shadow: 0 0 0 3px rgba(56, 189, 248, .45); }
.field input::placeholder { color: #9b9488; }

.btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 2px;
  color: #141414;
  background: #7dd3fc;
  border: 2px solid #141414;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #141414;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #141414; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #141414; filter: brightness(.85); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 #141414; }

.btn.small {
  width: auto;
  padding: 6px 12px;
  font-size: 12.5px;
  letter-spacing: 0;
  border-width: 1.5px;
  border-radius: 7px;
  box-shadow: 2px 2px 0 #141414;
}

.btn.ghost { background: #f6fbff; }
.btn.danger { background: #ffb3a7; }
.btn.good { background: #b7e4c7; }
.btn.plain { background: transparent; box-shadow: none; border-color: #bdb5a5; color: #5b6b7a; }

.tip {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #5b6b7a;
  background: #fff8e1;
  border: 1px dashed #c9b98f;
  border-radius: 9px;
  min-height: 0;
}

.msg { margin: 12px 0 0; font-size: 13px; line-height: 1.6; min-height: 18px; }
.msg.err { color: #c02617; }
.msg.good { color: #1b7a43; }

.foot-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #d8cfbd;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ---------------- 后台 ---------------- */
body.admin-body {
  display: block;
  padding: 0;
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .03) 0 2px, transparent 2px 12px),
    #efe6d4;
}

/* 未登录时登录卡片在页面正中 */
body.admin-body.auth-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.admin-wrap { max-width: 96vw; margin: 0 auto; padding: 22px 16px 46px; }

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f6fbff;
  border: 2px solid #141414;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #141414;
}

.admin-head .title { font-size: 18px; font-weight: 700; margin: 0; }
.admin-head .who { font-size: 13px; color: #5b6b7a; margin: 4px 0 0; }

.panel {
  margin-top: 16px;
  padding: 16px;
  background: #f6fbff;
  border: 2px solid #141414;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #141414;
}

.panel[hidden] { display: none !important; }

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 2px 10px;
  margin-top: 8px;
  border-bottom: 2px solid #141414;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #dceffb;
}

.admin-tab {
  flex: 0 0 auto;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
  color: #141414;
  background: #f6fbff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #141414;
  cursor: pointer;
}

.admin-tab.is-active {
  background: #7dd3fc;
  transform: translateY(1px);
  box-shadow: none;
}

.panel h2 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.stat {
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 10px;
}

.stat .k { font-size: 12px; color: #5b6b7a; }
.stat .v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.stat .v small { font-size: 12px; font-weight: 600; color: #5b6b7a; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar input, .toolbar select {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #141414;
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.toolbar input:focus, .toolbar select:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.inline-form input {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #141414;
  border-radius: 8px;
  background: #fff;
  outline: none;
  min-width: 150px;
}

.inline-form input:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.inline-form select {
  padding: 8px 30px 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #141414;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23141414' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 12px 8px;
  border: 1.5px solid #141414;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 92px;
}

.inline-form select:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.inline-form textarea {
  flex: 1 1 320px;
  min-width: 200px;
  min-height: 56px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  border: 1.5px solid #141414;
  border-radius: 8px;
  background: #fff;
  outline: none;
  resize: vertical;
}

.inline-form textarea:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.empty { padding: 22px; text-align: center; color: #8b8478; font-size: 13px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }

th, td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid #e6ddc9;
  white-space: nowrap;
  vertical-align: middle;
}

th { font-size: 12.5px; color: #5b6b7a; font-weight: 700; background: #fdf6e3; }
tbody tr:hover { background: #fffaf0; }

td.wrap { white-space: normal; min-width: 200px; word-break: break-all; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #141414;
}

.badge.active { background: #b7e4c7; }
.badge.pending { background: #ffe9a8; }
.badge.expired { background: #ffd0c7; }
.badge.disabled { background: #ddd7cc; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 前端页面内容（地址库编辑） ---------- */
.lib-empty {
  margin: 0 0 12px;
  padding: 18px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #5b6b7a;
  background: #f4fafe;
  border: 2px dashed #141414;
  border-radius: 10px;
}

.lib-channel {
  padding: 12px 14px 13px;
  margin-bottom: 10px;
  background: #fff;
  border: 1.5px solid #141414;
  border-left: 6px solid #0ea5e9;
  border-radius: 10px;
}

.lib-channel.fixed-pdd { border-left: 6px solid #0ea5e9; }
.lib-channel.guangzhou { border-left: 6px solid #e88b8b; }
.lib-channel.jingdong { border-left: 6px solid #d63b2f; }
.lib-channel.tpl-blue { border-left: 6px solid #2d7aff; }
.lib-channel.tpl-green { border-left: 6px solid #2f9e44; }
.lib-channel.tpl-purple { border-left: 6px solid #7048e8; }

.lib-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 700;
}

.lib-head .lib-total {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #5b6b7a;
  white-space: nowrap;
  background: #f7f2e4;
  border-radius: 999px;
}

.lib-tpl-name {
  flex: 1 1 200px;
  min-width: 140px;
  padding: 6px 10px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 700;
  color: #141414;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  outline: none;
}

.lib-tpl-name:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.lib-tpl-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }

.lib-color { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #5b6b7a; }

.lib-color select {
  padding: 5px 7px;
  font-size: 12.5px;
  font-family: inherit;
  color: #141414;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 7px;
  outline: none;
}

.lib-color input[type="color"] {
  width: 40px;
  height: 28px;
  padding: 2px;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 7px;
  cursor: pointer;
}

.lib-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.lib-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.lib-color input[type="color"]::-moz-color-swatch { border: none; border-radius: 4px; }

.lib-channel.is-collapsed { padding: 10px 16px; }
.lib-channel.is-collapsed .lib-grid,
.lib-channel.is-collapsed .lib-textareas { display: none; }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
  padding-bottom: 11px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #ddd5c6;
}

.lib-field.span-2 { grid-column: span 2; }
.lib-field.span-3 { grid-column: span 3; }
.lib-field.span-4 { grid-column: span 4; }

.lib-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #5b6b7a; min-width: 0; }

.lib-field > span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: break-word;
}

.lib-field input,
.lib-field select,
.lib-field textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  color: #141414;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  outline: none;
  transition: box-shadow .15s;
}

.lib-field input,
.lib-field select { height: 34px; }

.lib-field textarea {
  min-height: 66px;
  padding: 6px 8px;
  font-size: 12.5px;
  resize: vertical;
  line-height: 1.6;
}

/* 细滚动条，避免默认粗灰条破坏排版 */
.lib-field textarea,
.lib-region select[size] {
  scrollbar-width: thin;
  scrollbar-color: #d9d0bb #fff;
}
.lib-field textarea::-webkit-scrollbar,
.lib-region select[size]::-webkit-scrollbar { width: 6px; height: 6px; }
.lib-field textarea::-webkit-scrollbar-thumb,
.lib-region select[size]::-webkit-scrollbar-thumb { background: #d9d0bb; border-radius: 3px; }
.lib-field textarea::-webkit-scrollbar-track { background: transparent; }

.lib-region select[size] {
  height: 104px;
  padding: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lib-region select[size] option {
  padding: 4px 6px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-field input:focus,
.lib-field select:focus,
.lib-field textarea:focus { box-shadow: 0 0 0 3px rgba(255, 224, 102, .85); }

.lib-textareas {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}

/* 前端预览 */
.preview-modal { max-width: 920px; padding: 14px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.preview-head h3 { margin: 0; font-size: 16px; }
.preview-actions { display: flex; gap: 8px; }
.preview-frame {
  width: 100%;
  height: min(72vh, 720px);
  margin-top: 8px;
  background: #efe6d4;
  border: 1.5px solid #141414;
  border-radius: 10px;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 90;
}

.modal-mask.show { display: flex; }

.modal {
  width: 100%;
  max-width: 380px;
  background: #f6fbff;
  border: 2px solid #141414;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #141414;
  padding: 20px;
}

.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal .hint { font-size: 12.5px; color: #5b6b7a; margin: 0 0 14px; line-height: 1.6; }

.modal .field { margin-bottom: 12px; }

.modal-foot { display: flex; gap: 8px; margin-top: 14px; }
.modal-foot .btn { flex: 1; width: auto; }

.options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.options button {
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  cursor: pointer;
}

.options button.on { background: #7dd3fc; }

@media (max-width: 1440px) {
  .lib-textareas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .lib-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lib-field.span-3 { grid-column: span 3; }
  .lib-field.span-4 { grid-column: span 3; }
  .lib-field.span-2 { grid-column: span 3; }
  .lib-textareas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  /* 手机端隐藏所有滚动条 */
  * { scrollbar-width: none; -ms-overflow-style: none; }
  *::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }

  body { padding: 16px 12px; }
  .auth-card { padding: 24px 18px 20px; box-shadow: 4px 4px 0 #141414; }

  /* 手机端：登录 / 注册卡片铺满屏幕 */
  body:not(.admin-body) { padding: 0; align-items: stretch; }
  body:not(.admin-body) .auth-card {
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 34px 20px 28px;
    background: #f2f2f2;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.admin-body.auth-mode { padding: 16px 14px; }
  .admin-wrap { padding: 12px 10px 32px; }

  .admin-head { padding: 12px; gap: 10px; }
  .admin-head .title { font-size: 16px; }
  .admin-head .actions { width: 100%; }
  .admin-head .actions .btn { flex: 1 1 0; }
  #refLinkText { word-break: break-all; }

  /* 手机端标签分两行显示，避免横向滚动被裁切 */
  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 8px 0 10px;
  }
  .admin-tab {
    width: 100%;
    padding: 8px 4px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .panel { margin-top: 12px; padding: 12px; box-shadow: 3px 3px 0 #141414; }
  .panel h2 { font-size: 14px; }

  .stat { padding: 10px 12px; }
  .stat .v { font-size: 19px; }

  /* 手机端控件统一 16px，避免 iOS 自动放大 */
  input, select, textarea { font-size: 16px; }
  .toolbar input, .toolbar select, .inline-form input { flex: 1 1 100%; width: 100%; min-width: 0; }
  .inline-form .btn { flex: 1 1 auto; }
  .toolbar .sub { flex-basis: 100%; margin-top: 2px; }

  .lib-tpl-name { flex: 1 1 100%; }
  .lib-tpl-actions { width: 100%; justify-content: flex-end; gap: 8px; }
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .lib-field.span-2, .lib-field.span-3, .lib-field.span-4 { grid-column: span 1; }
  .lib-order { grid-column: 1 / -1; order: 7; }
  .lib-field input, .lib-field select { height: 38px; }
  .lib-textareas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .lib-field textarea { min-height: 56px; }
  .lib-region select[size] { height: 96px; }

  table { min-width: 620px; font-size: 12.5px; }
  th, td { padding: 8px; }
  .table-wrap { border: 1px dashed #c9b98f; border-radius: 8px; padding-bottom: 2px; }

  .modal { padding: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}

/* ---------- 省份 / 城市选择弹窗 ---------- */
.lib-picker { cursor: pointer; }
.picker-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(20, 20, 20, .45);
}
.picker-mask[hidden] { display: none; }
.picker-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(78vh, 620px);
  padding: 14px;
  background: #f6fbff;
  border: 2px solid #141414;
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(20, 20, 20, .85);
}
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.picker-head h3 { font-size: 16px; color: #141414; }
.picker-close {
  width: 30px; height: 30px;
  font-size: 15px; line-height: 1;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  cursor: pointer;
}
.picker-search {
  width: 100%;
  height: 38px;
  margin-bottom: 10px;
  padding: 0 10px;
  font-size: 14px;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  outline: none;
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px 4px 4px 2px;
}
.picker-item {
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #141414;
  text-align: center;
  background: #fff;
  border: 1.5px solid #141414;
  border-radius: 8px;
  cursor: pointer;
}
.picker-item.is-active { background: #7dd3fc; }
.picker-empty { grid-column: 1 / -1; padding: 20px 0; font-size: 13px; color: #7a8a99; text-align: center; }
body.picker-open { overflow: hidden; }

@media (max-width: 640px) {
  .picker-mask { align-items: flex-end; padding: 0; }
  .picker-panel {
    width: 100%;
    max-height: 72vh;
    padding: 12px 12px 16px;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    box-shadow: none;
  }
  .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .picker-item { padding: 10px 4px; font-size: 12.5px; }
}

/* 摄像头扫码弹层 */
.scan-mask {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(20, 20, 20, .72);
}
.scan-mask[hidden] { display: none; }
.scan-card {
  width: min(500px, 100%);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: #f4fafe;
  border: 2px solid #141414; border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .35);
}
.scan-card h3 { margin: 0; font-size: 15px; color: #141414; }
.scan-view {
  position: relative; height: min(26vh, 200px); min-height: 150px;
  background: #000; border-radius: 12px; overflow: hidden;
}
.scan-view video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; left: 10%; right: 10%; top: 34%; height: 32%;
  border: 2px dashed #7dd3fc; border-radius: 10px; pointer-events: none;
}
.scan-stats { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.scan-stat {
  display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px;
  border-radius: 999px; background: #eaf4ff; color: #0369a1;
  font-size: 11.5px; font-weight: 600;
}
.scan-stat b { font-weight: 800; }
.scan-stat.total { background: #ecfdf5; color: #15803d; }
.scan-stat.warn { background: #fff7ed; color: #b45309; }
.scan-list-box {
  border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
  background: #fff;
}
.scan-list-head {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 10px; background: #f8fafc; border-bottom: 1px solid #edf2f7;
  color: #64748b; font-size: 11px; font-weight: 700;
}
.scan-list { max-height: 170px; overflow-y: auto; overscroll-behavior: contain; }
.scan-list::-webkit-scrollbar { width: 6px; }
.scan-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.scan-empty { padding: 18px 10px; text-align: center; color: #94a3b8; font-size: 12px; }
.scan-row { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.scan-row:last-child { border-bottom: 0; }
.scan-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 700; color: #0f172a; word-break: break-all; }
.scan-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; background: #ecfdf5; color: #15803d; }
.scan-badge.warn { background: #fff7ed; color: #b45309; }
.scan-badge.muted { background: #f1f5f9; color: #64748b; }
.scan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11.5px; color: #64748b; }
.scan-product { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-amount { color: #047857; font-weight: 700; }
.scan-sign { padding: 1px 6px; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-weight: 600; }
.scan-sign.ok { background: #ecfdf5; color: #15803d; }
.scan-parcel { padding: 1px 6px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-weight: 600; }

/* ============================================================
   后台 · 现代服务器控制台风格（覆盖纸感主题）
   ============================================================ */
body.admin-body {
  background: #f5f6f8;
  color: #1f2937;
  font-size: 13px;
}
body.admin-body.auth-mode { background: #f5f6f8; }

body.admin-body.auth-mode .auth-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .08);
}
body.admin-body .brand .logo {
  background: #2563eb;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
}
body.admin-body .brand h1 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
body.admin-body .sub { color: #667085; font-size: 12.5px; }

body.admin-body .field input {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  padding: 10px 12px;
}
body.admin-body .field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

body.admin-body .btn {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  letter-spacing: 0;
}
body.admin-body .btn:hover { background: #1d4ed8; border-color: #1d4ed8; transform: none; box-shadow: none; }
body.admin-body .btn:active { transform: none; box-shadow: none; background: #1e40af; }
body.admin-body .btn:disabled { background: #93b4f5; border-color: #93b4f5; box-shadow: none; }
body.admin-body .btn.small {
  padding: 5px 11px;
  font-size: 12.5px;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  border: 1px solid #d0d5dd;
  box-shadow: none;
}
body.admin-body .btn.small:hover { background: #f9fafb; color: #344054; border-color: #d0d5dd; }
body.admin-body .btn.small:active { background: #f2f4f7; }
body.admin-body .btn.ghost { background: #ffffff; color: #344054; border-color: #d0d5dd; }
body.admin-body .btn.ghost:hover { background: #f9fafb; }
body.admin-body .btn.danger { background: #ffffff; color: #b42318; border-color: #fda29b; }
body.admin-body .btn.danger:hover { background: #fef3f2; border-color: #fda29b; }
body.admin-body .btn.good { background: #12b76a; border-color: #12b76a; color: #ffffff; }

body.admin-body .admin-wrap { padding: 16px 18px 42px; }

body.admin-body .admin-head {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  padding: 14px 18px;
}
body.admin-body .admin-head .title { font-size: 16px; font-weight: 600; }
body.admin-body .admin-head .who { font-size: 12px; color: #667085; margin-top: 3px; }

body.admin-body .admin-tabs {
  margin-top: 12px;
  padding: 6px;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  border-bottom: 1px solid #e4e7ec;
}
body.admin-body .admin-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  white-space: nowrap;
}
body.admin-body .admin-tab:hover { background: #f2f4f7; color: #344054; }
body.admin-body .admin-tab.is-active {
  background: #eff4ff;
  color: #1d4ed8;
  transform: none;
  box-shadow: none;
}

body.admin-body .panel {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  padding: 18px;
}
body.admin-body .panel h2 { font-size: 14.5px; font-weight: 600; color: #101828; }

body.admin-body .stats { gap: 12px; }
body.admin-body .stat {
  background: #fafbfc;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  padding: 14px 16px;
}
body.admin-body .stat .k { font-size: 12px; color: #667085; }
body.admin-body .stat .v { font-size: 22px; font-weight: 600; color: #101828; }
body.admin-body .stat .v small { color: #667085; font-size: 12px; font-weight: 500; }

body.admin-body .toolbar { gap: 10px; }
body.admin-body .toolbar input,
body.admin-body .toolbar select,
body.admin-body .inline-form input,
body.admin-body .inline-form textarea {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  padding: 8px 10px;
  font-size: 13px;
}
body.admin-body .inline-form select {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #1f2937;
  font-size: 13px;
}
body.admin-body .toolbar input:focus,
body.admin-body .toolbar select:focus,
body.admin-body .inline-form input:focus,
body.admin-body .inline-form select:focus,
body.admin-body .inline-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

body.admin-body table { font-size: 13px; }
body.admin-body th {
  background: #f9fafb;
  color: #667085;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid #eaecf0;
}
body.admin-body td { color: #344054; border-bottom: 1px solid #eaecf0; }
body.admin-body tbody tr:hover { background: #f9fafb; }

body.admin-body .badge {
  border: 0;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 500;
}
body.admin-body .badge.active { background: #ecfdf3; color: #027a48; }
body.admin-body .badge.pending { background: #fffaeb; color: #b54708; }
body.admin-body .badge.expired { background: #fef3f2; color: #b42318; }
body.admin-body .badge.disabled { background: #f2f4f7; color: #475467; }

body.admin-body .empty { color: #667085; }
body.admin-body .table-wrap {
  border: 1px solid #eaecf0;
  border-radius: 8px;
  overflow: auto;
}

body.admin-body .modal-mask { background: rgba(16, 24, 40, .45); }
body.admin-body .modal {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(16, 24, 40, .18);
}
body.admin-body .modal h3 { font-size: 15px; font-weight: 600; color: #101828; }
body.admin-body .options button {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  color: #344054;
  box-shadow: none;
}
body.admin-body .options button.is-active { background: #eff4ff; border-color: #b2ccff; color: #1d4ed8; }

body.admin-body .lib-empty {
  background: #f9fafb;
  border: 1px dashed #d0d5dd;
  border-radius: 10px;
  color: #667085;
}
body.admin-body .lib-channel {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-left: 3px solid #f79009;
  border-radius: 10px;
}
body.admin-body .lib-head .lib-total { background: #f2f4f7; color: #475467; }
body.admin-body .lib-tpl-name {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #ffffff;
}
body.admin-body .lib-color select,
body.admin-body .lib-color input[type="color"] {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #ffffff;
}

body.admin-body .scan-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(16, 24, 40, .25);
}
