body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-family: Arial, sans-serif;
    background-image: url('{{ url_for('static', filename='img/background.jpg') }}');
}

.content {
    width: 43%;
    background-color: white;
    box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    padding: 20px;
    margin: 0 auto;
}

.publish-button {
    margin: 10px 10px 10px 85%;
    display: block;
    padding: 10px 20px;
    background-color: #a7b6a8;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 3px;
}

.publish-button-2 {
    display: block;
    padding: 10px 20px;
    background-color: #a7b6a8;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 3px;
}

.publish-button:hover {
    background-color: #45a049;
}

.publish-form {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border-radius: 8px;
}

.overlay-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.publish-form textarea {
    width: 100%;
    height: 100px;
    padding: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 20px;
    margin-top: 20px;
}

.image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background-color: #f5f5f5;
    cursor: pointer;
}

#confirmDeleteDialog {
    border-radius: 8px;
}

#confirmDeleteBtn, #cancelDeleteBtn {
    margin: 5px;
}

.image-container:hover {
    transform: scale(1.05); /* 图片容器和图片一起放大 */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: "经典隶变简", sans-serif;
    font-size: 1.2rem;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    z-index: 10000;
}

.image-preview img {
    max-width: 90vw;
    max-height: 90vh;
}

.image-container p {
    text-align: center;
    margin-top: 10px;
    font-family: "经典隶变简", sans-serif;
}

/* 全屏预览模态框样式 */
#fullscreenModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 半透明黑色背景 */
    overflow: auto;
}

/* Flash信息提醒 */
/* 增加淡出效果 */
.flashes {
    position: fixed;
    top: 20px;
    left: 45%;
    margin: 0 auto;
    z-index: 1000;
}

.flashes li {
    list-style: none;
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    margin-bottom: 5px;
    border-radius: 5px;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

/* 手机端的响应式优化 */
@media (max-width: 768px) {
    body {
        background-size: cover;
    }

    .content {
        width: 90%; /* 调整卡片宽度以适应小屏幕 */
        padding: 15px; /* 减少内边距以更好地利用空间 */
    }

    .publish-button {
        margin: 10px auto; /* 将按钮居中 */
        display: block;
        width: 80%; /* 增加按钮宽度，便于点击 */
    }

    .publish-form {
        width: 90%; /* 缩小表单宽度以适应手机屏幕 */
    }

    .gallery-grid {
        grid-template-columns: 1fr; /* 单列布局 */
        grid-gap: 10px; /* 减少网格间距 */
    }

    .image-preview {
        width: 90%; /* 缩小预览框宽度 */
        padding: 10px; /* 减少内边距 */
    }

    .image-preview img {
        max-width: 100%; /* 适应手机屏幕宽度 */
        max-height: 80vh; /* 限制高度 */
    }

    .flashes {
        left: 10%; /* 在手机端将flash信息居中 */
        width: 80%;
    }
}
