:root {
    --bg-color: #F9F6F0;
    --text-color: #4A4A4A;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow: 0 16px 32px rgba(0,0,0,0.06);
}

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

body, html {
    width: 100%; height: 100%;
    font-family: 'Nunito', 'Segoe UI', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

#app {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    background-image: radial-gradient(circle at top right, #fff5e6, transparent 400px),
                      radial-gradient(circle at bottom left, #e6f2ff, transparent 400px);
}

.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.handwriting-title {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    font-weight: bold;
    color: #6D4C41;
}

/* ---------- 移动端布局 (Mobile First) ---------- */
.panel {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: calc(100% - 70px);
}

.panel-content { padding: 24px; height: 100%; overflow-y: auto; }

#panel-stats, #panel-album {
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px);
    background-color: var(--bg-color);
}

#panel-stats.active, #panel-album.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#panel-map {
    z-index: 1;
    height: calc(100% - 70px);
}

#map { width: 100%; height: 100%; border-radius: inherit; }

.map-title-overlay {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    z-index: 400;
    color: #6D4C41;
    text-shadow: 0 4px 12px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.8);
    pointer-events: none;
}

/* 备案信息角标 (手账风毛玻璃胶囊) */
.map-beian-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    font-size: 0.72rem;
    color: rgba(93, 64, 55, 0.75);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-family: 'Nunito', 'Segoe UI', -apple-system, sans-serif;
}
.map-beian-overlay a {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.map-beian-overlay a:hover { color: #6D4C41; text-decoration: underline; }
.beian-sep { opacity: 0.5; }

/* 移动端: 避开底部导航栏，角标移至面板右上角 */
@media (max-width: 1023px) {
    .map-beian-overlay { top: 16px; bottom: auto; }
}

/* 底部导航栏 */
#mobile-nav {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 90px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    border-radius: 40px 40px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    font-weight: bold;
    color: #A1A1A1;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-item.active {
    color: #6D4C41;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-icon-img {
    width: 58px;  /* 直接放大到近两倍，视觉张力拉满 */
    height: 58px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* ---------- 电脑端布局 (Desktop) ---------- */
@media (min-width: 1024px) {
    #mobile-nav { display: none; }
    #app { flex-direction: row; padding: 32px; gap: 32px; }
    #panel-stats, #panel-album {
        position: static;
        height: 100%;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        border-radius: 32px;
        z-index: 10;
        background: var(--glass-bg);
    }
    #panel-stats {
        width: 350px;
    }
    #panel-album {
        width: 600px;
    }
    #panel-map {
        position: relative;
        flex: 1;
        height: 100%;
        border-radius: 32px;
        overflow: hidden;
        z-index: 1;
        box-shadow: var(--shadow);
    }
}

/* ---------- 内部组件样式 ---------- */
.subtitle { color: #888; font-size: 0.9rem; margin-top: 8px; margin-bottom: 24px; }
.stats-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.stat-item { 
    width: calc(50% - 8px); 
    background: rgba(255,255,255,0.7); 
    padding: 24px 16px; 
    border-radius: 24px; 
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.stat-num { display: block; font-size: 2.5rem; font-weight: 900; line-height: 1; margin-bottom: 8px; font-family: 'Comic Sans MS', cursive;}
.stat-label { font-size: 0.95rem; color: #777; font-weight: bold; }

.mascot-header { text-align: center; margin-bottom: 16px; }
.mascot-img { width: 100%; border-radius: 24px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

/* 相册过滤器 (手账风整合设计) */
.album-filters {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 24px;
    background: #FAF7F2;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid #EADDD7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    align-items: center;
}
.filter-wrapper {
    display: flex;
    align-items: center;
    background: #FFF;
    border: 2px solid #D7CCC8;
    border-radius: 16px;
    padding: 6px 12px;
    flex: 1;
    transition: all 0.3s ease;
}
.filter-wrapper:focus-within {
    border-color: #FFCC80;
    box-shadow: 0 0 0 3px rgba(255, 204, 128, 0.2);
}
.filter-label {
    font-size: 0.85rem;
    color: #A1887F;
    font-weight: bold;
    margin-right: 8px;
    white-space: nowrap;
}
.hand-drawn-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #5D4037;
    outline: none;
    font-family: 'Nunito', 'Comic Sans MS', cursive, sans-serif;
    font-size: 0.95rem;
    width: 100%;
}
.year-wrapper { flex: 0.5; }

/* 时间轴 */
.timeline-year { 
    margin-bottom: 32px; 
    border-left: 3px dashed #E0D4D0; 
    padding-left: 10px; 
    margin-left: 0;
}
.year-title { color: #8D6E63; margin-bottom: 16px; position: relative; font-size: 1.5rem; font-family: 'Comic Sans MS', cursive;}
.year-title::before { 
    content: ''; position: absolute; left: -20px; top: 8px; width: 14px; height: 14px; 
    border-radius: 50%; background: #FFD27F; border: 3px solid #FFF; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.album-card { 
    background: rgba(255,255,255,0.9); 
    border-radius: 20px; 
    overflow: hidden; 
    margin-bottom: 16px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.04);
}
.album-info { padding: 16px; border-bottom: 1px solid #f0f0f0; }
.album-info h4 { color: #5D4037; font-size: 1.1rem; margin-bottom: 4px; }
.album-info p { color: #9E9E9E; font-size: 0.85rem; }

.album-tags { display: flex; padding: 8px 12px; gap: 8px; background: #FAFAFA; }
.tag { font-size: 0.8rem; padding: 4px 10px; background: #E0E0E0; color: #666; border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.tag.active { background: #FFCC80; color: #5D4037; font-weight: bold; }

.album-date-section { margin-top: 12px; padding-left: 16px; border-left: 2px solid #F0E6E6; }
.date-header { font-size: 0.95rem; color: #8D6E63; margin-bottom: 8px; }

.album-gallery { display: none; padding: 12px; }
.album-gallery.active { display: block; }
.gallery-placeholder { height: 120px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #999; }

/* 地图 Tooltip 样式 */
.custom-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px dashed #D7CCC8 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    padding: 6px 12px !important;
}
.custom-tooltip::before {
    border-top-color: #D7CCC8 !important;
}
