/* ============================================================
 * Kisara Album — 苹果风格液态玻璃 UI
 * 设计语言:iOS / macOS 风格
 *  - 液态玻璃(Liquid Glass):高模糊 + 饱和 + 顶部高光 + 柔和投影
 *  - 弹簧弹性动画(Spring):overshoot 曲线,卡片/按钮/弹窗都带“弹”
 *  - SF 字体、胶囊按钮、大圆角、克制配色
 * ============================================================ */

:root {
  /* 系统色 */
  --blue: #007aff;
  --blue-deep: #0a6be0;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #aeaeb2;
  --fill: rgba(255, 255, 255, 0.5);
  --fill-strong: rgba(255, 255, 255, 0.78);
  --separator: rgba(60, 60, 67, 0.18);

  /* 天空背景(柔和,衬托玻璃) */
  --sky-1: #ddeafc;
  --sky-2: #cfe0fb;
  --sky-3: #f3f6ff;
  --cloud: rgba(255, 255, 255, 0.92);

  /* 弹簧 / 缓动 */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --shadow-glass: 0 24px 70px rgba(30, 60, 110, 0.18), 0 4px 16px rgba(30, 60, 110, 0.08);
  --shadow-card: 0 10px 30px rgba(30, 60, 110, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--label);
  min-height: 100vh;
  background: var(--sky-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* ---------- 柔和流动的天空 ---------- */
.sky-bg {
  position: fixed; inset: 0; z-index: -4;
  background: linear-gradient(165deg, var(--sky-1) 0%, var(--sky-2) 40%, var(--sky-3) 72%, var(--sky-2) 100%);
  background-size: 220% 220%;
  animation: skyFlow 36s ease-in-out infinite;
}
@keyframes skyFlow {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

.sun-glow {
  position: fixed; z-index: -3; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 244, 224, 0.35) 45%, transparent 72%);
  width: 62vmax; height: 62vmax;
  right: -20vmax; top: -24vmax;
  pointer-events: none;
}


/* 背景柔光斑(让液态玻璃有内容可“折射”) */
.bg-blob { position: fixed; z-index: -2; border-radius: 50%; pointer-events: none; filter: blur(70px); opacity: 0.55; }
.bg-blob-blue  { width: 42vmax; height: 42vmax; left: -12vmax; top: -8vmax;  background: radial-gradient(circle, #7db7f7, transparent 65%); }
.bg-blob-center{ width: 30vmax; height: 30vmax; left: 50%; top: 46%; transform: translate(-50%, -50%); background: radial-gradient(circle, #8faef2, #b7a6f0 55%, transparent 72%); opacity: 0.5; animation: none; }
.bg-blob-purple{ width: 38vmax; height: 38vmax; right: -10vmax; top: 24vh;   background: radial-gradient(circle, #c3a6f5, transparent 65%); }
.bg-blob-pink  { width: 34vmax; height: 34vmax; left: 24vw; bottom: -14vmax; background: radial-gradient(circle, #f5b7c9, transparent 65%); }
.bg-blob { animation: blobFloat 30s ease-in-out infinite alternate; }
.bg-blob-purple { animation-delay: -10s; animation-duration: 36s; }
.bg-blob-pink { animation-delay: -20s; animation-duration: 26s; }
@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(5vw, -4vh) scale(1.12); }
  100% { transform: translate(-3vw, 3vh) scale(0.95); }
}

/* ---------- 飘云 ---------- */
.cloud { position: fixed; z-index: -2; pointer-events: none; animation: cloudDrift linear infinite; }
.cloud svg { display: block; filter: drop-shadow(0 6px 18px rgba(90, 130, 190, 0.18)); }
.cloud-1 { left: -12%; top: 8%;  animation-duration: 72s; }
.cloud-2 { left: 58%;  top: 15%; animation-duration: 96s; opacity: 0.65; transform: scale(0.82); }
.cloud-3 { left: 22%;  top: 60%; animation-duration: 120s; opacity: 0.5; transform: scale(1.12); }
@keyframes cloudDrift {
  from { transform: translateX(-8vw); }
  to   { transform: translateX(108vw); }
}

/* ---------- 细雨画布 ---------- */
#rain { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ============================================================
 * 液态玻璃
 * ============================================================ */
.glass {
  position: relative;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.55) 40%, rgba(255, 255, 255, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3),
    inset 1px 0 0 rgba(255, 255, 255, 0.45),
    inset -1px 0 0 rgba(255, 255, 255, 0.45),
    var(--shadow-glass);
}
/* 玻璃顶部高光 */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.1) 30%, rgba(255, 255, 255, 0.28) 62%, rgba(255, 255, 255, 0.5) 100%);
  opacity: 0.8; pointer-events: none;
}
.glass > * { position: relative; z-index: 1; }

/* ============================================================
 * 登录页
 * ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

.login-card {
  width: min(400px, 94vw);
  padding: 42px 38px 36px;
  text-align: center;
  border-radius: var(--radius-lg);
  animation: cardIn 0.9s var(--spring) both;
}
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(46px) scale(0.94); }
  55%  { transform: translateY(-6px) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-mark { width: 76px; height: 56px; margin: 0 auto 8px; display: block; }

.login-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--label);
}
.login-sub {
  margin-top: 8px;
  color: var(--label-2);
  font-size: 13.5px;
  letter-spacing: 0.5px;
}
.login-divider { height: 1px; margin: 26px 0; background: var(--separator); }

.pw-label {
  display: block; text-align: left;
  font-size: 13px; font-weight: 500; color: var(--label-2); margin-bottom: 8px; letter-spacing: 0.3px;
}
.pw-box { position: relative; }
.pw-box input {
  width: 100%;
  padding: 14px 46px 14px 16px;
  font-size: 16px; letter-spacing: 4px; color: var(--label);
  font-family: inherit;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  outline: none;
  transition: box-shadow 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--spring);
}
.pw-box input:focus {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
  transform: scale(1.01);
}
.pw-box input::placeholder { color: #c4c4cc; letter-spacing: 1px; }
.pw-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.5;
  transition: opacity 0.2s;
}
.pw-eye:hover { opacity: 0.9; }

.pw-error {
  min-height: 20px; margin-top: 10px;
  font-size: 13px; color: #ff3b30; letter-spacing: 0.3px;
  opacity: 0; transition: opacity 0.3s;
}
.pw-error.show { opacity: 1; }

/* 苹果式胶囊主按钮 */
.btn-primary {
  width: 100%; margin-top: 6px;
  padding: 14px;
  font-size: 16px; font-weight: 600; letter-spacing: 4px; color: #fff;
  font-family: inherit;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #3b9bff, var(--blue));
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease), filter 0.3s;
}
.btn-primary:hover { filter: brightness(1.05); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.97); box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25); }
.btn-primary.loading { opacity: 0.7; pointer-events: none; }

.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--label-3); letter-spacing: 0.5px; }

.shake { animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(5px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ============================================================
 * 相册页
 * ============================================================ */
.album-page { min-height: 100vh; position: relative; }

/* ---------- 液态玻璃导航 ---------- */
.nav {
  position: sticky; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 60;
  margin: calc(10px + env(safe-area-inset-top, 0px)) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), var(--shadow-card);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 700; letter-spacing: 0.5px; color: var(--label); }
.nav-brand .mini-mark { width: 26px; height: 20px; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-count { font-size: 12px; color: var(--label-2); background: rgba(255,255,255,0.7); border: 1px solid var(--separator); padding: 5px 12px; border-radius: 999px; }
.btn-logout {
  font-size: 13px; color: var(--blue);
  background: none; border: none; border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
  transition: background 0.2s, transform 0.3s var(--spring);
}
.btn-logout:hover { background: rgba(0, 122, 255, 0.1); transform: scale(1.04); }
.btn-logout:active { transform: scale(0.95); }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 64px 24px 88px; overflow: hidden; }
.hero h1 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 800; letter-spacing: 0.5px; color: var(--label); }
.hero .sub { margin-top: 12px; color: var(--label-2); font-size: clamp(13px, 2vw, 15px); letter-spacing: 0.5px; }
.hero .count-line { margin-top: 14px; font-size: 13px; color: var(--label-3); letter-spacing: 0.5px; }

/* ---------- 轻波浪 ---------- */
.wave-box { position: relative; margin-top: -58px; }
.wave { display: block; width: 200%; height: 64px; }
.wave path { fill: rgba(255, 255, 255, 0.5); }
.wave-1 { animation: waveMove 18s linear infinite; }
.wave-2 { position: absolute; left: -100%; top: 0; animation: waveMove 26s linear infinite reverse; opacity: 0.55; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 播放回忆按钮 ---------- */
.btn-play {
  margin-top: 22px;
  padding: 13px 30px;
  font-size: 15px; font-weight: 600; letter-spacing: 2px; color: #fff;
  font-family: inherit;
  background: linear-gradient(180deg, #3b9bff, var(--blue));
  border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease), filter 0.3s;
}
.btn-play:hover { filter: brightness(1.05); transform: scale(1.05); }
.btn-play:active { transform: scale(0.96); }

/* ---------- 回忆网格 ---------- */
.memory-grid {
  column-count: 3;
  column-gap: 14px;
  padding: 22px 26px 34px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 1024px) { .memory-grid { column-count: 2; } }
@media (max-width: 620px)  { .memory-grid { column-count: 2; column-gap: 8px; padding: 14px 12px 24px; } }

.m-card {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(30, 60, 110, 0.12);
  animation: cardPop 0.55s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease);
}
@keyframes cardPop {
  0%   { opacity: 0; transform: translateY(22px) scale(0.94); }
  60%  { transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.m-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 18px 40px rgba(30, 60, 110, 0.2); }
.m-card:active { transform: scale(0.98); }

.m-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.m-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.m-card:hover .m-cover img { transform: scale(1.06); }

.m-date {
  position: absolute; left: 10px; bottom: 10px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 500; color: #fff; letter-spacing: 0.5px;
  background: rgba(20, 30, 50, 0.6);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ============================================================
 * 全屏回忆播放器(iOS 回忆风格)
 * ============================================================ */
.player {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  background: #000;
}
.player.open { display: block; animation: fadeIn 0.35s var(--ease) both; }

/* 舞台 */
.pl-stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.pl-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 74%, rgba(0, 0, 0, 0.5) 100%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.28) 100%);
}
.pl-layer { position: absolute; inset: -5%; z-index: 1; opacity: 0; }
.pl-layer.in  { opacity: 1; z-index: 2; animation: fadeIn 1.1s ease both; }
.pl-layer.out { opacity: 0; z-index: 1; animation: fadeOut 1.1s ease both; }
.pl-img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }

/* Ken Burns 运镜 */
.kb-a { animation: kbA var(--kb-ms, 14s) ease-out both; }
.kb-b { animation: kbB var(--kb-ms, 14s) ease-out both; }
@keyframes kbA {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.15) translate(-2.2%, -1.5%); }
}
@keyframes kbB {
  from { transform: scale(1.15) translate(2.2%, 1.5%); }
  to   { transform: scale(1) translate(0, 0); }
}

/* 顶部栏 */
.player-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 18px;
}
.pl-brand { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,0.4); }
.pl-counter { font-size: 13px; color: rgba(255,255,255,0.85); letter-spacing: 1px; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.pl-close {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; color: #fff;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer; transition: transform 0.3s var(--spring), background 0.2s;
}
.pl-close:hover { background: rgba(255,255,255,0.32); transform: scale(1.08); }
.pl-close:active { transform: scale(0.92); }

/* 日期 */
.pl-date {
  position: absolute; top: calc(74px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 10;
  padding: 7px 18px;
  font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 1px;
  background: rgba(20, 30, 50, 0.5);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* 前后切换 */
.pl-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px; color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer; transition: transform 0.3s var(--spring), background 0.2s;
}
.pl-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.08); }
.pl-btn:active { transform: translateY(-50%) scale(0.94); }
.pl-prev { left: 22px; }
.pl-next { right: 22px; }
@media (max-width: 620px) {
  .pl-btn { width: 42px; height: 42px; font-size: 20px; }
  .pl-prev { left: 10px; } .pl-next { right: 10px; }
}

/* 底部:胶片条 + 控制 */
.pl-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 0 20px calc(18px + env(safe-area-inset-bottom, 0px));
}
.pl-film {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto; padding: 10px 4px;
  scrollbar-width: none;
}
.pl-film::-webkit-scrollbar { display: none; }
.film-thumb {
  flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 10px;
  overflow: hidden; padding: 0; cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.65;
  transition: transform 0.3s var(--spring), opacity 0.2s, border-color 0.2s;
}
.film-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film-thumb:hover { opacity: 1; transform: scale(1.06); }
.film-thumb.active { opacity: 1; border-color: #fff; transform: scale(1.1); }
@media (max-width: 620px) { .film-thumb { width: 52px; height: 52px; } }

.pl-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.pl-pp {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; color: #fff;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer; transition: transform 0.3s var(--spring), background 0.2s;
}
.pl-pp:hover { background: rgba(255,255,255,0.34); transform: scale(1.08); }
.pl-pp:active { transform: scale(0.94); }
.pl-hint { font-size: 12px; color: rgba(255,255,255,0.6); letter-spacing: 1px; }
@media (max-width: 620px) { .pl-hint { display: none; } }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 34px 20px 40px; color: var(--label-3); font-size: 13px; letter-spacing: 0.5px; }

.empty { text-align: center; padding: 70px 20px; color: var(--label-2); font-size: 15px; letter-spacing: 0.5px; }
.empty .big { font-size: 40px; margin-bottom: 12px; }

.reveal { animation: cardPop 0.7s var(--spring) both; }

@media (max-width: 620px) {
  .nav { margin: calc(8px + env(safe-area-inset-top, 0px)) 10px 0; padding: 10px 14px; }
  .hero { padding: 48px 16px 76px; }
  .memory-grid { padding: 14px 12px 24px; column-gap: 8px; }
}

@media (max-width: 380px) {
  .nav-count { display: none; }
  .login-title { font-size: 23px; }
  .login-card { padding: 34px 26px 30px; }
}

/* 移动端触摸优化 */
button, .m-card, .film-thumb { touch-action: manipulation; }
