/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #F5F7FA;
  color: #333;
  line-height: 1.6;
}

/* 导航条样式 */
.navbar {
  background-color: #3B5F9E;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  min-width: 1000px;
}

/* 导航列表 */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.nav-list-right {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

/* 导航项样式 */
.nav-item {
  position: relative;
  margin: 0 5px;
}

.nav-item a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.nav-item a:hover {
  background-color: #4A6FB1;
}

/* 子菜单样式 */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  z-index: 9999;
  margin: 0;
  padding: 0;
}

.dropdown-menu li {
  display: block;
}

.dropdown-menu a {
  color: #333;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border-bottom: 1px solid #F0EDFF;
}

.dropdown-menu a:hover {
  background-color: #F0EDFF;
  color: #3B5F9E;
}

/* 鼠标悬停显示子菜单 */
.nav-item.dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* 淡入动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 页面容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 标题样式 */
h1 {
  color: #2D4A7F;
  margin-bottom: 24px;
  font-size: 28px;
  font-weight: 600;
  border-bottom: 2px solid #7B68EE;
  padding-bottom: 10px;
  display: inline-block;
}

h2 {
  color: #7B68EE;
  margin: 30px 0 15px;
  font-size: 22px;
  font-weight: 500;
  border-left: 4px solid #3B5F9E;
  padding-left: 12px;
}

/* 日记卡片样式 */
.diary-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.diary-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.diary-title {
  font-size: 20px;
  font-weight: 600;
  color: #3B5F9E;
  margin-bottom: 8px;
  border-left: 3px solid #7B68EE;
  padding-left: 10px;
}

.diary-date {
  color: #888;
  font-size: 14px;
  margin-bottom: 12px;
  display: block;
}

.diary-content {
  color: #555;
  line-height: 1.8;
}

/* 作品页面区块样式 */
section {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

section:hover {
  transform: translateX(5px);
}

section p {
  color: #555;
  line-height: 1.8;
}

/* 登录页面样式 */
.login-container {
  max-width: 400px;
  margin: 50px auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  border-color: #3B5F9E;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 95, 158, 0.2);
}

button {
  background-color: #3B5F9E;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #2D4A7F;
}

.error {
  color: #E53935;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #FFF8F8;
  border-radius: 4px;
}

.success {
  color: #43A047;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #F1F8E9;
  border-radius: 4px;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}