/* 
 * 大坨犯罪日记 - 样式文件
 * 此文件包含整个留言板应用的所有样式
 * 包括:
 * - 页面基础样式
 * - 留言板样式
 * - 表单样式
 * - 按钮样式
 * - 消息列表样式
 * - 登录/注册界面样式
 * - 管理员面板样式
 * - 背景特效
 */

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

body {
    background-color: #0a0723;
    color: #ffe6ff;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.message-board {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(30, 10, 60, 0.9);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(255, 179, 245, 0.8), 0 0 40px rgba(190, 61, 255, 0.5);
    border: 2px solid rgba(255, 179, 245, 0.6);
    position: relative;
    z-index: 10;
}

.message-board::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    background: linear-gradient(45deg, #ff69b4, #be3dff, #ff94f0, #8a2be2);
    border-radius: 15px;
    filter: blur(10px);
    opacity: 0.8;
    animation: glowingBorder 3s linear infinite;
}

@keyframes glowingBorder {
    0% { filter: blur(10px); opacity: 0.5; }
    50% { filter: blur(15px); opacity: 0.8; }
    100% { filter: blur(10px); opacity: 0.5; }
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffe6ff;
    text-shadow: 0 0 10px #ffb3f5, 0 0 20px #ffb3f5, 0 0 30px #be3dff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.8; transform: scale(1); }
}

.message-form {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.message-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 179, 245, 0.5);
    border-radius: 10px;
    color: #ffe6ff;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    min-height: 100px;
}

.message-form textarea:focus {
    outline: none;
    border-color: #ff94f0;
    box-shadow: 0 0 10px rgba(255, 179, 245, 0.5);
}

/* 底部工具栏 */
.message-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 按钮容器 */
.message-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.message-form button[type="submit"] {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
    margin-left: 15px;
}

.message-form button[type="submit"]:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

.message-form button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-list {
    margin-top: 30px;
}

.message-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 179, 245, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.message-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 179, 245, 0.3);
}

.message-item p {
    color: #ffe6ff;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.message-time {
    color: #ffb3f5;
    font-size: 0.9rem;
    text-shadow: 0 0 5px #be3dff;
}

/* 返回按钮 */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 179, 245, 0.5);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

/* 背景效果 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 4s infinite;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* 登录相关样式 */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 7, 35, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-box {
    background-color: rgba(30, 10, 60, 0.9);
    padding: 30px;
    border-radius: 15px;
    width: 400px;
    box-shadow: 0 0 20px rgba(255, 179, 245, 0.8);
    border: 2px solid rgba(255, 179, 245, 0.6);
    position: relative;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    background: linear-gradient(45deg, #ff69b4, #be3dff, #ff94f0, #8a2be2);
    border-radius: 15px;
    filter: blur(10px);
    opacity: 0.8;
    animation: glowingBorder 3s linear infinite;
}

.auth-title {
    text-align: center;
    margin-bottom: 20px;
    color: #ffe6ff;
    text-shadow: 0 0 10px #ffb3f5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-input {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 179, 245, 0.5);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffe6ff;
    font-size: 1rem;
}

.auth-input:focus {
    outline: none;
    border-color: #ff94f0;
    box-shadow: 0 0 10px rgba(255, 179, 245, 0.5);
}

.auth-button {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-button:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.02);
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    color: #ffb3f5;
    cursor: pointer;
    text-decoration: underline;
}

.user-info {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 179, 245, 0.5);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: bold;
    color: #ffb3f5;
    text-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

.logout-button {
    background: none;
    border: none;
    color: #ffb3f5;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.user-info .user-role {
    background-color: rgba(255, 179, 245, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.user-role.admin {
    background-color: rgba(255, 105, 180, 0.5);
}

/* 设置按钮风格 */
.settings-button {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.settings-button:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

/* 用户名设置弹窗样式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: rgba(30, 10, 60, 0.9);
    border: 2px solid rgba(255, 179, 245, 0.6);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(255, 179, 245, 0.8), 0 0 40px rgba(190, 61, 255, 0.5);
    color: #ffe6ff;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    background: linear-gradient(45deg, #ff69b4, #be3dff, #ff94f0, #8a2be2);
    border-radius: 15px;
    filter: blur(10px);
    opacity: 0.8;
    animation: glowingBorder 3s linear infinite;
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffe6ff;
    text-shadow: 0 0 10px #ffb3f5;
}

.username-form {
    margin: 20px 0;
}

.input-group {
    display: flex;
    margin: 15px 0;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(255, 179, 245, 0.5);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffe6ff;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #ff94f0;
    box-shadow: 0 0 10px rgba(255, 179, 245, 0.5);
}

.input-group button {
    padding: 12px 15px;
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-group button:hover {
    background-color: rgba(190, 61, 255, 0.5);
}

.input-group button:disabled {
    background-color: rgba(90, 61, 155, 0.3);
    cursor: not-allowed;
    opacity: 0.7;
}

.close-button {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
}

.close-button:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

.notice {
    color: #ffcc00;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.3);
    text-align: center;
    margin-top: 10px;
}

/* 删除按钮样式 */
.delete-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: rgba(255, 107, 107, 0.2);
    color: #ff3333;
}

.message-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

/* 图片上传和显示样式 */
.file-upload {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.file-upload-btn {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 10px;
    white-space: nowrap;
    display: inline-block;
}

.file-upload-btn:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    position: relative;
}

.image-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.clear-image {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
    line-height: 1;
    position: absolute;
    top: 5px;
    right: 5px;
}

.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.message-image:hover {
    opacity: 0.9;
}

.upload-progress {
    color: #ffb3f5;
    margin-left: 10px;
}

.auth-role-selector {
    margin-bottom: 15px;
    color: #ffe6ff;
}

.auth-role-selector label {
    display: block;
    margin-bottom: 5px;
}

/* 管理员控制面板 */
.admin-panel {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(30, 10, 60, 0.9);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 179, 245, 0.8);
    border: 2px solid rgba(255, 179, 245, 0.6);
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.admin-panel h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffe6ff;
    text-shadow: 0 0 10px #ffb3f5;
    user-select: text;
    -webkit-user-select: text;
}

.user-list-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.user-list-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.admin-button {
    background-color: rgba(190, 61, 255, 0.3);
    color: #ffe6ff;
    border: 2px solid rgba(255, 179, 245, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.admin-button:hover {
    background-color: rgba(190, 61, 255, 0.5);
    transform: scale(1.05);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    color: #ffe6ff;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.user-table th, .user-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 179, 245, 0.3);
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
}

.user-table th {
    background-color: rgba(190, 61, 255, 0.3);
    font-weight: bold;
}

.user-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.promote-button, .demote-button, .edit-button, .delete-button, .action-btn {
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid;
    margin-right: 5px;
    /* 确保按钮可点击性 */
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    z-index: 30;
    position: relative;
}

.promote-button {
    background-color: rgba(75, 181, 67, 0.3);
    color: #b4ffb4;
    border-color: rgba(75, 181, 67, 0.5);
}

.promote-button:hover {
    background-color: rgba(75, 181, 67, 0.5);
}

.demote-button {
    background-color: rgba(255, 107, 107, 0.3);
    color: #ffb3b3;
    border-color: rgba(255, 107, 107, 0.5);
}

.demote-button:hover {
    background-color: rgba(255, 107, 107, 0.5);
}

.edit-button {
    background-color: rgba(255, 194, 10, 0.3);
    color: #ffe0a3;
    border-color: rgba(255, 194, 10, 0.5);
}

.edit-button:hover {
    background-color: rgba(255, 194, 10, 0.5);
}

.delete-button {
    background-color: rgba(238, 58, 67, 0.3);
    color: #ffb3b3;
    border-color: rgba(238, 58, 67, 0.5);
}

.delete-button:hover {
    background-color: rgba(238, 58, 67, 0.5);
}

/* 确保操作单元格中的按钮正常显示和工作 */
.user-table td.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
    z-index: 25;
    pointer-events: auto !important;
    overflow: visible;
}

/* 确保操作按钮文本能够被选择 */
.action-btn {
    color: inherit;
    font-family: inherit;
    text-align: center;
    text-rendering: auto;
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
    cursor: pointer;
    pointer-events: auto !important;
}

@media (max-width: 768px) {
    .user-table td.action-cell {
        display: flex;
        flex-direction: column;
    }
    
    .promote-button, .demote-button, .edit-button, .delete-button, .action-btn {
        margin-bottom: 5px;
        width: 100%;
        text-align: center;
    }
}

.loading-indicator {
    text-align: center;
    padding: 15px;
    color: #ffb3f5;
}

.message-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.message-images-container .message-image {
    max-width: calc(33% - 10px);
    height: auto;
    object-fit: cover;
}

@media (max-width: 600px) {
    .message-images-container .message-image {
        max-width: calc(50% - 5px);
    }
}

/* 错误消息样式 */
.error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
} 
