/* Yinyu source plugin management center */
.source-plugin-center,
.source-plugin-center * {
  box-sizing: border-box;
}

.source-plugin-center[hidden],
.source-plugin-center [hidden] {
  display: none !important;
}

.source-plugin-center {
  position: fixed;
  inset: 0;
  z-index: 760;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.78);
  color: rgba(242, 247, 247, 0.96);
  font-family: var(--font-sans, "Noto Sans SC", "PingFang SC", system-ui, sans-serif);
  opacity: 0;
  transition: opacity 180ms ease-out;
}

.source-plugin-center.is-visible {
  opacity: 1;
}

.spc-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: min(88dvh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background: rgba(11, 13, 14, 0.965);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.64), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

.source-plugin-center.is-visible .spc-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.source-plugin-center.spc-motion-driven,
.source-plugin-center.spc-motion-driven .spc-dialog,
.spc-confirm-layer.spc-motion-driven,
.spc-confirm-layer.spc-motion-driven .spc-confirm {
  transition: none;
}

.spc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.018);
}

.spc-heading {
  min-width: 0;
}

.spc-eyebrow {
  margin-bottom: 7px;
  color: var(--fc-accent, #00f5d4);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
}

.spc-heading h1 {
  margin: 0;
  color: rgba(255, 255, 255, 0.98);
  font-size: 23px;
  font-weight: 720;
  line-height: 1.25;
  text-wrap: balance;
}

.spc-heading p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.spc-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.64);
  font: 300 25px/1 var(--font-sans, sans-serif);
  cursor: pointer;
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.spc-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  transform: scale(1.04);
}

.spc-close:active {
  transform: scale(0.96);
}

.spc-readonly {
  padding: 10px 26px;
  border-bottom: 1px solid rgba(var(--fc-accent-rgb, 0, 245, 212), 0.13);
  background: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.055);
  color: rgba(216, 255, 249, 0.78);
  font-size: 11.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.spc-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  overflow: hidden;
}

.spc-import,
.spc-library {
  min-width: 0;
  min-height: 0;
}

.spc-import {
  padding: 22px 24px 24px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.018);
}

.spc-library {
  display: flex;
  flex-direction: column;
}

.spc-section-heading,
.spc-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.spc-section-heading {
  margin-bottom: 17px;
}

.spc-section-heading h2,
.spc-library-header h2,
.spc-confirm h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 690;
  line-height: 1.35;
  text-wrap: balance;
}

.spc-section-heading p,
.spc-library-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.spc-count {
  font-variant-numeric: tabular-nums;
}

.spc-import-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spc-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.spc-tab {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  font: 620 11px/1 var(--font-sans, sans-serif);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.spc-tab:hover {
  color: rgba(255, 255, 255, 0.82);
}

.spc-tab.is-active {
  background: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.105);
  color: rgba(224, 255, 251, 0.96);
}

.spc-tab-panel {
  min-height: 162px;
  padding-top: 2px;
  outline: none;
}

.spc-file-input {
  display: none;
}

.spc-file-pick {
  width: 100%;
  min-height: 72px;
  margin-bottom: 10px;
  justify-content: center;
  border-style: dashed !important;
  color: rgba(229, 255, 251, 0.84) !important;
}

.spc-file-name {
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spc-field-help {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.36);
  font-size: 10.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.spc-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 620;
}

.spc-field:last-child {
  margin-bottom: 0;
}

.spc-field input,
.spc-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 10px;
  outline: 0;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 12px;
  -webkit-user-select: text;
  user-select: text;
}

.spc-field input {
  height: 40px;
  padding: 0 12px;
}

.spc-field textarea {
  min-height: 150px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.spc-field input::placeholder,
.spc-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.spc-field input:focus,
.spc-field textarea:focus {
  border-color: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.48);
  box-shadow: 0 0 0 2px rgba(var(--fc-accent-rgb, 0, 245, 212), 0.1);
}

.spc-field input:disabled,
.spc-field textarea:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.spc-import-error,
.spc-plugin-error,
.spc-confirm-error {
  color: rgba(255, 184, 184, 0.92);
  font-size: 11.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.spc-import-error {
  margin: -2px 0 0;
}

.spc-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.7);
  font: 620 11.5px/1 var(--font-sans, sans-serif);
  cursor: pointer;
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.spc-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.085);
  color: #fff;
  transform: translateY(-1px);
}

.spc-button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.spc-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.spc-button-primary {
  min-height: 42px;
  border-color: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.35);
  background: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.115);
  color: rgba(223, 255, 251, 0.96);
}

.spc-button-primary:hover:not(:disabled) {
  border-color: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.58);
  background: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.17);
}

.spc-button-danger {
  border-color: rgba(255, 125, 125, 0.28);
  background: rgba(255, 95, 95, 0.08);
  color: rgba(255, 206, 206, 0.94);
}

.spc-button-danger:hover:not(:disabled) {
  border-color: rgba(255, 125, 125, 0.5);
  background: rgba(255, 95, 95, 0.14);
}

.spc-library-header {
  flex: 0 0 auto;
  padding: 20px 22px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.spc-reload {
  min-width: 86px;
}

.spc-plugin-list {
  min-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.spc-plugin-list::-webkit-scrollbar,
.spc-import::-webkit-scrollbar,
.spc-content::-webkit-scrollbar {
  width: 5px;
}

.spc-plugin-list::-webkit-scrollbar-thumb,
.spc-import::-webkit-scrollbar-thumb,
.spc-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.spc-plugin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.spc-plugin-row:last-child {
  border-bottom: 0;
}

.spc-plugin-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.spc-plugin-main {
  min-width: 0;
}

.spc-plugin-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.spc-plugin-title-line h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.93);
  font-size: 13.5px;
  font-weight: 680;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spc-badge {
  flex: 0 0 auto;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.spc-preferred {
  background: rgba(var(--fc-accent-rgb, 0, 245, 212), 0.11);
  color: rgba(213, 255, 249, 0.94);
}

.spc-failed {
  background: rgba(255, 95, 95, 0.09);
  color: rgba(255, 192, 192, 0.9);
}

.spc-plugin-description {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11.5px;
  line-height: 1.5;
  text-wrap: pretty;
}

.spc-plugin-meta {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10.5px;
  line-height: 1.45;
}

.spc-meta-key {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.28);
}

.spc-source-value,
.spc-source-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spc-source-link {
  color: rgba(107, 255, 235, 0.76);
  text-decoration: none;
  -webkit-user-select: text;
  user-select: text;
}

.spc-source-link:hover {
  color: rgba(220, 255, 250, 0.98);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spc-plugin-error {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

.spc-plugin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spc-select {
  min-width: 82px;
}

.spc-delete {
  min-width: 54px;
}

.spc-delete:hover:not(:disabled) {
  background: rgba(255, 95, 95, 0.08);
  color: rgba(255, 205, 205, 0.95);
}

.spc-list-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 30px;
  text-align: center;
}

.spc-list-error {
  min-height: 0;
  align-items: flex-start;
  flex-direction: row;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 132, 132, 0.13);
  background: rgba(255, 95, 95, 0.045);
  text-align: left;
}

.spc-list-state-copy {
  min-width: 0;
}

.spc-list-state h3 {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  text-wrap: balance;
}

.spc-list-state p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.spc-list-error h3,
.spc-list-error p {
  color: rgba(255, 205, 205, 0.84);
}

.spc-loading-state {
  padding: 18px 22px;
}

.spc-loading-label {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11.5px;
}

.spc-skeleton-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.spc-skeleton-title,
.spc-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.spc-skeleton-title {
  width: 38%;
}

.spc-skeleton-line {
  width: 72%;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.spc-confirm-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.74);
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.spc-confirm-layer.is-visible {
  opacity: 1;
}

.spc-confirm {
  width: min(410px, 100%);
  padding: 25px;
  border: 0;
  border-radius: 16px;
  outline: 0;
  background: rgba(18, 20, 21, 0.99);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.spc-confirm-layer.is-visible .spc-confirm {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.spc-confirm h2 {
  margin-top: 2px;
  font-size: 18px;
}

.spc-confirm > p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.6;
  text-wrap: pretty;
}

.spc-confirm > .spc-confirm-error {
  color: rgba(255, 184, 184, 0.92);
}

.spc-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.source-plugin-center :focus-visible {
  outline: 2px solid rgba(var(--fc-accent-rgb, 0, 245, 212), 0.72);
  outline-offset: 2px;
}

@media (max-width: 780px) {
  .spc-dialog {
    max-height: 92dvh;
  }

  .spc-content {
    display: block;
    overflow-y: auto;
  }

  .spc-import {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .spc-library {
    min-height: 420px;
  }

  .spc-plugin-list {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .source-plugin-center {
    padding: 0;
  }

  .spc-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .spc-header {
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 17px max(18px, env(safe-area-inset-left));
  }

  .spc-heading h1 {
    font-size: 20px;
  }

  .spc-readonly {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .spc-import {
    padding: 20px 18px;
  }

  .spc-library-header {
    padding: 18px;
  }

  .spc-plugin-row {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 17px 18px;
  }

  .spc-plugin-actions {
    justify-content: flex-end;
  }

  .spc-list-error {
    align-items: stretch;
    flex-direction: column;
  }

  .spc-confirm-layer {
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-plugin-center,
  .spc-dialog,
  .spc-close,
  .spc-tab,
  .spc-button,
  .spc-confirm-layer,
  .spc-confirm {
    transition: none !important;
  }

  .spc-dialog,
  .spc-confirm {
    transform: none;
  }
}
