/* 查询结果 - Main stylesheet */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --primary: #2f6fed;
  --primary-dark: #2458c4;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #16a34a;
  --green: #21ba45;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ============ 生成页 ============ */
.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header .badge {
  display: inline-block;
  padding: 4px 14px;
  background: #e8f0ff;
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.header p {
  color: var(--muted);
  font-size: 15px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 16px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

input.input,
select.input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

select.input {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

input.input:focus,
select.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: #f3f4f6;
  color: var(--text);
  flex: 1;
}

.btn-ghost:hover {
  background: #e5e7eb;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.result {
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}

.result.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.qr-box {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
}

.qr-box img,
.qr-box canvas {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
}

.qr-tip {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.qr-tip strong {
  color: var(--ok);
  font-weight: 600;
}

.error-msg {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 24px;
}

/* ============ 扫码结果页（移动端） ============ */
.result-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.r-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f2f2f2;
  position: relative;
}

.r-close {
  font-size: 20px;
  color: #333;
  width: 28px;
  cursor: pointer;
}

.r-title {
  font-size: 17px;
  font-weight: 600;
  color: #111;
  text-align: center;
  flex: 1;
}

.r-domain {
  font-size: 12px;
  color: #999;
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  text-align: center;
}

.r-more {
  color: #333;
  letter-spacing: 2px;
  font-size: 14px;
  width: 28px;
  text-align: right;
  cursor: pointer;
}

.r-success {
  display: flex;
  align-items: center;
  padding: 36px 24px 28px;
}

.success-icon {
  width: 58px;
  height: 58px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  flex-shrink: 0;
  margin-right: 18px;
}

.success-text {
  font-size: 24px;
  font-weight: 700;
  color: #111;
}

.r-detail {
  padding: 0 24px;
}

.r-detail-title {
  font-size: 13px;
  color: #999;
  padding: 10px 0;
}

.detail-list {
  border-top: 0.5px solid #f0f0f0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 2px;
  border-bottom: 0.5px solid #f0f0f0;
}

.detail-key {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.detail-val {
  font-size: 15px;
  color: #999;
  text-align: right;
  max-width: 60%;
  word-break: break-all;
}

.detail-val.strong {
  color: #333;
  font-weight: 700;
}

.r-exit {
  margin: 40px 24px 60px;
  padding: 14px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ============ 已退出提示页 ============ */
.exit-page .exit-icon {
  width: 58px;
  height: 58px;
  background: #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  flex-shrink: 0;
  margin-right: 18px;
}

.r-exit-tip {
  padding: 0 40px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.8;
}

/* ============ 已退出遮罩层（本页内叠加） ============ */
.exit-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.exit-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exit-overlay .exit-icon {
  width: 64px;
  height: 64px;
  background: #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 30px;
  flex-shrink: 0;
  margin-bottom: 18px;
}

.exit-overlay .success-text {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
}

.exit-overlay-tip {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.9;
}

@media (max-width: 520px) {
  .app {
    padding: 20px 14px 36px;
  }
  .header h1 {
    font-size: 23px;
  }
  .card {
    padding: 18px;
  }
  .field-row {
    flex-direction: column;
    gap: 0;
  }
}