:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --fg: #e8eaed;
  --muted: #9aa0aa;
  --primary: #14b87a;
  --primary-d: #0e9460;
  --error: #ff6b6b;
  --warn: #f0a93b;
  --line: #2a2e37;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
  min-height: 100vh;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}
.brand {
  margin: 0;
  font-size: 22px;
  letter-spacing: .5px;
  color: var(--primary);
}
.lang select {
  background: #0f1218;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
}
.lang select:focus { outline: none; border-color: var(--primary); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.contact {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.contact a { color: var(--primary); text-decoration: none; margin-left: 4px; }

.panel { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

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

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 12px;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--primary); }

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--line);
}
.btn-primary { background: var(--primary); }
.btn-primary:active { background: var(--primary-d); }
/* 主操作按钮：手机首屏主付款路径，更大更醒目 */
.btn-hero {
  padding: 16px 18px;
  font-size: 17px;
  margin: 2px 0 18px;
  box-shadow: 0 4px 16px rgba(20, 184, 122, .35);
}
.btn-mini {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--line);
  flex: 0 0 auto;
}

.error { color: var(--error); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

.amount {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  margin: 4px 0 16px;
  color: var(--primary);
}

.qrcode {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin: 0 auto 8px;
  width: 264px;
}
.qrcode img, .qrcode canvas, .qrcode table { display: block; }
.qr-fallback { color: var(--warn); font-size: 13px; text-align: center; margin: 6px 0 12px; }

.kv { margin: 12px 0; }
.kv-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.kv-row { display: flex; align-items: center; gap: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.break { word-break: break-all; }
.small { font-size: 11px; color: var(--muted); }
code.mono {
  flex: 1 1 auto;
  min-width: 0;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}
/* Solana Pay 链接：原文独占一行（block，全宽），按钮另起一行，避免长链接挤掉复制按钮 */
.link-block { display: block; width: 100%; }
.kv-actions { display: flex; gap: 8px; margin-top: 8px; }
/* 链接折叠：默认一行省略，展开后整段换行 */
.link-collapsed { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-expanded  { white-space: normal; word-break: break-all; }

/* 长按选中兜底：即使复制按钮在某些 webview 失效，用户也能长按手动选中复制。
   selectable=普通可选（地址，全可见）；selectable-all=整体选中（链接虽折叠也能整段选中复制）。 */
.selectable {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}
.selectable-all {
  -webkit-touch-callout: default;
  -webkit-user-select: all;
  user-select: all;
  cursor: text;
}
.copy-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 0; }

#wallet-open { margin-top: 12px; }

.meta { margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.meta > div { display: flex; justify-content: space-between; margin: 4px 0; }
.meta dt { color: var(--muted); margin: 0; }
.meta dd { margin: 0; }

.status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px; margin: 14px 0 0;
}
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--primary);
  display: inline-block; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ok-badge { text-align: center; font-size: 20px; font-weight: 700; color: var(--primary); margin: 8px 0 16px; }
.paid-thanks { text-align: center; font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.paid-contact { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 14px 0 0; }
.paid-contact a { color: var(--primary); text-decoration: none; margin-left: 4px; word-break: break-all; }
.warn-badge { text-align: center; font-size: 18px; font-weight: 700; color: var(--warn); margin: 8px 0 18px; }
