:root {
  --bg: #0f172a;
  --card: #ffffff;
  --primary: #0ea5e9;
  --primary-d: #0284c7;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --ok: #16a34a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 14px 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #0ea5e9 160%);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 22px 20px 24px;
}

.head h1 { margin: 0 0 4px; font-size: 1.35rem; }
.head .sub { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }

select, input[type="text"] {
  width: 100%;
  padding: 13px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
}
select:focus, input:focus { outline: 2px solid var(--primary); background: #fff; }

.hint { display: block; margin-top: 5px; color: var(--muted); font-size: 0.76rem; }

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-primary:active { background: var(--primary-d); }

.result { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 20px; }

.qr-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 16px;
}
#qr { width: 280px; max-width: 100%; height: auto; border-radius: 10px; }
.loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}

.info { margin: 0 0 16px; display: grid; gap: 9px; }
.info > div { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.info dt { color: var(--muted); margin: 0; }
.info dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }

.copy {
  margin-left: 6px; padding: 2px 8px; font-size: 0.72rem;
  border: 1px solid var(--primary); color: var(--primary);
  background: #fff; border-radius: 6px; cursor: pointer;
}

.btn-copy-all {
  width: 100%; padding: 12px; margin-bottom: 12px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  color: var(--primary-d); background: #e0f2fe;
  border: 1px solid #bae6fd; border-radius: 10px;
}
.btn-copy-all:active { background: #bae6fd; }

.actions { display: flex; gap: 10px; }
.btn-secondary, .btn-ghost {
  flex: 1; padding: 12px; font-size: 0.95rem; font-weight: 600;
  border-radius: 10px; cursor: pointer;
}
.btn-secondary { color: #fff; background: var(--primary); border: none; }
.btn-ghost { color: var(--muted); background: #fff; border: 1px solid var(--border); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ok); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 0.88rem; box-shadow: 0 8px 20px rgba(0,0,0,.3); z-index: 9;
}
