/* 账号设置弹窗（与播放器 style.css 变量配套） */
.settings-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.settings-modal-wrap::-webkit-scrollbar {
  width: 6px;
}

.settings-modal-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.settings-modal-wrap[hidden] {
  display: none !important;
}

.settings-modal-dialog {
  width: min(520px, 100%);
  flex-shrink: 0;
  margin: auto;
  overflow: visible;
  background: rgba(18, 18, 28, 0.98);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-modal-header h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
}

.settings-modal-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #a1a1aa);
  line-height: 1.45;
}

.settings-user-line {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #a1a1aa);
}

.settings-user-line strong {
  color: var(--text, #f4f4f5);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section {
  background: var(--surface, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 12px;
}

.settings-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #f4f4f5);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.settings-field:first-of-type {
  margin-top: 0;
}

.settings-field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #c4b5fd);
}

.settings-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  background: rgba(0, 0, 0, 0.25);
  color: var(--text, #f4f4f5);
  font-family: var(--font, inherit);
  font-size: 0.88rem;
}

.settings-field input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.55);
}

.settings-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #a1a1aa);
  margin: 0 0 8px;
  line-height: 1.45;
}

.settings-note {
  font-size: 0.78rem;
  color: var(--text-muted, #a1a1aa);
  margin: 10px 0 0;
  line-height: 1.45;
}

.settings-note code,
.settings-note .url-value {
  word-break: break-all;
  color: #c4b5fd;
  font-size: 0.76rem;
}

.settings-firmware-default {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  font-size: 0.78rem;
  color: var(--text-muted, #d4d4d8);
  line-height: 1.45;
}

.settings-firmware-default strong {
  color: #e9d5ff;
  font-weight: 600;
}

.acr-register-link {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border, rgba(255, 255, 255, 0.12));
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted, #a1a1aa);
}

.acr-register-link a {
  color: #93c5fd;
  text-decoration: none;
}

.acr-register-link a:hover {
  text-decoration: underline;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-settings-save {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--gradient, linear-gradient(135deg, #a78bfa, #6366f1));
  color: #fff;
  font-family: var(--font, inherit);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-settings-save:hover {
  opacity: 0.92;
}

.btn-settings-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-msg {
  min-height: 1.2em;
  font-size: 0.82rem;
  text-align: center;
  margin: 0;
}

/* 独立 /settings 页（保留直达链接） */
.settings-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  background: #0e0e16;
}

.settings-page .settings-modal-dialog {
  max-height: none;
}

.settings-modal-dialog--scroll {
  max-height: min(88vh, 720px);
  overflow-y: auto;
}

.settings-form-block {
  margin-bottom: 0;
}

.settings-section-password {
  border-color: rgba(167, 139, 250, 0.22);
  background: rgba(167, 139, 250, 0.06);
}

.settings-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn-settings-save-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #e9d5ff;
}

.btn-settings-save-secondary:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.2);
}

@media (max-width: 768px) {
  .settings-modal-wrap {
    padding: 12px 10px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }

  .settings-modal-dialog {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  .settings-page {
    padding: 16px 12px 32px;
  }
}
