:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #d7dce5;
  --accent: #111111;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f9fafb 0%, var(--bg) 100%);
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

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

h1 {
  margin: 0;
  font-size: 28px;
}

.page-hint-list {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

button, a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.secondary, a.secondary {
  background: #e7eaf0;
  color: var(--ink);
}

.language-switch button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-switch button.active {
  background: var(--accent);
  color: #fff;
}

.status {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.manual-delete {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.manual-delete input {
  flex: 1 1 320px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.card.removing {
  opacity: 0;
  transform: translateY(8px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 13px;
  font-weight: 800;
  word-break: break-all;
  line-height: 1.35;
}

.badge {
  flex: none;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #eef2ff;
  color: #2f56d5;
}

.badge.succeeded { background: #e8fff4; color: var(--ok); }
.badge.failed, .badge.expired, .badge.canceled { background: #fff1f0; color: var(--danger); }

.qr-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr-wrap img {
  display: block;
  width: min(180px, 100%);
  height: auto;
}

.qr-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
}

.qr-success-mark {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.22);
}

.meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.card-actions {
  margin-top: 12px;
}

.payment-help-link {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  justify-content: flex-start;
}

.meta-row {
  display: grid;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

code {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f2f4f8;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.empty {
  padding: 32px 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.75);
}
