.mall-page {
  min-height: 100vh;
  background: var(--gray-50);
}

.mall-main {
  max-width: 1100px;
  margin: 24px auto 56px;
  padding: 0 24px;
}

.mall-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.mall-title {
  font-size: 24px;
  color: var(--gray-900);
  font-weight: 800;
}

.mall-subtitle {
  font-size: 13px;
  color: var(--gray-500);
}

.mall-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.mall-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mall-grid {
  display: grid;
  gap: 16px;
}

.mall-grid--2 {
  grid-template-columns: 1.6fr 1fr;
}

.cart-line {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  min-width: 0;
}

.cart-line > * {
  min-width: 0;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-name {
  font-size: 14px;
  color: var(--gray-900);
  font-weight: 700;
  word-break: break-word;
}

.cart-sku {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.cart-price,
.cart-subtotal {
  font-weight: 700;
  color: var(--gray-800);
  font-size: 14px;
}

.qty-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.qty-inline button {
  width: 30px;
  height: 30px;
  color: var(--gray-600);
}

.qty-inline button:hover {
  background: var(--gray-100);
}

.qty-inline input {
  width: 38px;
  text-align: center;
  border: 0;
  outline: none;
  font-size: 13px;
  color: var(--gray-800);
}

.link-danger {
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

.link-danger:hover {
  text-decoration: underline;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.summary-row strong {
  font-size: 19px;
  color: #dc2626;
}

.full-btn {
  width: 100%;
  margin-top: 12px;
}

.input-block label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.input-block input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
}

.input-block select,
.input-block textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.input-block select {
  height: 44px;
}

.input-block textarea {
  resize: vertical;
  min-height: 110px;
}

@supports (-webkit-touch-callout: none) {
  .input-block input,
  .input-block select,
  .input-block textarea,
  .qty-inline input {
    font-size: 16px;
  }
}

.verify-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.settings-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: #fff;
}

.settings-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--gray-600);
}

.settings-tab.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 700;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: flex;
}

.input-tip {
  margin-top: 7px;
  font-size: 12px;
  color: var(--gray-500);
}

.payment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.status-failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.status-completed {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #166534;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 7px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 12px;
  color: var(--gray-600);
  background: #fff;
}

.filter-chip.active,
.filter-chip:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-light);
}

.order-item {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.order-item--link {
  cursor: pointer;
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

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

.order-meta {
  margin-top: 10px;
  color: var(--gray-500);
  font-size: 12px;
  word-break: break-word;
}

.delivery-box {
  margin-top: 12px;
  border: 1px dashed #93c5fd;
  background: #f8fbff;
  border-radius: 10px;
  padding: 12px;
}

.delivery-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
}

.delivery-line--block {
  display: block;
}

.delivery-payload {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(191, 219, 254, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-alipay-btn {
  display: none;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-700);
  background: #fff;
}

.btn-small:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.notice-list,
.support-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.notice-item,
.support-item {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.support-qr-section {
  margin-top: 4px;
}

.support-ticket-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.support-ticket-form .btn-primary,
.support-ticket-desc {
  grid-column: 1 / -1;
}

.support-qr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.support-qr-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.support-qr-card {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  background: #fff;
}

.support-qr-card--text .support-qr-placeholder {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-style: solid;
}

.support-contact-icon {
  width: 100%;
  height: 100%;
}

.support-qr-title {
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.support-qr-placeholder {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background:
    linear-gradient(45deg, #1d4ed8 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(-45deg, #1d4ed8 25%, transparent 25%) 7px 0 / 14px 14px,
    linear-gradient(45deg, transparent 75%, #1d4ed8 75%) 0 7px / 14px 14px,
    linear-gradient(-45deg, transparent 75%, #1d4ed8 75%) 7px 7px / 14px 14px,
    #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.support-qr-account {
  margin-top: 12px;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
  text-align: center;
}

.support-copy-btn {
  margin-top: 10px;
  min-width: 84px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.muted {
  color: var(--gray-500);
  font-size: 13px;
}

.text-danger {
  color: #dc2626;
}

.empty-box {
  text-align: center;
  padding: 36px 18px;
}

.guest-security-note {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdf2 0%, #fffbeb 100%);
}

.security-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.security-link:hover {
  color: #1e40af;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cashier-qr-wrap {
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  padding: 14px;
  background: #f8fbff;
  text-align: center;
}

.cashier-qr {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  margin: 0 auto 10px;
  border: 1px solid #bfdbfe;
  background:
    linear-gradient(45deg, #1d4ed8 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #1d4ed8 25%, transparent 25%) 8px 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #1d4ed8 75%) 0 8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #1d4ed8 75%) 8px 8px / 16px 16px,
    #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.cashier-qr-image {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid #bfdbfe;
  background: #fff;
  object-fit: contain;
}

[data-theme='dark'] .mall-page {
  background: transparent;
}

[data-theme='dark'] .mall-title,
[data-theme='dark'] .cart-name {
  color: #f1f5ff;
}

[data-theme='dark'] .mall-subtitle,
[data-theme='dark'] .muted,
[data-theme='dark'] .cart-sku,
[data-theme='dark'] .order-meta,
[data-theme='dark'] .input-tip {
  color: #9fb0cb;
}

[data-theme='dark'] .mall-card,
[data-theme='dark'] .order-item,
[data-theme='dark'] .notice-item,
[data-theme='dark'] .support-item,
[data-theme='dark'] .settings-tabs,
[data-theme='dark'] .btn-small,
[data-theme='dark'] .qty-inline,
[data-theme='dark'] .input-block input,
[data-theme='dark'] .input-block select,
[data-theme='dark'] .input-block textarea {
  background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
  color: #d6deed;
}

[data-theme='dark'] .support-qr-card {
  background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
  border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .support-qr-placeholder {
  border-color: rgba(59, 130, 246, .48);
  color: #bfdbfe;
  background:
    linear-gradient(45deg, rgba(96, 165, 250, .7) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(-45deg, rgba(96, 165, 250, .7) 25%, transparent 25%) 7px 0 / 14px 14px,
    linear-gradient(45deg, transparent 75%, rgba(96, 165, 250, .7) 75%) 0 7px / 14px 14px,
    linear-gradient(-45deg, transparent 75%, rgba(96, 165, 250, .7) 75%) 7px 7px / 14px 14px,
    rgba(14, 27, 47, .92);
}

[data-theme='dark'] .delivery-box {
  border-color: rgba(89, 155, 255, .52);
  background: rgba(14, 27, 47, .72);
}

[data-theme='dark'] .delivery-payload {
  background: rgba(8, 15, 29, .72);
  border-color: rgba(89, 155, 255, .32);
  color: #d6deed;
}

[data-theme='dark'] .cashier-qr-wrap {
  border-color: rgba(89, 155, 255, .52);
  background: rgba(14, 27, 47, .72);
}

[data-theme='dark'] .cashier-qr {
  border-color: rgba(59, 130, 246, .48);
  color: #bfdbfe;
  background:
    linear-gradient(45deg, rgba(96, 165, 250, .7) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, rgba(96, 165, 250, .7) 25%, transparent 25%) 8px 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, rgba(96, 165, 250, .7) 75%) 0 8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, rgba(96, 165, 250, .7) 75%) 8px 8px / 16px 16px,
    rgba(14, 27, 47, .92);
}

[data-theme='dark'] .cashier-qr-image {
  background: #fff;
  border-color: rgba(89, 155, 255, .52);
}

[data-theme='dark'] .cart-price,
[data-theme='dark'] .cart-subtotal,
[data-theme='dark'] .summary-row {
  color: #d6deed;
}

[data-theme='dark'] .btn-small:hover {
  color: #bfdbfe;
  border-color: #3b82f6;
}

[data-theme='dark'] .payment-chip {
  background: rgba(29, 78, 216, .22);
  border-color: rgba(59, 130, 246, .48);
  color: #bfdbfe;
}

[data-theme='dark'] .filter-chip {
  background: rgba(18, 28, 46, .92);
  border-color: rgba(94, 130, 187, .30);
  color: #d6deed;
}

[data-theme='dark'] .settings-tab {
  color: #9fb0cb;
}

[data-theme='dark'] .settings-tab.active {
  background: rgba(37, 99, 235, .2);
  color: #bfdbfe;
}

[data-theme='dark'] .guest-security-note {
  border-color: rgba(245, 158, 11, .45);
  background: linear-gradient(180deg, rgba(61, 43, 12, .65), rgba(48, 34, 10, .62));
}

[data-theme='dark'] .security-link {
  color: #bfdbfe;
}

@media (max-width: 880px) {
  .mall-grid--2 {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 0;
  }

  .delivery-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .support-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mall-main {
    margin: 18px auto 36px;
    padding: 0 14px;
  }

  .mall-header-row {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .mall-title {
    font-size: 21px;
  }

  .mall-card {
    padding: 14px;
  }

  .support-qr-grid {
    grid-template-columns: 1fr;
  }

  .support-ticket-form {
    grid-template-columns: 1fr;
  }

  .verify-inline {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .support-qr-placeholder {
    width: 124px;
    height: 124px;
  }

  .order-filters {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .order-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .mobile-alipay-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .cart-line {
    gap: 6px;
  }

  .cart-name {
    font-size: 13px;
  }

  .cart-sku,
  .muted {
    font-size: 12px;
  }

  .order-head {
    flex-wrap: wrap;
  }

  .badge-status {
    min-width: 74px;
  }
}
