:root {
  --ink: #28202a;
  --muted: #736b75;
  --rose: #ff625f;
  --rose-dark: #d84151;
  --cream: #fff7f4;
  --paper: #ffffff;
  --line: #f0dfe0;
  --lavender: #e8e0fb;
  --shadow: 0 16px 38px rgba(99, 47, 65, 0.12);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: #fff1ef; font-family: "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.app-shell { width: min(100%, 780px); min-height: 100dvh; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom)); }
.app-header, .section-heading, .dialog-header, .memory-footer, .film-control, .film-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-header { margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: white; background: var(--rose); font-family: Georgia, serif; font-size: 22px; font-style: italic; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); }
.icon-button svg, .primary-button svg, .secondary-button svg { width: 19px; height: 19px; stroke-width: 2.1; }

.love-summary { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 14px; min-height: 182px; overflow: hidden; padding: 24px; border-radius: 8px; color: white; background: #ff716d; box-shadow: var(--shadow); }
.love-summary::after { content: ""; position: absolute; right: -27px; bottom: -57px; width: 205px; height: 205px; border: 27px solid rgba(255,255,255,.18); border-radius: 50%; }
.summary-copy, .days-card { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 9px; opacity: .88; font-size: 13px; font-weight: 700; }
h1 { max-width: 390px; margin: 0; font-size: 30px; line-height: 1.13; letter-spacing: 0; }
.love-note { max-width: 390px; margin: 13px 0 0; font-size: 14px; line-height: 1.55; }
.days-card { align-self: end; display: grid; align-content: center; width: 104px; height: 104px; padding: 12px; border: 1px solid rgba(255,255,255,.46); border-radius: 50%; text-align: center; background: rgba(255,255,255,.15); backdrop-filter: blur(8px); }
.days-card strong { font-size: 28px; line-height: 1; }.days-card span { margin-top: 5px; font-size: 12px; }

.workspace { margin-top: 22px; }.section-heading h2, .dialog-header h2 { margin: 0; font-size: 17px; }.section-heading > span, .memory-footer { color: var(--muted); font-size: 12px; }
.upload-zone { display: grid; place-items: center; gap: 8px; min-height: 156px; margin-top: 12px; border: 1.5px dashed #eab5bc; border-radius: 8px; color: var(--rose-dark); background: rgba(255,255,255,.65); cursor: pointer; }
.upload-zone svg { width: 28px; height: 28px; }.upload-zone span { font-size: 15px; font-weight: 800; }.upload-zone small { color: var(--muted); font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #f5e6e5; }.photo-tile img { width: 100%; height: 100%; object-fit: cover; }.remove-photo { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: white; background: rgba(40,32,42,.66); }.remove-photo svg { width: 15px; }

.template-workspace { padding-top: 3px; }.template-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }.template-card { min-width: 0; padding: 7px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; }.template-card.selected { border-color: var(--rose); background: #fff7f6; }.template-card strong { display: block; overflow: hidden; margin: 7px 2px 1px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.template-preview { display: block; aspect-ratio: 1.18; border-radius: 5px; }.film-preview { background: linear-gradient(145deg, #1d263c 0 38%, #f08b82 38% 68%, #f5c9c4 68%); }.polaroid-preview { border: 8px solid white; background: linear-gradient(145deg, #ffd7be, #dc858c); box-shadow: 0 3px 9px rgba(83,42,54,.15); }.night-preview { background: linear-gradient(145deg, #1c244e 0 51%, #f05d70 51%); }

.memory-workspace { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 8px 20px rgba(106,54,73,.05); }.text-button { padding: 0; color: var(--rose-dark); background: transparent; font-size: 13px; font-weight: 800; }.memory-workspace textarea, .settings-dialog textarea, .settings-dialog input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; resize: none; }.memory-workspace textarea { min-height: 76px; margin-top: 11px; line-height: 1.55; }.memory-footer { margin-top: 4px; }

.film-control { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; width: min(100%, 780px); min-height: 86px; margin: auto; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }.film-control > div { display: grid; gap: 4px; }.film-control span { color: var(--rose-dark); font-size: 11px; font-weight: 900; }.film-control strong { font-size: 14px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 17px; border-radius: 8px; font-weight: 800; }.primary-button { color: white; background: var(--rose); box-shadow: 0 9px 18px rgba(216,65,81,.25); }.secondary-button { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }.full-button { width: 100%; margin-top: 4px; }

dialog { border: 0; }.settings-dialog, .film-dialog { width: min(calc(100% - 28px), 510px); max-height: min(90dvh, 800px); padding: 20px; border-radius: 8px; color: var(--ink); background: #fffdfc; box-shadow: 0 24px 80px rgba(45,24,35,.34); }.settings-dialog::backdrop, .film-dialog::backdrop { background: rgba(35,20,30,.42); backdrop-filter: blur(3px); }.settings-dialog form { display: grid; gap: 16px; }.settings-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }.settings-dialog input, .settings-dialog textarea { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: white; }.settings-dialog textarea { min-height: 80px; }.film-dialog { display: none; }.film-dialog[open] { display: grid; gap: 14px; }.film-dialog canvas { width: min(100%, 320px); max-height: 52dvh; margin: 0 auto; border-radius: 6px; background: #262032; box-shadow: 0 13px 28px rgba(39,25,40,.22); }.film-status { margin: 0; color: var(--muted); text-align: center; font-size: 13px; }.film-actions { justify-content: center; }

@media (max-width: 390px) { .app-shell { padding-inline: 12px; }.love-summary { grid-template-columns: minmax(0, 1fr) 94px; padding: 20px; }.days-card { width: 92px; height: 92px; }.days-card strong { font-size: 25px; } h1 { font-size: 26px; }.primary-button { padding-inline: 13px; } }
@media (min-width: 700px) { .app-shell { padding-top: 34px; }.love-summary { min-height: 205px; padding: 29px; }.photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }.film-control { padding-inline: 22px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); } }
