/* ============================================================
   书亦 · 情侣回忆纪念册 — 全局样式
   大厂克制配色 · 净白 + 暖中性灰 + 单一低饱和点缀
   干净无衬线字体 · 去除廉价渐变与装饰
   ============================================================ */

:root {
  /* —— 中性背景与表面 —— */
  --bg: #f7f5f3;              /* 暖中性底 */
  --bg-elev: #fbfaf9;
  --surface: #ffffff;         /* 卡片净白 */
  --surface-2: #fcfbfa;

  /* —— 文字（中性灰，非棕色）—— */
  --ink: #1c1917;             /* 主文字 stone-900 */
  --ink-2: #44403c;           /* 次级 stone-700 */
  --muted: #78716c;           /* stone-500 */
  --faint: #a8a29e;           /* stone-400 */
  --inverse: #ffffff;

  /* —— 描边（极淡中性）—— */
  --line: rgba(28, 27, 23, 0.08);
  --line-strong: rgba(28, 27, 23, 0.14);
  --line-soft: rgba(28, 27, 23, 0.05);

  /* —— 单一点缀色（低饱和暖黏土，克制使用）—— */
  --accent: #b8826a;
  --accent-hover: #a6714f;
  --accent-soft: rgba(184, 130, 106, 0.10);
  --accent-line: rgba(184, 130, 106, 0.28);
  --danger: #b5544a;
  --danger-soft: rgba(181, 84, 74, 0.10);

  /* —— 字体（干净）—— */
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Inter", serif;

  /* —— 圆角 —— */
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* —— 阴影（中性、极柔）—— */
  --shadow-xs: 0 1px 2px rgba(28, 27, 23, 0.04);
  --shadow-sm: 0 2px 8px -2px rgba(28, 27, 23, 0.06), 0 1px 2px rgba(28, 27, 23, 0.04);
  --shadow: 0 6px 20px -6px rgba(28, 27, 23, 0.08), 0 2px 6px -2px rgba(28, 27, 23, 0.05);
  --shadow-lg: 0 16px 40px -12px rgba(28, 27, 23, 0.14), 0 4px 12px -4px rgba(28, 27, 23, 0.06);
  --shadow-float: 0 24px 56px -16px rgba(28, 27, 23, 0.20), 0 8px 20px -6px rgba(28, 27, 23, 0.08);

  /* —— 过渡 —— */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t-mid: 280ms;
  --t-slow: 420ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

img, video { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ============================================================
   背景装饰（极克制）
   ============================================================ */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-aurora {
  position: absolute; inset: -10%;
  background:
    radial-gradient(50% 40% at 15% 5%, rgba(184, 130, 106, 0.06), transparent 70%),
    radial-gradient(45% 38% at 85% 95%, rgba(120, 113, 108, 0.05), transparent 70%);
  filter: blur(6px);
}
.bg-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(28, 27, 23, 0.035) 0.6px, transparent 0.6px);
  background-size: 26px 26px;
  opacity: 0.5;
}
.bg-hearts { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.35; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); }

/* ============================================================
   通用
   ============================================================ */
.view { animation: viewIn var(--t-mid) var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-primary {
  background: var(--ink);
  color: var(--inverse);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #292524; box-shadow: var(--shadow); }
.btn-accent {
  background: var(--accent);
  color: var(--inverse);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--shadow); }
.btn-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { background: var(--line-soft); color: var(--ink); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 12px;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.back-btn:hover { color: var(--ink); background: var(--line-soft); }

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--ink);
}
.page-title .sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.12em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ============================================================
   首页
   ============================================================ */
.home {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 0 72px;
  text-align: center;
}
.home-brand { margin-bottom: 24px; }
.home-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.home-title {
  font-family: var(--font-serif);
  font-size: clamp(52px, 10vw, 88px);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-indent: 0.12em;
  color: var(--ink);
}
.home-subtitle {
  margin-top: 16px;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.home-divider { width: 40px; height: 2px; margin: 22px auto 0; background: var(--accent); border-radius: 999px; }

/* 主合照 4:3 */
.main-photo-wrap {
  position: relative;
  width: min(80vw, 540px);
  aspect-ratio: 4 / 3;
  margin: 36px 0 30px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.main-photo-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") center / 40px no-repeat;
  opacity: 0.5; z-index: 0;
}
.main-photo-wrap > * { position: relative; z-index: 1; }
.main-photo {
  width: 100%; height: 100%;
  border-radius: var(--r-xl);
  object-fit: cover;
  transition: opacity var(--t-mid);
}
.main-photo-placeholder {
  width: 100%; height: 100%;
  border-radius: var(--r-xl);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); cursor: pointer;
  transition: border-color var(--t-mid), background var(--t-mid);
}
.main-photo-placeholder:hover { border-color: var(--accent); background: var(--surface-2); }
.main-photo-placeholder .upload-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.main-photo-placeholder .ph-text { font-size: 14px; letter-spacing: 0.04em; }

/* 主合照三点菜单 —— 常驻显示 */
.photo-menu-trigger {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: background var(--t-fast), transform var(--t-fast);
  z-index: 2;
}
.photo-menu-trigger:hover { background: #fff; }
.main-photo-wrap:not(.has-photo) .photo-menu-trigger { display: none; }

/* 天数计数 */
.days-counter { margin: 4px 0 36px; }
.days-label { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
.days-number {
  font-family: var(--font-serif);
  font-size: clamp(64px, 13vw, 112px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 6px 0 2px;
  color: var(--ink);
}
.days-unit { font-size: clamp(16px, 2.6vw, 20px); color: var(--ink-2); letter-spacing: 0.12em; }
.days-meta { margin-top: 10px; font-size: 12px; color: var(--faint); letter-spacing: 0.04em; }

.home-nav { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   年份快速导航
   ============================================================ */
.year-nav {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 4px 0 20px;
  justify-content: center;
}
.year-pill {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all var(--t-fast);
}
.year-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.year-pill.active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }

/* ============================================================
   年份卡片网格（时光轴首页）
   ============================================================ */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding: 8px 0 120px;
}
.year-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid);
  animation: tileIn var(--t-slow) var(--ease) both;
}
.year-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.year-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.year-card:hover img { transform: scale(1.03); }
.yc-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.7));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px; color: #fff;
}
.yc-name {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600; letter-spacing: 0.02em; line-height: 1;
}
.yc-count { font-size: 12px; opacity: 0.85; margin-top: 6px; letter-spacing: 0.04em; }

/* ============================================================
   照片网格（真正的 CSS Grid，行优先）
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 8px 0 120px;
}
@media (max-width: 1180px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* 旧 masonry 类保持兼容（仍使用 CSS Grid） */
.masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 8px 0 120px;
}
@media (max-width: 1180px) { .masonry { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .masonry { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* 照片卡片 */
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid);
  animation: tileIn var(--t-slow) var(--ease) both;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile img {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  transition: opacity var(--t-mid), transform var(--t-slow) var(--ease);
}
.tile:hover img { transform: scale(1.02); }
.tile .date-mask {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55));
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px;
  color: #fff;
  font-size: 12px; letter-spacing: 0.04em;
  opacity: 0; transition: opacity var(--t-mid);
}
.tile:hover .date-mask { opacity: 1; }
.tile .note-chip {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  max-width: calc(100% - 12px);
  font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: var(--r-sm);
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--t-mid), transform var(--t-mid);
  pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile:hover .note-chip { opacity: 1; transform: translateY(0); }

@keyframes tileIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* LIVE 徽章 */
.live-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  padding: 3px 7px; border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  display: flex; align-items: center; gap: 4px;
}
.live-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* 空状态 */
.empty-state { text-align: center; padding: 80px 20px; color: var(--faint); grid-column: 1 / -1; }
.empty-state .es-icon { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--line-strong); }
.empty-state .es-title { font-family: var(--font-serif); font-size: 18px; color: var(--ink-2); margin-bottom: 6px; }
.empty-state .es-desc { font-size: 13px; }

/* ============================================================
   月份卡片网格（相册年度视图）
   ============================================================ */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 8px 0 120px;
}
@media (max-width: 1180px) { .month-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .month-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.month-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid);
  animation: tileIn var(--t-slow) var(--ease) both;
}
.month-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.month-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.month-card:hover img { transform: scale(1.03); }
.month-card .mc-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  color: #fff;
}
.month-card .mc-name { font-family: var(--font-serif); font-size: 19px; font-weight: 600; letter-spacing: 0.02em; }
.month-card .mc-count { font-size: 11px; opacity: 0.85; margin-top: 2px; letter-spacing: 0.06em; }
.month-card .mc-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--faint);
}
.month-card .mc-placeholder .mc-name { color: var(--muted); }

/* 悬浮按钮 */
.fab {
  position: fixed; right: clamp(16px, 5vw, 40px); bottom: clamp(18px, 5vw, 36px);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.fab:hover { transform: translateY(-2px) scale(1.04); background: #292524; }
.fab:active { transform: scale(0.96); }

/* ============================================================
   里程碑
   ============================================================ */
.milestone-list { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 130px; max-width: 760px; margin: 0 auto; }
.milestone-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  display: grid; grid-template-columns: 88px 1fr; gap: 20px;
  align-items: start; overflow: hidden;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid);
  animation: viewIn var(--t-slow) var(--ease) both;
}
.milestone-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.milestone-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.m-photo {
  width: 88px; height: 88px; border-radius: var(--r-md);
  object-fit: cover; border: 1px solid var(--line);
  background: var(--bg-elev);
}
.m-photo-placeholder {
  width: 88px; height: 88px; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  color: var(--line-strong);
}
.m-content { min-width: 0; }
.m-date { font-size: 12px; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 5px; font-weight: 500; }
.m-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.m-desc { font-size: 13px; color: var(--muted); line-height: 1.7; word-break: break-word; }
.m-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.milestone-card:hover .m-actions { opacity: 1; }
.m-actions .btn-icon { width: 30px; height: 30px; }

/* ============================================================
   弹窗 / 灯箱
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(28, 27, 23, 0.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: overlayIn var(--t-mid) var(--ease) both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.overlay.closing { animation: overlayOut var(--t-mid) var(--ease) both; }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--line);
  padding: 28px 26px 24px;
  animation: modalIn var(--t-mid) var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal.closing { animation: modalOut var(--t-mid) var(--ease) both; }
@keyframes modalOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(10px) scale(0.97); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.modal-body { display: flex; flex-direction: column; gap: 16px; }
.modal-foot { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--muted); }
.field-label .req { color: var(--accent); }
.input, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: 14px; color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 76px; line-height: 1.6; }

/* 上传区 */
.dropzone {
  position: relative; border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md); background: var(--surface-2);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: border-color var(--t-mid), background var(--t-mid);
}
.dropzone:hover { border-color: var(--accent); background: var(--surface); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { width: 36px; height: 36px; margin: 0 auto 8px; color: var(--muted); }
.dropzone .dz-text { font-size: 13px; color: var(--ink-2); }
.dropzone .dz-hint { font-size: 11px; color: var(--faint); margin-top: 3px; }
.preview-wrap { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.preview-wrap img, .preview-wrap video { width: 100%; max-height: 240px; object-fit: contain; }
.preview-remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.live-tag-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-sm); padding: 8px 12px;
}

/* 复选 */
.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check-row input { display: none; }
.check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check-row input:checked + .check-box { background: var(--ink); border-color: var(--ink); }
.check-box svg { opacity: 0; transition: opacity var(--t-fast); color: #fff; }
.check-row input:checked + .check-box svg { opacity: 1; }
.check-row span { font-size: 13px; color: var(--ink-2); }

/* ============================================================
   自定义日期选择器
   ============================================================ */
.datepicker { position: relative; }
.datepicker-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 11px 13px;
  font-size: 14px; color: var(--ink); width: 100%;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.datepicker-trigger:hover { border-color: var(--line-strong); }
.datepicker-trigger .icon { color: var(--muted); margin-left: auto; }
.dp-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  width: 296px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-float);
  padding: 14px;
  animation: modalIn var(--t-fast) var(--ease) both;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-nav { width: 28px; height: 28px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: var(--muted); transition: background var(--t-fast), color var(--t-fast); }
.dp-nav:hover { background: var(--line-soft); color: var(--ink); }
.dp-title { font-family: var(--font-serif); font-size: 14px; color: var(--ink); font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--faint); padding: 5px 0; font-weight: 500; }
.dp-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-2); border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.dp-day:hover:not(.muted) { background: var(--line-soft); }
.dp-day.muted { color: var(--line-strong); }
.dp-day.today { color: var(--accent); font-weight: 600; }
.dp-day.selected { background: var(--ink); color: #fff; font-weight: 600; }

/* ============================================================
   下拉菜单
   ============================================================ */
.menu {
  position: fixed; z-index: 120;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  padding: 5px; min-width: 156px;
  animation: modalIn var(--t-fast) var(--ease) both;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-2); text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.menu-item:hover { background: var(--line-soft); color: var(--ink); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ============================================================
   灯箱
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(15, 15, 15, 0.96);
  display: flex; flex-direction: column;
  animation: overlayIn var(--t-mid) var(--ease) both;
}
.lightbox.closing { animation: overlayOut var(--t-mid) var(--ease) both; }
.lb-stage {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 56px 72px;
}
.lb-media {
  max-width: 100%; max-height: 100%;
  border-radius: var(--r-md);
  transition: opacity var(--t-mid), transform var(--t-mid);
  object-fit: contain;
}
.lb-media.switching { opacity: 0; transform: scale(0.99); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
  z-index: 2;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.20); transform: translateY(-50%) scale(1.05); }
.lb-nav.prev { left: 20px; }
.lb-nav.next { right: 20px; }
.lb-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
  z-index: 2;
}
.lb-play:hover { background: rgba(255, 255, 255, 0.30); transform: translate(-50%,-50%) scale(1.05); }

.lb-topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; z-index: 3; }
.lb-icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.lb-icon-btn:hover { background: rgba(255, 255, 255, 0.20); }
.lb-topbar-right { display: flex; gap: 8px; }

.lb-foot { text-align: center; color: #fff; padding: 16px 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.lb-date { font-size: 13px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.65); }
.lb-note { font-family: var(--font-serif); font-size: 15px; color: #fff; max-width: 580px; }
.lb-tools { display: flex; gap: 8px; align-items: center; }
.lb-tool {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.10); color: #fff;
  font-size: 12px; padding: 7px 14px; border-radius: var(--r-pill);
  transition: background var(--t-fast);
}
.lb-tool:hover { background: rgba(255, 255, 255, 0.20); }
.lb-tool.active { background: #fff; color: var(--ink); }
.lb-counter { font-size: 12px; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.06em; }
.lb-progress {
  height: 2px; width: 100%; max-width: 340px;
  background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden;
}
.lb-progress span { display: block; height: 100%; background: #fff; width: 0; }

/* ============================================================
   Toast
   ============================================================ */
.toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  padding: 11px 20px;
  font-size: 13px;
  display: flex; align-items: center; gap: 9px;
  animation: toastIn var(--t-mid) var(--ease) both;
}
.toast.out { animation: toastOut var(--t-mid) var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 720px) {
  .lb-stage { padding: 48px 12px; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
  .milestone-card { grid-template-columns: 72px 1fr; gap: 14px; padding: 18px; }
  .m-photo, .m-photo-placeholder { width: 72px; height: 72px; }
  .modal { padding: 22px 18px; }
  .dp-panel { width: 264px; right: 0; left: auto; }
  .section-head { gap: 10px; margin: 20px 0 12px; }
  .section-head .sh-count { display: none; }
  .home-title { letter-spacing: 0.08em; text-indent: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
