* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

body {
  background-color: #f5f5f5;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

h2 {
  color: #444;
  margin-bottom: 20px;
  font-size: 18px;
}

.form-box {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.form-item {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 14px;
}

input, textarea {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  color: #333;
  resize: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 5px rgba(66, 133, 244, 0.3);
}

.submit-btn {
  background-color: #4285f4;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.submit-btn:hover {
  background-color: #3367d6;
}

.messages-list {
  margin-top: 20px;
}

.message-item {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  border-left: 3px solid #4285f4;
}

.message-item .username {
  font-weight: bold;
  color: #4285f4;
  margin-bottom: 5px;
  font-size: 15px;
}

.message-item .time {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.message-item .content {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.empty-tip {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 30px 0;
}

/* 登录弹窗样式 */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.login-btn {
  background-color: #4285f4;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  width: 100%;
  margin-top: 10px;
}

.login-btn:hover {
  background-color: #3367d6;
}

.login-tip {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-top: 15px;
}

/* 退出登录按钮样式 */
.logout-box {
  text-align: right;
  margin-bottom: 20px;
}

.logout-btn {
  background-color: #ea4335;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background-color: #d33426;
}

/* 当前登录用户提示样式 */
.login-user-tip {
  color: #4285f4;
  margin-right: 15px;
  font-size: 14px;
}

/* 管理员删除按钮样式 */
.delete-btn {
  background-color: #dc3545;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  float: right;
  transition: background-color 0.3s;
}

.delete-btn:hover {
  background-color: #bb2d3b;
}

/* 清除浮动，避免布局错乱 */
.message-item {
  overflow: hidden;
}


/* 清空所有留言按钮样式 */
.clear-all-btn {
  background-color: #ffc107;
  color: #212529;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 15px;
  transition: background-color 0.3s;
}

.clear-all-btn:hover {
  background-color: #ffb300;
}

/* 分页控件样式 */
.pagination {
  margin-top: 30px;
  text-align: center;
  font-size: 14px;
}

.pagination-btn {
  background-color: #4285f4;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 5px;
  transition: background-color 0.3s;
}

.pagination-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #3367d6;
}

.pagination-info {
  color: #666;
  margin: 0 10px;
}

/* 留言提交加载提示样式 */
.submit-loading {
  margin-top: 10px;
  color: #4285f4;
  font-size: 14px;
  text-align: center;
  padding: 8px 0;
}

.submit-loading {
  margin-top: 15px;
  color: #4285f4;
  font-size: 14px;
  text-align: center;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  display: block !important;
  visibility: visible !important;
  z-index: 10; /* 提升层级，避免被遮挡 */
  position: relative; /* z-index生效需要配合定位 */
}


/* 自定义弹窗基础样式 */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.custom-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

.modal-body {
  padding: 24px 20px;
  font-size: 16px;
  color: #555;
  line-height: 1.5;
}

.modal-footer {
  padding: 12px 20px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: #e9ecef;
  color: #666;
}

.cancel-btn:hover {
  background: #dee2e6;
}

.confirm-btn {
  background: #007bff;
  color: #fff;
}

.confirm-btn:hover {
  background: #0069d9;
}

/* 加载中弹窗样式 */
.loading-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.loading-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* 只显示确认按钮的样式 */
.modal-footer.single-btn {
  justify-content: center;
}

.modal-footer.single-btn .cancel-btn {
  display: none;
}