:root {
  --cream: #faf7f2;
  --paper: #fffdf9;
  --ink: #4a3f35;
  --ink-soft: #8a7c6f;
  --rose: #c9867f;
  --rose-deep: #a9655e;
  --sage: #a8b79a;
  --line: #eadfd2;
  --shadow: 0 10px 30px rgba(90, 70, 55, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", Georgia, serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(200, 134, 127, 0.16), transparent 60%),
    radial-gradient(1000px 600px at -10% 30%, rgba(168, 183, 154, 0.18), transparent 55%),
    linear-gradient(180deg, var(--cream), #f6efe6);
}

header {
  text-align: center;
  padding: 5rem 1.25rem 2.5rem;
  position: relative;
}

.lang-switch {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
}

.lang-switch button {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-switch button:hover {
  color: var(--rose-deep);
  border-color: var(--rose);
}

.hero-eyebrow {
  font-size: 1.05rem;
  letter-spacing: 0.35em;
  color: var(--rose-deep);
  margin-bottom: 0.8rem;
}

.hero-names {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}

.hero-date {
  margin-top: 1rem;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  letter-spacing: 0.3em;
  color: var(--rose-deep);
}

.hero-sub {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.details-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.6rem;
}

.details-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-top: 1px dashed var(--line);
}

.detail-row:first-of-type { border-top: none; }

.detail-row .dl {
  font-weight: 600;
  color: var(--rose-deep);
  font-size: 0.95rem;
}

.detail-row .dr {
  font-size: 0.95rem;
  line-height: 1.65;
}

.detail-row .addr { color: var(--ink-soft); font-size: 0.9rem; }

.map-link {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.85rem;
  color: var(--rose-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--rose);
}

.map-link:hover { border-bottom-style: solid; }

.timeline { list-style: none; }

.timeline li { display: flex; gap: 0.7rem; font-size: 0.92rem; padding: 0.15rem 0; }

.timeline b {
  color: var(--rose-deep);
  font-family: "Cormorant Garamond", serif;
  min-width: 3.4em;
}

.upload-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.8rem;
  margin-bottom: 3rem;
}

.upload-card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
}

.hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0.4rem 0 1.2rem;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  border: 2px dashed #dccfc0;
  border-radius: 14px;
  padding: 2.2rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: #fffdf8;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--rose);
  background: #fdf3ee;
}

.drop-zone .dz-icon { font-size: 2.1rem; }

.drop-zone .dz-text {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
}

.drop-zone .dz-sub {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.cam-row { text-align: center; margin-top: 0.7rem; }

.camera-btn {
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-btn:hover {
  color: var(--rose-deep);
  border-color: var(--rose);
  background: #fdf3ee;
}

.row { margin-top: 0.8rem; }

.field {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

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

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.preview-list .pv {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.preview-list .pv img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-list .pv .rm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  border: none;
  background: rgba(30, 20, 15, 0.55);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.upload-btn {
  width: 100%;
  margin-top: 1.1rem;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  border: none;
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.upload-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.upload-btn:not(:disabled):active { transform: scale(0.985); }

.progress-wrap { margin-top: 1rem; }

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #f0e7dc;
  overflow: hidden;
}

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

.progress-text {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
}

.status {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--rose-deep);
  min-height: 1.4em;
}

.gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.gallery-head h2 { font-size: 1.35rem; font-weight: 600; }

.count { color: var(--ink-soft); font-size: 0.9rem; }

.masonry {
  columns: 3 220px;
  column-gap: 0.8rem;
}

.masonry .card {
  break-inside: avoid;
  margin-bottom: 0.8rem;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #f1e9de;
  display: flex;
  flex-direction: column;
}

.masonry .card img {
  width: 100%;
  display: block;
}

.masonry .card .meta {
  padding: 0.5rem 0.65rem 0.6rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.45;
}

.masonry .card .meta .nm {
  font-weight: 600;
  color: var(--rose-deep);
  font-size: 0.8rem;
}

.masonry .card .meta .cp {
  font-size: 0.8rem;
  color: var(--ink);
  overflow-wrap: break-word;
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 2.5rem 0;
}

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 2rem 1.25rem 3rem;
}

footer .admin-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  opacity: 0.6;
  text-decoration: none;
}

footer .admin-link:hover { opacity: 1; }

.bless-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem;
  margin-bottom: 3rem;
}

.bless-card .gallery-head { margin-bottom: 0.5rem; }

.bless-form .field { font-family: inherit; }
.bless-form textarea { resize: vertical; }

.bless-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.bless-item { display: flex; width: 100%; }

.bubble {
  width: 100%;
  background: #fff7f1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
}

.b-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.2rem;
}

.b-name { font-weight: 600; color: var(--rose-deep); font-size: 0.88rem; }
.b-time { color: var(--ink-soft); font-size: 0.72rem; white-space: nowrap; }
.b-text { font-size: 0.93rem; white-space: pre-wrap; word-break: break-word; }

.qa-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem;
  margin-bottom: 3rem;
}

.qa-block { padding-top: 1rem; margin-top: 1rem; border-top: 1px dashed var(--line); }
.qa-block:first-of-type { border-top: none; margin-top: 0; padding-top: 0.5rem; }

.qa-q {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.qa-row { display: flex; gap: 0.6rem; }

.qa-row .field { flex: 1; }

.qa-send {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--sage), #8aa07a);
  border: none;
  border-radius: 10px;
  padding: 0 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.qa-send:active { opacity: 0.85; }

.qa-name-row { margin-top: 0.55rem; }

.qa-name-row .field { font-size: 0.88rem; padding: 0.5rem 0.9rem; }

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.chip {
  position: relative;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 0 rgba(90, 60, 50, 0.16), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  animation: pop-in 0.4s ease;
}

.chip::before,
.chip::after {
  content: '';
  position: absolute;
  top: -7px;
  width: 11px;
  height: 11px;
  background: inherit;
  border-radius: 50%;
  box-shadow: inherit;
}

.chip::before { left: 15%; }
.chip::after { right: 15%; }

@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.love-lines { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }

.love-line {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid #f3d8e0;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 12px rgba(200, 130, 130, 0.12);
  animation: fade-in 0.4s ease;
}

.ll-avatar { display: inline-flex; flex-shrink: 0; }

.labubu-avatar {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 3px rgba(90, 60, 50, 0.18));
}

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

.ll-text { font-size: 1rem; font-weight: 600; color: var(--ink); }

.ll-prefix { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }

.ll-answer {
  margin-top: 0.15rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c, var(--rose-deep));
  white-space: normal;
  overflow-wrap: break-word;
}

.ll-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.qa-head { display: flex; align-items: center; gap: 0.55rem; font-size: 1.35rem; }

.qa-head .qa-head-icon { display: inline-flex; }

.qa-head .labubu-avatar { width: 36px; height: 36px; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(25, 17, 12, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox .lb-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox .lb-img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.lightbox .lb-caption {
  margin-top: 0.9rem;
  color: #f2e8dc;
  font-size: 0.95rem;
  text-align: center;
}

@media (max-width: 520px) {
  header { padding-top: 4rem; }
  .upload-card { padding: 1.3rem; }
  .masonry { columns: 2 150px; column-gap: 0.6rem; }
  .masonry .card { margin-bottom: 0.6rem; border-radius: 8px; }
  .masonry .card .meta { font-size: 0.78rem; padding: 0.45rem 0.55rem 0.55rem; line-height: 1.4; }
  .masonry .card .meta .nm, .masonry .card .meta .cp { font-size: 0.75rem; }
}
