/* 夏日留言板 v3 - 背景装饰、下拉刷新、头部、主内容区、骨架屏 */
/* ==================== ćĽĺ­ŁćĺčćŻ ==================== */
.spring-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: var(--blob-opacity);
    animation: blobFloat 20s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}

.blob-1 {
    width: 360px;
    height: 360px;
    background: var(--accent-1);
    top: -120px;
    right: -120px;
    animation-delay: 0s;
}

.blob-2 {
    width: 320px;
    height: 320px;
    background: var(--accent-3);
    bottom: 10%;
    left: -100px;
    animation-delay: -7s;
}

.blob-3 {
    width: 280px;
    height: 280px;
    background: var(--accent-2);
    top: 40%;
    right: -80px;
    animation-delay: -14s;
}


@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ==================== éŁč˝čąçŁčŁéĽ° ==================== */
.petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -10%;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--fjd-light), var(--mdb-light));
    border-radius: 50% 0 50% 50%;
    opacity: 0.35;
    animation: fall linear infinite;
}

.petal:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; transform: rotate(30deg); }
.petal:nth-child(2) { left: 20%; animation-duration: 15s; animation-delay: 1s; transform: rotate(60deg); width: 8px; height: 8px; }
.petal:nth-child(3) { left: 30%; animation-duration: 10s; animation-delay: 3s; transform: rotate(15deg); background: var(--sky-blue); }
.petal:nth-child(4) { left: 40%; animation-duration: 14s; animation-delay: 2s; transform: rotate(45deg); width: 10px; height: 10px; }
.petal:nth-child(5) { left: 50%; animation-duration: 16s; animation-delay: 0s; transform: rotate(75deg); }
.petal:nth-child(6) { left: 60%; animation-duration: 11s; animation-delay: 4s; transform: rotate(20deg); width: 9px; height: 9px; background: var(--lemon-yellow); }
.petal:nth-child(7) { left: 70%; animation-duration: 13s; animation-delay: 1s; transform: rotate(50deg); }
.petal:nth-child(8) { left: 80%; animation-duration: 17s; animation-delay: 2s; transform: rotate(35deg); width: 7px; height: 7px; }
.petal:nth-child(9) { left: 90%; animation-duration: 12s; animation-delay: 3s; transform: rotate(65deg); background: var(--lavender); }
.petal:nth-child(10) { left: 15%; animation-duration: 14s; animation-delay: 5s; transform: rotate(40deg); width: 11px; height: 11px; }
.petal:nth-child(11) { left: 55%; animation-duration: 18s; animation-delay: 2s; transform: rotate(25deg); }
.petal:nth-child(12) { left: 85%; animation-duration: 10s; animation-delay: 6s; transform: rotate(55deg); width: 8px; height: 8px; }

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.35; }
    90% { opacity: 0.35; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ==================== ä¸ćĺˇć° ==================== */
.pull-refresh {
    position: fixed;
    top: calc(var(--header-h, 156px) + 10px);
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    z-index: 5;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    background: var(--bg-card);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(77, 208, 225, 0.16);
    box-shadow: var(--shadow-card);
}

.pull-refresh.active {
    opacity: 1;
    transform: translateY(0);
}

.pull-refresh.pulling {
    opacity: 1;
    transform: translateY(0);
}

.refresh-icon {
    font-size: 24px;
    transition: transform 0.2s;
}

.pull-refresh.pulling .refresh-icon {
    animation: petalSpin 1s linear infinite;
}

@keyframes petalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.refresh-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== ĺ¤´é¨ ==================== */
/* ==================== 头部（标题栏 + 心情栏一体固定） ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    padding: 6px 0 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(77, 208, 225, 0.12);
    display: flex;
    flex-direction: column;
    /* 标题栏与心情栏之间不留缝，两行共用同一块玻璃底 */
    gap: 0;
}

@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(8px + env(safe-area-inset-top));
    }
}

/* 头部第一行：标题贴左，徽章贴右。
   这里不复用 .container —— 后者在 ≥768px 会被 max-width:640px + margin:auto
   夹成居中窄条，space-between 的作用范围随之缩小，视觉上标题与徽章一起向
   屏幕中间收拢。改为自带左右内距，铺满头部整宽。 */
.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 22px;
    animation: leafSway 3s ease-in-out infinite;
}

@keyframes leafSway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* 头部右侧徽章区：主题徽章与在线状态横向排列 */
.header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(77, 208, 225, 0.15);
    flex-shrink: 0;
    white-space: nowrap;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: background 0.3s;
}

.online-dot.online {
    background: #4DD0E1;
    animation: dotPulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(77, 208, 225, 0.5);
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.7; }
}

.online-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.online-label.online {
    color: var(--mdb-dark);
}

/* ==================== ä¸ťĺĺŽšĺş ==================== */
.main {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--header-h, 156px) + 12px);
    /* padding-bottom: 70px; */
    /* 与 body 同理：dvh 跟随地址栏收放，vh 打底供旧内核回退（第 3 条） */
    min-height: 100vh;
    min-height: 100dvh;
}

/* ==================== éŞ¨ćśĺą?==================== */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.tiny { width: 25%; height: 10px; }
.skeleton-line.medium { width: 70%; }
.skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== çč¨ĺčĄ¨ ==================== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
    transition: opacity var(--transition-normal);
}

/* 下拉刷新进行中：保留旧内容，整体压暗提示 */
.messages-list.refreshing {
    opacity: 0.55;
    pointer-events: none;
}

/* 刷新完成后新内容淡入，盖住替换瞬间的跳变 */
.messages-list.just-refreshed {
    animation: listFadeIn 0.15s ease-out;
}

@keyframes listFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

