/* 相册（photos.html）。放在 home.css、ui.css 之后。 */

@media (min-width: 800px) {
  main.wide {
    width: min(100%, 760px);
  }
}

body.viewing {
  overflow: hidden;
}

body.selecting main,
body.docked main {
  padding-bottom: 120px;
}

/* 假照片：底色加一个柔和的人像轮廓 */
.shot {
  --t: #c9d3c3;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 252, 247, 0.85) 0 15%, transparent 15.6%),
    radial-gradient(ellipse 42% 30% at 50% 100%, rgba(255, 252, 247, 0.6) 0 98%, transparent 100%),
    var(--t);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 现在在哪里 */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  color: var(--muted);
  font-size: 15px;
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #cfc6b6;
  text-underline-offset: 4px;
}

.crumbs + h1,
.crumbs + .title-row h1 {
  margin-top: 0;
}

/* 标题右边的小锁：打开私密相册，可以在「我 → 隐私」里藏起来 */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vault-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 4px -8px 14px 0;
  border-radius: 50%;
  color: var(--muted);
}

.vault-btn .icon {
  width: 20px;
  height: 20px;
}

.vault-btn:active {
  background: var(--soft);
}

.photos-memory {
  margin: 16px 0 0;
}

.photos-memory .memory {
  position: relative;
  height: 168px;
  padding: 16px;
}

.memory .mem-pic {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(255, 252, 247, 0.7);
}

/* 「那年今天 · N 年前」放在小图下面，不被小图盖住 */
.photos-memory .memory-kind {
  margin-top: 20px;
}

.photos-memory .memory:only-child .memory-kind {
  margin-top: 6px;
}

.memory .memory-year {
  font-size: 28px;
}

.memory .memory-title {
  font-size: 17px;
}

.memory .memory-text {
  margin-top: 2px;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--soft);
}

.notice p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.notice .btn {
  align-self: flex-start;
}

.notice-row {
  display: flex;
  gap: 8px;
}

/* 存照片：三种各一句 */
.sheet-card p.kinds {
  color: var(--ink);
  font-size: 15px;
}

.sheet-card .hint {
  margin: 0;
}

.hint.center {
  text-align: center;
}

/* 不是本机拍的：先看一眼是哪张 */
.ask-pic {
  justify-self: center;
  width: 88px;
  height: 88px;
  border-radius: 14px;
}

.btn.two-line {
  flex-direction: column;
  gap: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}

.btn.two-line small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

/* 搜索、按年按月、筛选 */
.tools {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 年、月里面没有「按年 按月 全部」，筛选放在搜索框右边 */
.tools.inner {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.tools.inner .tool-row {
  display: contents;
}

.tool-row .chips {
  flex-wrap: nowrap;
}

.filter-btn {
  margin-left: auto;
}

@media (max-width: 359px) {
  .tool-row .chips button,
  .filter-btn {
    padding: 0 11px;
  }
}

/* AI 分好的类：一行，左右滑 */
.ai-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.ai-head b {
  color: var(--ink);
  font-weight: 600;
}

.ai-head .link {
  min-height: 36px;
  font-size: 14px;
}

.ai-chips {
  flex-wrap: nowrap;
  margin: 0 -20px;
  padding: 0 20px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-chips::-webkit-scrollbar {
  display: none;
}

.ai-chips button {
  flex: none;
}

.ai-chips small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ai-chips button.on small {
  color: rgba(255, 255, 255, 0.7);
}

.btn.small.on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* 区块标题，右边放「多选」「看全部」 */
.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 8px;
}

.sec h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.sec h2.note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.sec-actions {
  display: flex;
  gap: 8px;
}

.link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.link.strong {
  color: var(--ink);
  font-weight: 600;
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 照片格里的一张 */
.ph {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease;
}

.ph:active {
  transform: scale(0.97);
}

.ph.fresh {
  animation: rise 360ms ease;
}

.ph .lock-mark {
  display: grid;
  place-items: center;
  left: 5px;
  bottom: 5px;
}

.ph .lock-mark .icon,
.v-tags .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.ph .lock-mark .icon {
  stroke: #fff;
}

.ph .du {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: rgba(26, 24, 20, 0.5);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.ph .du .icon {
  width: 10px;
  height: 10px;
  fill: #fff;
  stroke: none;
}

.ph .st {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  color: var(--ink);
  font-size: 11px;
  line-height: 18px;
}

.ph .st.wait {
  color: var(--gold);
}

.ph .ck {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(26, 24, 20, 0.2);
}

.ph .ck .icon {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 2.6;
  opacity: 0;
}

.ph.sel {
  box-shadow: inset 0 0 0 3px var(--ink);
}

.ph.sel .ck {
  border-color: var(--ink);
  background: var(--ink);
}

.ph.sel .ck .icon {
  opacity: 1;
}

/* 最近：窄屏 9 张，宽屏 10 张 */
.recent > :nth-child(n + 10) {
  display: none;
}

@media (min-width: 640px) {
  .recent > :nth-child(10) {
    display: block;
  }

  main.wide .cards {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 年、月卡片 */
.gcard {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease;
}

.gcard:active {
  transform: scale(0.97);
}

.gcard .cover {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 14px;
}

.gcard b {
  font-size: 17px;
  font-weight: 600;
}

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

.yh {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.sec + .yh {
  margin-top: 8px;
}

.more {
  margin-top: 16px;
}

.empty.me {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.empty.me .avatar {
  width: 64px;
  height: 64px;
}

.empty .btn {
  margin-top: 12px;
}

/* 拇指够得着的地方放主按钮 */
.dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(243, 239, 230, 0), var(--bg) 28%);
}

.dock .btn {
  display: flex;
  width: min(100%, 380px);
  margin: 0 auto;
}

.bar-in {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 420px);
}

.bar-n {
  flex: 1;
  font-size: 15px;
}

.demo-links {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.demo-links a {
  display: inline-block;
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-links + .demo {
  margin-top: 8px;
}

/* 底部弹层里的小组 */
.fgroup {
  display: grid;
  gap: 8px;
}

.fname {
  font-size: 14px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.two label {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.two input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
}

.sheet-card .rows {
  max-height: 52dvh;
  overflow: auto;
}

.trash .row {
  gap: 12px;
  padding-right: 12px;
}

.trash .thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.trash .row-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.trash .row-name b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

/* 全屏查看：上面是照片，下面纸色面板放说明和按钮 */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #14120f;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.v-top {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 0 12px;
}

.v-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 0 16px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
}

.v-count {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.v-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: calc(64px + env(safe-area-inset-top)) 16px 16px;
  overflow: hidden;
  container-type: size;
  touch-action: none;
}

.v-pic {
  position: relative;
  width: min(calc(100vw - 32px), 40vh);
  width: min(100cqw, 100cqh * 0.75);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 16px;
  transition: transform 150ms ease;
}

.v-stage.mz-on .v-pic,
.v-pic.mz-zoomed,
.v-pic img.mz-zoomed,
.v-pic video.mz-zoomed {
  transition: none;
  will-change: transform;
}

.v-pic.dragging {
  transition: none;
}

.v-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 24, 20, 0.45);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.v-play .icon {
  width: 30px;
  height: 30px;
  fill: #fff;
  stroke: none;
}

.v-pic.started:not(.paused) .v-play {
  opacity: 0;
}

.v-dur {
  position: absolute;
  right: 10px;
  bottom: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26, 24, 20, 0.5);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.v-prog {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
}

.v-prog i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.v-pic.started .v-prog i {
  animation: grow var(--secs) linear forwards;
}

.v-pic.paused .v-prog i {
  animation-play-state: paused;
}

@keyframes grow {
  to { width: 100%; }
}

.v-arrow {
  position: absolute;
  top: calc(50% + 24px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 24, 20, 0.5);
  color: #fff;
  transform: translateY(-50%);
  cursor: pointer;
}

.v-arrow.prev { left: 6px; }
.v-arrow.next { right: 6px; }

.v-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (min-width: 600px) {
  .v-arrow.prev { left: calc(50% - 280px); }
  .v-arrow.next { right: calc(50% - 280px); }
}

.v-panel {
  display: grid;
  gap: 8px;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  color: var(--ink);
}

.v-panel p {
  margin: 0;
}

.v-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.v-name.none {
  color: var(--muted);
  font-weight: 400;
}

.v-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 算哪一种：本机拍的、纪念照、外来的 */
.v-src {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.v-src .link {
  min-height: 32px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.v-nopush {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
}

.v-memo {
  font-size: 15px;
  line-height: 1.5;
}

.v-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v-main {
  display: grid;
  margin-top: 4px;
}

.v-row {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 8px;
}

.v-row .btn {
  padding: 0 10px;
}

/* 隐私的：轻轻问一句，不自动搬 */
.v-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  background: var(--soft);
}

.v-ask p {
  flex: 1;
  font-size: 15px;
}

.v-priv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  cursor: pointer;
}

.v-priv-name {
  display: grid;
  gap: 2px;
  font-size: 16px;
}

.v-priv-name small {
  color: var(--muted);
  font-size: 13px;
}

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

.v-priv .switch::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;
}

.v-priv .switch:checked {
  background: var(--ink);
}

.v-priv .switch:checked::after {
  transform: translateX(20px);
}

.v-priv .switch:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 多选条里三个按钮，窄屏挤一挤 */
@media (max-width: 420px) {
  .bar-in .btn {
    padding: 0 12px;
    font-size: 15px;
  }
}

/* 私密相册 */
.vault-shut {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 40px 0 8px;
  text-align: center;
}

.vault-shut p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.vault-shut .btn {
  width: min(100%, 320px);
}

.vault-shut-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--soft);
}

.vault-shut-icon .icon {
  width: 30px;
  height: 30px;
}

.vault-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
}

.vault-tools .chips {
  flex-wrap: nowrap;
}

.vault-empty {
  margin-top: 24px;
}

.vtile {
  overflow: hidden;
  background: var(--soft);
}

.vtile .vpic {
  position: absolute;
  inset: 0;
  transition: filter 200ms ease, transform 200ms ease;
}

.vtile.blur .vpic {
  filter: blur(9px) saturate(0.6);
  transform: scale(1.25);
}

.trash .thumb.blurred {
  filter: blur(4px) saturate(0.6);
}

.vault-honest {
  margin: 32px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.vault-honest + .demo {
  margin-top: 12px;
}
