*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 80px;
}

main {
  max-width: 480px;
  width: 100%;
}

h1 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  color: #999;
  font-size: 13px;
  margin-bottom: 28px;
}

.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #f0c070;
}

.card p {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 16px;
  line-height: 1.6;
}

.card p strong {
  color: #f0c070;
}

.qr-box {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.qr-img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  background: #fff;
  padding: 8px;
}

.hint {
  text-align: center;
  font-size: 12px !important;
  color: #777 !important;
  margin-bottom: 0 !important;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#shareLink {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#shareLink:focus {
  border-color: #f0c070;
}

#shareLink::placeholder {
  color: #666;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #1a1a2e;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-submit:hover {
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-submit.loading {
  background: rgba(255, 255, 255, 0.15);
  color: #aaa;
}

/* Overlay & Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.overlay.hidden {
  display: none;
}

.modal {
  position: relative;
  overflow: hidden;
  background: #1e1e3a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 32px 24px 20px;
  width: 90vw;
  max-width: 400px;
  text-align: center;
  animation: scaleIn 0.25s ease;
}

.modal.success {
  border-color: rgba(76, 175, 80, 0.4);
}

.modal.fail {
  border-color: rgba(244, 67, 54, 0.4);
}

.result-icon {
  font-size: 52px;
  margin-bottom: 12px;
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #fff;
}

.modal.success h3 {
  color: #4caf50;
}

.modal.fail h3 {
  color: #f44336;
}

.modal p {
  font-size: 14px;
  color: #bbb;
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-line;
}

.result-diff {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  text-align: left;
  font-size: 12px;
  color: #ff9800;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-diff.hidden {
  display: none;
}

.btn-close {
  margin-top: 8px;
  padding: 10px 40px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #1a1a2e;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}

.btn-close:hover {
  transform: translateY(-1px);
}

.btn-close:active {
  transform: translateY(0);
}

.btn-close:active {
  transform: translateY(0);
}

/* Watermark */
.watermark {
  position: absolute;
  font-size: 36px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transform: rotate(-20deg);
  transform-origin: center center;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: #555;
  background: rgba(15, 12, 41, 0.8);
  backdrop-filter: blur(10px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
