/* R35 宠物纪念站 · 13色板 + 烛光/彩虹桥 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Songti SC', serif; background: var(--bg); color: var(--text); line-height: 1.7; padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); transition: background .4s, color .4s; }
body.showcase-back-active { padding-top: calc(44px + env(safe-area-inset-top, 0)); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

body[data-theme='golden'] { --primary:#A1887F; --primary-dark:#6D4C41; --bg:#FFFDF7; --bg-card:#FFF; --text:#4E342E; --text-light:#8D6E63; --border:#D7CCC8; --hero-overlay:rgba(78,52,46,.45); --accent:#C9A84C; --rainbow:linear-gradient(90deg,#ff6b6b,#ffd93d,#6bcb77,#4d96ff,#9b59b6); }
body[data-theme='lavender-cat'] { --primary:#9C89B8; --primary-dark:#6A4C93; --bg:#F5F0F0; --bg-card:#FFF; --text:#4527A0; --text-light:#7E57C2; --border:#D1C4E9; --hero-overlay:rgba(74,20,140,.4); --accent:#B39DDB; --rainbow:linear-gradient(90deg,#e1bee7,#ce93d8,#9fa8da); }
body[data-theme='peach'] { --primary:#F8BBD0; --primary-dark:#EC407A; --bg:#E0F2F1; --bg-card:#FFF; --text:#880E4F; --text-light:#C2185B; --border:#F8BBD0; --hero-overlay:rgba(136,14,79,.35); --accent:#80CBC4; --rainbow:linear-gradient(90deg,#f8bbd0,#b2dfdb,#fff9c4); }
body[data-theme='sky'] { --primary:#90CAF9; --primary-dark:#42A5F5; --bg:#FFFBF0; --bg-card:#FFF; --text:#1565C0; --text-light:#1976D2; --border:#BBDEFB; --hero-overlay:rgba(21,101,192,.4); --accent:#FFF176; --rainbow:linear-gradient(90deg,#90caf9,#fff59d,#81d4fa); }
body[data-theme='bronze'] { --primary:#C9A84C; --primary-dark:#8D6E2C; --bg:#FFF8F0; --bg-card:#FFF; --text:#5D4037; --text-light:#8D6E63; --border:#E0D4B8; --hero-overlay:rgba(93,64,55,.5); --accent:#D4AF37; --rainbow:linear-gradient(90deg,#c9a84c,#f5e6cc,#a1887f); }
body[data-theme='starry'] { --primary:#FFD54F; --primary-dark:#FFC107; --bg:#F5F5FF; --bg-card:#1A237E; --text:#E8EAF6; --text-light:#FFD54F; --border:#3949AB; --hero-overlay:rgba(26,35,126,.7); --accent:#FFD54F; --rainbow:linear-gradient(90deg,#1a237e,#5c6bc0,#ffd54f); }
body[data-theme='rose'] { --primary:#F48FB1; --primary-dark:#C94F6B; --bg:#FFF5F8; --bg-card:#FFF; --text:#AD1457; --text-light:#EC407A; --border:#F8BBD0; --hero-overlay:rgba(173,20,87,.4); --accent:#F06292; --rainbow:linear-gradient(90deg,#f48fb1,#ffcdd2,#f8bbd0); }
body[data-theme='forest'] { --primary:#66BB6A; --primary-dark:#2E7D32; --bg:#F1F8E9; --bg-card:#FFF; --text:#1B5E20; --text-light:#388E3C; --border:#C8E6C9; --hero-overlay:rgba(27,94,32,.45); --accent:#A5D6A7; --rainbow:linear-gradient(90deg,#66bb6a,#aed581,#fff9c4); }
body[data-theme='ocean'] { --primary:#5C6BC0; --primary-dark:#283593; --bg:#FFF8E1; --bg-card:#FFF; --text:#1A237E; --text-light:#3949AB; --border:#C5CAE9; --hero-overlay:rgba(40,53,147,.5); --accent:#FFCC80; --rainbow:linear-gradient(90deg,#5c6bc0,#81d4fa,#fff59d); }
body[data-theme='sunset'] { --primary:#FF8A65; --primary-dark:#E64A19; --bg:#FFF3E0; --bg-card:#FFF; --text:#BF360C; --text-light:#FF7043; --border:#FFCCBC; --hero-overlay:rgba(191,54,12,.45); --accent:#FFB74D; --rainbow:linear-gradient(90deg,#ff8a65,#ffcc80,#ffab91); }
body[data-theme='sakura'] { --primary:#FFAB91; --primary-dark:#D8434F; --bg:#FFFBF8; --bg-card:#FFF; --text:#C62828; --text-light:#E57373; --border:#FFCCBC; --hero-overlay:rgba(198,40,40,.35); --accent:#FFCCBC; --rainbow:linear-gradient(90deg,#ffab91,#f8bbd0,#fff9c4); }
body[data-theme='lavender'] { --primary:#CE93D8; --primary-dark:#8E24AA; --bg:#FDF5FE; --bg-card:#FFF; --text:#6A1B9A; --text-light:#AB47BC; --border:#E1BEE7; --hero-overlay:rgba(106,27,154,.4); --accent:#E1BEE7; --rainbow:linear-gradient(90deg,#ce93d8,#b39ddb,#f3e5f5); }
body[data-theme='aurora'] { --primary:#00E5FF; --primary-dark:#00B8D4; --bg:#F0F8FF; --bg-card:#1B2A4A; --text:#E3F2FD; --text-light:#80DEEA; --border:#37474F; --hero-overlay:rgba(27,42,74,.75); --accent:#00E5FF; --rainbow:linear-gradient(90deg,#1b2a4a,#00e5ff,#ff4081); }

.glass-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 4px 24px rgba(0,0,0,.04); }
.section { max-width: 920px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.section__title { font-size: 1.35rem; text-align: center; margin-bottom: .35rem; color: var(--primary); font-weight: 800; }
.section__sub { text-align: center; font-size: .85rem; color: var(--text-light); margin-bottom: 1.25rem; }

.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(1.05); }
.hero__overlay { position: absolute; inset: 0; background: var(--hero-overlay); }
.hero__rainbow { position: absolute; bottom: 15%; left: 5%; right: 5%; height: 120px; background: var(--rainbow); opacity: .35; border-radius: 50% 50% 0 0 / 100% 100% 0 0; filter: blur(8px); }
.hero__content { position: relative; z-index: 2; text-align: center; padding: 2rem 1.25rem; }
.hero__avatar { width: 9rem; height: 9rem; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.hero__name { font-size: clamp(2rem, 8vw, 3rem); font-weight: 900; margin-bottom: .25rem; }
.hero__breed { font-size: .95rem; opacity: .9; margin-bottom: .75rem; }
.hero__dates { font-size: .88rem; opacity: .92; margin-bottom: .75rem; }
.hero__epitaph { font-size: 1rem; font-style: italic; max-width: 22rem; margin: 0 auto 1.25rem; opacity: .95; line-height: 1.6; }
.hero__scroll { display: block; margin-top: 1rem; font-size: .82rem; opacity: .75; animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

.candle-row { display: flex; justify-content: center; gap: 1.5rem; margin-top: .5rem; }
.candle { position: relative; width: 1.25rem; height: 2.5rem; background: linear-gradient(#fff8e1,#ffe0b2); border-radius: 2px 2px 4px 4px; }
.candle::before { content: ''; position: absolute; top: -1rem; left: 50%; transform: translateX(-50%); width: .5rem; height: .85rem; background: radial-gradient(#ffd54f 30%, #ff8f00 70%, transparent); border-radius: 50% 50% 20% 20%; animation: flicker 3s ease-in-out infinite; box-shadow: 0 0 12px #ff8f00, 0 0 24px rgba(255,143,0,.4); }
.candle.lit::after { content: ''; position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, rgba(255,213,79,.35) 0%, transparent 70%); animation: glow 2s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: translateX(-50%) scale(1); opacity: 1; } 50% { transform: translateX(-50%) scale(1.08) rotate(3deg); opacity: .85; } }
@keyframes glow { 50% { opacity: .6; transform: scale(1.1); } }

.timeline { position: relative; padding: 1rem 0; }
.timeline::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--border); transform: translateX(-50%); }
@media (max-width: 767px) { .timeline::before { left: 1rem; } }
.timeline-node { position: relative; width: 50%; padding: .75rem 1.5rem 1.5rem; }
.timeline-node:nth-child(odd) { margin-left: 0; padding-right: 2rem; text-align: right; }
.timeline-node:nth-child(even) { margin-left: 50%; padding-left: 2rem; }
@media (max-width: 767px) { .timeline-node, .timeline-node:nth-child(even) { width: 100%; margin-left: 0; padding: .75rem 1rem 1.5rem 2.5rem; text-align: left; } }
.timeline-node__dot { position: absolute; top: 1.25rem; width: .85rem; height: .85rem; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 4px var(--bg); animation: pulse-dot 2s infinite; }
.timeline-node:nth-child(odd) .timeline-node__dot { right: -.45rem; }
.timeline-node:nth-child(even) .timeline-node__dot { left: -.45rem; }
@media (max-width: 767px) { .timeline-node__dot { left: .55rem !important; right: auto !important; } }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 6px rgba(161,136,127,.25); } }
.timeline-card { padding: 1rem; text-align: inherit; }
.timeline-card__date { font-size: .78rem; color: var(--primary); font-weight: 700; }
.timeline-card__title { font-weight: 800; margin: .25rem 0; }
.timeline-card__desc { font-size: .85rem; color: var(--text-light); }
.timeline-card__img { width: 100%; max-width: 140px; border-radius: .5rem; margin-top: .5rem; display: inline-block; }

.photo-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
@media (min-width: 768px) { .photo-wall { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .photo-wall { grid-template-columns: repeat(4, 1fr); } }
.photo-item { position: relative; border-radius: .75rem; overflow: hidden; cursor: pointer; transition: transform .25s; }
.photo-item:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.photo-item.tall { grid-row: span 2; }
.photo-item.tall img { aspect-ratio: auto; min-height: 100%; }
.photo-item.wide { grid-column: span 2; }
.photo-item.wide img { aspect-ratio: 2/1; }
.photo-item__cap { position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.65)); color: #fff; font-size: .75rem; padding: .5rem; display: flex; align-items: flex-end; opacity: 0; transition: opacity .25s; }
.photo-item:hover .photo-item__cap { opacity: 1; }
.photo-item.favorite::after { content: '★ 最爱'; position: absolute; top: .5rem; right: .5rem; background: var(--accent, #C9A84C); color: #fff; font-size: .65rem; padding: .2rem .45rem; border-radius: 999px; }

.letter-box { max-width: 560px; margin: 0 auto; padding: 2rem 1.5rem; background: linear-gradient(#fffdf5, #fff8e8); border: 1px solid var(--border); border-radius: .25rem; box-shadow: 2px 2px 0 var(--border), inset 0 0 60px rgba(161,136,127,.08); position: relative; }
.letter-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: repeating-linear-gradient(90deg, var(--primary) 0 8px, transparent 8px 16px); opacity: .3; }
.letter-box__title { font-family: 'Songti SC', Georgia, serif; font-size: 1.35rem; text-align: center; color: var(--primary-dark); margin-bottom: 1rem; }
.letter-box__quote { font-size: .82rem; color: var(--text-light); font-style: italic; text-align: center; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px dashed var(--border); }
.letter-box p { margin-bottom: .85rem; font-size: .92rem; text-indent: 2em; }
.letter-box__sign { text-align: right; margin-top: 1.5rem; font-size: .88rem; color: var(--text-light); }

.tribute-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; margin-bottom: 1rem; font-size: .85rem; }
.flower-picker { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.flower-btn { padding: .5rem .75rem; border: 2px solid var(--border); border-radius: .75rem; background: var(--bg-card); cursor: pointer; font-size: 1.25rem; transition: all .2s; }
.flower-btn.active, .flower-btn:hover { border-color: var(--primary); background: var(--bg); transform: scale(1.05); }
.flower-btn small { display: block; font-size: .65rem; color: var(--text-light); }
.tribute-form { max-width: 480px; margin: 1rem auto; padding: 1rem; }
.tribute-list { display: grid; gap: .65rem; max-width: 560px; margin: 0 auto; }
.tribute-card { padding: 1rem; }
.tribute-card__head { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-light); margin-bottom: .35rem; }
.tribute-card__text { font-size: .88rem; }
.floating-flower { position: fixed; font-size: 1.5rem; pointer-events: none; z-index: 999; animation: float-up 1.2s ease-out forwards; }
@keyframes float-up { to { transform: translateY(-120px); opacity: 0; } }

.ritual-section { background: linear-gradient(180deg, var(--bg) 0%, #1a1a2e 100%); color: #fff; text-align: center; padding: 3rem 1.25rem; position: relative; overflow: hidden; }
body[data-theme='starry'] .ritual-section, body[data-theme='aurora'] .ritual-section { background: linear-gradient(180deg, #1a237e 0%, #0d1117 100%); }
.ritual-section__rainbow { position: absolute; top: 20%; left: 10%; right: 10%; height: 80px; background: var(--rainbow); opacity: .4; border-radius: 50%; filter: blur(12px); }
.ritual-section__avatar { width: 6rem; height: 6rem; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 3px solid rgba(255,255,255,.6); box-shadow: 0 0 40px rgba(255,213,79,.4); position: relative; z-index: 1; }
.ritual-countdown { font-size: .88rem; opacity: .85; margin: 1rem 0; position: relative; z-index: 1; }
.candle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; max-width: 320px; margin: 1.5rem auto; position: relative; z-index: 1; }
.ritual-candle { font-size: 1.75rem; cursor: pointer; opacity: .35; transition: all .4s; filter: grayscale(1); }
.ritual-candle.lit { opacity: 1; filter: none; transform: scale(1.15); text-shadow: 0 0 20px #ffd54f; }
.ripple { position: absolute; border: 2px solid rgba(255,213,79,.6); border-radius: 50%; animation: ripple-out 1s ease-out forwards; pointer-events: none; }
@keyframes ripple-out { from { width: 0; height: 0; opacity: 1; } to { width: 200px; height: 200px; opacity: 0; margin: -100px; } }

.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; max-width: 560px; margin: 0 auto; }
@media (min-width: 768px) { .profile-grid { grid-template-columns: repeat(3, 1fr); } }
.profile-item { padding: 1rem; text-align: center; }
.profile-item__icon { font-size: 1.5rem; margin-bottom: .35rem; }
.profile-item__label { font-size: .72rem; color: var(--text-light); }
.profile-item__value { font-size: .85rem; font-weight: 700; margin-top: .15rem; }

.card-templates { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.card-tpl-btn { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; font-size: .78rem; }
.card-tpl-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#memorial-canvas { max-width: 280px; width: 100%; margin: 0 auto; display: block; border-radius: .75rem; box-shadow: 0 8px 32px rgba(0,0,0,.12); }

.site-footer { text-align: center; padding: 2rem 1.25rem; font-size: .82rem; color: var(--text-light); }
.site-footer .btn { margin-top: 1rem; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal__box { position: relative; background: var(--bg-card); border-radius: 1rem; max-width: 90vw; max-height: 90vh; overflow: auto; }
.modal__box img { border-radius: .5rem; }

.scene-panel, .theme-panel { position: fixed; z-index: 50; }
.scene-panel { bottom: calc(5.5rem + env(safe-area-inset-bottom)); left: 1rem; }
.theme-panel { bottom: calc(5.5rem + env(safe-area-inset-bottom)); right: 1rem; }
.scene-panel__toggle, .theme-panel__toggle { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 1.25rem; cursor: pointer; }
.scene-panel__list, .theme-panel__list { position: absolute; bottom: calc(100% + .5rem); background: var(--bg-card); border: 1px solid var(--border); border-radius: .75rem; padding: .5rem; min-width: 9rem; max-height: 50vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.theme-panel__list { right: 0; left: auto; }
.scene-panel__list button, .theme-panel__list button { display: block; width: 100%; text-align: left; padding: .4rem .6rem; border-radius: .35rem; font-size: .8rem; color: var(--text); background: none; border: none; cursor: pointer; }
.scene-panel__list button.active, .theme-panel__list button.active, .scene-panel__list button:hover, .theme-panel__list button:hover { background: var(--primary); color: #fff; }

.back-top { position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom)); right: 1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--primary); color: #fff; z-index: 40; border: none; cursor: pointer; }
.back-top[hidden] { display: none; }
.contact-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); background: rgba(0,0,0,.82); color: #fff; text-align: center; }
.contact-footer__btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: .35rem; }
.contact-footer__cta { padding: .45rem 1rem; border-radius: 999px; background: var(--primary, #A1887F); color: #fff; font-size: .82rem; font-weight: 600; }
.contact-footer__btn { padding: .45rem .85rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); color: #fff; background: transparent; font-size: .82rem; cursor: pointer; }
.contact-footer__brand { font-size: .68rem; opacity: .65; }
html.has-contact-footer body { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .88rem; border: none; cursor: pointer; background: var(--primary); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }

.lightbox { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); }
.lightbox__box { position: relative; z-index: 1; max-width: 90vw; max-height: 85vh; text-align: center; }
.lightbox__close { position: absolute; top: -2.5rem; right: 0; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.lightbox__box img { max-height: 70vh; border-radius: .75rem; margin: 0 auto; }
.lightbox__cap { color: #fff; margin-top: .75rem; font-size: .9rem; }

body.share-page { padding-bottom: 2rem; }
.share-hero { position: relative; color: #fff; padding: 2.5rem 1.25rem; text-align: center; }
.share-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.share-hero__overlay { position: absolute; inset: 0; background: var(--hero-overlay); }
.share-hero__body { position: relative; z-index: 1; }
