/* 二维码生成页样式 - 与比价平台整体风格一致 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #333;
  min-height: 100vh;
}

/* 导航（复用全站） */
.navbar {
  background: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  height: 60px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #333; font-weight: 700; font-size: 17px; }
.brand-icon { font-size: 22px; }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-link {
  padding: 8px 14px; border-radius: 8px; text-decoration: none; color: #555; font-size: 15px;
  transition: all .15s;
}
.nav-link:hover { background: #f0f0f0; color: #222; }
.nav-link.active { background: #007BFF; color: #fff; }
.btn-back { margin-left: auto; text-decoration: none; color: #007BFF; font-size: 14px; }

/* 主体 */
.main { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.page-header { margin-bottom: 18px; }
.page-header h1 { font-size: 24px; margin-bottom: 6px; }
.page-header p { color: #888; font-size: 14px; }

.qr-panel {
  background: #fff; border-radius: 12px; padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  margin-bottom: 24px;
}
.qr-panel label { font-weight: 600; display: block; margin-bottom: 8px; }
#inputArea {
  width: 100%; min-height: 120px; padding: 12px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; resize: vertical; line-height: 1.6;
}
#inputArea:focus { outline: none; border-color: #007BFF; }

.qr-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mybutton {
  padding: 10px 22px; border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
  background: #007BFF; color: #fff; transition: filter .15s;
}
.mybutton:hover { filter: brightness(1.08); }
#downloadSelected {
  background: #28a745; display: none;
}
.qr-hint { color: #999; font-size: 13px; }
.qr-hint b { color: #e67e22; }

#qrStats { color: #888; font-size: 13px; }

/* 二维码网格 */
.qr-container {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.qr-item {
  background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 14px;
  text-align: center; position: relative; transition: box-shadow .15s;
  min-width: 0; overflow: hidden;
}
/* 二维码图/画布自适应格子宽度，避免固定 220px 在窄屏溢出重叠 */
.qr-item img, .qr-item canvas {
  max-width: 100%; height: auto !important; display: block; margin: 0 auto;
}
.qr-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.qr-item.marked { border-color: #28a745; box-shadow: 0 0 0 2px rgba(40,167,69,.25); }
.qr-num {
  position: absolute; top: 8px; left: 10px; background: #007BFF; color: #fff;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; line-height: 22px; font-weight: 600;
}
.qr-text {
  margin: 8px 0 10px; font-size: 12px; color: #666; word-break: break-all;
  max-height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mark-btn {
  width: 100%; padding: 7px; border: 1px solid #ddd; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 13px; color: #555; transition: all .15s;
}
.mark-btn:hover { border-color: #28a745; color: #28a745; }
.qr-item.marked .mark-btn { background: #28a745; color: #fff; border-color: #28a745; }

/* 页脚 */
.footer {
  text-align: center; color: #999; font-size: 13px; padding: 24px 0 40px;
}

/* Toast */
.qr-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
}
.qr-toast.show { opacity: 1; }

/* 移动端适配 */
@media (max-width: 640px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 6px 10px; }
  .brand-name { font-size: 14px; }
  .nav-links { flex: 1 1 100%; order: 3; flex-wrap: wrap; gap: 4px 6px; margin: 2px 0 0; }
  .nav-link { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .nav-user { margin-left: auto; }
  .btn-back { font-size: 13px; white-space: nowrap; }
  .qr-panel { padding: 16px; }
  /* 手机端单列展示，避免两列过窄导致二维码溢出重叠 */
  .qr-container { grid-template-columns: 1fr; gap: 12px; }
  .qr-item img, .qr-item canvas { max-width: 240px; }
}