/* 电玩社后台 · 功能开关工作区（仅作用于 feature-switch 面板） */
[data-panel="feature-switch"] {
  width: 100%;
  min-width: 0;
}

[data-panel="feature-switch"] .feature-switch-panel {
  grid-column: 1 / -1;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #f4dfe6 !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 16px 44px rgba(132, 51, 78, 0.08) !important;
}

.feature-switch-panel-head,
.feature-switch-control-row,
.feature-switch-overview,
.feature-switch-publish-bar {
  margin: 0 22px;
}

.feature-switch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 16px 0;
  border-bottom: 1px solid #f5e5ea;
}

.feature-switch-panel-head h3 {
  margin: 0 0 4px;
  color: #17223b;
  font-size: 20px;
  line-height: 1.25;
}

.feature-switch-panel-head p {
  margin: 0;
  color: #8c97aa;
  font-size: 13px;
}

.feature-switch-panel-meta,
.feature-switch-actions,
.feature-switch-publish-bar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-switch-panel-meta > span {
  color: #7f8ba1;
  font-size: 13px;
  white-space: nowrap;
}

.feature-switch-control-row {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(280px, 1fr) auto;
  align-items: flex-end;
  gap: 20px;
  padding: 18px 0;
}

.feature-switch-mode-field {
  position: relative;
  width: min(360px, 100%);
  margin: 0 !important;
}

.feature-switch-mode-field > span {
  color: #546075;
  font-size: 13px;
  font-weight: 700;
}

.feature-switch-mode-field select {
  height: 46px;
  border: 1px solid #eadce2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #29344b !important;
}

.feature-switch-mode-hint {
  position: absolute;
  top: calc(100% + 6px);
  left: 2px;
  display: block;
  color: #98a0b0;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.feature-switch-mode-hint strong {
  color: #ef3b73;
  font-weight: 800;
}

.feature-switch-search-field {
  width: 100%;
  margin: 0 !important;
}

.feature-switch-search-field > span:first-child {
  color: #546075;
  font-size: 13px;
  font-weight: 700;
}

.feature-switch-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.feature-switch-search-box input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 43px !important;
  border: 1px solid #eadce2 !important;
  border-radius: 12px !important;
  outline: none;
  background: #fff !important;
  color: #29344b !important;
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.feature-switch-search-box input::placeholder { color: #a2a9b7; }
.feature-switch-search-box input::-webkit-search-cancel-button { display: none; }

.feature-switch-search-box input:focus {
  border-color: #ef6b91 !important;
  box-shadow: 0 0 0 4px rgba(241, 39, 104, 0.09) !important;
}

.feature-switch-search-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  color: #e72a62;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.feature-switch-search-box button {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: #f8e9ee;
  color: #c95878;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease;
}

.feature-switch-search-box button.is-visible { opacity: 1; pointer-events: auto; }
.feature-switch-search-box button:hover { background: #f4d8e1; }

.feature-switch-search-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 170px;
  padding: 48px 20px !important;
}

.feature-switch-search-empty strong { color: #29344b; font-size: 16px; }
.feature-switch-search-empty span { color: #8a94a6; font-size: 13px; }

.feature-switch-actions .primary-btn,
.feature-switch-publish-bar .primary-btn {
  background: linear-gradient(135deg, #f52b69 0%, #e91c5d 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 1px rgba(129, 13, 52, 0.16);
  box-shadow: 0 10px 20px rgba(241, 39, 104, 0.18) !important;
}

.feature-switch-actions .primary-btn:hover,
.feature-switch-publish-bar .primary-btn:hover,
.feature-switch-actions .primary-btn:focus-visible,
.feature-switch-publish-bar .primary-btn:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  filter: brightness(1.04);
}

.feature-switch-actions .primary-btn:disabled,
.feature-switch-publish-bar .primary-btn:disabled {
  color: rgba(255, 255, 255, 0.82) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.82) !important;
}

.feature-switch-danger-btn {
  color: #e3365f !important;
  border-color: #f4bdcc !important;
}

.feature-switch-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  gap: 0;
  padding: 17px 18px 14px;
  border: 1px solid #f2e4e9;
  border-radius: 16px;
  background: #fffafb;
}

.feature-switch-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 54px;
  border-right: 1px solid #f1e5e9;
}

.feature-switch-stat:nth-child(4) { border-right: 0; }

.feature-switch-stat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff0f5;
  color: #f12768;
  font-size: 15px;
  font-weight: 900;
}

.feature-switch-stat.is-enabled .feature-switch-stat-icon { background: #eaf9f1; color: #1fa66a; }
.feature-switch-stat.is-disabled .feature-switch-stat-icon { background: #fff3eb; color: #f07830; }
.feature-switch-stat.is-api .feature-switch-stat-icon { background: #eef4ff; color: #537eea; }

.feature-switch-stat div { display: grid; gap: 2px; }
.feature-switch-stat small { color: #7f899d; font-size: 12px; }
.feature-switch-stat strong { color: #17223b; font-size: 22px; line-height: 1; }

.feature-switch-progress-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding-top: 13px;
  border-top: 1px solid #f1e5e9;
}

.feature-switch-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3e8ec;
}

.feature-switch-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f12768, #ff5c8d);
  transition: width 180ms ease;
}

.feature-switch-progress-row > strong { color: #24a86c; font-size: 13px; white-space: nowrap; }

.feature-switch-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 22px;
}

.feature-switch-card-grid .empty-state { grid-column: 1 / -1; }

.feature-switch-card {
  position: relative;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: start !important;
  gap: 13px !important;
  min-height: 148px;
  margin: 0 !important;
  padding: 17px !important;
  border: 1px solid #f1e2e7 !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 7px 20px rgba(119, 42, 68, 0.045) !important;
}

.feature-switch-card.is-disabled {
  border-color: #e8e9ed !important;
  background: #fbfbfc !important;
  box-shadow: none !important;
}

.feature-switch-card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff0f5;
  color: #f12768;
  font-size: 17px;
  font-weight: 900;
}

.feature-switch-card.is-disabled .feature-switch-card-icon { background: #f0f1f3; color: #8991a0; }

.feature-switch-card-main { min-width: 0; }
.feature-switch-card-main > strong { display: block; margin: 1px 0 5px; color: #1f2a41; font-size: 16px; }
.feature-switch-card-main > p { min-height: 38px; margin: 0 0 10px; color: #667287; font-size: 12px; line-height: 1.6; }

.feature-switch-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feature-switch-card-tags span { padding: 4px 9px; border-radius: 999px; background: #fff1f5; color: #eb2865; font-size: 11px; font-weight: 700; }
.feature-switch-card.is-disabled .feature-switch-card-tags span { background: #f0f1f3; color: #7f8795; }

.feature-switch-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #f6c9d6;
  border-radius: 999px;
  color: #ed2b66;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.feature-switch-card-status::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f12768; }
.feature-switch-card-status input { position: absolute; opacity: 0; pointer-events: none; }
.feature-switch-card.is-disabled .feature-switch-card-status { border-color: #dfe1e6; color: #7c8492; }
.feature-switch-card.is-disabled .feature-switch-card-status::after { background: #9aa1ad; }

.feature-switch-card-updated {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 1px;
  color: #8d98aa;
  font-size: 11px;
}

.feature-switch-card-updated::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #26b475; }
.feature-switch-card.is-disabled .feature-switch-card-updated::before { background: #a7adb8; }

.feature-switch-publish-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 0;
  border-top: 1px solid #f1e3e8;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.feature-switch-publish-bar p { margin: 0; color: #536075; font-size: 13px; }
.feature-switch-publish-bar p strong { color: #f12768; font-size: 17px; }

@media (max-width: 1320px) {
  .feature-switch-control-row { grid-template-columns: minmax(260px, 340px) minmax(260px, 1fr); }
  .feature-switch-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .feature-switch-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .feature-switch-control-row { grid-template-columns: 1fr; }
  .feature-switch-mode-field { margin-bottom: 20px !important; }
  .feature-switch-actions { grid-column: auto; justify-content: flex-start; }
  .feature-switch-actions { flex-wrap: wrap; }
  .feature-switch-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-switch-stat:nth-child(2) { border-right: 0; }
  .feature-switch-stat:nth-child(-n+2) { border-bottom: 1px solid #f1e5e9; }
  .feature-switch-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .feature-switch-panel-head { align-items: flex-start; flex-direction: column; }
  .feature-switch-panel-head,
  .feature-switch-control-row,
  .feature-switch-overview,
  .feature-switch-publish-bar { margin-right: 14px; margin-left: 14px; }
  .feature-switch-card-grid { padding-right: 14px; padding-left: 14px; }
  .feature-switch-publish-bar { align-items: stretch; flex-direction: column; }
  .feature-switch-publish-bar > div { width: 100%; }
  .feature-switch-publish-bar button { flex: 1; }
}
