/* Three selector studies. They are enabled only by ?selector=a|b|c so the
   approved theme page remains untouched until a direction is chosen. */

body[data-selector-preview] .theme-segmented {
  isolation: isolate;
}

body[data-selector-preview] .theme-segment {
  transition:
    color 160ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 120ms cubic-bezier(.22, 1, .36, 1),
    text-shadow 160ms ease !important;
}

body[data-selector-preview] .theme-segment:active {
  transform: scale(.975) !important;
}

/* A · 金箔嵌片：完整亮面最醒目，适合快速确认当前选择。 */
body[data-selector-preview="a"] .theme-segmented {
  min-height: 48px;
  overflow: visible;
  border: 1px solid rgba(209, 151, 52, .52);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(8, 20, 15, .94), rgba(0, 8, 6, .88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 153, .035),
    0 12px 24px rgba(0, 0, 0, .24) !important;
}

body[data-selector-preview="a"] .theme-segment-indicator {
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 12px) / 3);
  height: auto;
  border: 1px solid rgba(255, 226, 137, .94);
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 247, 207, .42), transparent 54%),
    linear-gradient(180deg, #c8943f 0%, #805017 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 217, .58),
    inset 0 -10px 18px rgba(80, 39, 4, .22),
    0 0 0 1px rgba(81, 45, 7, .5),
    0 0 18px rgba(242, 190, 78, .3);
  transform: translateX(calc(var(--active-index) * (100% + 3px)));
}

body[data-selector-preview="a"] .theme-segment.is-active {
  color: #fff0bd !important;
  text-shadow: 0 1px 4px rgba(52, 25, 0, .7) !important;
}

/* B · 玉玺金签：每项都是独立签牌，选中项抬起并出现双层金边。 */
body[data-selector-preview="b"] .theme-segmented {
  gap: 6px;
  min-height: 48px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

body[data-selector-preview="b"] .theme-segmented::after,
body[data-selector-preview="b"] .theme-segment-indicator {
  display: none;
}

body[data-selector-preview="b"] .theme-segment {
  min-height: 48px;
  border: 1px solid rgba(185, 127, 39, .54);
  border-radius: 5px;
  color: rgba(248, 230, 190, .72);
  background: linear-gradient(180deg, rgba(13, 27, 21, .92), rgba(0, 8, 6, .9));
  box-shadow:
    inset 0 0 0 2px rgba(242, 200, 108, .025),
    0 8px 18px rgba(0, 0, 0, .2);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}

body[data-selector-preview="b"] .theme-segment.is-active {
  z-index: 2;
  color: #ffedb2 !important;
  border-color: rgba(255, 223, 127, .96);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 244, 199, .32), transparent 56%),
    linear-gradient(180deg, rgba(171, 116, 38, .82), rgba(83, 48, 10, .96));
  box-shadow:
    inset 0 0 0 2px rgba(255, 229, 148, .15),
    inset 0 1px 0 rgba(255, 250, 222, .46),
    0 0 18px rgba(242, 190, 78, .28),
    0 10px 20px rgba(0, 0, 0, .3);
  text-shadow: 0 1px 4px rgba(45, 22, 0, .8) !important;
  transform: translateY(-2px);
}

/* C · 月台标记：维持轻盈滑轨，用左右金柱与较宽底光强化选中态。 */
body[data-selector-preview="c"] .theme-segmented {
  min-height: 48px;
  overflow: hidden;
  border: 1px solid rgba(209, 151, 52, .28);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(8, 21, 16, .9), rgba(0, 8, 6, .78));
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 155, .045),
    0 10px 24px rgba(0, 0, 0, .2) !important;
}

body[data-selector-preview="c"] .theme-segment-indicator {
  top: auto;
  bottom: 2px;
  left: 0;
  width: calc(100% / 3);
  height: 4px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent 6%, #c88b28 20%, #ffe7a0 50%, #c88b28 80%, transparent 94%);
  box-shadow:
    0 -7px 18px rgba(245, 196, 76, .42),
    0 0 6px rgba(255, 231, 153, .58);
  transform: translateX(calc(var(--active-index) * 100%));
}

body[data-selector-preview="c"] .theme-segment.is-active {
  color: #fff0bd !important;
  background:
    linear-gradient(90deg, rgba(206, 147, 44, .16) 0 1px, transparent 1px calc(100% - 1px), rgba(206, 147, 44, .16) calc(100% - 1px)),
    radial-gradient(ellipse at 50% 100%, rgba(241, 188, 64, .25), transparent 64%);
  text-shadow: 0 0 14px rgba(255, 213, 108, .48) !important;
}

@media (max-width: 680px) {
  body[data-selector-preview] .theme-segmented,
  body[data-selector-preview] .theme-segment {
    min-height: 42px;
  }

  body[data-selector-preview="b"] .theme-segmented {
    gap: 3px;
  }

  body[data-selector-preview="b"] .theme-segment,
  body[data-selector-preview="b"] .theme-segment.is-active {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-selector-preview] .theme-segment,
  body[data-selector-preview] .theme-segment-indicator {
    transition-duration: .01ms !important;
  }
}
