/* ==========================================================================
   Bencho-inspired component pack for Qianwang
   Keeps native controls in the DOM; all enhancement is additive.
   ========================================================================== */

html.apple-skin {
  --b-blue: #007aff;
  --b-blue-deep: #0066d6;
  --b-ink: #1d1d1f;
  --b-muted: #6e6e73;
  --b-hairline: rgba(60, 60, 67, .12);
  --b-glass: rgba(255, 255, 255, .68);
  --b-spring: cubic-bezier(.22, 1.35, .36, 1);
}

/* ---------- Magnetic select ---------- */
html.apple-skin .b-select {
  position: relative;
  display: inline-flex;
  min-width: 0;
  vertical-align: middle;
}
html.apple-skin .b-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}
html.apple-skin .b-select-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  max-width: 220px;
  padding: 0 9px 0 12px;
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 24, 40, .03);
  color: #3a3a3c;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s var(--b-spring);
}
html.apple-skin .b-select-trigger:hover {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(0, 122, 255, .24);
}
html.apple-skin .b-select-trigger:active { transform: scale(.975); }
html.apple-skin .b-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(0, 122, 255, .5);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .13), inset 0 1px 0 #fff;
}
html.apple-skin .b-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.apple-skin .b-select-chevron {
  flex: 0 0 auto;
  margin-top: -1px;
  color: #8e8e93;
  font-size: 13px;
  transition: transform .2s ease;
}
html.apple-skin .b-select-trigger[aria-expanded="true"] .b-select-chevron { transform: rotate(180deg); }

html.apple-skin .b-select-menu {
  position: fixed;
  z-index: 90;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .68));
  box-shadow:
    0 0 0 .5px rgba(60, 60, 67, .13),
    0 22px 48px -20px rgba(16, 24, 40, .3),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  animation: b-select-in .18s var(--b-spring);
}
@keyframes b-select-in {
  from { opacity: 0; transform: translateY(-5px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
html.apple-skin .b-select-head {
  padding: 6px 10px 7px;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
html.apple-skin .b-select-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(286px, 54vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
html.apple-skin .b-select-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #3a3a3c;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: transform .18s var(--b-spring), background .15s ease, color .15s ease;
}
html.apple-skin .b-select-option:hover,
html.apple-skin .b-select-option:focus-visible {
  outline: none;
  background: rgba(0, 122, 255, .07);
  color: var(--b-blue);
}
html.apple-skin .b-select-option.selected {
  background: rgba(0, 122, 255, .1);
  color: var(--b-blue);
  font-weight: 600;
}
html.apple-skin .b-select-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border: 1.5px solid #b8c1cd;
  border-radius: 50%;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
html.apple-skin .b-select-option.selected .b-select-dot {
  border-color: var(--b-blue);
  background: var(--b-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .13);
}
html.apple-skin .b-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Liquid toggle ---------- */
html.apple-skin .b-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  margin-right: 2px;
  vertical-align: -5px;
}
html.apple-skin .b-toggle-input {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
}
html.apple-skin .b-toggle-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: .5px solid rgba(60, 60, 67, .1);
  border-radius: 999px;
  background: rgba(120, 120, 128, .2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06), inset 0 .5px 0 rgba(255, 255, 255, .4);
  transition: background .28s ease, box-shadow .28s ease;
}
html.apple-skin .b-toggle-track::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .23), transparent 55%);
  pointer-events: none;
}
html.apple-skin .b-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 .5px 1px rgba(0, 0, 0, .12);
  transition: transform .32s var(--b-spring), width .2s var(--b-spring), border-radius .2s ease;
}
html.apple-skin .b-toggle-input:checked + .b-toggle-track {
  background: linear-gradient(180deg, #3aa0ff, #007aff 58%, #006be0);
  box-shadow: inset 0 1px 2px rgba(0, 40, 110, .24), 0 0 0 3px rgba(0, 122, 255, .08);
}
html.apple-skin .b-toggle-input:checked + .b-toggle-track .b-toggle-knob { transform: translateX(17px); }
html.apple-skin .b-toggle-input:active + .b-toggle-track .b-toggle-knob { width: 23px; border-radius: 10px; }
html.apple-skin .b-toggle:has(.b-toggle-input:focus-visible) .b-toggle-track {
  outline: 2px solid rgba(0, 122, 255, .55);
  outline-offset: 3px;
}
html.apple-skin .b-toggle-input:disabled { cursor: not-allowed; }
html.apple-skin .b-toggle:has(.b-toggle-input:disabled) { opacity: .45; }
html.apple-skin .checkbox-label { align-items: center; }

/* ---------- Slide to confirm ---------- */
html.apple-skin .b-slide {
  flex: 1 1 100%;
  min-width: 230px;
}
html.apple-skin .b-slide-original { display: none !important; }
html.apple-skin .b-slide-track {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  overflow: hidden;
  border: .5px solid rgba(60, 60, 67, .13);
  border-radius: 13px;
  background: rgba(120, 120, 128, .1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), inset 0 .5px 0 rgba(255, 255, 255, .55);
  touch-action: none;
  user-select: none;
}
html.apple-skin .b-slide-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0, 122, 255, .2), rgba(0, 122, 255, .86));
  transition: width .16s ease-out;
}
html.apple-skin .b-slide-caption {
  position: relative;
  z-index: 1;
  flex: 1;
  padding-left: 48px;
  color: #5c5c61;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  text-align: center;
  pointer-events: none;
  transition: opacity .2s ease, color .2s ease;
}
html.apple-skin .b-slide-thumb {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 4px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: .5px solid rgba(60, 60, 67, .12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .17), inset 0 .5px 0 rgba(255, 255, 255, 1);
  color: #1d1d1f;
  cursor: grab;
  touch-action: none;
  transition: transform .28s var(--b-spring), background .2s ease, color .2s ease, width .2s var(--b-spring);
}
html.apple-skin .b-slide-thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .2), 0 2px 6px rgba(16, 24, 40, .17);
}
html.apple-skin .b-slide.dragging .b-slide-thumb {
  width: 44px;
  cursor: grabbing;
  transition: width .16s var(--b-spring), background .2s ease;
}
html.apple-skin .b-slide.dragging .b-slide-fill { transition: none; }
html.apple-skin .b-slide-arrow { font-size: 16px; font-weight: 500; }
html.apple-skin .b-slide.done .b-slide-track {
  border-color: rgba(48, 209, 88, .35);
  background: rgba(48, 209, 88, .12);
}
html.apple-skin .b-slide.done .b-slide-fill {
  background: linear-gradient(90deg, rgba(48, 209, 88, .5), #30d158);
  transition: width .2s ease;
}
html.apple-skin .b-slide.done .b-slide-thumb {
  border-color: rgba(48, 209, 88, .6);
  background: #30d158;
  color: #fff;
}
html.apple-skin .b-slide.done .b-slide-caption { color: #147a35; font-weight: 600; }
html.apple-skin .b-slide.nudge .b-slide-track { animation: b-slide-nudge .42s ease; }
@keyframes b-slide-nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* ---------- Number stepper ---------- */
html.apple-skin .b-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 3px;
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: border-color .18s ease, box-shadow .18s ease;
}
html.apple-skin .b-stepper:focus-within {
  border-color: rgba(0, 122, 255, .5);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .12), inset 0 1px 0 #fff;
}
html.apple-skin .b-stepper input {
  flex: 1;
  min-width: 0;
  height: 34px !important;
  padding: 0 4px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--b-ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}
html.apple-skin .b-stepper input::-webkit-outer-spin-button,
html.apple-skin .b-stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
html.apple-skin .b-stepper-btn {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(120, 120, 128, .08);
  color: #3a3a3c;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s var(--b-spring);
}
html.apple-skin .b-stepper-btn:hover { background: rgba(0, 122, 255, .1); color: var(--b-blue); }
html.apple-skin .b-stepper-btn:active { transform: scale(.9); }
html.apple-skin .b-stepper-grip {
  flex: 0 0 auto;
  width: 22px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a1a1a6;
  font-size: 16px;
  line-height: 1;
  cursor: ns-resize;
  touch-action: none;
}
html.apple-skin .b-stepper-grip:hover { color: #6e6e73; background: rgba(120, 120, 128, .08); }
html.apple-skin .b-stepper.dragging .b-stepper-grip { color: var(--b-blue); background: rgba(0, 122, 255, .1); }

/* ---------- Password strength ---------- */
html.apple-skin .b-pw { margin: 9px 0 2px; }
html.apple-skin .b-pw-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
html.apple-skin .b-pw-bars i {
  height: 4px;
  border-radius: 999px;
  background: rgba(120, 120, 128, .16);
  transition: background .2s ease, box-shadow .2s ease;
}
html.apple-skin .b-pw[data-score="1"] .b-pw-bars i:nth-child(-n+1) { background: #ff453a; }
html.apple-skin .b-pw[data-score="2"] .b-pw-bars i:nth-child(-n+2) { background: #ff9f0a; }
html.apple-skin .b-pw[data-score="3"] .b-pw-bars i:nth-child(-n+3) { background: #30d158; }
html.apple-skin .b-pw[data-score="4"] .b-pw-bars i { background: linear-gradient(90deg, #30d158, #007aff); box-shadow: 0 0 8px rgba(0, 122, 255, .18); }
html.apple-skin .b-pw-label {
  margin-top: 6px;
  color: #8e8e93;
  font-size: 11px;
  line-height: 1.35;
}

/* ---------- Toast stack ---------- */
html.apple-skin #toast-region {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
html.apple-skin .toast.b-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 38px 11px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 14px;
  background: rgba(28, 28, 30, .84);
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, .45), inset 0 .5px 0 rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  animation: b-toast-in .32s var(--b-spring);
  transition: opacity .18s ease, transform .18s ease;
}
html.apple-skin .toast.b-toast::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #64d2ff, #0a84ff);
  transform-origin: left;
  animation: b-toast-progress 4.5s linear forwards;
}
html.apple-skin .toast.b-toast.error { background: rgba(64, 18, 20, .9); }
html.apple-skin .toast.b-toast.error::after { background: #ff453a; animation-duration: 8s; }
html.apple-skin .b-toast-close {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .8);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
html.apple-skin .b-toast-close:hover { background: rgba(255, 255, 255, .22); color: #fff; }
html.apple-skin .toast.b-toast-out { opacity: 0; transform: translateY(6px) scale(.97); }
@keyframes b-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes b-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ---------- Command bar ---------- */
html.apple-skin .command-dialog {
  width: min(680px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 21px;
  background: rgba(255, 255, 255, .8);
  box-shadow:
    0 0 0 .5px rgba(60, 60, 67, .15),
    0 32px 80px -22px rgba(16, 24, 40, .35),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  backdrop-filter: blur(34px) saturate(190%);
}
html.apple-skin .command-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 0 18px;
  border-bottom: .5px solid rgba(60, 60, 67, .1);
  background: rgba(255, 255, 255, .28);
}
html.apple-skin .command-search .icon { flex: 0 0 auto; width: 19px; height: 19px; color: #8e8e93; }
html.apple-skin .command-search input {
  flex: 1;
  min-width: 0;
  height: 60px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--b-ink);
  font-size: 16px !important;
  letter-spacing: -.01em;
}
html.apple-skin .command-search input::placeholder { color: #a1a1a6; }
html.apple-skin .command-key {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 4px 7px;
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 6px;
  background: rgba(255, 255, 255, .6);
  color: #8e8e93;
  font-size: 10px;
  text-align: center;
}
html.apple-skin .b-command-kicker {
  padding: 12px 18px 4px;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
}
html.apple-skin .command-results {
  max-height: min(460px, 60vh);
  padding: 4px 10px 10px;
}
html.apple-skin .command-result {
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #6e6e73;
  transition: background .15s ease, border-color .15s ease, transform .18s var(--b-spring);
}
html.apple-skin .command-result:hover,
html.apple-skin .command-result.active,
html.apple-skin .command-result:focus-visible {
  border-color: rgba(0, 122, 255, .12);
  background: linear-gradient(90deg, rgba(0, 122, 255, .1), rgba(0, 122, 255, .035));
  outline: none;
}
html.apple-skin .command-result.active .icon { color: var(--b-blue); }
html.apple-skin .command-result b { color: #1d1d1f; font-size: 13.5px; }
html.apple-skin .command-result small { color: #8e8e93; }
html.apple-skin .command-dialog .panel-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: .5px solid rgba(60, 60, 67, .1);
  background: rgba(255, 255, 255, .3);
  color: #8e8e93;
  font-size: 10px;
}

/* ---------- Progressive blur under the top bar ---------- */
html.apple-skin .topbar { position: relative; overflow: visible; }
html.apple-skin .topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -18px;
  left: 0;
  height: 18px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .65) 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .65) 45%, transparent 100%);
  opacity: .7;
}

/* ---------- Progress / criteria / roster / copy ---------- */
html.apple-skin .progress-track {
  gap: 5px;
  padding: 5px;
  border: .5px solid rgba(60, 60, 67, .1);
  border-radius: 12px;
  background: rgba(120, 120, 128, .06);
}
html.apple-skin .progress-step {
  min-height: 28px;
  border-radius: 8px;
  background: transparent;
  color: #8e8e93;
  font-size: 10px;
  transition: background .2s ease, color .2s ease;
}
html.apple-skin .progress-step.done { background: rgba(0, 122, 255, .08); color: var(--b-blue); }
html.apple-skin .progress-step.current {
  background: #fff;
  color: var(--b-ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12), inset 0 .5px 0 #fff;
}
html.apple-skin .detail-block ul { display: grid; gap: 8px; padding-left: 0; list-style: none; }
html.apple-skin .detail-block ul li {
  position: relative;
  padding-left: 25px;
  color: #3a3a3c;
  font-size: 13px;
  line-height: 1.5;
}
html.apple-skin .detail-block ul li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(0, 122, 255, .3);
  border-radius: 50%;
  background: rgba(0, 122, 255, .07);
}
html.apple-skin .detail-block ul li::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 122, 255, .58);
}
html.apple-skin .member-row {
  padding: 11px 12px;
  border: .5px solid rgba(60, 60, 67, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .36);
  transition: background .18s ease, transform .18s var(--b-spring);
}
html.apple-skin .member-row:hover { background: rgba(255, 255, 255, .62); transform: translateY(-1px); }
html.apple-skin .account-grid .panel:first-child .row + .row { margin-top: 7px; }
html.apple-skin .report-progress .submission-step {
  min-height: 30px;
  padding: 6px 10px;
  border: .5px solid rgba(60, 60, 67, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .4);
}
html.apple-skin .report-progress .submission-step.complete {
  border-color: rgba(48, 209, 88, .22);
  background: rgba(48, 209, 88, .1);
  color: #147a35;
}

@media (max-width: 760px) {
  html.apple-skin .b-slide { flex-basis: 100%; }
  html.apple-skin .b-slide-track { height: 48px; }
  html.apple-skin .b-select-menu { max-width: calc(100vw - 24px); }
  html.apple-skin .command-dialog { width: calc(100vw - 20px); }
  html.apple-skin .command-search { min-height: 56px; padding: 0 14px; }
  html.apple-skin .command-search input { height: 54px; font-size: 15px !important; }
  html.apple-skin .b-slide-caption { font-size: 11px; padding-left: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html.apple-skin .b-select-menu,
  html.apple-skin .toast.b-toast,
  html.apple-skin .b-slide-thumb,
  html.apple-skin .b-toggle-knob,
  html.apple-skin .command-result { animation: none !important; transition: none !important; }
}
