* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #3c4043;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
}
button, a { font-family: inherit; }
.wrap {
  padding: 4px 8px 28px;
}
.sync {
  margin: 0 0 14px;
  color: #8b939c;
  font-size: 13px;
  line-height: 1.6;
}
.sync a {
  color: #1a5e8f;
  text-decoration: none;
}
.sync a:hover { text-decoration: underline; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 16px;
}
.album {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8eef3;
  border: 1px solid #e3e6ea;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
}
.name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.4;
  color: #3a3f44;
}
.date {
  flex: none;
  color: #9aa0a6;
  font-size: 13px;
}
.album:hover .cover,
.album:focus-visible .cover {
  border-color: #8eb4d6;
}
.album:focus-visible {
  outline: 2px solid #1a5e8f;
  outline-offset: 3px;
}
.state {
  padding: 28px 8px;
  color: #66707a;
  font-size: 15px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.back, .fb-link {
  color: #1a5e8f;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
}
.back { display: inline-block; margin: 0 0 10px; }
.album-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1a5e8f;
  line-height: 1.4;
}
.album-sub {
  margin: 4px 0 0;
  color: #8b939c;
  font-size: 13px;
}
.photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.photo {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid #e3e6ea;
  background: #e8eef3;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.9);
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  position: absolute;
  inset: 48px 64px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-out;
}
.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lightbox-nav, .lightbox-close {
  position: absolute;
  z-index: 2;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 64px;
  font-size: 32px;
  line-height: 1;
}
.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }
.lightbox-close {
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  font-size: 28px;
  line-height: 1;
}
@media (max-width: 980px) {
  .grid, .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid, .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox-stage { inset: 56px 12px; }
}
