/* WINK GO 固件烧录独立组件。所有选择器均使用 wg-flasher 前缀，避免影响主站。 */
.wg-flasher-nav-entry {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 0.42rem;
  padding: 0.48rem 0.78rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  color: var(--text-secondary, #667085);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.wg-flasher-nav-entry:hover {
  color: #111318;
  border-color: rgba(99, 102, 241, 0.3);
  background: #fff;
  transform: translateY(-1px);
}

.wg-flasher-nav-entry i {
  color: #6366f1;
  font-size: 0.82rem;
}

body.wg-flasher-scroll-lock {
  overflow: hidden;
}

.wg-flasher-overlay,
.wg-flasher-overlay * {
  box-sizing: border-box;
}

.wg-flasher-overlay[hidden],
.wg-flasher-browser-note[hidden],
.wg-flasher-progress[hidden],
.wg-flasher-result[hidden] {
  display: none !important;
}

.wg-flasher-overlay {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 9, 14, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: wg-flasher-fade-in 0.2s ease both;
}

.wg-flasher-dialog {
  position: relative;
  display: flex;
  width: min(620px, 100%);
  max-height: min(86vh, 780px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  color: #111318;
  background: #fbfbfd;
  box-shadow: 0 36px 90px rgba(6, 10, 20, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  animation: wg-flasher-pop-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wg-flasher-dialog::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 18%;
  left: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #3b82f6, transparent);
}

.wg-flasher-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 22px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.075);
  background: rgba(255, 255, 255, 0.88);
}

.wg-flasher-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.wg-flasher-title-group h2,
.wg-flasher-title-group p,
.wg-flasher-step-heading h3,
.wg-flasher-description,
.wg-flasher-device-status strong,
.wg-flasher-device-status span {
  margin: 0;
}

.wg-flasher-title-group h2 {
  color: #0b0d12;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.wg-flasher-title-group p {
  margin-top: 3px;
  color: #7b8493;
  font-size: 0.72rem;
}

.wg-flasher-logo {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 17, 21, 0.1);
}

.wg-flasher-logo img {
  display: block;
  width: 33px;
  height: 33px;
  object-fit: contain;
}

.wg-flasher-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.075);
  border-radius: 50%;
  color: #6c7481;
  background: #f4f5f7;
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.wg-flasher-close:hover {
  color: #111318;
  background: #e9ebef;
  transform: rotate(90deg);
}

.wg-flasher-close:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.wg-flasher-content {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 18px 22px 20px;
  scrollbar-color: #d7dbe2 transparent;
  scrollbar-width: thin;
}

.wg-flasher-browser-note {
  padding: 10px 12px;
  border: 1px solid rgba(229, 72, 77, 0.16);
  border-radius: 12px;
  color: #a43137;
  background: #fff3f3;
  font-size: 0.72rem;
  line-height: 1.5;
}

.wg-flasher-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(15, 23, 42, 0.075);
  border-radius: 15px;
  background: linear-gradient(135deg, #fff, #f7f8fb);
}

.wg-flasher-device-status {
  display: grid;
  min-width: 0;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.wg-flasher-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aab2bf;
  box-shadow: 0 0 0 4px rgba(170, 178, 191, 0.14);
  transition: 0.25s ease;
}

.wg-flasher-status-dot.is-online {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.13), 0 0 14px rgba(18, 183, 106, 0.28);
}

.wg-flasher-device-status strong,
.wg-flasher-device-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-flasher-device-status strong {
  color: #303744;
  font-size: 0.76rem;
}

.wg-flasher-device-status span {
  margin-top: 2px;
  color: #8a93a1;
  font-size: 0.64rem;
}

.wg-flasher-chip-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  color: #5d50ce;
  background: #eeecff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.wg-flasher-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  padding: 15px;
  border: 1px solid rgba(15, 23, 42, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

.wg-flasher-step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #6557db;
  background: #efedff;
  font-size: 0.68rem;
  font-weight: 700;
}

.wg-flasher-step-content {
  min-width: 0;
}

.wg-flasher-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 13px;
}

.wg-flasher-step-heading h3 {
  color: #222832;
  font-size: 0.8rem;
  font-weight: 700;
}

.wg-flasher-step-heading span {
  color: #9199a7;
  font-size: 0.61rem;
}

.wg-flasher-label {
  margin-bottom: 6px;
  color: #667085;
  font-size: 0.65rem;
  font-weight: 600;
}

.wg-flasher-product {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.13);
  border-radius: 11px;
  color: #252b35;
  background: #f9fafb;
  font-size: 0.74rem;
  font-weight: 600;
}

.wg-flasher-package-label {
  margin-top: 12px;
}

.wg-flasher-safety-warning {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 12px;
  color: #991b1b;
  background: #fff7f7;
}

.wg-flasher-warning-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #dc2626;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.wg-flasher-safety-warning strong {
  display: block;
  font-size: 0.68rem;
  line-height: 1.35;
}

.wg-flasher-safety-warning p {
  margin: 2px 0 0;
  color: #b42318;
  font-size: 0.61rem;
  line-height: 1.45;
}

.wg-flasher-firmware-options {
  display: grid;
  gap: 8px;
}

.wg-flasher-firmware-option {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wg-flasher-firmware-option:hover {
  border-color: rgba(99, 102, 241, 0.28);
  background: #fff;
  transform: translateY(-1px);
}

.wg-flasher-firmware-option.is-selected {
  border-color: rgba(99, 102, 241, 0.45);
  background: #f7f6ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.07);
}

.wg-flasher-firmware-option.is-full.is-selected {
  border-color: rgba(245, 158, 11, 0.5);
  background: #fffbf2;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.wg-flasher-firmware-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.wg-flasher-firmware-option:focus-within {
  outline: 2px solid rgba(99, 102, 241, 0.42);
  outline-offset: 2px;
}

.wg-flasher-firmware-option input:disabled + .wg-flasher-radio {
  opacity: 0.45;
}

.wg-flasher-radio {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1.5px solid #a7afbb;
  border-radius: 50%;
  background: #fff;
}

.wg-flasher-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  opacity: 0;
  transform: scale(0.35);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.wg-flasher-firmware-option.is-full .wg-flasher-radio::after {
  background: #f59e0b;
}

.wg-flasher-firmware-option.is-selected .wg-flasher-radio {
  border-color: #6366f1;
}

.wg-flasher-firmware-option.is-full.is-selected .wg-flasher-radio {
  border-color: #f59e0b;
}

.wg-flasher-firmware-option.is-selected .wg-flasher-radio::after {
  opacity: 1;
  transform: scale(1);
}

.wg-flasher-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wg-flasher-option-copy strong {
  overflow: hidden;
  color: #303744;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-flasher-option-copy small {
  color: #7f8897;
  font-size: 0.61rem;
  line-height: 1.4;
}

.wg-flasher-firmware-option code {
  padding: 5px 7px;
  border-radius: 7px;
  color: #5d50ce;
  background: #eceaff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.59rem;
  font-weight: 700;
}

.wg-flasher-firmware-option.is-full code {
  color: #a15c07;
  background: #fff0d6;
}

.wg-flasher-description {
  margin-top: 8px;
  color: #7f8897;
  font-size: 0.66rem;
  line-height: 1.55;
}

.wg-flasher-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.wg-flasher-btn {
  min-height: 43px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.wg-flasher-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.wg-flasher-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.wg-flasher-btn-secondary {
  color: #353d49;
  border-color: rgba(15, 23, 42, 0.1);
  background: #f1f3f6;
}

.wg-flasher-btn-primary {
  color: #fff;
  background: #111318;
  box-shadow: 0 8px 18px rgba(15, 17, 21, 0.16);
}

.wg-flasher-btn-primary:hover:not(:disabled) {
  background: #292d35;
  box-shadow: 0 11px 24px rgba(15, 17, 21, 0.22);
}

.wg-flasher-progress {
  padding: 13px 15px;
  border: 1px solid rgba(99, 102, 241, 0.11);
  border-radius: 14px;
  background: #f6f5ff;
}

.wg-flasher-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #5750a6;
  font-size: 0.67rem;
}

.wg-flasher-progress strong {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.wg-flasher-progress progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.wg-flasher-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
}

.wg-flasher-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6);
}

.wg-flasher-progress small {
  display: block;
  margin-top: 8px;
  color: #8b85bd;
  font-size: 0.59rem;
}

.wg-flasher-result {
  padding: 11px 13px;
  border: 1px solid rgba(18, 183, 106, 0.16);
  border-radius: 12px;
  color: #087443;
  background: #edfff6;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
}

.wg-flasher-result.is-error {
  border-color: rgba(229, 72, 77, 0.16);
  color: #a43137;
  background: #fff3f3;
}

.wg-flasher-logs {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.075);
  border-radius: 12px;
  background: #f5f6f8;
}

.wg-flasher-logs summary {
  padding: 10px 12px;
  color: #747d8b;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  list-style-position: inside;
}

.wg-flasher-logs pre {
  max-height: 130px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #cfd5df;
  background: #0c1016;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.wg-flasher-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  color: #858e9c;
  background: #f7f8fa;
  font-size: 0.61rem;
}

.wg-flasher-shield {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #12b76a;
  font-size: 0.55rem;
  font-weight: 700;
}

@keyframes wg-flasher-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wg-flasher-pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 720px) {
  .wg-flasher-nav-entry {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .wg-flasher-nav-entry span {
    display: none;
  }
}

@media (max-width: 560px) {
  .wg-flasher-overlay {
    align-items: end;
    padding: 0;
  }

  .wg-flasher-dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .wg-flasher-header {
    padding: 18px 17px 15px;
  }

  .wg-flasher-title-group p {
    display: none;
  }

  .wg-flasher-content {
    padding: 15px 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wg-flasher-overlay,
  .wg-flasher-dialog {
    animation: none;
  }
}
