/* ============================================================
   虞俊杰 & 何鑫 · 私人记录
   零依赖静态页面：无外部字体、无 CDN、无网络请求
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC",
                "SimSun", Georgia, "Times New Roman", serif;

  --bg: #f5f1ea;
  --bg-soft: #eee8de;
  --surface: #fffdf8;
  --ink: #1b1916;
  --ink-2: #57504a;
  --ink-3: #9a9186;
  --line: rgba(27, 25, 22, 0.14);
  --line-soft: rgba(27, 25, 22, 0.07);
  --accent: #b45b4c;
  --accent-ink: #8f4237;
  --accent-soft: rgba(180, 91, 76, 0.10);
  --accent-glow: rgba(180, 91, 76, 0.16);
  --frame: #fffdf8;
  --frame-line: rgba(27, 25, 22, 0.07);
  --shadow-photo: 0 22px 44px -26px rgba(48, 32, 24, 0.42), 0 2px 6px rgba(48, 32, 24, 0.05);
  --shadow-photo-hover: 0 34px 70px -30px rgba(48, 32, 24, 0.52), 0 4px 12px rgba(48, 32, 24, 0.08);
  --shadow-soft: 0 40px 90px -60px rgba(48, 32, 24, 0.5);
  --topbar-bg: rgba(245, 241, 234, 0.82);
  --grain: 0.030;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #131211;
  --bg-soft: #191716;
  --surface: #1d1b19;
  --ink: #f2ede4;
  --ink-2: #b7aea2;
  --ink-3: #7e766b;
  --line: rgba(242, 237, 228, 0.15);
  --line-soft: rgba(242, 237, 228, 0.07);
  --accent: #e2a196;
  --accent-ink: #f0c3bb;
  --accent-soft: rgba(226, 161, 150, 0.12);
  --accent-glow: rgba(226, 161, 150, 0.12);
  --frame: #232120;
  --frame-line: rgba(242, 237, 228, 0.08);
  --shadow-photo: 0 28px 60px -30px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-photo-hover: 0 40px 90px -34px rgba(0, 0, 0, 0.95), 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 40px 100px -60px rgba(0, 0, 0, 0.95);
  --topbar-bg: rgba(19, 18, 17, 0.82);
  --grain: 0.045;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

body.locked { overflow: hidden; }

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

a { color: inherit; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.serif { font-family: var(--font-serif); }

/* 细颗粒纸张质感（纯内联 SVG，无外部请求） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain);
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 爱心画布 ---------- */
#hearts {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 4vw, 46px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease),
              backdrop-filter 0.5s var(--ease);
}

.topbar.scrolled {
  background: var(--topbar-bg);
  border-bottom-color: var(--line-soft);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 13px;
  color: var(--accent);
  line-height: 1;
  padding-bottom: 2px;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.brand:hover .brand-mark { border-color: var(--accent); }

.brand-text {
  font-size: 11.5px;
  letter-spacing: 0.26em;
  color: var(--ink-2);
  white-space: nowrap;
}

.brand-text .sep {
  margin: 0 0.55em;
  font-style: normal;
  color: var(--ink-3);
}

/* 章节导航 */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.2vw, 26px);
  margin: 0 auto;
  padding: 0 12px;
  max-width: 62vw;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-nav a {
  position: relative;
  flex: none;
  padding: 6px 2px;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}

.topbar-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.topbar-nav a:hover { color: var(--ink); }
.topbar-nav a.active { color: var(--accent); }
.topbar-nav a.active::after { opacity: 1; transform: none; }

.theme-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease),
              transform 0.4s var(--ease);
}

.theme-btn:hover { border-color: var(--ink-2); transform: rotate(6deg); }
.theme-btn:active { transform: scale(0.94); }

.theme-btn .ic {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  margin: -8.5px 0 0 -8.5px;
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}

.ic-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.ic-moon { opacity: 0; transform: rotate(-70deg) scale(0.55); }
html[data-theme="dark"] .ic-sun { opacity: 0; transform: rotate(70deg) scale(0.55); }
html[data-theme="dark"] .ic-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(110px, 16vh, 170px) clamp(20px, 5vw, 48px) clamp(72px, 10vh, 110px);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(820px, 96vw);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -62%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent-glow), transparent 62%);
  filter: blur(8px);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.kicker {
  margin: 0 0 clamp(26px, 4vh, 42px);
  font-size: 10.5px;
  letter-spacing: 0.36em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding-left: 0.36em;
}

.hero-names {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.34em;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 8.2vw, 5.6rem);
  line-height: 1.14;
  letter-spacing: 0.09em;
  color: var(--ink);
}

.hero-names .name { white-space: nowrap; }

.hero-names .amp {
  font-size: 0.56em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
  transform: translateY(-0.12em);
}

.hero-rule {
  width: min(560px, 74vw);
  height: 1px;
  margin: clamp(28px, 4.4vh, 46px) auto clamp(26px, 4vh, 40px);
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}

/* ---------- 介绍（可编辑） ---------- */
.intro {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  text-align: left;
}

.intro-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.intro-count {
  letter-spacing: 0.14em;
  color: var(--ink-3);
  opacity: 0.8;
  transition: opacity 0.3s var(--ease);
}

.intro-text {
  min-height: 4.2em;
  padding: 2px 0 6px;
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  line-height: 2.08;
  letter-spacing: 0.035em;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  outline: none;
  caret-color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}

.intro-text:hover { border-bottom-color: var(--line-soft); }
.intro-text:focus {
  border-bottom-color: var(--line);
  background: linear-gradient(180deg, transparent 92%, var(--accent-soft) 92%);
}

.intro-text:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-3);
  pointer-events: none;
}

.intro-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.saved::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.saved.show { opacity: 1; transform: none; }

.scroll-cue {
  margin-top: clamp(44px, 7vh, 78px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: 0.4em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.scroll-cue span {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--line), transparent);
  transform-origin: top center;
  animation: cue 2.6s var(--ease) infinite;
}

@keyframes cue {
  0%   { transform: scaleY(0.15); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- 照片墙 ---------- */
.wall {
  padding-top: clamp(64px, 9vw, 110px);
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 60px;
}

.wall-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

.wall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: clamp(26px, 4vw, 42px);
}

.section-label {
  margin: 0 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.wall h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.3;
}

.wall h2 .lat {
  margin-left: 0.55em;
  font-size: 0.66em;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  white-space: nowrap;
}

.wall-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
              color 0.3s var(--ease), transform 0.25s var(--ease);
}

.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- 飘动舞台 ---------- */
.stage {
  position: relative;
  height: clamp(440px, 70vh, 760px);
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  touch-action: pan-y;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(28px, 8vw, 120px);
  z-index: 6;
  pointer-events: none;
}

.stage::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 6%, transparent);
}

.stage::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 6%, transparent);
}

.stage.dragover::before,
.stage.dragover::after { opacity: 0.4; }

.stage.dragover {
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.photo {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform;
  opacity: 0;
  animation: pic-in 1s var(--ease) forwards;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

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

.photo-inner {
  padding: 7px;
  background: var(--frame);
  border: 1px solid var(--frame-line);
  border-radius: 10px;
  box-shadow: var(--shadow-photo);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.photo:hover .photo-inner,
.photo:focus-visible .photo-inner {
  transform: scale(1.06);
  box-shadow: var(--shadow-photo-hover);
}

.photo:focus-visible { outline: none; }

.photo img {
  display: block;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- 空状态 ---------- */
.stage-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
}

.stage-empty.hide { display: none; }

.empty-card {
  max-width: 420px;
  padding: clamp(30px, 4vw, 46px) clamp(26px, 6vw, 64px);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.empty-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.empty-card p {
  margin: 0 0 22px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  line-height: 1.9;
  color: var(--ink-3);
}

.empty-card .empty-hint { margin: 18px 0 0; font-size: 10.5px; opacity: 0.85; }

.wall-tip {
  margin: 0;
  padding: 18px 20px 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-3);
}

/* ---------- 留言墙 ---------- */
.messages { padding-bottom: clamp(30px, 5vw, 50px); }

.message-grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  align-items: start;
}

.message-empty {
  grid-column: 1 / -1;
  padding: clamp(34px, 5vw, 56px) 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.18em;
}

.note {
  position: relative;
  padding: 24px 22px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
              background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.note:hover {
  transform: translateY(-3px);
  border-color: var(--line);
}

.note::before {
  content: "\201C";
  position: absolute;
  top: 0;
  left: 14px;
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.3;
  pointer-events: none;
}

.note-text {
  margin: 12px 0 16px;
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.03em;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.note-name { color: var(--ink-2); }

.note-del {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.note:hover .note-del { opacity: 1; }
.note-del:hover { color: var(--accent); border-color: var(--accent); }
.note-del.arming { opacity: 1; color: #fff; background: var(--accent); border-color: var(--accent); }

body.shared .note-del { display: none; }

/* ---------- 手机上传 ---------- */
.upload-fab {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 60;
  padding: 13px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.upload-fab:hover { transform: translateY(-2px); }
.upload-fab[hidden] { display: none; }

.upload-walls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.wall-chip {
  appearance: none;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.wall-chip.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.field input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}

.field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

/* ---------- 页脚 ---------- */
.foot {
  padding: clamp(60px, 9vw, 110px) clamp(20px, 4vw, 48px) clamp(44px, 6vw, 72px);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.24em;
  line-height: 2.3;
  color: var(--ink-2);
}

.foot p { margin: 0; }

.foot-heart {
  margin-bottom: 16px !important;
  font-size: 17px;
  color: var(--accent);
  letter-spacing: 0;
}

.foot .tiny {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.18em;
}

/* ---------- 大图查看 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(12, 10, 9, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.38s var(--ease), visibility 0.38s var(--ease);
}

.lightbox.open { opacity: 1; visibility: visible; }

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: min(90vw, 1180px);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  border-radius: 6px;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.85);
  transform: scale(0.965);
  transition: transform 0.45s var(--ease);
}

.lightbox.open img { transform: scale(1); }

.lb-caption {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.62);
}

.lb-hint { opacity: 0.55; }

.lb-close {
  position: absolute;
  top: clamp(14px, 3vw, 30px);
  right: clamp(14px, 3vw, 30px);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.lb-close:hover { border-color: rgba(255, 255, 255, 0.6); transform: rotate(90deg); }

.lb-delete {
  position: absolute;
  bottom: clamp(18px, 4vw, 38px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.lb-delete:hover { color: #fff; border-color: rgba(255, 255, 255, 0.55); }

.lb-delete.arming {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 90;
  transform: translate(-50%, 10px);
  max-width: min(86vw, 520px);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

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

/* ---------- 共享浏览（线上只读版本） ---------- */
.shared-note { display: none; }

body.shared .edit-hint,
body.shared #saveState { display: none; }

body.shared .shared-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  opacity: 0.92;
}

body.shared .intro-text {
  cursor: default;
  border-bottom-color: transparent !important;
  background: none !important;
}

body.shared .intro-text:focus { outline: none; }

body.shared #addPhotoBtn,
body.shared #exportBtn,
body.shared #importBtn,
body.shared #encryptBtn,
body.shared .empty-card .btn,
body.shared .empty-hint { display: none; }

body.shared .wall-tools { display: none; }

body.shared .photo { cursor: zoom-in; }

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- 深浅切换的圆形揭示（Chrome / Edge） ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

::view-transition-old(root) {
  animation: none;
}

::view-transition-new(root) {
  animation-name: vt-reveal;
  animation-fill-mode: both;
}

@keyframes vt-reveal {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to   { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

/* ---------- 访问密码 ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}

.gate[hidden], .modal[hidden] { display: none; }

.gate::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 92vw);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -60%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent-glow), transparent 62%);
  filter: blur(8px);
  pointer-events: none;
}

.gate-card {
  position: relative;
  width: min(400px, 100%);
  text-align: center;
}

.gate-kicker {
  margin: 0 0 22px;
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.gate-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.gate-title .amp {
  color: var(--accent);
  font-style: italic;
  font-size: 0.58em;
  letter-spacing: 0;
}

.gate-desc {
  margin: 0 0 30px;
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.gate-field { margin-bottom: 14px; }

.gate-input,
.field input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-align: center;
  outline: none;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.gate-input:focus,
.field input:focus { border-color: var(--accent); }

.gate-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px 20px;
}

.gate-status,
.modal-status {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.gate-error {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.gate-foot {
  margin: 26px 0 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.gate.shake .gate-card { animation: gate-shake 0.4s var(--ease); }

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- 发布设置弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 10, 9, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.modal-card {
  width: min(470px, 100%);
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.modal-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  letter-spacing: 0.07em;
}

.modal-desc {
  margin: 0 0 22px;
  font-size: 12px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}

.modal-desc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  font-size: 0.92em;
}

.field { display: block; margin-bottom: 14px; }

.field span {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

.field input { text-align: left; letter-spacing: 0.06em; }

.field textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.field textarea:focus { border-color: var(--accent); }

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

.modal-foot {
  margin: 18px 0 0;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

/* 让所有元素在切换主题时平滑过渡（不支持 View Transition 的浏览器） */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition-property: background-color, border-color, color, box-shadow, fill, stroke, opacity !important;
  transition-duration: 0.55s !important;
  transition-timing-function: var(--ease) !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .topbar { padding: 15px 18px; }
  .brand-text { display: none; }
  .hero { padding-top: 96px; }
  .hero-names { letter-spacing: 0.05em; }
  .wall-head { align-items: flex-start; }
  .wall-tools { width: 100%; }
  .wall h2 .lat { display: block; margin: 6px 0 0; }
  .stage { height: clamp(400px, 58vh, 560px); }
  .wall-tip { font-size: 9px; letter-spacing: 0.2em; }
  .lightbox img { max-height: 68vh; }
  .lb-hint { display: none; }
}

@media (max-width: 900px) {
  .topbar-nav { display: none; }
  .message-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-height: 620px) {
  .scroll-cue { display: none; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; opacity: 0.6; }
  .photo { opacity: 1; animation: none; }
  .photo-inner, .lightbox img, .theme-btn { transition: none; }
  ::view-transition-new(root) { animation: none; }
}
