.page.ref-order-screen {
  display: block;
  min-height: calc(100svh - 44px - env(safe-area-inset-top));
  padding: 0 0 28px;
  color: #303030;
  background: #f3f3f3;
}

#app:has(.ref-order-screen) > .topbar.subpage {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 45px 0;
  border: 0;
  background: #fff;
  color: #191919;
}

#app:has(.ref-order-screen) > .topbar.subpage strong { font-size: 18px; }
#app:has(.ref-order-screen) > .topbar.subpage .back { position: absolute; inset-inline-start: 0; margin: 0; }

.ref-order-settlement .ref-settlement-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
  color: #616161;
  text-align: center;
}

.ref-settlement-tabs a { min-height: 36px; display: grid; place-items: stretch center; }
.ref-settlement-tabs span { min-width: 97px; padding-top: 7px; border-bottom: 2px solid transparent; }
.ref-settlement-tabs a[aria-current='page'] span { border-color: #4899c5; color: #358ab8; }

.ref-settlement-products {
  min-height: 203px;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  gap: 12px;
  background: #fff;
  padding: 16px;
  margin-block: 12px;
}

.ref-settlement-item { display: grid; gap: 5px; flex: 0 0 98px; min-width: 0; }
.ref-settlement-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 2px; }
.ref-settlement-item span { font-size: 13px; overflow-wrap: anywhere; }
.ref-settlement-item strong { font-size: 16px; font-weight: 500; color: #d94d53; }
.ref-settlement-products > p, .ref-settlement-lines > p { margin: auto; color: #666; text-align: center; }
.ref-settlement-lines { display: grid; gap: 7px; margin-bottom: 65px; }
.ref-settlement-lines > p { padding: 12px; }

.ref-payment-card { background: #fff; padding: 6px 16px 9px; min-width: 0; }
.ref-payment-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 5px;
}

.ref-payment-row > span { color: #666; }
.ref-payment-row > div { min-width: 0; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.ref-payment-row:last-of-type > div { font-size: 13px; }
.ref-payment-proof { min-height: 46px; padding-block: 4px; }
.ref-payment-proof:has(.ref-proof-preview) { min-height: 73px; }
.ref-proof-preview { display: block; margin-inline-start: auto; border: 0; padding: 0; background: none; }
.ref-proof-preview .protected-image { width: 49px; height: 65px; border: 1px solid #eee; border-radius: 1px; object-fit: contain; }
.ref-full-proof { max-height: 65svh; max-width: 100%; object-fit: contain; margin-inline: auto; }

.ref-payment-action, .ref-payment-state {
  display: inline-flex;
  justify-content: center;
  min-height: 24px;
  min-width: 68px;
  padding: 3px 9px;
  border: 0;
  border-radius: 5px;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
  color: #fff;
  background: #cecece;
}

.ref-payment-state { color: #414141; }
.ref-payment-action { background: #488d73; }
.ref-payment-action:hover { background: #39785e; }
.ref-payment-action:disabled { opacity: .65; }
.ref-payment-note { margin-top: 8px; color: #a1252e; font-size: 13px; overflow-wrap: anywhere; }
.ref-payment-deadline { margin-top: 6px; color: #676767; font-size: 13px; }
.ref-payment-deadline summary { cursor: pointer; }

#app.ref-seller-payment { --seller-pay-red: #ff4949; background: #f4f4f4; }
#app.ref-seller-payment > .topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #131313;
  border: 0;
}
#app.ref-seller-payment > .topbar .back { left: 0; }
#app.ref-seller-payment > .topbar .back svg { width: 28px; height: 28px; }
.page.seller-payment-screen { display: block; padding: 0; color: #303030; }
.seller-payment-form { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.seller-payment-upload, .seller-information, .seller-payment-methods, .seller-payment-qr, .seller-payment-result { background: #fff; }
.seller-payment-upload { padding: 15px 10px 10px; margin-bottom: 5px; }
.seller-proof-picker {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 158px;
  padding: 10px;
  border: 1px dashed #d8d8d8;
  border-radius: 9px;
  background: #f8f8f8;
  cursor: pointer;
}
.seller-proof-picker:focus-within { outline: 2px solid var(--seller-pay-red); outline-offset: 2px; }
.seller-proof-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.seller-proof-picker img { display: block; width: 100%; height: 136px; object-fit: contain; }
.seller-proof-placeholder {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: min(59%, 234px);
  aspect-ratio: 1.62;
  border: 6px solid transparent;
  background: linear-gradient(#fae8e6 0 0) content-box;
  color: #e4524f;
  font-size: 11px;
}
.seller-proof-placeholder::before {
  content: '';
  position: absolute;
  inset: -6px;
  --corner: linear-gradient(var(--seller-pay-red) 0 0);
  background: var(--corner) top left / 14px 2px, var(--corner) top left / 2px 14px,
    var(--corner) top right / 14px 2px, var(--corner) top right / 2px 14px,
    var(--corner) bottom left / 14px 2px, var(--corner) bottom left / 2px 14px,
    var(--corner) bottom right / 14px 2px, var(--corner) bottom right / 2px 14px;
  background-repeat: no-repeat;
}
.seller-proof-icon { position: relative; width: 38px; height: 38px; border-radius: 50%; background: var(--seller-pay-red); }
.seller-proof-icon::before {
  position: absolute;
  content: '';
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}
.seller-proof-icon::after {
  position: absolute;
  content: '';
  width: 13px;
  height: 13px;
  left: 12.5px;
  top: 9px;
  background: #fff;
  clip-path: polygon(50% 0, 100% 54%, 65% 54%, 65% 100%, 35% 100%, 35% 54%, 0 54%);
}
.seller-payment-note { margin: 8px 0 0; color: #b32025; font-size: 13px; overflow-wrap: anywhere; }
.seller-information { padding: 0 10px; margin-bottom: 10px; }
.seller-information h2 { display: grid; align-items: center; height: 25px; padding-left: 9px; border-left: 3px solid #4a9ede; font-size: 16px; }
.seller-information dl { margin: 8px 0 0; }
.seller-information dl > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 7px 16px; }
.seller-information dl > div + div { border-top: 1px solid #eee; }
.seller-information dt { color: #666; flex: 0 0 auto; }
.seller-information dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.seller-payment-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; margin-bottom: 10px; }
.seller-payment-methods button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: inherit;
}
.seller-payment-methods button[aria-pressed='true'] { border-color: #f04c48; background: #fff5f3; }
.seller-payment-methods button[aria-pressed='true']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  border: 10px solid transparent;
  border-top-color: #ff5651;
  border-left-color: #ff5651;
}
.seller-payment-methods button[aria-pressed='true']::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 3px;
  width: 8px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(-45deg);
}
.seller-payment-methods button:disabled { opacity: .45; }
.seller-method-mark { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; border-radius: 3px; color: #fff; }
.seller-method-alipay { background: #1196d8; font-size: 21px; line-height: 1; }
.seller-method-wechat { background: #3eb448; }
.seller-method-wechat svg { width: 21px; height: 18px; border-radius: 50% 50% 50% 7px; color: #3aaf42; background: #fff; stroke-width: 3px; }
.seller-payment-qr { display: grid; justify-items: center; padding: 19px 12px 26px; text-align: center; }
.seller-payment-amount { font-size: 15px; }
.seller-payment-amount strong { margin-left: .25em; font-weight: 500; }
.seller-qr-reminder { margin: 14px 0 15px; color: #c61116; font-size: 11px; }
.seller-qr-card { display: grid; justify-items: center; gap: 8px; width: min(220px, 80vw); padding: 16px 12px 10px; background: #fff; box-shadow: 0 3px 15px #00000012; }
.seller-qr-card figcaption { display: flex; align-items: center; gap: 3px; color: #282828; font-size: 14px; font-weight: 700; }
.seller-qr-card .seller-method-mark { width: 17px; height: 17px; font-size: 15px; }
.seller-qr-card .seller-method-wechat svg { width: 14px; height: 12px; }
.seller-qr-card img { width: min(100%, 155px); min-height: 85px; max-height: 235px; object-fit: contain; }
.seller-payment-deadline { margin-top: 12px; color: #666; font-size: 12px; }
.seller-payment-result { display: grid; justify-items: center; gap: 12px; padding: 20px 16px; }
.seller-payment-footer {
  position: fixed;
  z-index: 4;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  background: #f5f5f5;
  box-shadow: 0 -3px 13px #00000006;
}
.seller-payment-footer button { width: 100%; min-height: 36px; border: 1px solid #e84646; border-radius: 6px; color: #fff; background: var(--seller-pay-red); font-size: 16px; }
.seller-payment-footer button:disabled { opacity: .65; }

.ref-settlement-result,
.ref-order-actions {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--ref-app-width, 520px));
  background: #fff;
  border-top: 1px solid #ededed;
}

.ref-settlement-result {
  min-height: calc(57px + env(safe-area-inset-bottom));
  padding: 8px 15px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
}

.ref-settlement-result span { font-size: 13px; }
.ref-settlement-result strong { color: #d94d53; font-size: 16px; font-weight: 500; white-space: nowrap; }
.ref-settlement-warehouse { font-size: 13px; color: #3c9cff; white-space: nowrap; }

#app:is(.ref-orders, .ref-order, .ref-records) {
  --mine-order-unit: min(.133333334vw, .693333334px);
  --mine-order-gutter: calc(var(--mine-order-unit) * 20);
  --mine-order-outer: calc(var(--mine-order-unit) * 24);
  --mine-order-gap: calc(var(--mine-order-unit) * 16);
  --mine-order-image: calc(var(--mine-order-unit) * 150);
  --mine-proof-image: calc(var(--mine-order-unit) * 70);
  --mine-empty-space: calc(var(--mine-order-unit) * 100);
  background: #f5f5f5;
  color: #333;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
@supports (width: round(down, 20.5px, 1px)) {
  #app:is(.ref-orders, .ref-order, .ref-records) {
    --mine-order-gutter: round(down, calc(var(--mine-order-unit) * 20), 1px);
    --mine-order-outer: round(down, calc(var(--mine-order-unit) * 24), 1px);
    --mine-order-gap: round(down, calc(var(--mine-order-unit) * 16), 1px);
    --mine-order-image: round(down, calc(var(--mine-order-unit) * 150), 1px);
    --mine-proof-image: round(down, calc(var(--mine-order-unit) * 70), 1px);
  }
}

#app:is(.ref-orders, .ref-order, .ref-records) > .topbar.subpage {
  position: sticky;
  z-index: 10;
  top: 0;
  height: calc(44px + env(safe-area-inset-top));
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 45px 0;
  border: 0;
  color: #000;
  background: #fff;
}
#app:is(.ref-orders, .ref-order, .ref-records) > .topbar.subpage strong { font-size: 16px; line-height: 30px; }
#app:is(.ref-orders, .ref-order, .ref-records) > .topbar.subpage .back { left: 0; min-width: 37px; }

.page.ref-order-records {
  background: #f0f5ff;
  padding: var(--mine-order-gutter) var(--mine-order-gutter) env(safe-area-inset-bottom);
}
#app.ref-records { background: #f0f5ff; }
.ref-order-records .ref-payment-card {
  margin-bottom: var(--mine-order-gutter);
  padding: var(--mine-order-gutter);
  border-radius: 5px;
  box-shadow: 0 1px 5px rgb(0 0 0 / 5%);
}
.ref-order-records .ref-payment-row {
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  line-height: 21px;
}
.ref-order-records .ref-payment-row > span { flex-shrink: 0; }
.ref-order-records .ref-payment-row > div { color: #333; font-size: 16px; }
.ref-order-records .ref-payment-rows-end { min-height: 35px; border-bottom: 0; }
.ref-order-records .ref-payment-proof { min-height: calc(var(--mine-proof-image) + 15px); }
.ref-order-records .ref-proof-preview .protected-image {
  width: var(--mine-proof-image);
  height: var(--mine-proof-image);
  border: 0;
  border-radius: 0;
  object-fit: cover;
}
.ref-order-records .ref-payment-state, .ref-order-records .ref-payment-action {
  min-width: 0;
  min-height: 25px;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 16px;
  line-height: 21px;
}
.ref-order-records .ref-payment-state { background: #e0e0e0; color: #666; }
.ref-order-records .ref-payment-action { background: #55aa7f; }
.ref-order-records [data-upload-toggle] { min-height: 21px; padding: 0; background: transparent; color: #333; }

.page.ref-order-book, .page.ref-order-detail { padding: 0 0 env(safe-area-inset-bottom); background: #f5f5f5; }
.ref-order-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.ref-order-tabs a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 39px;
  color: #191919;
  font-size: 14px;
  line-height: 21px;
  white-space: nowrap;
}
.ref-order-tabs a[aria-current="page"] { color: #3c9cff; }
.ref-order-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 25% 0;
  height: 1px;
  background: #3c9cff;
}
.ref-order-card {
  margin-bottom: 4px;
  padding: var(--mine-order-gap) var(--mine-order-outer);
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.ref-order-card header, .ref-order-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.ref-order-card header {
  min-height: 16px;
  margin-bottom: var(--mine-order-gap);
  color: #333;
  font-size: 12px;
  line-height: 16px;
}
.ref-order-card header span, .ref-order-info .value-row strong { overflow-wrap: anywhere; }
.ref-order-card header strong { color: #ff4d4f; white-space: nowrap; }
.ref-order-item {
  display: grid;
  grid-template-columns: var(--mine-order-image) minmax(0, 1fr);
  align-items: center;
  gap: var(--mine-order-gap);
  margin-bottom: var(--mine-order-gap);
}
.ref-order-photo {
  display: block;
  width: var(--mine-order-image);
  height: var(--mine-order-image);
  border-radius: 3px;
  background: #000;
  object-fit: cover;
}
.ref-order-photo svg { display: none; }
.ref-order-item h3 { margin: 0 0 4px; color: #333; font-size: 14px; font-weight: 400; line-height: 19px; overflow-wrap: anywhere; }
.ref-order-item strong { display: block; color: #ff4d4f; font-size: 16px; font-weight: 500; line-height: 21px; }
.ref-order-card footer { min-height: 21px; align-items: end; padding-bottom: 1px; color: #999; font-size: 10px; line-height: 14px; }

.ref-order-empty {
  padding: var(--mine-empty-space) 0;
  color: #999;
  font-size: 15px;
  line-height: 21px;
  text-align: center;
}
.ref-order-records .ref-order-empty { font-size: 16px; }
.ref-order-more {
  display: block;
  width: 100%;
  padding: 12px;
  border: 0;
  background: transparent;
  color: #999;
  font-size: 13px;
  text-align: center;
}
.ref-order-more[hidden] { display: none; }

.page.ref-order-detail { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.ref-order-detail-item { margin-bottom: 6px; }
.ref-order-detail-item .ref-order-item { margin-bottom: 0; }
.ref-order-info { padding: 4px var(--mine-order-outer); background: #fff; }
.ref-order-info .value-row { border-bottom: 1px solid #f0f0f0; padding-block: 9px; font-size: 14px; }
.ref-order-info .value-row:last-child { border: 0; }
.ref-order-notes { margin: 12px var(--mine-order-outer); color: #666; font-size: 13px; line-height: 1.7; }
.ref-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px var(--mine-order-outer) calc(10px + env(safe-area-inset-bottom));
}
.ref-order-link {
  display: grid;
  place-items: center;
  min-height: 41px;
  padding: 4px 12px;
  border: 1px solid #3c9cff;
  border-radius: 5px;
  background: #fff;
  color: #3c9cff;
  font-size: 14px;
}
.ref-order-primary { background: #3c9cff; color: #fff; }
.ref-order-primary:disabled { opacity: .6; }
.ref-order-detail > .ref-order-primary { margin: 12px var(--mine-order-outer); }
