/* BuddyGo 引导/管理页样式（v0.2 浅色商务风，参考 v0.2old）
   只改风格，业务逻辑（JS）不动 */
:root {
  --brand: #059669;
  --brand-light: #ECFDF5;
  --brand-hover: #047857;
  --text: #1F2937;
  --text-light: #6B7280;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 40px;
}
/* ===== 头部渐变横幅 ===== */
.header {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  padding: 18px 20px 16px;
  text-align: center;
}
.header h1 { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.header p { font-size: 12px; opacity: 0.85; }
.box-id {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  margin-top: 8px;
  font-family: monospace;
}
/* ===== 内容容器 ===== */
.steps { max-width: 420px; margin: 0 auto; padding: 20px 16px; }
.step {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.step-num {
  display: inline-flex;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 10px;
}
.step h2 { font-size: 18px; margin-bottom: 8px; }
.step .desc { font-size: 14px; color: var(--text-light); line-height: 1.6; margin-bottom: 16px; }
.step .desc b { color: var(--text); }
/* 进度点 */
.progress { display: flex; justify-content: center; gap: 8px; margin: 16px auto 16px; }
.progress .dot { width: 8px; height: 8px; border-radius: 50%; background: #E5E7EB; }
.progress .dot.on { background: var(--brand); }
.progress .dot.done { background: var(--brand); opacity: 0.5; }
/* ===== 按钮 ===== */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.btn:hover { background: var(--brand-hover); }
.btn:disabled { background: #D1D5DB; cursor: not-allowed; }
/* v0.2.26 我已扫码按钮：固定底部屏内（页面滚动也不出屏），点击=主动确认 */
#btnIveScanned {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 72px;
  width: calc(100% - 48px);
  max-width: 480px;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
/* 遮罩弹出时按钮让位（遮罩 z-index 更高，按钮在其下） */
.config-overlay.showing ~ #btnIveScanned { display: none; }
.btn.secondary { background: #E5E7EB; color: var(--text); margin-top: 10px; }
.btn.secondary:hover { background: #D1D5DB; }
.btn.ghost { background: #E5E7EB; color: var(--text); margin-top: 10px; }
.btn.ghost:hover { background: #D1D5DB; }
.btn.danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; margin-top: 10px; }
.btn.danger:hover { background: #FECACA; }
/* 小按钮（管理页助手操作） */
.small-btn {
  padding: 6px 14px; font-size: 13px; border: none; border-radius: 8px;
  background: #F3F4F6; color: var(--text); cursor: pointer; transition: all 0.2s;
}
.small-btn:hover { background: #E5E7EB; }
.danger-btn {
  padding: 6px 14px; font-size: 13px; border: none; border-radius: 8px;
  background: #F3F4F6; color: #9CA3AF; cursor: pointer; transition: all 0.2s;
  border: 1px solid #E5E7EB;
}
.danger-btn:hover { color: #DC2626; background: #FEF2F2; border-color: #FECACA; }
/* 精致移除按钮（旧版 asst-remove 风格） */
.asst-remove {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: #9CA3AF;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.asst-remove:hover { color: #DC2626; background: #FEF2F2; border-color: #FECACA; }
/* ===== 表单 ===== */
label { display: block; font-size: 13px; color: var(--text-light); margin: 14px 0 6px; }
input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #E5E7EB; background: #fff; color: var(--text);
  font-size: 15px; outline: none; transition: border 0.2s;
}
input:focus { border-color: var(--brand); }
/* v0.2.20 表单按钮与输入框统一间距（避免按钮贴输入框） */
input + .btn, input + button { margin-top: 16px; }
/* ===== 提示框 ===== */
.tip {
  background: #EFF6FF;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: #1D4ED8;
  margin-bottom: 16px;
  line-height: 1.6;
}
.tip strong { color: #1D4ED8; }
.ok-box {
  background: var(--brand-light);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.ok-box .icon { font-size: 40px; }
.ok-box .text { font-size: 15px; font-weight: 500; margin-top: 6px; color: var(--brand-hover); }
.name-guide {
  margin: 14px auto 0; max-width: 340px;
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px;
  padding: 10px 14px; text-align: left;
}
.name-guide-title { font-size: 14px; font-weight: 600; color: #92400E; margin-bottom: 4px; }
.name-guide-body { font-size: 13px; color: #78350F; line-height: 1.6; }
.name-example { color: #059669; font-weight: 600; }
/* v0.2.19 绑定页双场景引导（复刻 v0.2old）：手机/电脑分流 + 保存二维码按钮 */
.guide-mobile { display: none; }
.guide-desktop { display: none; }
@media (max-width: 767px) { .guide-mobile { display: block; } }
@media (min-width: 768px) { .guide-desktop { display: block; } }
#btnSaveQr { display: none; margin: 4px 0 10px; font-size: 14px; padding: 12px; }
@media (max-width: 767px) { #btnSaveQr { display: block; } }
.hint { font-size: 13px; color: #9CA3AF; margin-top: 14px; line-height: 1.7; }
.err { color: #DC2626; font-size: 13px; margin-top: 10px; min-height: 0; line-height: 1.5; }
/* ===== 加载/二维码 ===== */
.loading { text-align: center; padding: 16px 0; }
.spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* 遮罩（深色背景）专用 spinner：白色系，去 emoji，严谨加载样式 */
.config-overlay .spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-right-color: rgba(255,255,255,0.6);
}
/* ===== 管理页 远程维护卡片 ===== */
.maint-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0 14px;
}
.maint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.maint-title { font-size: 14px; font-weight: 600; color: #111827; }
.maint-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #F3F4F6;
  color: #6B7280;
}
.maint-badge.on {
  background: #ECFDF5;
  color: #059669;
}
.maint-status { font-size: 13px; color: #374151; margin-bottom: 8px; }
.maint-status .on { color: #059669; }
.maint-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.maint-actions .small-btn { flex: 1; }
.maint-desc { font-size: 11px; color: #9CA3AF; line-height: 1.6; }
.qr-wrap { text-align: center; padding: 12px 0 4px; }
/* ===== v0.2.28 二维码常驻占位层（生成中/失败占位 → 真图原位替换，页面零跳动） ===== */
.qr-stage {
  position: relative; width: 240px; height: 240px; margin: 0 auto;
  display: block;
}
/* v14 结构级居中：img 与占位层同构（绝对定位 + 中心锚定）。
   ID 选择器特异性(1,0,0) > 旧 .qr-wrap img(0,1,1)，彻底压过
   max-width:180/240/320px 等历史规则，物理锁定在 stage 正中心 */
#qrImg {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 240px !important;
  height: 240px !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain;
  border-radius: 12px; border: 1px solid #E5E7EB; background: #fff;
}
.qr-placeholder {
  position: absolute; inset: 0; border-radius: 12px;
  border: 1px dashed #C9D2DC; background: #F8FAFC;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.qr-ph-icon { font-size: 34px; line-height: 1; }
.qr-ph-text { font-size: 14px; font-weight: 600; color: #475467; }
.qr-ph-sub { font-size: 12px; color: #98A2B3; }
.qr-wrap img {
  max-width: 240px; width: 100%;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
}
.qr-hint { font-size: 13px; color: var(--text-light); margin-top: 10px; line-height: 1.6; }
.qr-expire { font-size: 12px; color: #DC2626; margin-top: 6px; }
.status-line { text-align: center; font-size: 14px; color: var(--text-light); min-height: 22px; margin-top: 12px; }
/* ===== 管理页 ===== */
.status-row {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-row .label { color: var(--text-light); }
.status-row .val { font-weight: 500; }
.row {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.row .name { color: var(--text); font-weight: 500; }
.sec-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; color: var(--text); }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.b-ok { background: var(--brand-light); color: var(--brand-hover); }
.b-wait { background: #FFFBEB; color: #D97706; }
.b-err { background: #FEF2F2; color: #DC2626; }
.b-off { background: #F3F4F6; color: #9CA3AF; }
.actions { display: flex; gap: 8px; }
.actions button { margin-top: 0; }
/* ===== 弹窗 ===== */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay .step { width: 100%; max-width: 380px; }
/* ===== 配置中全屏遮罩（深色，旧版一致） ===== */
.config-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #0F172A;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  text-align: center;
}
.config-overlay .icon { font-size: 44px; }
.config-overlay .text { font-size: 17px; font-weight: 600; margin-top: 10px; color: #fff; line-height: 1.6; }
.config-progress { width: 220px; height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; margin: 16px auto 0; overflow: hidden; }
.config-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #059669, #10B981); border-radius: 3px; transition: width .5s linear; }
.config-overlay .tip { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 12px; background: transparent; padding: 0; margin-bottom: 0; line-height: 1.6; }
/* ===== 助手卡片（v0.2.4：显示名字 + 操作链接，无按钮） ===== */
.asst-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.asst-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.asst-name { font-weight: 600; font-size: 14px; color: #1F2937; word-break: break-all; }
.asst-sub { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.asst-idx { font-size: 12px; color: #9CA3AF; }
.asst-ops a {
  font-size: 12px; color: #9CA3AF; text-decoration: none;
  margin-left: 14px; cursor: pointer;
}
.asst-ops a:hover { color: #DC2626; text-decoration: underline; }
.asst-err { font-size: 12px; color: #DC2626; margin-top: 6px; }
/* ===== 二维码区（v0.2.3：不跳动 + 保存相册 + 扫码引导） ===== */
.qr-wrap { text-align: center; }
.qr-wrap img {
  max-width: 180px;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background: #fff;
}
.qr-hint { font-size: 13px; color: #6B7280; margin-top: 8px; line-height: 1.6; }
.qr-regen { font-size: 12px; color: #9CA3AF; margin-top: 6px; }
.qr-regen a { color: #9CA3AF; text-decoration: underline; }
.btn.small { width: auto; display: inline-block; padding: 8px 18px; margin-top: 10px; font-size: 13px; }
.guide-step {
  display: block;
  background: #F8FAFC; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; color: #374151;
  line-height: 1.6; margin-top: 8px; text-align: left;
}
.guide-step span { color: #059669; font-weight: 700; display: inline-block; margin-right: 2px; }
.guide-step b { color: #1F2937; }
.guide-step .hint { color: #6B7280; font-size: 12px; }
/* ===== 体验 key 高亮提醒横幅 ===== */
.key-warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid #D97706;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #92400E;
  line-height: 1.6;
  margin-bottom: 16px;
}
.key-warn b { color: #D97706; }
/* ===== 页脚版本号（测试用） ===== */
.footer {
  text-align: center;
  font-size: 12px;
  color: #B0B8C4;
  margin-top: 24px;
  padding-bottom: 16px;
}
/* ===== 链接 ===== */
.link-btn {
  display: block; text-align: center; margin-top: 18px;
  color: #9CA3AF; font-size: 13px; text-decoration: none;
}
.link-btn:hover { color: var(--text); }
/* ===== 响应式 ===== */
@media (min-width: 768px) {
  .steps { max-width: 640px; padding: 28px 24px; }
  .header { padding: 40px 28px 28px; }
  .header h1 { font-size: 26px; }
  .step { padding: 28px; }
  .qr-wrap img { max-width: 320px; }
  .tip { font-size: 14px; }
  .btn { font-size: 16px; padding: 15px; }
}
