:root {
    /* Dark Mode Theme */
    --primary-pink: #d65d7a;
    --dark-pink: #e68a9f;
    --light-pink: #2c1f23;
    --bg-gradient: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
    --glass-bg: rgba(30, 30, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #e0e0e0;
    --heading-color: #f8a5c2;
    --input-bg: #2b2b2b;
    --input-border: #444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: radial-gradient(circle at top left, #1a1a1a, #121212, #0d0d0d);
    background-attachment: fixed;
    /* 全屏背景固定 */
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
    background-image:
        radial-gradient(#ffc0cb 2px, transparent 2px),
        radial-gradient(#ffb6c1 2px, transparent 2px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    animation: moveBackground 60s linear infinite;
}

@keyframes moveBackground {
    from {
        background-position: 0 0, 25px 25px;
    }

    to {
        background-position: 100px 100px, 125px 125px;
    }
}

/* 顶部导航 Glassmorphism */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
}

.glass-header.hidden {
    transform: translateY(-100%);
}

.glass-header h1 {
    font-family: 'ZCOOL KuaiLe', cursive;
    color: var(--heading-color);
    font-size: 1.8rem;
}

.post-btn {
    background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.6);
}

/* 主要内容区域 */
.container {
    max-width: 1200px;
    margin: 100px auto 40px;
    /* Top margin for header */
    padding: 0 1rem;
}

/* 瀑布流布局 CSS Columns 实现 */
.masonry-grid {
    column-count: 4;
    /* 默认4列 */
    column-gap: 1.5rem;
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* 卡片样式 */
.message-card {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    break-inside: avoid;
    /* 防止卡片被列断开 */
    display: inline-block;
    /* 配合 column 使用 */
    width: 100%;
    position: relative;
    overflow: hidden;
    color: var(--text-color);
}

.message-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
    background: rgba(40, 40, 40, 0.85);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nickname {
    font-weight: 700;
    color: var(--text-color);
}

.card-body p {
    line-height: 1.6;
    color: #ccc;
    font-size: 1rem;
    word-wrap: break-word;
}

.card-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffb7c5;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.like-btn:hover {
    transform: scale(1.2);
    color: #ff6b81;
}

/* 加载更多 */
.loading-more {
    text-align: center;
    padding: 2rem;
    color: var(--dark-pink);
    font-weight: 500;
    display: none;
    /* JS控制显示 */
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #252525;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
    outline: none;
    background: var(--input-bg);
    color: white;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-pink);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--heading-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #631e3f;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 3000;
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}