:root {
  --sc-bg-1: #0f9479;
  --sc-bg-2: #f4b244;
  --sc-bg-3: #f85d56;
  --sc-card: rgba(255, 255, 255, 0.88);
  --sc-text: #1e2633;
  --sc-subtle: #778094;
  --sc-border: rgba(25, 36, 54, 0.08);
  --sc-primary: #1a6dff;
  --sc-primary-2: #43a0ff;
  --sc-success: #18b76a;
  --sc-danger: #ea3949;
  --sc-shadow: 0 22px 60px rgba(17, 28, 45, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--sc-text);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.22), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.25), transparent 36%),
    linear-gradient(120deg, var(--sc-bg-1), var(--sc-bg-2), var(--sc-bg-3));
  display: grid;
  place-items: center;
  padding: 24px;
}

.demo-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 22px;
  align-items: start;
}

.intro-card,
.captcha-panel {
  background: var(--sc-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--sc-border);
  border-radius: 22px;
  box-shadow: var(--sc-shadow);
}

.intro-card {
  padding: 26px;
}

.intro-card h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0.01em;
}

.intro-card p {
  margin: 12px 0 0;
  line-height: 1.6;
  color: #304258;
}

.intro-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chip {
  border: 1px solid rgba(16, 26, 41, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.66);
}

.captcha-panel {
  padding: 16px;
}

.captcha-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.captcha-title {
  font-size: 16px;
  font-weight: 700;
}

.captcha-refresh {
  border: 0;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: #244363;
  background: rgba(32, 78, 137, 0.12);
}

.captcha-board {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  background: #eaf2ff;
}

.captcha-board[data-mode="image"] {
  height: auto;
  min-height: 236px;
  padding-bottom: 0;
  overflow: visible;
}

.captcha-board[data-mode="image"] .captcha-image-board {
  position: relative !important;
  inset: auto !important;
}

.captcha-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  gap: 10px;
  background:
    linear-gradient(130deg, rgba(26, 109, 255, 0.18), rgba(32, 195, 176, 0.18)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.24),
      rgba(255, 255, 255, 0.24) 14px,
      rgba(255, 255, 255, 0.1) 14px,
      rgba(255, 255, 255, 0.1) 28px
    );
  transition: opacity 0.25s ease;
}

.captcha-loading[data-hidden="1"] {
  opacity: 0;
  pointer-events: none;
}

.captcha-loading-art {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.12) 60%),
    linear-gradient(135deg, rgba(39, 95, 179, 0.75), rgba(53, 165, 155, 0.75));
  box-shadow: 0 12px 28px rgba(22, 44, 78, 0.24);
  position: relative;
  overflow: hidden;
}

.captcha-loading-art::after {
  content: "";
  position: absolute;
  inset: -30px;
  background: linear-gradient(95deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: loadingSweep 1.25s linear infinite;
}

.captcha-loading-text {
  font-size: 13px;
  font-weight: 600;
  color: #244363;
  letter-spacing: 0.03em;
}

@keyframes loadingSweep {
  from {
    transform: translateX(-72px);
  }
  to {
    transform: translateX(72px);
  }
}

.captcha-bg,
.captcha-piece,
.captcha-hole {
  position: absolute;
  top: 0;
  left: 0;
}

.captcha-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.captcha-piece {
  pointer-events: none;
  transition: transform 0.1s linear;
  filter: drop-shadow(0 6px 6px rgba(22, 33, 58, 0.45));
}

.captcha-hole {
  display: none;
  border: 2px dashed rgba(255, 255, 255, 0.88);
  background: rgba(21, 34, 57, 0.28);
  box-shadow: inset 0 0 0 1px rgba(10, 20, 34, 0.2);
}

.slider-wrap {
  margin-top: 14px;
  background: #edf1f7;
  border-radius: 999px;
  border: 1px solid rgba(18, 31, 47, 0.08);
  height: 48px;
  position: relative;
  user-select: none;
}

.slider-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(26, 109, 255, 0.25), rgba(67, 160, 255, 0.38));
  transition: width 0.08s linear;
}

.slider-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--sc-subtle);
}

.slider-button {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  cursor: grab;
  color: #fff;
  font-size: 18px;
  background: linear-gradient(135deg, var(--sc-primary), var(--sc-primary-2));
  box-shadow: 0 8px 18px rgba(26, 109, 255, 0.35);
}

.slider-button:active {
  cursor: grabbing;
}

.captcha-message {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.captcha-msg-text {
  display: inline-flex;
  align-items: center;
}

.captcha-brand-link {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  text-decoration: none;
  color: #31557f;
  border: 1px solid rgba(49, 85, 127, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.75);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.captcha-brand-link:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 85, 127, 0.45);
  background: rgba(255,255,255,1);
}

.captcha-brand-icon {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.captcha-message[data-type="ok"] {
  color: var(--sc-success);
}

.captcha-message[data-type="error"] {
  color: var(--sc-danger);
}

.captcha-message[data-type="loading"] {
  color: #2f5f9a;
}

.captcha-text-word {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.75),
    0 0 6px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  transition: transform .12s ease, opacity .12s ease, color .12s ease;
}

.captcha-text-word:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.captcha-text-word[data-selected="1"] {
  color: #7dd3fc;
  opacity: .95;
  transform: translate(-50%, -50%) scale(.96);
}

.captcha-image-board {
  display: block;
}

.captcha-image-target {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px dashed rgba(33, 56, 88, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  min-height: 46px;
  color: #20324e;
  font-size: 13px;
  font-weight: 700;
}

.captcha-image-target strong {
  font-size: 15px;
  line-height: 1.2;
}

.captcha-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.captcha-image-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(27, 44, 70, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #eef4ff);
  min-height: 72px;
  padding: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.captcha-image-tile img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.captcha-image-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(20, 35, 58, 0.12);
}

.captcha-image-tile[data-selected="1"] {
  border-color: #2f7cff;
  box-shadow: 0 0 0 2px rgba(47, 124, 255, 0.2);
  transform: translateY(-1px);
}

.demo-action {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(100deg, #24364f, #1f70d4);
  box-shadow: 0 10px 24px rgba(22, 43, 78, 0.25);
}

.demo-result {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
  color: #334a67;
}

.sc-check-trigger {
  width: min(360px, 100%);
  min-height: 48px;
  border: 1px solid #d7e0ec;
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.sc-check-trigger:hover {
  border-color: #a9bfdc;
  box-shadow: 0 5px 14px rgba(16, 34, 62, 0.08);
}

.sc-check-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #c4d2e4;
  display: grid;
  place-items: center;
  color: #6b7f99;
  font-size: 14px;
  flex: 0 0 auto;
}

.sc-trigger-label {
  color: #22324a;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}

.sc-trigger-brand {
  margin-left: auto;
  font-size: 11px;
  color: #7a8aa0;
  border: 1px solid #d9e4f2;
  border-radius: 999px;
  padding: 3px 8px;
}

.sc-check-trigger[data-state="checking"] {
  border-color: #bfd1ee;
  background: #f8fbff;
}

.sc-check-trigger[data-state="verified"] {
  border-color: #9ad7b8;
  background: #f3fcf7;
}

.sc-check-trigger[data-state="verified"] .sc-check-box {
  border-color: #55b98a;
  background: #22c55e;
  color: #fff;
}

.sc-check-trigger[data-state="verified"] .sc-trigger-label {
  color: #17603f;
}

.sc-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  --sc-dialog-left: 50vw;
  --sc-dialog-top: 50vh;
  --sc-origin-x: 50%;
  --sc-origin-y: 50%;
}

.sc-modal[data-open="1"] {
  display: block;
}

.sc-modal[data-open="1"] .sc-mask::before {
  animation: scMaskIn .7s ease-out both;
}

.sc-modal[data-open="1"] .sc-dialog {
  animation: scDialogIn .78s cubic-bezier(.18,.72,.2,1) both;
}

.sc-modal[data-open="1"][data-closing="1"] .sc-mask::before {
  animation: scMaskOut .32s ease-in both;
}

.sc-modal[data-open="1"][data-closing="1"] .sc-dialog {
  animation: scDialogOut .32s cubic-bezier(.4,0,.2,1) both;
}

.sc-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sc-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 15, 28, 0.52);
  transform: scale(1);
  opacity: 0;
}

@supports (backdrop-filter: blur(2px)) {
  .sc-mask::before {
    backdrop-filter: blur(2px);
  }
}

.sc-dialog {
  position: absolute;
  width: min(460px, calc(100vw - 22px));
  left: var(--sc-dialog-left);
  top: var(--sc-dialog-top);
  transform-origin: var(--sc-origin-x) var(--sc-origin-y);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(14, 30, 52, 0.1);
  box-shadow: 0 28px 70px rgba(15, 25, 45, 0.34);
  padding: 14px;
}

.sc-close {
  position: absolute;
  top: 14px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(30, 45, 68, 0.1);
  color: #1f3555;
  font-size: 20px;
  line-height: 1;
}

/* Reserve close-button space only for modal header, no extra blank area */
.sc-dialog .captcha-head {
  padding-right: 42px;
  min-height: 32px;
  align-items: center;
}

.sc-body .captcha-panel,
.sc-body .intro-card {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 0;
}

@keyframes scMaskIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scDialogIn {
  from {
    opacity: 0;
    transform: scale(.18);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scMaskOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.sc-modal[data-mode="float"] .sc-mask {
  display: none;
}

.sc-modal[data-mode="float"] .sc-dialog {
  box-shadow: 0 18px 40px rgba(15, 25, 45, 0.24), 0 2px 8px rgba(15, 25, 45, 0.08);
}

.sc-modal[data-mode="modal"] .sc-mask {
  display: block;
  pointer-events: auto;
}

@keyframes scDialogOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(.18);
  }
}

@keyframes panelIn {
  from {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.intro-card,
.captcha-panel {
  animation: panelIn 0.45s ease-out;
}

@media (max-width: 920px) {
  .demo-shell {
    grid-template-columns: 1fr;
    max-width: 460px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }
}
