/* ============================================================
   Lumen · 光影相册
   设计语言：Apple Minimalist
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #fafafc;
  --surface-3: #ececee;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --ink-4: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.04);
  --accent: #0071e3;
  --accent-2: #0a84ff;
  --accent-press: #0058b9;
  --danger: #ff3b30;
  --danger-press: #d70015;
  --success: #34c759;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.10), 0 8px 20px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 40px 90px rgba(0, 0, 0, 0.16), 0 12px 30px rgba(0, 0, 0, 0.08);

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --radius-xl: 28px;
  --radius-2xl: 36px;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --maxw: 1180px;
  --topbar-h: 64px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

::selection { background: rgba(0, 113, 227, 0.18); color: var(--ink); }

/* ---------- 启动闪屏 ---------- */
.splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 9999;
  animation: splashFade 0.6s var(--ease-out) 1.5s forwards;
}
.splash-mark {
  animation: splashPop 0.9s var(--ease-spring) both;
  filter: drop-shadow(0 12px 30px rgba(0, 113, 227, 0.35));
}
.splash-word {
  margin-top: 18px;
  font-size: 22px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink);
  animation: splashWord 0.8s var(--ease-out) 0.2s both;
}
@keyframes splashFade { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes splashPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes splashWord {
  0% { transform: translateY(8px); opacity: 0; letter-spacing: 0.2em; }
  100% { transform: translateY(0); opacity: 1; letter-spacing: 0.02em; }
}

/* ---------- 品牌标识 ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand-sm .brand-name { font-size: 17px; }

/* ---------- 按钮 ---------- */
.btn-primary {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease-spring), background 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 113, 227, 0.34); }
.btn-primary:active { background: var(--accent-press); transform: translateY(0) scale(0.98); box-shadow: 0 4px 10px rgba(0, 113, 227, 0.22); }
.btn-primary.danger { background: var(--danger); box-shadow: 0 6px 18px rgba(255, 59, 48, 0.28); }
.btn-primary.danger:hover { background: #ff5147; box-shadow: 0 10px 24px rgba(255, 59, 48, 0.34); }
.btn-primary.danger:active { background: var(--danger-press); }

.btn-ghost {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease-spring), background 0.2s var(--ease-out), border-color 0.2s;
}
.btn-ghost:hover { background: var(--surface-3); border-color: rgba(0,0,0,0.12); }
.btn-ghost:active { transform: scale(0.98); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }

.icon-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  border: 0;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--ease-spring);
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger:hover { background: rgba(255, 59, 48, 0.1); color: var(--danger); }

.link-btn {
  appearance: none; cursor: pointer;
  background: transparent; border: 0; padding: 0;
  color: var(--accent); font-size: 15px; font-weight: 500;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 认证视图 ---------- */
.auth-view {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}
.auth-aurora { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.aurora-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.55;
  animation: auroraFloat 18s var(--ease-in-out) infinite;
}
.blob-a { width: 480px; height: 480px; left: -120px; top: -80px; background: radial-gradient(circle, rgba(0,113,227,0.45), transparent 70%); }
.blob-b { width: 520px; height: 520px; right: -140px; top: 20%; background: radial-gradient(circle, rgba(175,82,222,0.32), transparent 70%); animation-delay: -6s; }
.blob-c { width: 460px; height: 460px; left: 30%; bottom: -160px; background: radial-gradient(circle, rgba(52,199,89,0.28), transparent 70%); animation-delay: -12s; }
@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.96); }
}

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-2xl);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-xl);
  animation: cardRise 0.8s var(--ease-spring) both;
}
@keyframes cardRise {
  0% { transform: translateY(24px) scale(0.97); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.auth-head { margin-bottom: 28px; }
.auth-head .brand { margin-bottom: 22px; }
.auth-title { margin: 0 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.auth-sub { margin: 0; font-size: 15px; color: var(--ink-4); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.01em; }
.field input {
  appearance: none;
  height: 50px; padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 16px; color: var(--ink);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--ink-4); opacity: 0.7; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1); }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 16px; opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s; }
.field-error.show { opacity: 1; transform: translateY(0); }

.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 48px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-4);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.pwd-toggle:hover { color: var(--ink); background: var(--surface); }
.pwd-toggle.revealed { color: var(--accent); }

.auth-form .btn-primary { margin-top: 8px; }

.auth-foot { margin-top: 26px; text-align: center; font-size: 15px; color: var(--ink-3); }

/* ---------- 主应用视图 ---------- */
.app-view { min-height: 100vh; min-height: 100dvh; background: var(--bg); animation: appFade 0.5s var(--ease-out) both; }
@keyframes appFade { from { opacity: 0; } to { opacity: 1; } }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-2);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 10px;
  border-radius: 20px;
  background: var(--surface);
  transition: background 0.2s;
}
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}
.user-name { font-size: 14px; font-weight: 500; color: var(--ink-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hero */
.hero { padding: 56px 28px 32px; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.hero-eyebrow {
  display: inline-block; margin: 0 0 10px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--accent);
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
}
.hero-title { margin: 0 0 8px; font-size: clamp(32px, 5vw, 46px); font-weight: 600; letter-spacing: -0.025em; color: var(--ink); }
.hero-sub { margin: 0; font-size: 17px; color: var(--ink-4); }

/* 上传区 */
.upload-zone {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
}
.upload-inner {
  position: relative;
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-2xl);
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-2), #fff);
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease-spring);
}
.upload-zone:hover .upload-inner,
.upload-zone.dragover .upload-inner {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(0,113,227,0.04), #fff);
  transform: translateY(-2px);
}
.upload-zone.dragover .upload-inner { border-style: solid; box-shadow: 0 0 0 6px rgba(0,113,227,0.08); }
.upload-glyph {
  width: 88px; height: 88px; margin: 0 auto 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(0,113,227,0.12), rgba(10,132,255,0.06));
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
  transition: transform 0.4s var(--ease-spring);
}
.upload-zone:hover .upload-glyph { transform: scale(1.06) rotate(-3deg); }
.upload-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.upload-sub { margin: 0 0 24px; font-size: 14.5px; color: var(--ink-4); }
.upload-actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* 画廊 */
.gallery-section { max-width: var(--maxw); margin: 56px auto 0; padding: 0 28px; }
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.gallery-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.gallery-tools { display: inline-flex; align-items: center; gap: 10px; }

.seg-control {
  display: inline-flex; padding: 3px;
  background: var(--surface); border-radius: 12px;
  border: 1px solid var(--line-2);
}
.seg-btn {
  appearance: none; cursor: pointer; border: 0;
  width: 34px; height: 30px; border-radius: 9px;
  background: transparent; color: var(--ink-4);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.gallery { display: grid; gap: 16px; }
.gallery.grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery.masonry {
  display: block;
  column-count: 5;
  column-gap: 16px;
}
.gallery.masonry .photo-card {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
}

.photo-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-out);
  animation: cardIn 0.5s var(--ease-spring) both;
}
@keyframes cardIn {
  0% { transform: translateY(14px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.photo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.photo-card:hover img { transform: scale(1.05); }
.gallery.grid .photo-card { aspect-ratio: 1 / 1; }

.photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: flex-end; padding: 14px;
}
.photo-card:hover .photo-overlay { opacity: 1; }
.photo-meta {
  color: #fff; font-size: 12.5px; font-weight: 500;
  display: flex; flex-direction: column; gap: 2px;
}
.photo-meta .pm-date { opacity: 0.85; font-size: 11.5px; font-weight: 400; }

.photo-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  color: #fff; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 999px;
  opacity: 0; transition: opacity 0.3s;
}
.photo-card:hover .photo-badge { opacity: 1; }

/* 選擇模式 */
.photo-check {
  position: absolute; top: 10px; left: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s, background 0.2s, transform 0.2s var(--ease-spring);
  z-index: 2;
}
.photo-check svg { width: 16px; height: 16px; color: #fff; opacity: 0; transition: opacity 0.2s; }
.gallery.selecting .photo-check { opacity: 1; }
.gallery.selecting .photo-card { cursor: pointer; }
.gallery.selecting .photo-card:hover { transform: none; box-shadow: var(--shadow-md); }
.gallery.selecting .photo-card:hover img { transform: none; }
.gallery.selecting .photo-badge { opacity: 0 !important; }
.photo-card.selected .photo-check { background: var(--accent); border-color: #fff; transform: scale(1.05); }
.photo-card.selected .photo-check svg { opacity: 1; }
.photo-card.selected { box-shadow: 0 0 0 3px var(--accent), var(--shadow-md); }
.photo-card.selected img { transform: scale(0.97); }

/* 批次工具列 */
.batch-bar {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20;
  max-width: var(--maxw); margin: 0 auto 16px;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-md);
  animation: batchIn 0.3s var(--ease-spring) both;
}
@keyframes batchIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.batch-info { font-size: 14px; color: var(--ink-2); }
.batch-info strong { color: var(--accent); font-size: 16px; }
.batch-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: rgba(255,59,48,0.08); border-color: rgba(255,59,48,0.3); }

/* 空状态 */
.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--ink-4);
}
.empty-glyph {
  width: 110px; height: 110px; margin: 0 auto 20px;
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink-4);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty-state h4 { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--ink-2); }
.empty-state p { margin: 0; font-size: 15px; }

/* 頁腳 */
.foot { max-width: var(--maxw); margin: 80px auto 32px; padding: 32px 28px 56px; text-align: center; }
.foot p { margin: 4px 0; font-size: 13px; color: var(--ink-4); }
.foot-admin a {
  color: var(--ink-4); text-decoration: none; font-size: 12.5px;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.foot-admin a:hover { color: var(--accent); border-color: var(--accent); background: rgba(0,113,227,0.05); }

/* ---------- 预览模态框 ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); animation: fadeIn 0.3s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.viewer-panel {
  position: relative; z-index: 1;
  width: min(96vw, 1200px); height: min(92vh, 760px);
  background: var(--bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: viewerIn 0.4s var(--ease-spring) both;
}
@keyframes viewerIn {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
}
.viewer-name { font-size: 15px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: inline-flex; gap: 4px; }
.viewer-stage {
  flex: 1; position: relative;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: imgIn 0.4s var(--ease-out); }
@keyframes imgIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(10px);
  border: 0; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.25s var(--ease-spring);
  z-index: 2;
}
.nav-arrow:hover { background: rgba(255,255,255,0.32); }
.nav-arrow:active { transform: translateY(-50%) scale(0.92); }
.nav-arrow.prev { left: 16px; }
.nav-arrow.next { right: 16px; }
.nav-arrow.hidden { opacity: 0; pointer-events: none; }
.viewer-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-4); text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(16px);
  color: #fff; font-size: 14.5px; font-weight: 500;
  padding: 12px 22px; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity 0.3s, transform 0.3s var(--ease-spring);
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(52, 199, 89, 0.95); }
.toast.error { background: rgba(255, 59, 48, 0.95); }

/* ---------- 确认对话框 ---------- */
.confirm { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); animation: fadeIn 0.25s var(--ease-out); }
.confirm-panel {
  position: relative; z-index: 1;
  width: min(88vw, 380px);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 28px 24px 20px;
  box-shadow: var(--shadow-xl);
  animation: confirmIn 0.35s var(--ease-spring) both;
  text-align: center;
}
@keyframes confirmIn { 0% { transform: scale(0.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.confirm-panel h4 { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: var(--ink); }
.confirm-panel p { margin: 0 0 22px; font-size: 14.5px; color: var(--ink-3); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; height: 56px; }
  :root { --topbar-h: 56px; }
  .hero { padding: 32px 16px 20px; }
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 15px; }
  .upload-zone { padding: 0 16px; }
  .upload-inner { padding: 32px 18px; }
  .upload-glyph { width: 76px; height: 76px; }
  .upload-title { font-size: 18px; }
  .upload-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; margin: 0 auto; }
  .upload-actions .btn-primary,
  .upload-actions .btn-ghost { width: 100%; }
  .gallery-section { padding: 0 16px; margin-top: 36px; }
  .gallery-head { margin-bottom: 16px; }
  .gallery-title { font-size: 20px; }
  .gallery.grid, .gallery.masonry { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery.masonry { column-count: 2; column-gap: 10px; }
  .gallery.masonry .photo-card { margin-bottom: 10px; }
  .gallery.grid .photo-card { border-radius: 16px; }
  .user-name { display: none; }
  .user-chip { padding: 0 4px 0 6px; }
  .auth-card { padding: 34px 24px 26px; border-radius: 24px; }
  .auth-title { font-size: 23px; }
  .nav-arrow { width: 40px; height: 40px; }
  .nav-arrow.prev { left: 8px; }
  .nav-arrow.next { right: 8px; }
  .viewer-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .viewer-head { padding: 10px 12px; }
  .viewer-name { font-size: 13px; max-width: 50vw; }
  .foot { padding: 24px 16px calc(48px + env(safe-area-inset-bottom, 20px)); margin-top: 48px; margin-bottom: 28px; }
  .foot-admin a { font-size: 12px; }
}

@media (max-width: 400px) {
  .gallery.grid, .gallery.masonry { grid-template-columns: 1fr; }
  .gallery.masonry { column-count: 1; }
  .hero-title { font-size: 26px; }
}

@media (min-width: 401px) and (max-width: 720px) {
  .gallery.masonry { column-count: 2; }
}
@media (min-width: 721px) and (max-width: 980px) {
  .gallery.masonry { column-count: 3; }
}
@media (min-width: 981px) and (max-width: 1280px) {
  .gallery.masonry { column-count: 4; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 安全區域（iPhone 劉海 / 底部 Home 指示） */
@supports (padding: env(safe-area-inset-top)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topbar { padding-top: env(safe-area-inset-top); }
  .toast { bottom: calc(32px + env(safe-area-inset-bottom)); }
}