* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #fff5f5;
  color: #4a2b2b;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 247, 245, 0.52), rgba(255, 252, 250, 0.68)),
    url('/img/wedding-bg.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 26px; margin: 60px 0 8px; text-align: center; }
.subtitle { text-align: center; color: #8a6a6a; margin: 4px 0 16px; }
.hint { font-size: 13px; color: #a08080; background: #fff7f2; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.primary, .secondary {
  display: block; width: 100%; padding: 14px; font-size: 17px; border: none;
  border-radius: 12px; cursor: pointer;
}
.primary {
  animation: fade-in 0.3s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.primary { background: #e07a6a; color: #fff; }
.primary:active { background: #c96658; }
.secondary { background: #f3e4df; color: #7a4a42; margin-top: 12px; }
#file-list { list-style: none; padding: 0; margin: 18px 0 0; }
#file-list.grid { margin-bottom: 20px; }
#upload-btn { margin-top: 20px; }
#file-list li {
  display: grid; grid-template-columns: 56px 1fr auto auto; gap: 8px; align-items: center;
  background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(74, 43, 43, 0.08);
}
#file-list img.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #eee; }
#file-list .name { font-size: 13px; word-break: break-all; }
#file-list .meta { font-size: 12px; color: #a08080; }
#view-toggle {
  display: flex; gap: 8px; justify-content: center; margin: 16px 0 4px;
}
.view-btn {
  border: 1px solid #e0b9ae; background: #fff; color: #7a4a42;
  font-size: 13px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
}
.view-btn.active { background: #e07a6a; border-color: #e07a6a; color: #fff; }

#file-list.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
#file-list.grid li {
  display: block;
  position: relative;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 1;
}
#file-list.grid li .thumb {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
#file-list.grid li > div,
#file-list.grid li > span.badge {
  display: none;
}
#file-list.grid li .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
}
#file-list.grid li.item-done::after {
  content: '✓';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3f7a3f;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge { font-size: 12px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.preparing { background: #f0e8e0; color: #8a6a5a; }
.badge.ready { background: #e8f0ea; color: #4a7a5a; }
.badge.uploading, .badge.retrying { background: #e8eef7; color: #4a6a8a; }
.badge.done { background: #e4f5e4; color: #3f7a3f; }
.badge.failed { background: #f9e2e0; color: #a04040; }
.remove-btn {
  border: none; background: #f3e4df; color: #7a4a42;
  font-size: 12px; padding: 5px 8px; border-radius: 8px; cursor: pointer;
}
.remove-btn:active { background: #e8d0c8; }
.status { text-align: center; color: #7a5a5a; margin-top: 16px; font-size: 15px; }
.status.success { color: #3f7a3f; font-weight: 600; }
