/* 参考小米商城收银台：白底、橙金额、信息行、单选支付方式 */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --ink: #333333;
  --ink-2: #666666;
  --muted: #999999;
  --line: #e0e0e0;
  --orange: #ff6700;
  --orange-soft: #fff4ec;
  --wechat: #07c160;
  --alipay: #1677ff;
  --danger: #e53935;
  --ok: #83c44e;
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-height: 100vh;
}

.panel {
  background: var(--surface);
  border-radius: 2px;
  padding: 28px 32px 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  animation: rise 0.4s ease both;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.merchant {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.merchant-mark,
.merchant-logo {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.merchant-mark {
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
}

.merchant-mark.is-hidden {
  display: none;
}

.merchant-logo {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 2px;
}

.merchant-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.merchant-tip {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.countdown {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.countdown span {
  color: var(--orange);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.amount-block {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 20px;
  animation: rise 0.45s 0.05s ease both;
}

.amount-label {
  font-size: 14px;
  color: var(--ink-2);
  margin-right: 4px;
}

.currency {
  font-size: 22px;
  font-weight: 600;
  color: var(--orange);
  line-height: 1;
}

.amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.meta {
  margin: 0 0 28px;
  padding: 0;
}

.meta-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
}

.meta-row:last-child {
  border-bottom: 1px solid #f0f0f0;
}

.meta-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
}

.meta-row dd {
  margin: 0;
  color: var(--ink);
  word-break: break-all;
  text-align: right;
}

.section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.channels {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.channel {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background 0.15s ease;
}

.channel:last-child {
  border-bottom: 0;
}

.channel:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.channel:not(:disabled):hover {
  background: #fafafa;
}

.channel.active {
  background: var(--orange-soft);
}

.radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #bdbdbd;
  flex-shrink: 0;
  position: relative;
  background: #fff;
}

.channel.active .radio {
  border-color: var(--orange);
}

.channel.active .radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--orange);
}

.channel-icon {
  display: grid;
  place-items: center;
  line-height: 0;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.channel-icon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.channel-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.channel.loading {
  opacity: 0.65;
  pointer-events: none;
}

.qr-wrap {
  text-align: center;
  padding: 8px 0 4px;
  animation: fade 0.3s ease both;
}

.qr-frame {
  width: 220px;
  min-height: 220px;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
}

.qr-frame img {
  display: block;
  width: 200px;
  height: 200px;
}

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px;
}

.qr-loading[hidden],
.qr-frame img[hidden],
.qr-wrap .hint[hidden] {
  display: none !important;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #eee;
  border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.cancel {
  display: block;
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px;
}

.cancel:hover {
  color: var(--orange);
}

.primary {
  appearance: none;
  border: 0;
  border-radius: 2px;
  padding: 10px 36px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: var(--orange);
  color: #fff;
  margin-top: 16px;
}

.primary:hover {
  background: #f25807;
}

.success {
  text-align: center;
  padding: 36px 8px 12px;
  animation: fade 0.35s ease both;
}

.check {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: #f0f9e8;
  color: var(--ok);
}

.success-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.success-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.error {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #fff5f5;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.foot {
  margin-top: 28px;
  text-align: center;
  animation: rise 0.45s 0.08s ease both;
}

.foot-company {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.foot-note,
.foot-beian {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.foot-beian {
  margin-top: 4px;
}

.foot-beian a {
  color: var(--muted);
  text-decoration: none;
}

.foot-beian a:hover {
  color: var(--orange);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 560px) {
  .panel {
    padding: 20px 16px 18px;
  }

  .amount {
    font-size: 30px;
  }

  .meta-row {
    grid-template-columns: 72px 1fr;
  }

  .countdown {
    width: 100%;
  }
}

@media (min-width: 720px) {
  .pay-section {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 28px;
    align-items: start;
  }

  .section-title {
    grid-column: 1 / -1;
  }

  .channels {
    margin-bottom: 0;
  }

  .qr-wrap {
    padding-top: 0;
  }
}
