.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 0;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: 0;
}

.panel-subtitle {
  display: none;
}

.model-status-picker-menu,
.suite-model-picker-menu {
  overscroll-behavior-y: auto;
}

.btn,
.icon-btn,
.chip-btn,
.seg-btn,
.tag-btn,
.step-btn,
.pager-btn,
.pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
}

.btn,
.chip-btn,
.seg-btn,
.tag-btn,
.step-btn,
.pager-btn,
.pager-page {
  box-shadow: var(--shadow-sm);
}

.btn--primary {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-strong);
}

.btn--ghost {
  background: #fff;
}

.btn--brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(37, 99, 235, 0.16);
}

.btn--danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.16);
}

.icon-btn {
  width: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, #9ca3af, #7c8798);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  font-size: 13px;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

textarea {
  min-height: 148px;
  resize: none;
  line-height: 1.75;
}

.segmented,
.tabbar,
.modal-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.seg-btn,
.tab-btn,
.modal-tab,
.tag-btn,
.chip-btn {
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.seg-btn.is-active,
.tab-btn.is-active,
.modal-tab.is-active,
.tag-btn.is-active,
.chip-btn.is-active {
  color: var(--text);
  background: var(--brand-soft);
  border-color: rgba(37, 99, 235, 0.16);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.is-success {
  color: var(--success);
  background: rgba(15, 155, 88, 0.08);
  border-color: rgba(15, 155, 88, 0.16);
}

.status-pill.is-danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.16);
}

.status-pill.is-info {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.16);
}

.status-pill.is-neutral {
  color: var(--muted);
  background: rgba(102, 117, 139, 0.08);
  border-color: rgba(102, 117, 139, 0.14);
}

.mini-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(219, 227, 238, 0.9);
  font-size: 13px;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
  background: #fff;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.shared-menu {
  display: inline-flex;
  align-items: center;
}

.shared-menu--top {
  gap: 22px;
}

.shared-menu--side {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.shared-menu-item {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.shared-menu-item--top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  color: #40475a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 180ms ease, color 180ms ease, background-color 180ms ease;
}

.shared-menu-item--top:hover {
  color: var(--brand);
  transform: scale(1.06);
}

.shared-menu-item--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.shared-menu-item--top-stack {
  min-height: 38px;
  padding: 0 10px;
  align-items: center;
  overflow: visible;
}

.shared-menu-item-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  line-height: 1.1;
}

.shared-menu-item-bubble {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #5f6b7d;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(18, 24, 40, 0.06);
}

.shared-menu-item-bubble::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(37, 99, 235, 0.08);
  border-left: 1px solid rgba(37, 99, 235, 0.16);
  border-top: 1px solid rgba(37, 99, 235, 0.16);
  transform: translateX(-50%) rotate(45deg);
}

.shared-menu-share-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}

.shared-menu-item--top svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.85;
}

.shared-menu-item--top.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.shared-menu-item--top.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -8px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.shared-menu-item--side {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #4e5a70;
  font-size: 15px;
  line-height: 1;
  text-align: left;
  border-left: 3px solid transparent;
}

.shared-menu-item--side:hover {
  background: #f7f8fa;
  color: var(--text);
}

.shared-menu-item--side.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  border-left-color: var(--brand);
  font-weight: 600;
}

.shared-menu-item--danger {
  color: #f53f3f;
}

.shared-menu-item--danger:hover {
  background: rgba(245, 63, 63, 0.04);
  color: #d93636;
}

@media (prefers-reduced-motion: reduce) {
  .shared-menu-item--top {
    transition: none;
  }

  .shared-menu-item--top:hover {
    transform: none;
  }
}

.shared-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
  z-index: 60;
  overflow: hidden;
}

.modal-mask--recharge {
  place-items: center;
}

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

.modal {
  width: min(100%, 720px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(219, 227, 238, 0.95);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.modal--small {
  width: min(100%, 520px);
}

.modal--recharge {
  width: min(100%, 880px);
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head > div {
  min-width: 0;
}

.modal-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.modal-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-body {
  min-height: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  flex: 0 0 auto;
  padding: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.modal--recharge .modal-foot {
  align-items: center;
  justify-content: space-between;
}

.recharge-choices {
  display: grid;
  gap: 14px;
}

.recharge-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recharge-chip {
  position: relative;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  overflow: hidden;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.recharge-chip.is-active {
  border-color: rgba(47, 108, 243, 0.9);
  color: var(--brand);
  background: #f0f3ff;
}

.recharge-chip.is-promoted {
  padding-bottom: 18px;
  border-color: var(--line-strong);
  background: #fff;
}

.recharge-chip.is-active.is-promoted {
  border-color: rgba(47, 108, 243, 0.9);
  background: #f0f3ff;
}

.recharge-chip-amount {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.recharge-chip-tag {
  position: absolute;
  top: 5px;
  left: 6px;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff1eb;
  color: #ef4444;
  overflow: hidden;
  pointer-events: none;
}

.recharge-chip-tag svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.recharge-chip-tag[hidden],
.recharge-chip-corner[hidden] {
  display: none !important;
}

.recharge-chip-corner {
  position: absolute;
  right: 6px;
  bottom: 4px;
  max-width: calc(100% - 12px);
  padding: 2px 7px;
  border-radius: 7px;
  background: #fff0e8;
  color: #c2410c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
}

.recharge-chip.is-percent-promo .recharge-chip-corner {
  right: 6px;
}

.recharge-chip.is-fixed-promo .recharge-chip-corner {
  right: 6px;
}

.recharge-payments {
  display: grid;
  gap: 10px;
}

.recharge-pay-title {
  font-size: 14px;
  font-weight: 600;
}

.recharge-pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-btn {
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  color: #334155;
  position: relative;
  flex-wrap: wrap;
}

.payment-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payment-btn.is-active {
  border-color: rgba(47, 108, 243, 0.9);
  box-shadow: inset 0 0 0 1px rgba(47, 108, 243, 0.16);
}

.payment-btn:disabled {
  cursor: not-allowed;
}

.payment-btn.is-unavailable,
.payment-btn.payment-btn--disabled {
  border-color: #e5e9f0;
  background: #f4f6f9;
  color: #98a2b3;
  box-shadow: none;
}

.payment-btn.is-unavailable .payment-icon,
.payment-btn.payment-btn--disabled .payment-icon {
  background: #cbd5e1;
  color: #fff;
}

.payment-status {
  margin-left: auto;
  color: #f59e0b;
  font-style: normal;
  font-size: 12px;
}

.payment-status--unavailable {
  width: fit-content;
  margin-left: 0;
  padding: 3px 8px;
  border: 1px solid rgba(225, 29, 72, 0.18);
  border-radius: 999px;
  background: #fff1f2;
  color: #e11d48;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.payment-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
}

.payment-icon.is-wechat {
  background: #21bf73;
}

.payment-icon.is-alipay {
  background: #1677ff;
}

.recharge-layout {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(250px, 4fr);
  gap: 20px;
  align-items: start;
}

.recharge-payment-panel {
  display: grid;
  gap: 12px;
}

.recharge-qr {
  display: grid;
  gap: 8px;
}

.recharge-qr-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.recharge-qr-box {
  position: relative;
  min-height: 340px;
  height: 340px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.recharge-qr-box.has-payment-frame {
  place-items: center;
}

.recharge-qr-frame-viewport[hidden],
.recharge-qr-empty[hidden] {
  display: none !important;
}

.recharge-qr-frame-viewport {
  position: relative;
  width: min(100%, 300px);
  height: min(100%, 324px);
  overflow: hidden;
  background: #fff;
  isolation: isolate;
}

.recharge-qr-frame {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  min-width: 0;
  height: 340px;
  min-height: 340px;
  border: 0;
  background: #fff;
  transform: none;
}

.recharge-qr-empty {
  width: min(260px, calc(100% - 32px));
  min-height: 180px;
  padding: 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  border-radius: 16px;
  color: #334155;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(22, 119, 255, 0.28), rgba(47, 107, 255, 0.08)) border-box;
  border: 1px solid transparent;
}

.recharge-qr-empty::before {
  content: "";
  width: 78px;
  height: 78px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #1677ff 12px, transparent 12px) 12px 12px / 22px 22px,
    linear-gradient(#1677ff 12px, transparent 12px) 12px 12px / 22px 22px,
    #eef5ff;
}

.recharge-qr-empty strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.recharge-qr-empty span {
  display: block;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
}

.recharge-qr-box.is-disabled .recharge-qr-empty {
  opacity: 0.72;
}

.recharge-payment-status {
  min-height: 20px;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.recharge-payment-status[hidden] {
  display: none !important;
}

.recharge-payment-status.is-scanned,
.recharge-payment-status.is-success {
  color: #15803d;
  font-weight: 600;
}

.recharge-payment-status.is-closed {
  color: #b45309;
}

.recharge-head {
  display: grid;
  gap: 8px;
}

.recharge-title {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
}

.recharge-head-note {
  color: #d97706;
  font-size: 13px;
  line-height: 1.6;
}

.btn--recharge {
  min-height: 48px;
}

.modal--recharge-result {
  width: min(100%, 460px);
}

.recharge-result {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.recharge-result-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.24);
}

.recharge-result-icon svg {
  width: 28px;
  height: 28px;
}

.recharge-result-copy {
  display: grid;
  gap: 6px;
}

.recharge-result-copy strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
}

.recharge-result-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.recharge-result-summary {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: #f7fafc;
  border: 1px solid var(--line);
}

.recharge-result-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.recharge-result-summary strong {
  color: var(--brand);
  font-size: 15px;
}

.modal--recharge .modal-actions {
  flex: 0 0 auto;
}

.btn--recharge.is-locked {
  opacity: 0.72;
}

.field input[readonly],
.field input:disabled,
.field select:disabled {
  background: #f7f8fa;
  color: #6b7280;
}

.recharge-promo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(22, 163, 74, 0.2);
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  line-height: 1.5;
}

.recharge-promo-banner[hidden] {
  display: none !important;
}

.recharge-promo-banner strong {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
}

.recharge-summary {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f9fc;
}

.recharge-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recharge-summary strong {
  color: var(--brand);
  font-size: 16px;
  font-weight: 700;
}

.recharge-summary-row--total {
  padding-top: 10px;
  border-top: 1px solid rgba(219, 227, 238, 0.85);
}

.recharge-summary-row--total strong {
  font-size: 18px;
}

.recharge-agreement {
  flex: 1 1 280px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: #4e5a70;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.recharge-agreement.is-shake {
  animation: agreement-flash 0.9s ease-in-out 1;
}

.recharge-agreement input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.recharge-agreement a {
  color: var(--brand);
  font-weight: 600;
}

.recharge-agreement a:hover {
  color: var(--brand-strong);
}

.recharge-payment-tip {
  flex: 1 0 100%;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: #d97706;
  text-align: right;
}

.recharge-payment-tip[hidden] {
  display: none !important;
}

@keyframes agreement-flash {
  0%,
  100% {
    border-color: transparent;
    box-shadow: 0 0 0 0 rgba(47, 108, 243, 0);
  }
  20%,
  60% {
    border-color: rgba(47, 108, 243, 0.95);
    box-shadow: 0 0 0 4px rgba(47, 108, 243, 0.14);
  }
  40%,
  80% {
    border-color: rgba(47, 108, 243, 0.35);
    box-shadow: 0 0 0 2px rgba(47, 108, 243, 0.08);
  }
}

@media (max-width: 900px) {
  .recharge-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .modal-mask {
    padding: 12px;
  }

  .modal {
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }

  .modal-head {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-foot {
    padding: 0 14px 14px;
  }

  .modal--recharge .modal-foot {
    justify-content: stretch;
  }

  .modal--recharge .modal-actions,
  .btn--recharge {
    width: 100%;
  }

  .recharge-agreement {
    flex-basis: 100%;
    padding: 8px 0;
  }

  .recharge-amounts,
  .recharge-pay-grid {
    grid-template-columns: 1fr;
  }

  .recharge-title {
    font-size: 26px;
  }

  .recharge-qr-box {
    min-height: 340px;
    height: 340px;
  }
}
