* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}
body {
  background-color: #f7f8fa;
  padding: 20px;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 32px;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.logo-mark {
  width: 36px;
  height: 36px;
  background: #f97316;
  border-radius: 50%;
}
.header-top h1 {
  font-size: 28px;
  color: #111;
  font-weight: 700;
}
/* 进度条 */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
  padding: 0 40px;
}
.progress-line-wrap {
  position: absolute;
  width: calc(100% - 80px);
  height: 4px;
  background: #e5e7eb;
  top: 16px;
  left: 40px;
  z-index: 1;
}
.progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}
.progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d1d5db;
  margin-bottom: 8px;
  transition: 0.25s;
}
.progress-item.active .progress-dot {
  background: #3b82f6;
}
.progress-item[data-step="2"].active .progress-dot {background:#a855f7;}
.progress-item[data-step="3"].active .progress-dot {background:#22c55e;}
.progress-item[data-step="4"].active .progress-dot {background:#ccc;}
.progress-text {
  font-size: 15px;
  color: #444;
}
.step-module {
  display: none;
}
.step-module.show {
  display: block;
}
/* 背景选择网格 */
.bg-select-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap:16px;
  margin: 20px 0 40px;
}
.bg-item {
  border:3px solid transparent;
  border-radius:12px;
  overflow:hidden;
  cursor:pointer;
  transition:0.2s;
  background:#f3f4f6;
  min-height:160px;
  display:flex;
  flex-direction:column;
}
.bg-item.active {
  border-color:#f97316;
}
.bg-item img {
  width:100%;
  height:120px;
  object-fit:cover;
  display:block;
  background:#eee;
}
.bg-item p {
  text-align:center;
  font-size:14px;
  padding:8px 0;
}
/* 按钮样式 */
.btn-wrap-next {
  text-align:right;
}
.btn-next {
  padding:14px 32px;
  border-radius:10px;
  border:none;
  background:#22c55e;
  color:white;
  font-size:18px;
  cursor:pointer;
  transition:0.2s;
}
.btn-next:disabled {
  background:#b7e9c4;
  cursor:not-allowed;
}
.btn-prev {
  padding:10px 20px;
  border-radius:8px;
  border:none;
  background:#9ca3af;
  color:white;
  font-size:15px;
  cursor:pointer;
}
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  margin-bottom:30px;
}
.upload-area button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  margin: 8px;
}
#openCam { background: #2563eb; }
#captureBtn { background: #22c55e; }
#selectImg { background: #4b5563; }
#videoCam {
  width: 280px;
  border-radius: 10px;
  margin-top: 16px;
  display: none;
}
#previewRaw {
  width: 240px;
  border-radius: 10px;
  margin-top: 16px;
  display: none;
}
#canvasCam { display: none; }
.form-row {
  margin-bottom: 20px;
}
.form-row label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-size: 15px;
}
.form-row input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}
.btn-group {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}
.card-box {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}
.sol-card {
  width: 260px;
  height: 400px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  left: 0;
  top: 0;
}
.card-photo {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  background: #fff;
}
.card-top-tag-left {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #000;
  color: #fff;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  z-index: 3;
}
.card-top-tag-right {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #000;
  color: #fff;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  z-index: 3;
}
.card-name-text {
  position: absolute;
  bottom: 44px;
  left: 8px;
  background: #000;
  color: #fff;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  z-index: 3;
}
.card-qr-canvas {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  background: #fff;
  z-index: 3;
}
.tip-msg {
  text-align: center;
  color: #ef4444;
  min-height:24px;
  font-size:14px;
  margin-top:8px;
}
.tip-msg.ok {
  color:#22c55e;
}
.print-wrapper {
  text-align: center;
}
@media print {
  body * { visibility: hidden; }
  #printCardWrap, #printCardWrap * { visibility: visible; }
  #printCardWrap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}
.sol-card {
  width: 260px;
  height: 400px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background-color: #1f2937;
}
.card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-photo {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  background: #fff;
}
.card-top-tag-left {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #000;
  color: #fff;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  z-index: 10;
}
/* 名字：底部居中 */
.card-name-text {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: bold;
  z-index: 10;
}
/* 直接删掉或注释旧的 card‑top‑tag‑right、card‑qr‑canvas 样式 */
/*.card-top-tag-right{}*/
/*.card-qr-canvas{}*/


/* AI绘图进度条 */
.progress-bar-ai {
  width: 220px;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin:0 auto;
}
.progress-fill {
  height:100%;
  width:0%;
  background:#7c3aed;
  border-radius:999px;
  animation: aiProgress 1.8s infinite ease-in-out;
}
@keyframes aiProgress {
  0% { width:0%; }
  50% { width:70%; }
  100% { width:95%; }
}