/* ==============================================
   Marriage10Years · style.css
   全面升级 · 高德地图 + 箭头时间轴 + 点赞评论
   ============================================== */

/* ── 字体（系统字体栈，无需外链） ── */
:root {
    --pink:     #ff6f91;
    --pink-lt:  #ffd6e0;
    --rose:     #f43f5e;
    --peach:    #ffa07a;
    --peach-lt: #fff3e0;
    --gold:     #f59e0b;
    --cream:    #fff7f0;
    --text:     #6d4c41;
    --text-dk:  #4a2c2a;
    --shadow:   0 4px 24px rgba(255,111,145,0.13);
    --radius:   18px;
    --font:     'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    margin: 0;
    background: linear-gradient(135deg, #fff7f0 0%, #ffe9ec 100%);
    color: var(--text);
    min-height: 100vh;
}


/* ============================================================
   礼物盒 Overlay
   ============================================================ */
#gift-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#gift-overlay-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #2d1b4e 0%, #0a0010 100%);
    animation: overlayPulse 3s ease-in-out infinite alternate;
}
@keyframes overlayPulse {
    from { opacity: 1; }
    to   { opacity: 0.85; }
}

#gift-overlay-bg::before,
#gift-overlay-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 80px 80px, 130px 130px;
    background-position: 0 0, 40px 40px;
    animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle {
    from { opacity: 0.3; }
    to   { opacity: 0.8; }
}

#gift-scene {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#gift-hint {
    color: rgba(255,255,255,0.85);
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(255,111,145,0.6);
    animation: hintFloat 2s ease-in-out infinite alternate;
    transition: opacity 0.4s;
}
@keyframes hintFloat {
    from { transform: translateY(0); opacity: 0.7; }
    to   { transform: translateY(-6px); opacity: 1; }
}

/* ── 礼物盒 ── */
#gift-box {
    position: relative;
    width: 140px;
    height: 140px;
    cursor: pointer;
    transition: transform 0.3s;
    animation: giftBob 2.5s ease-in-out infinite;
}
#gift-box:hover { transform: scale(1.06); }

@keyframes giftBob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%       { transform: translateY(-8px) rotate(-2deg); }
    75%       { transform: translateY(-4px) rotate(2deg); }
}

#gift-lid {
    position: absolute;
    top: -14px; left: -8px;
    width: 156px; height: 44px;
    background: linear-gradient(135deg, #ff6f91 0%, #f43f5e 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 20px rgba(244,63,94,0.5), inset 0 -3px 0 rgba(0,0,0,0.1);
    transition: transform 0.5s cubic-bezier(.4,2,.6,1);
    transform-origin: center top;
    z-index: 3;
}
#gift-ribbon-v {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(180deg, #ffd700 0%, #f59e0b 100%);
    transform: translateX(-50%);
    border-radius: 4px;
}
#gift-ribbon-h { display: none; }

#gift-bow {
    position: absolute;
    top: -20px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 34px;
}
.bow-left, .bow-right {
    position: absolute;
    top: 0;
    width: 26px; height: 26px;
    border-radius: 50% 0 50% 0;
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.bow-left  { left: 0;  transform: rotate(-30deg); }
.bow-right { right: 0; transform: rotate(30deg); }
.bow-center {
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 12px; height: 12px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(251,191,36,0.8);
}

#gift-body {
    position: absolute;
    bottom: 0; left: 0;
    width: 140px; height: 100px;
    background: linear-gradient(135deg, #ff89a9 0%, #ff6f91 40%, #ec4899 100%);
    border-radius: 4px 4px 12px 12px;
    box-shadow: 0 8px 32px rgba(255,111,145,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    overflow: hidden;
    z-index: 2;
}
#gift-stripe-v {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(180deg, rgba(255,215,0,0.7) 0%, rgba(245,158,11,0.7) 100%);
    transform: translateX(-50%);
}
#gift-stripe-h {
    position: absolute;
    top: 34%; left: 0; right: 0;
    height: 24px;
    background: linear-gradient(90deg, rgba(255,215,0,0.7) 0%, rgba(245,158,11,0.7) 100%);
}

#gift-box.exploding #gift-lid {
    animation: lidFly 0.5s forwards cubic-bezier(.2, 2, .5, 1);
}
@keyframes lidFly {
    0%   { transform: translateY(0) rotate(0); opacity: 1; }
    40%  { transform: translateY(-60px) rotate(-15deg) scale(1.1); opacity: 1; }
    100% { transform: translateY(-200px) rotate(-40deg) scale(0.3); opacity: 0; }
}
#gift-box.exploding #gift-body {
    animation: bodyShake 0.5s forwards;
}
@keyframes bodyShake {
    0%   { transform: scale(1) rotate(0); }
    20%  { transform: scale(1.12) rotate(3deg); }
    40%  { transform: scale(1.08) rotate(-3deg); }
    60%  { transform: scale(1.2) rotate(2deg); }
    80%  { transform: scale(0.9) rotate(-2deg); }
    100% { transform: scale(0) rotate(20deg); opacity: 0; }
}
#gift-box.exploding #gift-bow {
    animation: bowFly 0.5s forwards;
}
@keyframes bowFly {
    to { transform: translateX(-50%) translateY(-160px) rotate(720deg) scale(0); opacity: 0; }
}

#fireworks-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: none;
}

.flying-photo {
    position: absolute;
    width: 90px; height: 90px;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    transform: translate(-50%, -50%);
    animation: photoFly 1.2s cubic-bezier(.25, 1.4, .5, 1) both;
    z-index: 20;
}
.flying-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
@keyframes photoFly {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--rot)); opacity: 1; }
}


/* ============================================================
   主页面
   ============================================================ */

/* ── Header ── */
header {
    background: linear-gradient(110deg, #ff6f91 0%, #ffb347 50%, #ffd700 100%);
    padding: 36px 0 22px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(255,111,145,0.2);
    position: relative;
    overflow: hidden;
}
header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.header-inner { position: relative; z-index: 1; }
.header-heart {
    font-size: 2em;
    line-height: 1;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.9);
    animation: heartBeat 1.5s ease-in-out infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25%       { transform: scale(1.2); }
    50%       { transform: scale(1); }
    75%       { transform: scale(1.1); }
}
header h1 {
    font-size: 2.4em;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 0 0 8px;
    color: white;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-subtitle {
    font-size: 1.05em;
    color: rgba(255,255,255,0.9);
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 10px;
}
.header-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.header-stats span {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.92em;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ── BGM ── */
#bgm-control {
    position: fixed;
    top: 16px; right: 20px;
    z-index: 9990;
    border-radius: 50px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(255,111,145,0.18);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--pink-lt);
}
#bgm-control button {
    background: linear-gradient(135deg, var(--pink), var(--peach));
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.95em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-weight: 700;
    font-family: var(--font);
}
#bgm-control button:hover { opacity: 0.85; transform: scale(1.04); }
#bgm-control audio { display: none; }

/* ── Main ── */
main {
    padding: 28px 3vw 0;
    max-width: 1300px;
    margin: 0 auto;
}

/* ── 时间轴区域 ── */
#controls { margin-bottom: 6px; position: relative; z-index: 20; }

#timeline-container {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    padding: 10px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--pink-lt);
    gap: 0;
}

/* 箭头导航按钮（爱心款） */
.nav-arrow {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
    color: white;
    font-size: 1.5em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.25,1.5,.5,1);
    box-shadow: 0 3px 12px rgba(255,111,145,0.35);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}
.nav-arrow:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 20px rgba(255,111,145,0.5);
}
.nav-arrow:active { transform: scale(0.95); }
/* 爱心旋转方向：上一站向左倾90°，下一站向右倾90° */
#prev-date { transform: rotate(-90deg); }
#prev-date:hover { transform: rotate(-90deg) scale(1.12); }
#prev-date:active { transform: rotate(-90deg) scale(0.95); }
#next-date { transform: rotate(90deg); }
#next-date:hover { transform: rotate(90deg) scale(1.12); }
#next-date:active { transform: rotate(90deg) scale(0.95); }

.timeline-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    min-width: 0;
}

.timeline-track-wrap {
    flex: 1;
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

#timeline {
    -webkit-appearance: none;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--pink-lt) 0%, #ffe0b2 100%);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}
#timeline-progress {
    position: absolute;
    left: 0; top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--pink) 0%, var(--peach) 100%);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    transition: width 0.3s;
    min-width: 6px;
}
#timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    position: relative;
    z-index: 3;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(255,111,145,0.5);
    cursor: pointer;
    transition: transform 0.2s;
}
#timeline::-webkit-slider-thumb:hover { transform: scale(1.18); }
#timeline::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
    border: 3px solid #fff;
    cursor: pointer;
}

#selected-date {
    font-weight: 700;
    color: var(--pink);
    font-size: 0.95em;
    min-width: 92px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-align: right;
}

#play-timeline {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--pink-lt);
    background: linear-gradient(135deg, #fff0f5, #fff8ec);
    color: var(--pink);
    font-size: 1em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255,111,145,0.1);
}
#play-timeline:hover {
    background: var(--pink);
    color: white;
    box-shadow: 0 4px 12px rgba(255,111,145,0.3);
    transform: scale(1.08);
}

/* 年份标签栏（等距排列，按实际年份跨度定位） */
#timeline-label-bar {
    position: relative;
    height: 28px;
    margin: 6px 80px 10px 80px;
    overflow: visible;
    z-index: 20;
}
.timeline-year-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.72em;
    color: #c0a090;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    user-select: none;
    text-align: center;
}
.timeline-year-label:hover { color: var(--pink); }
.timeline-year-label::before {
    content: '|';
    display: block;
    text-align: center;
    font-size: 0.85em;
    margin-bottom: 1px;
    opacity: 0.5;
}


/* ── 地图面板 + 画廊布局 ── */
#map-and-gallery {
    display: flex;
    gap: 2vw;
    align-items: stretch;
    min-height: 500px;
    height: 540px;      /* 固定整体高度，地图和画廊并排等高 */
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

/* 地图面板 */
#map-panel {
    flex: 1 1 56%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid var(--pink-lt);
    background: #fff7f0;
    min-height: 0;    /* 允许 flex 收缩 */
}
#map-header {
    background: linear-gradient(90deg, #fff0f5, #fff8ec);
    border-bottom: 1.5px solid var(--pink-lt);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
#map-location-title {
    font-size: 1em;
    font-weight: 800;
    color: var(--text-dk);
    letter-spacing: 0.5px;
}
#map-location-date {
    font-size: 0.82em;
    color: var(--pink);
    font-weight: 700;
    background: var(--pink-lt);
    border-radius: 20px;
    padding: 2px 10px;
    white-space: nowrap;
}
#map {
    flex: 1;
    min-height: 0;    /* flex 子项允许收缩 */
    background: #f5f0eb;
}
#map-footer {
    background: linear-gradient(90deg, #fff0f5, #fff8ec);
    border-top: 1.5px solid var(--pink-lt);
    padding: 7px 18px;
    text-align: center;
    flex-shrink: 0;
}
#map-path-hint {
    font-size: 0.8em;
    color: #c0a090;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 高德地图爱心标记 */
.map-heart-marker {
    font-size: 16px;
    text-align: center;
    line-height: 24px;
    width: 24px; height: 24px;
    color: #ff6f91;
    text-shadow: 0 1px 4px rgba(255,111,145,0.4);
    transition: all 0.3s;
    opacity: 0.85;
}
.map-heart-marker.active {
    font-size: 22px;
    color: #f43f5e;
    text-shadow: 0 0 10px rgba(255,111,145,0.8);
    opacity: 1;
    animation: heartBeat 1.2s ease-in-out infinite;
}
.map-heart-marker.pulse {
    animation: heartBeat 0.8s ease-in-out 3;
    color: #f43f5e;
    text-shadow: 0 0 12px rgba(255,111,145,0.9);
}

/* ── 画廊 ── */
#gallery {
    flex: 1 1 40%;
    min-width: 260px;
    height: 100%;         /* 撑满父容器固定高度 */
    max-height: 100%;     /* 不超出父容器 */
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1.5px solid var(--pink-lt);
    box-sizing: border-box;
}
#gallery::-webkit-scrollbar { width: 4px; }
#gallery::-webkit-scrollbar-track { background: transparent; }
#gallery::-webkit-scrollbar-thumb { background: var(--pink-lt); border-radius: 4px; }

#gallery-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e8c0c8;
    gap: 10px;
}
.placeholder-heart { font-size: 3em; animation: heartBeat 2s infinite; }
#gallery-placeholder p { text-align: center; font-size: 0.95em; line-height: 1.7; margin: 0; }

/* ── 照片卡片 ── */
.photo-card {
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.25, 1.5, .5, 1);
    padding: 2px;
    margin-bottom: 10px;
    background: transparent;
    position: relative;
}
.photo-card:last-child { margin-bottom: 0; }
.photo-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--pink-lt), #fff3e0);
    box-shadow: 0 6px 20px rgba(255,111,145,0.15);
}
.photo-card.active {
    background: linear-gradient(135deg, #ffe4ec, #fff3e0);
    box-shadow: 0 4px 16px rgba(255,111,145,0.2);
    border-left: 3px solid var(--pink);
}
.photo-card-inner { padding: 10px 12px; border-radius: 12px; }
.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}
.photo-title-text {
    font-size: 1.05em;
    font-weight: 800;
    color: var(--text-dk);
    line-height: 1.3;
    flex: 1;
}
.photo-date-badge {
    font-size: 0.78em;
    background: var(--pink-lt);
    color: var(--pink);
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
    font-weight: 700;
    flex-shrink: 0;
}
.photo-img-wrap {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #f0e8e8;
    /* 限制最大高度，避免竖版大图撑破布局；等比压缩不裁剪 */
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.responsive-photo {
    width: 100%;
    height: auto;
    max-height: 260px;    /* 等比压缩上限，超出此高度时等比缩小 */
    /* 不裁剪：使用 contain 完整显示整张照片 */
    object-fit: contain;
    border-radius: 10px;
    display: block;
    transition: transform 0.4s;
}
.photo-card:hover .responsive-photo { transform: scale(1.02); }
.photo-description {
    font-size: 0.88em;
    color: #a07060;
    line-height: 1.65;
    white-space: pre-line;
    padding-left: 8px;
    border-left: 2px solid var(--pink-lt);
    margin-bottom: 10px;
}

/* 照片卡片底部操作栏 */
.photo-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}
.action-like-btn, .action-comment-btn {
    flex: 1;
    padding: 6px 8px;
    border-radius: 20px;
    border: 1.5px solid var(--pink-lt);
    background: rgba(255,255,255,0.8);
    color: #c07080;
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font);
}
.action-like-btn:hover, .action-comment-btn:hover {
    background: linear-gradient(135deg, #ffe4ec, #fff3e0);
    border-color: var(--pink);
    color: var(--pink);
    transform: scale(1.04);
}

/* ── 底部操作栏 ── */
#bottom-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px 0 8px;
    flex-wrap: wrap;
}
#show-all-btn {
    background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,111,145,0.3);
    transition: all 0.2s;
    font-family: var(--font);
}
#show-all-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,111,145,0.4); }
#total-stats {
    color: #b07060;
    font-size: 0.9em;
    font-weight: 600;
}

/* ── 地图 Popup ── */
.leaflet-popup-content-wrapper {
    background: rgba(255,255,255,0.96) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(255,111,145,0.2) !important;
    border: 1.5px solid var(--pink-lt) !important;
    padding: 0 !important;
    min-width: 110px;
}
.leaflet-popup-content { margin: 0 !important; padding: 0 !important; }
.leaflet-popup-tip { background: rgba(255,255,255,0.96) !important; }
.marker-popup-content { padding: 10px 16px; text-align: center; }
.marker-popup-title { font-size: 0.93em; font-weight: 800; color: var(--text-dk); margin-bottom: 2px; }
.marker-popup-date { font-size: 0.78em; color: var(--pink); font-weight: 600; }


/* ============================================================
   点赞/评论 浮层
   ============================================================ */
#reaction-modal {
    position: fixed;
    inset: 0;
    z-index: 88888;
    display: none;
    align-items: center;
    justify-content: center;
}
#reaction-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(80,30,50,0.45);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}
#reaction-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 60px rgba(255,111,145,0.25);
    width: min(480px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 24px 24px;
    border: 1.5px solid var(--pink-lt);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(.25,1.5,.5,1);
}
#reaction-modal.open #reaction-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}
#reaction-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--pink-lt);
    color: var(--pink);
    font-size: 0.9em;
    font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
#reaction-close:hover { background: var(--pink); color: white; }

#reaction-photo-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1.5px dashed var(--pink-lt);
}
#reaction-title {
    font-size: 1.08em;
    font-weight: 800;
    color: var(--text-dk);
    flex: 1;
}
#reaction-date-badge {
    font-size: 0.78em;
    background: var(--pink-lt);
    color: var(--pink);
    border-radius: 20px;
    padding: 3px 10px;
    font-weight: 700;
}

/* 点赞区 */
#like-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
    min-height: 60px;
}
.like-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fff0f5, #fff8ec);
    border: 2px solid var(--pink-lt);
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 1.05em;
    font-weight: 800;
    color: #c07080;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.25,1.5,.5,1);
    font-family: var(--font);
}
.like-btn:hover {
    background: linear-gradient(135deg, #ffe4ec, #fff3e0);
    border-color: var(--pink);
    transform: scale(1.06);
}
.like-btn.liked {
    background: linear-gradient(135deg, var(--pink) 0%, var(--peach) 100%);
    border-color: var(--pink);
    color: white;
    box-shadow: 0 4px 16px rgba(255,111,145,0.4);
}
#like-count {
    font-size: 1.05em;
    min-width: 20px;
    text-align: center;
}

/* 爱心飘起动画 */
#like-floats {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.like-float {
    position: absolute;
    bottom: 0;
    font-size: 1.4em;
    animation: floatUp 1.2s ease-out forwards;
    pointer-events: none;
}
@keyframes floatUp {
    0%   { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-80px) scale(0.5); opacity: 0; }
}

/* 评论区 */
#comment-section {
    border-top: 1.5px dashed var(--pink-lt);
    padding-top: 16px;
}
#comment-list {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#comment-list::-webkit-scrollbar { width: 3px; }
#comment-list::-webkit-scrollbar-thumb { background: var(--pink-lt); border-radius: 4px; }
.no-comment {
    text-align: center;
    color: #c8a0b0;
    font-size: 0.88em;
    padding: 20px 0;
}
.comment-item {
    border-radius: 12px;
    padding: 10px 14px;
    position: relative;
}
.comment-miao {
    background: linear-gradient(135deg, #fff0f5, #fff8ec);
    border-left: 3px solid var(--pink);
}
.comment-mai {
    background: linear-gradient(135deg, #f0f4ff, #eef8ff);
    border-left: 3px solid #6bb3ff;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-author {
    font-size: 0.85em;
    font-weight: 800;
    color: var(--text-dk);
}
.comment-time {
    font-size: 0.75em;
    color: #b8a0a0;
    flex: 1;
}
.comment-del {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255,111,145,0.1);
    color: #d09090;
    font-size: 0.7em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    opacity: 0;
}
.comment-item:hover .comment-del { opacity: 1; }
.comment-del:hover { background: var(--pink); color: white; }
.comment-text { font-size: 0.9em; color: var(--text); line-height: 1.55; }

#comment-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
#comment-author {
    border: 1.5px solid var(--pink-lt);
    border-radius: 20px;
    padding: 7px 10px;
    font-size: 0.88em;
    color: var(--text-dk);
    font-weight: 700;
    background: #fff;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    font-family: var(--font);
}
#comment-input {
    flex: 1;
    border: 1.5px solid var(--pink-lt);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9em;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font);
    background: #fff;
}
#comment-input:focus { border-color: var(--pink); }
#comment-submit {
    background: linear-gradient(135deg, var(--pink), var(--peach));
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.88em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font);
    flex-shrink: 0;
}
#comment-submit:hover { opacity: 0.88; transform: scale(1.04); }


/* ── Footer ── */
footer {
    text-align: center;
    color: rgba(255,255,255,0.95);
    padding: 22px 0 12px;
    font-size: 1em;
    font-weight: 700;
    background: linear-gradient(110deg, var(--pink) 0%, var(--peach) 100%);
    box-shadow: 0 -2px 16px rgba(255,111,145,0.15);
    letter-spacing: 1px;
    margin-top: 28px;
}


/* ============================================================
   图片编辑面板
   ============================================================ */
#edit-panel {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}
#edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(50,20,60,0.5);
    backdrop-filter: blur(4px);
}
#edit-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 60px rgba(255,111,145,0.3);
    width: min(580px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border: 2px solid var(--pink-lt);
}
.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px dashed var(--pink-lt);
    flex-wrap: wrap;
    gap: 10px;
}
.edit-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.edit-tab {
    padding: 6px 14px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 20px;
    background: transparent;
    color: var(--text);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.edit-tab:hover { border-color: var(--pink); color: var(--pink); }
.edit-tab.active {
    background: var(--pink);
    border-color: var(--pink);
    color: white;
}
#edit-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--pink-lt);
    color: var(--pink);
    font-size: 1em;
    font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
#edit-close:hover { background: var(--pink); color: white; }

.edit-section {
    margin-bottom: 18px;
}
.edit-label {
    display: block;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-dk);
    margin-bottom: 8px;
}

/* 照片选择器 */
.photo-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding: 8px;
    background: #faf8f5;
    border-radius: 12px;
    border: 1px solid var(--pink-lt);
}
.photo-select-item {
    width: 60px; height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.photo-select-item:hover { border-color: var(--pink-lt); transform: scale(1.05); }
.photo-select-item.active { border-color: var(--pink); box-shadow: 0 2px 8px rgba(255,111,145,0.4); }
.photo-select-item img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* 预览区 */
.edit-preview {
    background: #faf8f5;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--pink-lt);
}
.edit-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}
.edit-preview-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text);
}
#edit-preview-title { font-weight: 700; color: var(--text-dk); }
#edit-preview-date { color: var(--pink); }

/* 大小滑块 */
#edit-size-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--pink-lt), var(--pink));
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}
#edit-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--pink);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(255,111,145,0.4);
    cursor: pointer;
}
.size-presets {
    display: flex;
    gap: 6px;
}
.size-preset {
    flex: 1;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1.5px solid var(--pink-lt);
    background: #fff;
    color: var(--text);
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.size-preset:hover { border-color: var(--pink); color: var(--pink); }
.size-preset.active { background: var(--pink); border-color: var(--pink); color: white; }

/* 输入框 */
#edit-title, #edit-date {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 12px;
    font-size: 0.95em;
    font-family: var(--font);
    color: var(--text-dk);
    outline: none;
    transition: border-color 0.2s;
}
#edit-title:focus, #edit-date:focus, #edit-description:focus {
    border-color: var(--pink);
}
#edit-description {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 12px;
    font-size: 0.95em;
    font-family: var(--font);
    color: var(--text-dk);
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

/* 操作按钮 */
.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pink-lt);
}
.edit-btn-secondary, .edit-btn-primary {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.edit-btn-secondary {
    background: #fff;
    border: 1.5px solid var(--pink-lt);
    color: var(--text);
}
.edit-btn-secondary:hover {
    border-color: var(--pink);
    color: var(--pink);
}
.edit-btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--peach));
    border: none;
    color: white;
    box-shadow: 0 4px 16px rgba(255,111,145,0.3);
}
.edit-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,111,145,0.4);
}
.edit-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 保存状态 */
.edit-status {
    text-align: center;
    margin-top: 12px;
    font-size: 0.88em;
    font-weight: 600;
    min-height: 20px;
}
.edit-status.success { color: #4caf50; }
.edit-status.error { color: #f44336; }
.edit-status.saving { color: var(--pink); }

/* 编辑模式按钮 */
#edit-mode-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9990;
    padding: 10px 18px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border: 1.5px solid var(--pink-lt);
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-dk);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,111,145,0.15);
    transition: all 0.2s;
    font-family: var(--font);
}
#edit-mode-btn:hover {
    background: var(--pink);
    border-color: var(--pink);
    color: white;
    transform: scale(1.05);
}
#edit-mode-btn.active {
    background: var(--pink);
    border-color: var(--pink);
    color: white;
}

/* 响应式 */
@media (max-width: 800px) {
    #edit-box { padding: 16px; }
    .photo-selector { max-height: 120px; }
    .photo-select-item { width: 50px; height: 50px; }
}
#branch-select {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0010 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}
#branch-select.visible { opacity: 1; }
#branch-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 70px 70px, 120px 120px;
    background-position: 0 0, 35px 35px;
    animation: twinkle 5s ease-in-out infinite alternate;
}
#branch-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
#branch-title {
    color: rgba(255,255,255,0.95);
    font-size: 1.7em;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(255,111,145,0.6);
    margin-bottom: 10px;
    animation: hintFloat 2.5s ease-in-out infinite alternate;
}
#branch-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 1em;
    letter-spacing: 1.5px;
    margin-bottom: 48px;
}
#branch-cards {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}
.branch-card {
    width: 220px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255,111,145,0.3);
    border-radius: 24px;
    padding: 36px 24px 28px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(.25,1.5,.5,1);
    color: rgba(255,255,255,0.9);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.branch-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255,111,145,0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
.branch-card:hover::before { opacity: 1; }
.branch-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(255,111,145,0.7);
    box-shadow: 0 20px 60px rgba(255,111,145,0.25);
    background: rgba(255,255,255,0.13);
}
.branch-card-icon {
    font-size: 3.2em;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(255,200,100,0.6));
}
.branch-card-name {
    font-size: 1.35em;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: #fff;
}
.branch-card-desc {
    font-size: 0.88em;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    margin-bottom: 20px;
}
.branch-card-arrow {
    font-size: 1.4em;
    color: rgba(255,111,145,0.8);
    font-weight: 900;
    transition: transform 0.3s;
}
.branch-card:hover .branch-card-arrow { transform: translateX(6px); }


/* ── 返回按钮 ── */
.back-home-btn {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 50px;
    padding: 7px 18px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    font-family: var(--font);
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 10;
}
.back-home-btn:hover {
    background: rgba(255,255,255,0.32);
    transform: translateX(-3px);
}

/* 页面进入动画 */
#map-page, #tree-page {
    opacity: 0;
    transition: opacity 0.4s ease;
}
#map-page.page-visible, #tree-page.page-visible {
    opacity: 1;
}


/* ============================================================
   幸福果实页面 · 橘暖蜜桃系
   ============================================================ */
#tree-page {
    min-height: 100vh;
    /* 颜色A（浅化版）：樱花玫瑰 — 降低饱和度、提升亮度 */
    background: linear-gradient(180deg, #784860 0%, #c06080 35%, #f0a0b8 70%, #ffe8f2 100%);
    display: flex;
    flex-direction: column;
}
#tree-page header {
    background: linear-gradient(110deg, #f06088 0%, #f8a0b8 50%, #ffe0eb 100%);
}
#tree-container {
    flex: 1;
    position: relative;
    min-height: 580px;
    min-width: 0;
}
#tree-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}
#tree-fruits-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ── 爱心果实 ── */
.tree-fruit {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    text-align: center;
    pointer-events: all;
    transition: transform 0.25s cubic-bezier(.25,1.5,.5,1);
    user-select: none;
}
.tree-fruit:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 100;
}
.fruit-body {
    position: relative;
    display: inline-block;
    line-height: 1;
    filter: drop-shadow(0 6px 18px rgba(180,60,100,0.32));
    animation: fruitSway 3.5s ease-in-out infinite alternate;
}
@keyframes fruitSway {
    from { transform: rotate(-5deg) scale(1); }
    to   { transform: rotate(5deg) scale(1.05); }
}
.tree-fruit:hover .fruit-body { animation: none; }
.tree-fruit.visited .fruit-body {
    filter: drop-shadow(0 4px 16px rgba(160,50,90,0.42));
}
.fruit-body svg {
    width: 48px;
    height: 48px;
}
.fruit-visited-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: #e8305a;
    border-radius: 50%;
    border: 2px solid #fff;
    color: white;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.fruit-label {
    font-size: 0.62em;
    color: rgba(255,255,255,0.96);
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(60,10,30,0.7);
    white-space: nowrap;
    margin-top: 3px;
    letter-spacing: 0.3px;
    background: rgba(80,15,35,0.52);
    border-radius: 8px;
    padding: 2px 7px;
}

/* ── 爱心果实弹窗（玫瑰粉系）── */
#fruit-modal {
    position: fixed;
    inset: 0;
    z-index: 99000;
    display: none;
    align-items: center;
    justify-content: center;
}
#fruit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30,5,18,0.72);
    backdrop-filter: blur(6px);
    transition: opacity 0.3s;
}
#fruit-modal-box {
    position: relative;
    z-index: 1;
    background: #fff7f9;
    border-radius: 22px;
    box-shadow: 0 20px 70px rgba(220,50,80,0.22);
    width: min(560px, 94vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px 24px 24px;
    border: 2px solid rgba(232,100,140,0.32);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(.25,1.5,.5,1);
}
#fruit-modal.open #fruit-modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}
#fruit-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(232,60,100,0.14);
    color: #c02050;
    font-size: 0.9em;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
#fruit-modal-close:hover {
    background: #e8305a;
    color: white;
}
#fruit-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px dashed rgba(232,100,140,0.3);
}
#fruit-modal-era {
    font-size: 1.25em;
    font-weight: 900;
    color: #8b1535;
    flex: 1;
}
#fruit-modal-range {
    font-size: 0.82em;
    background: rgba(232,100,140,0.16);
    color: #c03060;
    border-radius: 20px;
    padding: 3px 12px;
    font-weight: 700;
}
#fruit-photo-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.fruit-photo-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: linear-gradient(135deg, #fff2f5, #ffe8f0);
    border-radius: 14px;
    border: 1px solid rgba(232,100,140,0.18);
    transition: all 0.2s;
}
.fruit-photo-item:hover {
    box-shadow: 0 4px 18px rgba(220,50,80,0.12);
    transform: translateY(-2px);
}
.fruit-photo-img-wrap {
    width: 120px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8dce4;
    flex-shrink: 0;
}
.fruit-photo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fruit-img-error {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: #d08898;
}
.fruit-photo-text { flex: 1; min-width: 0; }
.fruit-photo-title {
    font-size: 1em;
    font-weight: 800;
    color: #8b1535;
    margin-bottom: 3px;
}
.fruit-photo-date {
    font-size: 0.78em;
    color: #c03060;
    font-weight: 700;
    margin-bottom: 6px;
}
.fruit-photo-desc {
    font-size: 0.86em;
    color: #7a3848;
    line-height: 1.65;
}
#fruit-modal-box::-webkit-scrollbar { width: 4px; }
#fruit-modal-box::-webkit-scrollbar-thumb { background: rgba(232,100,140,0.32); border-radius: 4px; }

/* ── 幸福果实 BGM 控制条 ── */
/* 旧 #tree-bgm-control 已迁移到侧边栏 #tree-sidebar */

/* ── 幸福果实页面：双栏布局 ── */
#tree-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* 左侧面板 */
#tree-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: rgba(90, 25, 55, 0.42);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px;
    border-right: 1px solid rgba(255, 180, 200, 0.22);
    overflow-y: auto;
}
.tree-sidebar-card {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 150, 175, 0.18);
}
.tree-sidebar-label {
    font-size: 0.78em;
    color: rgba(255, 220, 235, 0.85);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.8px;
}

/* 侧边栏 BGM */
.tree-bgm-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.tree-bgm-btn {
    flex: 1;
    padding: 7px 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 170, 195, 0.35);
    background: rgba(240, 100, 140, 0.12);
    color: #ffd8e8;
    font-size: 0.8em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    white-space: nowrap;
}
.tree-bgm-btn:hover {
    background: rgba(240, 100, 140, 0.3);
    transform: scale(1.03);
    color: #fff;
}
.tree-bgm-name {
    color: rgba(255, 230, 240, 0.65);
    font-size: 0.7em;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.2px;
}

/* 侧边栏进度 */
.tree-progress-text {
    font-size: 1.05em;
    font-weight: 800;
    color: #ffb0c5;
    margin-bottom: 8px;
}
.tree-progress-bar-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}
.tree-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f06088, #ffa0b8);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* 侧边栏重置按钮 */
.tree-reset-btn {
    width: 100%;
    padding: 9px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 140, 170, 0.35);
    background: rgba(232, 60, 100, 0.12);
    color: #ffb8cc;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.tree-reset-btn:hover {
    background: rgba(232, 60, 100, 0.3);
    color: #fff;
    transform: scale(1.03);
}

/* 侧边栏提示文字 */
.tree-sidebar-tip {
    border: 1px dashed rgba(255, 160, 185, 0.28);
    background: transparent;
}
.tree-sidebar-tip p {
    margin: 0;
    color: rgba(255, 210, 220, 0.68);
    font-size: 0.82em;
    line-height: 1.6;
    text-align: center;
}

/* 照片加载失败样式 */
.photo-img-error {
    padding: 20px;
    text-align: center;
    color: #c0a090;
    font-size: 0.88em;
}


/* ── 响应式 ── */
@media (max-width: 800px) {
    #map-and-gallery {
        flex-direction: column;
        height: auto;        /* 移动端不固定高度，纵向排列 */
    }
    #map-panel, #gallery {
        min-width: 0;
        width: 100%;
        flex: none;
    }
    #map { min-height: 320px; }
    #gallery { max-height: 400px; height: auto; }
    #timeline-container {
        padding: 8px 10px;
    }
    .nav-arrow { width: 38px; height: 38px; font-size: 1.2em; }
    #prev-date { transform: rotate(-90deg); }
    #prev-date:hover { transform: rotate(-90deg) scale(1.12); }
    #next-date { transform: rotate(90deg); }
    #next-date:hover { transform: rotate(90deg) scale(1.12); }
    .timeline-body { padding: 0 8px; gap: 6px; }
    header h1 { font-size: 1.7em; }
    #timeline-label-bar { margin: 2px 56px 8px 56px; }
    #gift-box { width: 110px; height: 110px; }
    #gift-lid { width: 126px; }
    #gift-body { width: 110px; height: 78px; }
    #branch-cards { gap: 18px; }
    .branch-card { width: 160px; padding: 28px 16px 22px; }
    .branch-card-icon { font-size: 2.4em; }
    .branch-card-name { font-size: 1.1em; }
    .fruit-photo-item { flex-direction: column; }
    .fruit-photo-img-wrap { width: 100%; height: 160px; }
    #tree-container { min-height: 420px; }
    #tree-main { flex-direction: column; }
    #tree-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(255,160,120,0.2);
        overflow-y: visible;
    }
    .tree-sidebar-card {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 10px;
    }
    .tree-sidebar-tip { display: none; }
}

/* ── 幸福果实编辑区 ── */
#fruit-year-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 10px;
    font-size: 0.9em;
    font-family: inherit;
    color: var(--text);
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e8a0b0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
#fruit-era-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-dk);
    text-align: center;
    transition: border-color 0.2s;
}
#fruit-era-input:focus { outline: none; border-color: var(--pink); }
/* 旧 fruit-era-preview 已废弃，保留空 rule 避免报错 */
.fruit-era-preview { display: none; }

/* ── 果实编辑器：果实列表 tabs ── */
.fruit-list-section { padding-bottom: 4px; }
.fruit-edit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.fruit-edit-toolbar-btns { display: flex; gap: 6px; }
.edit-btn-sm {
    padding: 4px 10px;
    border-radius: 16px;
    border: 1.5px solid var(--pink-lt);
    background: transparent;
    color: var(--text);
    font-size: 0.78em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}
.edit-btn-sm:hover { border-color: var(--pink); color: var(--pink); }
.edit-btn-danger { border-color: #ffbaba; color: #c06060; }
.edit-btn-danger:hover { border-color: #e05050; color: #e05050; background: #fff5f5; }

#fruit-list-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 110px;
    overflow-y: auto;
    padding: 4px 0 2px;
}
.fruit-tab-item {
    padding: 5px 12px;
    border: 1.5px solid var(--pink-lt);
    border-radius: 18px;
    background: transparent;
    font-size: 0.82em;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.fruit-tab-item:hover { border-color: var(--pink); color: var(--pink); }
.fruit-tab-item.active {
    background: var(--pink);
    border-color: var(--pink);
    color: white;
    font-weight: 700;
}

/* ── 果实照片选择器 ── */
.fruit-photo-hint {
    font-size: 0.78em;
    color: #b0a0a0;
    font-weight: 400;
    margin-left: 6px;
}
#fruit-photo-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 7px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 2px;
}
.fruit-picker-item {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.15s;
    background: #f8f0f3;
}
.fruit-picker-item:hover { border-color: var(--pink-lt); transform: scale(1.04); }
.fruit-picker-item.selected { border-color: var(--pink); }
.fruit-picker-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.fruit-picker-label {
    font-size: 0.65em;
    color: var(--text);
    text-align: center;
    padding: 2px 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fruit-picker-date {
    font-size: 0.6em;
    color: #b0a0a0;
    text-align: center;
    padding: 0 3px 3px;
}
.fruit-picker-check {
    position: absolute;
    top: 3px;
    right: 4px;
    background: var(--pink);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.65em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* ── 已选照片预览 ── */
#fruit-selected-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
    padding: 4px 0;
}
.fruit-sel-thumb {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--pink-lt);
}
.fruit-sel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fruit-sel-order {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 0.6em;
    background: rgba(0,0,0,0.45);
    color: white;
    border-radius: 4px;
    padding: 0 3px;
    font-weight: 700;
}

/* ── 新增照片表单 ── */
#add-photo-form {
    margin-top: 6px;
    padding: 14px;
    background: rgba(255,240,245,0.6);
    border-radius: 12px;
    border: 1.5px dashed rgba(220,120,140,0.4);
}
.add-photo-field {
    margin-bottom: 12px;
}
.add-photo-field label {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: #a05060;
    margin-bottom: 4px;
}
.add-photo-field input[type="text"],
.add-photo-field input[type="date"],
.add-photo-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid rgba(220,120,140,0.35);
    border-radius: 10px;
    font-size: 0.88em;
    background: rgba(255,255,255,0.8);
    color: #5a2030;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    resize: vertical;
}
.add-photo-field input:focus,
.add-photo-field textarea:focus {
    border-color: #e87890;
    box-shadow: 0 0 0 3px rgba(232,120,144,0.12);
    background: #fff;
}
.add-photo-drop-zone {
    border: 2px dashed rgba(220,120,140,0.45);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255,255,255,0.6);
    transition: border-color 0.2s, background 0.2s;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c07888;
    font-size: 0.82em;
    line-height: 1.6;
}
.add-photo-drop-zone:hover,
.add-photo-drop-zone.dragover {
    border-color: #e87890;
    background: rgba(255,230,235,0.5);
}
.add-photo-drop-zone.has-file {
    border-style: solid;
    border-color: #d46080;
    background: rgba(255,240,244,0.8);
}
#add-photo-preview-wrap {
    width: 100%;
}
#add-photo-preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
}
#add-photo-preview-name {
    font-size: 0.75em;
    color: #a05060;
    word-break: break-all;
    text-align: center;
}

/* ── 密码门登录弹窗（玫瑰粉系）── */
#login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#login-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 2, 8, 0.78);
    backdrop-filter: blur(14px);
    animation: loginFadeIn 0.5s ease;
}
@keyframes loginFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#login-card {
    position: relative;
    z-index: 1;
    background: linear-gradient(165deg, #fff5f7 0%, #ffe0ea 50%, #ffd6e2 100%);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(200, 30, 60, 0.28), 0 4px 14px rgba(0,0,0,0.10);
    width: min(380px, 88vw);
    padding: 36px 28px 30px;
    text-align: center;
    border: 2px solid rgba(232, 100, 140, 0.36);
    animation: loginCardIn 0.5s cubic-bezier(.25,1.5,.5,1);
}
@keyframes loginCardIn {
    from { transform: scale(0.85) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
/* 密码错误抖动 */
#login-card.shake {
    animation: loginShake 0.45s ease;
}
@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-10px); }
    30%       { transform: translateX(10px); }
    45%       { transform: translateX(-7px); }
    60%       { transform: translateX(7px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}
#login-icon {
    font-size: 2.6em;
    margin-bottom: 6px;
}
#login-title {
    font-size: 1.35em;
    font-weight: 700;
    color: #b84058;
    margin-bottom: 4px;
}
#login-subtitle {
    font-size: 0.82em;
    color: #c07888;
    margin-bottom: 22px;
    line-height: 1.5;
}
#login-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 6px;
}
.login-field {
    text-align: left;
}
.login-field label {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: #a05060;
    margin-bottom: 4px;
    padding-left: 2px;
}
.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.8px solid rgba(220, 120, 140, 0.38);
    border-radius: 12px;
    font-size: 0.95em;
    background: rgba(255,255,255,0.72);
    color: #5a2030;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
}
.login-field input:focus {
    border-color: #e87890;
    box-shadow: 0 0 0 4px rgba(232, 120, 144, 0.14);
    background: #fff;
}
.login-field input::placeholder {
    color: #c8a0a8;
}
#login-error {
    color: #d4425a;
    font-size: 0.78em;
    font-weight: 600;
    min-height: 1.2em;
    margin: 4px 0 10px;
    opacity: 0;
    transition: opacity 0.2s;
}
#login-error.show {
    opacity: 1;
}
#login-submit {
    width: 100%;
    padding: 13px 0;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #e87890, #d4425a);
    color: #fff;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: transform 0.18s, box-shadow 0.18s, background 0.25s;
    box-shadow: 0 4px 16px rgba(210, 60, 90, 0.32);
}
#login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(210, 60, 90, 0.42);
    background: linear-gradient(135deg, #ee8c9e, #de5470);
}
#login-submit:active {
    transform: scale(0.97);
}
