:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface-2: #1f2430;
  --border: #2a3142;
  --text: #e8eaef;
  --text-muted: #9aa3b5;
  --accent: #60a5fa;
  --accent-ae: #f59e0b;
  --accent-awb: #60a5fa;
  --accent-isp: #34d399;
  --accent-g: #34d399;
  --accent-l: #a78bfa;
  --accent-chip: #e8eaef;
  --radius: 10px;
  --font: "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --compare-height: 38%;
  --compare-cell-width: 300px;
  --compare-summary-row-height: 1.75rem;
  --header-control-h: 32px;
  /* 彩色 chip 选中：W1 细白边 + 轻外晕 */
  --color-chip-hover-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
  --color-chip-active-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.92),
    0 0 5px 1px rgba(255, 255, 255, 0.45);
}

.split-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.split-divider {
  flex: 0 0 6px;
  background: var(--border);
  cursor: row-resize;
  position: relative;
  z-index: 5;
}

.split-divider:hover,
.split-divider.is-dragging {
  background: #4a5568;
}

.split-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-muted);
  opacity: 0.5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.review-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 0;
}

.review-header__start {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.review-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.review-header__link {
  font-size: 0.82rem;
  color: var(--accent-awb);
  text-decoration: none;
  white-space: nowrap;
}

.review-header__end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex-shrink: 0;
}

.shortcut-hint {
  position: relative;
}

.shortcut-hint__trigger {
  display: inline-flex;
  align-items: center;
  height: var(--header-control-h);
  padding: 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: default;
  white-space: nowrap;
  box-sizing: border-box;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.shortcut-hint:hover .shortcut-hint__trigger,
.shortcut-hint:focus-within .shortcut-hint__trigger {
  color: var(--text);
  border-color: #4a5568;
  background: var(--surface-2);
}

.shortcut-hint__panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 380px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  z-index: 200;
}

.shortcut-hint:hover .shortcut-hint__panel,
.shortcut-hint:focus-within .shortcut-hint__panel {
  display: block;
}

.shortcut-hint__head {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.75rem;
  padding: 0.15rem 0 0.35rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.shortcut-hint__row {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.75rem;
  padding: 0.28rem 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.shortcut-hint__key {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.shortcut-hint__action {
  color: var(--text-muted);
  white-space: nowrap;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: var(--header-control-h);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  box-sizing: border-box;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lang-toggle-btn:hover {
  color: var(--text);
  border-color: #4a5568;
  background: var(--surface-2);
}

.lang-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-awb);
  outline-offset: 2px;
}

.lang-toggle-mark {
  position: relative;
  display: block;
  width: 24px;
  height: 22px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.lang-toggle-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.5;
  transform: translate(-50%, -50%) rotate(-38deg);
}

.lang-toggle-mark__zh {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 11px;
}

.lang-toggle-mark__en {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 9px;
  letter-spacing: 0.02em;
}

html[data-lang="en"] .lang-toggle-mark__en,
html[data-lang="zh"] .lang-toggle-mark__zh {
  color: var(--accent-awb);
}

html[data-lang="en"] .chip {
  font-size: 0.72rem;
}

html[data-lang="en"] .tag-rect {
  width: 176px;
  height: 136px;
  padding: 0.32rem 0.5rem;
}

html[data-lang="en"] .tag-rect__btn {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
}

html[data-lang="en"] .local-btn,
html[data-lang="en"] .sat-label {
  font-size: 0.72rem;
}

html[data-lang="en"] .cast-block__label {
  font-size: 0.62rem;
}

.review-header__display {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: var(--header-control-h);
  padding: 0 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.review-header__display.is-hdr {
  color: #fbbf24;
}

.review-header__display.is-sdr {
  color: var(--accent-awb);
}

/*
 * U 键 SDR：hint UA 将 HDR JPEG tone-map 到 SDR（仅显示，不改文件）。
 * 需作用在 transform 祖先链上，否则 WebKit 易漏掉 HDR 图层（同 ABtest）。
 */
html.review-sdr-display .review-app,
html.review-sdr-display .compare-section,
html.review-sdr-display .compare-section__images,
html.review-sdr-display .compare-row,
html.review-sdr-display .compare-cell,
html.review-sdr-display .compare-cell__viewport,
html.review-sdr-display .compare-cell__inner,
html.review-sdr-display .compare-cell__img {
  -webkit-dynamic-range-limit: standard;
  dynamic-range-limit: standard;
}

/*
 * Y 键黑白：filter 去色（可见性优先；HDR Gain Map 高光在灰度下可能略压缩）。
 */
html.review-grayscale-display .compare-cell__inner {
  filter: grayscale(100%);
}

.compare-section {
  flex: 0 0 auto;
  height: var(--compare-height);
  min-height: 140px;
  padding: 0.45rem 1rem 0.65rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.compare-section__images {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.compare-column {
  position: relative;
  flex: 0 0 auto;
  width: var(--compare-cell-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.compare-cell__summary {
  flex: 0 0 var(--compare-summary-row-height);
  min-height: var(--compare-summary-row-height);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  pointer-events: auto;
  overflow: hidden;
}

.compare-row {
  display: flex;
  gap: 1rem;
  height: 100%;
  align-items: stretch;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

.compare-cell {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--surface);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
}

.compare-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
}

.compare-cell.is-selected::after {
  border-color: var(--accent-awb);
}

.compare-cell.is-tab-compare::after {
  border-color: var(--accent-isp);
}

.compare-cell.is-tab-compare.is-selected::after {
  border-color: var(--accent-isp);
}

.compare-cell__label {
  padding: 0.35rem 0.5rem 0.18rem;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.compare-cell__viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
}

.compare-row.is-panning .compare-cell__viewport {
  cursor: grabbing;
}

.compare-cell__inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  height: 100%;
  width: 100%;
}

.compare-cell__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  display: block;
  flex-shrink: 0;
}

.compare-cell__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.compare-cell__overlay.is-active {
  pointer-events: auto;
}

.bbox-rect {
  position: absolute;
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-sizing: border-box;
}

.bbox-rect.is-drawing {
  border-style: dashed;
}

.pick-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.range-mask-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.interaction-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 100;
  pointer-events: none;
}

.interaction-mask.is-active {
  pointer-events: auto;
}

.interaction-mask__hint {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
  z-index: 101;
  pointer-events: none;
}

.compare-cell.is-spotlight {
  position: relative;
  z-index: 102;
  box-shadow: 0 0 0 3px var(--accent);
}

.compare-cell.is-ref-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.annotate-section {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding: 0.85rem 1rem 1.25rem;
  background: var(--surface);
  border-top: none;
}

.annotate-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.35rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.summary-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.issue-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  font-size: 0.82rem;
}

.issue-item__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.issue-item__groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.issue-segment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
}

.issue-segment--desc,
.issue-segment--meta,
.issue-segment--extra {
  gap: 0.85rem;
}

.issue-segment--loc {
  gap: 0.32rem;
}

.issue-item__conflict {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.issue-item__warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1;
  flex-shrink: 0;
}

.issue-item__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-height: 1.5rem;
  opacity: 0;
  transition: opacity 0.12s;
  padding-right: 0.25rem;
}

.issue-item:hover .issue-item__actions,
.issue-item:focus-within .issue-item__actions {
  opacity: 1;
}

.issue-item__edit {
  border: none;
  background: none;
  color: var(--accent-awb);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  line-height: 1.2;
}

.issue-item__edit:hover {
  text-decoration: underline;
}

.issue-item__delete {
  border: none;
  background: none;
  color: #ef4444;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  line-height: 1.2;
}

.issue-item__delete:hover {
  text-decoration: underline;
}

.issue-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.chip {
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}

.chip--cast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 500;
}

.chip--tone {
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 500;
}

.chip--conflict {
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
  font-weight: 600;
}

.chip--meta {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  line-height: 1.35;
}

.chip--optional {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.chip--selection {
  background: var(--surface-2);
  color: #93c5fd;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.chip--selection__icon {
  display: inline-block;
  vertical-align: -0.08em;
  margin-right: 0.2rem;
  opacity: 0.85;
}

.chip--selection:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  color: #bfdbfe;
}

.chip--selection.is-preview-active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  color: #dbeafe;
}

.btn-add {
  display: inline-block;
  width: auto;
  min-width: 140px;
  margin: 0;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent-chip);
  color: #111;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-add:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-add:not(:disabled):hover {
  filter: brightness(0.95);
}

.wizard {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Mindmap flow wizard (Xmind-style) ── */
.flow-wizard {
  position: relative;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.flow-wizard__selected {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 2;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  pointer-events: none;
}

.flow-wizard__selected strong {
  color: var(--accent-awb);
}

.flow-entry-btn {
  padding: 0.24rem 0.55rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-awb) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-awb) 35%, transparent);
  color: var(--accent-awb);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  white-space: nowrap;
  box-sizing: border-box;
}

.flow-entry-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.flow-entry-btn:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent-awb) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent-awb) 50%, transparent);
}

.mindmap {
  position: relative;
  height: var(--mindmap-height, 188px);
  min-height: var(--mindmap-height, 188px);
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
  box-sizing: border-box;
}

.mindmap__svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.mindmap__content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.mm-row {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: min-content;
}

.mm-segment {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 1.75rem 0 0.35rem;
}

.mm-fork-wrap {
  flex: 0 0 auto;
  padding-left: 0;
}

.mm-fork {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mm-wire {
  fill: none;
  stroke: #555c6e;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mm-node--panel {
  max-width: 100%;
}

.flow-pill {
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: default;
  box-sizing: border-box;
  line-height: 1.25;
  white-space: nowrap;
}

.flow-pill--confirmed {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.flow-pill.is-clickable {
  cursor: pointer;
}

.flow-pill.is-clickable:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--text-muted) 40%, var(--border));
}

.flow-branch-btn {
  padding: 0.24rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.25;
}

.flow-branch-btn--pending {
  background: rgba(200, 205, 216, 0.08);
  border: 1px solid rgba(200, 205, 216, 0.28);
  color: var(--text);
}

.flow-branch-btn--pending:hover {
  background: rgba(200, 205, 216, 0.16);
  border-color: rgba(200, 205, 216, 0.45);
}

.flow-branch-btn.is-selected {
  background: color-mix(in srgb, var(--accent-awb) 14%, var(--surface-2));
  color: var(--accent-awb);
  border-color: color-mix(in srgb, var(--accent-awb) 35%, transparent);
  font-weight: 600;
}

.wizard-footer {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  margin: 0;
  padding: 0;
  text-align: right;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.3;
  pointer-events: none;
}

.top-suggestions {
  margin-top: 0.85rem;
}

.top-suggestions__hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.top-suggestions__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.top-suggestion-chip {
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accent-awb) 30%, var(--border));
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1.3;
}

.top-suggestion-chip:hover {
  background: color-mix(in srgb, var(--accent-awb) 10%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-awb) 45%, var(--border));
}

/* AE tag rectangle — D2 深渐变底 + D4 蓝 accent 选中 */
.tag-rect {
  width: 132px;
  height: 124px;
  background: linear-gradient(180deg, #2f3648 0%, #1a1f2b 100%);
  border: 1px solid #3a4256;
  border-radius: 4px;
  padding: 0.28rem 0.38rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.05rem;
  box-sizing: border-box;
}

.tag-rect__btn {
  padding: 0.08rem 0.32rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.15;
  box-sizing: border-box;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.tag-rect__btn--edge {
  font-size: 0.6rem;
  font-weight: 400;
  color: rgba(232, 234, 239, 0.48);
  padding: 0.04rem 0.26rem;
  letter-spacing: 0.02em;
}

.tag-rect__btn:hover:not(.is-selected) {
  background: color-mix(in srgb, var(--accent-awb) 12%, transparent);
  color: #fff;
}

.tag-rect__btn--edge:hover:not(.is-selected) {
  color: rgba(232, 234, 239, 0.72);
  background: color-mix(in srgb, var(--accent-awb) 8%, transparent);
}

.tag-rect__btn.is-selected {
  color: var(--accent-awb);
  background: color-mix(in srgb, var(--accent-awb) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-awb) 38%, transparent);
}

.tag-rect__btn.is-selected:hover {
  background: color-mix(in srgb, var(--accent-awb) 20%, var(--surface-2));
}

.tag-rect__btn--edge.is-selected {
  font-size: 0.6rem;
}

.tag-rect__row {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

/* AWB cast — 183×150 + 饱和列 */
.awb-issue-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.awb-issue-col {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.cast-wrap {
  flex: 0 0 auto;
}

.cast-rect {
  width: 132px;
  height: 112px;
  border-radius: 4px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 3px;
  cursor: crosshair;
  box-sizing: border-box;
  /* Figma: Radial 叠 Angular — 中心发白、边缘饱和 */
  background:
    radial-gradient(
      ellipse 72% 72% at 50% 50%,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.62) 28%,
      rgba(255, 255, 255, 0.18) 52%,
      transparent 68%
    ),
    conic-gradient(
      from 0deg at 50% 50%,
      #8adb87 0deg,
      #cedf6d 45deg,
      #ffe279 90deg,
      #ec9e9b 135deg,
      #d85bbd 180deg,
      #a97cda 225deg,
      #7b9ef7 270deg,
      #85bdac 315deg,
      #8adb87 360deg
    );
  position: relative;
}

.cast-center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: #111;
  pointer-events: none;
  z-index: 0;
}

.cast-block {
  position: relative;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1;
  transition: background 0.06s, box-shadow 0.06s, backdrop-filter 0.06s;
}

.cast-block__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 500;
  color: #111;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s;
}

.cast-block.is-hover .cast-block__label,
.cast-block.is-selected .cast-block__label {
  opacity: 1;
}

.cast-block.is-selected .cast-block__label {
  font-weight: 600;
}

.cast-block--top { grid-column: 2; grid-row: 1; }
.cast-block--bottom { grid-column: 2; grid-row: 3; }
.cast-block--left { grid-column: 1; grid-row: 2; }
.cast-block--right { grid-column: 3; grid-row: 2; }
.cast-block--tl { grid-column: 1; grid-row: 1; }
.cast-block--tr { grid-column: 3; grid-row: 1; }
.cast-block--bl { grid-column: 1; grid-row: 3; }
.cast-block--br { grid-column: 3; grid-row: 3; }

.cast-block.is-hover {
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}

/* A7 · 磨砂玻璃 + inset 高光 + 外白 blur */
.cast-block.is-selected {
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.55),
    inset 0 -1px 3px rgba(0, 0, 0, 0.06),
    0 0 16px rgba(255, 255, 255, 0.48),
    0 3px 12px rgba(0, 0, 0, 0.08);
}

.flow-sat-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  width: fit-content;
  min-width: 56px;
  height: 112px;
  padding: 6px 6px;
  /* Figma Rectangle 34 — 74×150: #de7825 → #ddb390 */
  background: linear-gradient(180deg, #de7825 0%, #ddb390 100%);
  border-radius: 4px;
  box-sizing: border-box;
}

.sat-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  user-select: none;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
  padding: 0.1rem 0.15rem;
  border: none;
  background: none;
  border-radius: 5px;
  transition: background 0.06s, color 0.06s, box-shadow 0.06s;
}

.sat-label:hover {
  color: #111;
  background: rgba(255, 255, 255, 0.22);
}

.sat-label.is-selected {
  color: #111;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 0.12rem 0.22rem;
  box-shadow:
    inset 0 1px 4px rgba(255, 255, 255, 0.6),
    0 0 12px rgba(255, 255, 255, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.local-type-input--inline {
  width: 8rem;
  min-width: 6rem;
}

/* Local panel */
.local-panel {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.local-panel__sync {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: fit-content;
  max-width: 100%;
}

.local-row--semantic {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
}

.local-row--type {
  width: fit-content;
  max-width: 100%;
}

.local-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
}

.local-row__leading {
  display: flex;
  gap: 0.28rem;
  align-items: center;
  min-width: 0;
}

.local-btn {
  min-height: 22px;
  height: 22px;
  padding: 0 0.48rem;
  border-radius: 4px;
  background: rgba(200, 205, 216, 0.1);
  border: none;
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.25;
}

.local-btn:hover:not(.local-btn--face) {
  background: rgba(200, 205, 216, 0.18);
}

.local-btn--labeled {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.local-btn--labeled svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.local-btn.is-active:not(.local-btn--face) {
  background: color-mix(in srgb, var(--accent-awb) 14%, var(--surface-2));
  color: var(--accent-awb);
  border: 1px solid color-mix(in srgb, var(--accent-awb) 35%, transparent);
  outline: none;
  box-shadow: none;
}

.local-btn--wide {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.local-btn--icon {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(200, 205, 216, 0.12);
}

.local-btn--icon svg {
  width: 16px;
  height: 16px;
}

.range-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.local-btn--range {
  height: 22px;
  min-height: 22px;
  min-width: 0;
  padding: 0 0.48rem;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  background: rgba(200, 205, 216, 0.12);
}

.local-btn--range svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.local-btn__label {
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.local-btn--reset {
  background: rgba(200, 205, 216, 0.12);
}

.local-btn--face {
  color: #111;
  transition: box-shadow 0.14s ease, transform 0.14s ease;
  position: relative;
  z-index: 0;
}

.local-btn--face:hover:not(.is-active) {
  z-index: 1;
  box-shadow: var(--color-chip-hover-shadow);
}

.local-btn--face.is-active {
  z-index: 2;
  color: #111;
  border: none;
  box-shadow: var(--color-chip-active-shadow);
}

.local-btn--face-base,
.local-btn--face-highlight,
.local-btn--face-shadow {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%), #d0915c;
}

.local-hue-row {
  display: flex;
  gap: 3px;
  align-items: center;
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  height: 22px;
}

.hue-block {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  display: block;
  position: relative;
  z-index: 0;
  transition: box-shadow 0.14s ease, transform 0.14s ease;
}

.hue-block:hover:not(.is-active) {
  z-index: 1;
  box-shadow: var(--color-chip-hover-shadow);
}

.hue-block.is-active {
  z-index: 2;
  box-shadow: var(--color-chip-active-shadow);
  outline: none;
}

.hue-block--narrow { flex: 0 0 18px; width: 18px; }
.hue-block--wide { flex: 1 1 28px; max-width: 44px; min-width: 28px; }

.local-type-input--compact {
  width: 9rem;
  max-width: 100%;
}

.local-type-input {
  width: 100%;
  min-height: 22px;
  height: 22px;
  padding: 0 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #2a3142;
  color: var(--text-muted);
  font-size: 0.75rem;
  box-sizing: border-box;
}

.local-type-input:focus {
  outline: 1px solid var(--border);
  color: var(--text);
}

.flow-next-btn {
  margin-top: 0.35rem;
  align-self: flex-start;
}

.flow-finalize {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 240px;
}

.flow-finalize__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wizard-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.wizard-btn:hover {
  border-color: var(--accent);
}

.wizard-btn.is-primary {
  background: var(--accent-chip);
  color: #111;
  border-color: transparent;
  font-weight: 600;
}

.wizard-btn.is-active {
  outline: 2px solid var(--accent);
}

.wizard-btn--icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wizard-btn--icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.wizard-local {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.wizard-local__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.wizard-local__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 4rem;
}

.wizard-input {
  flex: 1;
  min-width: 120px;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 2rem);
  gap: 0.25rem;
}

.color-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-swatch.is-active {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.finalize-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.finalize-note-input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.ref-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.35rem;
}
