:root {
  --ink: #1a1410;
  --muted: #6b5e54;
  --line: rgba(26, 20, 16, 0.12);
  --paper: rgba(255, 252, 247, 0.88);
  --accent: #e85d04;
  --accent-deep: #c2410c;
  --sky: #3d7ea6;
  --ok: #2f6b4f;
  --danger: #b42318;
  --radius: 20px;
  --shadow: 0 16px 40px rgba(26, 20, 16, 0.1);
  --font-display: "ZCOOL KuaiLe", "ZCOOL XiaoWei", cursive;
  --font-body: "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 0% -10%, #ffe0c2 0%, transparent 55%),
    radial-gradient(800px 420px at 100% 0%, #cfe8f5 0%, transparent 50%),
    linear-gradient(180deg, #fff7ef 0%, #f7f3ee 45%, #efeae4 100%);
}

.bg-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(232, 93, 4, 0.16) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  color: #fff;
  background: linear-gradient(145deg, #ff8a3d, var(--accent-deep));
  box-shadow: 0 10px 22px rgba(232, 93, 4, 0.28);
  transform: rotate(-6deg);
}
.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.brand-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { color: var(--accent-deep); }

main {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto 48px;
}

.hero {
  padding: 10px 4px 22px;
  animation: rise 0.5s ease both;
}
.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 400;
  letter-spacing: 0.03em;
}
.hero .lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 34em;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

button, .btn, label.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button:active, .btn:active { transform: translateY(1px); }
.primary {
  color: #fff;
  background: linear-gradient(180deg, #ff7a2f, var(--accent-deep));
  box-shadow: 0 10px 24px rgba(232, 93, 4, 0.28);
}
.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}
.ghost {
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid rgba(232, 93, 4, 0.28);
  padding: 8px 14px;
  font-size: 13px;
}
.ghost.tiny { padding: 6px 10px; font-size: 12px; }
.danger {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.18);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 20px;
  animation: rise 0.6s ease both;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.chip {
  font-size: 12px;
  color: var(--accent-deep);
  background: rgba(232, 93, 4, 0.1);
  border: 1px solid rgba(232, 93, 4, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.room-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .room-layout { grid-template-columns: 1fr; }
}

.qr-wrap {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
}
#qr {
  width: 220px;
  height: 220px;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
}
#qr img, #qr canvas {
  width: 100% !important;
  height: 100% !important;
}
.upload-link {
  word-break: break-all;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Album masonry-ish grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
@media (min-width: 700px) {
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}
.album-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #ebe4dc;
  border: 1px solid var(--line);
  cursor: pointer;
  animation: pop 0.35s ease both;
}
.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.album-card:hover img { transform: scale(1.04); }
.album-card .file-tile {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  background: linear-gradient(160deg, #fff8f1, #efe6dc);
}
.album-card .file-tile strong {
  font-size: 12px;
  word-break: break-all;
  line-height: 1.35;
}
.album-card .file-tile span {
  font-size: 11px;
  color: var(--muted);
}
.album-card .del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  opacity: 0.92;
}
.empty {
  color: var(--muted);
  padding: 36px 12px;
  text-align: center;
  font-size: 14px;
  grid-column: 1 / -1;
}

.upload-shell {
  width: min(720px, calc(100% - 20px));
  margin: 8px auto 72px;
}
.upload-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.upload-bar .meta {
  color: var(--muted);
  font-size: 13px;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.progress {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(232, 93, 4, 0.12);
  overflow: hidden;
  display: none;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8a3d, #c2410c);
  transition: width 0.2s ease;
}
.status {
  margin: 8px 0 0;
  min-height: 1.3em;
  font-size: 13px;
  color: var(--muted);
}
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 12, 10, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  object-fit: contain;
}
.lightbox .close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  width: auto;
  min-width: 132px;
  box-shadow: 0 14px 30px rgba(232, 93, 4, 0.35);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 30;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 16px 28px;
}
footer a { color: var(--accent-deep); text-decoration: none; }
