:root {
  --bg: #f5f0e7;
  --bg-deep: #ebe3d6;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --ink: #24261f;
  --ink-soft: #4e5047;
  --muted: #85857a;
  --line: rgba(42, 44, 36, 0.11);
  --line-strong: rgba(42, 44, 36, 0.18);
  --accent: #b25530;
  --accent-deep: #8f3e20;
  --accent-soft: #f0d9cc;
  --moss: #314b3f;
  --moss-soft: #dce5dd;
  --gold: #d2a852;
  --danger: #9e3d36;
  --shadow-sm: 0 1px 2px rgba(42, 37, 27, 0.05), 0 6px 20px rgba(42, 37, 27, 0.05);
  --shadow-md: 0 18px 60px rgba(42, 37, 27, 0.14);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; }
body.login-mode { overflow: auto; }
body.lightbox-open, body.overlay-open { overflow: hidden; }
[hidden], .hidden { display: none !important; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#i-heart { fill: none; }
#i-play { fill: currentColor; stroke: none; }

::selection { background: var(--accent-soft); color: var(--accent-deep); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(60, 55, 44, 0.2); border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.boot-screen.done { opacity: 0; visibility: hidden; }
.boot-mark {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--moss);
  box-shadow: 0 18px 40px rgba(49, 75, 63, 0.25);
  animation: bootPulse 2s ease-in-out infinite;
}
.boot-mark svg { width: 40px; height: 40px; }
.boot-word { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.12em; }
.boot-line { width: 90px; height: 2px; background: var(--line); overflow: hidden; border-radius: 4px; }
.boot-line span { display: block; width: 40%; height: 100%; background: var(--accent); animation: bootLine 1.25s ease-in-out infinite; }
@keyframes bootPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes bootLine { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  background: var(--bg);
}
.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(210, 168, 82, 0.28), transparent 34%),
    radial-gradient(circle at 82% 75%, rgba(178, 85, 48, 0.25), transparent 38%),
    #22342b;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 72px);
  min-height: 100vh;
  min-height: 100dvh;
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to top, black, transparent 85%);
  pointer-events: none;
}
.login-collage {
  position: absolute;
  inset: 8% 8% 28%;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 1fr 0.8fr 0.9fr;
  gap: 14px;
  transform: rotate(-2deg);
}
.collage-tile {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255,255,255,0.14);
}
.collage-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 25%, rgba(255,255,255,0.42), transparent 11%),
    radial-gradient(circle at 65% 55%, rgba(255,245,210,0.32), transparent 20%),
    linear-gradient(140deg, transparent 42%, rgba(0,0,0,0.24));
}
.collage-tile span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: rgba(255,255,255,0.82);
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.collage-tile.t1 { grid-row: 1 / 3; background: linear-gradient(150deg, #9e765c, #453e34 60%, #1b2822); }
.collage-tile.t2 { background: linear-gradient(150deg, #d8c6a8, #7b735c 55%, #2d332c); }
.collage-tile.t3 { grid-row: 2 / 4; background: linear-gradient(150deg, #7d9a8c, #3d5d50 55%, #16251f); }
.collage-tile.t4 { background: linear-gradient(150deg, #d6a37d, #875b45 55%, #332720); }
.login-quote { position: relative; z-index: 2; color: #f8f1e5; }
.login-quote p {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.5vw, 54px);
  line-height: 1.3;
  letter-spacing: 0.05em;
  font-weight: 400;
  text-shadow: 0 4px 30px rgba(0,0,0,0.35);
}
.login-quote span {
  display: block;
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(248, 241, 229, 0.56);
}
.login-panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 64px);
  background:
    radial-gradient(circle at 80% 10%, rgba(210,168,82,0.12), transparent 30%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 80px rgba(70, 55, 35, 0.1);
  backdrop-filter: blur(18px);
  border-radius: 30px;
  padding: clamp(26px, 4vw, 42px);
  animation: riseIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.brand-row { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--moss);
  color: #f7f2e8;
  box-shadow: 0 10px 24px rgba(49, 75, 63, 0.22);
  flex: 0 0 auto;
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 14px; }
.brand-mark.tiny { width: 30px; height: 30px; border-radius: 10px; }
.brand-mark.tiny svg { width: 18px; height: 18px; }
.brand-name { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.08em; }
.brand-sub { font-size: 9px; letter-spacing: 0.24em; color: var(--muted); margin-top: 4px; }
.login-heading { margin: 42px 0 28px; }
.login-heading h1 { font-family: var(--font-display); font-size: 34px; font-weight: 500; letter-spacing: 0.04em; }
.login-heading p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.06em; }
.field-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
  border-radius: 14px;
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field-control:focus-within { border-color: rgba(178, 85, 48, 0.55); box-shadow: 0 0 0 4px rgba(178, 85, 48, 0.09); background: #fff; }
.field-control input, .field-control select, .field-control textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 14px 0;
  font-size: 15px;
}
.field-control input::placeholder { color: #a9a79e; }
.field-icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.field-action { width: 34px; height: 34px; }
.field-action svg { width: 18px; height: 18px; }
.field.compact .field-control { min-height: 44px; background: var(--surface); }
.select-control { position: relative; }
.select-control select { appearance: none; cursor: pointer; padding-right: 24px; }
.select-control::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.form-error {
  border-radius: 12px;
  background: #fbebe7;
  color: #8a342b;
  border: 1px solid #f2d2ca;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
}
.login-note {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding: 15px;
  border-radius: 14px;
  background: rgba(49, 75, 63, 0.055);
  color: #5f6b61;
}
.login-note svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 2px; color: var(--moss); }
.login-note p { font-size: 12px; line-height: 1.7; }
.login-foot {
  width: min(420px, 100%);
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.16s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  touch-action: manipulation;
  user-select: none;
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff8f1; box-shadow: 0 8px 22px rgba(178, 85, 48, 0.22); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: rgba(255,255,255,0.6); border: 1px solid var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: #fff; border-color: var(--line-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; min-height: 52px; }
.btn-small { min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn.loading .spinner { display: block; }
.btn.loading .btn-label { opacity: 0.75; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  transition: background 0.16s, color 0.16s, transform 0.16s;
  flex: 0 0 auto;
}
.icon-button:hover { background: rgba(42, 44, 36, 0.07); }
.icon-button:active { transform: scale(0.94); }
.icon-button:disabled { opacity: 0.25; cursor: not-allowed; }
.icon-button:disabled:hover { background: transparent; }
.icon-button.loading svg { animation: spin 0.9s linear infinite; }
.icon-button.light { color: rgba(255,255,255,0.8); }
.icon-button.light:hover { background: rgba(255,255,255,0.12); color: #fff; }
.avatar, .avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--moss);
  color: #f8f1e5;
  font-family: var(--font-display);
  font-size: 15px;
  flex: 0 0 auto;
}
.avatar.small { width: 30px; height: 30px; font-size: 12px; }
.avatar-button { border: 2px solid rgba(255,255,255,0.8); box-shadow: var(--shadow-sm); }
.text-button {
  padding: 4px 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
}
.text-button:hover { color: var(--accent-deep); }
.pill-button {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  color: var(--ink-soft);
  font-size: 12px;
  transition: background 0.16s, border-color 0.16s;
}
.pill-button:hover { background: #fff; border-color: var(--line-strong); }
.pill-button.active { background: var(--moss); color: #fff; border-color: var(--moss); }

/* ---------- Main layout ---------- */
.main-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  width: 264px;
  flex: 0 0 264px;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 16px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 15% 0%, rgba(210,168,82,0.08), transparent 36%),
    rgba(250, 247, 240, 0.72);
  overflow: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; min-width: 0; }
.sidebar-brand > div:last-child { min-width: 0; }
.sidebar-title { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-sub { font-size: 8px; letter-spacing: 0.22em; color: var(--muted); margin-top: 3px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  transition: background 0.16s, color 0.16s;
  text-align: left;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.75; }
.nav-item:hover { background: rgba(42, 44, 36, 0.05); }
.nav-item.active { background: var(--moss); color: #fff; box-shadow: 0 7px 18px rgba(49, 75, 63, 0.18); }
.nav-item.active svg { opacity: 1; }
.sidebar-upload { width: 100%; margin: 18px 0 24px; min-height: 46px; }
.sidebar-section { min-height: 0; display: flex; flex-direction: column; margin-bottom: 17px; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px; font-size: 10px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.sidebar-months { overflow-y: auto; max-height: 25vh; padding-right: 3px; }
.sidebar-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: left;
}
.sidebar-month:hover { background: rgba(42,44,36,0.05); }
.sidebar-month.active { color: var(--accent); background: rgba(178, 85, 48, 0.08); font-weight: 600; }
.sidebar-month small { color: var(--muted); font-size: 10px; font-weight: 400; }
.sidebar-albums-wrap { max-height: 22vh; overflow: hidden; }
.sidebar-albums { overflow-y: auto; padding-right: 3px; }
.sidebar-album {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 9px; border-radius: 9px; text-align: left; color: var(--ink-soft); font-size: 12.5px;
}
.sidebar-album:hover { background: rgba(42,44,36,0.05); }
.sidebar-album .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.sidebar-album span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px; margin-top: auto; border-radius: 14px; border: 1px solid transparent; text-align: left; transition: background 0.16s, border-color 0.16s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.7); border-color: var(--line); }
.sidebar-user-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user-info strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info small { font-size: 10px; color: var(--muted); }
.sidebar-user > svg { width: 15px; height: 15px; color: var(--muted); }
.workspace { flex: 1; min-width: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; position: relative; }
.topbar {
  height: 88px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: calc(16px + var(--safe-top)) clamp(18px, 3vw, 42px) 0;
}
.topbar-mobile-brand { display: none; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 18px; letter-spacing: 0.06em; min-width: 0; }
.topbar-mobile-brand span { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-heading { min-width: 0; }
.topbar-heading h1 { font-family: var(--font-display); font-weight: 500; font-size: 25px; letter-spacing: 0.04em; }
.topbar-heading p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.mobile-month-strip-wrap { display: flex; align-items: center; gap: 4px; padding: 15px clamp(14px, 3vw, 38px) 10px; }
.strip-arrow { width: 34px; height: 34px; }
.strip-arrow svg { width: 17px; height: 17px; }
.month-strip {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; scroll-behavior: smooth; padding: 3px 2px;
}
.month-strip::-webkit-scrollbar { display: none; }
.month-chip {
  flex: 0 0 auto; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; transition: all 0.18s; white-space: nowrap;
}
.month-chip:hover { background: rgba(255,255,255,0.65); color: var(--ink-soft); }
.month-chip.active { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); font-weight: 600; }
.month-chip .chip-count { font-size: 9px; color: var(--accent); background: var(--accent-soft); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.month-chip.active .chip-count { background: var(--accent); color: white; }
.gallery-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 clamp(14px, 3vw, 42px) 42px; scroll-behavior: smooth; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.view { max-width: 1540px; margin: 0 auto; }
.gallery-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 20px 0 22px; }
.gallery-heading-main h2 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: 0.03em; line-height: 1.1; }
.gallery-heading-main p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.gallery-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.active-filter { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--moss); color: #fff; font-size: 11px; }
.filter-chip button { color: rgba(255,255,255,0.72); display: grid; place-items: center; width: 18px; height: 18px; }
.filter-chip button:hover { color: #fff; }
.filter-chip svg { width: 12px; height: 12px; }

/* ---------- Gallery ---------- */
.gallery-content { min-height: 120px; }
.day-section { padding-top: 4px; }
.day-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 2px 10px;
  background: linear-gradient(var(--bg) 68%, rgba(245, 240, 231, 0));
  backdrop-filter: blur(4px);
}
.day-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: 0.03em; }
.day-header span { font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
.media-grid { columns: 2; column-gap: 10px; }
.media-card {
  break-inside: avoid;
  margin: 0 0 10px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: 0 1px 1px rgba(40,35,26,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.media-card:hover { box-shadow: 0 10px 30px rgba(40, 35, 26, 0.14); }
.media-card:active { transform: scale(0.985); }
.media-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1);
  overflow: hidden;
  background: linear-gradient(145deg, #e2d7c5, #cfc1aa);
}
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.35s ease, transform 0.5s ease; opacity: 0; }
.media-card .thumb img.loaded { opacity: 1; }
.media-card:hover .thumb img { transform: scale(1.025); }
.media-card .thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(15, 17, 13, 0.38), transparent 38%);
  opacity: 0.85;
}
.media-card .card-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; color: #fff; pointer-events: none;
}
.media-card .card-time { font-size: 10px; letter-spacing: 0.06em; opacity: 0.85; text-shadow: 0 1px 5px rgba(0,0,0,0.35); }
.media-card .card-badges { display: flex; align-items: center; gap: 5px; }
.media-card .video-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(20, 20, 16, 0.62); backdrop-filter: blur(8px); border-radius: 7px; padding: 4px 7px; font-size: 9px; }
.media-card .video-badge svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.media-card .status-badge { position: absolute; top: 9px; left: 9px; display: inline-flex; align-items: center; gap: 5px; background: rgba(255,253,248,0.88); color: var(--ink-soft); border-radius: 7px; padding: 4px 7px; font-size: 9px; backdrop-filter: blur(8px); }
.media-card .status-badge.failed { background: rgba(158, 61, 54, 0.9); color: #fff; }
.media-card .status-badge.processing svg { animation: spin 1.2s linear infinite; }
.media-card .status-badge svg { width: 11px; height: 11px; }
.media-card .card-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.media-card .card-play span { width: 42px; height: 42px; border-radius: 50%; background: rgba(20,20,16,0.48); backdrop-filter: blur(8px); display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.media-card .card-play svg { width: 15px; height: 15px; fill: currentColor; stroke: none; margin-left: 2px; }
.media-card .card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(80,70,54,0.42); background: repeating-linear-gradient(135deg, #e7ddcb 0 12px, #e1d5c0 12px 24px); }
.media-card .card-placeholder svg { width: 26px; height: 26px; }
.day-section:first-child .day-header { padding-top: 0; }
.gallery-loading { columns: 2; column-gap: 10px; margin-top: 10px; }
.skeleton-card { height: 180px; margin-bottom: 10px; border-radius: 14px; background: linear-gradient(100deg, #e9dfce 30%, #f4ecdf 50%, #e9dfce 70%); background-size: 220% 100%; animation: shimmer 1.4s infinite; break-inside: avoid; }
@keyframes shimmer { to { background-position: -220% 0; } }
.load-sentinel { height: 40px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 20px 80px; color: var(--muted); }
.empty-state.compact { padding: 40px 20px; }
.empty-state h3 { font-family: var(--font-display); color: var(--ink); font-size: 22px; font-weight: 500; margin-top: 16px; }
.empty-state p { font-size: 13px; margin: 9px 0 20px; }
.empty-art { width: 132px; color: #b8a98f; }
.empty-art.small { width: 98px; }
.empty-art svg { width: 100%; height: auto; stroke-width: 1.4; }
.pull-indicator { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 11px; transition: height 0.18s; }
.pull-indicator span { width: 15px; height: 15px; border: 1.5px solid var(--muted); border-top-color: transparent; border-radius: 50%; }
.pull-indicator.pulling { height: 38px; }
.pull-indicator.ready span { transform: rotate(180deg); }
.pull-indicator.loading span { animation: spin 0.8s linear infinite; }

/* ---------- Albums ---------- */
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 24px 0 24px; }
.section-heading h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 500; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 7px; }
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.album-card {
  position: relative; text-align: left; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; padding: 0;
}
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.album-cover { aspect-ratio: 1.38; background: linear-gradient(140deg, #d9c9ae, #b9a98e); position: relative; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover::after { content:""; position:absolute; inset:0; background: linear-gradient(to top, rgba(25,28,20,0.36), transparent 60%); }
.album-cover .album-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,0.72); background: linear-gradient(140deg, #798d7d, #3d574a); }
.album-cover .album-placeholder svg { width: 42px; height: 42px; }
.album-card-body { padding: 15px 16px 17px; }
.album-card-body h3 { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.album-card-body p { color: var(--muted); font-size: 11px; margin-top: 5px; display: flex; justify-content: space-between; gap: 8px; }
.album-card.all .album-cover { background: linear-gradient(140deg, #405c4e, #24372d); }
.album-card.all .album-cover::before { content: "全部照片"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,0.84); font-family: var(--font-display); font-size: 26px; letter-spacing: 0.1em; }

/* ---------- Profile ---------- */
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 34px 0 24px; border-bottom: 1px solid var(--line); }
.profile-avatar { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; background: var(--moss); color: #f8f1e5; font-family: var(--font-display); font-size: 30px; box-shadow: 0 16px 40px rgba(49,75,63,0.2); }
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-family: var(--font-display); font-size: 30px; font-weight: 500; }
.profile-info p { font-size: 12px; color: var(--muted); margin: 6px 0 9px; letter-spacing: 0.06em; }
.role-badge { display: inline-flex; height: 24px; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--moss-soft); color: var(--moss); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; }
.role-badge.viewer { background: #f0e4cf; color: #8b662c; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.profile-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.profile-stats strong { font-family: var(--font-display); font-size: 26px; font-weight: 500; }
.profile-stats span { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.settings-list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 17px 18px; border-bottom: 1px solid var(--line); transition: background 0.16s; }
.settings-row:last-child { border-bottom: 0; }
.settings-row:not(.static):hover { background: var(--surface-2); }
.settings-row .settings-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--ink-soft); flex: 0 0 auto; }
.settings-row .settings-icon svg { width: 18px; height: 18px; }
.settings-row > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.settings-row strong { font-size: 13px; font-weight: 500; }
.settings-row small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.settings-row .chevron { width: 16px; height: 16px; color: var(--muted); }
.settings-row.danger strong, .settings-row.danger .settings-icon { color: var(--danger); }
.profile-version { text-align: center; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; margin: 28px 0; }

/* ---------- Mobile nav ---------- */
.fab { display: none; }
.bottom-nav { display: none; }
.mobile-month-strip-wrap { }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(24, 23, 18, 0.48);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-overlay { align-items: flex-end; padding: 0; }
.sheet {
  width: min(660px, 100%);
  max-height: min(88dvh, 900px);
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 80px rgba(20, 18, 13, 0.2);
  padding: 10px 24px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 999px; background: rgba(50, 45, 35, 0.18); margin: 2px auto 14px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; }
.sheet-head h2, .modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.sheet-head p, .modal-head p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.upload-body { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 148px; border: 1.5px dashed rgba(178, 85, 48, 0.34); border-radius: 18px; background: rgba(178, 85, 48, 0.035); color: var(--ink-soft); cursor: pointer; transition: background 0.18s, border-color 0.18s;
}
.dropzone:hover, .dropzone.dragover { background: rgba(178, 85, 48, 0.08); border-color: var(--accent); }
.dropzone-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; margin-bottom: 3px; }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone strong { font-size: 13px; font-weight: 500; }
.dropzone small { font-size: 10px; color: var(--muted); }
.upload-options { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.upload-options .field { min-width: 200px; }
.upload-summary { color: var(--muted); font-size: 11px; padding-bottom: 13px; text-align: right; }
.upload-overall {
  padding: 12px 14px; border: 1px solid rgba(178, 85, 48, 0.22); border-radius: 14px;
  background: linear-gradient(180deg, rgba(178, 85, 48, 0.075), rgba(178, 85, 48, 0.025));
}
.upload-overall-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.upload-overall-head span { font-size: 12px; color: var(--ink-soft); }
.upload-overall-head strong { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--accent-deep); line-height: 1; }
.upload-overall-bar { height: 8px; border-radius: 999px; background: rgba(50, 45, 35, 0.1); margin-top: 9px; overflow: hidden; }
.upload-overall-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #c98a54); transition: width 0.18s ease; }
.upload-overall-sub { margin-top: 7px; font-size: 10.5px; color: var(--muted); min-height: 14px; }
.upload-overall.done { border-color: rgba(75, 105, 78, 0.28); background: rgba(75, 105, 78, 0.07); }
.upload-overall.done .upload-overall-head strong { color: var(--moss); }
.upload-overall.done .upload-overall-bar span { background: var(--moss); }
.upload-overall.error { border-color: rgba(160, 64, 52, 0.28); background: rgba(160, 64, 52, 0.06); }
.upload-overall.error .upload-overall-head strong { color: var(--danger); }
.upload-overall.error .upload-overall-bar span { background: var(--danger); }
.upload-queue { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow-y: auto; }
.upload-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; }
.upload-file-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-deep); display: grid; place-items: center; color: var(--ink-soft); flex: 0 0 auto; }
.upload-file-icon svg { width: 18px; height: 18px; }
.upload-item-main { flex: 1; min-width: 0; }
.upload-item-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.upload-item-meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item.uploading [data-upload-status] { color: var(--accent-deep); }
.upload-item.processing [data-upload-status] { color: var(--accent-deep); }
.upload-item.done [data-upload-status] { color: var(--moss); font-weight: 500; }
.upload-item.error [data-upload-status] { color: var(--danger); }
.upload-progress { height: 6px; border-radius: 999px; background: var(--line); margin-top: 8px; overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.18s ease; }
.upload-item.done .upload-progress span { background: var(--moss); }
.upload-item.error .upload-progress span { background: var(--danger); }
.upload-item-remove { width: 30px; height: 30px; color: var(--muted); }
.upload-item-remove svg { width: 15px; height: 15px; }
.upload-result { margin-top: 10px; padding: 11px 14px; border-radius: 12px; font-size: 12px; line-height: 1.5; }
.upload-result.success { color: #38553c; background: rgba(75, 105, 78, 0.11); border: 1px solid rgba(75, 105, 78, 0.2); }
.upload-result.error { color: #8d3d32; background: rgba(160, 64, 52, 0.09); border: 1px solid rgba(160, 64, 52, 0.2); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- Calendar ---------- */
.calendar-sheet { width: min(440px, 100%); padding-bottom: calc(18px + var(--safe-bottom)); }
.calendar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 18px; }
.calendar-head h2 { font-family: var(--font-display); font-size: 23px; font-weight: 500; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { padding: 0 0 8px; }
.calendar-weekdays span { text-align: center; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.calendar-grid { gap: 4px; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-soft); transition: background 0.15s, color 0.15s;
}
.cal-day:not(.disabled):hover { background: var(--bg); }
.cal-day.other { color: #c0bcb1; }
.cal-day.today { color: var(--accent); font-weight: 700; }
.cal-day.today::after { content: ""; position: absolute; bottom: 6px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.cal-day.has-media::before { content: ""; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cal-day.selected { background: var(--moss); color: #fff; font-weight: 600; }
.cal-day.selected::before { background: #f5d99e; }
.cal-day.selected.today::after { background: #fff; }
.calendar-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 15px; font-size: 10px; color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox-overlay { padding: 0; background: rgba(13, 14, 11, 0.94); z-index: 1000; align-items: stretch; backdrop-filter: blur(10px); }
.lightbox { position: relative; width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 370px; grid-template-rows: auto minmax(0, 1fr); color: #f4f1e9; overflow: hidden; }
.lightbox-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-top)) 18px 8px; z-index: 5; }
.lightbox-meta { display: flex; flex-direction: column; gap: 3px; padding-left: 4px; }
.lightbox-meta strong { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: 0.04em; }
.lightbox-meta span { font-size: 10px; color: rgba(255,255,255,0.48); letter-spacing: 0.08em; }
.lightbox-top-actions { display: flex; gap: 2px; }
.lightbox-main { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.lb-media { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb-media img { max-width: calc(100% - 110px); max-height: calc(100% - 20px); object-fit: contain; transform-origin: center; transition: transform 0.22s ease, filter 0.25s ease, opacity 0.25s ease; user-select: none; -webkit-user-drag: none; cursor: zoom-in; }
.lb-media img.lb-loading { filter: blur(3px); opacity: 0.92; }
.lb-media img.lb-ready { filter: none; opacity: 1; }
.lb-media img.zoomed { cursor: grab; transition: none; }
.lb-media video { max-width: calc(100% - 110px); max-height: calc(100% - 20px); border-radius: 6px; background: #000; }
.lb-media .lb-failed { max-width: 420px; padding: 24px; text-align: center; color: rgba(255,255,255,0.65); font-size: 12px; line-height: 1.7; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 46px; height: 46px; border-radius: 50%; color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.06); backdrop-filter: blur(8px); display: grid; place-items: center; transition: background 0.16s, opacity 0.16s; }
.lb-nav:hover { background: rgba(255,255,255,0.14); color: #fff; }
.lb-nav:disabled { opacity: 0.18; cursor: default; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-zoom-controls { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: rgba(20,20,16,0.5); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; padding: 2px; opacity: 0; transition: opacity 0.2s; }
.lb-stage:hover .lb-zoom-controls, .lb-stage:focus-within .lb-zoom-controls { opacity: 1; }
.lb-zoom-controls .icon-button { width: 34px; height: 34px; }
.lb-zoom-controls .icon-button svg { width: 16px; height: 16px; }
.lightbox-panel { grid-column: 2; grid-row: 2; background: #191a16; border-left: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; min-height: 0; }
.panel-handle { display: none; }
.lb-info { padding: 18px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.lb-author { display: flex; align-items: center; gap: 9px; }
.lb-author strong { font-size: 12.5px; font-weight: 500; }
.lb-author small { display: block; font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.lb-author .avatar { background: #c18b5e; color: #fffaf1; }
.lb-actions { display: flex; gap: 8px; margin-top: 15px; }
.action-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.76); font-size: 11px; transition: background 0.16s, color 0.16s; }
.action-chip:hover { background: rgba(255,255,255,0.1); color: #fff; }
.action-chip svg { width: 14px; height: 14px; }
.action-chip.liked { background: rgba(178, 85, 48, 0.24); border-color: rgba(210, 130, 100, 0.4); color: #f0b294; }
.action-chip.liked svg { fill: currentColor; }
.action-chip.static { cursor: default; }
.lb-album { margin-top: 12px; font-size: 10px; color: rgba(255,255,255,0.45); }
.lb-camera { margin-top: 4px; font-size: 10px; color: rgba(255,255,255,0.32); }
.comments-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px 8px; font-size: 10px; letter-spacing: 0.08em; color: rgba(255,255,255,0.42); }
.comments-head strong { color: rgba(255,255,255,0.8); font-size: 11px; letter-spacing: 0.04em; }
.comments-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px; }
.comment-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.055); }
.comment-item:last-child { border-bottom: 0; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); display: grid; place-items: center; font-size: 11px; flex: 0 0 auto; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.comment-meta strong { font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,0.8); }
.comment-meta time { font-size: 9px; color: rgba(255,255,255,0.3); }
.comment-text { font-size: 11.5px; line-height: 1.65; color: rgba(255,255,255,0.66); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.comment-delete { color: rgba(255,255,255,0.3); font-size: 9px; margin-top: 3px; }
.comment-delete:hover { color: #e8a08b; }
.comments-empty { padding: 24px 0; text-align: center; color: rgba(255,255,255,0.32); font-size: 11px; }
.comment-form { display: flex; gap: 8px; padding: 12px 16px calc(14px + var(--safe-bottom)); border-top: 1px solid rgba(255,255,255,0.08); }
.comment-form textarea { flex: 1; resize: none; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.055); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.5; max-height: 90px; outline: none; }
.comment-form textarea:focus { border-color: rgba(210, 130, 100, 0.55); }
.comment-form textarea::placeholder { color: rgba(255,255,255,0.3); }
.readonly-note { margin: 0 16px 14px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.42); font-size: 10px; text-align: center; }

/* ---------- Modals ---------- */
.modal { width: min(460px, 100%); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-md); overflow: hidden; animation: riseIn 0.24s ease; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 22px 5px; }
.modal-head h2 { font-size: 23px; }
.modal-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.action-sheet { width: min(420px, 100%); padding: 8px 14px calc(14px + var(--safe-bottom)); }
.action-row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 15px 12px; border-radius: 12px; text-align: left; font-size: 13px; }
.action-row:hover { background: var(--surface-2); }
.action-row svg { width: 19px; height: 19px; color: var(--muted); }
.action-row.cancel { justify-content: center; border-top: 1px solid var(--line); border-radius: 0; margin-top: 5px; color: var(--muted); font-size: 12px; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; z-index: 1500; left: 50%; bottom: calc(88px + var(--safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(90vw, 460px); }
.toast { background: rgba(31, 33, 27, 0.94); color: #f7f2e8; backdrop-filter: blur(14px); border-radius: 12px; padding: 11px 16px; font-size: 12px; line-height: 1.5; box-shadow: 0 12px 30px rgba(0,0,0,0.22); animation: toastIn 0.24s ease; max-width: 100%; text-align: center; }
.toast.error { background: rgba(130, 46, 39, 0.96); }
.toast.success { background: rgba(41, 74, 57, 0.96); }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .upload-sheet { border-radius: 28px; margin-bottom: 4vh; }
  .sheet-overlay { align-items: center; padding: 24px; }
  .calendar-sheet { border-radius: 28px; }
  .action-sheet { border-radius: 22px; }
}
@media (min-width: 700px) {
  .media-grid { columns: 3; column-gap: 12px; }
  .media-card { margin-bottom: 12px; }
  .gallery-loading { columns: 3; column-gap: 12px; }
}
@media (min-width: 1120px) {
  .media-grid { columns: 4; column-gap: 14px; }
  .media-card { margin-bottom: 14px; }
  .gallery-loading { columns: 4; column-gap: 14px; }
}
@media (min-width: 1500px) {
  .media-grid { columns: 5; }
  .gallery-loading { columns: 5; }
}
@media (max-width: 980px) {
  .sidebar { width: 218px; flex-basis: 218px; padding-left: 12px; padding-right: 12px; }
  .topbar-heading h1 { font-size: 22px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; min-height: 100dvh; padding: 22px; }
  .login-card { border-radius: 24px; }
  .login-heading { margin: 32px 0 24px; }
}
@media (max-width: 760px) {
  body { background: var(--bg); }
  /* 避免 iOS 在聚焦输入框时自动放大页面 */
  input, textarea, select { font-size: 16px !important; }
  .sidebar { display: none; }
  .topbar { height: auto; min-height: 74px; padding: calc(12px + var(--safe-top)) 16px 4px; align-items: center; }
  .topbar-mobile-brand { display: flex; }
  .topbar-heading { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .icon-button { width: 38px; height: 38px; }
  .mobile-month-strip-wrap { padding: 8px 10px 6px; }
  .month-strip { gap: 4px; }
  .month-chip { height: 31px; padding: 0 11px; font-size: 11px; }
  .gallery-scroll { padding: 0 10px calc(88px + var(--safe-bottom)); }
  .gallery-heading { padding: 10px 4px 14px; align-items: center; }
  .gallery-heading-main h2 { font-size: 30px; }
  .gallery-heading-actions .pill-button { height: 30px; font-size: 11px; }
  .day-header { padding: 9px 2px 8px; }
  .day-header h3 { font-size: 14px; }
  .media-grid { columns: 2; column-gap: 7px; }
  .media-card { margin-bottom: 7px; border-radius: 11px; }
  .media-card .thumb { border-radius: 11px; }
  .media-card .card-overlay { padding: 7px 8px; }
  .media-card .card-time { font-size: 9px; }
  .gallery-loading { columns: 2; column-gap: 7px; }
  .skeleton-card { height: 160px; margin-bottom: 7px; border-radius: 11px; }
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 40; right: 18px; bottom: calc(76px + var(--safe-bottom)); width: 52px; height: 52px; border-radius: 18px; background: var(--accent); color: #fff; box-shadow: 0 12px 28px rgba(178,85,48,0.35); transition: transform 0.16s;
  }
  .fab:active { transform: scale(0.94); }
  .fab svg { width: 23px; height: 23px; stroke-width: 1.9; }
  .bottom-nav {
    display: flex; position: fixed; z-index: 45; left: 10px; right: 10px; bottom: calc(8px + var(--safe-bottom)); height: 58px; padding: 5px 8px; border-radius: 20px; background: rgba(255, 253, 248, 0.9); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.7); box-shadow: 0 12px 40px rgba(40, 35, 26, 0.14);
  }
  .bottom-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 15px; color: var(--muted); font-size: 9px; transition: color 0.16s, background 0.16s; }
  .bottom-item svg { width: 20px; height: 20px; }
  .bottom-item.active { color: var(--accent); background: rgba(178, 85, 48, 0.07); }
  .bottom-item.active svg { stroke-width: 1.9; }
  .albums-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .album-cover { aspect-ratio: 1 / 1; }
  .album-card-body { padding: 11px 12px 13px; }
  .album-card-body h3 { font-size: 15px; }
  .album-card-body p { font-size: 9.5px; }
  .profile-hero { padding: 22px 4px 18px; gap: 13px; }
  .profile-avatar { width: 62px; height: 62px; border-radius: 20px; font-size: 24px; }
  .profile-info h2 { font-size: 24px; }
  .profile-hero .btn { min-height: 34px; padding: 0 11px; font-size: 11px; border-radius: 9px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 18px 0; }
  .profile-stats div { padding: 13px; }
  .profile-stats strong { font-size: 22px; }
  .settings-row { padding: 14px 13px; }
  .settings-list { border-radius: 16px; }
  .empty-state { padding: 48px 16px 60px; }
  .toast-container { bottom: calc(84px + var(--safe-bottom)); }
  .sheet { border-radius: 24px 24px 0 0; padding-left: 17px; padding-right: 17px; }
  .sheet-head h2 { font-size: 21px; }
  .dropzone { min-height: 130px; }
  .upload-options { flex-direction: column; align-items: stretch; gap: 4px; }
  .upload-options .field { min-width: 0; }
  .upload-summary { text-align: left; padding-bottom: 2px; }
  .upload-queue { max-height: 30vh; }
  .overlay:not(.sheet-overlay):not(.lightbox-overlay) { padding: 16px; align-items: center; }
  .modal { border-radius: 22px; }
  .lightbox { display: flex; flex-direction: column; }
  .lightbox-top { position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(to bottom, rgba(10,10,8,0.6), transparent); padding-bottom: 28px; }
  .lightbox-main { flex: 0 0 auto; height: 56dvh; margin-top: 0; }
  .lightbox-panel { flex: 1; min-height: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,0.08); border-radius: 22px 22px 0 0; margin-top: -18px; background: #191a16; z-index: 6; }
  .panel-handle { display: block; width: 34px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.18); margin: 8px auto 0; flex: 0 0 auto; }
  .lb-info { padding: 12px 17px 12px; }
  .lb-actions { margin-top: 10px; }
  .lb-album, .lb-camera { margin-top: 7px; }
  .comments-head { padding: 10px 17px 5px; }
  .comments-list { padding: 0 17px; }
  .comment-form { padding: 8px 12px calc(10px + var(--safe-bottom)); }
  .lb-media img, .lb-media video { max-width: 100%; max-height: 100%; }
  .lb-nav { width: 38px; height: 38px; top: 50%; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
  .lb-zoom-controls { opacity: 1; bottom: 10px; }
  .action-sheet { width: 100%; }
}
@media (max-width: 380px) {
  .albums-grid { grid-template-columns: 1fr 1fr; }
  .month-chip { padding: 0 9px; }
  .gallery-heading-main h2 { font-size: 27px; }
  .gallery-heading-actions .pill-button#jump-today { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
