/* 旋转对齐验证码样式（cc- 前缀，避免与宿主项目冲突） */
.cc-rotate {
  --cc-pri: #10b981;
  --cc-pri-d: #0d9488;
  --cc-pri-l: #d1fae5;
  --cc-txt: #1f2937;
  --cc-sub: #475467;
  --cc-faint: #98a2b3;
  --cc-line: #dbe3e8;
  --cc-bad: #ef4444;
  --cc-bad-l: #fef2f2;
  position: relative;
  font-family: inherit;
  color: var(--cc-txt);
}

.cc-rotate-tip {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cc-txt);
}

/* ---------- 左右图片 ---------- */
.cc-rotate-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.cc-rotate-pane {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  background: #e7eff3;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .08);
}

.cc-rotate-ref {
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
}

.cc-rotate-ref img {
  display: block;
  width: 100%;
  height: 100%;
}

.cc-rotate-target {
  flex: 0 0 auto;
  width: 200px;
  height: 200px;
}

/* 图片放大到 146%，旋转后四角仍能盖满容器 */
.cc-rotate-target img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 146%;
  height: 146%;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  transition: transform .18s ease-out;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.cc-rotate-target img.cc-rotate-no-anim { transition: none; }

/* ---------- 立体旋转（yaw）：整帧切换，不做 CSS 旋转 ---------- */
.cc-rotate-yaw {
  --cc-pri: #6366f1;
  --cc-pri-d: #4f46e5;
  --cc-pri-l: #e0e7ff;
}

.cc-rotate-yaw .cc-rotate-target img {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: none;
  transition: opacity .12s linear;
  will-change: auto;
}

/* 取帧期间轻微淡出，提示正在请求下一帧 */
.cc-rotate-yaw.is-turning .cc-rotate-target img { opacity: .55; }

/* 帧数随机（18/24/30），圆点会挤成一条线，改用文字显示剩余转动次数 */
.cc-rotate-yaw .cc-rotate-dots { display: none; }

.cc-rotate-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, .58);
  color: #fff;
  font-size: 10px;
  letter-spacing: .5px;
}

.cc-rotate.is-loading .cc-rotate-target::after {
  content: '加载中…';
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .82);
  font-size: 12.5px;
  color: var(--cc-sub);
}

.cc-rotate.is-loading img { opacity: .35; }

/* ---------- 箭头与步数 ---------- */
.cc-rotate-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
}

.cc-rotate-arrow {
  width: 46px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8de;
  border-radius: 11px;
  background: #fff;
  color: var(--cc-txt);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .14);
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}

.cc-rotate-arrow svg { width: 23px; height: 23px; }
.cc-rotate-arrow:hover:not(:disabled) { background: var(--cc-pri-l); color: var(--cc-pri-d); border-color: transparent; }
.cc-rotate-arrow:active:not(:disabled) { transform: translateY(1px); }
.cc-rotate-arrow:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

.cc-rotate-count {
  min-width: 82px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cc-sub);
}

.cc-rotate-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 12px;
  margin-top: 12px;
}

.cc-rotate-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background .15s, transform .15s, box-shadow .15s;
}

.cc-rotate-dot.is-center { box-shadow: 0 0 0 1px #94a3b8 inset; }
.cc-rotate-dot.is-active {
  background: var(--cc-pri-d);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .2);
}

/* ---------- 提交与提示 ---------- */
.cc-rotate-submit {
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cc-pri), var(--cc-pri-d));
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}

.cc-rotate-submit:hover:not(:disabled) { opacity: .92; }
.cc-rotate-submit:disabled { opacity: .45; cursor: not-allowed; }

.cc-rotate-msg {
  min-height: 18px;
  margin-top: 9px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cc-bad);
}

.cc-rotate-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.cc-rotate-refresh {
  padding: 0;
  border: none;
  border-bottom: 1px dashed var(--cc-line);
  background: none;
  color: var(--cc-sub);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.cc-rotate-refresh:hover { color: var(--cc-pri-d); border-bottom-color: var(--cc-pri-d); }

/* ---------- 成功浮层 ---------- */
.cc-rotate-result {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  animation: cc-rotate-fade .15s ease-out;
}

.cc-rotate-result[hidden] { display: none; }

.cc-rotate-result-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-rotate-result-icon svg { width: 29px; height: 29px; }
.cc-rotate-result-icon.is-ok { background: var(--cc-pri-l); color: var(--cc-pri-d); animation: cc-rotate-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
.cc-rotate-result-icon.is-err { background: var(--cc-bad-l); color: var(--cc-bad); }
.cc-rotate-result-text { font-size: 14px; font-weight: 700; }

@keyframes cc-rotate-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-rotate-pop {
  0% { transform: scale(.5); opacity: .4; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
