.ags-ext-toolbar {
  position: fixed;
  z-index: 99999;
  display: none !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.ags-ext-top-back {
  position: fixed;
  z-index: 100000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  border: 1px solid rgba(239, 203, 185, 0.5);
  border-radius: 999px;
  background: rgba(16, 10, 8, 0.72);
  color: #efcbb9;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.ags-ext-top-back svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ags-ext-top-back:active {
  transform: scale(0.96);
}

.ags-ext-toolbar-btn {
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(239, 203, 185, 0.45);
  background: rgba(20, 12, 8, 0.66);
  color: var(--ags-toolbar-icon, #efcbb9);
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.2s, transform 0.15s;
  flex-shrink: 0;
  box-shadow: none;
  backdrop-filter: blur(6px);
  outline: none;
}

.ags-ext-toolbar-btn:hover {
  opacity: 0.85;
}

.ags-ext-toolbar.is-dragging .ags-ext-toolbar-btn {
  cursor: grabbing;
  transform: scale(0.96);
}

.ags-ext-toolbar-home-text {
  display: block;
  margin-top: 2px;
  color: var(--ags-toolbar-icon, #efcbb9);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.ags-ext-toolbar-btn:active {
  transform: scale(0.92);
}

.ags-ext-toolbar-btn svg {
  fill: none;
  stroke: var(--ags-toolbar-icon, #efcbb9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ags-ext-toolbar-btn:hover svg {
  stroke: var(--ags-toolbar-icon-hover, #ffe1cf);
}

.ags-ext-toolbar-btn svg.ags-ext-toolbar-solid {
  fill: var(--ags-toolbar-icon, #efcbb9);
  stroke: none;
}

.ags-ext-toolbar-btn:hover svg.ags-ext-toolbar-solid {
  fill: var(--ags-toolbar-icon-hover, #ffe1cf);
}

.ags-ext-toolbar-btn-text {
  width: auto;
  min-width: 44px;
  padding: 0 4px;
}

.ags-ext-toolbar-deposit-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

.ags-ext-toolbar-text {
  color: var(--ags-toolbar-icon, #efcbb9);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: none;
}

.ags-ext-toolbar-btn-text:hover .ags-ext-toolbar-text {
  color: var(--ags-toolbar-icon-hover, #ffe1cf);
}

.ags-ext-remember-root {
  box-sizing: border-box;
  pointer-events: auto;
}

.ags-ext-remember-root[hidden] {
  display: none !important;
}

.ags-ext-remember-root.is-inline {
  display: block;
  width: 100%;
  padding-left: 10%;
  margin: 0;
}

.ags-ext-remember {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 0 4px;
  margin: 0;
}

.ags-ext-remember label {
  color: #e4bf87e6;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ags-ext-remember-expire {
  color: rgba(228, 191, 135, 0.72);
  font-size: 12px;
  line-height: 1.4;
  padding-left: 24px;
  display: none;
}

.ags-ext-remember input {
  width: 16px;
  height: 16px;
  accent-color: #f15e21;
}

#pa-loading {
  transition: opacity 0.25s ease !important;
}

.ags-ext-mask {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ags-ext-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(36, 26, 18, 0.98), rgba(15, 15, 15, 0.98));
  border: 1px solid rgba(228, 191, 135, 0.42);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.ags-ext-panel h3 {
  margin: 0 0 16px;
  color: #e4bf87;
  font-size: 18px;
  text-align: center;
}

.ags-ext-support {
  border: 1px solid rgba(228, 191, 135, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  margin: 0 0 12px;
}

.ags-ext-support p {
  color: rgba(228, 191, 135, 0.82);
  font-size: 12px;
  margin: 0 0 8px;
  text-align: center;
}

.ags-ext-support-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ags-ext-support-btn {
  height: 42px;
  border: 1px solid rgba(228, 191, 135, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: #e4bf87;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

.ags-ext-support-btn:hover {
  border-color: rgba(255, 232, 163, 0.78);
  background: rgba(228, 191, 135, 0.12);
}

.ags-ext-support-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #e4bf87;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ags-ext-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ags-ext-tab {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(228, 191, 135, 0.35);
  background: transparent;
  color: #e4bf87;
  cursor: pointer;
}

.ags-ext-tab.active {
  background: linear-gradient(135deg, #ffe8a3, #edbe77, #b28452);
  color: #5e3400;
  border-color: transparent;
  font-weight: 700;
}

.ags-ext-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 14px;
}

.ags-ext-steps span {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(228, 191, 135, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(228, 191, 135, 0.7);
  font-size: 11px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

.ags-ext-steps span.active,
.ags-ext-steps span.done {
  border-color: rgba(228, 191, 135, 0.55);
  color: #e4bf87;
  background: rgba(228, 191, 135, 0.12);
}

.ags-ext-section-title {
  color: #e4bf87;
  font-size: 13px;
  margin: 4px 0 8px;
}

.ags-ext-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ags-ext-preset {
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(228, 191, 135, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.ags-ext-preset.active {
  border-color: #e4bf87;
  background: rgba(228, 191, 135, 0.18);
  color: #e4bf87;
  font-weight: 700;
}

.ags-ext-input {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(228, 191, 135, 0.42);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0 16px;
  margin-bottom: 12px;
}

.ags-ext-range-tip {
  margin: -4px 0 12px;
  color: #ffe8a3;
  font-size: 12px;
  text-align: center;
}

.ags-ext-qr {
  text-align: center;
  margin: 12px 0;
}

.ags-ext-qr-section {
  margin-bottom: 12px;
}

.ags-ext-qr-title {
  color: #e4bf87;
  font-size: 13px;
  margin: 0 0 8px;
  text-align: left;
}

.ags-ext-qr-empty {
  color: rgba(228, 191, 135, 0.75);
  font-size: 13px;
  text-align: center;
  margin: 8px 0 12px;
}

.ags-ext-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.ags-ext-qr-item {
  border: 1px solid rgba(228, 191, 135, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.ags-ext-qr-item.active {
  border-color: #e4bf87;
  box-shadow: 0 0 0 1px rgba(228, 191, 135, 0.35);
  background: rgba(228, 191, 135, 0.12);
}

.ags-ext-qr-item.active::after {
  content: "已选";
  position: absolute;
  top: 6px;
  right: 6px;
  color: #5e3400;
  background: #e4bf87;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 6px;
}

.ags-ext-qr-label {
  color: #e4bf87;
  font-size: 12px;
  line-height: 1.3;
}

.ags-ext-qr-range {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(255, 232, 163, 0.12);
  color: #ffe8a3;
  font-size: 11px;
  line-height: 1.35;
  padding: 3px 8px;
  word-break: break-word;
}

.ags-ext-qr-addr {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
}

.ags-ext-qr-copy {
  border: 1px solid rgba(228, 191, 135, 0.36);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: #e4bf87;
  font-size: 11px;
  padding: 4px 12px;
  cursor: pointer;
}

.ags-ext-qr-order {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(228, 191, 135, 0.25);
}

.ags-ext-voucher-tip {
  color: #e4bf87;
  font-size: 13px;
  margin: 0 0 8px;
}

.ags-ext-qr img {
  max-width: 100%;
  width: 132px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.ags-ext-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ags-ext-btn {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.ags-ext-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ags-ext-btn-primary {
  background: linear-gradient(135deg, #ffe8a3, #edbe77, #b28452);
  color: #5e3400;
  font-weight: 700;
}

.ags-ext-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ags-ext-msg {
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

.ags-ext-msg.error {
  color: #ff3b30;
}

.ags-ext-msg.success {
  color: #34c759;
}

.ags-ext-voucher {
  margin-top: 12px;
}

.ags-ext-voucher input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ags-ext-voucher-upload {
  min-height: 96px;
  border: 1px dashed rgba(228, 191, 135, 0.48);
  border-radius: 12px;
  background: rgba(228, 191, 135, 0.07);
  color: #e4bf87;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  text-align: center;
  padding: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.ags-ext-voucher-upload:hover {
  border-color: rgba(255, 232, 163, 0.8);
  background: rgba(228, 191, 135, 0.12);
}

.ags-ext-voucher-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(228, 191, 135, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.ags-ext-voucher-upload small {
  color: rgba(228, 191, 135, 0.72);
  font-size: 11px;
}

.ags-ext-voucher-info {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  word-break: break-all;
}

.ags-ext-voucher-info.success {
  color: #34c759;
}

.ags-ext-voucher-info.error {
  color: #ff3b30;
}

.ags-ext-voucher-preview {
  margin-top: 10px;
  text-align: center;
}

.ags-ext-voucher-preview p {
  color: #e4bf87;
  font-size: 12px;
  margin: 0 0 6px;
}

.ags-ext-voucher-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid rgba(228, 191, 135, 0.32);
  background: #fff;
}

@media (max-width: 768px) {
  .ags-ext-remember {
    width: 80%;
    padding-left: 0;
  }

  .ags-ext-remember-expire {
    padding-left: 24px;
  }

  .ags-ext-toolbar {
    gap: 4px;
  }

  .ags-ext-qr-grid {
    grid-template-columns: 1fr;
    max-height: 240px;
  }
}
