/* ============================================================
   Our Little World · 日系治愈风样式表
   配色：奶油白纸感 + 鼠尾草绿 + 一点樱粉
   ============================================================ */

:root {
  /* 颜色 */
  --paper: #fbf7f0;
  --paper-2: #f5efe4;
  --card: #fffefb;
  --ink: #453d34;
  --ink-2: #6f665c;
  --ink-3: #a09486;
  --sage: #8fa98a;
  --sage-deep: #6d8768;
  --sage-soft: #e4ebe0;
  --blush: #e9cdc4;
  --blush-soft: #f7e7e2;
  --gold: #c1a882;
  --line: #e8dfd1;
  --danger: #b96a5f;

  /* 圆角与阴影 */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow-s: 0 2px 10px rgba(69, 61, 52, 0.05);
  --shadow: 0 10px 30px rgba(69, 61, 52, 0.08);
  --shadow-l: 0 24px 60px rgba(69, 61, 52, 0.14);

  /* 字体：优先系统自带的日文字形，无需联网下载 */
  --font-sans: "Hiragino Sans GB", "PingFang SC", "Hiragino Maru Gothic ProN",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Songti SC", "Yu Mincho", Georgia, serif;
  --font-hand: "Klee One", "Yuppy SC", "Hiragino Maru Gothic ProN", var(--font-sans);

  --nav-h: 64px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景：柔和的纸感 + 一点点樱粉和绿在角落晕开 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(46rem 30rem at 88% -6%, rgba(233, 205, 196, 0.42), transparent 70%),
    radial-gradient(40rem 28rem at -8% 8%, rgba(143, 169, 138, 0.22), transparent 70%),
    radial-gradient(38rem 26rem at 50% 118%, rgba(228, 235, 224, 0.65), transparent 72%),
    linear-gradient(180deg, #fdfaf4 0%, var(--paper) 46%, #f7f2e8 100%);
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

::selection { background: var(--blush); color: var(--ink); }

/* ------------------------------------------------------------
   通用排版
   ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.35;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 600;
}

.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.hand { font-family: var(--font-hand); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------
   外壳 / 导航
   ------------------------------------------------------------ */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(251, 247, 240, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(232, 223, 209, 0.9);
}

.topbar-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--sage-soft), #fff);
  border: 1px solid var(--line);
  font-size: 15px;
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 16.5px;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 0;          /* 允许导航区收缩并横向滚动，否则会挤到用户信息区上面 */
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
}

.nav a:hover { background: rgba(143, 169, 138, 0.12); color: var(--ink); }

.nav a.active {
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-weight: 600;
}

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  margin-left: 6px;
  border-left: 1px solid var(--line);
  flex-shrink: 0;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--blush-soft);
  border: 1px solid #eadfd7;
  flex-shrink: 0;
}

.avatar-sage { background: var(--sage-soft); border-color: #dbe5d7; }

/* 上传照片做头像时用背景图铺满 */
.avatar-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--paper-2);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 5px rgba(69, 61, 52, 0.14);
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-preview { flex: none; display: flex; }

.avatar-actions { min-width: 0; }

.me-name { font-size: 13px; color: var(--ink-2); }

/* 移动端底部标签栏 */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(9px + env(safe-area-inset-bottom));
}

.tabbar-inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 10.5px;
  color: var(--ink-3);
  border-radius: 12px;
}

.tabbar a i {
  font-style: normal;
  font-size: 17px;
  line-height: 1.1;
  filter: saturate(0.9);
}

.tabbar a.active { color: var(--sage-deep); }
.tabbar a.active i { transform: translateY(-1px); }

/* 主内容 */
.main {
  flex: 1;
  padding: 34px 0 96px;
  animation: fade-up 0.5s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-head h2 { font-size: 25px; }

.page-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   卡片 / 按钮 / 表单
   ------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  padding: 22px;
}

.card-pad-lg { padding: 28px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-s); }

.btn:active { transform: translateY(0) scale(0.985); }

.btn-primary {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
  box-shadow: 0 6px 16px rgba(109, 135, 104, 0.28);
}
.btn-primary:hover { background: #617b5c; box-shadow: 0 10px 22px rgba(109, 135, 104, 0.32); }

.btn-blush {
  background: var(--blush);
  border-color: #e0bdb2;
  color: #6b4a40;
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(143, 169, 138, 0.12); box-shadow: none; }

/* 危险操作：淡砖红填充，比描边更醒目，但仍然保持柔和的纸感 */
.btn-danger { color: #9c5347; border-color: #e3c3bb; background: #f8e3de; }
.btn-danger:hover { background: #f2d6cf; border-color: #d9b3a9; color: #8d473b; }

.btn-sm { padding: 6px 13px; font-size: 12.5px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease;
}
.icon-btn:hover { background: rgba(143, 169, 138, 0.14); color: var(--ink); }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fffdfa;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 169, 138, 0.18);
}

textarea { resize: vertical; min-height: 96px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a09486'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 32px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover { border-color: var(--sage); }

.chip.active {
  background: var(--sage-soft);
  border-color: #cfdccb;
  color: var(--sage-deep);
  font-weight: 600;
}

.switch { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--sage-deep); }

/* ------------------------------------------------------------
   首页：Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  text-align: center;
  padding: 26px 20px 34px;
  border-radius: 26px;
  background:
    radial-gradient(30rem 18rem at 50% -30%, rgba(233, 205, 196, 0.5), transparent 70%),
    linear-gradient(180deg, #fffdf8, #fbf6ec);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(193, 168, 130, 0.34);
  border-radius: 20px;
  pointer-events: none;
}

.hero-couple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-couple .avatar { width: 44px; height: 44px; font-size: 21px; box-shadow: var(--shadow-s); }

.hero-couple .names {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.hero-couple .heart {
  color: var(--blush);
  font-size: 15px;
  animation: beat 2.6s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  24% { transform: scale(1); }
  36% { transform: scale(1.14); }
}

.hero-label {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.hero-days {
  font-family: var(--font-serif);
  font-size: clamp(64px, 15vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--sage-deep);
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}

.hero-unit { font-size: 13px; letter-spacing: 0.28em; color: var(--ink-3); }

.hero-motto {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-2);
  margin-top: 16px;
  letter-spacing: 0.04em;
}

.hero-since { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

/* 倒计时 */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 460px;
  margin: 18px auto 0;
}

.cd-cell {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 4px 8px;
}

.cd-num {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cd-key { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.16em; margin-top: 2px; }

.cd-caption {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

/* 首页网格 */
.home-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  margin-top: 20px;
}

.polaroid {
  background: #fff;
  padding: 9px 9px 40px;
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(69, 61, 52, 0.14);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-2);
  border-radius: 2px;
}

.polaroid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 62px;
  height: 18px;
  background: rgba(233, 205, 196, 0.62);
  border-left: 1px dashed rgba(255, 255, 255, 0.7);
  border-right: 1px dashed rgba(255, 255, 255, 0.7);
}

.polaroid:hover { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-l); }

.today-photo { transform: rotate(-1.6deg); }

.hero-side { display: flex; flex-direction: column; gap: 18px; }

.mini-list { display: flex; flex-direction: column; }

.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.mini-row:last-child { border-bottom: none; padding-bottom: 0; }
.mini-row:first-child { padding-top: 0; }

.mini-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}

.mini-row .t { font-size: 13.5px; }
.mini-row .d { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.mini-row .v { margin-left: auto; font-family: var(--font-serif); color: var(--sage-deep); font-size: 15px; }

/* 快捷入口 */
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.quick a:hover { transform: translateY(-2px); background: #fff; }
.quick a i { font-style: normal; font-size: 19px; }

/* ------------------------------------------------------------
   照片墙
   ------------------------------------------------------------ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar .spacer { margin-left: auto; }

/* 用 grid + JS 计算跨越行数，做出规整的瀑布流（比 columns 更可控） */
.wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  grid-auto-rows: 8px;
  align-items: start;
}

.wall-item {
  cursor: zoom-in;
  position: relative;
}

.wall-item .frame {
  background: #fff;
  border-radius: 3px;
  padding: 8px 8px 30px;
  box-shadow: 0 6px 18px rgba(69, 61, 52, 0.1);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.wall-item img {
  display: block;
  width: 100%;
  border-radius: 2px;
  background: var(--paper-2);
}

.wall-item .cap {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wall-item:hover .frame { transform: translateY(-4px) rotate(-0.4deg); box-shadow: 0 18px 36px rgba(69, 61, 52, 0.16); }

.wall-item .fav {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.wall-item .who {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-2);
  backdrop-filter: blur(4px);
}

/* 时间轴视图 */
.timeline { position: relative; padding-left: 26px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: repeating-linear-gradient(180deg, #cfc3ad 0 5px, transparent 5px 11px);
}

.tl-group { margin-bottom: 26px; }

.tl-month {
  position: relative;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--sage-deep);
  margin-bottom: 12px;
}

.tl-month::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--sage);
}

.tl-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  max-width: 720px;
}

.tl-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid #fff;
  box-shadow: var(--shadow-s);
  cursor: zoom-in;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(38, 33, 28, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.24s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lb-inner {
  max-width: min(920px, 96vw);
  width: 100%;
  background: #fffdf8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-l);
  animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

.lb-inner img { display: block; width: 100%; max-height: 64vh; object-fit: contain; background: #f2ece1; }

/* 大图（手机上是弹窗里的那张） */
.lb-img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  background: #f2ece1;
}

.lb-meta { padding: 14px 18px 16px; }

.lb-meta h3 { font-size: 16px; margin-bottom: 6px; }

.lb-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
}

.lb-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 上传区 */
.dropzone {
  border: 1.5px dashed #cbbfa9;
  border-radius: var(--r);
  padding: 30px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.dropzone:hover, .dropzone.drag { border-color: var(--sage); background: rgba(228, 235, 224, 0.5); }
.dropzone i { font-style: normal; font-size: 26px; display: block; margin-bottom: 8px; }

/* ------------------------------------------------------------
   日记
   ------------------------------------------------------------ */
.diary-list { display: flex; flex-direction: column; gap: 14px; }

.diary-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow-s);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.diary-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.diary-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blush), var(--sage-soft));
}

.diary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.diary-head h3 { font-size: 16.5px; }

.diary-body {
  font-size: 14px;
  color: var(--ink-2);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.badge-lock { background: #fbf1ee; border-color: #efdcd6; color: #94605a; }
.badge-share { background: var(--sage-soft); border-color: #d5e0d1; color: var(--sage-deep); }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.5);
}

.empty i { font-style: normal; font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.8; }

/* ------------------------------------------------------------
   纪念日
   ------------------------------------------------------------ */
.date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }

.date-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-s);
  position: relative;
  overflow: hidden;
}

.date-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 205, 196, 0.4), transparent 70%);
  /* 装饰层不能吃掉鼠标事件，否则会挡住右上角的编辑/删除按钮 */
  pointer-events: none;
  z-index: 0;
}

.date-card .ic { font-size: 20px; }

.date-card .num {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.date-card .num small { font-size: 13px; color: var(--ink-3); margin-left: 4px; font-family: var(--font-sans); }

.date-card .nm { font-size: 14px; margin-top: 2px; }
.date-card .dt { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.date-card.today { border-color: var(--sage); background: linear-gradient(180deg, #fffefb, #f4f8f1); }

.date-card .ops {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 3;
  opacity: 0.9;
  transition: opacity 0.18s ease;
}

.date-card:hover .ops,
.date-card:focus-within .ops { opacity: 1; }

/* 卡片右上角的「编辑 / 删除」小按钮：文字比图标更好认，点击范围也更大 */
.mini-btn {
  font: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.94);
  cursor: pointer;
  flex: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.mini-btn:hover {
  color: var(--sage-deep);
  background: var(--sage-soft);
  border-color: #cfdcc7;
}

.mini-btn.mini-del:hover {
  color: var(--danger);
  background: #fdf1ef;
  border-color: #ecd6d2;
}

/* 手机上按钮再放大一点，方便手指点 */
@media (hover: none) {
  .date-card .ops { opacity: 1; }
  .mini-btn { font-size: 12px; padding: 8px 13px; }
}

/* ------------------------------------------------------------
   愿望清单
   ------------------------------------------------------------ */
.wish-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-2);
}

.bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), #a8bd9f);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.wish-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.wish-item:last-child { border-bottom: none; }

.wish-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #d6cbb8;
  background: #fff;
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 12px;
  transition: all 0.2s ease;
}

.wish-check:hover { border-color: var(--sage); }

.wish-item.done .wish-check { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }

.wish-item.done .wish-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(160, 148, 134, 0.7); }

.wish-title { font-size: 14.5px; }
.wish-note { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.wish-body { flex: 1; min-width: 0; }
.wish-ops { display: flex; gap: 6px; opacity: 0.9; transition: opacity 0.2s ease; }
.wish-item:hover .wish-ops { opacity: 1; }

/* ------------------------------------------------------------
   年度相册
   ------------------------------------------------------------ */
.album-hero {
  text-align: center;
  padding: 30px 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fffdf8, #f6f0e4);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.album-hero .yr {
  font-family: var(--font-serif);
  font-size: 56px;
  line-height: 1;
  color: var(--sage-deep);
  letter-spacing: 0.04em;
}

.album-hero .ttl { font-size: 14px; color: var(--ink-2); margin-top: 8px; letter-spacing: 0.18em; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 24px; }

.stat {
  text-align: center;
  padding: 16px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.stat .n { font-family: var(--font-serif); font-size: 26px; color: var(--ink); }
.stat .k { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.1em; margin-top: 2px; }

.collage {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 110px;
  gap: 10px;
}

.collage figure {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-2);
  position: relative;
  border: 3px solid #fff;
  box-shadow: var(--shadow-s);
}

.collage figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

.collage figure:nth-child(7n + 1) { grid-column: span 3; grid-row: span 2; }
.collage figure:nth-child(7n + 4) { grid-column: span 2; }
.collage figure:nth-child(7n + 6) { grid-column: span 2; }

/* ------------------------------------------------------------
   回忆胶囊
   ------------------------------------------------------------ */
.capsule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }

.capsule {
  position: relative;
  border-radius: var(--r);
  padding: 22px;
  background: linear-gradient(160deg, #fffdf9, #f8f2e6);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  min-height: 172px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.capsule:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.capsule.locked { background: linear-gradient(160deg, #f7f4ee, #efe9dd); }

.capsule .seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--blush-soft);
  border: 1px solid #ecd9d2;
  margin-bottom: 12px;
}

.capsule.open .seal { background: var(--sage-soft); border-color: #d7e2d3; }

.capsule h3 { font-size: 16px; margin-bottom: 6px; }

.capsule .excerpt {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--ink-2);
  flex: 1;
  overflow: hidden;
}

.capsule.locked .excerpt { filter: blur(4px); opacity: 0.55; user-select: none; }

.capsule .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}

.letter {
  background: #fffdf6;
  border-radius: 10px;
  padding: 26px 26px 22px;
  box-shadow: inset 0 0 0 1px #efe6d6, 0 8px 20px rgba(69, 61, 52, 0.05);
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  color: #4c433a;
  white-space: pre-wrap;
  background-image: repeating-linear-gradient(180deg, transparent 0 38px, rgba(226, 214, 194, 0.75) 38px 39px);
  background-position: 0 14px;
}

/* ------------------------------------------------------------
   弹窗 / 提示 / 登录
   ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(48, 42, 36, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease both;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-l);
  padding: 24px;
  animation: pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  margin: auto;
}

.modal h3 { font-size: 19px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 120;
  background: rgba(69, 61, 52, 0.94);
  color: #fdf9f2;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  max-width: 84vw;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

.toast .toast-act {
  border: 0;
  background: transparent;
  color: #cfe0c8;
  font: inherit;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.toast .toast-act:hover { color: #eaf3e4; }

/* 登录页 */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 254, 251, 0.86);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 38px 30px 30px;
  text-align: center;
  backdrop-filter: blur(10px);
  animation: fade-up 0.6s ease both;
}

.login-card .logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 25px;
  background: linear-gradient(145deg, var(--blush-soft), #fff);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}

.login-card h1 { font-size: 24px; letter-spacing: 0.04em; }
.login-card .tagline { font-family: var(--font-hand); font-size: 13.5px; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.06em; }

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0 18px; }

.who-card {
  padding: 18px 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fffdfa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.who-card .avatar { width: 46px; height: 46px; font-size: 22px; margin: 0 auto 8px; }
.who-card .nm { font-size: 13.5px; }
.who-card:hover { border-color: var(--sage); transform: translateY(-2px); }
.who-card.sel { border-color: var(--sage); background: linear-gradient(180deg, #fbfdf9, #f2f7ef); box-shadow: 0 0 0 3px rgba(143, 169, 138, 0.14); }

.login-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.7; }

/* 设置页 */
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: 13.5px; }
.setting-row .desc { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.setting-row .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.stack-lg { display: flex; flex-direction: column; gap: 18px; }

/* 账号列表 */
.acc-list { display: flex; flex-direction: column; gap: 10px; }

.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fffdfa;
}

.acc-main { min-width: 0; flex: 1; }
.acc-name { font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.acc-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; letter-spacing: 0.02em; }
.acc-ops { display: flex; gap: 6px; flex-shrink: 0; }

.tag-me {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(143, 169, 138, 0.16);
  color: var(--sage-deep);
  letter-spacing: 0.04em;
}

.mini-btn.danger { color: var(--danger); border-color: rgba(196, 116, 116, 0.35); }
.mini-btn.danger:hover { background: rgba(196, 116, 116, 0.1); }

@media (max-width: 560px) {
  .acc-row { flex-wrap: wrap; }
  .acc-ops { margin-left: auto; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ------------------------------------------------------------
   响应式：手机
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* 拼贴原来按 7 列算跨度，小屏上会错位成窄条，这里改成 3 列 */
  .collage { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 96px; }
  .collage figure:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
  .collage figure:nth-child(7n + 4) { grid-column: span 1; }
  .collage figure:nth-child(7n + 6) { grid-column: span 2; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  .nav { display: none; }
  .me { padding-left: 10px; margin-left: auto; }
  .me-name { display: none; }
  .tabbar { display: block; }
  .main { padding: 18px 0 calc(84px + env(safe-area-inset-bottom)); }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wall-item { margin-bottom: 0; }
  .hero { padding: 22px 14px 28px; border-radius: 22px; }
  .hero::after { inset: 6px; border-radius: 18px; }
  .countdown { gap: 7px; }
  .cd-cell { padding: 8px 2px 6px; border-radius: 12px; }
  .card { padding: 18px; border-radius: var(--r); }
  .page-head h2 { font-size: 21px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .date-grid, .capsule-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px; border-radius: 18px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .date-card .ops, .wish-ops { opacity: 1; }
  .letter { padding: 20px 18px; font-size: 14px; }
}

@media (max-width: 340px) {
  .wall { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   手机细节优化（手指友好 / iOS 不自动放大 / 安全区）
   ------------------------------------------------------------ */
@media (max-width: 720px) {
  /* 1) 手指点得准：小按钮统一抬到 34px 左右 */
  .chip { padding: 8px 14px; font-size: 13px; min-height: 34px; }
  .mini-btn { padding: 9px 13px; font-size: 12.5px; min-height: 34px; }
  .btn-sm { padding: 9px 14px; font-size: 13px; min-height: 34px; }
  .icon-btn { width: 34px; height: 34px; }
  .wish-check { width: 30px; height: 30px; margin-top: 0; font-size: 13px; }

  /* 2) iPhone 上输入框字号 < 16px 会自动放大整页，这里统一 16px */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
    padding: 11px 13px;
  }

  /* 3) 顶栏避开刘海 / 状态栏 */
  .topbar { padding-top: env(safe-area-inset-top); }

  /* 4) 纪念日卡片收紧一点，一屏能多看一张 */
  .date-card { padding: 15px 16px; }
  .date-card .num { font-size: 30px; margin-top: 4px; }
  .date-card .dt { margin-top: 4px; }

  /* 5) 小字别太小 */
  .tiny { font-size: 12px; }
  .tabbar a { font-size: 11px; padding: 7px 0; }
  .tabbar a i { font-size: 18px; }

  /* 6) 弹窗在矮屏上留出呼吸，内部可滚动 */
  .modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
  .modal-actions { position: sticky; bottom: -1px; background: var(--card); padding-top: 12px; }

  /* 7) 弹窗按钮：次要按钮一行排开，主按钮独占一行，拇指更好按 */
  .modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .modal-actions .btn { flex: 1 1 30%; justify-content: center; }
  .modal-actions .btn-primary { flex: 1 1 100%; order: 9; }

  /* 8) 看大图时给文字和按钮多留点空间 */
  .lb-img { max-height: 48vh; border-radius: 10px; }

  /* 9) 相册拼贴：手机上两列，第一张占大格 */
  .collage { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 84px; gap: 8px; }
  .collage figure:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
  .collage figure:nth-child(7n + 4) { grid-column: span 1; }
  .collage figure:nth-child(7n + 6) { grid-column: span 1; }
}

/* ------------------------------------------------------------
   添加照片：上传预览
   ------------------------------------------------------------ */
.dropzone { display: block; }

/* 已经选了照片后，上传框收窄成一条，给预览腾地方 */
.dropzone.has-files {
  padding: 14px 16px;
  border-style: solid;
  border-color: #d7e2d3;
  background: rgba(228, 235, 224, 0.35);
}
.dropzone.has-files i { display: none; }
.dropzone.has-files .tiny { display: none; }

.up-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 2px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.up-bar span { margin-right: auto; }

.up-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.up-preview:empty { display: none; }

.up-item {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.up-item img { display: block; width: 100%; height: 92px; object-fit: cover; }
.up-item figcaption {
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 3px 0;
}

.up-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(69, 61, 52, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.up-remove:hover { background: var(--danger); }

/* ------------------------------------------------------------
   回收站
   ------------------------------------------------------------ */
.trash-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #fffefb, #f6faf3);
}
.trash-note-icon { font-size: 22px; line-height: 1.3; }
.trash-note .label { font-size: 14px; }
.trash-note .desc { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.75; }

.trash-list { display: flex; flex-direction: column; gap: 10px; }

.trash-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow-s);
}

.trash-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  display: grid;
  place-items: center;
}
.trash-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trash-thumb-emoji { font-size: 22px; }

.trash-body { flex: 1; min-width: 0; }
.trash-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.trash-kind {
  display: inline-block;
  padding: 0 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 11px;
}

.trash-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.trash-days { font-size: 11px; color: var(--ink-3); }
.trash-ops { display: flex; gap: 6px; }

@media (max-width: 640px) {
  .trash-item { flex-wrap: wrap; }
  .trash-side {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------
   回忆轴
   ------------------------------------------------------------ */
.mem-today { margin-bottom: 24px; }
.mem-today-head { margin-bottom: 12px; }
.mem-today-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.mem-today-item {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.mem-today-item img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.mem-today-cap {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-2);
}

.mem-line { position: relative; padding-left: 26px; }
.mem-line::before {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 12px;
  bottom: 12px;
  width: 1.5px;
  background: linear-gradient(180deg, #ddd0bb, #e8dfd1 40%, rgba(232, 223, 209, 0.35));
}

.mem-group { position: relative; margin-bottom: 26px; }

.mem-month {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
}
.mem-dot {
  position: absolute;
  left: -26px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--sage);
  box-shadow: 0 0 0 4px var(--card);
}
.mem-dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--sage);
}
.mem-month-text { font-family: var(--font-serif); font-size: 15px; color: var(--ink); }
.mem-month-count { font-size: 11.5px; color: var(--ink-3); }

.mem-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.mem-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mem-photo img { display: block; width: 100%; height: 190px; object-fit: cover; }
.mem-text { padding: 12px 14px 14px; }
.mem-title { font-size: 14px; color: var(--ink); }
.mem-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

@media (max-width: 640px) {
  .mem-line { padding-left: 22px; }
  .mem-dot { left: -22px; }
  .mem-cards { grid-template-columns: 1fr; }
  .mem-photo img { height: 168px; }
}

/* ------------------------------------------------------------
   打印（年度相册导出 PDF）
   ------------------------------------------------------------ */
@media print {
  body::before, .paper-grain, .topbar, .tabbar, .no-print, .toast { display: none !important; }
  .main { padding: 0; }
  .container { max-width: none; padding: 0; }
  .album-hero { border: none; background: #fff; }
  .collage { grid-auto-rows: 150px; gap: 6px; }
  .collage figure { border-color: #fff; box-shadow: none; }
  .card, .stat { box-shadow: none; }
}

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   视频（照片墙里的短片）
   ------------------------------------------------------------
   视频用和照片一样的容器，只是多一个时长角标；没有封面帧时
   直接把 <video> 当静态图用（不自动播放）。
   ============================================================ */

.wall-item video,
.tl-thumb video,
.collage figure video,
.mem-photo video,
.mem-today-item video,
.polaroid video,
.up-item video {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: var(--paper-2);
  object-fit: cover;
}

.wall-item .frame { position: relative; }

.tl-thumbs .tl-thumb {
  position: relative;
  display: block;
  cursor: zoom-in;
}

.tl-thumb img,
.tl-thumb video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid #fff;
  box-shadow: var(--shadow-s);
}

.collage figure,
.mem-photo,
.mem-today-item,
.today-photo,
.up-item { position: relative; }

/* 视频角标：右下角的小药丸，显示时长或 ▶ */
.vbadge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 29, 24, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(3px);
}

.mem-photo .vbadge { right: 12px; bottom: 12px; }
.mem-today-item .vbadge { right: 6px; bottom: 26px; padding: 3px 6px; font-size: 10px; }
.collage figure .vbadge { right: 8px; bottom: 8px; padding: 3px 7px; font-size: 10px; }

/* 看大图时的播放器 */
.lb-video {
  display: block;
  width: 100%;
  max-height: 64vh;
  border-radius: 12px;
  background: #1c1916;
}

/* 上传预览里的视频格子 */
.up-item .up-kind {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 29, 24, 0.62);
  color: #fff;
  font-size: 10px;
  line-height: 1.5;
}

.up-item.up-video video { height: 92px; object-fit: cover; background: #14120f; }

@media (max-width: 720px) {
  .lb-video { max-height: 48vh; border-radius: 10px; }
  .up-item.up-video video { height: 84px; }
}

/* 相框式的容器底部有留白（写字的地方），角标往上挪一点 */
.wall-item .frame .vbadge { right: 16px; bottom: 38px; }
.today-photo .vbadge { right: 16px; bottom: 44px; }

/* ============================================================
   「这次见面羞羞了吗」
   ============================================================ */

.it-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.it-stat {
  text-align: center;
  padding: 14px 8px 12px;
  border-radius: var(--r);
  background: var(--paper-2);
}

.it-stat b {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.it-stat:nth-child(3) b { font-size: 17px; }

.it-stat span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.it-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.it-row:last-child { border-bottom: 0; padding-bottom: 4px; }

.it-date { flex: 0 0 64px; }
.it-date b {
  display: block;
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--ink);
}
.it-date span { font-size: 10.5px; color: var(--ink-3); }

.it-body { flex: 1 1 auto; min-width: 0; }

.it-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.5;
}

.it-mark.yes { background: var(--blush-soft); color: #a8635a; }
.it-mark.no { background: var(--paper-2); color: var(--ink-2); }

.it-note {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-family: var(--font-hand);
}

.it-ops { display: flex; gap: 6px; flex: 0 0 auto; }

/* 弹窗里的大按钮：羞羞了 / 这次没有 */
.it-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 18px;
}

.pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pick-card span { font-size: 24px; line-height: 1; }
.pick-card b { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

.pick-card.on {
  border-color: var(--blush);
  background: var(--blush-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-s);
}

.pick-card.on b { color: #a8635a; }

@media (max-width: 720px) {
  .it-row { gap: 10px; }
  .it-date { flex-basis: 54px; }
  .it-ops { flex-direction: column; }
  .it-stat b { font-size: 20px; }
  .it-stat:nth-child(3) b { font-size: 15px; }
}

.it-preview-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ============================================================
   上传压缩：选项行 + 处理进度
   ============================================================ */

.up-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  cursor: pointer;
  user-select: none;
}

.up-opt input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--sage-deep);
  cursor: pointer;
}

.up-opt span { display: block; line-height: 1.45; }
.up-opt b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.up-opt i {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-style: normal;
  color: var(--ink-3);
}

/* 处理进度遮罩 */
.pgs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(69, 61, 52, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: pgsIn 0.18s ease-out;
}

@keyframes pgsIn { from { opacity: 0; } to { opacity: 1; } }

.pgs-card {
  width: 100%;
  max-width: 340px;
  padding: 26px 24px 22px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-l);
  text-align: center;
}

.pgs-ring {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 3px solid var(--sage-soft);
  border-top-color: var(--sage-deep);
  border-radius: 50%;
  animation: pgsSpin 0.9s linear infinite;
}

@keyframes pgsSpin { to { transform: rotate(360deg); } }

.pgs-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}

.pgs-sub {
  margin-top: 6px;
  min-height: 32px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.pgs-track {
  margin-top: 12px;
  height: 5px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.pgs-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage-deep) 100%);
  transition: width 0.25s ease;
}

.pgs-act {
  margin-top: 16px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pgs-act:hover { background: var(--paper-2); color: var(--ink); }
.pgs-act:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 720px) {
  .up-opt { padding: 10px 12px; }
  .up-opt b { font-size: 13px; }
  .pgs-card { padding: 22px 18px 18px; }
}

/* ------------------------------------------------------------
   中间宽度（平板 / 窄窗口）：导航项收紧，别让「设置」被右侧用户信息盖住
   ------------------------------------------------------------ */
@media (min-width: 721px) and (max-width: 1240px) {
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .nav { gap: 0; }
  .nav a { padding: 7px 9px; font-size: 12.5px; }
  .brand-text { font-size: 15px; }
  .brand-text small { font-size: 9px; letter-spacing: 0.2em; }
  .me { padding-left: 10px; margin-left: 2px; gap: 6px; }
  .me-name { display: none; }
}

/* 更窄的窗口：品牌只留短标识，把位置让给导航项 */
@media (min-width: 721px) and (max-width: 900px) {
  .brand-text { font-size: 0; }
  .brand-text::before {
    content: 'OLW';
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--ink);
  }
  .brand-text small { display: none; }
}

/* 账号列表里直接显示的可读密码 */
.acc-pass {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
}

.acc-pass code {
  display: inline-block;
  margin-left: 3px;
  padding: 2px 8px;
  border-radius: 7px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--sage-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
