/* 相册（me.html）测试版加的：真的照片视频、随手拍入口、上传进度、写描述、剪视频。放在 photos.css 之后。
   样子跟原型 web/photos.css、ui.css 走。 */

/* 真的照片：格子里铺满，长按不弹「存储图像」 */
.ph img,
.gcard .cover img,
.mem-pic img,
.ask-pic img,
.trash .thumb img,
.vtile .vpic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.ph,
.gcard .cover,
.mem-pic,
.ask-pic,
.trash .thumb {
  position: relative;
  overflow: hidden;
  background: var(--soft);
}

.ph .st,
.ph .du,
.ph .lock-mark,
.ph .ck {
  z-index: 1;
}

.ask-pic {
  display: block;
}

/* 随手拍：一行，不抢「存照片」的位置（ADR-0155 第 2 条） */
.snap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper, #fffdf8);
  color: var(--ink);
}

.snap-row .icon {
  flex: none;
  width: 22px;
  height: 22px;
}

.snap-row .icon.go {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--muted);
}

.snap-row span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.snap-row b {
  font-size: 16px;
  font-weight: 600;
}

.snap-row small {
  color: var(--muted);
  font-size: 13px;
}

body.empty-album .snap-row {
  display: none;
}

/* 全屏看真的照片和视频：放在框里，不裁 */
.v-pic.real {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  background: none;
}

.v-pic.real img,
.v-pic.real video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  object-fit: contain;
  -webkit-touch-callout: none;
}

.v-pic.real img {
  pointer-events: none;
}

.v-pic.real.blank::after {
  content: "";
  width: 72%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.v-panel {
  max-height: 58dvh;
  overflow-y: auto;
}

.v-more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 14px;
  margin-top: -2px;
}

.v-more .link {
  min-height: 36px;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.v-main .note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.v-main {
  gap: 6px;
}

/* 存照片的弹层：三种各一句 */
.sheet-card .kinds-left {
  color: var(--muted);
  font-size: 13px;
}

/* 上传的进度：每个文件一条（ADR-0155 第 1 条） */
.up-list {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
}

.up-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.up-pic {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
}

.up-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.up-main {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.up-name {
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.up-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.up-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.2s;
}

.up-row.working .up-bar i {
  animation: up-busy 1.2s ease-in-out infinite;
}

.up-row.done .up-bar i {
  background: var(--green, #2f7d4f);
}

.up-row.failed .up-bar i {
  width: 100% !important;
  background: var(--red, #b3261e);
}

.up-state {
  color: var(--muted);
  font-size: 12px;
}

.up-row.failed .up-state {
  color: var(--red, #b3261e);
}

.up-row.done .up-state {
  color: var(--green, #2f7d4f);
}

@keyframes up-busy {
  50% { opacity: 0.35; }
}

.up-tray {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 65;
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 6px 24px rgba(26, 24, 20, 0.18);
}

.up-tray[hidden] {
  display: none;
}

.up-tray-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.up-tray-head .grow {
  flex: 1;
}

.up-tray-head button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

/* 写描述、谁能看（ADR-0155 第 2 条）：底部弹层，和原型的弹层一样 */
.sheet.composer {
  z-index: 75;
}

.sheet-card > strong:first-of-type {
  font-size: 19px;
  font-weight: 600;
}

.composer-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.composer-strip img {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.composer-count {
  justify-self: end;
  margin-top: -6px;
  font-size: 12px;
}

.sheet-card label.composer-switch {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-size: 16px;
}

.sheet-card .composer-switch input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 52px;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 150ms ease;
}

.sheet-card .composer-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 150ms ease;
}

.sheet-card .composer-switch input:checked {
  background: var(--ink);
}

.sheet-card .composer-switch input:checked::after {
  transform: translateX(20px);
}

.composer-place,
.sheet-card p.composer-place {
  margin-top: -6px;
  font-size: 13px;
}

.composer-label {
  font-size: 14px;
}

.sheet-card textarea {
  resize: vertical;
}

.composer-face {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.5;
}

.composer-face a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 超过时长的视频：选一段（ADR-0155 第 3 条） */
.trim-sheet {
  z-index: 80;
}

.trim-video {
  width: 100%;
  max-height: 38vh;
  border-radius: 14px;
  background: #000;
}

.trim-track {
  position: relative;
  height: 44px;
  margin: 6px 14px;
  border-radius: 10px;
  background: var(--soft);
  touch-action: none;
}

.trim-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 10px;
  background: rgba(26, 24, 20, 0.22);
}

.trim-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red, #b3261e);
  pointer-events: none;
}

.sheet-card button.trim-h {
  position: absolute;
  top: -4px;
  width: 28px;
  height: 52px;
  margin-left: -14px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fffdf8;
  touch-action: none;
  cursor: ew-resize;
}

.trim-len {
  text-align: center;
  font-size: 14px;
}

/* 私密相册：真的缩略图 */
.vtile .vpic {
  overflow: hidden;
}

.v-src .link[hidden] {
  display: none;
}
