:root {
  color: #191413;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, #f4f2ee 0%, #e8e4dc 45%, #efe8dd 100%);
  --ink: #191413;
  --muted: rgba(25, 20, 19, 0.6);
  --line: rgba(25, 20, 19, 0.12);
  --accent: #e4641f;
  --accent-dark: #c14f13;
  --card: #ffffff;
  --shadow: 0 24px 60px rgba(25, 20, 19, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.site-footer {
  text-align: center;
  padding: 16px 20px 36px;
  color: var(--muted);
  font-size: 12px;
  margin-top: auto;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(25, 20, 19, 0.25);
}

.site-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.footer-main {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.footer-note {
  margin-top: 6px;
}

.title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 6px;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 18px 45px rgba(25, 20, 19, 0.08);
}

.card-title {
  font-weight: 600;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--muted);
}

.upload-zone {
  border: 2px dashed rgba(228, 100, 31, 0.35);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  background: rgba(228, 100, 31, 0.04);
}

.upload-zone.dragover {
  background: rgba(228, 100, 31, 0.12);
  border-color: var(--accent);
}

.upload-zone[hidden],
.result[hidden] {
  display: none !important;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.meta,
.status {
  font-size: 12px;
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(25, 20, 19, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, #f2a349 100%);
  transition: width 0.2s ease;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

input[type="text"],
select {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 14px;
  background: #ffffff;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.row.align-center {
  justify-content: center;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(228, 100, 31, 0.2);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}

.label {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  letter-spacing: 0.28em;
}

.qr-box {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.qr-box canvas,
.qr-box img {
  width: 160px;
  height: 160px;
}

.expire {
  font-size: 12px;
  color: var(--muted);
}

.preview {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fbfaf8;
}

.preview img,
.preview video,
.preview iframe {
  width: 100%;
  border-radius: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#scan-video {
  width: 100%;
  border-radius: 12px;
  background: #000000;
}