/* ==================== 基础重置与变量 ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* 春季清新配色 */
    --bg-primary: #FFFBF5;
    --bg-secondary: #FFF8F0;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72);
    
    --mdb-primary: #81D8B8;
    --mdb-light: #A8E8CF;
    --mdb-dark: #5EC49A;
    
    --fjd-primary: #FFB8C9;
    --fjd-light: #FFD4DE;
    --fjd-dark: #F28DA3;
    
    --sky-blue: #A0D8EF;
    --lemon-yellow: #FFE8A0;
    --lavender: #E2D5F5;
    
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-tertiary: #B2BEC3;
    --text-muted: #95A5A6;
    
    --shadow-soft: 0 4px 20px rgba(129, 216, 184, 0.08);
    --shadow-card: 0 8px 32px rgba(45, 52, 54, 0.06);
    --shadow-fab: 0 6px 24px rgba(129, 216, 184, 0.35);
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        max-width: 640px;
        padding: 0 24px;
    }
}

/* ==================== 春季柔和背景 ==================== */
.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%, #FFF9F2 100%);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: blobFloat 20s ease-in-out infinite;
}

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

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

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--sky-blue);
    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: 60px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 5;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

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

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

.refresh-icon {
    font-size: 24px;
    margin-bottom: 4px;
    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-tertiary);
    font-weight: 500;
}

/* ==================== 头部 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 10px 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(129, 216, 184, 0.12);
}

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

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.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;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(129, 216, 184, 0.15);
}

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

.online-dot.online {
    background: #81D8B8;
    animation: dotPulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(129, 216, 184, 0.5);
}

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

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

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

/* ==================== 主内容区 ==================== */
.main {
    position: relative;
    z-index: 1;
    padding-top: calc(70px + env(safe-area-inset-top));
    padding-bottom: 100px;
    min-height: 100vh;
}

/* ==================== 骨架屏 ==================== */
.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;
}

/* ==================== 留言卡片 ==================== */
.message-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    animation: cardSpringIn 0.5s var(--transition-spring);
    transition: transform 0.2s, box-shadow 0.2s;
}

.message-card:active {
    transform: scale(0.985);
}

@keyframes cardSpringIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.message-author {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.message-card[data-author="MDB"] .author-avatar {
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-dark));
}

.message-card[data-author="FJD"] .author-avatar {
    background: linear-gradient(135deg, var(--fjd-primary), var(--fjd-dark));
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* 删除按钮 - 右上角 */
.btn-delete {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 50%;
    color: #EF4444;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
    z-index: 10;
}

.btn-delete:active {
    background: #EF4444;
    color: white;
    transform: scale(0.85);
}

.author-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.message-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.message-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* ==================== 左滑删除 ==================== */
.message-card.deleting {
    background: #EF4444 !important;
}

.message-card.deleting .message-header,
.message-card.deleting .message-content,
.message-card.deleting .message-images,
.message-card.deleting .message-footer {
    opacity: 0;
}

.message-card.deleting::after {
    content: '删除';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

/* 撤销删除 Toast */
.toast.undo-delete-toast {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(45, 52, 54, 0.92);
    white-space: normal;
}

.toast.undo-delete-toast .undo-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 8px;
}

.toast.undo-delete-toast .undo-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================== 图片网格 ==================== */
.message-images {
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.images-grid {
    display: grid;
    gap: 6px;
}

.images-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
}

/* 1 张图 - 保持原比例完整显示 */
.images-grid.count-1 {
    grid-template-columns: 1fr;
}

.images-grid.count-1 img {
    height: auto;
    max-height: 400px;
    object-fit: contain;
    aspect-ratio: auto;
}

/* 2 张图 - 左右均分 1:1 */
.images-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

.images-grid.count-2 img {
    aspect-ratio: 1;
}

/* 3 张图 - 第一张跨整行大图，下面两张 1:1 */
.images-grid.count-3 {
    grid-template-columns: 1fr 1fr;
}

.images-grid.count-3 img:nth-child(1) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}

.images-grid.count-3 img:nth-child(2),
.images-grid.count-3 img:nth-child(3) {
    aspect-ratio: 1;
}

/* 4 张图 - 2×2 均匀网格 */
.images-grid.count-4 {
    grid-template-columns: 1fr 1fr;
}

.images-grid.count-4 img {
    aspect-ratio: 1;
}

/* 5 张图 - 第一行 2 张大图，第二行 3 张小图 */
.images-grid.count-5 {
    grid-template-columns: repeat(6, 1fr);
}

.images-grid.count-5 img:nth-child(1),
.images-grid.count-5 img:nth-child(2) {
    grid-column: span 3;
    aspect-ratio: 16 / 10;
}

.images-grid.count-5 img:nth-child(3),
.images-grid.count-5 img:nth-child(4),
.images-grid.count-5 img:nth-child(5) {
    grid-column: span 2;
    aspect-ratio: 1;
}

/* 6 张图 - 2 行 3 列 */
.images-grid.count-6 {
    grid-template-columns: repeat(3, 1fr);
}

.images-grid.count-6 img {
    aspect-ratio: 1;
}

/* PC 端适配 */
@media (min-width: 768px) {
    .images-grid {
        gap: 8px;
    }

    /* 1 张图 - 更高显示 */
    .images-grid.count-1 img {
        max-height: 600px;
    }

    /* 2 张图 */
    .images-grid.count-2 img {
        aspect-ratio: 1;
    }

    /* 3 张图 */
    .images-grid.count-3 img:nth-child(1) {
        aspect-ratio: 16 / 9;
    }

    .images-grid.count-3 img:nth-child(2),
    .images-grid.count-3 img:nth-child(3) {
        aspect-ratio: 1;
    }

    /* 4 张图 */
    .images-grid.count-4 img {
        aspect-ratio: 1;
    }

    /* 5 张图 */
    .images-grid.count-5 img:nth-child(1),
    .images-grid.count-5 img:nth-child(2) {
        aspect-ratio: 16 / 10;
    }

    .images-grid.count-5 img:nth-child(3),
    .images-grid.count-5 img:nth-child(4),
    .images-grid.count-5 img:nth-child(5) {
        aspect-ratio: 1;
    }

    /* 6 张图 */
    .images-grid.count-6 img {
        aspect-ratio: 1;
    }
}

/* ==================== 留言底部操作栏 ==================== */
.message-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.btn-like {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius-pill);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: visible;
}

.btn-like:active {
    transform: scale(0.95);
}

.btn-like.liked {
    background: rgba(255, 184, 201, 0.12);
    border-color: rgba(255, 184, 201, 0.3);
    color: var(--fjd-dark);
}

.like-icon {
    font-size: 15px;
    transition: transform 0.3s var(--transition-spring);
}

.btn-like.liked .like-icon {
    animation: heartPop 0.4s var(--transition-spring);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.5); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 点赞粒子容器 */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 0.6s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}


/* ==================== 加载状态 ==================== */
.load-more {
    text-align: center;
    margin-top: 20px;
}

.btn-load-more {
    padding: 12px 28px;
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.btn-load-more:active {
    background: var(--mdb-light);
    color: var(--mdb-dark);
    border-color: rgba(129, 216, 184, 0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-text {
    font-size: 15px;
    font-weight: 500;
}

/* ==================== 悬浮发布按钮 ==================== */
.fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-dark));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-fab);
    transition: transform 0.3s var(--transition-spring), opacity 0.3s;
    z-index: 90;
    animation: fabBreathe 3s ease-in-out infinite;
}

.fab svg {
    width: 26px;
    height: 26px;
}

@keyframes fabBreathe {
    0%, 100% { box-shadow: 0 6px 24px rgba(129, 216, 184, 0.35); transform: scale(1); }
    50% { box-shadow: 0 8px 32px rgba(129, 216, 184, 0.45); transform: scale(1.03); }
}

.fab:active {
    transform: scale(0.92) !important;
}

.fab.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ==================== 底部 Sheet 面板 ==================== */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sheet {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-sheet);
    z-index: 160;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 2px;
    margin: 10px auto 6px;
    opacity: 0.35;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.nickname-selector {
    display: flex;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 3px;
}

.nickname-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nickname-btn.active[data-value="MDB"] {
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-dark));
    color: white;
    box-shadow: 0 3px 12px rgba(129, 216, 184, 0.3);
}

.nickname-btn.active[data-value="FJD"] {
    background: linear-gradient(135deg, var(--fjd-primary), var(--fjd-dark));
    color: white;
    box-shadow: 0 3px 12px rgba(255, 184, 201, 0.35);
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0,0,0,0.03);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sheet-close svg {
    width: 18px;
    height: 18px;
}

.sheet-close:active {
    background: rgba(0,0,0,0.06);
    transform: scale(0.92);
}

.sheet-form {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.sheet-textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.7;
    resize: none;
    min-height: 100px;
    font-family: inherit;
    outline: none;
}

.sheet-textarea::placeholder {
    color: var(--text-tertiary);
}

.sheet-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

/* ==================== Sheet 内图片预览网格 ==================== */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-remove:active {
    background: rgba(239, 68, 68, 0.85);
}

.preview-add-btn {
    aspect-ratio: 1;
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.preview-add-btn:active {
    border-color: var(--mdb-primary);
    color: var(--mdb-dark);
    background: rgba(129, 216, 184, 0.06);
}

.preview-add-btn svg {
    width: 24px;
    height: 24px;
}

.add-text {
    font-size: 11px;
    font-weight: 500;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.sheet-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-dark));
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
    box-shadow: 0 4px 16px rgba(129, 216, 184, 0.3);
}

.sheet-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sheet-submit:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(129, 216, 184, 0.25);
}

/* ==================== 图片灯箱 ==================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-close svg,
.lightbox-nav svg {
    width: 22px;
    height: 22px;
}

.lightbox-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-nav:active {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    object-fit: contain;
    transition: transform 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-counter {
    position: absolute;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    color: white;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
}

/* 灯箱切换动画 */
.lightbox-content img.swiping-left {
    animation: swipeLeft 0.25s ease;
}
.lightbox-content img.swiping-right {
    animation: swipeRight 0.25s ease;
}

@keyframes swipeLeft {
    from { transform: translateX(50px); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes swipeRight {
    from { transform: translateX(-50px); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    padding: 10px 22px;
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.35s var(--transition-spring);
    box-shadow: var(--shadow-card);
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: rgba(129, 216, 184, 0.15);
    border-color: rgba(129, 216, 184, 0.25);
    color: var(--mdb-dark);
}

.toast.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #e74c3c;
}

.toast.info {
    background: rgba(160, 216, 239, 0.15);
    border-color: rgba(160, 216, 239, 0.25);
    color: #3498db;
}

/* ==================== 页脚 ==================== */
.footer {
    position: relative;
    padding: 24px 0 32px;
    text-align: center;
    z-index: 1;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }
}

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

/* ==================== 响应式优化 ==================== */
@media (max-width: 375px) {
    .logo-text {
        font-size: 16px;
    }
    
    .online-label {
        display: none;
    }
    
    .message-card {
        padding: 14px;
    }
    
    .author-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .message-content {
        font-size: 14px;
    }
    
    .images-grid.count-2 img { aspect-ratio: 1; }
    .images-grid.count-3 img:nth-child(1) { aspect-ratio: 16 / 9; }
    .images-grid.count-3 img:nth-child(2),
    .images-grid.count-3 img:nth-child(3) { aspect-ratio: 1; }
    .images-grid.count-4 img { aspect-ratio: 1; }
    .images-grid.count-5 img:nth-child(1),
    .images-grid.count-5 img:nth-child(2) { aspect-ratio: 16 / 10; }
    .images-grid.count-5 img:nth-child(3),
    .images-grid.count-5 img:nth-child(4),
    .images-grid.count-5 img:nth-child(5) { aspect-ratio: 1; }
    .images-grid.count-6 img { aspect-ratio: 1; }
}

@media (min-width: 768px) {
    .main {
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-bottom: 120px;
    }
    
    .header {
        padding: 14px 0;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .message-card {
        padding: 20px;
        border-radius: var(--radius-xl);
    }
    
    .author-avatar {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }
    
    .sheet {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    
    .sheet.active {
        transform: translateX(-50%) translateY(0);
    }
    
    .fab {
        width: 60px;
        height: 60px;
        right: calc(50% - 300px + 24px);
    }
    
    .fab svg {
        width: 28px;
        height: 28px;
    }
}

/* ==================== 长按菜单 ==================== */
.longpress-menu {
    position: fixed;
    display: none;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    overflow: hidden;
    animation: menuSlideIn 0.15s ease;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.longpress-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.longpress-menu-item:active {
    background: rgba(239, 68, 68, 0.08);
}

.longpress-menu-item:first-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.menu-item-icon {
    font-size: 18px;
    line-height: 1;
}

.menu-item-text {
    font-size: 14px;
    color: #EF4444;
    font-weight: 600;
}

/* ==================== 触摸优化 ==================== */
@media (hover: none) {
    .btn-like:hover,
    .btn-load-more:hover,
    .message-card:hover {
        transform: none;
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.12);
}

/* ==================== 选中文字 ==================== */
::selection {
    background: rgba(129, 216, 184, 0.35);
    color: var(--text-primary);
}

/* ==================== 安全区域 ==================== */
@supports (padding-top: env(safe-area-inset-top)) {
    .main {
        padding-top: calc(70px + env(safe-area-inset-top));
    }
    
    .toast {
        top: calc(70px + env(safe-area-inset-top));
    }
}

/* ==================== 身份引导层 ==================== */
.onboarding {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.onboarding.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.onboarding-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #FFF9F2 100%);
}

.onboarding-bg .bg-blob {
    filter: blur(90px);
    opacity: 0.5;
}

.onboarding .petals-container {
    z-index: 1;
}

.onboarding-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    text-align: center;
    animation: onboardingIn 0.7s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes onboardingIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(255, 184, 201, 0.3));
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.onboarding-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.onboarding-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 500;
}

.identity-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.identity-card {
    position: relative;
    width: 100%;
    padding: 28px 20px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    overflow: hidden;
}

.identity-card:active {
    transform: scale(0.96);
}

.identity-card.mdb {
    border: 2px solid rgba(129, 216, 184, 0.35);
}

.identity-card.fjd {
    border: 2px solid rgba(255, 184, 201, 0.4);
}

.identity-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(129, 216, 184, 0.12), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.identity-card.fjd .identity-glow {
    background: radial-gradient(circle at 50% 50%, rgba(255, 184, 201, 0.15), transparent 50%);
}

.identity-card:hover .identity-glow,
.identity-card:focus .identity-glow {
    opacity: 1;
}

.identity-icon {
    font-size: 44px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.identity-card:hover .identity-icon,
.identity-card:focus .identity-icon {
    transform: scale(1.1);
}

.identity-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.identity-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.onboarding-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 身份卡片选择后的消失动画 */
.onboarding.exiting .onboarding-content {
    animation: onboardingOut 0.4s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes onboardingOut {
    to {
        opacity: 0;
        transform: scale(1.05);
    }
}

/* PC 端引导层并排卡片 */
@media (min-width: 768px) {
    .identity-cards {
        flex-direction: row;
        gap: 20px;
    }
    
    .identity-card {
        flex: 1;
        padding: 36px 20px;
    }
    
    .onboarding-title {
        font-size: 36px;
    }
}
/* ==================== 密码验证界面 ==================== */
.password-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: onboardingIn 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.password-content {
    width: 100%;
    max-width: 360px;
    padding: 24px;
    text-align: center;
}

.password-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: iconFloat 3s ease-in-out infinite;
}

.password-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.password-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.password-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-lg);
    font-size: 17px;
    text-align: center;
    letter-spacing: 3px;
    background: var(--bg-card);
    color: var(--text-primary);
    margin-bottom: 24px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.password-input:focus {
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 4px rgba(129, 216, 184, 0.12);
}

.password-input::placeholder {
    color: var(--text-tertiary);
    letter-spacing: normal;
    font-size: 15px;
}

.password-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.password-back,
.password-submit {
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    font-family: inherit;
}

.password-back {
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary);
}

.password-submit {
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(129, 216, 184, 0.3);
}

.password-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.password-back:active {
    background: rgba(0,0,0,0.08);
}

.password-submit:active:not(:disabled) {
    transform: scale(0.96);
}

@media (min-width: 768px) {
    .password-title {
        font-size: 28px;
    }
    .password-content {
        padding: 32px;
    }
}

/* ==================== 密码错误抖动动画 ==================== */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}
