/* ===== V54: 添加伙伴 / 上传宠物 / 本地抠图优化 ===== */

.companion-entry {
  display: grid;
  gap: 14px;
}

.choice-stack {
  display: grid;
  gap: 12px;
}

.choice-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(67,47,34,.08);
  border-radius: 24px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(55, 44, 33, .06);
  text-align: left;
}

.choice-card:active {
  transform: scale(.985);
}

.choice-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 24px;
  background: linear-gradient(180deg, #f4efe7 0%, #ede6dc 100%);
}

.choice-copy b {
  display: block;
  font-size: 18px;
  color: #23170f;
  margin-bottom: 4px;
}

.choice-copy small {
  display: block;
  color: #8a8177;
  line-height: 1.45;
}

.choice-arrow {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f3ede5;
  color: #584332;
  font-size: 18px;
  flex: 0 0 auto;
}

.adopt-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.adopt-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(67,47,34,.08);
  padding: 12px;
  box-shadow: 0 12px 28px rgba(55,44,33,.06);
}

.adopt-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.adopt-info b {
  display: block;
  color: #23170f;
  font-size: 17px;
  margin-bottom: 4px;
}

.adopt-info small {
  display: block;
  color: #8b8278;
  line-height: 1.4;
}

.adopt-btn {
  border: none;
  background: linear-gradient(180deg, #204e3f 0%, #173e31 100%);
  color: #fff;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(18, 53, 42, .16);
}

.adopt-btn.owned {
  background: #efe8de;
  color: #7b7268;
  box-shadow: none;
}

.upload-entry {
  display: grid;
  gap: 14px;
}

.upload-drop {
  min-height: 200px;
  border-radius: 26px;
  border: 1.5px dashed rgba(54, 76, 66, .16);
  background:
    radial-gradient(circle at top left, rgba(161, 222, 188, .32), transparent 44%),
    linear-gradient(180deg, #fbfaf7 0%, #f5f1ea 100%);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px 20px;
}

.upload-drop strong {
  display: block;
  font-size: 24px;
  margin: 12px 0 8px;
  color: #22160f;
}

.upload-drop p {
  margin: 0;
  color: #877e74;
  line-height: 1.5;
}

.upload-hint-list {
  display: grid;
  gap: 8px;
  color: #83796f;
  font-size: 14px;
}

.upload-hint-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-hint-list i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6ab58a;
  display: inline-block;
}

.dual-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dual-cta button {
  border: none;
  border-radius: 18px;
  padding: 15px 14px;
  font-size: 16px;
  font-weight: 800;
}

.dual-cta .album {
  background: #f2ebe1;
  color: #4e4033;
}

.dual-cta .camera {
  background: linear-gradient(180deg, #215140 0%, #173d31 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(19, 54, 43, .18);
}

.preview-wrap {
  display: grid;
  gap: 14px;
}

.preview-box,
.result-box {
  border-radius: 28px;
  overflow: hidden;
  min-height: 290px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%),
    linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  border: 1px solid rgba(64, 47, 34, .08);
  background-color: #faf8f4;
}

.preview-box img,
.result-box img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.processing-box {
  display: grid;
  gap: 16px;
}

.processing-visual {
  min-height: 240px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 40%, rgba(97, 195, 138, .16), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(97, 195, 138, .08), transparent 52%),
    linear-gradient(180deg, #fbfaf7 0%, #f7f3ec 100%);
  border: 1px solid rgba(64,47,34,.08);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.processing-cloud {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  position: relative;
  background: radial-gradient(circle, rgba(85, 201, 127, .12) 0%, rgba(85,201,127,0) 70%);
}

.processing-cloud::before,
.processing-cloud::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(75, 176, 120, .16);
  animation: pulseOrbit 2.6s linear infinite;
}

.processing-cloud::after {
  transform: scale(1.18);
  animation-delay: .8s;
}

@keyframes pulseOrbit {
  0% { transform: scale(.92); opacity: .2; }
  50% { opacity: .55; }
  100% { transform: scale(1.18); opacity: .08; }
}

.spark-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(102, 203, 140, .75);
  animation: floatSpark 4s ease-in-out infinite;
}

.spark-particle.dark {
  background: rgba(64, 73, 69, .46);
}

@keyframes floatSpark {
  0%,100% { transform: translateY(0) scale(.8); opacity: .35; }
  50% { transform: translateY(-20px) scale(1.12); opacity: 1; }
}

.processing-step-list {
  display: grid;
  gap: 10px;
}

.processing-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  color: #9a928a;
  font-size: 15px;
}

.processing-step.active,
.processing-step.done {
  color: #2c1f16;
  font-weight: 700;
}

.processing-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid rgba(64,47,34,.16);
  display: grid;
  place-items: center;
  font-size: 13px;
  background: #fff;
}

.processing-step.active .processing-dot {
  border-color: #6cc58e;
  color: #57b679;
  background: rgba(108, 197, 142, .08);
}

.processing-step.done .processing-dot {
  background: #6cc58e;
  color: #fff;
  border-color: #6cc58e;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ede6dc;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #73c996 0%, #2f8c62 100%);
  border-radius: inherit;
  transition: width .28s ease;
}

.form-preview-mini {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  background:
    linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%),
    linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  background-color: #faf8f4;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0 auto 14px;
  border: 1px solid rgba(64,47,34,.08);
}

.form-preview-mini img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.species-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.species-pill {
  border: none;
  border-radius: 16px;
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 800;
  background: #f2ece4;
  color: #5a4a3c;
}

.species-pill.active {
  background: linear-gradient(180deg, #214f41 0%, #163b2f 100%);
  color: #fff;
  box-shadow: 0 12px 20px rgba(18, 53, 42, .18);
}

.pet-choice.add-card {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 120px;
  border: 1.5px dashed rgba(52, 73, 64, .16);
  background: linear-gradient(180deg, #fbfaf7 0%, #f3eee6 100%);
}

.pet-choice.add-card strong {
  color: #2b1d14;
  font-size: 15px;
}

.pet-choice.add-card small {
  color: #8d857b;
}

.companion-tip {
  color: #8a8178;
  font-size: 14px;
  line-height: 1.55;
  padding: 0 2px;
}

@media (max-width: 390px) {
  .dual-cta { grid-template-columns: 1fr; }
  .adopt-card { grid-template-columns: 64px 1fr; }
  .adopt-btn { grid-column: 1 / -1; width: 100%; }
  .species-row { grid-template-columns: 1fr; }
}
