/* stories.css — 朋友的今天故事查看器（.st-*）：进度条、全幅画面（照片加载中转圈）、立方体翻转、回复栏、我的故事（看过的人 / 删除） */

/* 故事永远是"暗房"：画面在照片上，文字统一白色，不随浅/深色变化 */
.st-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  outline: none;
  color: #FFFFFF;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.st-layer.is-closing { pointer-events: none; }
.st-layer :focus-visible { outline-color: #FFFFFF; }

.st-scrim { position: absolute; inset: 0; background: #0E0D0C; }

.st-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 0 0;
  background: #0E0D0C;
  touch-action: none;
  will-change: transform;
}
.st-cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.st-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #1A1816;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.st-layer.is-turning .st-face { pointer-events: none; }

/* ---------- 画面 ---------- */
.st-media, .st-slide { position: absolute; inset: 0; }
.st-slide { opacity: 0; transition: opacity 140ms linear; }
.st-slide.is-on { opacity: 1; }
.st-img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.04);
  pointer-events: none;
  -webkit-user-drag: none;
}
/* 比画面宽得多的真实照片（横拍、3:4 竖拍）：整张放下，下面垫同一张图的模糊放大做底 */
.st-bg {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: blur(26px) brightness(.62) saturate(1.15);
  transform: scale(1.18);
  pointer-events: none;
  -webkit-user-drag: none;
}
.st-slide.is-fit .st-bg { display: block; }
.st-slide.is-fit .st-img { object-fit: contain; transform: none; }
.st-slide.is-loading .st-bg { opacity: 0; }
/* 照片还没下载好：转圈（进度条同时停住） */
.st-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .22);
  border-top-color: rgba(255, 255, 255, .9);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
  pointer-events: none;
}
.st-slide.is-loading .st-spin { opacity: 1; animation: st-spin .9s linear infinite; }
.st-slide.is-loading .st-img { opacity: 0; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-slide.is-text {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-soft);
}
.st-slide-char {
  font-family: var(--font-char);
  font-size: 280px;
  line-height: 1;
  color: var(--c-wm);
  opacity: .22;
  transform: translateY(-6%);
}
.st-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .44) 0%, rgba(0, 0, 0, .12) 14%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .16) 56%, rgba(0, 0, 0, .5) 74%, rgba(0, 0, 0, .74) 100%);
}
.st-shade::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.st-layer.is-typing .st-face.is-current .st-shade::after { opacity: 1; }

/* ---------- 点按区：左 32% 上一张，右 68% 下一张 ---------- */
.st-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  border-radius: 0;
  touch-action: none;
}
.st-nav-prev { left: 0; width: 32%; }
.st-nav-next { right: 0; width: 68%; }
.st-nav:focus-visible { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -8px; border-radius: 20px; }
.st-nav::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: solid rgba(255, 255, 255, .9);
  border-width: 0 0 2.2px 2.2px;
  border-radius: 1px;
  opacity: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35));
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.st-nav-prev::after { left: 18px; transform: rotate(45deg) translate(4px, -4px); }
.st-nav-next::after { right: 18px; transform: rotate(-135deg) translate(4px, -4px); }
@media (hover: hover) and (pointer: fine) {
  .st-nav:hover::after { opacity: .85; }
  .st-nav-prev:hover::after { transform: rotate(45deg); }
  .st-nav-next:hover::after { transform: rotate(-135deg); }
  .st-layer.is-holding .st-nav::after, .st-layer.is-turning .st-nav::after { opacity: 0; }
}

/* ---------- 一句话（楷书大字） ---------- */
.st-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 96px;
  z-index: 3;
  font-family: var(--font-char);
  font-size: 34px;
  line-height: 1.32;
  letter-spacing: 1px;
  color: #FFFFFF;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  text-wrap: balance;
  overflow-wrap: anywhere;
  pointer-events: none;
}

/* ---------- 顶部：分段进度 + 头部 ---------- */
.st-chrome { transition: opacity var(--dur-2) var(--ease-out); }
.st-layer.is-holding .st-chrome,
.st-layer.is-pulling .st-chrome { opacity: 0; }
.st-layer.is-holding .st-chrome { pointer-events: none; }

.st-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  padding: 10px 10px 0;
  pointer-events: none;
}
.st-bars { display: flex; gap: 4px; padding: 0 2px; }
.st-bar {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .34);
  overflow: hidden;
}
.st-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #FFFFFF;
  transform: scaleX(0);
  transform-origin: left center;
}
.st-head { display: flex; align-items: center; gap: 10px; padding: 8px 0 0 4px; }
.st-ava {
  flex: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--c-soft);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.st-ava > .ui-char { --size: 26px; color: var(--c-wm); }
.st-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.st-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-time { font-size: 12px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; }
.st-close { pointer-events: auto; color: #FFFFFF; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .3)); }
.st-close:hover { background: rgba(255, 255, 255, .14); }

/* 键盘空格暂停的提示 */
.st-paused {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px 9px 13px;
  border-radius: 999px;
  background: rgba(14, 13, 12, .5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring);
  pointer-events: none;
}
.st-layer.is-kpause .st-face.is-current .st-paused { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 底部回复栏 ---------- */
.st-reply {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 16px 14px;
}
.st-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 23px;
  background: rgba(14, 13, 12, .18);
  color: #FFFFFF;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color var(--dur-2), background-color var(--dur-2);
}
.st-input::placeholder { color: rgba(255, 255, 255, .8); }
.st-input:focus { border-color: #FFFFFF; background: rgba(14, 13, 12, .34); }
.st-input:focus-visible { outline: none; }
.st-acts { position: relative; flex: none; width: 46px; height: 46px; }
.st-heart, .st-send {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #FFFFFF;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring), background-color var(--dur-2);
}
.st-heart { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .3)); }
.st-heart:hover { background: rgba(255, 255, 255, .12); }
.st-heart:active { transform: scale(.88); }
.st-send {
  background: var(--c-deep);
  color: var(--c-on-deep);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: scale(.4) rotate(-30deg);
  pointer-events: none;
}
.st-reply.has-text .st-send { opacity: 1; transform: none; pointer-events: auto; }
.st-reply.has-text .st-send:active { transform: scale(.92); }
.st-reply.has-text .st-heart { opacity: 0; transform: scale(.4); pointer-events: none; }

/* 我的故事：左边「已有 N 人看过」（点开看是谁），右边「删除这条」 */
.st-mine { justify-content: space-between; gap: 12px; padding-left: 12px; }
.st-viewers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px 0 6px;
  border-radius: 22px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
  transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
.st-viewers-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-viewers-go { opacity: .7; }
@media (hover: hover) { .st-viewers:not(.is-empty):hover { background: rgba(255, 255, 255, .12); } }
.st-viewers:not(.is-empty):active { transform: scale(.96); }
.st-viewers.is-empty { cursor: default; color: rgba(255, 255, 255, .82); }
.st-viewers.is-empty .st-viewers-go { display: none; }
.st-viewers-chars { display: inline-flex; flex: none; }
.st-viewers-chars:empty { display: none; }
.st-vchar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--c-soft);
  box-shadow: 0 0 0 2px rgba(14, 13, 12, .55);
}
.st-vchar + .st-vchar { margin-left: -8px; }
.st-vchar .ui-char { --size: 19px; color: var(--c-deep); line-height: 1; text-shadow: none; }
.st-del {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px 0 13px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  color: #1F1D1A;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-2);
}
.st-del:active { transform: scale(.96); }
.st-del:disabled { opacity: .5; }
.st-del .ui-ico { color: #B3261E; }

/* 看过的朋友（底部弹窗，跟随浅/深色） */
.st-vlist { display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 12px; list-style: none; }
.st-vrow { display: flex; align-items: center; gap: 12px; }
.st-vname { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.st-vuser { font-size: 12px; font-weight: 400; color: var(--muted); }

/* 发出去的字往上飘 */
.st-fly {
  position: absolute;
  z-index: 6;
  height: 22px;
  max-width: 70%;
  font-size: 15px;
  line-height: 22px;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
  pointer-events: none;
}

/* ---------- 飘心 / 立方体阴影 ---------- */
.st-hearts { position: absolute; inset: 0; z-index: 6; overflow: hidden; pointer-events: none; }
.st-fheart { position: absolute; left: 0; top: 0; display: block; will-change: transform, opacity; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .22)); }
.st-fheart > svg { display: block; width: 100%; height: 100%; }
.st-dim { position: absolute; inset: 0; z-index: 7; background: #000000; opacity: 0; pointer-events: none; }

/* 矮屏：一句话和回复栏收紧 */
@media (max-height: 640px) {
  .st-caption { font-size: 28px; bottom: 84px; }
}
