body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(233, 30, 99, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfbfb 0%, #f2f3f5 100%);
  color: #202124;
}

.verify-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  box-sizing: border-box;
}

.verify-panel {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.verify-title {
  color: #c2185b;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.verify-subtitle {
  margin-top: -6px;
  color: #777;
  font-size: 13px;
  line-height: 1.6;
}

.verify-widget {
  width: 320px;
  max-width: 100%;
  min-height: 78px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.verify-widget:hover {
  border-color: #e91e63;
  box-shadow: 0 6px 18px rgba(233, 30, 99, 0.12);
}

.verify-widget:focus-visible {
  outline: none;
  border-color: #e91e63;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.14);
}

.verify-widget:active {
  transform: translateY(1px);
}

.verify-checkbox {
  width: 28px;
  height: 28px;
  border: 2px solid #bdbdbd;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.verify-checkbox .mdui-icon {
  display: none;
  color: #fff;
  font-size: 20px;
}

.verify-widget:hover .verify-checkbox {
  border-color: #e91e63;
}

.verify-widget-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.verify-widget-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.verify-widget-hint {
  min-height: 16px;
  font-size: 12px;
  color: #777;
}

.verify-widget-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #9aa0a6;
  font-size: 9px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.verify-widget-brand .mdui-icon {
  color: #e91e63;
  font-size: 24px;
}

.verify-widget.verified {
  border-color: #c8e6c9;
  background: #fbfffb;
  cursor: default;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.08);
}

.verify-widget.verified .verify-checkbox {
  border-color: #43a047;
  background: #43a047;
}

.verify-widget.verified .verify-checkbox .mdui-icon {
  display: block;
}

.verify-widget.verified .verify-widget-hint {
  color: #2e7d32;
  font-weight: 500;
}

.verify-widget.verified .verify-widget-brand .mdui-icon {
  color: #43a047;
}

.captcha-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.captcha-overlay.active { display: flex; }

.captcha-card {
  position: relative;
  width: 340px;
  max-width: 94vw;
  background: #fff;
  border-radius: 6px;
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  isolation: isolate;
}

.captcha-card.animate-in {
  animation: captchaSlideIn 0.2s ease-out;
}

@keyframes captchaSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Header: solid pink bar ── */
.captcha-header {
  background: #e91e63;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 6px 6px 0 0;
}

.captcha-header-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.captcha-header-icon .mdui-icon { font-size: 18px; color: #fff; }

.captcha-header-text { flex: 1; min-width: 0; }

.captcha-header-title {
  font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2;
}

.captcha-header-subtitle {
  font-size: 10px; color: rgba(255,255,255,0.7); margin-top: 1px;
}

.captcha-header-close .mdui-icon { color: rgba(255,255,255,0.75) !important; font-size: 18px !important; }
.captcha-header-close { width: 32px !important; height: 32px !important; }
.captcha-header-close:hover { background: rgba(255,255,255,0.12) !important; }

/* ── Tabs: flat underline style ── */
.captcha-tabs-wrap {
  padding: 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
}

.captcha-mode-tabs {
  display: flex;
  width: 100%;
}

.captcha-mode-tab {
  flex: 1;
  padding: 9px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #999;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.captcha-mode-tab .mdui-icon { font-size: 13px; }
.captcha-mode-tab:hover { color: #666; background: #fafafa; }
.captcha-mode-tab.active { color: #e91e63; border-bottom-color: #e91e63; }
.captcha-mode-tab:focus-visible {
  outline: 2px solid rgba(233, 30, 99, 0.25);
  outline-offset: -2px;
}

/* ── Question: plain text ── */
.captcha-question-wrap { padding: 10px 14px 0; }

.captcha-question {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.5;
}

.captcha-question .anime-name-highlight { color: #e91e63; font-weight: 700; }

/* ── Body ── */
.captcha-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

#captcha-body-content { width: 100%; }

/* ── Status ── */
.captcha-status-msg {
  display: none;
  width: 100%;
  padding: 7px 10px;
  border-radius: 3px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

.captcha-status-msg.show { display: block; animation: fadeInUp 0.2s ease-out; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.captcha-status-msg.success { background: #e8f5e9; color: #2e7d32; }
.captcha-status-msg.error { background: #ffebee; color: #c62828; }
.captcha-status-msg.info { background: #fff3e0; color: #e65100; }

/* ── Search ── */
.captcha-search-box {
  position: relative;
  z-index: 50;
  width: 100%;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.captcha-search-inner {
  position: relative;
  width: 100%;
  z-index: 50;
}

.captcha-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  box-sizing: border-box;
}

.captcha-search-input:focus {
  border-color: #e91e63;
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
}

.captcha-search-input::placeholder { color: #bbb; }

.captcha-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: #bbb; font-size: 16px;
  pointer-events: none;
}

.captcha-search-results {
  position: absolute;
  top: calc(100% + 2px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10020;
  display: none;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
}

.captcha-search-results.show { display: block; }

.captcha-search-item {
  position: relative;
  padding: 8px 12px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
}

.captcha-search-item:last-child { border-bottom: none; }
.captcha-search-item:hover,
.captcha-search-item.captcha-search-highlight { background: #fce4ec; }
.captcha-search-item:hover::before,
.captcha-search-item.captcha-search-highlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e91e63;
}
.captcha-search-item .anime-cn { font-weight: 500; color: #333; }
.captcha-search-item .anime-jp { font-size: 11px; color: #aaa; margin-top: 1px; }
.captcha-search-empty { color: #aaa !important; cursor: default !important; font-size: 12px; }

/* ── Puzzle ── */
.captcha-puzzle-area { width: 100%; max-width: 280px; margin: 0 auto; }

.captcha-puzzle-header {
  margin-bottom: 8px;
  text-align: center;
}

.captcha-puzzle-anime-name {
  font-size: 12px;
  font-weight: 500;
  color: #e91e63;
}

.captcha-puzzle-drag-source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
}

.captcha-puzzle-drag-label {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

.captcha-puzzle-drag-piece {
  width: 50px; height: 50px;
  border-radius: 3px;
  overflow: hidden;
  cursor: grab;
  border: 2px solid #e91e63;
  transition: transform 0.1s;
  position: relative;
  user-select: none;
  touch-action: none;
}

.captcha-puzzle-drag-piece:active { cursor: grabbing; }
.captcha-puzzle-drag-piece:hover { transform: scale(1.05); }
.captcha-puzzle-drag-piece:focus-visible {
  outline: 2px solid rgba(233, 30, 99, 0.35);
  outline-offset: 2px;
}

.captcha-puzzle-drag-piece.ghost {
  position: fixed;
  pointer-events: none;
  z-index: 10001;
  opacity: 0.85;
  transform: scale(1.08);
  transition: none;
}

.captcha-puzzle-drag-piece .puzzle-piece-inner {
  width: 100%; height: 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  user-select: none;
}

.captcha-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: #ddd;
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
}

.captcha-puzzle-cell {
  position: relative;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 1;
  transition: all 0.15s;
  border: 2px solid transparent;
}

.captcha-puzzle-cell .puzzle-piece-inner {
  width: 100%; height: 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  user-select: none;
}

.captcha-puzzle-cell.locked { cursor: default; }

.captcha-puzzle-cell.empty {
  background: #f9f9f9;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-puzzle-cell.empty .shadow-icon {
  opacity: 0.12; font-size: 22px; color: #999;
}

.captcha-puzzle-cell.drop-hover {
  background: #fce4ec;
  border-color: #e91e63;
}

.captcha-puzzle-cell.drop-valid {
  border: 3px solid #4caf50;
}

.captcha-puzzle-cell.drop-invalid {
  border: 3px solid #f44336;
  animation: shakeCell 0.3s ease-in-out;
}

@keyframes shakeCell {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.captcha-puzzle-hint {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  margin-top: 6px;
}

/* ── Selection Counter ── */
.captcha-select-counter {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: #fafafa;
  border-radius: 4px;
}

.captcha-select-counter .counter-current {
  color: #e91e63;
  font-weight: 700;
  font-size: 13px;
}

.captcha-select-counter .counter-total { font-weight: 600; }

.captcha-select-counter.ready {
  background: #e8f5e9;
  color: #2e7d32;
}

.captcha-select-counter.ready .counter-current { color: #2e7d32; }

/* ── Image Grid: the main element ── */
.captcha-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  background: #ddd;
  border-radius: 4px;
  padding: 2px;
  overflow: hidden;
}

.captcha-image-cell {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.captcha-image-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  transition: filter 0.15s, transform 0.15s;
}

.captcha-image-cell:hover img {
  filter: brightness(0.94);
}

/* Selected: pink overlay + border, like hCaptcha */
.captcha-image-cell.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid #e91e63;
  box-sizing: border-box;
  z-index: 1;
  pointer-events: none;
}

.captcha-image-cell.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(233, 30, 99, 0.2);
  z-index: 1;
  pointer-events: none;
}

.captcha-image-cell .check-mark {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: #e91e63;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.captcha-image-cell.selected .check-mark { display: flex; }

.captcha-image-cell .check-mark .mdui-icon {
  font-size: 12px;
  color: #fff;
}

.captcha-image-cell .cell-index {
  position: absolute;
  bottom: 3px; left: 3px;
  width: 15px; height: 15px;
  background: rgba(0,0,0,0.4);
  border-radius: 2px;
  font-size: 9px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  pointer-events: none;
  z-index: 2;
}

.captcha-image-cell .cell-loading {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  transition: opacity 0.2s;
}

.captcha-image-cell.loaded .cell-loading {
  opacity: 0;
  pointer-events: none;
}

.cell-loading-spinner {
  width: 18px; height: 18px;
  border: 2px solid #e0e0e0;
  border-top-color: #e91e63;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.captcha-footer {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  min-height: 44px;
  border-radius: 0 0 6px 6px;
}

.captcha-footer-left {
  display: flex;
  align-items: center;
}

.captcha-footer-right { margin-left: auto; }

.captcha-footer .mdui-btn-icon {
  color: #aaa !important;
  width: 30px !important;
  height: 30px !important;
}

.captcha-footer .mdui-btn-icon .mdui-icon { font-size: 17px; }
.captcha-footer .mdui-btn-icon:hover { color: #777 !important; }

.captcha-footer-brand {
  display: flex;
  align-items: center;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid #e8e8e8;
  height: 24px;
}

.captcha-footer-brand-text {
  font-size: 9px;
  color: #c0c0c0;
  line-height: 1.15;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.captcha-footer-right .mdui-btn {
  min-width: 72px;
  height: 32px;
  border-radius: 4px;
  background: #e91e63 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 600;
  box-shadow: none;
  text-transform: none;
}

.captcha-footer-right .mdui-btn[disabled] {
  background: #e0e0e0 !important;
  color: #9e9e9e !important;
  cursor: not-allowed;
  opacity: 1;
}

.captcha-footer-right .mdui-btn[disabled]:hover,
.captcha-footer-right .mdui-btn[disabled]:active {
  background: #e0e0e0 !important;
}

.captcha-footer-right .mdui-btn:hover {
  background: #c2185b !important;
}

.captcha-footer-right .mdui-btn:active {
  background: #ad1457 !important;
}

/* ── Loading ── */
.captcha-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  gap: 10px;
}

.captcha-loading-text { font-size: 12px; color: #aaa; }

/* ── Responsive ── */
@media (max-width: 420px) {
  .verify-page { min-height: calc(100vh - 56px); padding: 28px 14px; }
  .verify-title { font-size: 20px; }
  .verify-widget { width: 100%; min-height: 74px; padding: 12px; }
  .verify-widget-title { font-size: 15px; }
  .captcha-overlay { padding: 0; align-items: flex-start; }
  .captcha-card { width: 100%; max-width: 100%; border-radius: 0; border-left: none; border-right: none; }
  .captcha-header { border-radius: 0; }
  .captcha-footer { border-radius: 0; }
  .captcha-header { padding: 9px 12px; }
  .captcha-body { padding: 8px 10px; }
  .captcha-mode-tab { font-size: 10px; padding: 8px 1px; }
  .captcha-mode-tab .mdui-icon { font-size: 12px; }
  .captcha-puzzle-drag-piece { width: 44px; height: 44px; }
  .captcha-footer-brand { display: none; }
  .captcha-search-results { max-height: 48vh; }
}

/* ── Scrollbar ── */
.captcha-search-results::-webkit-scrollbar { width: 4px; }
.captcha-search-results::-webkit-scrollbar-track { background: transparent; }
.captcha-search-results::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
