/**
 * ============================================================================
 * admin.css —— 可视化管理面板样式（访问 本页网址#admin 时启用）
 * ----------------------------------------------------------------------------
 * 面板以右侧抽屉形式呈现：桌面端与收款页并排实现"边改边看"实时预览，
 * 手机端全屏覆盖，可通过"预览"按钮临时收起查看效果。
 * ============================================================================
 */

/* ---------- 抽屉容器 ---------- */
.admin {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(430px, 100%);
  background: #f6f7fa;
  box-shadow: -10px 0 32px rgba(0, 0, 0, .16);
  display: flex;
  flex-direction: column;
  z-index: 100;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
}

/* ---------- 顶栏 ---------- */
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  position: sticky; top: 0; z-index: 2;
}
.admin-head h2 { font-size: .98rem; color: #222; }
.admin-head .a-sub { font-size: .72rem; color: #999; margin-top: 2px; }
.admin-actions { display: flex; gap: 8px; }

/* ---------- 表单区 ---------- */
.admin-body { flex: 1; overflow-y: auto; padding: 14px 16px 44px; -webkit-overflow-scrolling: touch; }
.admin-body fieldset {
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.fs-title { font-weight: 600; font-size: .88rem; color: #333; margin-bottom: 10px; }
.fs-hint  { font-size: .72rem; color: #999; line-height: 1.7; margin-bottom: 10px; }

.f-row { margin-bottom: 10px; }
.f-row:last-child { margin-bottom: 0; }
label.f { display: block; font-size: .76rem; color: #666; }
label.f input[type="text"],
label.f input[type="url"],
label.f input[type="number"],
label.f select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  font-size: .84rem;
  background: #fbfcfe;
  color: #333;
  outline: none;
}
label.f input:focus, label.f select:focus { border-color: #2f6fed; background: #fff; }
label.f-check {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: #444; cursor: pointer;
}
label.f-check input { width: 16px; height: 16px; accent-color: #2f6fed; }

/* ---------- 操作按钮区 ---------- */
.admin-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #444;
  font-size: .84rem;
  cursor: pointer;
  transition: opacity .15s;
}
.a-btn:hover { opacity: .85; }
.a-btn.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.a-btn.danger  { color: #e5484d; border-color: #f2c8ca; }
.admin-head .a-btn { padding: 7px 12px; font-size: .78rem; border-radius: 8px; }

/* ---------- "返回编辑"悬浮按钮（预览模式） ---------- */
.admin-fab {
  position: fixed;
  right: 16px; bottom: 22px;
  z-index: 99;
  background: #2f6fed; color: #fff;
  border: none; border-radius: 999px;
  padding: 12px 20px;
  font-size: .88rem;
  box-shadow: 0 8px 22px rgba(47, 111, 237, .4);
  cursor: pointer;
}

/* ---------- 轻提示 Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  background: rgba(20, 24, 34, .82);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .84rem;
  z-index: 200;
  animation: toast-in .2s ease;
  max-width: 80vw;
  text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   收款码图片上传与解析
   ============================================================ */

/* 渠道配置块内的上传按钮与状态行 */
.upload-row { margin-bottom: 8px; }
.a-btn-upload {
  width: 100%;
  border-style: dashed;
  border-color: #bcd2f7;
  background: #f4f8ff;
  color: #2f6fed;
}
.a-btn-upload:disabled { color: #999; background: #f4f4f4; border-color: #ddd; cursor: default; }
.pay-status {
  font-size: .72rem; line-height: 1.7; color: #888;
  background: #fafbfd; border: 1px solid #eef0f4; border-radius: 8px;
  padding: 7px 9px; margin-bottom: 10px; word-break: break-all;
}
.pay-status.is-bound { color: #3d7a4e; background: #f4fbf5; border-color: #d8ecdc; }
.pay-status code { font-size: .7rem; color: #c0392b; }
.a-btn-mini {
  float: right;
  border: 1px solid #f2c8ca; color: #e5484d; background: #fff;
  border-radius: 6px; font-size: .68rem; padding: 2px 7px; cursor: pointer;
}

/* 解析结果预览弹窗（需浮于管理面板之上，且固定浅色不受主题影响） */
#parse-modal { z-index: 120; }
.parse-modal-body { background: #fff; color: #333; }
.parse-modal-body h3 { color: #222; }
.parse-qr {
  width: 200px; height: 200px; margin: 4px auto 0;
  background: #fff; border: 1px solid #e5e8ee; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.parse-qr img, .parse-qr canvas { width: 100% !important; height: 100% !important; }
.parse-caption { font-size: .72rem; color: #999; margin-top: 8px; }
.parse-extra { text-align: left; margin-top: 10px; }
.parse-payload {
  word-break: break-all;
  background: #f6f8fa; border-radius: 8px;
  padding: 8px 10px; font-size: .74rem; color: #555;
  max-height: 76px; overflow: auto; margin: 0 0 8px;
}
.parse-ok {
  color: #3d7a4e; background: #f4fbf5; border: 1px solid #d8ecdc;
  border-radius: 8px; padding: 7px 10px; font-size: .75rem; line-height: 1.6;
  margin: 0;
}
.parse-warn {
  color: #a2701d; background: #fdf6e3; border: 1px solid #f5e6bd;
  border-radius: 8px; padding: 7px 10px; font-size: .75rem; line-height: 1.6;
  margin: 0;
}
.parse-actions { margin-top: 12px; }
