/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 主容器 */
.container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
}

/* 左侧表单区域 */
.form-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    text-align: center;
    color: #ff9a9e;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 0 0 10px rgba(255, 154, 158, 0.5);
}

/* 表单输入框 */
.form-group {
    margin-bottom: 20px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1em;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #ff9a9e;
    box-shadow: 0 0 10px rgba(255, 154, 158, 0.3);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* 文件上传样式 */
.file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 提交按钮 */
button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
}

/* 右侧留言展示区域 */
.messages-section {
    flex: 1;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* 隐藏滚动条 */
.messages-section::-webkit-scrollbar {
    width: 5px;
}

.messages-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.messages-section::-webkit-scrollbar-thumb {
    background: rgba(255, 154, 158, 0.5);
    border-radius: 10px;
}

/* 单条留言卡片 */
.message-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #ff9a9e;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    /* 关键修复：宽度自适应 */
    width: 100%;
    max-width: 400px;
    word-wrap: break-word;
}

.message-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.08);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 5px;
}

.message-name {
    color: #ff9a9e;
    font-weight: bold;
    font-size: 1.1em;
}

.message-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

.message-content {
    color: #fff;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

/* 留言中的图片 */
.message-image {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计 - 手机端适配 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }
    
    .form-section {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .messages-section {
        max-height: none;
        margin-top: 30px;
    }
    
    .message-item {
        max-width: 100%; /* 手机端占满全宽 */
    }
}