/* 找不同 · 样式（.g-spotdiff 前缀） */

.g-spotdiff {
  padding-left: 12px;
  padding-right: 12px;
  gap: 10px;
}

.g-spotdiff .sd-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ---------------- 初始界面 ---------------- */
.g-spotdiff .sd-idle {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 20px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-spotdiff .sd-idle-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 32px;
  font-weight: 900;
  color: #0b2812;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 30px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.g-spotdiff .sd-idle-title { font-size: 21px; font-weight: 800; }
.g-spotdiff .sd-idle-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 30em;
  margin: 0 auto;
}
.g-spotdiff .sd-label { font-size: 10.5px; letter-spacing: 0.14em; color: var(--faint); margin-top: 2px; }
.g-spotdiff .sd-seg .seg { width: 100%; }
.g-spotdiff .sd-diff-desc { font-size: 11.5px; color: var(--dim); min-height: 17px; }
.g-spotdiff .sd-bests { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; }
.g-spotdiff .sd-best-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.g-spotdiff .sd-best-chip.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.g-spotdiff .sd-rule { font-size: 11px; line-height: 1.6; color: var(--faint); }
.g-spotdiff .sd-rule b { color: var(--accent); font-weight: 700; }
.g-spotdiff .sd-resume { margin-top: 0; }

/* ---------------- 进行中 ---------------- */
.g-spotdiff .sd-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g-spotdiff .sd-progress { height: 6px; flex: none; }
.g-spotdiff .sd-progress > i { transition: width 0.12s linear; }
.g-spotdiff .stat-v.low { color: var(--err); animation: sdPulse 0.9s ease-in-out infinite; }
@keyframes sdPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.g-spotdiff .sd-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
}
.g-spotdiff .sd-step {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s, box-shadow 0.18s;
}
.g-spotdiff .sd-step.done { background: var(--accent); border-color: transparent; box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent); }
.g-spotdiff .sd-step.now { background: rgba(255, 255, 255, 0.28); }

.g-spotdiff .sd-panels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
  margin-top: auto;
  margin-bottom: auto;
  touch-action: manipulation;
}
.g-spotdiff .sd-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 460;
  border-radius: 15px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255, 255, 255, 0.055), transparent 60%),
    linear-gradient(160deg, rgba(22, 30, 44, 0.9), rgba(13, 18, 27, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px -18px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.g-spotdiff .sd-svg { display: block; width: 100%; height: 100%; }

/* 差异标记 */
.g-spotdiff .sd-mark-found {
  stroke: var(--ok);
  filter: drop-shadow(0 0 6px rgba(62, 207, 142, 0.8));
  animation: sdMarkIn 0.28s cubic-bezier(0.3, 1.4, 0.4, 1) both;
}
.g-spotdiff .sd-mark-timeout {
  stroke: var(--err);
  filter: drop-shadow(0 0 6px rgba(255, 92, 108, 0.7));
  animation: sdMarkIn 0.28s cubic-bezier(0.3, 1.4, 0.4, 1) both;
}
.g-spotdiff .sd-mark-hint {
  stroke: var(--warn);
  filter: drop-shadow(0 0 8px rgba(255, 176, 32, 0.55));
  animation: sdHintPulse 0.9s ease-in-out infinite;
}
.g-spotdiff .sd-mark-wrong {
  stroke: rgba(255, 92, 108, 0.9);
  animation: sdWrongOut 0.42s ease-out both;
}
@keyframes sdMarkIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes sdHintPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.45; }
}
@keyframes sdWrongOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.g-spotdiff .sd-feedback {
  min-height: 19px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--faint);
  text-align: center;
  transition: color 0.16s;
}
.g-spotdiff .sd-feedback.ok { color: var(--ok); font-weight: 600; }
.g-spotdiff .sd-feedback.bad { color: #ff8b96; }
.g-spotdiff .sd-feedback.hint { color: var(--warn); }

/* ---------------- 结算 ---------------- */
.g-spotdiff .sd-result {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-spotdiff .sd-result-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--dim);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 12px;
}
.g-spotdiff .sd-result-badge.record {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 20px -8px var(--accent);
}
.g-spotdiff .sd-result-k { font-size: 11.5px; color: var(--faint); }
.g-spotdiff .sd-result-score { display: flex; align-items: baseline; gap: 4px; margin-top: -2px; }
.g-spotdiff .sd-score-n {
  font-size: 62px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(130deg, #dcffe4, var(--accent) 55%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent));
}
.g-spotdiff .sd-score-k { font-size: 14px; color: var(--faint); }

.g-spotdiff .sd-round-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.g-spotdiff .sd-round-chip {
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
}
.g-spotdiff .sd-round-chip.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.g-spotdiff .sd-round-chip.bad { color: #ff8b96; border-color: rgba(255, 92, 108, 0.3); }

.g-spotdiff .sd-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.g-spotdiff .sd-result-grid .stat { background: rgba(255, 255, 255, 0.04); }
.g-spotdiff .sd-result-actions { display: flex; gap: 8px; width: 100%; margin-top: 2px; }
.g-spotdiff .sd-result-actions .btn { flex: 1; min-height: 46px; }

@media (max-height: 700px) {
  .g-spotdiff .sd-idle-icon { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
  .g-spotdiff .sd-rule { display: none; }
  .g-spotdiff .sd-steps { display: none; }
  .g-spotdiff .sd-play { gap: 8px; }
  .g-spotdiff .sd-score-n { font-size: 52px; }
}
