/*AI还是太强了，定制了个css了属于是？*/
/* 基础重置与全局设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  scroll-behavior: smooth;
}

/* body样式 */
body {
  background: linear-gradient(90deg, #C7C5F4, #776BCC);
  font: 16px arial,'Microsoft Yahei','Hiragino Sans GB',sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* 标题样式 */
h1 {
  color: #fff;
  text-align: center;
  margin: 0 0 1.5rem;
  padding: 0.8rem;
  border-radius: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 2rem;
}

/* 导航栏样式（增强与内容的区分度） */
.nav-links {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin: 0 0 2.5rem; /* 增加底部间距，拉开与内容距离 */
  padding: 1rem;
  background-color: #fff; /* 纯白带实色，与内容区形成对比 */
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.12); /* 加深阴影，强化悬浮感 */
  border-bottom: 3px solid #5b4fff; /* 底部特色色边框，增加标识性 */
}

/* 导航按钮样式 */
.nav-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
}

.nav-login { color: #3498db; --hover-color: #3498db; }
.nav-register { color: #2980b9; --hover-color: #2980b9; }
.nav-name { color: #31c1cb; --hover-color: #31c1cb; }
.nav-post { color: #27ae60; --hover-color: #27ae60; }
.nav-logout { color: #c0392b; --hover-color: #c0392b; }
.nav-change { color: #2980b9; --hover-color: #2980b9; }

.nav-btn:hover {
  color: #fff;
  background-color: var(--hover-color);
  transform: none;
  box-shadow: none;
}

/* 内容区域与导航的分隔处理 */
.message-content, .no-message {
  position: relative;
  margin-top: 1.8rem; /* 顶部预留空间给分隔线 */
  white-space: pre-wrap;    /* 保留换行符，同时自动换行 */
  word-wrap: break-word;    /* 允许在单词内换行（兼容旧浏览器） */
  overflow-wrap: break-word;/* 现代浏览器推荐，强制换行 */
  max-width: 100%;  
}

.message-content::before, .no-message::before {
  content: '';
  position: absolute;
  top: -1.5rem;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); /* 中间深两边浅的分隔线 */
}

/* 无留言提示样式 */
.no-message {
  text-align: center;
  padding: 2.5rem 1rem;
  background-color: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  color: #666;
  font-size: 1.1rem;
}

/* 留言内容样式 */
.message-content {
  background-color: rgba(255,255,255,0.95);
  padding: 1.5rem;
  border-radius: 8px 8px 0 0;
  color: #333;
  line-height: 1.8;
  font-size: 1.05rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 留言元信息样式 */
.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: rgba(255,255,255,0.9);
  border-radius: 0 0 8px 8px;
  margin-bottom: 1.8rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.04);
  border-top: 1px solid #f0f0f0;
}

.message-author {
  color: #2980b9;
  font-weight: 600;
}

.message-time {
  color: #888;
  font-style: italic;
}

/* 以下为保留的其他样式（未修改） */
/* 段落样式优化 */
p {
  margin-bottom: 1.2rem;
  line-height: 1.7;
  color: #444;
  letter-spacing: 0.02em;
}

/* 链接样式优化（非导航链接） */
a:not(.nav-btn) {
  color: #2563eb;
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

a:not(.nav-btn)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #2563eb;
  transition: width 0.25s ease;
}

a:not(.nav-btn):hover {
  color: #1d4ed8;
  text-decoration: none;
}

a:not(.nav-btn):hover::after {
  width: 100%;
}

a:not(.nav-btn):visited {
  color: #6366f1;
}

/* 表单样式优化 */
form {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 500;
  color: #1f2937;
  font-size: 0.95rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.2rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: #fff;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
  border-width: 1.5px;
}

input::placeholder, textarea::placeholder {
  color: #9ca3af;
  font-style: italic;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* 按钮样式优化（非导航按钮） */
button, input[type="submit"], input[type="button"] {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background-color: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  width: auto;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15);
}

button:active, input[type="submit"]:active, input[type="button"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(37, 99, 235, 0.1);
}

button:disabled, input[type="submit"]:disabled, input[type="button"]:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 其他原有元素样式保持不变 */
h2, h3, h4, h5, h6 {
  margin: 1.5rem 0 1rem;
  line-height: 1.2;
  color: #222;
  text-align: center;
}

ul, ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: 0.5rem;
}

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background-color: #f8f9fa;
  border-radius: 4px;
}

code {
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
}

tr:hover {
  background-color: #f8f9fa;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 1.5rem 0;
}

blockquote {
  border-left: 4px solid #ddd;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 0.6rem;
  }
}

@media (max-width: 600px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .nav-btn {
    display: block;
    text-align: center;
    width: 100%;
  }
  
  .message-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
.captcha-container {
    text-align: center; /* 关键：让内部元素水平居中 */
    /* margin: 15px 0; 上下间距，可选 */
}