.value-page .preview-wrap img {
  max-height: 520px;
}

.image-gallery {
  width: 100%;
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.image-thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.image-thumb.active {
  border-color: rgba(246, 193, 119, 0.9);
  box-shadow: 0 0 0 2px rgba(246, 193, 119, 0.18);
}

.image-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-thumb span {
  position: absolute;
  left: 0.35rem;
  top: 0.3rem;
  min-width: 1.2rem;
  padding: 0.08rem 0.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

/* 缩略图右上角删除按钮 */
.image-thumb .thumb-delete {
  position: absolute;
  left: auto;
  right: 0.25rem;
  top: 0.25rem;
  width: 1.45rem;
  height: 1.45rem;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  background: rgba(210, 40, 40, 0.82);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  opacity: 0.9;
  transition: opacity 0.15s;
  cursor: pointer;
  z-index: 2;
}

/* 桌面 hover 时显示删除按钮 */
.image-thumb:hover .thumb-delete {
  opacity: 1;
}

/* 手机：始终显示删除按钮（无 hover 状态） */
@media (hover: none) {
  .image-thumb .thumb-delete {
    opacity: 0.85;
  }
}

/* 点击反馈 */
.image-thumb .thumb-delete:active {
  background: rgba(180, 20, 20, 1);
  transform: scale(0.92);
}

.image-add-thumb {
  min-height: 72px;
  aspect-ratio: 4 / 3;
  border-style: dashed;
  border-color: rgba(127, 154, 255, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8d5ff;
}

.image-add-thumb span {
  position: static;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 2rem;
  line-height: 1;
}

.image-add-thumb:hover,
.image-add-thumb:focus-visible {
  border-color: rgba(127, 154, 255, 0.9);
  background: rgba(127, 154, 255, 0.12);
}

.ocr-debug-panel {
  width: min(100%, 980px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.ocr-debug-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: #d9deeb;
}

.ocr-debug-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.ocr-debug-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.ocr-debug-table {
  margin: 0;
  min-width: 760px;
}

.ocr-debug-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111827;
}

.value-panel h2,
.value-summary-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.value-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.value-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.roster-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.roster-control select {
  min-width: 7.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--txt);
  font: inherit;
}

.value-section-head h2 {
  margin: 0;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.value-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--txt);
}

.value-grid span {
  color: #d9deeb;
  font-size: 0.88rem;
  font-weight: 700;
}

.value-grid input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--txt);
  font: inherit;
}

.roster-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.roster-table {
  margin: 0;
}

.roster-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #10131f;
}

.roster-table input {
  width: 100%;
  min-width: 5.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.38rem 0.45rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--txt);
  font: inherit;
}

.roster-table .roster-shackle-input {
  min-width: 3.6rem;
}

.roster-table .btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.value-grid small {
  color: var(--muted);
  font-size: 0.75rem;
}

.skin-exclusive-panel {
  margin-top: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.16);
  display: grid;
  gap: 0.7rem;
}

.skin-exclusive-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  color: var(--txt);
}

.skin-exclusive-head strong {
  font-size: 0.95rem;
}

.skin-exclusive-head span,
.skin-exclusive-panel small {
  color: var(--muted);
  font-size: 0.78rem;
}

.skin-exclusive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 0.45rem 0.65rem;
}

.skin-exclusive-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--txt);
  font-size: 0.88rem;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.skin-exclusive-item input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #7f9aff;
}

.value-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.value-summary > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.22);
}

.value-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.value-summary strong {
  display: block;
  color: #f6c177;
  font-size: 1.2rem;
}

.value-summary > div:first-child strong {
  color: #7dd3a0;
  font-size: 1.45rem;
}

.recognized-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.missing-list {
  display: grid;
  gap: 0.75rem;
}

.missing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.char-tag.missing {
  border-color: rgba(127, 154, 255, 0.28);
  background: rgba(127, 154, 255, 0.1);
  color: #c8d5ff;
}

.recognized-group {
  display: grid;
  gap: 0.5rem;
}

.recognized-group > strong {
  color: #d9deeb;
}

.char-tag.ssr {
  border-color: rgba(246, 193, 119, 0.45);
  background: rgba(246, 193, 119, 0.14);
  color: #ffe0ad;
}

.value-char-card {
  display: inline-grid;
  gap: 0.18rem;
  border: 1px solid rgba(127, 154, 255, 0.28);
  border-radius: 8px;
  padding: 0.42rem 0.58rem;
  background: rgba(127, 154, 255, 0.12);
  color: #c8d5ff;
  font-size: 0.82rem;
}

.value-char-card.ssr {
  border-color: rgba(246, 193, 119, 0.45);
  background: rgba(246, 193, 119, 0.14);
  color: #ffe0ad;
}

.value-char-card strong {
  color: #fff2d6;
}

.value-char-card small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 720px) {
  .value-page {
    padding-inline: 0.75rem;
  }

  .value-page .box-header {
    gap: 0.65rem;
  }

  .value-page .lead {
    font-size: 0.88rem;
  }

  .value-page .status-pill {
    align-self: flex-start;
    max-width: min(100%, 18rem);
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .value-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .value-head-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .value-head-actions .btn {
    width: 100%;
    padding-inline: 0.45rem;
  }

  .value-grid,
  .value-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .value-head-actions {
    grid-template-columns: 1fr;
  }
}
.card-box {
  position: absolute;
  border: 1px solid rgba(120, 180, 255, 0.75);
  background: rgba(120, 180, 255, 0.04);
}

.raw-ocr-box {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.45);
}

.ocr-anchor-star {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe45c;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 3px #000, 0 0 8px rgba(255, 228, 92, 0.75);
}

.shackle-sample-point {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  border: none;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.shackle-sample-point.lit {
  background: #ffe45c;
  box-shadow: 0 0 2px rgba(255, 228, 92, 0.85);
}

.shackle-sample-point.unlit {
  background: rgba(108, 112, 132, 0.92);
}

.shackle-region-box {
  position: absolute;
  border: 2px dashed rgba(196, 140, 255, 0.95);
  background: rgba(180, 140, 255, 0.12);
  box-shadow: 0 0 8px rgba(180, 140, 255, 0.45);
}

.shackle-count-badge {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 193, 119, 0.85);
  background: rgba(20, 16, 12, 0.88);
  color: #ffe0ad;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 0 6px rgba(246, 193, 119, 0.35);
  pointer-events: none;
}

.shackle-center-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid rgba(180, 140, 255, 0.95);
  background: rgba(180, 140, 255, 0.45);
  transform: translate(-50%, -50%);
}

.overlay-legend .legend-shackle-lit,
.overlay-legend .legend-shackle-dim,
.overlay-legend .legend-shackle-region,
.overlay-legend .legend-shackle-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.overlay-legend .legend-shackle-count::before {
  content: "3锁";
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 193, 119, 0.85);
  background: rgba(20, 16, 12, 0.88);
  color: #ffe0ad;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
}

.name-label {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 0.28rem;
  border-radius: 4px;
  border: 1px solid rgba(127, 154, 255, 0.55);
  background: rgba(8, 10, 18, 0.9);
  color: #e8ecff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);
}

.name-anchor-point {
  position: absolute;
  border-radius: 50%;
  background: rgba(125, 211, 160, 0.95);
  box-shadow: 0 0 4px rgba(125, 211, 160, 0.75);
}

.recognition-trace-panel {
  width: min(100%, 980px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.recognition-trace-list {
  margin: 0;
  padding: 0.55rem 0.85rem 0.7rem 1.6rem;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
  color: #d9deeb;
  font-size: 0.84rem;
  line-height: 1.45;
}

.recognition-trace-list li {
  padding: 0.15rem 0;
}

.recognition-trace-list .trace-hit {
  color: #ffe0ad;
}

.recognition-trace-list .trace-miss {
  color: #c8d5ff;
}

.recognition-trace-label {
  position: absolute;
  max-width: 9rem;
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  border: 1px solid rgba(127, 154, 255, 0.45);
  background: rgba(8, 10, 18, 0.88);
  color: #e8ecff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);
}
